:root {
  --canvas: #e9ecef;
  --paper: #f3f4f2;
  --ink: #242a31;
  --muted: #68717b;
  --line: #d2d7dc;
  --line-strong: #c4cad1;
  --soft: #dfe3e6;
  --blue: #4f70c8;
  --blue-soft: #dfe6f5;
  --selection-line: #bec5cf;
  --selection-fill: var(--ink);
  --selection-ink: var(--paper);
  --green: #2f7d5b;
  --green-soft: #e5f2eb;
  --coral: #c95f49;
  --radius: 13px;
  --shell: min(1180px, calc(100% - 40px));
  --ease: cubic-bezier(.22, .76, .18, 1);
  --font-sans: "Noto Sans SC Variable", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --text-meta: 11px;
  --text-control: 12px;
  --text-support: 13px;
  --text-body: 14px;
}

html[data-effect-library-theme="dark"] {
  color-scheme: dark;
  --canvas: oklch(0.129 0.042 264.695);
  --paper: oklch(0.14 0.04 259.21);
  --ink: oklch(0.984 0.003 247.858);
  --muted: oklch(0.704 0.04 256.788);
  --line: rgb(255 255 255 / 7%);
  --line-strong: rgb(255 255 255 / 10%);
  --soft: rgb(255 255 255 / 2.5%);
  --blue: #475569;
  --blue-soft: rgb(148 163 184 / 12%);
  --selection-line: rgb(255 255 255 / 22%);
  --selection-fill: #1e293b;
  --selection-ink: #f8fafc;
  --green: #69a985;
  --green-soft: #20372c;
  --coral: #df806b;
}

html[data-effect-library-theme="gray"] .site-language-menu {
  border-color: rgba(18, 20, 23, .18);
  background: var(--paper);
  color: #171a1e;
  box-shadow: 0 18px 42px rgba(18, 20, 23, .14);
}

html[data-effect-library-theme="dark"] .site-language-menu {
  border-color: rgba(238, 240, 241, .18);
  background: #1d2126;
  color: #eef0f1;
  box-shadow: 0 20px 48px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  font: var(--text-body)/1.55 var(--font-sans);
  text-rendering: optimizeLegibility;
}

body.dialog-open { overflow: hidden; }
button, input, a { font: inherit; }
button, input { color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus { transform: none; }

.topbar,
.intro,
.controls,
.library,
footer {
  width: var(--shell);
  margin-inline: auto;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid color-mix(in srgb, var(--line-strong) 82%, transparent);
  background: color-mix(in srgb, var(--canvas) 95%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  width: 29px;
  height: 29px;
  display: block;
  border-radius: 7px;
  box-shadow: 0 0 0 1px rgba(18, 20, 23, .1), 0 5px 14px rgba(18, 20, 23, .1);
  transition: transform .35s cubic-bezier(.2, .75, .2, 1);
}

.brand:hover .brand-logo {
  transform: rotate(-7deg) scale(1.05);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 13px;
  font-weight: 780;
  letter-spacing: .09em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .13em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  transition: color .2s ease, transform .2s ease;
}

.back:hover {
  color: var(--ink);
  transform: translateX(-3px);
}

.account-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--text-control);
  font-weight: 700;
}

.account-button:hover {
  border-color: var(--ink);
}

.account-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a9afb8;
}

[data-account-state="signed-in"] .account-dot {
  background: #3a9569;
  box-shadow: 0 0 0 3px rgba(58, 149, 105, .11);
}

.language-switch {
  display: flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.language-switch button {
  min-width: 32px;
  min-height: 27px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
}

.language-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: white;
}

.intro {
  min-height: 114px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.intro-copy {
  min-width: 0;
}

.intro h1 {
  margin: 0;
  font-size: clamp(20px, 1.8vw, 25px);
  font-weight: 760;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.intro p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: var(--text-support);
  line-height: 1.65;
}

.intro .result-count {
  flex: none;
  margin: 0;
  font: var(--text-control)/1.2 var(--font-sans);
}

.intro-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
}

.library-theme-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
}

.library-theme-switch button {
  min-width: 48px;
  min-height: 30px;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-control);
  font-weight: 720;
}

.library-theme-switch button[aria-pressed="true"] {
  background: var(--selection-fill);
  color: var(--selection-ink);
}

.controls {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(420px, 1.35fr) auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 28px;
}

.search-field {
  min-height: 38px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
}

.search-field:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.search-field svg {
  width: 15px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: var(--text-support);
}

.search-field input::placeholder { color: #969ca6; }

kbd {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  color: var(--muted);
  font: var(--text-meta)/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.category-filters {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
}

.category-filters button {
  min-width: 0;
  min-height: 32px;
  padding: 5px 7px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-control);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-filters button span {
  margin-left: 3px;
  color: #9da3ad;
  font: var(--text-meta)/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.category-filters button[aria-pressed="true"] {
  background: var(--blue);
  color: white;
}

.category-filters button[aria-pressed="true"] span { color: #dfe7ff; }

.favorites-filter {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
  color: var(--muted);
  font-size: var(--text-control);
  white-space: nowrap;
  cursor: pointer;
}

.favorites-filter input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.favorites-filter:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.favorites-filter:has(input:checked) > span[aria-hidden] {
  font-size: 0;
}

.favorites-filter:has(input:checked) > span[aria-hidden]::before {
  content: "♥";
  font-size: var(--text-control);
}

.favorites-filter:has(input:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.library { padding-bottom: 82px; }

.effect-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.effect-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 10px 24px rgba(31, 40, 55, .045);
  scroll-margin-top: 20px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}

.effect-card:hover,
.effect-card:focus-within {
  border-color: var(--selection-line);
  box-shadow: 0 16px 34px rgba(31, 40, 55, .085);
  transform: translateY(-2px);
}

html[data-effect-library-theme="gray"] .effect-card {
  box-shadow: 0 10px 24px rgba(31, 40, 55, .035);
}

html[data-effect-library-theme="gray"] .effect-card:hover,
html[data-effect-library-theme="gray"] .effect-card:focus-within {
  box-shadow: 0 16px 34px rgba(31, 40, 55, .07);
}

.effect-card:focus { outline: none; }

.preview-stage {
  width: 100%;
  aspect-ratio: 8 / 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.native-preview {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: block;
  background: var(--soft);
}

.preview-loading {
  position: absolute;
  width: 28px;
  height: 2px;
  left: calc(50% - 14px);
  top: calc(50% - 1px);
  overflow: hidden;
  border-radius: 2px;
  background: #d3d9e1;
}

.preview-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--blue);
  transform: translateX(-100%);
  animation: preview-loading 1s ease-in-out infinite;
}

.native-preview.is-ready .preview-loading,
.native-preview.has-error .preview-loading { display: none; }

.preview-fallback {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

html[data-effect-library-theme="gray"] .preview-fallback,
html[data-effect-library-theme="gray"] .effect-frame {
  filter: brightness(.94);
}

html[data-effect-library-theme="dark"] .preview-fallback {
  filter: invert(.9) hue-rotate(180deg) brightness(.78) saturate(.9);
}

@keyframes preview-loading {
  50%, 100% { transform: translateX(100%); }
}

.preview-stage button,
.preview-stage input {
  font: inherit;
}

.preview-stage button {
  cursor: pointer;
}

.demo {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.demo button:focus-visible,
.demo input:focus-visible + span {
  outline: 2px solid #235dd8;
  outline-offset: 2px;
}

.demo-label {
  color: #717987;
  font: 700 7px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.demo-status {
  color: #6d7480;
  font-size: 8px;
}

/* FX-001 */

.demo-notch {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  background: #ecebe6;
}

.notch-button {
  position: relative;
  min-width: 158px;
  min-height: 43px;
  padding: 0 34px 0 18px;
  border: 1px solid #1e211e;
  border-radius: 3px;
  background: #1e211e;
  color: white;
  font-size: 10px;
  font-weight: 760;
  box-shadow: 0 5px 0 #70716b;
  transform: translateY(-2px);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), color .16s var(--ease);
}

.notch-button::after {
  content: "";
  position: absolute;
  top: 13px;
  right: 13px;
  width: 7px;
  height: 7px;
  background: #cfe761;
  transform: rotate(45deg);
}

.notch-button:hover { color: #dff37c; }
.notch-button.is-pressed {
  box-shadow: 0 0 0 #70716b;
  transform: translateY(3px);
}

/* FX-006 */

.demo-toggle {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  background: #eff0eb;
}

.sound-button {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #20221f;
  border-radius: 50%;
  background: #20221f;
  color: white;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}

.sound-button:hover { transform: rotate(-3deg); }
.sound-button[aria-pressed="true"] {
  background: #d8ed76;
  color: #20221f;
}

.sound-button svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.sound-slash {
  opacity: 0;
  transition: opacity .18s var(--ease);
}

.sound-button[aria-pressed="true"] .sound-slash { opacity: 1; }
.sound-caption {
  font-size: 9px;
  font-weight: 700;
}

/* FX-012 */

.demo-segments {
  display: grid;
  align-content: center;
  gap: 11px;
  padding: 20px 24px;
  background: #f5f3ed;
}

.segment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.segment-heading strong {
  font-size: 9px;
}

.segments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border: 1px solid #252721;
  background: #eceae3;
}

.segments label { position: relative; }
.segments input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segments span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  color: #74736d;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.segments input:checked + span {
  border-color: #252721;
  background: #bed1f4;
  color: #252721;
  box-shadow: 2px 2px 0 #252721;
  transform: translate(-1px, -1px);
}

.density-meter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.density-meter i {
  height: 3px;
  background: #d5d2c9;
}

.density-meter i.on { background: #252721; }

/* FX-021 */

.demo-commit {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px 24px;
  background: #f0ede5;
}

.commit-ledger {
  padding: 13px;
  border: 1px solid #d0ccc1;
  background: #fffdf7;
}

.commit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #697068;
  font-size: 8px;
}

.commit-total {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
  padding-top: 8px;
  border-top: 1px solid #d6d1c6;
  font-size: 8px;
}

.commit-total strong {
  color: #1f2823;
  font-size: 17px;
  line-height: 1;
}

.commit-button {
  width: 100%;
  min-height: 34px;
  border: 0;
  background: #254a3c;
  color: white;
  font-size: 8px;
  font-weight: 760;
}

.commit-button:disabled {
  cursor: default;
  background: #60766d;
}

/* FX-112 */

.demo-filter {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  padding: 16px 18px;
  background: #f2efe8;
}

.filter-pills {
  display: flex;
  gap: 5px;
}

.filter-pills button {
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #cbc7bd;
  border-radius: 99px;
  background: #fff;
  color: #68706a;
  font-size: 7px;
}

.filter-pills button[aria-pressed="true"] {
  border-color: #294d40;
  background: #294d40;
  color: white;
}

.ledger-list {
  display: grid;
  gap: 5px;
}

.ledger-row {
  min-height: 31px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 9px;
  border: 1px solid #d5d1c8;
  background: #fffdf8;
}

.ledger-row strong {
  font-size: 8px;
}

.ledger-row span {
  color: #778078;
  font-size: 7px;
}

.ledger-row[hidden] { display: none; }

/* FX-141 */

.demo-handoff {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 9px;
  padding: 14px;
  background: #e9eeea;
}

.shift-summary {
  display: grid;
  align-content: space-between;
  padding: 10px;
  background: #1d3026;
  color: white;
}

.shift-summary span {
  color: #b7c7bd;
  font-size: 7px;
}

.shift-summary strong {
  font-size: 23px;
  line-height: 1;
}

.handoff-list {
  display: grid;
  gap: 6px;
}

.handoff-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-top: 2px solid #b76e24;
  background: #fbfcf8;
}

.handoff-item strong,
.handoff-item span {
  display: block;
}

.handoff-item strong { font-size: 8px; }
.handoff-item span {
  margin-top: 2px;
  color: #707970;
  font-size: 7px;
}

.handoff-item button {
  min-height: 27px;
  padding: 0 8px;
  border: 0;
  background: #203229;
  color: white;
  font-size: 7px;
}

.handoff-item.is-done {
  border-color: #4c8a6e;
  opacity: .65;
}

/* FX-147 */

.demo-freshness {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 8px;
  padding: 14px;
  background: #e9eeea;
}

.source-list {
  display: grid;
  gap: 5px;
}

.source-row {
  min-width: 0;
  min-height: 35px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #cbd1ca;
  background: #fbfcf8;
  text-align: left;
}

.source-row strong {
  overflow: hidden;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-state {
  font-size: 7px;
  font-weight: 800;
}

.source-state.good { color: #277052; }
.source-state.warn { color: #9b5c14; }
.source-state.bad { color: #a24439; }

.source-row[aria-pressed="true"] {
  border-color: #21352b;
  box-shadow: inset 3px 0 #ce6349;
}

.freshness-detail {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 9px;
  border: 1px solid #cbd1ca;
  background: #fbfcf8;
}

.freshness-detail strong {
  font-size: 9px;
}

.freshness-detail p {
  margin: 0;
  color: #717a72;
  font-size: 7px;
}

/* FX-171 */

.demo-focal {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 10px;
  padding: 14px;
  background: #e7e5de;
}

.focal-window {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid #2a302d;
  background: #1c3233;
  transition: aspect-ratio .2s var(--ease);
}

.focal-window::before {
  content: "";
  position: absolute;
  inset: auto -8% -28% -8%;
  height: 73%;
  border-radius: 50% 50% 0 0;
  background: #54736c;
}

.focal-sun {
  position: absolute;
  top: 20px;
  right: 25px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1db8c;
  box-shadow: 0 0 0 10px rgba(241, 219, 140, .09);
}

.focal-person {
  position: absolute;
  z-index: 2;
  left: 48%;
  bottom: 17px;
  width: 6px;
  height: 31px;
  background: #dc6d4f;
}

.focal-person::before {
  content: "";
  position: absolute;
  top: -7px;
  left: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #222a26;
}

.ratio-controls {
  display: grid;
  align-content: center;
  gap: 6px;
}

.ratio-controls button {
  min-height: 30px;
  border: 1px solid #c4c1b8;
  background: #f7f5ef;
  color: #69706b;
  font-size: 7px;
}

.ratio-controls button[aria-pressed="true"] {
  border-color: #26302b;
  background: #26302b;
  color: white;
}

/* FX-212 */

.demo-pagination {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 13px;
  background: #efebe3;
}

.pagination-summary {
  display: grid;
  align-content: space-between;
  padding: 10px;
  border: 1px solid #d0ccc3;
  background: #faf7f0;
}

.pagination-summary strong {
  font-family: "Iowan Old Style", "Songti SC", Georgia, serif;
  font-size: 16px;
  line-height: 1.05;
}

.pagination-summary span {
  color: #7a7e77;
  font-size: 7px;
}

.feed-mini {
  display: grid;
  align-content: start;
  gap: 5px;
}

.feed-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 7px;
  padding: 5px 0;
  border-bottom: 1px solid #d1cec6;
}

.feed-row time {
  color: #858a83;
  font-size: 7px;
}

.feed-row strong {
  font-size: 7px;
}

.load-more {
  min-height: 28px;
  border: 1px solid #2b3d34;
  border-radius: 7px;
  background: transparent;
  color: #2b3d34;
  font-size: 7px;
  font-weight: 760;
}

.load-more.is-error {
  border-color: #a55842;
  color: #8f4937;
}

/* FX-253 */

.demo-permission {
  display: grid;
  place-items: center;
  padding: 14px;
  background: #ebe7e5;
}

.permission-card {
  width: min(270px, 100%);
  padding: 12px;
  border: 1px solid #d4c9cb;
  border-radius: 14px;
  background: #fff;
}

.permission-card strong {
  display: block;
  font-size: 10px;
}

.permission-card p {
  margin: 4px 0 9px;
  color: #74727a;
  font-size: 7px;
}

.permission-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.permission-actions button {
  min-height: 30px;
  padding: 0 6px;
  border: 1px solid #d5c8cc;
  border-radius: 8px;
  background: #fff;
  color: #714352;
  font-size: 7px;
  font-weight: 730;
}

.permission-actions .primary {
  grid-column: 1 / -1;
  border-color: #7d4552;
  background: #7d4552;
  color: white;
}

.permission-mark {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  margin-bottom: 7px;
  border-radius: 50%;
  background: #eedde2;
  color: #7d4552;
  font-size: 12px;
  font-weight: 800;
}

/* FX-278 */

.demo-constellation {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 10px;
  padding: 13px;
  background: #d9d7cf;
}

.constellation-cover {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  background: #1f3939;
}

.constellation-cover .moon {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #ecda99;
  box-shadow: 0 0 0 10px rgba(236, 218, 153, .08);
}

.constellation-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.constellation-svg path {
  fill: none;
  stroke: #efdf9d;
  stroke-width: 1.4;
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  transition: stroke-dashoffset .7s var(--ease);
}

.constellation-svg circle {
  fill: #fff0b2;
  opacity: 0;
  transition: opacity .25s var(--ease);
}

.constellation-cover.is-revealed .constellation-svg path { stroke-dashoffset: 0; }
.constellation-cover.is-revealed .constellation-svg circle { opacity: 1; }

.constellation-copy {
  display: grid;
  align-content: center;
  gap: 7px;
}

.constellation-copy strong {
  font-family: "Iowan Old Style", "Songti SC", Georgia, serif;
  font-size: 12px;
  line-height: 1.2;
}

.constellation-copy p {
  margin: 0;
  color: #68716c;
  font-size: 7px;
}

.constellation-copy button {
  min-height: 29px;
  border: 0;
  border-radius: 8px;
  background: #294941;
  color: white;
  font-size: 7px;
  font-weight: 760;
}

/* FX-299 */

.demo-auth {
  display: grid;
  place-items: center;
  padding: 13px;
  background: #e7ece8;
}

.auth-card {
  width: min(278px, 100%);
  padding: 12px;
  border: 1px solid #cbd5cd;
  border-radius: 14px;
  background: #fff;
}

.auth-card strong {
  display: block;
  font-size: 10px;
}

.auth-card p {
  margin: 4px 0 9px;
  color: #6e7871;
  font-size: 7px;
}

.auth-card button {
  width: 100%;
  min-height: 30px;
  border: 1px solid #3e604f;
  border-radius: 8px;
  background: #3e604f;
  color: white;
  font-size: 7px;
  font-weight: 760;
}

.auth-card .auth-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.auth-card .auth-options button {
  background: #fff;
  color: #3e604f;
}

.auth-card .auth-options button:last-child {
  background: #3e604f;
  color: white;
}

/* Card information */

.card-content {
  padding: 15px 16px 14px;
}

.card-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.category-tag {
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--blue-soft);
  color: #3e68c8;
  font-size: var(--text-meta);
  font-weight: 760;
}

.effect-id {
  color: var(--muted);
  font: var(--text-meta)/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-decoration: none;
}

.effect-id:hover { color: var(--blue); }

.favorite-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8e949e;
  font-size: 20px;
  line-height: 1;
}

.favorite-button:hover {
  background: var(--soft);
  color: var(--ink);
}

.favorite-button[aria-pressed="true"] { color: var(--coral); }

.card-title-row {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 760;
  line-height: 1.25;
  letter-spacing: -.025em;
}

.card-title-en {
  min-width: 0;
  overflow: hidden;
  color: #8a9099;
  font-size: var(--text-control);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-summary {
  min-height: 42px;
  margin: 8px 0 11px;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-support);
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.card-facts {
  min-width: 0;
  overflow: hidden;
  color: #8a9099;
  font: var(--text-meta)/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.get-button {
  flex: none;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--text-control);
  font-weight: 720;
}

.get-button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.empty-state {
  padding: 72px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.empty-state strong { font-size: 15px; }
.empty-state p {
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: var(--text-support);
}

.empty-state button {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: var(--ink);
  color: white;
  font-size: var(--text-control);
}

footer {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-control);
}

footer p { margin: 0; }
footer span {
  font: var(--text-meta)/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Detail dialog */

.detail-dialog {
  width: min(1100px, calc(100% - 30px));
  height: min(780px, calc(100dvh - 30px));
  max-height: min(780px, calc(100dvh - 30px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(21, 28, 39, .25);
}

.detail-dialog::backdrop {
  background: rgba(27, 33, 42, .08);
}

html[data-effect-library-theme="dark"] .detail-dialog::backdrop {
  background: rgba(4, 7, 10, .52);
}

.detail-dialog:focus { outline: none; }

.dialog-shell {
  height: 100%;
  overflow: hidden;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.dialog-head > div { min-width: 0; }
.dialog-head p:first-child {
  margin: 0 0 4px;
  color: var(--blue);
  font: 700 var(--text-meta)/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.dialog-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.03em;
}

.dialog-head p:last-child {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: var(--text-control);
}

.dialog-close {
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: var(--ink);
  color: white;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(31, 40, 55, .16);
  transition: transform .18s var(--ease), background-color .18s ease, box-shadow .18s ease;
}

.dialog-head-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dialog-close:hover {
  background: #333b48;
  box-shadow: 0 6px 16px rgba(31, 40, 55, .22);
  transform: translateY(-1px);
}

.dialog-close:active { transform: translateY(0); }

.dialog-content {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .75fr);
  min-height: 0;
}

.detail-showcase {
  position: relative;
  min-width: 0;
  padding: 16px;
  background: #eef1f5;
}

html[data-effect-library-theme="dark"] .detail-showcase {
  background: #171c22;
}

.detail-showcase-bar {
  position: absolute;
  z-index: 2;
  top: 26px;
  right: 26px;
  color: var(--muted);
  font-size: var(--text-control);
  font-weight: 700;
}

.detail-showcase-bar span { display: none; }

.detail-showcase-bar button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #aeb6c2;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--text-control);
  font-weight: 750;
  box-shadow: 0 3px 10px rgba(31, 40, 55, .1);
  transition: transform .18s var(--ease), border-color .18s ease, box-shadow .18s ease;
}

.detail-showcase-bar button:hover {
  border-color: var(--ink);
  box-shadow: 0 5px 14px rgba(31, 40, 55, .15);
  transform: translateY(-1px);
}

.detail-showcase-bar button:active { transform: translateY(0); }

.detail-preview {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
}

html[data-effect-library-theme="dark"] .detail-preview,
html[data-effect-library-theme="dark"] .effect-frame {
  background: #171c22;
}

html[data-effect-library-theme="dark"] .effect-frame {
  filter: none;
}

.detail-preview .demo {
  min-height: 100%;
}

.effect-frame {
  position: absolute;
  width: 1200px;
  height: 750px;
  min-height: 0;
  display: block;
  border: 0;
  border-radius: 10px;
  background: var(--soft);
  transform-origin: top left;
}

.card-effect-frame {
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .preview-loading::after { animation: none; transform: none; }
}

.detail-information {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--paper);
}

.dialog-summary {
  padding: 14px 16px;
}

.dialog-summary > p {
  margin: 0 0 12px;
  color: #4d5560;
  font-size: var(--text-support);
  line-height: 1.65;
}

html[data-effect-library-theme="dark"] .dialog-summary > p {
  color: var(--muted);
}

.dialog-summary dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.dialog-summary dl div {
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.dialog-summary dt {
  color: var(--muted);
  font-size: var(--text-meta);
}

.dialog-summary dd {
  margin: 3px 0 0;
  font-size: var(--text-control);
}

.get-panel {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: #f8f9fb;
}

html[data-effect-library-theme="dark"] .get-panel {
  background: var(--soft);
}

html[data-effect-library-theme="dark"] .dialog-close,
html[data-effect-library-theme="dark"] .detail-showcase-bar button {
  border-color: var(--line-strong);
  background: #29313a;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .24);
}

html[data-effect-library-theme="dark"] .dialog-close:hover,
html[data-effect-library-theme="dark"] .detail-showcase-bar button:hover {
  border-color: #596472;
  background: #343e49;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .32);
}

.get-panel > p {
  margin: 0 0 8px;
  font-size: var(--text-support);
  font-weight: 760;
}

.get-actions {
  display: grid;
  gap: 6px;
}

.get-actions a,
.get-actions button {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--text-control);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.get-actions .primary-action {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.get-actions button.copy-confirmed {
  border-color: #26734d;
  background: #26734d;
  color: white;
  animation: copy-confirm .34s var(--ease) both;
}

@keyframes copy-confirm {
  0% { transform: scale(.97); }
  65% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

.get-actions a:hover,
.get-actions button:hover {
  border-color: var(--ink);
}

/* Local account prototype */

.login-dialog,
.account-dialog {
  width: min(420px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(21, 28, 39, .24);
}

.login-dialog::backdrop,
.account-dialog::backdrop {
  background: rgba(27, 33, 42, .46);
  backdrop-filter: blur(3px);
}

.login-shell,
.account-shell {
  padding: 22px;
}

.login-head,
.account-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.login-head > div,
.account-head > div {
  min-width: 0;
}

.login-mark {
  display: block;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 19px;
}

.login-head h2,
.account-head h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -.03em;
}

.login-close,
.account-close {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: var(--soft);
  font-size: 16px;
}

.login-copy {
  margin: 14px 0 17px;
  color: var(--muted);
  font-size: var(--text-support);
  line-height: 1.65;
}

.login-field {
  display: grid;
  gap: 6px;
  font-size: var(--text-control);
  font-weight: 720;
}

.login-field input {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  background: var(--paper);
  font-size: var(--text-support);
}

.login-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.login-error {
  min-height: 17px;
  margin: 5px 0;
  color: #a84435;
  font-size: var(--text-meta);
}

.login-submit,
.logout-button {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-size: var(--text-support);
  font-weight: 760;
}

.login-privacy {
  margin: 11px 0 0;
  color: #8a9099;
  font-size: var(--text-meta);
  line-height: 1.55;
}

.account-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
  font: 700 var(--text-meta)/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.account-shell > p {
  margin: 24px 0 18px;
  color: var(--muted);
  font-size: var(--text-support);
}

.account-shell > p strong {
  color: var(--ink);
  font-size: 20px;
}

.logout-button {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}

.toast {
  position: fixed;
  z-index: 300;
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  width: max-content;
  max-width: min(360px, calc(100% - 32px));
  margin: 0;
  padding: 13px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  font-size: var(--text-control);
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 16px 44px rgba(21, 28, 39, .28);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 7px));
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}

.toast.visible,
.toast:popover-open {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 200;
  padding: 10px;
  background: #fff0c9;
}

@media (max-width: 980px) {
  :root { --shell: min(100% - 32px, 1180px); }

  .effect-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls {
    grid-template-columns: minmax(220px, .75fr) minmax(380px, 1.2fr);
  }

  .favorites-filter {
    grid-column: 1 / -1;
    justify-self: start;
    min-height: 32px;
  }

}

@media (max-width: 700px) {
  :root { --shell: calc(100% - 24px); }

  .topbar { min-height: 60px; }

  .intro {
    min-height: 102px;
    align-items: start;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }

  .intro h1 { font-size: 20px; }
  .intro-actions { width: 100%; justify-content: space-between; }
  .intro .result-count { display: none; }

  .controls {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-bottom: 22px;
  }

  .category-filters {
    grid-template-columns: repeat(3, max-content);
    justify-content: start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .category-filters::-webkit-scrollbar { display: none; }
  .category-filters button { padding-inline: 10px; }
  .favorites-filter { grid-column: auto; }

  .effect-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .effect-card:hover,
  .effect-card:focus-within {
    transform: none;
  }

  .detail-dialog {
    width: min(700px, calc(100% - 20px));
    height: auto;
  }

  .dialog-shell {
    overflow: auto;
  }

  .dialog-content {
    height: auto;
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .detail-showcase {
    min-height: 380px;
  }

  .detail-information {
    overflow: visible;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  footer {
    min-height: 90px;
    align-items: start;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
  }
}

@media (max-width: 390px) {
  .account-button {
    min-width: 0;
    max-width: 74px;
    padding-inline: 9px;
    font-size: var(--text-control);
  }
  .account-button [data-account-label] {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .detail-showcase {
    min-height: 320px;
    padding: 10px;
  }
  .detail-showcase-bar {
    top: 20px;
    right: 20px;
  }
  .demo-handoff { grid-template-columns: 82px 1fr; }
  .demo-pagination { grid-template-columns: 82px 1fr; }
  .card-content { padding-inline: 14px; }
}

@media (max-width: 600px) {
  .top-actions .back { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
