@font-face {
  font-family: "Exo 2";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/exo-2-cyrillic-variable.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Exo 2";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/exo-2-latin-variable.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Russo One";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/russo-one-cyrillic-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Russo One";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/russo-one-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Rondonhashi JP";
  font-style: normal;
  font-display: block;
  font-weight: 900;
  src: url("/fonts/rondonhashi-jp-900.woff") format("woff");
  unicode-range: U+30C9, U+30F3, U+30ED, U+6A4B;
}

:root {
  color-scheme: dark;
  --bg: #050505;
  --bg-deep: #020202;
  --surface: #0b0b0b;
  --surface-raised: #111;
  --surface-soft: #171717;
  --ink: #f3f3ef;
  --ink-inverse: #070707;
  --muted: #8d8d88;
  --muted-bright: #b9b9b3;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.42);
  --signal: #f0f0eb;
  --danger: #c7c7c2;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.72);
  --scrollbar-size: 11px;
  --scrollbar-track: rgba(255, 255, 255, 0.035);
  --scrollbar-thumb: rgba(240, 240, 235, 0.68);
  --scrollbar-thumb-hover: rgba(240, 240, 235, 0.94);
  --clip-lg: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
  --clip-md: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px));
  --clip-sm: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  --micro-font: "Exo 2", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: "Exo 2", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background:
    linear-gradient(90deg, transparent 0 4px, rgba(255, 255, 255, 0.13) 4px 5px, transparent 5px),
    var(--scrollbar-track);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

*::-webkit-scrollbar-thumb {
  min-height: 46px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), var(--scrollbar-thumb)),
    var(--scrollbar-thumb);
  background-clip: padding-box;
  border: 3px solid transparent;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.26),
    0 0 16px rgba(255, 255, 255, 0.08);
}

*::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, #fff, var(--scrollbar-thumb-hover)),
    var(--scrollbar-thumb-hover);
  background-clip: padding-box;
  border-width: 2px;
}

*::-webkit-scrollbar-corner {
  background: var(--bg);
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  text-rendering: geometricPrecision;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 72% 44%, rgba(255, 255, 255, 0.035), transparent 32%),
    linear-gradient(180deg, #050505, #020202);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  animation: grid-flash 1260ms ease-out both;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 100;
  content: "";
  pointer-events: none;
  opacity: 0.18;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 3px,
    rgba(255, 255, 255, 0.012) 3px,
    rgba(255, 255, 255, 0.012) 4px
  );
}

body.drawer-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.module-index {
  color: var(--muted);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-bright);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.system-status i {
  width: 6px;
  height: 6px;
  background: var(--signal);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.system-chrome {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  min-height: 44px;
  padding: 0 28px;
  color: rgba(255, 255, 255, 0.48);
  background: rgba(3, 3, 3, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.system-chrome > span,
.system-chrome-actions {
  animation: chrome-drop 630ms ease-out both;
}

.system-chrome > span:nth-child(2) {
  animation-delay: 368ms;
}

.system-chrome-actions {
  animation-delay: 735ms;
}

.system-chrome > span:last-child {
  text-align: right;
}

.system-chrome-center {
  color: rgba(255, 255, 255, 0.24);
  text-align: center;
}

.system-chrome-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.system-network {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.system-network i {
  width: 6px;
  height: 6px;
  background: var(--signal);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.accessibility-toggle-chrome {
  display: inline-flex;
  min-width: 52px;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted-bright);
}

.accessibility-toggle-chrome svg {
  width: 16px;
  height: 16px;
}

.accessibility-toggle-chrome span {
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 8px;
}

.accessibility-toggle-chrome:hover,
.accessibility-toggle-chrome:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-strong);
  color: var(--ink);
}

.accessibility-toggle-chrome:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.home-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 92px 40px 60px;
  overflow: hidden;
}

.home-shell::before {
  position: absolute;
  left: max(18px, calc(50% - 760px));
  bottom: -1.5vh;
  z-index: -1;
  content: "RONDONHASHI";
  color: rgba(255, 255, 255, 0.025);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: clamp(80px, 9vw, 154px);
  line-height: 0.78;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  pointer-events: none;
}

.access-stage,
.search-stage {
  position: relative;
  z-index: 3;
  animation: stage-in 1050ms cubic-bezier(0.22, 0.82, 0.2, 1) both;
}

.access-stage {
  width: min(550px, 100%);
}

.access-form {
  position: relative;
  display: grid;
  gap: 0;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0 3px, transparent 3px),
    rgba(7, 7, 7, 0.9);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  clip-path: var(--clip-lg);
  animation: panel-snap-in 980ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.access-form::after {
  position: absolute;
  top: 0;
  right: 36px;
  width: 72px;
  height: 4px;
  content: "";
  background: var(--signal);
  transform-origin: right;
  animation: line-grow 770ms 280ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.access-header,
.search-intro-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.access-header {
  animation: module-rise 630ms 105ms ease-out both;
}

.access-brand-lockup {
  padding: 58px 18px 50px;
  text-align: center;
  animation: module-rise 770ms 245ms ease-out both;
}

.access-brand {
  color: var(--ink);
  font-family: "Rondonhashi JP", sans-serif;
  font-size: clamp(46px, 9vw, 68px);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
  text-shadow: 0 0 34px rgba(255, 255, 255, 0.12);
  animation: logo-snap 980ms 315ms cubic-bezier(0.18, 0.88, 0.2, 1) both;
}

.access-brand-lockup p {
  max-width: 320px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.access-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 0;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 525ms ease, background 525ms ease, border-color 525ms ease, transform 525ms ease;
  clip-path: var(--clip-sm);
}

.access-button {
  color: var(--ink-inverse);
  background: var(--signal);
  border: 1px solid var(--signal);
  animation: module-rise 700ms 490ms ease-out backwards;
}

.access-button svg {
  width: 18px;
  height: 18px;
}

.access-button:hover {
  color: var(--ink);
  background: transparent;
  transform: translateY(-1px);
}

.access-button:hover svg {
  transform: translateX(4px);
}

.access-button:active {
  transform: translate(1px, 1px);
  transition-duration: 210ms;
}

.access-button svg {
  transition: transform 420ms ease;
}

.owner-access-trigger {
  position: relative;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 10px;
  padding: 0 12px 0 17px;
  overflow: hidden;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
  clip-path: var(--clip-sm);
  animation: module-rise 700ms 630ms ease-out both;
  transition: color 525ms ease, background 525ms ease, border-color 525ms ease, transform 525ms ease;
}

.owner-access-trigger::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  content: "";
  background: var(--signal);
  transform: scaleY(0.32);
  transition: transform 525ms ease;
}

.owner-access-trigger:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.owner-access-trigger:hover::before {
  transform: scaleY(1);
}

.owner-access-trigger:active {
  transform: translate(1px, 1px);
  transition-duration: 210ms;
}

.owner-access-trigger:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.owner-access-copy {
  display: grid;
  gap: 6px;
}

.owner-access-copy small {
  color: var(--muted);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.14em;
}

.owner-access-copy strong {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.owner-access-key {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  clip-path: var(--clip-sm);
  transition: color 490ms ease, background 490ms ease, transform 490ms ease;
}

.owner-access-key svg {
  width: 17px;
  height: 17px;
  transition: transform 525ms ease;
}

.owner-access-trigger:hover .owner-access-key {
  color: var(--ink-inverse);
  background: var(--signal);
  transform: rotate(-4deg);
}

.owner-access-trigger:hover .owner-access-key svg {
  transform: rotate(12deg) scale(1.05);
}

.access-error {
  min-height: 16px;
  margin: 0;
  color: var(--muted-bright);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.search-stage {
  max-width: 100%;
  min-width: 0;
  width: min(960px, calc(100vw - 80px));
}

.search-intro {
  margin-bottom: 36px;
}

.search-intro-meta {
  animation: module-rise 630ms 70ms ease-out both;
}

.search-intro h1 {
  max-width: 100%;
  margin: 28px 0 12px;
  color: var(--ink);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 86px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.88;
  overflow-wrap: anywhere;
  text-transform: uppercase;
  animation: module-rise 770ms 175ms ease-out both;
}

.search-intro h1 span {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.42);
  animation: outline-snap 910ms 245ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.search-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  animation: module-rise 630ms 350ms ease-out both;
}

.search-form {
  position: relative;
  z-index: 3;
  max-width: 100%;
  width: 100%;
}

.search-box {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 58px;
  max-width: 100%;
  gap: 8px;
  min-height: 78px;
  padding: 10px;
  overflow: hidden;
  background: rgba(7, 7, 7, 0.94);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  clip-path: var(--clip-lg);
  transform-origin: left center;
  animation: search-bar-in 875ms 403ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.search-box::before {
  position: absolute;
  top: 0;
  left: 76px;
  width: 110px;
  height: 3px;
  content: "";
  background: var(--signal);
  transform-origin: left;
  animation: line-grow 630ms 770ms ease-out both;
}

.search-box::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.11), transparent);
  transform: translateX(-100%);
}

#externalSearchForm:focus-within .search-box {
  border-color: rgba(255, 255, 255, 0.72);
}

.demo-playing .search-box,
.demo-playing #externalSearchForm:focus-within .search-box {
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

body.demo-input-locked {
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
}

body.demo-input-locked :where(a, button, input, select, textarea, label, [role="button"], [tabindex]) {
  pointer-events: none !important;
}

#externalQuery.is-demo-typing {
  caret-color: var(--signal);
}

#externalSearchForm:focus-within .search-box::after {
  opacity: 1;
  animation: search-sweep 1120ms ease-out both;
}

.search-prefix {
  display: grid;
  place-items: center;
  color: var(--muted);
  border-right: 1px solid var(--line);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 11px;
}

#externalQuery {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  height: 56px;
  padding: 0 18px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  clip-path: none;
  font-family: "Exo 2", sans-serif;
  font-size: 18px;
  font-weight: 700;
}

#externalQuery::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.search-footnote {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 12px 0;
  color: rgba(255, 255, 255, 0.34);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 8px;
  letter-spacing: 0.12em;
  animation: module-rise 560ms 735ms ease-out both;
}

.round-button,
.icon-button,
.primary-button,
.ghost-button,
.segment,
.tab-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  transition: transform 525ms ease, border-color 525ms ease, background 525ms ease, color 525ms ease;
}

.round-button {
  width: 58px;
  height: 56px;
  padding: 0;
  clip-path: var(--clip-sm);
}

.search-box .round-button[type="submit"] {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
}

.search-actions {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
  animation: module-rise 560ms 648ms ease-out both;
}

.round-button:hover,
.icon-button:hover,
.primary-button:hover,
.ghost-button:hover,
.segment:hover,
.tab-button:hover {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
  transform: translateY(-1px);
}

.round-button:active,
.icon-button:active,
.primary-button:active,
.ghost-button:active,
.segment:active,
.tab-button:active {
  transform: translate(1px, 1px);
  transition-duration: 210ms;
}

.round-button svg,
.icon-button svg,
.primary-button svg,
.ghost-button svg {
  transition: transform 420ms ease;
}

.round-button:hover svg,
.icon-button:hover svg {
  transform: rotate(-8deg) scale(1.06);
}

.search-box .round-button[type="submit"]:hover svg {
  transform: scale(1.14);
}

#listButton:hover svg {
  transform: rotate(8deg) scale(1.06);
}

#exportButton:hover svg {
  transform: translateY(3px);
}

#drawerCloseButton:hover svg {
  transform: rotate(90deg);
}

.round-button[aria-busy="true"] svg,
.primary-button[aria-busy="true"] svg {
  opacity: 0;
}

.round-button[aria-busy="true"]::after,
.primary-button[aria-busy="true"]::after {
  position: absolute;
  width: 17px;
  height: 17px;
  content: "";
  border: 2px solid rgba(0, 0, 0, 0.24);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 2450ms linear infinite;
}

.round-button svg,
.icon-button svg,
.primary-button svg,
.ghost-button svg,
.input-with-icon svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.round-button:focus-visible,
.icon-button:focus-visible,
.primary-button:focus-visible,
.ghost-button:focus-visible,
.segment:focus-visible,
.tab-button:focus-visible,
.media-card-open:focus-visible,
.status-choice:focus-visible,
.rating-step:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.result-list {
  position: absolute;
  top: calc(100% + 16px);
  right: 0;
  left: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  max-height: min(560px, calc(100vh - 170px));
  overflow: auto;
  padding: 8px;
  background: rgba(5, 5, 5, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  clip-path: var(--clip-lg);
  animation: dropdown-in 630ms ease both;
}

.result-list:empty,
.result-list[hidden] {
  display: none;
}

.result-row {
  display: grid;
  width: 100%;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 76px;
  padding: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid transparent;
  clip-path: var(--clip-sm);
  transition: background 490ms ease, border-color 490ms ease;
  animation: result-enter 595ms ease-out both;
}

.result-row:nth-child(2) { animation-delay: 70ms; }
.result-row:nth-child(3) { animation-delay: 140ms; }
.result-row:nth-child(4) { animation-delay: 210ms; }
.result-row:nth-child(5) { animation-delay: 280ms; }
.result-row:nth-child(n + 6) { animation-delay: 350ms; }

.result-row[data-result-row] {
  cursor: pointer;
}

.result-row[data-result-row]:hover,
.result-row.is-active {
  background: rgba(255, 255, 255, 0.075);
  border-color: var(--line-strong);
}

.result-row.is-demo-click,
.result-row.is-active.is-demo-click {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--signal);
  animation: demo-target-tap 910ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.result-row-muted {
  color: var(--muted);
}

.result-row img,
.result-thumb-fallback {
  width: 52px;
  height: 62px;
  object-fit: cover;
  background: var(--surface-soft);
  clip-path: var(--clip-sm);
}

.result-thumb-fallback {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.result-row-muted [data-lucide="loader-circle"] {
  animation: spin 3150ms linear infinite;
}

.result-title,
.card-title,
.detail-title {
  overflow-wrap: anywhere;
}

.result-title {
  display: block;
  font-weight: 800;
}

.result-meta,
.muted-count,
.detail-meta,
.card-meta,
.empty-state,
.toast {
  color: var(--muted);
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.library-drawer {
  position: fixed;
  inset: 14px;
  z-index: 50;
  display: flex;
  width: min(1660px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  flex-direction: column;
  margin: auto;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.7) 0 2px, transparent 2px),
    rgba(5, 5, 5, 0.95);
  border: 1px solid var(--line-strong);
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.86);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.992);
  transition: opacity 525ms ease, transform 665ms cubic-bezier(0.2, 0.86, 0.2, 1);
  backdrop-filter: blur(24px);
  clip-path: var(--clip-lg);
}

.drawer-open .library-drawer {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.72);
  border: 0;
  backdrop-filter: blur(9px);
}

.drawer-open .drawer-backdrop {
  display: block;
  animation: fade-in 420ms ease both;
}

.drawer-open .drawer-head {
  animation: shutter-down 630ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.drawer-open .drawer-actions .icon-button {
  animation: control-pop 525ms ease-out backwards;
}

.drawer-open .drawer-actions .icon-button:nth-child(2) {
  animation-delay: 308ms;
}

.drawer-open .drawer-actions .icon-button:nth-child(3) {
  animation-delay: 613ms;
}

.drawer-open .metric {
  animation: module-rise 630ms 123ms ease-out both;
}

.drawer-open .metric:nth-child(2) {
  animation-delay: 676ms;
}

.drawer-open .metric:nth-child(3) {
  animation-delay: 921ms;
}

.drawer-open .metric:nth-child(4) {
  animation-delay: 1166ms;
}

.drawer-open .filter-panel {
  animation: module-slide-right 735ms 245ms ease-out both;
}

.drawer-open .favorite-panel {
  animation: module-slide-right 735ms 305ms ease-out both;
}

.drawer-open .random-panel {
  animation: module-slide-right 735ms 365ms ease-out both;
}

.drawer-open .library-head {
  animation: module-rise 630ms 280ms ease-out both;
}

.drawer-open .status-tabs {
  animation: module-rise 630ms 368ms ease-out both;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  padding: 14px 20px 14px 24px;
  background: rgba(7, 7, 7, 0.94);
  border-bottom: 1px solid var(--line);
}

.drawer-identity {
  display: flex;
  align-items: center;
  gap: 20px;
}

.drawer-identity .module-index {
  padding-right: 20px;
  border-right: 1px solid var(--line);
}

.drawer-brand {
  color: var(--ink);
  font-family: "Rondonhashi JP", sans-serif;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.08em;
}

.drawer-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  clip-path: var(--clip-sm);
}

.drawer-actions .icon-button:last-of-type {
  margin-left: 8px;
}

.drawer-scroll {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  grid-template-areas:
    "metrics metrics"
    "controls library";
  align-items: start;
  gap: 22px;
  overflow: auto;
  padding: 22px;
}

.metric-grid {
  display: grid;
  grid-area: metrics;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 12px;
  min-height: 74px;
  padding: 16px 18px;
  background: transparent;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric::before {
  align-self: center;
  width: 5px;
  height: 5px;
  content: "";
  background: var(--signal);
}

.metric strong {
  grid-column: 2;
  grid-row: 1;
  color: var(--ink);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
}

.metric span {
  grid-column: 2;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-panel {
  position: sticky;
  top: 0;
  isolation: isolate;
  display: grid;
  grid-area: filters;
  gap: 18px;
  padding: 18px;
  overflow: hidden;
  background: rgba(14, 14, 14, 0.88);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  clip-path: var(--clip-md);
}

.control-stack {
  display: grid;
  grid-area: controls;
  gap: 22px;
  align-content: start;
  min-width: 0;
}

.control-stack > * {
  grid-area: auto;
}

.favorite-panel {
  grid-area: favorites;
}

.random-panel {
  grid-area: random;
}

.quick-panel {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 14px;
  padding: 14px;
  overflow: hidden;
  background: rgba(14, 14, 14, 0.88);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  clip-path: var(--clip-md);
}

.quick-panel::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 42px;
  height: 3px;
  content: "";
  background: var(--signal);
}

.favorite-toggle-button,
.random-button {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  clip-path: var(--clip-sm);
  transition:
    color 245ms ease,
    background 245ms ease,
    border-color 245ms ease,
    transform 245ms var(--ease-out);
}

.favorite-toggle-button:hover,
.random-button:hover {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
  transform: translateY(-1px);
}

.favorite-toggle-button.is-active {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
}

.favorite-toggle-button strong,
.random-button span:last-child {
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.favorite-toggle-button small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: currentColor;
  font-size: 10px;
  font-weight: 760;
  line-height: 1.2;
  opacity: 0.62;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  clip-path: var(--clip-sm);
}

.favorite-toggle-button:hover .quick-icon,
.favorite-toggle-button.is-active .quick-icon,
.random-button:hover .quick-icon {
  color: var(--ink);
  background: var(--ink-inverse);
  border-color: rgba(0, 0, 0, 0.28);
}

.quick-icon svg {
  width: 16px;
  height: 16px;
}

.favorite-toggle-button.is-active .quick-icon svg {
  fill: currentColor;
  animation: favorite-pop 525ms var(--ease-out) both;
}

.random-actions {
  display: grid;
  gap: 8px;
}

.filter-panel::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 54px;
  height: 3px;
  content: "";
  background: var(--signal);
}

.panel-heading {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.filter-toggle-button {
  width: 100%;
  margin: 0;
  color: inherit;
  background: transparent;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  text-align: left;
  cursor: default;
}

.filter-toggle-button > span {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.filter-toggle-button svg {
  display: none;
  width: 16px;
  height: 16px;
  transition: transform 245ms var(--ease-out);
}

.filter-content {
  display: grid;
}

.panel-heading strong {
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 18px;
  font-weight: 400;
  text-transform: uppercase;
}

.filter-grid,
.edit-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.filter-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field.wide {
  grid-column: 1 / -1;
}

.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;
}

.field label,
.info-cell span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select,
textarea {
  color-scheme: dark;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: #111;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  clip-path: var(--clip-sm);
  font-size: 14px;
}

select {
  background-color: #111;
  font-size: 13px;
}

select option {
  color: var(--ink);
  background: #111;
}

textarea {
  min-height: 100px;
  padding-top: 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  background: #151515;
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.poster-upload-field {
  margin-top: 2px;
}

.poster-upload-control {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-height: 154px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), transparent 34%),
    rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.18);
  clip-path: var(--clip-md);
}

.poster-upload-preview {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  min-height: 130px;
  color: rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.14), transparent 38%),
    linear-gradient(145deg, #181818, #080808);
  border: 1px solid rgba(255, 255, 255, 0.2);
  clip-path: var(--clip-sm);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

.poster-upload-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 32%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.18), transparent 45%);
  opacity: 0.55;
}

.poster-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.03) saturate(0.98);
}

.poster-upload-preview span {
  z-index: 1;
  max-width: 86%;
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 24px;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.poster-upload-actions {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.poster-upload-actions .ghost-button {
  justify-content: center;
  width: min(280px, 100%);
}

.poster-upload-actions .ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(1);
  transform: none;
}

.poster-upload-actions small {
  max-width: 360px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.input-with-icon {
  position: relative;
}

.input-with-icon input {
  padding-left: 38px;
}

.input-with-icon svg {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-bright);
  font-size: 12px;
  font-weight: 800;
}

.check-line input {
  width: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--signal);
  clip-path: none;
}

.library-panel {
  grid-area: library;
  min-width: 0;
  padding-bottom: 4px;
}

.library-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.library-title {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.library-title h2 {
  margin: 0;
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: clamp(24px, 2vw, 34px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.9;
  text-transform: uppercase;
}

.muted-count {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-tabs {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.status-tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  flex: 0 0 auto;
  gap: 9px;
  min-height: 37px;
  padding: 0 12px;
  color: var(--muted-bright);
  background: transparent;
  border-color: var(--line);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  clip-path: var(--clip-sm);
}

.tab-button.is-active {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
  animation: selected-snap 490ms ease-out backwards;
}

.tab-count {
  display: inline-grid;
  min-width: 22px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  font-size: 9px;
  clip-path: var(--clip-sm);
}

.tab-button.is-active .tab-count {
  color: var(--ink);
  background: var(--ink-inverse);
  border-color: var(--ink-inverse);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  counter-reset: media-card;
}

.media-card {
  position: relative;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  counter-increment: media-card;
  clip-path: var(--clip-md);
  transition: transform 630ms ease, border-color 630ms ease, box-shadow 630ms ease;
}

.drawer-open .media-card {
  animation: card-enter 770ms 420ms cubic-bezier(0.2, 0.88, 0.2, 1) backwards;
}

.drawer-open .media-card:nth-child(2) { animation-delay: 483ms; }
.drawer-open .media-card:nth-child(3) { animation-delay: 546ms; }
.drawer-open .media-card:nth-child(4) { animation-delay: 609ms; }
.drawer-open .media-card:nth-child(5) { animation-delay: 672ms; }
.drawer-open .media-card:nth-child(6) { animation-delay: 735ms; }
.drawer-open .media-card:nth-child(7) { animation-delay: 798ms; }
.drawer-open .media-card:nth-child(8) { animation-delay: 861ms; }
.drawer-open .media-card:nth-child(n + 9) { animation-delay: 924ms; }

.media-card::before {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: grid;
  min-width: 32px;
  height: 24px;
  place-items: center;
  padding: 0 7px;
  content: counter(media-card, decimal-leading-zero);
  color: var(--ink-inverse);
  background: var(--signal);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 9px;
  clip-path: var(--clip-sm);
}

.card-grid.is-random-order .media-card::before {
  display: none;
}

.media-card::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 2px;
  height: 0;
  content: "";
  background: var(--signal);
  transition: transform 770ms ease;
}

.media-card:hover {
  z-index: 2;
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42);
  transform: translateY(-4px);
}

.media-card:hover::after {
  height: 100%;
}

.media-card-open {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  flex-direction: column;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.poster-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 2.86;
  overflow: hidden;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.poster-frame::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -54%;
  z-index: 2;
  width: 28%;
  content: "";
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: skewX(-12deg);
}

.media-card:hover .poster-frame::before {
  animation: card-scan 980ms ease-out both;
}

.poster-frame::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), transparent 58%, rgba(0, 0, 0, 0.3)),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(255, 255, 255, 0.014) 4px 5px);
}

.poster-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.03);
  transition: filter 840ms ease, transform 1400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.media-card:hover .poster-frame img {
  filter: saturate(1) contrast(1.02);
  transform: scale(1.025);
}

.poster-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
  background:
    linear-gradient(135deg, transparent 49.5%, rgba(255, 255, 255, 0.08) 50%, transparent 50.5%),
    var(--surface-soft);
}

.favorite-flag {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--ink-inverse);
  background: var(--signal);
  clip-path: var(--clip-sm);
}

.favorite-flag svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.card-body {
  display: flex;
  min-height: 176px;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0 2px, transparent 2px),
    var(--surface);
}

.card-title {
  display: -webkit-box;
  min-height: 42px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--ink);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 18px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-meta span + span::before {
  margin-right: 6px;
  content: "/";
  color: rgba(255, 255, 255, 0.26);
}

.pill,
.score-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  clip-path: var(--clip-sm);
}

.pill {
  gap: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.card-body > .pill {
  align-self: stretch;
  justify-content: space-between;
  width: 100%;
  min-height: 33px;
  padding: 0 11px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-body > .pill::after {
  width: 5px;
  height: 5px;
  content: "";
  background: currentColor;
}

.pill.planned {
  color: var(--ink);
  background: #262626;
  border-color: #3b3b3b;
}

.pill.watching {
  color: var(--ink-inverse);
  background: #d0d0cb;
  border-color: #d0d0cb;
}

.pill.completed {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
}

.pill.dropped {
  color: #888;
  background: #070707;
  border-color: #252525;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 7px;
  margin-top: auto;
}

.score-pill {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 47px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 7px 9px;
  color: var(--ink-inverse);
  background: var(--signal);
  border: 1px solid var(--signal);
}

.score-pill.public {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

.score-label {
  max-width: 100%;
  overflow: hidden;
  color: currentColor;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.62;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.score-pill strong {
  color: currentColor;
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

.empty-state {
  display: grid;
  grid-column: 1 / -1;
  min-height: 280px;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(135deg, transparent 49.8%, rgba(255, 255, 255, 0.04) 50%, transparent 50.2%),
    rgba(255, 255, 255, 0.018);
  border: 1px dashed var(--line-strong);
  clip-path: var(--clip-md);
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 18px;
  font-weight: 400;
  text-transform: uppercase;
}

dialog {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: var(--shadow);
  clip-path: var(--clip-lg);
}

dialog[open] {
  animation: dialog-snap 735ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
}

dialog[open]::backdrop {
  animation: fade-in 455ms ease-out both;
}

.pin-dialog {
  width: min(430px, calc(100vw - 32px));
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0 3px, transparent 3px),
    #060606;
}

.pin-dialog[open] {
  animation: pin-dialog-in 665ms cubic-bezier(0.18, 0.9, 0.2, 1) both;
}

.pin-dialog.is-closing {
  animation: pin-dialog-out 420ms ease-in both;
}

.pin-form {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 20px;
  overflow: hidden;
}

.pin-form::after {
  position: absolute;
  top: 0;
  right: 66px;
  width: 82px;
  height: 3px;
  content: "";
  background: var(--signal);
  transform-origin: right;
  animation: line-grow 630ms 140ms ease-out both;
}

.pin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.pin-header h2 {
  margin: 9px 0 0;
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.pin-close-button {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.pin-close-button:hover svg {
  transform: rotate(90deg);
}

.pin-console {
  position: relative;
  padding: 15px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  clip-path: var(--clip-md);
}

.pin-console::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 2px;
  content: "";
  background: var(--signal);
}

.pin-console-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  color: var(--muted);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.pin-hidden-input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  clip-path: none;
}

.pin-slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  cursor: text;
}

.pin-slots span {
  position: relative;
  display: grid;
  aspect-ratio: 0.84;
  min-width: 0;
  place-items: center;
  background: #0e0e0e;
  border: 1px solid var(--line-strong);
  clip-path: var(--clip-sm);
  transition: border-color 420ms ease, background 420ms ease, transform 420ms ease;
}

.pin-slots span::after {
  width: 9px;
  height: 9px;
  content: "";
  background: var(--signal);
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.28);
  opacity: 0;
  transform: scale(0.35);
  transition: opacity 350ms ease, transform 420ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.pin-slots span.is-filled {
  background: #151515;
  border-color: rgba(255, 255, 255, 0.7);
  animation: pin-slot-fill 455ms ease-out both;
}

.pin-slots span.is-filled::after {
  opacity: 1;
  transform: scale(1);
}

.pin-slots span.is-current {
  border-color: var(--signal);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.pin-dialog.is-complete .pin-slots span {
  border-color: rgba(255, 255, 255, 0.78);
}

.pin-dialog.is-invalid .pin-console {
  animation: pin-denied 630ms ease-out both;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.pin-keypad button {
  min-height: 48px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 15px;
  clip-path: var(--clip-sm);
  transition: color 385ms ease, background 385ms ease, border-color 385ms ease, transform 280ms ease;
}

.pin-dialog[open] .pin-keypad button {
  animation: control-pop 490ms ease-out backwards;
}

.pin-dialog[open] .pin-keypad button:nth-child(2),
.pin-dialog[open] .pin-keypad button:nth-child(5),
.pin-dialog[open] .pin-keypad button:nth-child(8),
.pin-dialog[open] .pin-keypad button:nth-child(11) {
  animation-delay: 221ms;
}

.pin-dialog[open] .pin-keypad button:nth-child(3n) {
  animation-delay: 441ms;
}

.pin-keypad button:hover {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
  transform: translateY(-1px);
}

.pin-keypad button:active {
  transform: scale(0.97);
}

.is-demo-tap {
  color: var(--ink-inverse) !important;
  background: var(--signal) !important;
  border-color: var(--signal) !important;
  animation: demo-control-tap 910ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.pin-keypad button:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.pin-keypad .pin-key-action {
  color: var(--muted-bright);
  background: transparent;
  font-family: "Exo 2", sans-serif;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.pin-key-action svg {
  width: 17px;
  height: 17px;
  margin: auto;
}

.pin-submit-button {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 16px;
  color: var(--ink-inverse);
  background: var(--signal);
  border: 1px solid var(--signal);
  border-radius: 0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  clip-path: var(--clip-sm);
  transition: color 455ms ease, background 455ms ease, opacity 455ms ease, transform 350ms ease;
}

.pin-submit-button:disabled {
  color: var(--muted);
  background: #111;
  border-color: var(--line);
  cursor: not-allowed;
  opacity: 0.62;
}

.pin-submit-button:not(:disabled):hover {
  color: var(--ink);
  background: transparent;
  transform: translateY(-1px);
}

.pin-dialog.is-complete .pin-submit-button {
  animation: pin-ready 525ms ease-out both;
}

.pin-submit-button:not(:disabled):hover svg {
  transform: translateX(3px);
}

.pin-submit-button svg {
  width: 17px;
  height: 17px;
  transition: transform 420ms ease;
}

.details-dialog {
  width: min(820px, calc(100vw - 32px));
  overflow: hidden;
}

.details-dialog.is-demo-closing {
  animation: dialog-demo-out 525ms ease both;
}

#detailsContent {
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.detail-layout {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.1fr);
  min-height: 580px;
  overflow: hidden;
  background: rgba(5, 5, 5, 0.94);
}

.detail-close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 6;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  color: var(--ink-inverse);
  background: var(--signal);
  border: 1px solid var(--signal);
  clip-path: var(--clip-sm);
  transition: color 490ms ease, background 490ms ease, transform 490ms ease;
}

.detail-close-button svg {
  width: 17px;
  height: 17px;
}

.detail-close-button:hover {
  color: var(--ink);
  background: #050505;
  transform: translateY(-1px);
}

.detail-close-button:hover svg {
  transform: rotate(90deg);
}

.detail-close-button:active {
  transform: translate(1px, 1px);
}

.detail-close-button svg {
  transition: transform 455ms ease;
}

.detail-close-button:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.detail-card-editor::before {
  position: absolute;
  inset: -44px;
  z-index: -2;
  content: "";
  background-image: var(--detail-poster);
  background-position: center;
  background-size: cover;
  filter: blur(34px) grayscale(1);
  opacity: 0.18;
  transform: scale(1.08);
}

.detail-card-editor::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(90deg, transparent 38%, rgba(5, 5, 5, 0.72) 52%, #050505 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.54));
}

.detail-poster-frame {
  position: relative;
  min-height: 580px;
  overflow: hidden;
}

.details-dialog[open] .detail-poster-frame {
  animation: detail-poster-in 840ms 70ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.detail-poster {
  width: 100%;
  height: 100%;
  min-height: 580px;
  overflow: hidden;
  background: var(--surface-soft);
  border-right: 1px solid var(--line);
}

.detail-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-poster-caption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  padding: 16px;
  background: rgba(3, 3, 3, 0.78);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px);
  clip-path: var(--clip-md);
}

.detail-title {
  margin: 0;
  color: var(--ink);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.1;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.85);
}

.detail-original {
  margin: 8px 0 0;
  color: var(--muted-bright);
  font-size: 12px;
  line-height: 1.4;
}

.detail-main {
  min-width: 0;
  padding: 24px;
  background: rgba(5, 5, 5, 0.76);
  backdrop-filter: blur(20px);
}

.details-dialog[open] .detail-main {
  animation: detail-main-in 805ms 158ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.detail-cube,
.detail-favorite-button,
.detail-source-icon {
  display: inline-flex;
  width: auto;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  color: var(--ink-inverse);
  background: var(--signal);
  border: 1px solid var(--signal);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  clip-path: var(--clip-sm);
}

.detail-favorite-button,
.detail-source-icon {
  width: 32px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

.detail-favorite-button svg,
.detail-source-icon svg {
  width: 14px;
  height: 14px;
}

.detail-favorite-button.is-active {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
  animation: control-pop 525ms ease-out both;
}

.detail-favorite-button.is-active svg {
  fill: currentColor;
}

.detail-favorite-button:hover,
.detail-source-icon:hover {
  color: var(--ink-inverse);
  background: var(--signal);
}

.service-score {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  color: var(--ink-inverse);
  background: var(--signal);
  border: 1px solid var(--signal);
  clip-path: var(--clip-md);
}

.service-score span,
.detail-editor-label,
.rating-head span {
  color: inherit;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.service-score strong {
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 31px;
  font-weight: 400;
}

.detail-status-editor {
  margin-top: 22px;
}

.detail-editor-label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
}

.status-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.status-choice {
  position: relative;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--muted-bright);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.025em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  clip-path: var(--clip-sm);
  transition: color 490ms ease, background 490ms ease, border-color 490ms ease, transform 490ms ease;
}

.status-choice::before {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 4px;
  height: 4px;
  content: "";
  background: currentColor;
  opacity: 0.5;
}

.status-choice:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.status-choice.is-active {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
}

.status-choice.dropped:not(.is-active) {
  color: #727272;
}

.detail-rating-editor {
  margin-top: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  clip-path: var(--clip-md);
}

.rating-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rating-head span {
  color: var(--muted);
}

.rating-head strong {
  color: var(--ink);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

.rating-console {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.rating-step {
  width: 38px;
  height: 36px;
  color: var(--ink-inverse);
  background: var(--signal);
  border: 1px solid var(--signal);
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  clip-path: var(--clip-sm);
}

.rating-step:hover {
  color: var(--ink);
  background: transparent;
}

.rating-slider {
  width: 100%;
  height: 36px;
  margin: 0;
  padding: 0;
  appearance: none;
  background: linear-gradient(90deg, var(--signal) var(--rating-progress), #1b1b1b 0);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  clip-path: none;
}

.rating-slider::-webkit-slider-thumb {
  width: 12px;
  height: 38px;
  appearance: none;
  background: #050505;
  border: 2px solid var(--signal);
}

.rating-slider::-moz-range-thumb {
  width: 12px;
  height: 34px;
  background: #050505;
  border: 2px solid var(--signal);
  border-radius: 0;
}

.detail-card-footer {
  display: flex;
  margin-top: 18px;
}

.detail-delete-button {
  display: inline-flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  clip-path: var(--clip-sm);
}

.detail-delete-button:hover {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
}

.viewer-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.viewer-chip {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  clip-path: var(--clip-sm);
}

.detail-snapshot,
.detail-quick-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.detail-stat,
.info-cell {
  min-height: 64px;
  padding: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  clip-path: var(--clip-sm);
}

.detail-stat span,
.info-cell span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-stat strong,
.info-cell strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.detail-control {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.detail-control.wide {
  grid-column: 1 / -1;
}

.detail-control span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.detail-section {
  margin-top: 18px;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.detail-section p {
  margin: 0;
  color: var(--muted-bright);
  line-height: 1.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.edit-dialog {
  overflow: auto;
}

.edit-form {
  padding: 24px;
}

.dialog-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.dialog-title-row h2 {
  margin: 0;
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 24px;
  font-weight: 400;
  text-transform: uppercase;
}

.dialog-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.primary-button,
.ghost-button {
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  clip-path: var(--clip-sm);
}

.primary-button {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
}

.ghost-button {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.ghost-button.danger {
  color: var(--muted-bright);
}

.action-spacer {
  flex: 1 1 auto;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 15px;
  color: var(--ink);
  background: rgba(10, 10, 10, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
  clip-path: var(--clip-sm);
  animation: toast-in 770ms ease both;
}

@keyframes grid-flash {
  0% {
    opacity: 0;
    background-position: 20px 0, 0 20px;
  }
  55% {
    opacity: 1;
  }
  100% {
    background-position: 0 0, 0 0;
  }
}

@keyframes chrome-drop {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panel-snap-in {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes module-rise {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes module-slide-right {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes line-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes logo-snap {
  from {
    opacity: 0;
    filter: blur(2px);
    transform: scaleX(0.94);
  }
  68% {
    opacity: 1;
  }
  to {
    filter: blur(0);
    transform: scaleX(1);
  }
}

@keyframes outline-snap {
  from {
    opacity: 0;
    letter-spacing: 0.04em;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    letter-spacing: -0.055em;
    transform: translateX(0);
  }
}

@keyframes search-bar-in {
  from {
    opacity: 0;
    transform: scaleX(0.96) translateY(5px);
  }
  to {
    opacity: 1;
    transform: scaleX(1) translateY(0);
  }
}

@keyframes shutter-down {
  from {
    opacity: 0;
    clip-path: inset(0 0 72% 0);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes control-pop {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }
  70% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes selected-snap {
  0% {
    transform: translateX(-3px);
  }
  55% {
    transform: translateX(2px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes card-scan {
  from {
    left: -54%;
    opacity: 0;
  }
  24% {
    opacity: 1;
  }
  to {
    left: 126%;
    opacity: 0;
  }
}

@keyframes result-enter {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pin-dialog-in {
  from {
    opacity: 0;
    clip-path: inset(0 0 88% 0);
    transform: translateY(10px) scale(0.985);
  }
  56% {
    clip-path: inset(0 0 0 0);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pin-dialog-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
}

@keyframes pin-slot-fill {
  0% {
    transform: scale(0.9);
  }
  68% {
    transform: scale(1.035);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pin-ready {
  0% {
    transform: scaleX(0.97);
  }
  70% {
    transform: scaleX(1.01);
  }
  100% {
    transform: scaleX(1);
  }
}

@keyframes pin-denied {
  0%, 100% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-5px);
  }
  65% {
    transform: translateX(4px);
  }
}

@keyframes dialog-snap {
  from {
    opacity: 0;
    transform: scale(0.985) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes detail-poster-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes detail-main-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes search-sweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.storage-warning {
  margin: 0 0 14px;
  padding: 11px 12px;
  color: #000;
  background: #fff;
  border: 1px solid #fff;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
  text-transform: uppercase;
}

.poster-demo {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  isolation: isolate;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 38%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 9px, transparent 9px 18px),
    #111;
}

.poster-demo::before {
  position: absolute;
  inset: 12%;
  z-index: -1;
  content: "";
  background:
    linear-gradient(90deg, transparent 0 28%, rgba(255, 255, 255, 0.28) 28% 32%, transparent 32%),
    linear-gradient(0deg, transparent 0 48%, rgba(255, 255, 255, 0.2) 48% 52%, transparent 52%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  transform: skew(-8deg);
}

.poster-demo::after {
  position: absolute;
  right: 9%;
  bottom: 9%;
  width: 34%;
  height: 8px;
  content: "";
  background: currentColor;
  opacity: 0.72;
}

.poster-demo > span {
  display: grid;
  width: 52%;
  aspect-ratio: 1;
  place-items: center;
  color: #000;
  background: #fff;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: clamp(26px, 5vw, 52px);
  line-height: 1;
}

.result-thumb-fallback.poster-demo > span {
  width: 70%;
  font-size: 18px;
}

.tone-white {
  color: #000;
  background: #f2f2f2;
}

.tone-cyan,
.tone-ice {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.52), transparent 32%),
    #252525;
}

.tone-dark {
  color: #8f8f8f;
  background: #000;
}

.tone-lime {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.36), transparent 38%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 8px, transparent 8px 16px),
    #1b1b1b;
}

.tone-steel,
.tone-grid,
.tone-mono {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 44%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0 2px, transparent 2px 12px),
    #101010;
}

.result-action {
  margin-top: 12px;
}

@media (max-width: 1240px) {
  .drawer-scroll {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .filter-panel {
    padding: 16px;
  }
}

@media (max-width: 920px) {
  .home-shell {
    padding-right: 28px;
    padding-left: 28px;
  }

  .search-intro h1 {
    font-size: 72px;
  }

  .library-drawer {
    inset: 8px;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .drawer-scroll {
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .control-stack,
  .filter-panel,
  .quick-panel,
  .library-panel {
    flex: 0 0 auto;
  }

  .filter-panel {
    position: relative;
    grid-template-columns: 160px minmax(0, 1fr);
    align-items: end;
  }

  .panel-heading {
    padding: 0 16px 0 0;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .random-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  }
}

@media (max-width: 680px) {
  .system-chrome {
    grid-template-columns: 1fr auto;
    min-height: 40px;
    overflow: hidden;
    padding: 0 16px;
  }

  .system-chrome-center {
    display: none;
  }

  .system-chrome > span:last-child {
    display: none;
  }

  .search-intro-meta .system-status {
    display: none;
  }

  .home-shell {
    min-height: 100svh;
    padding: 70px 18px 34px;
  }

  .search-stage {
    width: min(320px, calc(100vw - 56px));
    max-width: min(320px, calc(100vw - 56px));
  }

  .home-shell::before {
    left: -12px;
    font-size: 82px;
  }

  .access-form {
    padding: 17px;
  }

  .access-brand-lockup {
    padding: 42px 10px 38px;
  }

  .access-brand {
    font-size: clamp(43px, 15vw, 60px);
  }

  .search-intro {
    margin-bottom: 26px;
  }

  .search-intro h1 {
    margin-top: 22px;
    font-size: 36px;
  }

  .search-intro p {
    font-size: 12px;
  }

  .search-box {
    display: flex;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 46px;
    align-items: stretch;
    min-height: 68px;
    gap: 6px;
    padding: 8px;
  }

  .search-prefix {
    display: none;
  }

  #externalQuery {
    flex: 1 1 auto;
    min-width: 0;
    width: 1px;
    height: 50px;
    padding: 0 10px;
    font-size: 15px;
  }

  .search-box .round-button {
    flex: 0 0 46px;
    width: 46px;
    height: 50px;
  }

  .search-footnote {
    font-size: 7px;
  }

  .result-list {
    top: calc(100% + 12px);
    max-height: calc(100svh - 130px);
  }

  .library-drawer {
    inset: 0;
    width: 100vw;
    max-height: 100dvh;
    border: 0;
    clip-path: none;
  }

  .drawer-head {
    min-height: 70px;
    padding: 12px 14px;
  }

  .drawer-identity {
    gap: 10px;
  }

  .drawer-identity .module-index {
    display: none;
  }

  .drawer-brand {
    font-size: 20px;
  }

  .drawer-actions {
    gap: 6px;
  }

  .drawer-actions .icon-button:last-of-type {
    margin-left: 2px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .drawer-scroll {
    gap: 16px;
    padding: 14px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 64px;
    padding: 12px;
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .metric strong {
    font-size: 22px;
  }

  .filter-panel {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 14px;
    padding: 15px;
  }

  .panel-heading {
    display: flex;
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .quick-panel {
    gap: 12px;
    padding: 15px;
  }

  .random-actions {
    grid-template-columns: 1fr;
  }

  .library-head {
    align-items: flex-end;
    margin-bottom: 14px;
  }

  .library-title {
    display: block;
  }

  .library-title .module-index {
    display: block;
    margin-bottom: 8px;
  }

  .library-title h2 {
    font-size: 26px;
  }

  .status-tabs {
    margin-right: -14px;
    margin-bottom: 14px;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .media-card:hover {
    transform: none;
  }

  .media-card::before {
    top: 7px;
    left: 7px;
    min-width: 28px;
    height: 21px;
  }

  .favorite-flag {
    top: 7px;
    right: 7px;
    width: 28px;
    height: 28px;
  }

  .card-body {
    min-height: 168px;
    gap: 8px;
    padding: 11px;
  }

  .card-title {
    min-height: 38px;
    font-size: 12px;
    line-height: 1.5;
  }

  .card-meta {
    min-height: 16px;
    font-size: 8px;
  }

  .card-body > .pill {
    min-height: 30px;
    padding: 0 8px;
    font-size: 8px;
  }

  .score-row {
    gap: 5px;
  }

  .score-pill {
    min-height: 43px;
    padding: 6px 7px;
  }

  .score-label {
    font-size: 7px;
  }

  .score-pill strong {
    font-size: 14px;
  }

  dialog,
  .details-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    border: 0;
    clip-path: none;
  }

  .pin-dialog {
    width: calc(100vw - 28px);
    max-width: 430px;
    max-height: calc(100dvh - 28px);
    border: 1px solid var(--line-strong);
    clip-path: var(--clip-lg);
  }

  .pin-form {
    padding: 17px;
  }

  #detailsContent {
    max-height: 100dvh;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .detail-card-editor::after {
    background: linear-gradient(180deg, transparent 28%, rgba(5, 5, 5, 0.86) 47%, #050505 66%);
  }

  .detail-poster-frame,
  .detail-poster {
    min-height: min(62vh, 540px);
    max-height: min(62vh, 540px);
  }

  .detail-poster {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .detail-main {
    padding: 18px;
  }

  .edit-form {
    padding: 18px;
  }

  .edit-grid {
    grid-template-columns: 1fr;
  }

  .field.wide {
    grid-column: auto;
  }

  .poster-upload-control {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    min-height: 132px;
  }

  .poster-upload-actions .ghost-button {
    width: 100%;
  }

  .edit-dialog .dialog-actions {
    position: static;
    margin-top: 14px;
  }

  .dialog-actions {
    position: sticky;
    bottom: 0;
    background: var(--bg);
  }

  .toast {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 420px) {
  .search-stage {
    width: min(320px, calc(100vw - 56px));
    max-width: min(320px, calc(100vw - 56px));
  }

  .search-intro h1 {
    font-size: 34px;
  }

  .pin-form {
    gap: 13px;
    padding: 15px;
  }

  .pin-header h2 {
    font-size: 18px;
  }

  .pin-console {
    padding: 12px;
  }

  .pin-slots {
    gap: 5px;
  }

  .pin-keypad {
    gap: 5px;
  }

  .pin-keypad button {
    min-height: 44px;
  }

  .search-intro-meta .system-status {
    display: none;
  }

  .search-footnote span:last-child {
    display: none;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .library-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .muted-count {
    align-self: flex-start;
  }

  .viewer-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 370px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 4ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 4ms !important;
  }
}

@keyframes demo-target-tap {
  0% {
    transform: translateX(0) scale(1);
  }
  55% {
    transform: translateX(4px) scale(1.01);
  }
  100% {
    transform: translateX(0) scale(1);
  }
}

@keyframes demo-control-tap {
  0% {
    transform: translateY(0) scale(1);
  }
  48% {
    transform: translateY(1px) scale(0.96);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes dialog-demo-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.988);
  }
}

/* Premium polish layer */
:root {
  --bg: #050607;
  --bg-deep: #020303;
  --surface: #0d0f10;
  --surface-raised: #15181a;
  --surface-soft: #1a1d20;
  --ink: #f5f2ea;
  --ink-inverse: #07100f;
  --muted: #918f87;
  --muted-bright: #c8c1b3;
  --line: rgba(245, 242, 234, 0.12);
  --line-strong: rgba(245, 242, 234, 0.34);
  --signal: #f5f2ea;
  --accent: #87dfd1;
  --accent-warm: #f0b869;
  --accent-rose: #e99cb9;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.62);
  --radius-sm: 6px;
  --radius-md: 8px;
  --ease-out: cubic-bezier(0.18, 0.86, 0.22, 1);
  --ease-snap: cubic-bezier(0.2, 0.9, 0.2, 1);
}

body {
  background:
    linear-gradient(135deg, rgba(135, 223, 209, 0.07), transparent 28%),
    linear-gradient(210deg, rgba(240, 184, 105, 0.065), transparent 34%),
    linear-gradient(180deg, #060708 0%, #030404 100%);
}

body::before {
  opacity: 0.72;
  background-image:
    linear-gradient(90deg, rgba(245, 242, 234, 0.024) 1px, transparent 1px),
    linear-gradient(0deg, rgba(245, 242, 234, 0.02) 1px, transparent 1px);
  background-size: 96px 96px;
}

body::after {
  opacity: 0.1;
}

.system-chrome {
  min-height: 42px;
  background: rgba(5, 7, 8, 0.76);
  border-bottom-color: rgba(245, 242, 234, 0.1);
  letter-spacing: 0;
}

.module-index,
.system-status,
.search-footnote,
.metric span,
.field label,
.muted-count,
.tab-button,
.card-eyebrow,
.card-meta,
.score-label,
.detail-editor-label,
.pin-console-meta {
  letter-spacing: 0;
}

.home-shell {
  padding-top: 96px;
}

.home-shell::before {
  color: rgba(245, 242, 234, 0.022);
  letter-spacing: 0;
}

.search-stage {
  width: min(1120px, calc(100vw - 80px));
  min-height: 540px;
  padding: 28px 0;
}

.search-stage::before,
.search-stage::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.search-stage::before {
  right: 18px;
  bottom: 76px;
  z-index: -1;
  width: min(420px, 40vw);
  height: 260px;
  background:
    linear-gradient(90deg, rgba(245, 242, 234, 0.08) 0 1px, transparent 1px),
    linear-gradient(0deg, rgba(245, 242, 234, 0.06) 0 1px, transparent 1px);
  background-size: 34px 34px;
  border: 1px solid rgba(245, 242, 234, 0.08);
  border-radius: var(--radius-md);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  transform: perspective(760px) rotateY(-16deg) rotateX(4deg);
}

.search-stage::after {
  right: 64px;
  bottom: 132px;
  z-index: -1;
  width: 150px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  box-shadow: 0 0 30px rgba(135, 223, 209, 0.24);
  animation: line-grow 770ms 980ms var(--ease-snap) both;
}

.search-intro {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin-bottom: 28px;
}

.search-intro h1 {
  margin: 26px 0 16px;
  color: var(--signal);
  font-size: 82px;
  letter-spacing: 0;
  text-shadow: 0 28px 70px rgba(0, 0, 0, 0.62);
}

.search-intro h1 span {
  -webkit-text-stroke: 1px rgba(245, 242, 234, 0.48);
  letter-spacing: 0;
}

.search-intro p {
  max-width: 540px;
  color: var(--muted-bright);
  font-size: 16px;
  line-height: 1.6;
}

.hero-showcase {
  position: absolute;
  right: 16px;
  top: 124px;
  z-index: 0;
  display: grid;
  width: 280px;
  height: 270px;
  pointer-events: none;
}

.showcase-card {
  position: absolute;
  display: grid;
  width: 150px;
  aspect-ratio: 0.68;
  place-items: center;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.22), transparent 36%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 11px),
    #171a1d;
  border: 1px solid rgba(245, 242, 234, 0.18);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  animation: showcase-in 1260ms var(--ease-out) both;
}

.showcase-card::before {
  position: absolute;
  inset: 12px;
  content: "";
  border: 1px solid rgba(245, 242, 234, 0.18);
  border-radius: var(--radius-sm);
  transform: skew(-7deg);
}

.showcase-card b {
  position: relative;
  z-index: 1;
  color: var(--ink-inverse);
  background: var(--signal);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

.showcase-card small {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  color: var(--ink-inverse);
  background: var(--accent-warm);
  border-radius: var(--radius-sm);
  padding: 5px 7px;
  font-weight: 900;
}

.showcase-card.is-lime {
  right: 0;
  top: 14px;
  transform: rotate(5deg);
}

.showcase-card.is-ice {
  left: 0;
  top: 42px;
  background:
    linear-gradient(140deg, rgba(135, 223, 209, 0.28), transparent 34%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 13px),
    #161b1f;
  transform: rotate(-7deg);
  animation-delay: 245ms;
}

.showcase-card.is-amber {
  right: 54px;
  bottom: 0;
  background:
    linear-gradient(140deg, rgba(240, 184, 105, 0.28), transparent 34%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 12px),
    #1b1712;
  transform: rotate(2deg);
  animation-delay: 420ms;
}

.search-box,
.result-list,
.library-drawer,
.filter-panel,
.quick-panel,
.metric-grid,
.media-card,
.poster-frame,
.favorite-flag,
.pill,
.score-pill,
.empty-state,
dialog,
.toast,
input,
select,
textarea,
.round-button,
.icon-button,
.primary-button,
.ghost-button,
.segment,
.tab-button {
  border-radius: var(--radius-md);
  clip-path: none;
}

.search-box {
  grid-template-columns: 48px minmax(0, 1fr) 58px;
  min-height: 76px;
  background:
    linear-gradient(135deg, rgba(135, 223, 209, 0.1), transparent 42%),
    rgba(9, 11, 12, 0.86);
  border-color: rgba(245, 242, 234, 0.24);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.54), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 525ms ease, box-shadow 525ms ease, transform 525ms ease;
}

.search-box::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
}

#externalSearchForm:focus-within .search-box {
  border-color: rgba(135, 223, 209, 0.65);
  box-shadow: 0 30px 96px rgba(0, 0, 0, 0.58), 0 0 0 4px rgba(135, 223, 209, 0.08);
  transform: translateY(-1px);
}

.search-prefix {
  border-right-color: rgba(245, 242, 234, 0.1);
}

#externalQuery {
  font-size: 17px;
}

#externalQuery::placeholder {
  color: rgba(245, 242, 234, 0.42);
}

.round-button,
.icon-button,
.primary-button,
.ghost-button,
.segment,
.tab-button,
.owner-mode-button,
.status-choice,
.rating-step {
  transition:
    transform 455ms var(--ease-out),
    border-color 455ms ease,
    background 455ms ease,
    color 455ms ease,
    box-shadow 455ms ease;
}

.owner-mode-button {
  position: relative;
  display: inline-flex;
  min-width: 154px;
  height: 56px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  overflow: hidden;
  color: var(--ink);
  background: rgba(245, 242, 234, 0.06);
  border: 1px solid rgba(245, 242, 234, 0.22);
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.owner-mode-button::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0;
  background: linear-gradient(135deg, rgba(135, 223, 209, 0.28), rgba(240, 184, 105, 0.16));
  transition: opacity 455ms ease;
}

.owner-mode-button span,
.owner-mode-button svg {
  position: relative;
  z-index: 1;
}

.owner-mode-button svg {
  width: 18px;
  height: 18px;
  transition: transform 455ms var(--ease-out);
}

.owner-mode-button:hover {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
  box-shadow: 0 12px 34px rgba(245, 242, 234, 0.14);
  transform: translateY(-1px);
}

.owner-mode-button:hover::before {
  opacity: 1;
}

.owner-mode-button:hover svg {
  transform: translateX(-2px) rotate(-4deg);
}

.owner-mode-button:active,
.round-button:active,
.icon-button:active,
.primary-button:active,
.ghost-button:active,
.tab-button:active {
  transform: translateY(1px) scale(0.99);
}

.search-box .round-button[type="submit"] {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
  box-shadow: 0 10px 26px rgba(245, 242, 234, 0.12);
}

.search-box .round-button[type="submit"]:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.search-footnote {
  color: rgba(245, 242, 234, 0.42);
}

.result-list {
  gap: 8px;
  padding: 10px;
  background: rgba(8, 10, 11, 0.94);
  border-color: rgba(245, 242, 234, 0.22);
}

.result-row {
  border-radius: var(--radius-md);
  clip-path: none;
}

.result-row[data-result-row]:hover,
.result-row.is-active {
  background: rgba(135, 223, 209, 0.08);
  border-color: rgba(135, 223, 209, 0.38);
}

.library-drawer {
  inset: 18px;
  width: min(1600px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  background:
    linear-gradient(135deg, rgba(135, 223, 209, 0.075), transparent 36%),
    linear-gradient(210deg, rgba(240, 184, 105, 0.06), transparent 34%),
    rgba(6, 8, 9, 0.96);
  border-color: rgba(245, 242, 234, 0.2);
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.72);
  transform: translateY(12px) scale(0.986);
  transition: opacity 525ms ease, transform 735ms var(--ease-out);
}

.drawer-open .library-drawer {
  transform: translateY(0) scale(1);
}

.drawer-backdrop {
  background: rgba(0, 0, 0, 0.66);
}

.drawer-head {
  min-height: 78px;
  background: rgba(10, 12, 13, 0.88);
  border-bottom-color: rgba(245, 242, 234, 0.1);
}

.drawer-brand,
.library-title h2,
.dialog-title-row h2,
.pin-header h2 {
  letter-spacing: 0;
}

.drawer-actions {
  gap: 10px;
}

.drawer-actions .icon-button,
.icon-button {
  background: rgba(245, 242, 234, 0.045);
  border-color: rgba(245, 242, 234, 0.18);
}

.icon-button:hover,
.ghost-button:hover,
.tab-button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.drawer-scroll {
  gap: 24px;
  padding: 24px;
  grid-template-areas: none;
  grid-template-columns: 238px minmax(0, 1fr);
}

.metric-grid {
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 88px;
  gap: 1px;
  overflow: hidden;
  background: rgba(245, 242, 234, 0.09);
  border: 1px solid rgba(245, 242, 234, 0.12);
}

.filter-panel {
  grid-column: 1;
  grid-row: 2;
}

.library-panel {
  grid-column: 2;
  grid-row: 2;
}

.metric {
  min-height: 86px;
  height: 86px;
  grid-template-columns: minmax(0, 1fr) 38px;
  grid-template-rows: auto auto;
  align-items: center;
  padding: 14px 18px;
  background:
    linear-gradient(135deg, rgba(245, 242, 234, 0.045), transparent),
    rgba(12, 14, 15, 0.92);
  border-right: 0;
}

.metric::before {
  display: none;
}

.metric-icon {
  grid-column: 2;
  grid-row: 1 / 3;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--accent);
  background: rgba(135, 223, 209, 0.1);
  border: 1px solid rgba(135, 223, 209, 0.22);
  border-radius: var(--radius-sm);
}

.metric-icon svg {
  width: 17px;
  height: 17px;
}

.metric strong {
  grid-column: 1;
  grid-row: 1;
  font-size: 29px;
}

.metric span:not(.metric-icon) {
  grid-column: 1;
  grid-row: 2;
}

.filter-panel {
  background: rgba(13, 15, 16, 0.82);
  border-color: rgba(245, 242, 234, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.filter-panel::after {
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
}

input,
select,
textarea {
  background: rgba(245, 242, 234, 0.045);
  border-color: rgba(245, 242, 234, 0.14);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(135, 223, 209, 0.58);
  box-shadow: 0 0 0 3px rgba(135, 223, 209, 0.1);
}

.check-line input {
  accent-color: var(--accent);
}

.library-title {
  gap: 14px;
}

.library-title h2 {
  font-size: 34px;
}

.tab-button {
  min-height: 40px;
  padding: 0 13px;
  background: rgba(245, 242, 234, 0.035);
}

.tab-button.is-active {
  color: var(--ink-inverse);
  background: var(--accent);
  border-color: var(--accent);
  animation: selected-snap 490ms var(--ease-out) backwards;
}

.tab-button.is-active .tab-count {
  background: rgba(7, 16, 15, 0.92);
}

.card-grid {
  gap: 18px;
}

.media-card {
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 46%),
    #0d0f10;
  border-color: rgba(245, 242, 234, 0.13);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  transition:
    transform 595ms var(--ease-out),
    border-color 595ms ease,
    box-shadow 595ms ease,
    background 595ms ease;
}

.drawer-open .media-card {
  animation: premium-card-enter 840ms 315ms var(--ease-out) backwards;
}

.media-card::before {
  top: 12px;
  left: 12px;
  color: var(--ink-inverse);
  background: rgba(245, 242, 234, 0.94);
  border-radius: var(--radius-sm);
  clip-path: none;
}

.media-card::after {
  width: auto;
  height: auto;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: linear-gradient(135deg, rgba(135, 223, 209, 0.16), transparent 38%, rgba(240, 184, 105, 0.1));
  transition: opacity 595ms ease;
}

.media-card:hover {
  border-color: rgba(135, 223, 209, 0.38);
  box-shadow: 0 24px 62px rgba(0, 0, 0, 0.44), 0 0 0 1px rgba(135, 223, 209, 0.08);
  transform: translateY(-5px);
}

.media-card:hover::after {
  height: auto;
  opacity: 1;
}

.poster-frame {
  border-bottom-color: rgba(245, 242, 234, 0.1);
}

.poster-frame::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
}

.media-card:hover .poster-frame::before {
  animation: card-scan 840ms ease-out both;
}

.poster-frame::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.03), transparent 52%, rgba(0, 0, 0, 0.44)),
    linear-gradient(135deg, rgba(135, 223, 209, 0.08), transparent 38%);
}

.favorite-flag {
  top: 12px;
  right: 12px;
  color: var(--ink-inverse);
  background: var(--accent-warm);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  animation: favorite-pop 630ms var(--ease-out) both;
}

.card-body {
  min-height: 170px;
  gap: 9px;
  padding: 15px;
  background: rgba(10, 12, 13, 0.96);
}

.card-eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 16px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
}

.card-eyebrow span + span::before {
  margin-right: 6px;
  content: "/";
  color: rgba(245, 242, 234, 0.28);
}

.card-title {
  min-height: 46px;
  font-size: 15px;
  letter-spacing: 0;
}

.card-body > .pill {
  background: rgba(245, 242, 234, 0.06);
}

.pill.watching {
  background: var(--accent);
  border-color: var(--accent);
}

.pill.completed {
  background: var(--signal);
}

.pill.planned {
  background: rgba(240, 184, 105, 0.14);
  border-color: rgba(240, 184, 105, 0.24);
}

.score-pill {
  background: var(--signal);
  border-color: var(--signal);
}

.score-pill.public {
  background: rgba(245, 242, 234, 0.045);
  border-color: rgba(245, 242, 234, 0.18);
}

.empty-state {
  grid-template-columns: auto minmax(0, 420px);
  gap: 18px;
  min-height: 260px;
  place-items: center;
  justify-content: center;
  padding: 34px;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(135, 223, 209, 0.08), transparent 42%),
    linear-gradient(210deg, rgba(240, 184, 105, 0.07), transparent 44%),
    rgba(245, 242, 234, 0.025);
  border: 1px solid rgba(245, 242, 234, 0.14);
}

.empty-state-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: var(--accent);
  background: rgba(135, 223, 209, 0.1);
  border: 1px solid rgba(135, 223, 209, 0.24);
  border-radius: var(--radius-md);
  animation: control-pop 525ms var(--ease-out) both;
}

.empty-state-icon svg {
  width: 25px;
  height: 25px;
}

.empty-state strong {
  margin-bottom: 10px;
  letter-spacing: 0;
}

dialog {
  background:
    linear-gradient(135deg, rgba(135, 223, 209, 0.055), transparent 42%),
    #07090a;
  border-color: rgba(245, 242, 234, 0.2);
}

dialog[open] {
  animation: premium-dialog-in 630ms var(--ease-out) both;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.details-dialog {
  width: min(1080px, calc(100vw - 32px));
}

.detail-layout {
  background: rgba(7, 9, 10, 0.96);
}

.detail-cube,
.detail-favorite-button,
.detail-source-icon,
.status-choice,
.detail-rating-editor,
.detail-stat,
.info-cell,
.viewer-chip,
.detail-delete-button {
  border-radius: var(--radius-md);
  clip-path: none;
}

.detail-favorite-button.is-active {
  background: var(--accent-warm);
  border-color: var(--accent-warm);
}

.service-score {
  border-color: rgba(135, 223, 209, 0.22);
  background:
    linear-gradient(135deg, rgba(135, 223, 209, 0.1), transparent),
    rgba(245, 242, 234, 0.035);
}

.detail-card-footer {
  gap: 8px;
}

.toast {
  background: rgba(9, 11, 12, 0.96);
  border-color: rgba(135, 223, 209, 0.24);
}

.confirm-dialog {
  width: min(520px, calc(100vw - 32px));
}

.confirm-form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.confirm-message {
  margin: 0;
  color: var(--muted-bright);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.55;
}

.primary-button.danger,
.primary-button.danger:hover {
  color: var(--ink-inverse);
  background: var(--accent-warm);
  border-color: var(--accent-warm);
}

.pin-dialog {
  background:
    linear-gradient(135deg, rgba(135, 223, 209, 0.08), transparent 42%),
    #080a0b;
  border-color: rgba(135, 223, 209, 0.24);
}

.pin-form {
  gap: 18px;
  padding: 22px;
}

.pin-form::after,
.pin-console::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
}

.pin-console {
  background: rgba(245, 242, 234, 0.035);
  border-color: rgba(245, 242, 234, 0.14);
  border-radius: var(--radius-md);
  clip-path: none;
}

.pin-slots span,
.pin-keypad button,
.pin-submit-button {
  border-radius: var(--radius-md);
  clip-path: none;
}

.pin-slots span {
  background: rgba(245, 242, 234, 0.045);
  border-color: rgba(245, 242, 234, 0.18);
}

.pin-slots span.is-filled,
.pin-slots span.is-current {
  border-color: rgba(135, 223, 209, 0.7);
}

.pin-slots span::after {
  background: var(--accent);
  box-shadow: 0 0 14px rgba(135, 223, 209, 0.32);
}

.pin-keypad button {
  background: rgba(245, 242, 234, 0.045);
  border-color: rgba(245, 242, 234, 0.14);
}

.pin-keypad button:hover {
  color: var(--ink-inverse);
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.pin-submit-button {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
}

.pin-submit-button:not(:disabled):hover {
  background: var(--accent);
  border-color: var(--accent);
}

.pin-submit-button:disabled {
  color: var(--muted);
  background: rgba(245, 242, 234, 0.045);
  border-color: rgba(245, 242, 234, 0.12);
}

.poster-demo {
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 40%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 8px, transparent 8px 18px),
    #141719;
}

.poster-demo::before,
.poster-demo > span {
  border-radius: var(--radius-sm);
  clip-path: none;
}

.poster-demo > span {
  color: var(--ink-inverse);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.tone-white {
  color: var(--ink-inverse);
  background:
    linear-gradient(135deg, rgba(135, 223, 209, 0.2), transparent 36%),
    #e7e1d6;
}

.tone-cyan,
.tone-ice {
  background:
    linear-gradient(135deg, rgba(135, 223, 209, 0.38), transparent 34%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 12px),
    #182128;
}

.tone-dark {
  color: var(--accent-rose);
  background:
    linear-gradient(135deg, rgba(233, 156, 185, 0.16), transparent 40%),
    #050506;
}

.tone-lime {
  background:
    linear-gradient(135deg, rgba(135, 223, 209, 0.34), transparent 38%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.11) 0 8px, transparent 8px 18px),
    #14201d;
}

.tone-steel,
.tone-grid,
.tone-mono {
  background:
    linear-gradient(135deg, rgba(240, 184, 105, 0.18), transparent 40%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 12px),
    #141617;
}

@keyframes showcase-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
  }
}

@keyframes premium-card-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.982);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes premium-dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.982);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes favorite-pop {
  0% {
    opacity: 0;
    transform: scale(0.72) rotate(-10deg);
  }
  70% {
    opacity: 1;
    transform: scale(1.06) rotate(4deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@media (max-width: 920px) {
  .search-stage {
    min-height: 500px;
  }

  .search-intro h1 {
    font-size: 66px;
  }

  .hero-showcase {
    right: -18px;
    width: 220px;
    opacity: 0.58;
  }

  .showcase-card {
    width: 120px;
  }
}

@media (max-width: 680px) {
  .home-shell {
    place-items: start center;
    padding: 72px 16px 30px;
  }

  .search-stage {
    width: min(430px, calc(100vw - 32px));
    max-width: min(430px, calc(100vw - 32px));
    min-height: 0;
    padding: 10px 0;
  }

  .search-stage::before,
  .search-stage::after,
  .hero-showcase {
    display: none;
  }

  .search-intro {
    margin-bottom: 22px;
  }

  .search-intro h1 {
    margin-top: 20px;
    font-size: 42px;
    line-height: 0.95;
  }

  .search-intro p {
    font-size: 14px;
  }

  .search-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 50px;
    gap: 8px;
    min-height: 0;
  }

  .search-box::before {
    left: 14px;
  }

  #externalQuery {
    width: 100%;
    height: 50px;
    padding: 0 12px;
  }

  .search-box .round-button {
    width: 50px;
    height: 50px;
  }

  .owner-mode-button {
    width: auto;
    min-width: 0;
    height: 48px;
  }

  .library-drawer {
    inset: 0;
    width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }

  .drawer-scroll {
    padding: 14px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 76px;
    padding: 14px;
  }

  .filter-panel {
    position: relative;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .media-card-open {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    min-height: 180px;
  }

  .poster-frame {
    height: 100%;
    aspect-ratio: auto;
    border-right: 1px solid rgba(245, 242, 234, 0.1);
    border-bottom: 0;
  }

  .card-body {
    min-height: 180px;
    padding: 13px;
  }

  .card-title {
    min-height: auto;
    font-size: 14px;
  }

  .score-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .empty-state {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 230px;
    text-align: center;
  }

  .dialog-actions {
    background: rgba(7, 9, 10, 0.96);
  }
}

@media (max-width: 420px) {
  .search-stage {
    width: min(390px, calc(100vw - 28px));
    max-width: min(390px, calc(100vw - 28px));
  }

  .search-intro h1 {
    font-size: 38px;
  }

  .media-card-open {
    grid-template-columns: 104px minmax(0, 1fr);
  }
}

/* Reference correction: restore the monochrome archive identity. */
:root {
  --bg: #050505;
  --bg-deep: #020202;
  --surface: #0b0b0b;
  --surface-raised: #111;
  --surface-soft: #171717;
  --ink: #f3f3ef;
  --ink-inverse: #070707;
  --muted: #8d8d88;
  --muted-bright: #b9b9b3;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.42);
  --signal: #f0f0eb;
  --accent: #f0f0eb;
  --accent-warm: #f0f0eb;
  --accent-rose: #c7c7c2;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.72);
  --radius-sm: 0;
  --radius-md: 0;
  --micro-font: "Exo 2", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background:
    radial-gradient(circle at 72% 44%, rgba(255, 255, 255, 0.035), transparent 32%),
    linear-gradient(180deg, #050505, #020202);
}

body::before {
  opacity: 1;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 88px 88px;
}

body::after {
  opacity: 0.14;
}

.system-chrome {
  background: rgba(3, 3, 3, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.home-shell {
  place-items: center;
}

.search-stage {
  width: min(960px, calc(100vw - 80px));
  min-height: 0;
  padding: 0;
}

.search-stage::before,
.search-stage::after,
.hero-showcase,
.showcase-card {
  display: none !important;
}

.search-intro {
  max-width: none;
  margin-bottom: 30px;
}

.search-intro h1 {
  margin: 28px 0 12px;
  color: var(--ink);
  font-size: 86px;
  line-height: 0.88;
  text-shadow: none;
}

.search-intro h1 span {
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.42);
}

.search-intro p {
  max-width: none;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.search-box,
.result-list,
.library-drawer,
.filter-panel,
.metric-grid,
.media-card,
.poster-frame,
.favorite-flag,
.pill,
.score-pill,
.empty-state,
dialog,
.toast,
input,
select,
textarea,
.round-button,
.icon-button,
.primary-button,
.ghost-button,
.segment,
.tab-button,
.owner-mode-button,
.status-choice,
.favorite-toggle-button,
.random-button,
.detail-cube,
.detail-favorite-button,
.detail-source-icon,
.detail-rating-editor,
.detail-stat,
.info-cell,
.viewer-chip,
.detail-delete-button,
.pin-console,
.pin-slots span,
.pin-keypad button,
.pin-submit-button {
  border-radius: 0;
}

.search-box {
  grid-template-columns: 48px minmax(0, 1fr) 58px;
  min-height: 78px;
  background: rgba(7, 7, 7, 0.94);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  clip-path: var(--clip-lg);
}

.search-box::before,
.pin-form::after,
.pin-console::before,
.filter-panel::after {
  background: var(--signal);
}

#externalSearchForm:focus-within .search-box {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  transform: none;
}

.round-button,
.icon-button,
.primary-button,
.ghost-button,
.segment,
.tab-button,
.owner-mode-button {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
  clip-path: var(--clip-sm);
}

.owner-mode-button {
  width: auto;
  min-width: 116px;
  height: 56px;
  padding: 0 14px;
  gap: 8px;
}

.owner-mode-button span {
  position: relative;
  width: auto;
  height: auto;
  overflow: hidden;
  clip: auto;
  text-transform: uppercase;
  white-space: normal;
}

.owner-mode-button::before {
  display: none;
}

.round-button:hover,
.icon-button:hover,
.primary-button:hover,
.ghost-button:hover,
.segment:hover,
.tab-button:hover,
.owner-mode-button:hover {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
  box-shadow: none;
}

.search-box .round-button[type="submit"],
.pin-submit-button:not(:disabled),
.primary-button {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
}

.search-box .round-button[type="submit"]:hover,
.pin-submit-button:not(:disabled):hover,
.primary-button:hover {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

.library-drawer {
  inset: 14px;
  width: min(1660px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.7) 0 2px, transparent 2px),
    rgba(5, 5, 5, 0.95);
  border-color: var(--line-strong);
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.86);
  clip-path: var(--clip-lg);
}

.drawer-head {
  background: rgba(7, 7, 7, 0.94);
  border-bottom-color: var(--line);
}

.drawer-scroll {
  grid-template-areas:
    "metrics metrics"
    "controls library";
  grid-template-columns: 238px minmax(0, 1fr);
  grid-template-rows: minmax(84px, auto) auto;
  gap: 22px;
  padding: 22px;
}

.metric-grid {
  grid-area: metrics;
  min-height: 84px;
  gap: 0;
  overflow: visible;
  background: transparent;
  border-top: 1px solid var(--line);
  border-right: 0;
  border-bottom: 1px solid var(--line);
  border-left: 0;
}

.filter-panel {
  grid-area: filters;
  background: rgba(14, 14, 14, 0.88);
  border-color: var(--line);
  box-shadow: none;
  clip-path: var(--clip-md);
}

.control-stack {
  grid-area: controls;
  gap: 22px;
}

.control-stack > * {
  grid-area: auto;
}

.favorite-panel {
  grid-area: favorites;
}

.random-panel {
  grid-area: random;
}

.quick-panel {
  background: rgba(14, 14, 14, 0.88);
  border-color: var(--line);
  box-shadow: none;
  clip-path: var(--clip-md);
}

.quick-panel::after {
  background: var(--signal);
}

.library-panel {
  grid-area: library;
}

.metric {
  appearance: none;
  height: auto;
  min-height: 74px;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: baseline;
  gap: 12px;
  padding: 16px 18px;
  color: inherit;
  font: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
  transition:
    background 245ms ease,
    border-color 245ms ease,
    color 245ms ease;
}

.metric:last-child {
  border-right: 0;
}

.metric:hover,
.metric.is-active {
  background: rgba(255, 255, 255, 0.045);
}

.metric.is-active::before {
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.34);
}

.metric-icon {
  display: none;
}

.metric::before {
  display: block;
}

.metric strong,
.metric span:not(.metric-icon) {
  grid-column: 2;
}

.metric strong {
  grid-row: 1;
  font-size: 27px;
}

.metric span:not(.metric-icon) {
  grid-row: 2;
}

input,
select,
textarea {
  background: #111;
  border-color: var(--line);
  clip-path: var(--clip-sm);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.check-line input {
  accent-color: var(--signal);
}

.tab-button {
  min-height: 37px;
  background: transparent;
}

.tab-button.is-active {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
}

.tab-button.is-active .tab-count {
  color: var(--ink);
  background: var(--ink-inverse);
}

.card-grid {
  gap: 16px;
}

.media-card {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
  clip-path: var(--clip-md);
}

.drawer-open .media-card {
  animation: card-enter 770ms 420ms cubic-bezier(0.2, 0.88, 0.2, 1) backwards;
}

.media-card::before {
  color: var(--ink-inverse);
  background: var(--signal);
  clip-path: var(--clip-sm);
}

.media-card::after {
  inset: auto 0 0 auto;
  width: 2px;
  height: 0;
  z-index: auto;
  opacity: 1;
  background: var(--signal);
  transition: transform 770ms ease;
}

.media-card:hover {
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42);
  transform: translateY(-4px);
}

.media-card:hover::after {
  height: 100%;
}

.poster-frame {
  border-bottom-color: var(--line);
}

.poster-frame::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), transparent 58%, rgba(0, 0, 0, 0.3)),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(255, 255, 255, 0.014) 4px 5px);
}

.favorite-flag,
.detail-favorite-button.is-active {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
  clip-path: var(--clip-sm);
}

.card-body {
  min-height: 176px;
  gap: 10px;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0 2px, transparent 2px),
    var(--surface);
}

.card-eyebrow {
  color: var(--muted);
}

.card-title {
  min-height: 42px;
  font-size: 14px;
}

.pill.watching,
.pill.completed,
.score-pill,
.primary-button.danger,
.primary-button.danger:hover {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
}

.pill.planned,
.score-pill.public {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

.empty-state {
  grid-template-columns: auto minmax(0, 420px);
  background:
    linear-gradient(135deg, transparent 49.8%, rgba(255, 255, 255, 0.04) 50%, transparent 50.2%),
    rgba(255, 255, 255, 0.018);
  border: 1px dashed var(--line-strong);
  clip-path: var(--clip-md);
}

.empty-state-icon {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
  clip-path: var(--clip-sm);
}

dialog,
.pin-dialog {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0 3px, transparent 3px),
    #060606;
  border-color: var(--line-strong);
  clip-path: var(--clip-lg);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.detail-layout {
  background: var(--bg);
}

.service-score,
.pin-console {
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--line);
  clip-path: var(--clip-md);
}

.service-score {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.service-score span {
  color: var(--muted-bright);
}

.service-score strong {
  color: var(--ink);
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.16);
}

.detail-score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.detail-score-grid .service-score {
  min-height: 76px;
  padding: 12px 14px;
  transition: transform 245ms var(--ease-out), border-color 245ms ease, background 245ms ease;
}

.detail-score-grid .service-score:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.detail-score-grid .service-score.is-personal {
  color: var(--ink-inverse);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(240, 240, 235, 0.78)),
    var(--signal);
  border-color: var(--signal);
  box-shadow: 0 14px 34px rgba(255, 255, 255, 0.08);
}

.detail-score-grid .service-score.is-personal span,
.detail-score-grid .service-score.is-personal strong {
  color: var(--ink-inverse);
}

.detail-score-grid .service-score.is-public {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 58%),
    rgba(255, 255, 255, 0.025);
}

@media (max-width: 680px) {
  .detail-score-grid {
    grid-template-columns: 1fr;
  }
}

.pin-slots span,
.pin-keypad button,
.pin-submit-button {
  clip-path: var(--clip-sm);
}

.pin-slots span {
  background: #0e0e0e;
  border-color: var(--line-strong);
}

.pin-slots span.is-filled,
.pin-slots span.is-current {
  border-color: rgba(255, 255, 255, 0.7);
}

.pin-slots span::after {
  background: var(--signal);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.28);
}

.pin-keypad button {
  background: var(--surface);
  border-color: var(--line);
}

.pin-keypad button:hover {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
}

.pin-submit-button:disabled {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.poster-demo {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 38%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 9px, transparent 9px 18px),
    #111;
}

.poster-demo::before,
.poster-demo > span {
  border-radius: 0;
  clip-path: var(--clip-sm);
}

.poster-demo > span {
  color: #000;
  background: #fff;
  box-shadow: none;
}

.tone-white {
  color: #000;
  background: #f2f2f2;
}

.tone-cyan,
.tone-ice {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.52), transparent 32%),
    #252525;
}

.tone-dark {
  color: #8f8f8f;
  background: #000;
}

.tone-lime {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.36), transparent 38%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 8px, transparent 8px 16px),
    #1b1b1b;
}

.tone-steel,
.tone-grid,
.tone-mono {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 44%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0 2px, transparent 2px 12px),
    #101010;
}

@media (max-width: 680px) {
  .home-shell {
    place-items: start center;
  }

  .search-stage {
    width: min(430px, calc(100vw - 32px));
    max-width: min(430px, calc(100vw - 32px));
  }

  .search-box {
    grid-template-columns: minmax(0, 1fr) 50px;
    clip-path: var(--clip-md);
  }

  .owner-mode-button {
    width: auto;
    min-width: 116px;
  }

  .owner-mode-button span {
    position: relative;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .library-drawer {
    inset: 0;
    width: 100vw;
    max-height: 100dvh;
    clip-path: none;
  }

  .drawer-scroll {
    display: flex;
    flex-direction: column;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-card-open {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .poster-frame {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
}

.search-stage {
  --list-button-width: 124px;
  --auth-button-width: 78px;
  --search-row-gap: 12px;
}

.search-control-row {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: var(--list-button-width) minmax(0, 1fr) var(--auth-button-width);
  align-items: stretch;
  gap: var(--search-row-gap);
  width: 100%;
  max-width: 100%;
}

.search-control-row .owner-mode-button {
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 78px;
  align-self: stretch;
}

.search-control-row .search-box {
  width: 100%;
  min-width: 0;
}

.search-control-row .hero-auth-button {
  padding-right: 10px;
  padding-left: 10px;
}

.search-actions {
  display: none;
}

.result-list {
  right: calc(var(--auth-button-width) + var(--search-row-gap));
  left: calc(var(--list-button-width) + var(--search-row-gap));
}

@media (max-width: 680px) {
  .search-stage {
    --list-button-width: 88px;
    --auth-button-width: 50px;
    --search-row-gap: 5px;
  }

  .search-control-row {
    grid-template-columns: var(--list-button-width) minmax(0, 1fr) var(--auth-button-width);
  }

  .search-control-row .owner-mode-button {
    min-width: 0;
    min-height: 66px;
    padding: 0 10px;
    font-size: 10px;
  }

  .search-control-row .search-box {
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 6px;
    padding: 6px;
  }

  .search-control-row #externalQuery {
    padding-right: 8px;
    padding-left: 8px;
    font-size: 15px;
  }

  .search-control-row .search-box .round-button {
    width: 46px;
  }

  .search-control-row .hero-auth-button svg {
    display: none;
  }

  .result-list {
    right: 0;
    left: 0;
  }
}

@media (max-width: 370px) {
  .search-stage {
    --list-button-width: 82px;
    --auth-button-width: 50px;
    --search-row-gap: 5px;
  }

  .search-control-row .owner-mode-button {
    gap: 6px;
    padding: 0 8px;
  }

  .search-control-row #externalQuery {
    padding-right: 6px;
    padding-left: 6px;
    font-size: 14px;
  }
}

.custom-cursor {
  display: none;
}

.custom-cursor-layer {
  display: none;
}

@media (pointer: fine) {
  body.has-custom-cursor.cursor-ready,
  body.has-custom-cursor.cursor-ready * {
    cursor: none !important;
  }

  .custom-cursor-layer {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: block;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    pointer-events: none;
    background: transparent;
    border: 0;
    color: inherit;
  }

  .custom-cursor-layer::backdrop {
    display: none;
    background: transparent;
  }

  .custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2147483647;
    display: block;
    width: 34px;
    height: 34px;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(
      calc(var(--cursor-x, -90px) - 17px),
      calc(var(--cursor-y, -90px) - 17px),
      0
    );
    transition:
      opacity 140ms ease,
      filter 180ms ease;
    will-change: transform, opacity;
    mix-blend-mode: difference;
  }

  body.cursor-ready .custom-cursor {
    opacity: 0.96;
  }

  body.cursor-demoing .custom-cursor {
    transition:
      transform 760ms cubic-bezier(0.16, 0.94, 0.18, 1),
      opacity 140ms ease,
      filter 180ms ease;
    mix-blend-mode: normal;
  }

  .custom-cursor::before,
  .custom-cursor::after {
    position: absolute;
    top: 50%;
    left: 50%;
    content: "";
    background: rgba(240, 240, 235, 0.56);
    transform: translate(-50%, -50%);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .custom-cursor::before {
    width: 48px;
    height: 1px;
  }

  .custom-cursor::after {
    width: 1px;
    height: 48px;
  }

  .custom-cursor-ring,
  .custom-cursor-dot {
    position: absolute;
    pointer-events: none;
  }

  .custom-cursor-ring {
    inset: 0;
    border: 1px solid rgba(240, 240, 235, 0.84);
    border-radius: 50%;
    box-shadow:
      0 0 0 1px rgba(240, 240, 235, 0.08),
      0 0 28px rgba(240, 240, 235, 0.14);
    transition:
      transform 180ms cubic-bezier(0.2, 0.9, 0.2, 1),
      border-color 180ms ease,
      background 180ms ease,
      box-shadow 180ms ease;
  }

  .custom-cursor-dot {
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--signal);
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(240, 240, 235, 0.56);
    transform: translate(-50%, -50%);
  }

  .custom-cursor-label {
    position: absolute;
    top: -19px;
    left: 28px;
    min-width: max-content;
    padding: 4px 7px 3px;
    color: var(--ink-inverse);
    background: var(--signal);
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 2px;
    font-family: "Russo One", "Exo 2", sans-serif;
    font-size: 9px;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
    transform: translate(-4px, 5px);
    transition: opacity 160ms ease, transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1);
  }

  .custom-cursor.has-label .custom-cursor-label {
    opacity: 1;
    transform: translate(0, 0);
  }

  .custom-cursor.is-demo {
    filter: drop-shadow(0 0 18px rgba(240, 240, 235, 0.18));
  }

  .custom-cursor.is-demo .custom-cursor-ring {
    border-color: var(--signal);
    box-shadow:
      0 0 0 1px rgba(240, 240, 235, 0.18),
      0 0 36px rgba(240, 240, 235, 0.26);
  }

  .custom-cursor.is-pressing .custom-cursor-ring {
    background: rgba(240, 240, 235, 0.18);
    transform: scale(0.62);
  }

  .custom-cursor.is-pressing::before {
    transform: translate(-50%, -50%) scaleX(0.58);
  }

  .custom-cursor.is-pressing::after {
    transform: translate(-50%, -50%) scaleY(0.58);
  }
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .custom-cursor-layer,
  .custom-cursor {
    display: none !important;
  }
}

.poster-image-wrap {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--surface-soft);
}

.poster-image,
.poster-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-thumb-image {
  display: block;
  width: 52px;
  height: 62px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.result-thumb-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-image-wrap.is-poster-missing img,
.result-thumb-image.is-poster-missing img {
  display: none;
}

.poster-image-wrap.is-poster-missing::after,
.result-thumb-image.is-poster-missing::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 42px;
  line-height: 1;
  content: attr(data-poster-fallback);
  background:
    linear-gradient(135deg, rgba(245, 242, 234, 0.14), transparent 48%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 8px),
    #111314;
}

.result-thumb-image.is-poster-missing::after {
  font-size: 14px;
}

.auth-button {
  min-width: 58px;
}

.auth-button span {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-button.is-active {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
}

.drawer-brand {
  white-space: nowrap;
}

@media (max-width: 680px) {
  .drawer-head {
    gap: 8px;
  }

  .drawer-identity {
    min-width: 0;
    overflow: hidden;
  }

  .drawer-brand {
    max-width: 78px;
    overflow: hidden;
    font-size: 15px;
    text-overflow: clip;
  }

  .drawer-actions {
    flex: 0 0 auto;
  }

  .drawer-actions .icon-button {
    width: 40px;
    height: 40px;
  }

  .drawer-actions .auth-button {
    min-width: 54px;
  }
}

@media (max-width: 420px) {
  .drawer-brand {
    max-width: 78px;
  }

  .drawer-actions {
    gap: 5px;
  }
}

.viewer-mode #addButton,
.viewer-mode .detail-favorite-button,
.viewer-mode .detail-status-editor,
.viewer-mode .detail-rating-editor,
.viewer-mode .detail-card-footer {
  display: none !important;
}

.server-backed-mode .storage-warning {
  display: none !important;
}

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

.result-title-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.result-title-line .result-title {
  min-width: 0;
}

.result-owned {
  display: inline-grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink-inverse);
  background: var(--signal);
  border: 1px solid var(--signal);
  clip-path: var(--clip-sm);
  transition: transform 180ms var(--ease-out);
}

.result-owned svg {
  width: 13px;
  height: 13px;
  stroke-width: 3;
}

.result-row.is-in-library:hover .result-owned,
.result-row.is-in-library.is-active .result-owned {
  transform: scale(1.04);
}

.module-index,
.system-chrome,
.system-status,
.search-footnote,
.search-prefix,
.owner-access-copy small,
.owner-mode-button,
.auth-button span,
.metric span:not(.metric-icon),
.favorite-toggle-button,
.favorite-toggle-button small,
.filter-toggle-button,
.random-button,
.field label,
.muted-count,
.tab-button,
.tab-count,
.card-eyebrow,
.card-meta,
.result-meta,
.score-label,
.detail-cube,
.service-score span,
.detail-editor-label,
.rating-head span,
.status-choice,
.detail-delete-button,
.viewer-chip,
.detail-stat span,
.info-cell span,
.pin-console-meta,
.pin-keypad button,
.pin-submit-button,
.primary-button,
.ghost-button,
.pill,
.custom-cursor-label {
  font-family: var(--micro-font);
  font-weight: 740;
  letter-spacing: 0.012em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "wght" 740;
}

.module-index,
.system-chrome,
.search-footnote,
.pin-console-meta {
  font-weight: 680;
  font-variation-settings: "wght" 680;
}

.tab-button,
.owner-mode-button,
.auth-button span,
.primary-button,
.ghost-button,
.pin-submit-button,
.status-choice,
.detail-delete-button,
.viewer-chip,
.custom-cursor-label {
  font-weight: 760;
  font-variation-settings: "wght" 760;
}

.tab-count,
.metric span:not(.metric-icon),
.score-label,
.detail-cube,
.service-score span,
.detail-editor-label,
.rating-head span,
.detail-stat span,
.info-cell span {
  font-weight: 700;
  font-variation-settings: "wght" 700;
}

.control-stack > .filter-panel,
.control-stack > .favorite-panel,
.control-stack > .random-panel {
  grid-area: auto;
  width: 100%;
}

.control-stack > .filter-panel {
  position: relative;
  top: auto;
}

.metric strong {
  font-variant-numeric: tabular-nums;
}

.media-card.is-favorite {
  border-color: rgba(240, 240, 235, 0.28);
  box-shadow:
    0 16px 46px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(240, 240, 235, 0.075);
}

.media-card.is-favorite .card-body {
  background:
    linear-gradient(135deg, rgba(240, 240, 235, 0.055), transparent 48%),
    rgba(10, 12, 13, 0.98);
}

.media-card.is-favorite .favorite-flag {
  overflow: hidden;
}

.media-card.is-favorite .favorite-flag::after,
.detail-favorite-button.is-active::after,
.favorite-toggle-button.is-active .quick-icon::after {
  position: absolute;
  inset: -35%;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, transparent 35%, rgba(255, 255, 255, 0.72), transparent 65%);
  transform: translateX(-120%) rotate(18deg);
  animation: favorite-shine 980ms 120ms ease-out both;
}

.favorite-flag,
.detail-favorite-button,
.favorite-toggle-button .quick-icon {
  position: relative;
  overflow: hidden;
}

.favorite-flag svg,
.detail-favorite-button.is-active svg,
.favorite-toggle-button.is-active .quick-icon svg {
  fill: currentColor;
}

.detail-favorite-button.is-active svg {
  animation: favorite-pulse 560ms var(--ease-out) both;
}

.poster-frame {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 42%),
    #101112;
}

.poster-image-wrap,
.detail-poster .poster-image-wrap,
.result-thumb-image {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(245, 242, 234, 0.08), transparent 44%),
    #111314;
}

.poster-image,
.poster-image-wrap img,
.detail-poster img,
.result-thumb-image img {
  object-fit: cover;
  object-position: center center;
  filter: saturate(0.92) contrast(1.045) brightness(0.97);
}

.media-card:hover .poster-image,
.media-card:hover .poster-image-wrap img {
  filter: saturate(1.02) contrast(1.055) brightness(1);
}

.poster-fallback,
.poster-demo {
  background-size: cover;
}

@keyframes favorite-shine {
  to {
    transform: translateX(120%) rotate(18deg);
  }
}

@keyframes favorite-pulse {
  0% {
    transform: scale(0.78) rotate(-8deg);
  }
  64% {
    transform: scale(1.12) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@media (max-width: 680px) {
  .control-stack {
    gap: 14px;
  }

  .favorite-panel {
    order: 1;
  }

  .random-panel {
    order: 2;
  }

  .filter-panel {
    order: 3;
  }

  .filter-panel.is-mobile-collapsible {
    gap: 12px;
  }

  .filter-toggle-button.panel-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    cursor: pointer;
  }

  .filter-toggle-button svg {
    display: block;
    justify-self: end;
  }

  .filter-panel.is-mobile-collapsible:not(.is-collapsed) .filter-toggle-button svg {
    transform: rotate(180deg);
  }

  .filter-panel.is-mobile-collapsible.is-collapsed {
    gap: 0;
  }

  .filter-panel.is-mobile-collapsible.is-collapsed .filter-toggle-button {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .filter-panel.is-mobile-collapsible .filter-content[hidden] {
    display: none;
  }

}

@media (max-width: 520px) {
  .poster-upload-control {
    grid-template-columns: 1fr;
  }

  .poster-upload-preview {
    width: min(148px, 58vw);
    justify-self: center;
  }

  .poster-upload-actions {
    align-items: stretch;
  }
}

.poster-demo {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: rgba(245, 242, 234, 0.78);
  background:
    linear-gradient(112deg, transparent 0 28%, rgba(245, 242, 234, 0.1) 28% 30%, transparent 30% 100%),
    repeating-linear-gradient(0deg, rgba(245, 242, 234, 0.09) 0 1px, transparent 1px 11px),
    linear-gradient(155deg, #202020, #080909 68%);
}

.poster-demo::before {
  position: absolute;
  inset: 9% 8%;
  z-index: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(100deg, transparent 0 47%, rgba(245, 242, 234, 0.26) 47% 50%, transparent 50% 100%),
    linear-gradient(0deg, transparent 0 57%, rgba(245, 242, 234, 0.13) 57% 61%, transparent 61% 100%);
  border: 1px solid rgba(245, 242, 234, 0.15);
  transform: skew(-8deg);
}

.poster-demo::after {
  position: absolute;
  right: 8%;
  bottom: 10%;
  z-index: 0;
  width: 42%;
  height: 7px;
  content: "";
  pointer-events: none;
  background: rgba(245, 242, 234, 0.26);
  box-shadow: 0 14px 0 rgba(245, 242, 234, 0.09);
}

.poster-demo > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 34%;
  aspect-ratio: 1;
  place-items: center;
  color: rgba(245, 242, 234, 0.82);
  background: rgba(245, 242, 234, 0.065);
  border: 1px solid rgba(245, 242, 234, 0.16);
  box-shadow: none;
  clip-path: var(--clip-sm);
}

.poster-demo > span svg {
  width: 52%;
  height: 52%;
}

.result-thumb-fallback.poster-demo > span {
  width: 42%;
  font-size: 0;
}

.tone-white,
.tone-line {
  background:
    linear-gradient(101deg, transparent 0 36%, rgba(245, 242, 234, 0.28) 36% 38%, transparent 38% 100%),
    linear-gradient(0deg, transparent 0 51%, rgba(245, 242, 234, 0.2) 51% 53%, transparent 53% 100%),
    repeating-linear-gradient(0deg, rgba(245, 242, 234, 0.09) 0 1px, transparent 1px 12px),
    linear-gradient(158deg, #2a2a2a, #0b0b0b 72%);
}

.tone-cyan,
.tone-ice,
.tone-scan {
  background:
    linear-gradient(180deg, transparent 0 33%, rgba(245, 242, 234, 0.18) 33% 36%, transparent 36% 100%),
    repeating-linear-gradient(0deg, rgba(245, 242, 234, 0.12) 0 1px, transparent 1px 7px),
    linear-gradient(135deg, #171a1b, #060707 66%);
}

.tone-dark,
.tone-void {
  background:
    linear-gradient(90deg, rgba(245, 242, 234, 0.12) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, transparent 0 72%, rgba(245, 242, 234, 0.1) 72% 76%, transparent 76% 100%),
    repeating-linear-gradient(0deg, rgba(245, 242, 234, 0.055) 0 1px, transparent 1px 16px),
    #050505;
}

.tone-lime,
.tone-field {
  background:
    linear-gradient(105deg, transparent 0 20%, rgba(245, 242, 234, 0.08) 20% 21%, transparent 21% 53%, rgba(245, 242, 234, 0.2) 53% 55%, transparent 55% 100%),
    repeating-linear-gradient(90deg, rgba(245, 242, 234, 0.08) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(0deg, rgba(245, 242, 234, 0.07) 0 1px, transparent 1px 13px),
    linear-gradient(150deg, #1b1d1c, #070807 70%);
}

.tone-steel {
  background:
    linear-gradient(123deg, transparent 0 17%, rgba(245, 242, 234, 0.08) 17% 29%, transparent 29% 48%, rgba(245, 242, 234, 0.22) 48% 51%, transparent 51% 100%),
    repeating-linear-gradient(0deg, rgba(245, 242, 234, 0.075) 0 2px, transparent 2px 14px),
    linear-gradient(150deg, #242424, #090909 74%);
}

.tone-grid {
  background:
    linear-gradient(112deg, transparent 0 29%, rgba(245, 242, 234, 0.1) 29% 31%, transparent 31% 100%),
    repeating-linear-gradient(90deg, rgba(245, 242, 234, 0.075) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(0deg, rgba(245, 242, 234, 0.095) 0 1px, transparent 1px 10px),
    linear-gradient(155deg, #202020, #080909 68%);
}

.tone-mono,
.tone-prism {
  background:
    linear-gradient(135deg, transparent 0 18%, rgba(245, 242, 234, 0.09) 18% 38%, transparent 38% 58%, rgba(245, 242, 234, 0.16) 58% 60%, transparent 60% 100%),
    linear-gradient(90deg, transparent 0 68%, rgba(245, 242, 234, 0.1) 68% 70%, transparent 70% 100%),
    repeating-linear-gradient(0deg, rgba(245, 242, 234, 0.07) 0 1px, transparent 1px 12px),
    linear-gradient(160deg, #191919, #050505 76%);
}

.poster-image-wrap.is-poster-missing,
.result-thumb-image.is-poster-missing {
  background-size: cover;
}

.poster-image-wrap.is-poster-missing::after,
.result-thumb-image.is-poster-missing::after {
  inset: 0;
  z-index: 1;
  display: block;
  content: "";
  background:
    linear-gradient(180deg, rgba(245, 242, 234, 0.08), transparent 36%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.18), transparent 46%);
  font-size: 0;
}

/* Motion system v2 */
:root {
  --motion-fast: 180ms;
  --motion-ui: 280ms;
  --motion-panel: 420ms;
  --motion-ease-premium: cubic-bezier(0.18, 0.86, 0.22, 1);
  --motion-ease-precise: cubic-bezier(0.22, 1, 0.36, 1);
}

.result-list.is-demo-director {
  overflow-anchor: none;
}

.result-list.is-demo-director .result-row {
  transition:
    min-height var(--motion-panel) var(--motion-ease-premium),
    padding var(--motion-panel) var(--motion-ease-premium),
    border-width var(--motion-panel) var(--motion-ease-premium),
    opacity var(--motion-ui) ease,
    transform var(--motion-panel) var(--motion-ease-premium),
    background var(--motion-fast) ease,
    border-color var(--motion-fast) ease;
}

.result-list.is-demo-director .result-row.is-demo-pruned {
  min-height: 0;
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  border-width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, -8px, 0) scale(0.985);
}

/* Search catalog: dense enough to scan without turning the dropdown into a drawer. */
.result-list {
  top: var(--result-list-top, calc(100% + 10px));
  right: 0;
  left: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 6px;
  max-height: var(--result-list-max-height, min(620px, calc(100dvh - 240px)));
  padding: 0 8px 8px;
  background: rgba(7, 8, 9, 0.985);
  border-color: rgba(245, 242, 234, 0.24);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72);
  scrollbar-gutter: stable;
}

.result-list.opens-upward {
  top: auto;
  bottom: var(--result-list-bottom, calc(78px + 10px));
}

.result-list-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  min-height: 42px;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -8px;
  padding: 9px 14px;
  color: var(--muted-bright);
  background: #090a0b;
  border-bottom: 1px solid rgba(245, 242, 234, 0.16);
}

.result-list-label,
.result-list-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 10px;
  text-transform: uppercase;
}

.result-list-label strong {
  display: inline-grid;
  min-width: 24px;
  height: 22px;
  place-items: center;
  color: var(--ink-inverse);
  background: var(--signal);
}

.result-list-summary {
  color: var(--muted);
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
}

.result-list-summary span + span::before {
  margin-right: 9px;
  color: rgba(245, 242, 234, 0.28);
  content: "/";
}

.result-list .result-row {
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 11px;
  min-height: 68px;
  padding: 6px 8px;
  text-align: left;
  animation-duration: 260ms;
}

.result-list .result-row:nth-child(2) { animation-delay: 25ms; }
.result-list .result-row:nth-child(3) { animation-delay: 50ms; }
.result-list .result-row:nth-child(4) { animation-delay: 75ms; }
.result-list .result-row:nth-child(5) { animation-delay: 100ms; }
.result-list .result-row:nth-child(n + 6) { animation-delay: 125ms; }

.result-list.results-updating .result-row {
  animation: none;
  opacity: 1;
}

.result-list > .result-row-muted,
.result-list > .empty-state {
  grid-column: 1 / -1;
}

.result-list .result-row img,
.result-list .result-thumb-image,
.result-list .result-thumb-fallback {
  width: 46px;
  height: 56px;
}

.result-original-title {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-family: "Exo 2", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-list .result-meta {
  gap: 6px;
  margin-top: 4px;
  font-size: 9px;
}

@media (max-width: 760px) {
  .result-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .result-list-head {
    gap: 8px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .result-list-summary {
    gap: 6px;
  }

  .result-list-summary span + span::before {
    margin-right: 6px;
  }

  body:has(.result-list:not([hidden])) .search-stage {
    animation: none;
    transform: none;
  }

  body:has(.result-list:not([hidden])) .search-control-row {
    position: fixed;
    top: 52px;
    right: 16px;
    left: 16px;
    z-index: 34;
    width: auto;
    background: #050505;
    animation: premium-layer-in var(--motion-ui) var(--motion-ease-premium) both;
  }

  body:has(.result-list:not([hidden])) .result-list,
  body:has(.result-list:not([hidden])) .result-list.opens-upward {
    position: fixed;
    top: 128px;
    right: 16px;
    bottom: 12px;
    left: 16px;
    z-index: 33;
    max-height: none;
    animation: premium-layer-in var(--motion-panel) var(--motion-ease-premium) both;
  }
}

@media (max-width: 460px) {
  .result-list-summary {
    display: none;
  }
}

.library-drawer {
  will-change: opacity, transform;
}

.drawer-open .drawer-head {
  animation: premium-layer-in 360ms 40ms var(--motion-ease-premium) both;
}

.drawer-open .metric {
  animation: premium-layer-in 380ms var(--metric-delay, 90ms) var(--motion-ease-premium) both;
}

.drawer-open .metric:nth-child(1) { --metric-delay: 90ms; }
.drawer-open .metric:nth-child(2) { --metric-delay: 135ms; }
.drawer-open .metric:nth-child(3) { --metric-delay: 180ms; }
.drawer-open .metric:nth-child(4) { --metric-delay: 225ms; }

.drawer-open .filter-panel,
.drawer-open .favorite-panel,
.drawer-open .random-panel {
  animation: premium-layer-in 400ms var(--panel-delay, 150ms) var(--motion-ease-premium) both;
}

.drawer-open .filter-panel { --panel-delay: 150ms; }
.drawer-open .favorite-panel { --panel-delay: 205ms; }
.drawer-open .random-panel { --panel-delay: 260ms; }

.drawer-open .library-head,
.drawer-open .status-tabs {
  animation: premium-layer-in 420ms var(--library-delay, 210ms) var(--motion-ease-premium) both;
}

.drawer-open .library-head { --library-delay: 210ms; }
.drawer-open .status-tabs { --library-delay: 270ms; }

.drawer-open .media-card {
  animation: premium-card-enter 460ms 300ms var(--motion-ease-premium) backwards;
}

.drawer-open .media-card:nth-child(2) { animation-delay: 340ms; }
.drawer-open .media-card:nth-child(3) { animation-delay: 380ms; }
.drawer-open .media-card:nth-child(4) { animation-delay: 420ms; }
.drawer-open .media-card:nth-child(5) { animation-delay: 460ms; }
.drawer-open .media-card:nth-child(6) { animation-delay: 500ms; }
.drawer-open .media-card:nth-child(n + 7) { animation-delay: 540ms; }

.media-card {
  background:
    linear-gradient(145deg, rgba(245, 242, 234, 0.045), transparent 38%),
    rgba(9, 10, 10, 0.98);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  transform: translate3d(0, 0, 0);
  transition:
    transform var(--motion-ui) var(--motion-ease-premium),
    border-color var(--motion-ui) ease,
    box-shadow var(--motion-ui) ease,
    background var(--motion-ui) ease;
}

.media-card::after {
  width: 3px;
  background: linear-gradient(180deg, var(--signal), rgba(245, 242, 234, 0.15));
  transition: transform var(--motion-panel) var(--motion-ease-premium), opacity var(--motion-ui) ease;
  opacity: 0.68;
}

.media-card:hover {
  border-color: rgba(245, 242, 234, 0.46);
  box-shadow:
    0 24px 58px rgba(0, 0, 0, 0.44),
    inset 0 0 0 1px rgba(245, 242, 234, 0.045);
  transform: translate3d(0, -5px, 0);
}

.media-card.is-favorite {
  border-color: rgba(245, 242, 234, 0.34);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(245, 242, 234, 0.12);
}

.media-card.is-favorite::after {
  height: 34%;
}

.media-card:hover .poster-frame img,
.media-card:hover .poster-image,
.media-card:hover .poster-image-wrap img {
  filter: saturate(1.04) contrast(1.06) brightness(1.02);
  transform: scale(1.032);
}

.media-card.is-favorite .favorite-flag::after,
.detail-favorite-button.is-active::after,
.favorite-toggle-button.is-active .quick-icon::after {
  opacity: 0;
  animation: none;
}

.media-card.is-favorite-pulse .favorite-flag::after,
.detail-favorite-button.is-favorite-pulse::after {
  opacity: 1;
  animation: favorite-shine 680ms 40ms ease-out both;
}

.detail-favorite-button.is-active svg {
  animation: none;
}

.detail-favorite-button.is-favorite-pulse svg {
  animation: favorite-pulse 520ms var(--motion-ease-premium) both;
}

.details-dialog[open] .detail-poster-frame {
  animation: premium-detail-poster 520ms 20ms var(--motion-ease-precise) both;
}

.details-dialog[open] .detail-main {
  animation: premium-detail-main 560ms 100ms var(--motion-ease-precise) both;
}

.details-dialog[open] .detail-meta {
  animation: premium-layer-in 340ms 180ms var(--motion-ease-premium) both;
}

.details-dialog[open] .detail-score-grid .service-score {
  animation: premium-score-in 420ms var(--score-delay, 210ms) var(--motion-ease-premium) both;
}

.details-dialog[open] .detail-score-grid .service-score:nth-child(2) {
  --score-delay: 260ms;
}

.details-dialog[open] .detail-status-editor,
.details-dialog[open] .detail-rating-editor,
.details-dialog[open] .detail-section,
.details-dialog[open] .detail-card-footer {
  animation: premium-layer-in 420ms var(--detail-layer-delay, 300ms) var(--motion-ease-premium) both;
}

.details-dialog[open] .detail-status-editor { --detail-layer-delay: 300ms; }
.details-dialog[open] .detail-rating-editor { --detail-layer-delay: 340ms; }
.details-dialog[open] .detail-section:nth-of-type(2) { --detail-layer-delay: 380ms; }
.details-dialog[open] .detail-section:nth-of-type(3) { --detail-layer-delay: 420ms; }
.details-dialog[open] .detail-section:nth-of-type(n + 4) { --detail-layer-delay: 460ms; }
.details-dialog[open] .detail-card-footer { --detail-layer-delay: 480ms; }

@keyframes premium-layer-in {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes premium-card-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes premium-detail-poster {
  from {
    opacity: 0;
    transform: translate3d(-18px, 0, 0) scale(1.018);
    filter: saturate(0.76) contrast(1.08);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: saturate(1) contrast(1);
  }
}

@media (max-width: 680px) {
  .drawer-actions .icon-button {
    min-width: 44px;
    height: 44px;
  }

  .drawer-actions .auth-button {
    min-width: 56px;
  }

  .status-tabs .tab-button {
    min-height: 44px;
  }
}

@keyframes premium-detail-main {
  from {
    opacity: 0;
    transform: translate3d(16px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes premium-score-in {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (max-width: 680px) {
  .library-drawer {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: min(92dvh, 820px);
    max-height: 92dvh;
    border-top: 1px solid var(--line-strong);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    transform: translate3d(0, 104%, 0);
    transition: opacity 220ms ease, transform 420ms var(--motion-ease-premium);
    clip-path: polygon(0 18px, 18px 18px, 18px 0, 100% 0, 100% 100%, 0 100%);
  }

  .drawer-open .library-drawer {
    transform: translate3d(0, 0, 0);
  }

  .drawer-head {
    position: sticky;
    top: 0;
    z-index: 4;
  }

  .drawer-scroll {
    max-height: calc(92dvh - 70px);
    overflow: auto;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

.details-dialog {
  width: min(980px, calc(100vw - 32px));
  max-width: none;
}

#detailsContent {
  height: min(620px, calc(100dvh - 32px));
  max-height: none;
  overflow: hidden;
}

.detail-layout {
  grid-template-columns: minmax(300px, 44%) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.detail-poster-frame,
.detail-poster {
  height: 100%;
  min-height: 0;
}

.detail-poster {
  display: grid;
  place-items: center;
  background: #090a0a;
}

.detail-poster .poster-image-wrap {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  place-items: center;
}

.detail-poster img,
.detail-poster .poster-image {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  background: #090a0a;
}

.detail-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.detail-heading {
  padding: 0 54px 14px 0;
  border-bottom: 1px solid var(--line);
}

.detail-heading .detail-meta {
  margin-bottom: 12px;
}

.detail-heading .detail-title {
  max-width: 100%;
  font-size: 26px;
  line-height: 1.08;
  text-shadow: none;
  overflow-wrap: anywhere;
}

.detail-heading .detail-original {
  margin-top: 7px;
  color: var(--muted-bright);
  font-size: 12px;
}

.detail-meta,
.detail-score-grid,
.detail-status-editor,
.detail-rating-editor,
.detail-section,
.detail-card-footer {
  margin-top: 0;
  margin-bottom: 0;
}

.detail-score-grid {
  gap: 8px;
}

.detail-score-grid .service-score {
  min-height: 66px;
}

.detail-fact-grid,
.detail-section {
  position: relative;
  border: 1px solid var(--line);
}

.detail-section {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.022);
  clip-path: var(--clip-sm);
}

.detail-section p {
  margin: 7px 0 0;
  color: var(--muted-bright);
  font-size: 13.5px;
  line-height: 1.55;
}

.detail-fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  border: 0;
}

.detail-fact {
  min-height: 56px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.024);
  border: 1px solid var(--line);
  clip-path: var(--clip-sm);
}

.detail-fact.is-wide {
  grid-column: 1 / -1;
}

.detail-fact span,
.detail-section h3 {
  display: block;
  margin: 0;
  color: var(--muted);
  font-family: var(--micro-font);
  font-size: 9px;
  font-weight: 700;
  font-variation-settings: "wght" 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-fact strong,
.detail-fact a {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.detail-fact a:hover {
  color: var(--accent);
}

.details-dialog[open] .detail-fact-grid {
  animation: premium-layer-in 420ms var(--detail-layer-delay, 300ms) var(--motion-ease-premium) both;
}

.details-dialog[open] .detail-section:first-of-type { --detail-layer-delay: 295ms; }
.details-dialog[open] .detail-fact-grid { --detail-layer-delay: 335ms; }

@media (max-width: 920px) {
  .details-dialog {
    width: min(720px, calc(100vw - 24px));
  }

  #detailsContent {
    height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .detail-poster-frame,
  .detail-poster {
    height: min(48dvh, 430px);
    min-height: 300px;
    max-height: none;
  }

  .detail-main {
    overflow: visible;
  }
}

@media (max-width: 680px) {
  .details-dialog {
    width: calc(100vw - 16px);
  }

  #detailsContent {
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .detail-poster-frame,
  .detail-poster {
    height: min(43dvh, 360px);
    min-height: 250px;
  }

  .detail-main {
    gap: 10px;
    padding: 16px;
  }

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

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

  .detail-fact:last-child {
    grid-column: 1 / -1;
  }

  .detail-fact.is-wide {
    grid-column: auto;
  }

  .detail-heading {
    padding-right: 44px;
  }

  .detail-heading .detail-title {
    font-size: 22px;
  }

}

/* Compositor-first motion pass */
.system-chrome,
.access-form,
.search-box,
.result-list,
.library-drawer,
.detail-main,
.detail-poster-caption {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.drawer-backdrop,
dialog::backdrop {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.library-drawer {
  contain: layout style;
  will-change: auto;
}

.library-drawer.is-motion-active {
  will-change: opacity, transform;
}

.drawer-scroll,
.result-list,
#detailsContent {
  overscroll-behavior: contain;
}

.media-card {
  contain: layout style;
  backface-visibility: hidden;
  transition:
    transform var(--motion-ui) var(--motion-ease-premium),
    border-color var(--motion-ui) ease;
}

.media-card::after {
  inset: auto 0 0 auto;
  z-index: 1;
  width: 3px;
  height: 100%;
  pointer-events: none;
  opacity: 0.68;
  transform: scaleY(0);
  transform-origin: bottom;
  transition:
    transform var(--motion-panel) var(--motion-ease-premium),
    opacity var(--motion-ui) ease;
}

.media-card:hover::after {
  height: 100%;
  transform: scaleY(1);
}

.media-card.is-favorite::after {
  height: 100%;
  transform: scaleY(0.34);
}

.media-card.is-favorite:hover::after {
  transform: scaleY(1);
}

.poster-frame::after {
  opacity: 0.9;
  transition: opacity var(--motion-ui) ease;
}

.media-card:hover .poster-frame::after {
  opacity: 0.62;
}

.poster-frame img,
.poster-image,
.poster-image-wrap img {
  filter: saturate(0.94) contrast(1.045) brightness(0.985);
  backface-visibility: hidden;
  transition: transform var(--motion-panel) var(--motion-ease-premium);
}

.media-card:hover .poster-frame img,
.media-card:hover .poster-image,
.media-card:hover .poster-image-wrap img {
  filter: saturate(0.94) contrast(1.045) brightness(0.985);
  transform: translate3d(0, 0, 0) scale(1.032);
}

.card-synopsis-preview {
  --synopsis-shift-x: 0px;
  --synopsis-shift-y: 14px;
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  display: flex;
  min-height: 82%;
  padding: 72px 16px 16px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(3, 3, 3, 0.22) 18%, rgba(3, 3, 3, 0.92) 52%, #030303 100%);
  transform: translate3d(var(--synopsis-shift-x), var(--synopsis-shift-y), 0);
  transition:
    opacity 180ms ease,
    transform 320ms var(--motion-ease-premium);
}

.media-card[data-synopsis-rhythm="1"] .card-synopsis-preview {
  --synopsis-shift-x: -10px;
  --synopsis-shift-y: 5px;
}

.media-card[data-synopsis-rhythm="2"] .card-synopsis-preview {
  --synopsis-shift-x: 9px;
  --synopsis-shift-y: 8px;
}

.media-card.is-synopsis-active .card-synopsis-preview {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.card-synopsis-label {
  display: grid;
  grid-template-columns: auto minmax(20px, 1fr);
  align-items: center;
  gap: 8px;
  color: rgba(245, 242, 234, 0.66);
  font-family: "Exo 2", sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  opacity: 0;
  transform: translate3d(0, 5px, 0);
  transition:
    opacity 160ms 40ms ease,
    transform 240ms 40ms var(--motion-ease-premium);
}

.card-synopsis-label::after {
  height: 1px;
  content: "";
  background: linear-gradient(90deg, rgba(245, 242, 234, 0.48), transparent);
  transform: scaleX(0.22);
  transform-origin: left;
  transition: transform 360ms 70ms var(--motion-ease-premium);
}

.media-card.is-synopsis-active .card-synopsis-label {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.media-card.is-synopsis-active .card-synopsis-label::after {
  transform: scaleX(1);
}

.card-synopsis-text {
  display: block;
  min-height: calc(1.52em * 10);
  max-height: calc(1.52em * 10);
  overflow: hidden;
  color: rgba(245, 242, 234, 0.92);
  font-family: "Exo 2", sans-serif;
  font-size: 14px;
  font-weight: 520;
  line-height: 1.52;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.76);
}

.card-synopsis-text::after {
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 3px;
  content: "";
  vertical-align: -0.12em;
  opacity: 0;
  background: var(--signal);
  box-shadow: 0 0 10px rgba(245, 242, 234, 0.44);
}

.media-card.is-synopsis-typing .card-synopsis-text::after {
  opacity: 1;
  animation: card-synopsis-caret 620ms steps(1, end) infinite;
}

@keyframes card-synopsis-caret {
  0%, 46% { opacity: 1; }
  47%, 100% { opacity: 0; }
}

@media (max-width: 680px), (hover: none), (pointer: coarse) {
  .card-synopsis-preview {
    display: none;
  }
}

.detail-card-editor::before {
  filter: none;
  opacity: 0.09;
}

.result-list.is-demo-director .result-row {
  transition:
    opacity var(--motion-ui) ease,
    transform var(--motion-panel) var(--motion-ease-premium),
    background var(--motion-fast) ease,
    border-color var(--motion-fast) ease;
}

.result-list.is-demo-director .result-row.is-demo-pruned {
  min-height: 76px;
  height: auto;
  padding: 8px;
  font: inherit;
  text-align: left;
  appearance: none;
  overflow: visible;
  border-width: 1px;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, -8px, 0) scale(0.985);
}

@media (pointer: fine) {
  .custom-cursor {
    mix-blend-mode: normal;
    transition: opacity 140ms ease;
  }

  body.cursor-demoing .custom-cursor {
    transition:
      transform 760ms cubic-bezier(0.16, 0.94, 0.18, 1),
      opacity 140ms ease;
  }

  .custom-cursor::before,
  .custom-cursor::after {
    background: rgba(245, 242, 234, 0.82);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.46);
  }

  .custom-cursor-ring {
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.72),
      0 0 14px rgba(0, 0, 0, 0.42);
    transition:
      transform 180ms cubic-bezier(0.2, 0.9, 0.2, 1),
      border-color 180ms ease,
      background 180ms ease;
  }

  .custom-cursor-dot {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.72);
  }

  .custom-cursor.is-demo {
    filter: none;
  }
}

@keyframes grid-flash {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes logo-snap {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scaleX(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scaleX(1);
  }
}

@keyframes outline-snap {
  from {
    opacity: 0;
    transform: translate3d(-12px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes shutter-down {
  from {
    opacity: 0;
    transform: translate3d(0, -8px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes pin-dialog-in {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes card-scan {
  from {
    opacity: 0;
    transform: translate3d(0, 0, 0) skewX(-12deg);
  }
  24% { opacity: 1; }
  to {
    opacity: 0;
    transform: translate3d(650%, 0, 0) skewX(-12deg);
  }
}

@keyframes premium-detail-poster {
  from {
    opacity: 0;
    transform: translate3d(-18px, 0, 0) scale(1.018);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

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

  .media-card,
  .media-card:hover,
  .details-dialog[open] .detail-poster-frame,
  .details-dialog[open] .detail-main,
  .drawer-open .media-card {
    transform: none !important;
  }

  .card-synopsis-preview,
  .card-synopsis-label {
    transform: none !important;
  }

  .media-card.is-synopsis-typing .card-synopsis-text::after {
    animation: none !important;
    opacity: 0 !important;
  }
}

/* Accessibility mode: an explicit, persistent high-legibility presentation. */
.search-intro-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.accessibility-toggle-button {
  position: relative;
  flex: 0 0 auto;
}

.accessibility-toggle-button::after {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 5px;
  height: 5px;
  content: "";
  background: currentColor;
  opacity: 0;
  transform: scale(0.4);
}

.accessibility-toggle-button.is-active {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--signal);
}

.accessibility-toggle-button.is-active::after {
  opacity: 1;
  transform: scale(1);
}

.accessibility-toggle-button:hover svg {
  transform: scale(1.1);
}

html.a11y-mode {
  --bg: #000;
  --bg-deep: #000;
  --surface: #080808;
  --surface-raised: #101010;
  --surface-soft: #151515;
  --ink: #fff;
  --ink-inverse: #000;
  --muted: #d3d3ce;
  --muted-bright: #f2f2ed;
  --line: rgba(255, 255, 255, 0.42);
  --line-strong: rgba(255, 255, 255, 0.82);
  --signal: #fff;
  --scrollbar-size: 16px;
  --scrollbar-track: #080808;
  --scrollbar-thumb: #e8e8e2;
  --scrollbar-thumb-hover: #fff;
}

html.a11y-mode body {
  color: #fff;
  background: #000;
  font-weight: 600;
  text-rendering: optimizeLegibility;
}

html.a11y-mode body::before,
html.a11y-mode body::after,
html.a11y-mode .poster-frame::after {
  display: none;
}

html.a11y-mode *,
html.a11y-mode *::before,
html.a11y-mode *::after {
  scroll-behavior: auto !important;
  animation-duration: 1ms !important;
  animation-delay: 0ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 1ms !important;
  transition-delay: 0ms !important;
}

html.a11y-mode .custom-cursor-layer,
html.a11y-mode .custom-cursor {
  display: none !important;
}

html.a11y-mode .module-index,
html.a11y-mode .system-status,
html.a11y-mode .search-footnote,
html.a11y-mode .muted-count,
html.a11y-mode .field label,
html.a11y-mode .card-eyebrow,
html.a11y-mode .result-meta,
html.a11y-mode .score-label,
html.a11y-mode .detail-fact span,
html.a11y-mode .detail-section h3,
html.a11y-mode .service-score span,
html.a11y-mode .detail-editor-label,
html.a11y-mode .rating-head span,
html.a11y-mode .pin-console-meta {
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: 0;
}

html.a11y-mode .system-chrome {
  min-height: 50px;
  padding: 0 20px;
  color: #fff;
  background: #000;
  font-size: 12px;
  letter-spacing: 0;
  border-bottom-color: var(--line-strong);
  backdrop-filter: none;
}

html.a11y-mode .accessibility-toggle-chrome {
  min-width: 92px;
  min-height: 46px;
  gap: 10px;
  border-width: 2px;
}

html.a11y-mode .accessibility-toggle-chrome svg {
  width: 22px;
  height: 22px;
}

html.a11y-mode .accessibility-toggle-chrome span {
  font-size: 12px;
}

html.a11y-mode .home-shell {
  padding-top: 106px;
}

html.a11y-mode .search-intro p {
  color: var(--muted-bright);
  font-size: 18px;
  line-height: 1.65;
}

html.a11y-mode #externalQuery {
  color: #fff;
  font-size: 20px;
  font-weight: 650;
}

html.a11y-mode #externalQuery::placeholder {
  color: #d0d0ca;
  opacity: 1;
}

html.a11y-mode .round-button,
html.a11y-mode .icon-button,
html.a11y-mode .primary-button,
html.a11y-mode .ghost-button,
html.a11y-mode .owner-mode-button,
html.a11y-mode .tab-button,
html.a11y-mode .status-choice,
html.a11y-mode .rating-step,
html.a11y-mode .favorite-toggle-button,
html.a11y-mode .random-button,
html.a11y-mode .pin-keypad button,
html.a11y-mode .pin-submit-button {
  min-height: 52px;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0;
}

html.a11y-mode .icon-button {
  width: 52px;
  height: 52px;
  min-width: 52px;
  padding: 0;
}

html.a11y-mode .icon-button svg,
html.a11y-mode .round-button svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.4;
}

html.a11y-mode :is(button, input, select, textarea, a):focus-visible,
html.a11y-mode .media-card-open:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 4px;
  box-shadow: 0 0 0 2px #000, 0 0 0 7px #fff;
}

html.a11y-mode input,
html.a11y-mode select,
html.a11y-mode textarea {
  min-height: 54px;
  color: #fff;
  background: #050505;
  border-color: var(--line-strong);
  font-size: 18px;
  line-height: 1.5;
}

html.a11y-mode textarea {
  padding-top: 12px;
  padding-bottom: 12px;
}

html.a11y-mode .drawer-head {
  min-height: 92px;
  background: #000;
  border-bottom-color: var(--line-strong);
}

html.a11y-mode .drawer-actions {
  gap: 10px;
}

html.a11y-mode .drawer-actions .auth-button {
  min-width: 68px;
}

html.a11y-mode .auth-button span {
  font-size: 13px;
  letter-spacing: 0;
}

html.a11y-mode .metric {
  min-height: 96px;
  padding: 18px 20px;
  border-color: var(--line-strong);
}

html.a11y-mode .metric strong {
  font-size: 34px;
}

html.a11y-mode .metric span:not(.metric-icon) {
  color: #fff;
  font-size: 14px;
  letter-spacing: 0;
}

html.a11y-mode .panel-heading strong,
html.a11y-mode .library-title h2,
html.a11y-mode .empty-state strong {
  font-size: 26px;
  line-height: 1.2;
}

html.a11y-mode .filter-panel,
html.a11y-mode .quick-panel,
html.a11y-mode .metric-grid,
html.a11y-mode .media-card,
html.a11y-mode .result-list,
html.a11y-mode dialog,
html.a11y-mode .detail-section,
html.a11y-mode .detail-fact {
  border-color: var(--line-strong);
}

html.a11y-mode .favorite-toggle-button small {
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
}

html.a11y-mode .status-tabs {
  gap: 10px;
}

html.a11y-mode .tab-button {
  padding: 0 16px;
  font-size: 15px;
}

html.a11y-mode .tab-count {
  min-width: 26px;
  min-height: 26px;
  font-size: 13px;
}

html.a11y-mode .card-grid:not(.is-franchise-view) {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

html.a11y-mode .media-card:hover,
html.a11y-mode .media-card:focus-within,
html.a11y-mode .media-card:hover .poster-frame img,
html.a11y-mode .media-card:focus-within .poster-frame img {
  transform: none;
}

html.a11y-mode .card-body {
  min-height: 204px;
  gap: 13px;
  padding: 18px;
}

html.a11y-mode .card-title {
  min-height: 52px;
  font-size: 20px;
  line-height: 1.3;
}

html.a11y-mode .card-body > .pill {
  min-height: 46px;
  font-size: 14px;
  letter-spacing: 0;
}

html.a11y-mode .score-pill {
  min-height: 64px;
  padding: 10px 12px;
}

html.a11y-mode .score-pill strong {
  font-size: 22px;
}

html.a11y-mode .card-synopsis-preview {
  min-height: 88%;
  padding: 82px 18px 20px;
  gap: 12px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.66) 22%, #000 52%, #000 100%);
}

html.a11y-mode .card-synopsis-label {
  color: #fff;
  font-size: 12px;
  letter-spacing: 0;
}

html.a11y-mode .card-synopsis-text {
  min-height: calc(1.62em * 8);
  max-height: calc(1.62em * 8);
  color: #fff;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.62;
  text-shadow: 0 2px 8px #000;
}

html.a11y-mode .result-list {
  gap: 10px;
  padding: 12px;
  background: #000;
  backdrop-filter: none;
}

html.a11y-mode .result-row {
  min-height: 88px;
  padding: 12px;
  background: #080808;
  border: 1px solid var(--line);
}

html.a11y-mode .result-title {
  font-size: 19px;
  line-height: 1.35;
}

html.a11y-mode .result-meta {
  color: #e4e4de;
}

html.a11y-mode .detail-heading .detail-title {
  font-size: 34px;
  line-height: 1.2;
}

html.a11y-mode .detail-heading .detail-original,
html.a11y-mode .detail-original {
  color: #fff;
  font-size: 17px;
  line-height: 1.5;
}

html.a11y-mode .detail-main {
  gap: 18px;
  padding: 26px;
  background: #000;
}

html.a11y-mode .detail-section {
  padding: 18px;
  background: #080808;
}

html.a11y-mode .detail-section p,
html.a11y-mode .confirm-message,
html.a11y-mode .empty-state p {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.7;
}

html.a11y-mode body.viewer-mode .detail-section.is-synopsis p {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

html.a11y-mode .detail-fact {
  min-height: 74px;
  padding: 14px;
  background: #080808;
}

html.a11y-mode .detail-fact strong,
html.a11y-mode .detail-fact a {
  margin-top: 8px;
  font-size: 17px;
  line-height: 1.4;
}

html.a11y-mode .detail-fact a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

html.a11y-mode .service-score {
  min-height: 84px;
}

html.a11y-mode .service-score strong,
html.a11y-mode .rating-head strong {
  font-size: 36px;
}

html.a11y-mode .status-choice {
  padding: 10px 14px;
  line-height: 1.35;
}

html.a11y-mode .toast {
  max-width: min(560px, calc(100vw - 32px));
  padding: 16px 20px;
  color: #000;
  background: #fff;
  border-color: #fff;
  font-size: 17px;
  font-weight: 750;
}

@media (max-width: 680px) {
  .search-intro-meta {
    min-height: 52px;
    animation: none;
    transform: none !important;
  }

  html.a11y-mode .system-chrome-center {
    display: none;
  }

  html.a11y-mode .system-chrome {
    grid-template-columns: 1fr auto;
  }

  html.a11y-mode .home-shell {
    padding-top: 82px;
  }

  html.a11y-mode .search-intro h1 {
    font-size: 44px;
  }

  html.a11y-mode .search-intro p {
    font-size: 17px;
  }

  html.a11y-mode .search-control-row .owner-mode-button {
    min-height: 68px;
    font-size: 14px;
  }

  html.a11y-mode .drawer-scroll {
    padding: 16px;
  }

  html.a11y-mode .card-grid:not(.is-franchise-view) {
    grid-template-columns: 1fr;
  }

  html.a11y-mode .media-card-open {
    grid-template-columns: 132px minmax(0, 1fr);
    min-height: 224px;
  }

  html.a11y-mode .card-body {
    min-height: 224px;
    padding: 16px;
  }

  html.a11y-mode .card-title {
    min-height: auto;
    font-size: 18px;
  }

  html.a11y-mode .detail-layout {
    display: block;
  }

  html.a11y-mode .detail-main {
    padding: 20px;
  }
}

@media (max-width: 420px) {
  .search-intro-actions {
    gap: 8px;
  }

  html.a11y-mode .drawer-identity {
    display: none;
  }

  html.a11y-mode .drawer-head {
    justify-content: flex-end;
    padding: 10px;
  }

  html.a11y-mode .drawer-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 5px;
  }

  html.a11y-mode .drawer-actions .icon-button,
  html.a11y-mode .icon-button {
    width: 48px;
    height: 48px;
    min-width: 48px;
  }

  html.a11y-mode .drawer-actions .auth-button {
    min-width: 58px;
  }

  html.a11y-mode .media-card-open {
    grid-template-columns: 116px minmax(0, 1fr);
  }

  html.a11y-mode .score-row {
    grid-template-columns: 1fr;
  }
}

/* Mobile product surface: keep this final layer authoritative. */
@media (max-width: 680px) {
  :root {
    --mobile-gutter: 12px;
    --mobile-chrome: 48px;
    --mobile-control: 56px;
  }

  html {
    min-width: 0;
    overflow-x: hidden;
    scroll-padding-top: calc(var(--mobile-chrome) + env(safe-area-inset-top));
  }

  body {
    min-width: 0;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    -webkit-tap-highlight-color: transparent;
  }

  :where(button, input, select, textarea, a, [role="button"]) {
    touch-action: manipulation;
  }

  .system-chrome {
    top: 0;
    height: calc(var(--mobile-chrome) + env(safe-area-inset-top));
    min-height: calc(var(--mobile-chrome) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) var(--mobile-gutter) 0;
    grid-template-columns: minmax(0, 1fr) auto;
    background: rgba(3, 3, 3, 0.96);
    backdrop-filter: blur(12px);
  }

  .system-chrome-center,
  .system-chrome > span:nth-child(3) {
    display: none;
  }

  .system-chrome-actions {
    gap: 8px;
  }

  html.a11y-mode .accessibility-toggle-chrome {
    min-width: 54px;
    min-height: 40px;
    padding-inline: 8px;
  }

  html.a11y-mode .accessibility-toggle-chrome span,
  html.a11y-mode .system-network b {
    display: none;
  }

  .home-shell {
    display: block;
    min-height: 100svh;
    padding:
      calc(var(--mobile-chrome) + env(safe-area-inset-top) + 30px)
      var(--mobile-gutter)
      calc(24px + env(safe-area-inset-bottom));
    overflow: clip;
  }

  .home-shell::before {
    inset: calc(var(--mobile-chrome) + env(safe-area-inset-top)) 0 auto;
    height: min(54svh, 460px);
    opacity: 0.48;
  }

  .search-stage {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .search-stage::before,
  .search-stage::after {
    pointer-events: none;
  }

  .search-intro {
    max-width: 100%;
    margin-bottom: 22px;
  }

  .search-intro-meta {
    min-height: 32px;
    margin-bottom: 13px;
  }

  .search-intro-actions {
    min-width: 0;
  }

  .search-intro h1 {
    max-width: 100%;
    margin: 0;
    font-size: clamp(40px, 13vw, 58px);
    line-height: 0.9;
    letter-spacing: 0;
    overflow-wrap: anywhere;
  }

  .search-intro h1 span {
    display: block;
    font-size: 0.68em;
    line-height: 1;
  }

  .search-intro p {
    max-width: 34rem;
    margin: 17px 0 0;
    font-size: 13px;
    line-height: 1.55;
  }

  .search-form {
    width: 100%;
  }

  .search-control-row {
    position: relative;
    inset: auto;
    width: 100%;
    grid-template-columns: 78px minmax(0, 1fr) 48px;
    gap: 6px;
  }

  .search-control-row .owner-mode-button,
  .search-control-row .hero-auth-button {
    min-width: 0;
    min-height: var(--mobile-control);
    padding: 0 8px;
    gap: 6px;
    font-size: 9px;
    clip-path: var(--clip-sm);
  }

  .search-control-row .owner-mode-button svg,
  .search-control-row .hero-auth-button svg {
    display: block;
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
  }

  .search-control-row .hero-auth-button {
    width: 48px;
    padding: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
  }

  .search-control-row .hero-auth-button span {
    font-size: 7px;
  }

  .search-control-row .search-box {
    min-width: 0;
    min-height: var(--mobile-control);
    padding: 4px;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 4px;
    clip-path: var(--clip-sm);
  }

  .search-prefix {
    display: none;
  }

  #externalQuery {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 12px;
    font-size: 16px;
    line-height: 1;
  }

  .search-box .round-button[type="submit"] {
    width: 46px;
    height: 46px;
    min-width: 46px;
  }

  .search-footnote {
    display: none;
  }

  body:has(.result-list:not(:empty):not([hidden])) .home-shell {
    min-height: 100dvh;
    padding-top: calc(var(--mobile-chrome) + env(safe-area-inset-top) + 10px);
  }

  body:has(.result-list:not(:empty):not([hidden])) .search-intro {
    display: none;
  }

  body:has(.result-list:not(:empty):not([hidden])) .search-control-row {
    position: fixed;
    z-index: 71;
    top: calc(var(--mobile-chrome) + env(safe-area-inset-top) + 8px);
    right: var(--mobile-gutter);
    left: var(--mobile-gutter);
    width: auto;
  }

  body:not(:has(.result-list:not(:empty):not([hidden]))) .search-control-row {
    position: relative;
    inset: auto;
    width: 100%;
  }

  .result-list,
  .result-list.opens-upward {
    position: fixed;
    z-index: 70;
    top: calc(var(--mobile-chrome) + env(safe-area-inset-top) + var(--mobile-control) + 22px);
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 8px;
    width: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0 6px 8px;
    overflow-x: hidden;
    overflow-y: auto;
    background: rgba(5, 6, 6, 0.985);
    border: 1px solid var(--line-strong);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    clip-path: none;
  }

  .result-list-head {
    position: sticky;
    z-index: 2;
    top: 0;
    min-height: 42px;
    padding: 0 8px;
    background: rgba(5, 6, 6, 0.98);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
  }

  .result-list-label,
  .result-list-summary {
    font-size: 8px;
  }

  .result-list-summary {
    max-width: 55%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .result-list .result-row,
  .result-row {
    min-height: 74px;
    padding: 8px;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
    clip-path: none;
  }

  .result-list .result-row img,
  .result-list .result-thumb-image,
  .result-list .result-thumb-fallback,
  .result-row img {
    width: 44px;
    height: 58px;
    min-width: 44px;
    object-fit: cover;
  }

  .result-title {
    font-size: 14px;
    line-height: 1.25;
  }

  .result-subtitle {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.25;
  }

  .result-list .result-meta {
    gap: 4px;
    font-size: 8px;
    line-height: 1.35;
  }

  .library-drawer {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    border-width: 1px 0 0;
    clip-path: polygon(0 12px, 12px 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
    transform: translate3d(0, 102%, 0);
    box-shadow: 0 -28px 80px rgba(0, 0, 0, 0.76);
    contain: layout paint;
  }

  .library-drawer::before {
    position: absolute;
    z-index: 9;
    top: 6px;
    left: 50%;
    width: 42px;
    height: 3px;
    content: "";
    background: rgba(255, 255, 255, 0.46);
    transform: translateX(-50%);
  }

  .library-drawer.is-open {
    transform: translate3d(0, 0, 0);
  }

  .drawer-head {
    position: sticky;
    z-index: 8;
    top: 0;
    min-height: 62px;
    padding: 14px var(--mobile-gutter) 8px;
    gap: 8px;
    background: rgba(4, 4, 4, 0.97);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
  }

  .drawer-identity {
    min-width: 0;
    flex: 1 1 auto;
  }

  .drawer-identity .module-index {
    display: none;
  }

  .drawer-brand {
    max-width: 84px;
    overflow: hidden;
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .drawer-actions {
    min-width: 0;
    margin-left: auto;
    gap: 5px;
  }

  .drawer-actions .icon-button,
  .drawer-actions .auth-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .drawer-actions .auth-button {
    width: 50px;
    min-width: 50px;
    gap: 2px;
    flex-direction: column;
  }

  .drawer-actions .auth-button span {
    font-size: 7px;
  }

  .drawer-scroll {
    display: flex;
    height: calc(100% - 62px);
    max-height: none;
    flex-direction: column;
    gap: 10px;
    padding: 10px var(--mobile-gutter) calc(20px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    scroll-padding-top: 8px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .metric-grid {
    order: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    background: var(--line);
    border: 1px solid var(--line);
  }

  .metric-item {
    min-width: 0;
    min-height: 68px;
    padding: 10px 8px;
    background: #0a0a0a;
  }

  .metric-item svg {
    width: 13px;
    height: 13px;
  }

  .metric-item strong {
    font-size: clamp(18px, 6vw, 24px);
    line-height: 1;
  }

  .metric-item span,
  .metric-item small {
    font-size: 7px;
    line-height: 1.2;
  }

  .control-stack {
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
  }

  .control-stack > .filter-panel {
    order: 1;
  }

  .control-stack > .favorite-panel {
    order: 2;
  }

  .control-stack > .random-panel {
    order: 3;
  }

  .filter-panel,
  .favorite-panel,
  .random-panel {
    min-width: 0;
    margin: 0;
    padding: 10px;
    clip-path: var(--clip-sm);
  }

  .filter-toggle-button {
    min-height: 46px;
    padding: 0 4px;
  }

  .filter-toggle-button .module-index {
    margin-bottom: 3px;
    font-size: 7px;
  }

  .filter-toggle-button strong {
    font-size: 16px;
  }

  .filter-content {
    padding-top: 10px;
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .field select,
  .field input,
  .field textarea {
    font-size: 16px;
  }

  .filter-grid select {
    min-height: 48px;
  }

  .favorite-toggle-button {
    min-height: 54px;
    padding: 0 4px;
    gap: 10px;
  }

  .favorite-toggle-button .quick-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .favorite-toggle-button strong {
    font-size: 11px;
  }

  .favorite-toggle-button small {
    display: block;
    max-width: 100%;
    margin-top: 2px;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .random-panel .panel-heading {
    min-height: auto;
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  .random-panel .panel-heading .module-index {
    font-size: 7px;
  }

  .random-panel .panel-heading strong {
    font-size: 15px;
  }

  .random-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .random-button {
    min-width: 0;
    min-height: 66px;
    grid-template-columns: 1fr;
    grid-template-rows: 28px auto;
    justify-items: center;
    align-content: center;
    padding: 7px 4px;
    gap: 5px;
    text-align: center;
  }

  .random-button .quick-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .random-button > span:last-child {
    max-width: 100%;
    font-size: 8px;
    line-height: 1.2;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .library-panel {
    order: 3;
    min-width: 0;
    margin: 2px 0 0;
  }

  .library-head {
    min-height: 50px;
    margin-bottom: 8px;
    padding: 0;
    align-items: flex-end;
  }

  .library-title h2 {
    font-size: clamp(24px, 8vw, 32px);
  }

  .muted-count {
    max-width: 38%;
    overflow: hidden;
    font-size: 8px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .status-tabs {
    position: sticky;
    z-index: 4;
    top: -10px;
    display: flex;
    width: calc(100% + (var(--mobile-gutter) * 2));
    margin: 0 calc(var(--mobile-gutter) * -1) 8px;
    padding: 8px var(--mobile-gutter);
    gap: 6px;
    overflow-x: auto;
    background: rgba(4, 4, 4, 0.96);
    border-block: 1px solid var(--line);
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .status-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-button {
    min-width: max-content;
    min-height: 44px;
    flex: 0 0 auto;
    padding: 0 12px;
    scroll-snap-align: start;
  }

  .card-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .media-card {
    min-width: 0;
    contain: layout paint;
  }

  .media-card-open {
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 172px;
    transform: none;
    clip-path: var(--clip-sm);
  }

  .poster-frame {
    width: 112px;
    height: 100%;
    min-height: 172px;
    aspect-ratio: auto;
  }

  .poster-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .card-body {
    min-width: 0;
    min-height: 172px;
    padding: 12px;
    gap: 7px;
  }

  .card-eyebrow {
    font-size: 8px;
  }

  .card-title {
    min-height: 0;
    font-size: 15px;
    line-height: 1.24;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .card-status {
    min-height: 36px;
    padding: 0 9px;
    font-size: 9px;
  }

  .score-row {
    gap: 6px;
  }

  .score-pill {
    min-width: 0;
    min-height: 42px;
    padding: 6px 8px;
  }

  .score-pill span {
    font-size: 7px;
  }

  .score-pill strong {
    font-size: 15px;
  }

  .card-hover-synopsis {
    display: none !important;
  }

  .details-dialog {
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    overflow: hidden;
    border: 0;
    clip-path: none;
  }

  #detailsContent {
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .detail-layout {
    display: block;
    width: 100%;
    min-height: 100%;
  }

  .detail-poster-frame {
    width: 100%;
    height: min(42svh, 390px);
    min-height: 270px;
    position: relative;
  }

  .detail-poster-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 24%;
  }

  .detail-close-button {
    position: fixed;
    z-index: 12;
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    background: rgba(245, 245, 242, 0.96);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.34);
  }

  .detail-main {
    min-width: 0;
    min-height: auto;
    padding: 18px var(--mobile-gutter) calc(24px + env(safe-area-inset-bottom));
    gap: 12px;
  }

  .detail-heading {
    min-width: 0;
    padding-right: 0;
  }

  .detail-title {
    max-width: calc(100vw - (var(--mobile-gutter) * 2));
    font-size: clamp(25px, 8vw, 34px);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .detail-original-title {
    font-size: 13px;
    line-height: 1.4;
  }

  .detail-score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .detail-score-grid .service-score {
    min-width: 0;
    min-height: 78px;
    padding: 12px;
  }

  .detail-score-grid .service-score strong {
    font-size: clamp(27px, 9vw, 38px);
  }

  .detail-section {
    min-width: 0;
    padding: 14px;
  }

  .detail-section p,
  .detail-synopsis {
    font-size: 15px;
    line-height: 1.62;
  }

  .detail-fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .detail-fact {
    min-width: 0;
    min-height: 68px;
    padding: 11px;
  }

  .detail-fact strong {
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .status-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .status-choice {
    min-height: 48px;
    padding: 7px;
  }

  .detail-card-footer,
  .detail-owner-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .detail-card-footer button,
  .detail-owner-actions button {
    width: 100%;
    min-height: 48px;
  }

  .pin-dialog,
  .confirm-dialog {
    inset: auto 8px calc(8px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    max-height: calc(100dvh - env(safe-area-inset-top) - 16px);
    margin: 0;
    clip-path: polygon(0 10px, 10px 0, 100% 0, 100% 100%, 0 100%);
  }

  .pin-form,
  .confirm-form {
    gap: 12px;
    padding: 16px;
  }

  .pin-header,
  .dialog-title-row {
    margin: 0;
    padding-bottom: 12px;
  }

  .pin-header h2,
  .dialog-title-row h2 {
    font-size: 20px;
  }

  .pin-close-button,
  .confirm-dialog .icon-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .pin-console {
    padding: 12px;
  }

  .pin-slots {
    gap: 6px;
  }

  .pin-slots span {
    aspect-ratio: 0.95;
  }

  .pin-keypad {
    gap: 6px;
  }

  .pin-keypad button {
    min-height: 50px;
    font-size: 17px;
  }

  .pin-submit-button {
    min-height: 52px;
  }

  .confirm-message {
    font-size: 15px;
    line-height: 1.55;
  }

  .confirm-dialog .dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 4px;
    padding-top: 12px;
  }

  .confirm-dialog .action-spacer {
    display: none;
  }

  .confirm-dialog .dialog-actions button {
    width: 100%;
    min-width: 0;
  }

  .edit-dialog {
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    overflow: hidden;
    border: 0;
    clip-path: none;
  }

  .edit-form {
    height: 100dvh;
    padding: 0 var(--mobile-gutter) calc(92px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .edit-form > .dialog-title-row {
    position: sticky;
    z-index: 6;
    top: 0;
    min-height: calc(64px + env(safe-area-inset-top));
    margin: 0 calc(var(--mobile-gutter) * -1) 14px;
    padding: calc(10px + env(safe-area-inset-top)) var(--mobile-gutter) 10px;
    background: rgba(4, 4, 4, 0.98);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
  }

  .edit-form > .dialog-title-row h2 {
    max-width: calc(100vw - 86px);
    font-size: 22px;
    line-height: 1.1;
  }

  .edit-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .edit-grid .field,
  .edit-grid .wide {
    grid-column: 1;
    min-width: 0;
  }

  .edit-grid input,
  .edit-grid select {
    min-height: 50px;
  }

  .edit-grid textarea {
    min-height: 124px;
    resize: vertical;
  }

  .poster-upload-control {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
  }

  .poster-upload-preview {
    width: 88px;
    min-width: 88px;
    aspect-ratio: 2 / 3;
  }

  .poster-upload-actions {
    min-width: 0;
  }

  .poster-upload-actions button {
    width: 100%;
    min-width: 0;
    padding-inline: 9px;
  }

  .edit-form > .dialog-actions {
    position: fixed;
    z-index: 9;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 7px;
    margin: 0;
    padding: 9px var(--mobile-gutter) calc(9px + env(safe-area-inset-bottom));
    background: rgba(4, 4, 4, 0.98);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
  }

  .edit-form > .dialog-actions .action-spacer {
    display: none;
  }

  .edit-form > .dialog-actions button {
    min-width: 0;
    min-height: 48px;
    padding-inline: 8px;
  }

  .edit-form > .dialog-actions .danger {
    width: 48px;
    padding: 0;
    font-size: 0;
  }

  .edit-form > .dialog-actions .danger svg {
    width: 18px;
    height: 18px;
  }

  .toast {
    right: var(--mobile-gutter);
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: var(--mobile-gutter);
    width: auto;
    max-width: none;
  }

  html.a11y-mode .home-shell {
    padding-top: calc(var(--mobile-chrome) + env(safe-area-inset-top) + 34px);
  }

  html.a11y-mode .search-intro h1 {
    font-size: clamp(40px, 12vw, 52px);
  }

  html.a11y-mode .search-control-row .owner-mode-button {
    min-height: 60px;
    font-size: 11px;
  }

  html.a11y-mode .drawer-scroll {
    padding: 10px var(--mobile-gutter) calc(20px + env(safe-area-inset-bottom));
  }

  html.a11y-mode .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html.a11y-mode .metric-item {
    min-height: 82px;
  }

  html.a11y-mode .media-card-open {
    grid-template-columns: 124px minmax(0, 1fr);
    min-height: 208px;
  }

  html.a11y-mode .poster-frame {
    width: 124px;
    min-height: 208px;
  }

  html.a11y-mode .card-body {
    min-height: 208px;
    padding: 14px;
  }

  html.a11y-mode .card-title {
    font-size: 18px;
  }

  html.a11y-mode .detail-main {
    padding: 20px var(--mobile-gutter) calc(28px + env(safe-area-inset-bottom));
  }

  html.a11y-mode .detail-section p,
  html.a11y-mode .detail-synopsis {
    font-size: 18px;
  }
}

@media (max-width: 420px) {
  :root {
    --mobile-gutter: 10px;
  }

  .drawer-identity {
    display: none;
  }

  .drawer-head {
    justify-content: flex-end;
  }

  .drawer-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .metric-item {
    min-height: 60px;
  }

  .detail-fact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .poster-upload-control {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 9px;
  }

  .poster-upload-preview {
    width: 78px;
    min-width: 78px;
  }

  html.a11y-mode .media-card-open {
    grid-template-columns: 116px minmax(0, 1fr);
  }

  html.a11y-mode .poster-frame {
    width: 116px;
  }

  html.a11y-mode .score-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 370px) {
  .search-control-row {
    grid-template-columns: 72px minmax(0, 1fr) 46px;
    gap: 5px;
  }

  .search-control-row .owner-mode-button {
    padding-inline: 6px;
  }

  .search-control-row .hero-auth-button {
    width: 46px;
  }

  .random-button > span:last-child {
    font-size: 7px;
  }

  .media-card-open {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .poster-frame {
    width: 104px;
  }

  .card-body {
    padding: 10px;
  }

  .edit-form > .dialog-actions {
    grid-template-columns: 46px minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 5px;
  }

  .edit-form > .dialog-actions .danger {
    width: 46px;
  }
}

@media (hover: none), (pointer: coarse) {
  .media-card-open:hover,
  .result-row:hover,
  .random-button:hover,
  .favorite-toggle-button:hover,
  .tab-button:hover,
  .icon-button:hover {
    transform: none;
  }

  .media-card-open:active,
  .result-row:active,
  .random-button:active,
  .favorite-toggle-button:active,
  .tab-button:active,
  .icon-button:active {
    transform: scale(0.985);
  }
}

/* Product utilities: franchise view, data quality, backups, deep links, and install. */
.install-app-button[hidden] {
  display: none !important;
}

.search-intro-actions .install-app-button {
  width: 34px;
  height: 34px;
}

.viewer-mode .owner-tools-panel {
  display: none !important;
}

.owner-tool-actions {
  display: grid;
  gap: 8px;
}

.owner-tool-button {
  display: grid;
  width: 100%;
  min-height: 62px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid var(--line);
  text-align: left;
  clip-path: var(--clip-sm);
  transition: border-color var(--motion-ui) ease, background var(--motion-ui) ease, transform var(--motion-ui) var(--motion-ease-premium);
}

.owner-tool-button:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--line-strong);
  transform: translate3d(2px, 0, 0);
}

.owner-tool-button > span:last-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.owner-tool-button strong {
  font-size: 10px;
  text-transform: uppercase;
}

.owner-tool-button small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.view-switch-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--muted-bright);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  clip-path: var(--clip-sm);
  transition: color var(--motion-ui) ease, background var(--motion-ui) ease, border-color var(--motion-ui) ease;
}

.view-switch-button svg {
  width: 15px;
  height: 15px;
}

.view-switch-button.is-active {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
}

.card-grid.is-franchise-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 30px;
}

.franchise-section {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.card-grid.is-franchise-view > .franchise-section {
  grid-column: 1 / -1;
  width: 100%;
}

.franchise-heading {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px 9px;
  border-bottom: 1px solid var(--line);
}

.franchise-heading span {
  overflow-wrap: anywhere;
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 16px;
}

.franchise-heading small {
  min-width: 28px;
  padding: 4px 7px;
  color: var(--ink-inverse);
  background: var(--signal);
  font-size: 9px;
  text-align: center;
  clip-path: var(--clip-sm);
}

.franchise-section.is-singles .franchise-heading {
  color: var(--muted-bright);
}

.franchise-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  counter-reset: media-card;
}

html.a11y-mode .franchise-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.detail-share-button {
  position: absolute;
  top: 16px;
  right: 64px;
  z-index: 6;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: rgba(12, 12, 12, 0.94);
  border: 1px solid var(--line);
  clip-path: var(--clip-sm);
  transition: color var(--motion-ui) ease, background var(--motion-ui) ease, transform var(--motion-ui) var(--motion-ease-premium);
}

.detail-share-button:hover {
  color: var(--ink-inverse);
  background: var(--signal);
  transform: translate3d(0, -2px, 0);
}

.detail-share-button svg {
  width: 17px;
  height: 17px;
}

.detail-heading {
  padding-right: 104px;
}

.utility-dialog {
  width: min(920px, calc(100vw - 32px));
  max-width: none;
  max-height: min(780px, calc(100dvh - 32px));
  overflow: hidden;
}

.utility-dialog-shell {
  display: flex;
  max-height: min(780px, calc(100dvh - 32px));
  padding: 22px;
  flex-direction: column;
  overflow: hidden;
}

.quality-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.quality-summary > div {
  display: grid;
  min-height: 82px;
  align-content: center;
  gap: 4px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.quality-summary > div:last-child {
  border-right: 0;
}

.quality-summary strong {
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 27px;
}

.quality-summary span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.quality-filters {
  display: flex;
  gap: 7px;
  margin: 16px 0 10px;
  padding-bottom: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.quality-filter {
  display: inline-flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--muted-bright);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  clip-path: var(--clip-sm);
}

.quality-filter span {
  color: inherit;
  opacity: 0.68;
}

.quality-filter.is-active {
  color: var(--ink-inverse);
  background: var(--signal);
  border-color: var(--signal);
}

.quality-list,
.backup-list {
  display: grid;
  gap: 7px;
  min-height: 180px;
  overflow: auto;
  padding-right: 5px;
  scrollbar-gutter: stable;
}

.quality-row,
.backup-row {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid var(--line);
  transition: border-color var(--motion-ui) ease, background var(--motion-ui) ease;
}

.quality-row {
  grid-template-columns: 34px minmax(0, 1fr) 40px;
}

.quality-row:hover,
.backup-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
}

.quality-row-icon,
.backup-sequence {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--muted-bright);
  border: 1px solid var(--line);
  font-size: 9px;
  clip-path: var(--clip-sm);
}

.quality-row-icon svg {
  width: 15px;
  height: 15px;
}

.quality-row > div,
.backup-row > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.quality-row strong,
.backup-row strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quality-row span,
.backup-row span {
  color: var(--muted);
  font-size: 10px;
}

.backup-status-band {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.backup-status-band > div {
  display: grid;
  gap: 5px;
}

.backup-status-band strong {
  font-size: 12px;
  text-transform: uppercase;
}

.backup-status-band span {
  color: var(--muted-bright);
  font-size: 10px;
  line-height: 1.45;
}

.backup-row {
  grid-template-columns: 34px minmax(0, 1fr) 40px;
}

.backup-row.is-latest {
  border-color: rgba(245, 242, 234, 0.4);
}

.utility-empty-state,
.utility-loading {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 30px;
  color: var(--muted-bright);
  border: 1px dashed var(--line-strong);
  text-align: center;
}

.utility-empty-state svg,
.utility-loading svg {
  width: 28px;
  height: 28px;
}

.utility-empty-state span,
.utility-loading span {
  color: var(--muted);
  font-size: 11px;
}

.utility-loading svg {
  animation: spin 900ms linear infinite;
}

@media (max-width: 680px) {
  .library-head {
    align-items: flex-start;
  }

  .library-head-actions {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 7px;
  }

  .view-switch-button {
    min-height: 44px;
  }

  .franchise-card-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  html.a11y-mode .franchise-card-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .utility-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    margin: 0;
  }

  .utility-dialog-shell {
    height: 100dvh;
    max-height: none;
    padding: 16px var(--mobile-gutter) calc(18px + env(safe-area-inset-bottom));
  }

  .quality-summary > div {
    min-height: 70px;
    padding: 10px;
  }

  .quality-summary strong {
    font-size: 21px;
  }

  .backup-status-band {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .backup-status-band .primary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .detail-share-button {
    top: 12px;
    right: 60px;
    width: 44px;
    height: 44px;
  }

  .detail-heading {
    padding-right: 0;
  }
}

html.a11y-mode .quality-row strong,
html.a11y-mode .backup-row strong,
html.a11y-mode .owner-tool-button strong {
  font-size: 15px;
}

html.a11y-mode .quality-row span,
html.a11y-mode .backup-row span,
html.a11y-mode .owner-tool-button small,
html.a11y-mode .backup-status-band span {
  font-size: 13px;
}

.owner-account-chooser,
.pin-code-stage,
.access-section,
.owner-directory,
.owner-invitation-list,
.owner-registration-stage {
  display: grid;
  gap: 10px;
}

.owner-account-option,
.owner-directory-row,
.owner-invitation-row {
  display: grid;
  width: 100%;
  min-height: 66px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  clip-path: var(--clip-sm);
}

.owner-account-option {
  cursor: pointer;
}

.owner-account-option:hover,
.owner-directory-row:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: var(--line-strong);
}

.owner-account-option > span:nth-child(2),
.owner-directory-row > span:nth-child(2),
.owner-invitation-row > span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.owner-account-option strong,
.owner-directory-row strong,
.owner-invitation-row strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-account-option small,
.owner-directory-row small,
.owner-invitation-row small,
.access-help,
.owner-directory-row em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.owner-account-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--ink-inverse);
  font-family: "Russo One", "Exo 2", sans-serif;
  background: var(--signal);
  clip-path: var(--clip-sm);
}

.pin-back-button {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  padding: 7px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.pin-back-button svg {
  width: 15px;
  height: 15px;
}

.access-dialog .utility-dialog-shell,
.registration-dialog .utility-dialog-shell {
  width: min(720px, calc(100vw - 32px));
  max-height: min(820px, calc(100dvh - 32px));
  overflow: auto;
}

.access-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.access-logout-button {
  min-height: 40px;
}

.access-section {
  padding: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  clip-path: var(--clip-sm);
}

.access-section-heading,
.access-link-row,
.invite-result,
.totp-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.access-section-heading {
  justify-content: space-between;
}

.access-section-heading h3 {
  margin: 5px 0 0;
}

.access-link-row input,
.invite-result input {
  min-width: 0;
  flex: 1;
}

.invite-result {
  flex-wrap: wrap;
  padding-top: 6px;
}

.invite-result small {
  width: 100%;
  color: var(--muted);
}

.owner-invitation-row {
  min-height: 58px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.owner-registration-form label {
  display: grid;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.owner-slug-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.owner-slug-input small {
  color: var(--muted);
}

.totp-setup-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  clip-path: var(--clip-sm);
}

.totp-setup-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.totp-setup-card code {
  overflow-wrap: anywhere;
  padding: 12px;
  color: var(--signal);
  font-size: 15px;
  letter-spacing: 0.12em;
  background: rgba(0, 0, 0, 0.25);
}

@media (max-width: 680px) {
  .access-dialog .utility-dialog-shell,
  .registration-dialog .utility-dialog-shell {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .access-logout-button {
    width: auto;
    min-width: 92px;
  }

  .access-section-heading,
  .access-link-row,
  .invite-result,
  .totp-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .access-section-heading .primary-button,
  .access-link-row .ghost-button,
  .invite-result .ghost-button,
  .totp-actions .ghost-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .utility-loading svg {
    animation: none;
  }
}

/* Meridian Bridge identity */
:root {
  --bg: #050505;
  --bg-deep: #020202;
  --surface: #0b0b0b;
  --surface-raised: #111;
  --surface-soft: #171717;
  --ink: #f0f0eb;
  --ink-inverse: #050505;
  --signal: #f0f0eb;
  --accent: #f0f0eb;
  --accent-warm: #b9b9b3;
  --accent-rose: #8d8d88;
}

body {
  background:
    radial-gradient(circle at 72% 40%, rgba(240, 240, 235, 0.035), transparent 34%),
    linear-gradient(180deg, #050505 0%, #020202 100%);
}

.system-brand,
.drawer-brand {
  display: flex;
  align-items: center;
}

.system-brand {
  gap: 8px;
}

.system-brand-mark {
  display: block;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.hero-brand-lockup {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  margin: 28px 0 14px;
}

.hero-brand-mark {
  display: block;
  width: 112px;
  height: 112px;
  opacity: 0;
  animation: meridian-mark-enter 520ms 120ms var(--ease-out) forwards;
}

.hero-brand-lockup h1 {
  margin: 0;
}

.search-stage::before {
  right: -120px;
  bottom: -132px;
  z-index: -1;
  display: block !important;
  width: 440px;
  height: 440px;
  background: url("/brand/rondonhashi-mark.svg") center / contain no-repeat;
  border: 0;
  border-radius: 0;
  opacity: 0.035;
  mask-image: none;
  transform: none;
}

.search-stage::after {
  display: none !important;
}

.drawer-brand {
  max-width: none;
  min-height: 44px;
  gap: 11px;
  overflow: visible;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 20px;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  transition: opacity 140ms ease;
}

.drawer-brand:hover {
  opacity: 0.78;
}

.drawer-brand:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 6px;
}

.drawer-brand-mark {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

@media (pointer: fine) {
  .custom-cursor-mark {
    position: absolute;
    inset: 0;
    display: block;
    width: 34px;
    height: 34px;
    opacity: 0.96;
    transition: opacity 160ms ease, transform 160ms var(--ease-out);
  }

  .custom-cursor::before,
  .custom-cursor::after,
  .custom-cursor-ring,
  .custom-cursor-dot {
    display: none;
  }

  .custom-cursor.is-demo {
    filter: none;
  }

  .custom-cursor.is-demo .custom-cursor-mark {
    opacity: 1;
  }

  .custom-cursor.is-pressing .custom-cursor-mark {
    opacity: 0.72;
    transform: scale(0.68);
  }
}

@keyframes meridian-mark-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 680px) {
  .system-brand {
    gap: 6px;
  }

  .system-brand-mark {
    width: 15px;
    height: 15px;
  }

  .hero-brand-lockup {
    display: block;
    margin: 12px 0 14px;
  }

  .hero-brand-mark {
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
  }

  .search-stage::before {
    right: -92px;
    bottom: -72px;
    width: 280px;
    height: 280px;
    opacity: 0.03;
  }

  .drawer-brand {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    gap: 0;
    overflow: visible;
    justify-content: center;
  }

  .drawer-brand-mark {
    width: 32px;
    height: 32px;
  }

  .drawer-brand span {
    display: none;
  }
}

@media (max-width: 420px) {
  .drawer-identity {
    display: flex;
    flex: 0 0 44px;
    overflow: visible;
  }

  .drawer-head {
    justify-content: space-between;
  }

  .drawer-actions {
    width: auto;
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-brand-mark {
    opacity: 1;
    animation: none;
  }
}

/* Accessibility completeness: keep this after every responsive and brand layer. */
html.a11y-mode .system-chrome,
html.a11y-mode .system-chrome > span,
html.a11y-mode .system-brand,
html.a11y-mode .system-chrome-center,
html.a11y-mode .module-index,
html.a11y-mode .system-status,
html.a11y-mode .search-prefix,
html.a11y-mode .search-footnote,
html.a11y-mode .search-footnote span,
html.a11y-mode .field label,
html.a11y-mode .muted-count,
html.a11y-mode .card-eyebrow,
html.a11y-mode .result-meta,
html.a11y-mode .score-label,
html.a11y-mode .detail-fact span,
html.a11y-mode .detail-section h3,
html.a11y-mode .service-score span,
html.a11y-mode .detail-editor-label,
html.a11y-mode .rating-head span,
html.a11y-mode .pin-console-meta {
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
}

html.a11y-mode .drawer-brand {
  font-size: 24px;
}

html.a11y-mode .metric strong {
  font-size: 36px;
}

html.a11y-mode .panel-heading strong,
html.a11y-mode .empty-state strong {
  font-size: 28px;
}

html.a11y-mode .library-title h2 {
  font-size: 40px;
  line-height: 1.1;
}

html.a11y-mode .favorite-toggle-button strong,
html.a11y-mode .random-button > span:last-child {
  font-size: 16px;
  line-height: 1.35;
  white-space: normal;
}

html.a11y-mode .favorite-toggle-button small {
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
}

html.a11y-mode .view-switch-button {
  min-height: 52px;
  padding-inline: 16px;
  font-size: 15px;
  letter-spacing: 0;
}

html.a11y-mode .view-switch-button svg {
  width: 22px;
  height: 22px;
}

html.a11y-mode .franchise-heading span {
  font-size: 20px;
  line-height: 1.35;
}

html.a11y-mode .franchise-heading small {
  min-width: 34px;
  min-height: 32px;
  padding: 7px 9px;
  font-size: 14px;
}

html.a11y-mode .card-synopsis-label {
  font-size: 14px;
}

html.a11y-mode .result-list-head {
  min-height: 52px;
  padding-inline: 12px;
}

html.a11y-mode .result-list-label,
html.a11y-mode .result-list-label strong,
html.a11y-mode .result-list-summary,
html.a11y-mode .result-list-summary span,
html.a11y-mode .result-original-title {
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
}

html.a11y-mode .result-list-summary {
  gap: 10px;
  white-space: normal;
}

html.a11y-mode .detail-cube,
html.a11y-mode .tag-row .pill,
html.a11y-mode .viewer-chip {
  min-height: 38px;
  padding-inline: 12px;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0;
}

html.a11y-mode .detail-close-button,
html.a11y-mode .detail-share-button,
html.a11y-mode .pin-close-button {
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
}

html.a11y-mode .detail-share-button {
  right: 76px;
}

html.a11y-mode .dialog-title-row h2,
html.a11y-mode .pin-header h2 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

html.a11y-mode .pin-keypad button {
  min-height: 58px;
  font-size: 19px;
}

html.a11y-mode .pin-keypad .pin-key-action,
html.a11y-mode .pin-submit-button,
html.a11y-mode .primary-button,
html.a11y-mode .ghost-button {
  font-size: 16px;
  letter-spacing: 0;
}

html.a11y-mode .owner-tool-button {
  min-height: 76px;
}

html.a11y-mode .owner-tool-button strong,
html.a11y-mode .quality-row strong,
html.a11y-mode .backup-row strong,
html.a11y-mode .backup-status-band strong {
  font-size: 16px;
  line-height: 1.35;
}

html.a11y-mode .owner-tool-button small,
html.a11y-mode .quality-row span,
html.a11y-mode .backup-row span,
html.a11y-mode .backup-status-band span,
html.a11y-mode .quality-summary span,
html.a11y-mode .utility-empty-state span,
html.a11y-mode .utility-loading span {
  font-size: 14px;
  line-height: 1.5;
}

html.a11y-mode .quality-filter,
html.a11y-mode .quality-row-icon,
html.a11y-mode .backup-sequence {
  min-height: 44px;
  font-size: 14px;
}

@media (max-width: 680px) {
  html.a11y-mode .system-chrome,
  html.a11y-mode .system-chrome > span,
  html.a11y-mode .system-brand {
    font-size: 14px;
  }

  html.a11y-mode .search-control-row {
    grid-template-columns: 96px minmax(0, 1fr) 58px;
  }

  html.a11y-mode .search-control-row .owner-mode-button,
  html.a11y-mode .search-control-row .hero-auth-button {
    min-height: 64px;
    font-size: 14px;
  }

  html.a11y-mode .search-control-row .hero-auth-button,
  html.a11y-mode .search-control-row .hero-auth-button span {
    font-size: 12px;
  }

  html.a11y-mode .search-control-row .search-box {
    min-height: 64px;
    grid-template-columns: minmax(0, 1fr) 52px;
  }

  html.a11y-mode #externalQuery {
    height: 52px;
    font-size: 19px;
  }

  html.a11y-mode .search-box .round-button[type="submit"] {
    width: 52px;
    height: 52px;
    min-width: 52px;
  }

  html.a11y-mode .result-list-label,
  html.a11y-mode .result-list-label strong,
  html.a11y-mode .result-list-summary,
  html.a11y-mode .result-list-summary span,
  html.a11y-mode .result-original-title,
  html.a11y-mode .result-meta {
    font-size: 14px;
  }

  html.a11y-mode .result-row {
    min-height: 104px;
  }

  html.a11y-mode .result-title {
    font-size: 19px;
  }

  html.a11y-mode .drawer-head {
    min-height: 72px;
  }

  html.a11y-mode .drawer-scroll {
    height: calc(100% - 72px);
  }

  html.a11y-mode .drawer-actions .icon-button,
  html.a11y-mode .drawer-actions .auth-button {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
  }

  html.a11y-mode .drawer-actions .auth-button span {
    font-size: 11px;
  }

  html.a11y-mode .metric-item {
    min-height: 88px;
    padding: 12px 8px;
  }

  html.a11y-mode .metric-item strong {
    font-size: 28px;
  }

  html.a11y-mode .metric-item span,
  html.a11y-mode .metric-item small {
    font-size: 12px;
    line-height: 1.3;
  }

  html.a11y-mode .filter-toggle-button .module-index,
  html.a11y-mode .random-panel .panel-heading .module-index,
  html.a11y-mode .card-eyebrow,
  html.a11y-mode .score-label {
    font-size: 13px;
  }

  html.a11y-mode .favorite-toggle-button strong,
  html.a11y-mode .random-button > span:last-child {
    font-size: 14px;
  }

  html.a11y-mode .random-button {
    min-height: 88px;
    padding: 10px 8px;
  }

  html.a11y-mode .library-title h2 {
    font-size: 36px;
  }

  html.a11y-mode .muted-count {
    max-width: 46%;
    font-size: 13px;
    white-space: normal;
  }

  html.a11y-mode .media-card-open {
    grid-template-columns: 132px minmax(0, 1fr);
    min-height: 244px;
  }

  html.a11y-mode .poster-frame {
    width: 132px;
    min-height: 244px;
  }

  html.a11y-mode .card-body {
    min-height: 244px;
  }

  html.a11y-mode .card-title {
    font-size: 19px;
  }

  html.a11y-mode .card-status {
    min-height: 48px;
    font-size: 14px;
  }

  html.a11y-mode .score-pill {
    min-height: 58px;
  }

  html.a11y-mode .score-pill span {
    font-size: 13px;
  }

  html.a11y-mode .score-pill strong {
    font-size: 20px;
  }

  html.a11y-mode .detail-close-button,
  html.a11y-mode .detail-share-button {
    top: calc(10px + env(safe-area-inset-top));
  }

  html.a11y-mode .detail-share-button {
    right: 72px;
  }

  html.a11y-mode .detail-section p,
  html.a11y-mode .detail-synopsis {
    font-size: 18px;
    line-height: 1.7;
  }

  html.a11y-mode .detail-fact strong {
    font-size: 16px;
  }

  html.a11y-mode .quality-summary {
    grid-template-columns: 1fr;
  }

  html.a11y-mode .quality-summary > div {
    min-height: 78px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  html.a11y-mode .quality-summary > div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 420px) {
  html.a11y-mode .search-control-row {
    grid-template-columns: 88px minmax(0, 1fr) 54px;
  }

  html.a11y-mode .media-card-open {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  html.a11y-mode .poster-frame {
    width: 118px;
  }

  html.a11y-mode .library-head {
    align-items: flex-start;
    flex-direction: column;
  }

  html.a11y-mode .library-head-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Final control surface: one sticky stack, collection intelligence, and cursor lens. */
@media (min-width: 681px) {
  .control-stack {
    position: sticky;
    top: 0;
    max-height: calc(100dvh - 132px);
    padding-right: 5px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .control-stack::-webkit-scrollbar {
    width: 7px;
  }

  .control-stack::-webkit-scrollbar-track {
    background: #080909;
    border-left: 1px solid var(--line);
  }

  .control-stack::-webkit-scrollbar-thumb {
    background: var(--muted);
    border: 2px solid #080909;
  }
}

.insights-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.insights-summary > div {
  display: grid;
  min-height: 82px;
  align-content: center;
  gap: 4px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.insights-summary > div:last-child {
  border-right: 0;
}

.insights-summary strong {
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 27px;
}

.insights-summary span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  overflow: auto;
  padding-right: 5px;
  scrollbar-gutter: stable;
}

.insight-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid var(--line);
  clip-path: var(--clip-sm);
}

.insight-panel-wide {
  grid-column: 1 / -1;
}

.insight-panel > header {
  display: grid;
  gap: 5px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.insight-panel > header strong {
  font-size: 13px;
  text-transform: uppercase;
}

.insight-row {
  display: grid;
  gap: 7px;
}

.insight-row > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.insight-row strong {
  font-size: 11px;
}

.insight-row span {
  color: var(--muted-bright);
  font-size: 9px;
}

.insight-track {
  display: block;
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.insight-track i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--signal);
  transform: scaleX(var(--insight-scale, 0));
  transform-origin: left center;
  transition: transform 320ms var(--motion-ease-premium);
  will-change: transform;
}

.diagnostics-status-band {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.diagnostics-status-band > div {
  display: grid;
  gap: 5px;
}

.diagnostics-status-band strong {
  font-size: 12px;
  text-transform: uppercase;
}

.diagnostics-status-band span {
  color: var(--muted-bright);
  font-size: 10px;
  line-height: 1.45;
}

.diagnostics-status-band .quick-icon svg,
.diagnostics-status-band .utility-loading svg {
  animation: none;
}

.diagnostics-list {
  display: grid;
  min-height: 220px;
  gap: 7px;
  margin-top: 16px;
  overflow: auto;
  padding-right: 5px;
  scrollbar-gutter: stable;
}

.diagnostic-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid var(--line);
}

.diagnostic-row.is-ok {
  border-left-color: rgba(240, 240, 235, 0.72);
}

.diagnostic-row.is-warn {
  border-left-color: #b8a06b;
}

.diagnostic-row.is-error {
  border-left-color: #b95d5d;
}

.diagnostic-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--muted-bright);
  border: 1px solid var(--line);
  clip-path: var(--clip-sm);
}

.diagnostic-icon svg {
  width: 16px;
  height: 16px;
}

.diagnostic-row > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.diagnostic-row strong {
  font-size: 12px;
}

.diagnostic-row span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.diagnostics-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

@media (pointer: fine) {
  .custom-cursor {
    mix-blend-mode: difference;
  }

  body.cursor-demoing .custom-cursor {
    mix-blend-mode: normal;
  }

  .custom-cursor::before {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    display: block;
    width: 14px;
    height: 14px;
    content: "";
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    opacity: 0.94;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 150ms var(--motion-ease-premium), opacity 120ms ease;
  }

  .custom-cursor.is-interactive::before {
    transform: translate(-50%, -50%) scale(1.75);
  }

  .custom-cursor.is-media::before {
    transform: translate(-50%, -50%) scale(3.2);
  }

  .custom-cursor-mark {
    z-index: 1;
  }

  .custom-cursor.is-demo::before {
    opacity: 0;
  }

  .custom-cursor.is-pressing::before {
    transform: translate(-50%, -50%) scale(0.72);
  }
}

html.a11y-mode .insights-summary span,
html.a11y-mode .insight-row strong,
html.a11y-mode .insight-row span,
html.a11y-mode .diagnostics-status-band span,
html.a11y-mode .diagnostic-row span {
  font-size: 14px;
}

html.a11y-mode .insight-panel > header strong,
html.a11y-mode .diagnostics-status-band strong,
html.a11y-mode .diagnostic-row strong {
  font-size: 17px;
}

@media (max-width: 680px) {
  .control-stack {
    position: static;
    top: auto;
    max-height: none;
    padding-right: 0;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .control-stack > .owner-tools-panel {
    order: 4;
  }

  .filter-panel,
  .favorite-panel,
  .random-panel,
  .owner-tools-panel {
    min-width: 0;
    margin: 0;
    padding: 10px;
    clip-path: var(--clip-sm);
  }

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

  .insights-summary > div:nth-child(2) {
    border-right: 0;
  }

  .insights-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

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

  .insight-panel-wide {
    grid-column: auto;
  }

  .diagnostics-actions .primary-button {
    width: 100%;
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .insight-track i,
  .custom-cursor::before {
    transition: none;
  }
}

/* Space service index */
.space-service-nav {
  position: absolute;
  top: 56px;
  right: max(40px, calc((100vw - 960px) / 2));
  z-index: 8;
  display: flex;
  padding: 5px;
  background: rgba(5, 5, 5, 0.98);
  border: 1px solid var(--line);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.3);
}

.space-service-nav a {
  position: relative;
  display: grid;
  min-width: 166px;
  min-height: 58px;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  transition: none;
}

.space-service-nav a + a {
  border-left: 1px solid var(--line);
}

.space-service-nav a::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  content: "";
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity 170ms ease, transform 170ms var(--motion-ease-premium);
}

.space-service-nav a:hover,
.space-service-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.space-service-nav a:hover::after,
.space-service-nav a:focus-visible::after,
.space-service-nav a.is-current::after {
  opacity: 1;
  transform: scaleX(1);
}

.space-service-nav a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.space-service-nav a.is-current {
  background: var(--ink);
  color: var(--ink-inverse);
}

.space-service-index {
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 8px;
}

.space-service-copy {
  display: grid;
  gap: 3px;
}

.space-service-copy strong {
  font-family: "Russo One", "Exo 2", sans-serif;
  font-size: 11px;
}

.space-service-copy small {
  color: currentColor;
  font-size: 7px;
  font-weight: 800;
  opacity: 0.58;
  text-transform: uppercase;
}

.space-service-nav svg {
  width: 14px;
  height: 14px;
}

html.a11y-mode .space-service-nav a {
  min-width: 166px;
  min-height: 56px;
}

html.a11y-mode .space-service-nav span,
html.a11y-mode .space-service-nav small,
html.a11y-mode .space-service-nav strong {
  font-size: 14px;
  letter-spacing: 0;
}

@media (max-width: 680px) {
  .space-service-nav {
    top: 50px;
    right: 12px;
    left: 12px;
    padding: 4px;
  }

  .space-service-nav a {
    width: 33.333%;
    min-width: 0;
    min-height: 52px;
  }

  .home-shell {
    padding-top: 124px;
  }
}

@media (max-width: 370px) {
  .space-service-nav a {
    padding-inline: 9px;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 6px;
  }

  .space-service-copy strong {
    font-size: 10px;
  }

  .space-service-copy small {
    display: none;
  }
}

/* Motion system v3: one composited layer per interaction. */
.library-drawer .media-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
}

@media (prefers-reduced-motion: no-preference) {
  body::before,
  .system-chrome > span,
  .system-chrome-actions,
  .search-intro-meta,
  .hero-brand-mark,
  .search-intro h1,
  .search-intro h1 span,
  .search-intro p,
  .search-box,
  .search-box::before,
  .search-footnote,
  .result-row,
  .tab-button.is-active,
  .favorite-flag,
  .favorite-toggle-button.is-active .quick-icon svg,
  .drawer-open .drawer-head,
  .drawer-open .drawer-actions .icon-button,
  .drawer-open .metric,
  .drawer-open .filter-panel,
  .drawer-open .favorite-panel,
  .drawer-open .random-panel,
  .drawer-open .library-head,
  .drawer-open .status-tabs,
  .drawer-open .media-card,
  .details-dialog[open] .detail-poster-frame,
  .details-dialog[open] .detail-main,
  .details-dialog[open] .detail-meta,
  .details-dialog[open] .detail-fact-grid,
  .details-dialog[open] .detail-score-grid .service-score,
  .details-dialog[open] .detail-status-editor,
  .details-dialog[open] .detail-rating-editor,
  .details-dialog[open] .detail-section,
  .details-dialog[open] .detail-card-footer {
    animation: none;
  }

  .search-stage {
    animation: motion-stage-in 260ms var(--motion-ease-precise) both;
  }

  .library-drawer {
    transition:
      opacity 140ms linear,
      transform 220ms var(--motion-ease-precise);
  }

  .drawer-open .drawer-backdrop {
    animation-duration: 160ms;
  }

  dialog[open] {
    animation: motion-dialog-in 220ms var(--motion-ease-precise) both;
  }

  dialog[open]::backdrop {
    animation-duration: 160ms;
  }

  .media-card.is-favorite-pulse .favorite-flag {
    animation: motion-control-pop 260ms var(--motion-ease-precise) both;
  }
}

@media (pointer: fine) {
  .custom-cursor {
    contain: strict;
    isolation: isolate;
    mix-blend-mode: normal;
  }
}

@keyframes motion-stage-in {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes motion-control-pop {
  0% {
    transform: scale3d(0.88, 0.88, 1);
  }
  70% {
    transform: scale3d(1.04, 1.04, 1);
  }
  100% {
    transform: scale3d(1, 1, 1);
  }
}

@keyframes motion-dialog-in {
  from {
    opacity: 0;
    transform: translate3d(0, 6px, 0) scale3d(0.992, 0.992, 1);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
  }
}
