@scope ([data-character-explore]) {
:scope { padding-top:64px; }
/* ==========================================================================
   Ottermind · AI Character Explore
   A standalone, production-shaped template. The shared marketing chrome is
   reproduced here (logo, nav rhythm, white/green palette, dark footer) and the
   library/apply/create flows are fully interactive.
   ========================================================================== */

:scope {
  --paper: #ffffff;
  --paper-deep: #f2f2f2;
  --paper-light: #ffffff;
  --cream: #ffffff;
  --ink: #151814;
  --ink-soft: #3a3f38;
  --muted: #62675f;
  --muted-soft: #858980;
  --line: rgba(21, 24, 20, 0.13);
  --line-strong: rgba(21, 24, 20, 0.24);
  --green: #28be66;
  --green-bright: #2fc77a;
  --green-deep: #0f3d26;
  --green-ink: #062214;
  --amber: #d8b46a;
  --stage: #0e1310;
  --stage-2: #151b16;
  --stage-3: #1b221c;
  --danger: #e2634f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Mono", "Roboto Mono", Menlo, monospace;
  --radius-xl: 30px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 1px 2px rgba(21, 24, 20, 0.04), 0 14px 40px -24px rgba(21, 24, 20, 0.22);
  --shadow-dialog: 0 30px 90px -30px rgba(0, 0, 0, 0.7), 0 2px 0 rgba(255, 255, 255, 0.05) inset;
  --nav-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

:scope {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

:scope {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

:scope.is-locked {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
figure {
  margin: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

::selection {
  background: var(--green);
  color: var(--green-ink);
}

[hidden] {
  display: none !important;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--muted);
}

.live-dot {
  position: relative;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(40, 190, 102, 0.14);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(40, 190, 102, 0.45);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(0.7); opacity: 0.8; }
  70%, 100% { transform: scale(1.5); opacity: 0; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition:
    background-color 0.22s var(--ease),
    border-color 0.22s var(--ease),
    color 0.22s var(--ease),
    transform 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.99);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 10px 24px -14px rgba(40, 190, 102, 0.85);
}

.btn-primary:hover {
  background: #23ad5c;
  box-shadow: 0 14px 30px -12px rgba(40, 190, 102, 0.9);
}

.btn-outline {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--ink);
  background: rgba(21, 24, 20, 0.045);
}

.btn-ghost {
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--ink);
  background: rgba(21, 24, 20, 0.06);
}

.btn-sm {
  min-height: 36px;
  padding: 0 15px;
  font-size: 13px;
}

.btn-lg {
  min-height: 52px;
  padding: 0 26px;
  font-size: 15px;
}

.btn svg {
  flex: 0 0 auto;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
}

.nav {
  /* Match the Ottermind landing page chrome: white bar, ink navigation. */
  background: #ffffff;
  transition:
    box-shadow 0.3s var(--ease),
    background-color 0.3s var(--ease);
}

.site-header.is-scrolled .nav {
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(21, 24, 20, 0.07), 0 16px 36px -28px rgba(21, 24, 20, 0.3);
}

.nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: 1480px;
  height: var(--nav-h);
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  color: var(--ink);
  transition: color 0.25s var(--ease);
}

.brand-icon {
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(21, 24, 20, 0.14);
}

.brand-word {
  width: 102px;
  height: auto;
  color: var(--ink);
  transition: color 0.25s var(--ease);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition:
    background-color 0.18s var(--ease),
    color 0.25s var(--ease);
}

.nav-link:hover,
.nav-trigger[aria-expanded="true"] {
  background: rgba(21, 24, 20, 0.06);
}

.chev {
  opacity: 0.55;
  transition: transform 0.2s var(--ease);
}

.nav-trigger[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  transition:
    color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    background-color 0.25s var(--ease);
}

/* Mega menus --------------------------------------------------------------- */

.has-mega {
  position: static;
}

.mega {
  position: absolute;
  top: calc(100% - 6px);
  left: 50%;
  z-index: 30;
  display: grid;
  grid-template-columns: 1.15fr 0.92fr 0.92fr;
  gap: 26px;
  width: min(780px, calc(100vw - 48px));
  padding: 24px;
  border: 1px solid rgba(21, 24, 20, 0.1);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 34px 80px -34px rgba(21, 24, 20, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease),
    visibility 0.2s;
}

.has-mega:hover .mega,
.has-mega:focus-within .mega,
.has-mega.is-open .mega {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.mega-intro {
  padding: 6px 8px 6px 4px;
  border-right: 1px solid var(--line);
}

.mega-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--green-deep);
}

.mega-intro h3 {
  margin-top: 9px;
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.mega-intro p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.mega-intro a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 650;
}

.mega-intro a:hover {
  text-decoration: underline;
}

.mega-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 6px;
}

.mega-title {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: none;
}

.mega-col a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 13px;
}

.mega-col a:hover {
  background: rgba(21, 24, 20, 0.05);
  color: var(--ink);
}

.mega-col a.is-current {
  background: rgba(40, 190, 102, 0.1);
  color: var(--green-deep);
  font-weight: 650;
}

.mini-new {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(40, 190, 102, 0.14);
  color: var(--green-deep);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: none;
}

/* Mobile drawer ------------------------------------------------------------ */

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 18px 22px 34px;
  background: rgba(255, 255, 255, 0.99);
  backdrop-filter: blur(16px);
  overflow-y: auto;
}

.mobile-drawer.is-open {
  display: flex;
  animation: drawerIn 0.28s var(--ease-out);
}

@keyframes drawerIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: none;
  color: var(--muted);
}

.mobile-drawer-head button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
}

.mobile-drawer > a {
  padding: 14px 2px;
  border-bottom: 1px solid rgba(21, 24, 20, 0.08);
  font-size: 20px;
  font-weight: 550;
  letter-spacing: -0.01em;
}

.mobile-drawer > a.btn {
  margin-top: 18px;
  justify-content: center;
  border-bottom: 0;
  color: #fff;
  font-size: 14px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  min-height: min(860px, 100svh);
  padding: 118px 24px 64px;
  color: var(--paper);
  background: #0a0e0b;
}

/* Full-bleed artwork. The composition keeps every figure on the right, so the
   copy always lands on the darker left side of the frame. */
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -4;
  overflow: hidden;
}

.hero-media picture,
.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-media img {
  object-fit: cover;
  object-position: 68% 36%;
}

/* Legibility scrim: almost opaque on the left, clear over the figures. */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(6, 10, 8, 0.96) 0%,
      rgba(6, 10, 8, 0.9) 16%,
      rgba(6, 10, 8, 0.66) 36%,
      rgba(6, 10, 8, 0.28) 54%,
      rgba(6, 10, 8, 0.05) 72%,
      rgba(6, 10, 8, 0) 100%
    ),
    linear-gradient(
      180deg,
      rgba(6, 10, 8, 0.62) 0%,
      rgba(6, 10, 8, 0) 24%,
      rgba(6, 10, 8, 0) 64%,
      rgba(8, 12, 9, 0.6) 100%
    );
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 78% 80% at 58% 44%, transparent 40%, rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
}

.hero-noise {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.13;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 700px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 4.5vw, 64px);
  width: 100%;
  max-width: 1360px;
  min-height: calc(min(860px, 100svh) - 182px);
  margin: 0 auto;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 690px;
  animation: riseIn 0.9s var(--ease-out) both;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
  max-width: 760px;
  color: var(--paper);
  font-family: var(--sans);
  font-size: clamp(54px, 6.2vw, 98px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero h1 em {
  position: relative;
  color: #8ff0b4;
  font-style: normal;
  font-weight: 600;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  right: 0.04em;
  bottom: 0.02em;
  left: 0.02em;
  height: 0.055em;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(143, 240, 180, 0), var(--green) 30%, var(--green));
  opacity: 0.9;
}

.hero-lede {
  max-width: 560px;
  margin-top: 28px;
  color: rgba(255, 253, 247, 0.74);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.7;
}


@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Library
   ========================================================================== */

.library {
  padding: clamp(72px, 8vw, 110px) 24px clamp(70px, 8vw, 110px);
}

.section-head {
  max-width: 1360px;
  margin: 0 auto clamp(30px, 4vw, 48px);
}

.section-head .eyebrow {
  color: var(--green-deep);
}

.section-head h2 {
  max-width: 900px;
  margin-top: 0;
  font-family: var(--sans);
  font-size: clamp(40px, 5vw, 70px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.section-head h2 em {
  color: var(--green-deep);
  font-style: normal;
  font-weight: 600;
}

.section-lede {
  max-width: 660px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.65;
}

.library-shell {
  max-width: 1360px;
  margin: 0 auto;
}

/* Tabs --------------------------------------------------------------------- */

.tabbar {
  position: sticky;
  top: 64px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  background: var(--ink);
  color: var(--paper);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(21, 24, 20, 0.08);
  color: inherit;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tab.is-active .tab-count {
  background: rgba(255, 255, 255, 0.16);
}

.tabbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-right: 2px;
}

/* Toolbar ------------------------------------------------------------------ */

.library-toolbar {
  position: sticky;
  top: 120px;
  z-index: 24;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 15px;
  border-bottom-left-radius: 15px;
  background: #ffffff;
  box-shadow: 0 12px 30px -30px rgba(21, 24, 20, 0.35);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(21, 24, 20, 0.05);
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.search-field:focus-within {
  border-color: rgba(40, 190, 102, 0.55);
  background: var(--cream);
}

.search-field svg {
  flex: 0 0 auto;
  color: var(--muted);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  outline: none;
}

.search-field input::placeholder {
  color: var(--muted);
}

.search-field input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(21, 24, 20, 0.08);
  color: var(--muted);
}

.search-clear:hover {
  color: var(--ink);
}

.taxonomy-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.multi-filter {
  position: relative;
  flex: 0 0 auto;
}

.multi-filter > summary {
  display: block;
  height: 42px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fafafa;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition:
    border-color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.multi-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  min-width: 0;
}

.multi-filter > summary::marker { content: ""; font-size: 0; }

.multi-filter > summary::-webkit-details-marker {
  display: none;
}

.multi-filter > summary:hover {
  border-color: var(--line-strong);
  background: #ffffff;
}

.multi-filter[open] > summary {
  border-color: rgba(40, 190, 102, 0.55);
  background: #ffffff;
}

.multi-filter > summary:focus-visible {
  outline: 2px solid rgba(40, 190, 102, 0.45);
  outline-offset: 2px;
}

.multi-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.multi-value {
  max-width: 165px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-filter.has-value .multi-value {
  color: var(--green-deep);
}

.multi-chevron {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  color: var(--muted);
  transition: transform 0.2s var(--ease);
}

.multi-filter[open] .multi-chevron {
  transform: rotate(180deg);
}

.multi-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 80;
  min-width: 260px;
  max-width: min(300px, calc(100vw - 32px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 22px 50px -24px rgba(21, 24, 20, 0.35);
}

.multi-filter.align-right .multi-menu {
  right: 0;
  left: auto;
}

.multi-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  padding: 0 9px 0 11px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}

.multi-option:hover {
  background: rgba(21, 24, 20, 0.04);
}

.multi-option:has(input:checked) {
  background: rgba(40, 190, 102, 0.06);
}

.multi-option input {
  position: relative;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  background: #ffffff;
  appearance: none;
  cursor: pointer;
}

.multi-option input:checked {
  border-color: var(--green);
  background: var(--green);
}

.multi-option input:checked::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 4px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.taxonomy-reset {
  margin-left: auto;
  padding: 6px 8px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color 0.2s var(--ease);
}

.taxonomy-reset:hover {
  color: var(--ink);
}

/* Masonry ------------------------------------------------------------------ */

.masonry {
  columns: 4;
  column-gap: 20px;
  margin-top: 20px;
}

.char-card {
  position: relative;
  break-inside: avoid;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--cream);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transform: translateZ(0);
  animation: cardIn 0.55s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 35ms);
  transition:
    transform 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out),
    border-color 0.3s var(--ease);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.char-card:hover {
  transform: translateY(-4px);
  border-color: rgba(21, 24, 20, 0.2);
  box-shadow: 0 2px 4px rgba(21, 24, 20, 0.04), 0 26px 50px -28px rgba(21, 24, 20, 0.4);
}

.char-open {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.char-open:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -3px;
  border-radius: 18px;
}

.char-media {
  position: relative;
  aspect-ratio: var(--ratio, 0.8);
  background: var(--paper-deep);
  overflow: hidden;
}

.char-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out);
}

.char-card:hover .char-media img {
  transform: scale(1.04);
}

.char-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 12, 9, 0.14) 0%, transparent 24%, transparent 54%, rgba(9, 12, 9, 0.78) 100%);
  pointer-events: none;
}

.char-bottom {
  position: absolute;
  right: 14px;
  bottom: 13px;
  left: 14px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 94px;
  color: var(--cream);
  pointer-events: none;
}

.char-name {
  font-family: var(--sans);
  font-size: clamp(19px, 1.65vw, 23px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.char-role {
  color: rgba(255, 253, 247, 0.72);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.char-actions {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.96);
  transition:
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease),
    visibility 0.25s var(--ease);
  pointer-events: none;
}

.char-card:hover .char-actions,
.char-card:focus-within .char-actions {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.char-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: var(--green);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px -14px rgba(40, 190, 102, 0.9);
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.char-apply:hover {
  border-color: #23ad5c;
  background: #23ad5c;
  color: #ffffff;
  transform: translateY(-1px);
}

.char-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 11px;
}

.char-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.char-tag {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.char-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.char-save:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.char-save.is-saved {
  border-color: rgba(40, 190, 102, 0.4);
  background: rgba(40, 190, 102, 0.1);
  color: var(--green-deep);
}

.char-save svg {
  width: 14px;
  height: 14px;
}

.char-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.char-remove:hover {
  border-color: rgba(226, 99, 79, 0.5);
  color: var(--danger);
}

@media (hover: none) {
  .char-actions {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
}

/* Create tile in My Characters -------------------------------------------- */

.create-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  break-inside: avoid;
  min-height: 230px;
  margin: 0 0 20px;
  padding: 28px;
  border: 1.5px dashed rgba(21, 24, 20, 0.24);
  border-radius: 18px;
  background: #ffffff;
  color: var(--muted);
  text-align: center;
  transition:
    border-color 0.22s var(--ease),
    background-color 0.22s var(--ease),
    color 0.22s var(--ease);
}

.create-tile:hover {
  border-color: var(--green-deep);
  background: #fafafa;
  color: var(--ink);
}

.create-tile .create-tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
}

.create-tile strong {
  font-size: 14px;
  font-weight: 650;
}

.create-tile span {
  max-width: 170px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

/* Empty states ------------------------------------------------------------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 440px;
  margin: 70px auto;
  text-align: center;
}

.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--cream);
  color: var(--muted);
}

.empty-state h3 {
  font-family: var(--sans);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.empty-state p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.empty-state .btn {
  margin-top: 18px;
}

/* My characters ------------------------------------------------------------ */

.mine-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 30px 2px 20px;
}

.mine-toolbar h3 {
  margin-top: 7px;
  font-family: var(--sans);
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.mine-empty {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(30px, 4vw, 54px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(ellipse 50% 70% at 0% 50%, rgba(40, 190, 102, 0.09), transparent 70%),
    #ffffff;
}

.mine-empty-art {
  position: relative;
  min-height: 300px;
}

.empty-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 16px;
  box-shadow: 0 24px 50px -28px rgba(21, 24, 20, 0.5);
}

.empty-card span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: none;
}

.empty-card-back {
  top: 20px;
  left: 12%;
  width: 190px;
  height: 245px;
  background: var(--stage);
  color: rgba(255, 253, 247, 0.55);
  transform: rotate(-6deg);
}

.empty-card-back::before {
  content: "";
  width: 74px;
  height: 94px;
  border-radius: 50% 50% 44% 44%;
  background: rgba(255, 253, 247, 0.1);
}

.empty-card-front {
  right: 8%;
  bottom: 10px;
  width: 200px;
  height: 255px;
  border: 1.5px dashed rgba(21, 24, 20, 0.32);
  background: #ffffff;
  color: var(--muted);
  transform: rotate(4deg);
}

.empty-plus {
  position: absolute;
  top: 47%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 22px;
  font-weight: 400;
  box-shadow: 0 12px 26px -12px rgba(40, 190, 102, 0.8);
  transform: translate(-50%, -50%);
}

.mine-empty-copy h3 {
  max-width: 450px;
  margin-top: 10px;
  font-family: var(--sans);
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

.mine-empty-copy > p:not(.eyebrow):not(.mine-empty-note) {
  max-width: 500px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}

.mine-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.mine-empty-note {
  margin-top: 14px;
  color: var(--muted-soft);
  font-size: 11px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: #0b0d0b;
  color: #fff;
}

.footer-accent {
  height: 6px;
  background: var(--green);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) minmax(0, 2.4fr);
  gap: clamp(34px, 5vw, 80px);
  max-width: 1360px;
  margin: 0 auto;
  padding: 58px 24px 48px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.footer-word {
  color: #fff;
  font-size: 22px;
  font-weight: 550;
  letter-spacing: -0.03em;
}

.footer-tagline {
  margin-top: 22px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.footer-desc {
  max-width: 290px;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 12.5px;
  line-height: 1.6;
}

.footer-social {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  transition:
    color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.footer-social a:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.language-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  margin-top: 18px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11.5px;
  font-weight: 550;
  transition:
    border-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.language-pill:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 26px 18px;
}

.footer-cols nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}

.footer-cols h2 {
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.footer-cols a {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11.5px;
  line-height: 1.4;
  transition: color 0.2s var(--ease);
}

.footer-cols a:hover {
  color: #fff;
}

.footer-legal {
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 24px 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.44);
  font-size: 10.5px;
  line-height: 1.7;
}

.footer-legal span {
  padding: 0 5px;
  opacity: 0.6;
}

.footer-legal a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ==========================================================================
   Modals — shared
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 9, 0.74);
  backdrop-filter: blur(9px) saturate(0.9);
  animation: backdropIn 0.25s var(--ease) both;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: calc(100dvh - 44px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  background: var(--stage);
  color: var(--paper);
  box-shadow: var(--shadow-dialog);
  overflow: hidden;
  animation: dialogIn 0.34s var(--ease-out) both;
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(14, 19, 16, 0.6);
  color: rgba(255, 253, 247, 0.72);
  backdrop-filter: blur(8px);
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.dialog .btn-outline {
  border-color: rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--paper);
}

.dialog .btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.dialog .btn-ghost {
  color: rgba(255, 253, 247, 0.55);
}

.dialog .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--paper);
}

/* Scrollbars inside dark dialogs */
.cm-panel,
.apply-panel,
.create-dialog {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

/* ==========================================================================
   Character detail modal
   ========================================================================== */

.character-dialog {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  width: min(1180px, 100%);
  height: min(748px, calc(100dvh - 44px));
}

.cm-media {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 20px;
  background:
    radial-gradient(ellipse 60% 50% at 12% 0%, rgba(40, 190, 102, 0.13), transparent 68%),
    var(--stage-2);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.cm-stage {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 70% 70% at 50% 30%, #ffffff, #efefef);
  overflow: hidden;
}

.cm-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(21, 24, 20, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 24, 20, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 50% 45%, #000 20%, transparent 80%);
  pointer-events: none;
}

.cm-stage img.cm-front {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  padding: 0;
  object-fit: contain;
}

.cm-face-wrap {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  aspect-ratio: 1;
  margin: 22px;
  border: 8px solid var(--cream);
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 28px 60px -26px rgba(21, 24, 20, 0.6);
  overflow: hidden;
}

.cm-face-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: var(--face, 50% 20%);
  transform: scale(1.55);
}

.cm-face-wrap.is-direct img {
  transform: none;
  object-position: 50% 50%;
}

.cm-turnaround {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  padding: 0;
}

.cm-turnaround figure {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
}

.cm-turnaround .panel {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 1px solid rgba(21, 24, 20, 0.12);
  border-radius: 9px;
  background: var(--cream);
  overflow: hidden;
}

.cm-turnaround .panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cm-turnaround .panel.is-side img {
  transform: scaleX(-1) scale(1.08);
}

.cm-turnaround .panel.is-back img {
  filter: grayscale(0.72) brightness(0.7) contrast(1.05);
  transform: scale(1.04);
}

.cm-turnaround figcaption {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: none;
}

.cm-sheet {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  padding: 0;
  object-fit: contain;
}

.cm-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  flex: 0 0 auto;
}

.cm-thumb {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 253, 247, 0.55);
  text-align: left;
  transition:
    border-color 0.2s var(--ease),
    background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.cm-thumb:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--paper);
}

.cm-thumb.is-active {
  border-color: var(--green);
  background: rgba(40, 190, 102, 0.08);
  color: var(--paper);
}

.cm-thumb-img {
  display: block;
  width: 100%;
  height: 62px;
  border-radius: 6px;
  background: #202720;
  overflow: hidden;
}

.cm-thumb-img img,
.cm-thumb-sheet {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cm-thumb-sheet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px;
}

.cm-thumb-sheet i {
  flex: 1;
  height: 100%;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
}

.cm-thumb > span:last-child {
  padding: 0 2px;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: none;
}

.cm-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 26px 26px 22px;
  overflow-y: auto;
}

.cm-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 40px;
}

.cm-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  object-fit: cover;
}

.cm-name-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.cm-name-row h2 {
  font-family: var(--sans);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
}

.cm-category {
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  color: rgba(255, 253, 247, 0.55);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: none;
}

.cm-idline {
  margin-top: 5px;
  color: rgba(255, 253, 247, 0.38);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
}

.cm-tabs {
  display: flex;
  gap: 4px;
  margin-top: 20px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.cm-tab {
  flex: 1;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 253, 247, 0.45);
  font-size: 11.5px;
  font-weight: 600;
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.cm-tab:hover {
  color: var(--paper);
}

.cm-tab.is-active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--paper);
}

.soon-dot {
  display: inline-block;
  margin-left: 3px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(216, 180, 106, 0.16);
  color: var(--amber);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: none;
  vertical-align: middle;
}

.cm-body {
  flex: 1;
  min-height: 120px;
  padding-top: 20px;
}

.cm-description {
  color: rgba(255, 253, 247, 0.72);
  font-size: 14px;
  line-height: 1.65;
}

.cm-section {
  margin-top: 20px;
}

.cm-section:first-child {
  margin-top: 0;
}

.cm-section-label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 253, 247, 0.42);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cm-tag {
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: rgba(255, 253, 247, 0.66);
  font-size: 10.5px;
  font-weight: 550;
}

.cm-bestfor {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cm-bestfor span {
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(40, 190, 102, 0.09);
  color: #a9edc5;
  font-size: 10.5px;
}

.cm-personality {
  color: rgba(255, 253, 247, 0.7);
  font-size: 13.5px;
  line-height: 1.7;
}

.cm-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cm-trait {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: rgba(255, 253, 247, 0.68);
  font-size: 10.5px;
}

.cm-trait::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
}

.cm-consistency {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 11px 12px;
  border: 1px solid rgba(40, 190, 102, 0.2);
  border-radius: 9px;
  background: rgba(40, 190, 102, 0.07);
  color: rgba(255, 253, 247, 0.6);
  font-size: 10.5px;
}

.cm-consistency svg {
  flex: 0 0 auto;
  color: var(--green);
}

.cm-story-soon {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(216, 180, 106, 0.2);
  border-radius: 12px;
  background: rgba(216, 180, 106, 0.06);
}

.cm-story-soon strong {
  color: var(--amber);
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cm-story-soon p {
  color: rgba(255, 253, 247, 0.58);
  font-size: 12.5px;
  line-height: 1.6;
}

.cm-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cm-actions .btn {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  font-size: 12.5px;
}

.cm-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  padding: 7px;
  border: 0;
  background: none;
  color: rgba(255, 253, 247, 0.3);
  font-size: 10.5px;
  transition: color 0.2s var(--ease);
}

.cm-remove:hover {
  color: var(--danger);
}

/* ==========================================================================
   Apply modal
   ========================================================================== */

.apply-dialog {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(440px, 1.1fr);
  width: min(1200px, 100%);
  height: min(790px, calc(100dvh - 44px));
}

.apply-media {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 24px;
  background:
    radial-gradient(ellipse 55% 50% at 50% 32%, rgba(40, 190, 102, 0.17), transparent 68%),
    radial-gradient(ellipse 50% 40% at 50% 110%, rgba(216, 180, 106, 0.1), transparent 70%),
    #0b100c;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.apply-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 45%, #000 10%, transparent 78%);
  pointer-events: none;
}

.apply-stage {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.apply-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(80%, 420px);
  aspect-ratio: 1;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: orbitSpin 50s linear infinite;
}

.apply-stage img {
  position: relative;
  z-index: 1;
  max-width: min(82%, 340px);
  max-height: 100%;
  border: 7px solid var(--cream);
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 34px 70px -28px rgba(0, 0, 0, 0.8);
}

.apply-caption {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.apply-caption h2 {
  font-family: var(--sans);
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
}

.apply-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 24px 28px 22px;
  overflow-y: auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 4px 0;
  border: 0;
  background: none;
  color: rgba(255, 253, 247, 0.48);
  font-size: 11.5px;
  font-weight: 600;
  transition: color 0.2s var(--ease);
}

.back-link:hover {
  color: var(--paper);
}

.apply-head {
  margin-top: 16px;
}

.apply-head h2 {
  margin-top: 0;
  font-family: var(--sans);
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.apply-head h2 span {
  color: #8ff0b4;
  font-style: normal;
}

.apply-head > p:last-child {
  max-width: 500px;
  margin-top: 8px;
  color: rgba(255, 253, 247, 0.5);
  font-size: 12.5px;
  line-height: 1.55;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.mode-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 64px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--paper);
  text-align: center;
  transition:
    border-color 0.22s var(--ease),
    background-color 0.22s var(--ease),
    transform 0.22s var(--ease);
}

.mode-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.045);
}

.mode-card.is-active {
  border-color: rgba(40, 190, 102, 0.65);
  background: rgba(40, 190, 102, 0.07);
  box-shadow: 0 0 0 1px rgba(40, 190, 102, 0.15) inset;
}

.mode-card strong {
  font-size: 14px;
  font-weight: 650;
}

.mode-soon {
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(216, 180, 106, 0.16);
  color: var(--amber);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.mode-soon-note {
  color: var(--amber);
}

.mode-form {
  margin-top: 18px;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.field-head label,
.field-head > label {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.field-req {
  color: var(--green);
}

.field-hint {
  color: rgba(255, 253, 247, 0.34);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.product-drop {
  position: relative;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition:
    border-color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.product-drop:hover,
.product-drop.is-drag {
  border-color: rgba(40, 190, 102, 0.6);
  background: rgba(40, 190, 102, 0.05);
}

.product-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 96px;
  padding: 12px;
  text-align: center;
}

.drop-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 253, 247, 0.55);
}

.product-empty strong {
  font-size: 12px;
  font-weight: 600;
}

.product-empty > span:not(.drop-icon):not(.drop-formats) {
  color: rgba(255, 253, 247, 0.4);
  font-size: 10.5px;
}

.sample-link {
  margin-top: 6px;
  padding: 2px;
  border: 0;
  background: none;
  color: #9df0bd;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sample-link:hover {
  color: #c8ffdc;
}

.product-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 96px;
  padding: 10px;
}

.product-preview img {
  width: 66px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  object-fit: cover;
}

.product-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.product-meta strong {
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-meta span {
  color: rgba(255, 253, 247, 0.4);
  font-size: 9.5px;
}

.product-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 253, 247, 0.55);
}

.product-remove:hover {
  border-color: rgba(226, 99, 79, 0.5);
  color: var(--danger);
}

#ad-brief,
#story-brief {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--paper);
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition:
    border-color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

#ad-brief::placeholder,
#story-brief::placeholder {
  color: rgba(255, 253, 247, 0.3);
}

#ad-brief:focus,
#story-brief:focus {
  border-color: rgba(40, 190, 102, 0.55);
  background: rgba(255, 255, 255, 0.05);
}

.form-error {
  margin-top: 8px;
  color: #ff9d8c;
  font-size: 10.5px;
}

.soon-note {
  display: flex;
  gap: 11px;
  margin-top: 12px;
  padding: 13px;
  border: 1px solid rgba(216, 180, 106, 0.2);
  border-radius: 11px;
  background: rgba(216, 180, 106, 0.06);
}

.soon-note strong {
  display: block;
  color: var(--amber);
  font-size: 11px;
  font-weight: 650;
}

.soon-note span:not(.soon-note-icon) {
  display: block;
  margin-top: 3px;
  color: rgba(255, 253, 247, 0.44);
  font-size: 10px;
  line-height: 1.5;
}

.apply-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
}

.apply-footer .btn-primary {
  min-width: 176px;
}

.apply-footer .btn-primary.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

/* ==========================================================================
   Create modal
   ========================================================================== */

.create-dialog {
  width: min(1080px, 100%);
  max-height: calc(100dvh - 44px);
  padding: 28px;
  overflow-y: auto;
}

.create-head {
  padding-right: 46px;
}

.create-head h2 {
  margin-top: 0;
  font-family: var(--sans);
  font-size: clamp(34px, 3.6vw, 46px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

.create-head > p:last-child {
  max-width: 620px;
  margin-top: 9px;
  color: rgba(255, 253, 247, 0.48);
  font-size: 12.5px;
  line-height: 1.55;
}

.create-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(340px, 1.08fr);
  gap: 26px;
  margin-top: 22px;
}

.portrait-drop {
  position: relative;
  min-height: 330px;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 20%, rgba(40, 190, 102, 0.09), transparent 70%),
    rgba(255, 255, 255, 0.02);
  overflow: hidden;
  transition:
    border-color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.portrait-drop:hover,
.portrait-drop.is-drag {
  border-color: rgba(40, 190, 102, 0.65);
  background: rgba(40, 190, 102, 0.05);
}

.portrait-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 330px;
  padding: 26px;
  text-align: center;
}

.drop-icon.is-large {
  width: 52px;
  height: 52px;
  margin-bottom: 8px;
  border-radius: 14px;
}

.portrait-empty strong {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.portrait-empty > span:not(.drop-icon):not(.drop-formats) {
  max-width: 240px;
  color: rgba(255, 253, 247, 0.42);
  font-size: 11px;
  line-height: 1.5;
}

.drop-formats {
  margin-top: 3px;
  color: rgba(255, 253, 247, 0.28);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.portrait-preview {
  position: absolute;
  inset: 0;
}

.portrait-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(180deg, transparent, rgba(9, 12, 9, 0.8));
}

.portrait-overlay span {
  color: rgba(255, 253, 247, 0.68);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: none;
}

.portrait-overlay button {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(14, 19, 16, 0.6);
  color: var(--paper);
  font-size: 10px;
  backdrop-filter: blur(8px);
}

.gen-progress {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.gen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 253, 247, 0.72);
  font-size: 11px;
  font-weight: 600;
}

.gen-head span:last-child {
  color: var(--green);
  font-family: var(--mono);
  font-size: 10px;
}

.gen-track {
  height: 4px;
  margin-top: 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.gen-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #1e9c54, var(--green-bright));
  transition: width 0.35s var(--ease);
}

.gen-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.gen-steps li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 253, 247, 0.3);
  font-size: 9.5px;
}

.gen-steps li span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.gen-steps li.is-done {
  color: rgba(255, 253, 247, 0.62);
}

.gen-steps li.is-done span {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(40, 190, 102, 0.12);
}

.gen-result {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(40, 190, 102, 0.22);
  border-radius: 13px;
  background: rgba(40, 190, 102, 0.05);
}

.gen-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: rgba(255, 253, 247, 0.7);
  font-size: 10.5px;
  font-weight: 600;
}

.pill-green {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(40, 190, 102, 0.16);
  color: #a9edc5;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: none;
}

.gen-result-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.5fr 1fr;
  gap: 7px;
}

.gen-result-grid figure {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.gen-result-grid img {
  width: 100%;
  height: 78px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.2);
  object-fit: cover;
}

.gen-result-grid figcaption {
  color: rgba(255, 253, 247, 0.42);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: none;
}

.create-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.text-input,
.text-area {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--paper);
  font-size: 14px;
  outline: none;
  transition:
    border-color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.text-input {
  height: 46px;
  padding: 0 13px;
}

.text-area {
  padding: 12px 13px;
  line-height: 1.55;
  resize: vertical;
}

.text-input::placeholder,
.text-area::placeholder {
  color: rgba(255, 253, 247, 0.28);
}

.text-input:focus,
.text-area:focus {
  border-color: rgba(40, 190, 102, 0.55);
  background: rgba(255, 255, 255, 0.05);
}

.create-right .field-head {
  margin-top: 18px;
}

.create-right .field-head:first-child {
  margin-top: 0;
}

.create-taxonomy {
  margin-top: 16px;
}

.create-taxonomy-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.create-taxonomy-head > span:first-child {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.create-taxonomy-head > span:last-child {
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 500;
}

.create-taxonomy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.create-taxonomy-grid.is-single {
  grid-template-columns: 1fr;
}

.create-tax-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.create-tax-field > span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.create-tax-field select {
  width: 100%;
  height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: #fafafa;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5' fill='none' stroke='%2362675f' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  appearance: none;
}

.create-tax-field select:focus {
  border-color: rgba(40, 190, 102, 0.55);
  background-color: #ffffff;
}

.create-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: auto;
  padding-top: 22px;
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
  padding: 11px 15px 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(14, 19, 16, 0.96);
  color: var(--paper);
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  animation: toastIn 0.3s var(--ease-out) both;
  pointer-events: auto;
}

.toast.is-leaving {
  animation: toastOut 0.22s var(--ease) both;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(40, 190, 102, 0.16);
  color: var(--green);
}

.toast.is-error .toast-icon {
  background: rgba(226, 99, 79, 0.16);
  color: var(--danger);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px) scale(0.98); }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  :scope {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .live-dot::after,
  .apply-halo {
    display: none;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1240px) {
  /* 这一档屏幕较矮，画面里的角色容易压到文字：文字沉到底部暗岩层 */
  .hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 700px;
  }

  .hero-inner {
    min-height: 0;
  }

  .hero-media img {
    object-position: 62% 22%;
  }

  .hero-scrim {
    background:
      linear-gradient(
        180deg,
        rgba(6, 10, 8, 0.08) 0%,
        rgba(6, 10, 8, 0.26) 30%,
        rgba(6, 10, 8, 0.78) 64%,
        rgba(6, 10, 8, 0.95) 100%
      );
  }

  .nav-link {
    padding: 9px 8px;
    font-size: 12.8px;
  }

  .nav-inner {
    gap: 10px;
  }

  .masonry {
    columns: 3;
  }

  .footer-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 28px;
  }
}

@media (max-width: 1120px) {
  .nav-links {
    display: none;
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .hero-inner {
    gap: 36px;
  }

  .character-dialog {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
  }
}

@media (max-width: 980px) {
  :scope {
    --nav-h: 60px;
  }

  .hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 620px;
    padding-top: 118px;
    padding-bottom: 54px;
  }

  /* 窄屏：文字沉到底部暗岩层，画面人脸露在上半部 */
  .hero-scrim {
    background:
      linear-gradient(
        180deg,
        rgba(6, 10, 8, 0.1) 0%,
        rgba(6, 10, 8, 0.28) 32%,
        rgba(6, 10, 8, 0.8) 66%,
        rgba(6, 10, 8, 0.95) 100%
      );
  }

  .hero-media img {
    object-position: 62% 24%;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 42px;
    min-height: 0;
  }

  .hero-copy {
    max-width: 720px;
  }

  .library-toolbar {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .mine-empty {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .mine-empty-art {
    min-height: 270px;
    max-width: 360px;
    margin: 0 auto;
    width: 100%;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .footer-desc {
    max-width: 420px;
  }

  .footer-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .character-dialog {
    grid-template-columns: 1fr;
    height: min(920px, calc(100dvh - 44px));
    overflow-y: auto;
    display: block;
  }

  .cm-media {
    height: 470px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .cm-panel {
    overflow: visible;
  }

  .apply-dialog {
    grid-template-columns: 1fr;
    display: block;
    height: min(980px, calc(100dvh - 44px));
    overflow-y: auto;
  }

  .apply-media {
    height: 420px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .apply-panel {
    overflow: visible;
  }

  .create-grid {
    grid-template-columns: 1fr;
  }

  .portrait-drop,
  .portrait-empty {
    min-height: 260px;
  }

  .create-right {
    padding-bottom: 4px;
  }
}

@media (max-width: 760px) {
  .nav-inner {
    padding: 0 16px;
  }

  .nav-cta {
    display: none;
  }

  .hero {
    min-height: 600px;
    padding: 104px 16px 58px;
  }

  /* 竖屏继续用右侧人物区，文字压在下方暗部 */
  .hero-media img {
    object-position: 56% 14%;
  }

  .hero-scrim {
    background:
      linear-gradient(
        180deg,
        rgba(6, 10, 8, 0.06) 0%,
        rgba(6, 10, 8, 0.2) 24%,
        rgba(6, 10, 8, 0.84) 58%,
        rgba(6, 10, 8, 0.97) 100%
      );
  }

  .hero h1 {
    font-size: clamp(48px, 12vw, 72px);
  }

  .hero-lede {
    margin-top: 20px;
    font-size: 15px;
  }

  .library {
    padding: 66px 16px;
  }

  .section-lede {
    font-size: 14.5px;
  }

  .tabbar {
    top: 64px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabbar::-webkit-scrollbar {
    display: none;
  }

  .tab {
    height: 40px;
    padding: 0 13px;
    font-size: 12.5px;
    flex: 0 0 auto;
  }

  .tabbar-actions .btn {
    width: 38px;
    padding: 0;
    font-size: 0;
    gap: 0;
  }

  .tabbar-actions .btn svg {
    width: 16px;
    height: 16px;
  }

  .library-toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .search-field {
    grid-column: auto;
  }

  .library-toolbar {
    top: 118px;
    padding: 10px;
  }

  .taxonomy-row {
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
  }

  .multi-filter,
  .taxonomy-reset {
    flex: 0 0 auto;
  }

  .taxonomy-reset {
    margin-left: 0;
  }

  .masonry {
    columns: 2;
    column-gap: 12px;
  }

  .char-card {
    margin-bottom: 12px;
    border-radius: 14px;
  }

  .char-meta {
    padding: 8px 9px 9px;
  }

  .char-tag:nth-child(n + 3) {
    display: none;
  }

  .char-save {
    width: 26px;
    height: 26px;
  }

  .create-tile {
    min-height: 180px;
    margin-bottom: 12px;
    padding: 18px;
  }

  .create-tile span {
    display: none;
  }

  .mine-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .mine-empty {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .mine-empty-art {
    min-height: 240px;
  }

  .empty-card-back {
    width: 160px;
    height: 210px;
  }

  .empty-card-front {
    width: 170px;
    height: 220px;
  }

  .mine-empty-actions .btn {
    flex: 1 1 100%;
  }

  .footer-inner {
    padding: 42px 16px 34px;
  }

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

  .footer-legal {
    padding: 18px 16px 22px;
  }

  .modal {
    padding: 0;
  }

  .dialog {
    width: 100%;
    max-height: 100dvh;
    height: 100dvh !important;
    border-radius: 0;
    border: 0;
  }

  .character-dialog,
  .apply-dialog {
    display: block !important;
    overflow-y: auto;
  }

  .cm-media {
    height: 54vh;
    min-height: 360px;
    padding: 14px;
  }

  .cm-panel {
    padding: 20px 18px 26px;
  }

  .cm-name-row h2 {
    font-size: 27px;
  }

  .cm-actions {
    grid-template-columns: 1fr;
  }

  .apply-media {
    height: auto;
    min-height: 0;
    padding: 16px;
  }

  .apply-stage {
    min-height: 290px;
  }

  .apply-stage img {
    max-width: min(54%, 205px);
    max-height: 280px;
  }

  .apply-caption h2 {
    font-size: 30px;
  }

  .apply-panel {
    padding: 20px 18px 28px;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .apply-footer {
    flex-direction: column-reverse;
  }

  .apply-footer .btn {
    width: 100%;
  }

  .create-dialog {
    padding: 22px 18px 30px;
  }

  .create-grid {
    gap: 20px;
  }

  .gen-result-grid {
    grid-template-columns: 1fr 1.2fr 1fr;
  }

  .gen-result-grid img {
    height: 64px;
  }

  .create-footer {
    flex-direction: column-reverse;
  }

  .create-footer .btn {
    width: 100%;
  }

  .toast-wrap {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .toast {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .hero h1 {
    font-size: clamp(42px, 12.5vw, 58px);
  }

  .masonry {
    columns: 1;
  }

  .char-media {
    aspect-ratio: var(--ratio, 0.85);
  }

  .char-tag:nth-child(n + 3) {
    display: inline;
  }

  .section-head h2 {
    font-size: 38px;
  }

  .mine-empty-art {
    min-height: 220px;
  }

  .empty-card-back {
    width: 140px;
    height: 185px;
  }

  .empty-card-front {
    width: 150px;
    height: 195px;
  }

  .footer-cols {
    grid-template-columns: 1fr 1fr;
    gap: 24px 16px;
  }

  .cm-turnaround {
    gap: 5px;
    padding: 8px;
  }

  .cm-thumb-img {
    height: 48px;
  }

  .cm-thumb > span:last-child {
    font-size: 8px;
  }

  .product-preview img {
    width: 54px;
    height: 52px;
  }

  .gen-result-grid {
    grid-template-columns: 1fr 1.15fr 1fr;
  }

  .gen-result-grid img {
    height: 56px;
  }
}

/* ==========================================================================
   Character detail — light surface
   The library is a white canvas, so the opened character card follows it.
   Apply / Create keep their dark studio treatment for now.
   ========================================================================== */

#character-modal .dialog {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow:
    0 30px 80px -34px rgba(21, 24, 20, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

#character-modal .cm-media {
  background:
    radial-gradient(ellipse 55% 50% at 15% 0%, rgba(40, 190, 102, 0.06), transparent 65%),
    #f6f6f6;
  border-right: 1px solid var(--line);
}

#character-modal .cm-panel {
  background: #ffffff;
  color: var(--ink);
  scrollbar-color: rgba(21, 24, 20, 0.2) transparent;
}

#character-modal .cm-name-row h2 {
  color: var(--ink);
}

#character-modal .cm-idline {
  color: var(--muted);
}

#character-modal .cm-description {
  color: var(--ink-soft);
}

#character-modal .cm-section-label {
  color: var(--muted);
}

#character-modal .cm-tag {
  border-color: var(--line);
  background: #fafafa;
  color: var(--ink-soft);
}

#character-modal .cm-avatar {
  border-color: var(--line);
}

#character-modal .cm-actions {
  border-top-color: var(--line);
}

#character-modal .btn-outline {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

#character-modal .btn-outline:hover {
  border-color: var(--ink);
  background: rgba(21, 24, 20, 0.045);
}

#character-modal .cm-remove {
  color: var(--muted-soft);
}

#character-modal .cm-remove:hover {
  color: var(--danger);
}

#character-modal .modal-close {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 8px 22px -14px rgba(21, 24, 20, 0.4);
}

#character-modal .modal-close:hover {
  background: #f2f2f2;
  color: var(--ink);
}

#character-modal .cm-thumb {
  border-color: var(--line);
  background: #f7f7f7;
  color: var(--muted);
}

#character-modal .cm-thumb:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

#character-modal .cm-thumb.is-active {
  border-color: var(--green);
  background: rgba(40, 190, 102, 0.08);
  color: var(--ink);
}

#character-modal .cm-thumb-img {
  background: #ececec;
}

#character-modal .cm-thumb > span:last-child {
  color: inherit;
}

#character-modal .cm-turnaround .panel {
  border-color: var(--line);
}


#character-modal .cm-taxonomy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

#character-modal .cm-taxonomy-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fafafa;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

/* ==========================================================================
   Apply modal — light surface
   ========================================================================== */

#apply-modal .dialog {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow:
    0 30px 80px -34px rgba(21, 24, 20, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

#apply-modal .apply-media {
  background:
    radial-gradient(ellipse 55% 52% at 18% 0%, rgba(40, 190, 102, 0.08), transparent 66%),
    #f6f6f6;
  border-right: 1px solid var(--line);
}

#apply-modal .apply-media::before {
  background-image:
    linear-gradient(rgba(21, 24, 20, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 24, 20, 0.05) 1px, transparent 1px);
}

#apply-modal .apply-halo {
  border-color: rgba(21, 24, 20, 0.12);
}

#apply-modal .apply-stage img {
  border-color: #ffffff;
  box-shadow: 0 26px 54px -28px rgba(21, 24, 20, 0.4);
}

#apply-modal .apply-caption {
  border-top-color: var(--line);
}

#apply-modal .apply-caption h2 {
  color: var(--ink);
}

#apply-modal .apply-panel {
  background: #ffffff;
  color: var(--ink);
  scrollbar-color: rgba(21, 24, 20, 0.2) transparent;
}

#apply-modal .back-link {
  color: var(--muted);
}

#apply-modal .back-link:hover {
  color: var(--ink);
}

#apply-modal .apply-head h2 {
  color: var(--ink);
}

#apply-modal .apply-head h2 span {
  color: var(--green-deep);
}

#apply-modal .apply-head > p:last-child {
  color: var(--muted);
}

#apply-modal .mode-card {
  border-color: var(--line);
  background: #fafafa;
  color: var(--ink);
}

#apply-modal .mode-card:hover {
  border-color: var(--line-strong);
  background: #f4f4f4;
}

#apply-modal .mode-card.is-active {
  border-color: var(--green);
  background: rgba(40, 190, 102, 0.08);
  box-shadow: 0 0 0 1px rgba(40, 190, 102, 0.12) inset;
}

#apply-modal .mode-card strong {
  color: var(--ink);
}

#apply-modal .mode-soon {
  background: rgba(216, 180, 106, 0.2);
  color: #7a5c24;
}

#apply-modal .field-head label {
  color: var(--ink);
}

#apply-modal .field-hint {
  color: var(--muted-soft);
}

#apply-modal .product-drop {
  border-color: var(--line-strong);
  background: #fafafa;
}

#apply-modal .product-drop:hover,
#apply-modal .product-drop.is-drag {
  border-color: rgba(40, 190, 102, 0.6);
  background: rgba(40, 190, 102, 0.05);
}

#apply-modal .drop-icon {
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
}

#apply-modal .product-empty strong {
  color: var(--ink);
}

#apply-modal .sample-link {
  color: var(--green-deep);
}

#apply-modal .sample-link:hover {
  color: var(--ink);
}

#apply-modal .product-preview img {
  background: #f0f0f0;
}

#apply-modal .product-meta strong {
  color: var(--ink);
}

#apply-modal .product-meta span {
  color: var(--muted);
}

#apply-modal .product-remove {
  border-color: var(--line);
  color: var(--muted);
}

#apply-modal .product-remove:hover {
  border-color: rgba(226, 99, 79, 0.55);
  color: var(--danger);
}

#apply-modal #ad-brief,
#apply-modal #story-brief {
  border-color: var(--line);
  background: #fafafa;
  color: var(--ink);
}

#apply-modal #ad-brief::placeholder,
#apply-modal #story-brief::placeholder {
  color: var(--muted-soft);
}

#apply-modal #ad-brief:focus,
#apply-modal #story-brief:focus {
  border-color: rgba(40, 190, 102, 0.55);
  background: #ffffff;
}

#apply-modal .form-error {
  color: #b23a28;
}

#apply-modal .soon-note {
  border-color: rgba(216, 180, 106, 0.4);
  background: rgba(216, 180, 106, 0.08);
}

#apply-modal .soon-note strong {
  color: #7a5c24;
}

#apply-modal .soon-note span:not(.soon-note-icon) {
  color: var(--muted);
}

#apply-modal .apply-footer .btn-ghost {
  color: var(--muted);
}

#apply-modal .apply-footer .btn-ghost:hover {
  color: var(--ink);
  background: rgba(21, 24, 20, 0.05);
}

#apply-modal .modal-close {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 8px 22px -14px rgba(21, 24, 20, 0.4);
}

#apply-modal .modal-close:hover {
  background: #f2f2f2;
  color: var(--ink);
}

/* ==========================================================================
   Create modal — light surface
   ========================================================================== */

#create-modal .dialog {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow:
    0 30px 80px -34px rgba(21, 24, 20, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

#create-modal .create-dialog {
  scrollbar-color: rgba(21, 24, 20, 0.2) transparent;
}

#create-modal .create-head h2 {
  color: var(--ink);
}

#create-modal .create-head > p:last-child {
  color: var(--muted);
}

#create-modal .portrait-drop {
  border-color: var(--line-strong);
  background:
    radial-gradient(ellipse 70% 60% at 50% 20%, rgba(40, 190, 102, 0.07), transparent 70%),
    #fafafa;
}

#create-modal .portrait-drop:hover,
#create-modal .portrait-drop.is-drag {
  border-color: rgba(40, 190, 102, 0.6);
  background: rgba(40, 190, 102, 0.05);
}

#create-modal .drop-icon {
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
}

#create-modal .portrait-empty strong {
  color: var(--ink);
}

#create-modal .portrait-empty > span:not(.drop-icon):not(.drop-formats) {
  color: var(--muted);
}

#create-modal .drop-formats {
  color: var(--muted-soft);
}

#create-modal .sample-link {
  color: var(--green-deep);
}

#create-modal .sample-link:hover {
  color: var(--ink);
}

#create-modal .gen-progress {
  border-color: var(--line);
  background: #fafafa;
}

#create-modal .gen-head {
  color: var(--muted);
}

#create-modal .gen-head span:last-child {
  color: var(--green-deep);
}

#create-modal .gen-track {
  background: rgba(21, 24, 20, 0.08);
}

#create-modal .gen-steps li {
  color: var(--muted-soft);
}

#create-modal .gen-steps li span {
  background: rgba(21, 24, 20, 0.16);
}

#create-modal .gen-steps li.is-done {
  color: var(--ink-soft);
}

#create-modal .gen-steps li.is-done span {
  background: var(--green);
}

#create-modal .gen-result {
  border-color: rgba(40, 190, 102, 0.24);
  background: rgba(40, 190, 102, 0.06);
}

#create-modal .gen-result-head {
  color: var(--muted);
}

#create-modal .pill-green {
  background: rgba(40, 190, 102, 0.12);
  color: var(--green-deep);
}

#create-modal .gen-result-grid img {
  border-color: var(--line);
  background: #ffffff;
}

#create-modal .gen-result-grid figcaption {
  color: var(--muted);
}

#create-modal .text-input,
#create-modal .text-area {
  border-color: var(--line);
  background: #fafafa;
  color: var(--ink);
}

#create-modal .text-input::placeholder,
#create-modal .text-area::placeholder {
  color: var(--muted-soft);
}

#create-modal .text-input:focus,
#create-modal .text-area:focus {
  border-color: rgba(40, 190, 102, 0.55);
  background: #ffffff;
}

#create-modal .field-head label {
  color: var(--ink);
}

#create-modal .field-hint {
  color: var(--muted-soft);
}

#create-modal .form-error {
  color: #b23a28;
}

#create-modal .create-footer .btn-ghost {
  color: var(--muted);
}

#create-modal .create-footer .btn-ghost:hover {
  color: var(--ink);
  background: rgba(21, 24, 20, 0.05);
}

#create-modal .modal-close {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 8px 22px -14px rgba(21, 24, 20, 0.4);
}

#create-modal .modal-close:hover {
  background: #f2f2f2;
  color: var(--ink);
}

/* Real Ottermind chrome hosts (header/footer live in shadow roots). */
#otter-header {
  position: relative;
  z-index: 50;
}

#otter-footer {
  position: relative;
  z-index: 1;
}

/* Character reference detail and ad setup refinements. */
#character-modal .cm-thumb-img { height: 126px; flex: 0 0 126px; display: flex; align-items: center; justify-content: center; }
#character-modal .cm-thumb-img img { width: 100%; height: 100%; object-fit: contain; }
#character-modal .cm-thumb > span:last-child { font-size: 15px; font-weight: 600; letter-spacing: 0; }
#character-modal .cm-section-label { font-size: 16px; font-weight: 650; letter-spacing: 0; color: #39483e; }
#character-modal .cm-taxonomy-tag { font-size: 14px; padding: 7px 12px; }
#character-modal .cm-description { font-size: 16px; line-height: 1.75; }
#character-modal .cm-actions .btn { font-size: 18px; font-weight: 650; }
#apply-modal .product-empty { min-height: 82px; padding: 10px; gap: 4px; }
#apply-modal .drop-icon { width: 30px; height: 30px; }
#apply-modal #ad-brief { min-height: 180px; line-height: 1.65; }
.ad-output-options { display: flex; gap: 8px; margin: 10px 0; }
.output-option { border: 1px solid #dce1dd; border-radius: 8px; background: #fff; color: #263b2e; padding: 9px 16px; font-size: 14px; font-weight: 600; }
.output-option.is-active { border-color: #28be66; background: #edf9f1; }
.output-option:disabled { color: #8a908c; cursor: not-allowed; }
.output-option span { font-size: 11px; padding: 3px 6px; border-radius: 4px; background: #f3ecdc; color: #866a32; margin-left: 6px; }
@media (max-width: 640px) { #character-modal .cm-thumb-img { height: 92px; flex-basis: 92px; } #character-modal .cm-thumb > span:last-child { font-size: 13px; } #apply-modal #ad-brief { min-height: 150px; } }

/* Preserve the complete hero artwork; unused width becomes a dark left panel. */
.hero { background: #060a08; }
.hero-media { background: #060a08; top: var(--nav-h); }
.hero-media img { object-fit: contain; object-position: right top; }
#character-modal .cm-idline { font-family: var(--sans); font-size: 12px; font-weight: 500; line-height: 1.5; letter-spacing: 0; color: #747b75; }
.brief-input { position: relative; }
#apply-modal .brief-input textarea { display: block; padding-bottom: 42px; }
#apply-modal .brief-count { position: absolute; right: 16px; bottom: 12px; margin: 0; padding: 2px 4px; border-radius: 4px; background: #fafafa; color: var(--muted-soft); font-size: 12px; line-height: 1.4; font-variant-numeric: tabular-nums; pointer-events: none; }
@media (max-width: 760px) { .hero-media img { object-position: center top; } }

/* Compact introduction keeps the library visible in the first viewport. */
.hero { height: clamp(260px, 33svh, 360px); min-height: 0; padding: calc(var(--nav-h) + 20px) 24px 24px; display: flex; flex-direction: column; justify-content: center; }
.hero-inner { min-height: 0; grid-template-columns: minmax(0, 700px) minmax(0, 1fr); gap: 24px; }
.hero-copy { max-width: 700px; }
.hero h1 { max-width: 680px; font-size: clamp(30px, 3.1vw, 46px); line-height: 1.08; }
.hero-lede { max-width: 530px; margin-top: 12px; font-size: 14px; line-height: 1.5; }
.library { padding-top: 24px; }
.library .section-head { margin-bottom: 18px; }
.library .section-head h2 { font-size: clamp(28px, 3vw, 38px); line-height: 1.12; }
.library .section-lede { max-width: 900px; margin-top: 8px; font-size: 14px; line-height: 1.5; }
#inspiration-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); columns: auto; gap: 20px; align-items: start; }
#inspiration-grid .char-card { margin-bottom: 0; }
@media (max-width: 1240px) { #inspiration-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
 .hero { padding: calc(var(--nav-h) + 16px) 16px 18px; }
 .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 0; }
 .hero-copy { max-width: 500px; }
 .hero h1 { max-width: 420px; font-size: clamp(27px, 6.8vw, 36px); }
 .hero-lede { max-width: 340px; font-size: 13px; line-height: 1.45; margin-top: 10px; }
 .library { padding-top: 20px; }
 #inspiration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 520px) { #inspiration-grid { grid-template-columns: minmax(0, 1fr); } }

/* Compact library cards: immediate reveal and five-column desktop browsing. */
#inspiration-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
#inspiration-grid .char-card { animation: none; animation-delay: 0s; opacity: 1; border-radius: 14px; }
#inspiration-grid .char-name { font-size: 20px; line-height: 1.2; }
#inspiration-grid .char-role { font-size: 11px; }
#inspiration-grid .char-tags { min-width: 0; }
#inspiration-grid .char-tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* Detail view keeps generous space around a smaller, centered dialog. */
#character-modal .character-dialog { width: min(1100px, 66vw); min-width: min(720px, calc(100vw - 40px)); height: min(680px, 74svh); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
#character-modal .cm-media { padding: 16px; gap: 12px; }
#character-modal .cm-panel { min-height: 0; padding: 24px; overflow: hidden; }
#character-modal .cm-identity { flex-shrink: 0; }
#character-modal .cm-body { min-height: 0; overflow-y: auto; padding-top: 16px; }
#character-modal .cm-description { font-size: 15px; line-height: 1.65; }
#character-modal .cm-name-row h2 { font-size: 26px; }
#character-modal .cm-thumb-img { height: 88px; flex-basis: 88px; }
#character-modal .cm-thumb > span:last-child { font-size: 13px; }
#character-modal .cm-actions { flex-shrink: 0; margin-top: auto; padding-top: 14px; }
#character-modal .cm-actions .btn { font-size: 16px; }
@media (max-width: 1199px) { #inspiration-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 980px) { #inspiration-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
 #inspiration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
 #inspiration-grid .char-name { font-size: 16px; }
 #inspiration-grid .char-role { font-size: 10px; }
 #inspiration-grid .char-tag { font-size: 9px; }
 #character-modal { padding: 12px; }
 #character-modal .character-dialog { width: calc(100vw - 24px); min-width: 0; height: min(720px, 88svh) !important; max-height: 88svh; border-radius: 20px; overflow-y: auto; }
 #character-modal .cm-media { height: 390px; min-height: 320px; }
 #character-modal .cm-panel { padding: 20px; overflow: visible; }
 #character-modal .cm-body { flex: initial; overflow: visible; }
 #character-modal .cm-name-row h2 { font-size: 24px; }
 #character-modal .cm-thumb-img { height: 76px; flex-basis: 76px; }
}

/* Uniform library frames keep five-column rows aligned without distorting people. */
#inspiration-grid .char-media { aspect-ratio: 2 / 3; background: #ededed; }
#inspiration-grid .char-media > img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
#inspiration-grid .char-card:hover .char-media > img { transform: none; }
#inspiration-grid .char-meta { height: 68px; min-height: 68px; box-sizing: border-box; padding: 8px 10px; }
#inspiration-grid .char-tags { max-height: 50px; overflow: hidden; }

/* Greedy shortest-column masonry preserves data order without row-sized gaps. */
#inspiration-grid { --library-columns: 5; --library-gap: 16px; display: block; position: relative; columns: auto; }
#inspiration-grid .char-card { position: absolute; margin: 0; width: calc((100% - 64px) / 5); }
#inspiration-grid .char-media { aspect-ratio: var(--ratio, .667); }
@media (max-width: 1199px) { #inspiration-grid { --library-columns: 4; } }
@media (max-width: 980px) { #inspiration-grid { --library-columns: 3; } }
@media (max-width: 760px) { #inspiration-grid { --library-columns: 2; --library-gap: 12px; } }
/* Apply uses the same centered outer frame as the character detail. */
#apply-modal .apply-dialog { width: min(1100px, 66vw); min-width: min(720px, calc(100vw - 40px)); height: min(680px, 74svh); grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
#apply-modal .apply-media { padding: 20px; }
#apply-modal .apply-caption h2 { font-size: 26px; }
#apply-modal .apply-panel { padding: 24px; overflow: hidden; }
#apply-modal .back-link { flex-shrink: 0; }
#apply-modal .apply-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
#apply-modal .apply-head h2 { font-size: 28px; line-height: 1.12; }
#apply-modal .mode-card { min-height: 58px; padding: 12px; }
#apply-modal .apply-footer { flex-shrink: 0; margin-top: 0; padding-top: 14px; background: #fff; }
#apply-modal #ad-brief { min-height: 150px; }
@media (max-width: 760px) {
 #apply-modal { padding: 12px; }
 #apply-modal .apply-dialog { width: calc(100vw - 24px); min-width: 0; height: min(720px, 88svh) !important; max-height: 88svh; border-radius: 20px; overflow-y: auto; }
 #apply-modal .apply-media { padding: 16px; }
 #apply-modal .apply-stage { height: 300px; flex: initial; }
 #apply-modal .apply-panel { padding: 20px; overflow: visible; }
 #apply-modal .apply-scroll { overflow: visible; flex: initial; }
}
@media (max-width: 760px) {
 #apply-modal .apply-dialog { display: flex !important; flex-direction: column; overflow: hidden; }
 #apply-modal .apply-media { flex: 0 0 240px; height: 240px; min-height: 0; padding: 12px 16px; }
 #apply-modal .apply-stage { flex: 1; min-height: 0; height: auto; }
 #apply-modal .apply-caption { padding-top: 8px; }
 #apply-modal .apply-caption h2 { font-size: 22px; }
 #apply-modal .apply-panel { flex: 1; min-height: 0; overflow: hidden; padding: 16px; }
 #apply-modal .apply-scroll { flex: 1; min-height: 0; overflow-y: auto; }
}
@media (max-width: 760px) {
 #apply-modal .apply-stage > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; border: 0; box-shadow: none; }
}

/* Reference hero: cinematic supplied art, action pair and overlapping library. */
.hero { height: auto; min-height: 620px; padding: calc(var(--nav-h) + 38px) 40px 100px; justify-content: center; background: #020c0a; }
.hero-media { top: var(--nav-h); background: #020c0a; }
.hero-media img { object-fit: cover; object-position: right 18%; }
.hero-inner { max-width: 1440px; min-height: 0; grid-template-columns: minmax(0, 650px) minmax(0, 1fr); }
.hero-copy { max-width: 650px; }
.hero-eyebrow { font-size: 10px; font-weight: 650; letter-spacing: .32em; line-height: 1.5; color: #e4efeb; margin-bottom: 16px; }
.hero h1 { max-width: 650px; font-size: clamp(56px, 5.5vw, 84px); font-weight: 650; line-height: .98; letter-spacing: -.045em; }
.hero h1 em { color: #36edbb; }
.hero h1 em::after { height: 4px; bottom: -.05em; background: #36edbb; border-radius: 50%; transform: rotate(-3deg); }
.hero-lede { max-width: 580px; font-size: 18px; line-height: 1.45; color: #f0f6f3; margin-top: 24px; }
.hero-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.hero-explore, .hero-create { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border-radius: 32px; padding: 0 25px; font: 650 16px/1.2 var(--sans); text-decoration: none; }
.hero-explore { color: #031a13; border: 1px solid #8affd8; background: linear-gradient(135deg,#72ffce,#1ceba5); box-shadow: 0 0 25px #20efaa38; }
.hero-create { color: #fff; border: 1px solid #c0e4d78a; background: #071a1599; }
.hero-create svg { color: #55f5c3; }
.hero-explore:hover { filter: brightness(1.06); }
.hero-create:hover { background: #143b2fc7; }
.hero-categories { display: flex; align-items: center; flex-wrap: wrap; margin-top: 28px; row-gap: 12px; }
.hero-categories button { display: inline-flex; align-items: center; gap: 9px; color: #e7f3ed; background: transparent; border: 0; padding: 0 17px; font: 500 12px/1.4 var(--sans); border-left: 1px solid #90b4a75c; }
.hero-categories button:first-child { border-left: 0; padding-left: 0; }
.hero-categories button:hover { color: #58f3c4; }
.hero-categories svg { width: 21px; height: 21px; stroke: #60efc4; stroke-width: 1.4; fill: none; }
.hero-scrim { background: linear-gradient(90deg,#020b09f0 0%,#020b09d1 24%,#020b0970 42%,#020b090a 68%,transparent 100%),linear-gradient(0deg,#03120bd9,transparent 24%); }
.library { position: relative; z-index: 2; margin-top: -64px; padding: 0 32px 72px; scroll-margin-top: 80px; }
.library-shell { max-width: 1440px; }
.library .tabbar { padding: 14px 20px 6px; border-radius: 24px 24px 0 0; border-bottom: 0; background: #fffffffa; }
.library .library-toolbar { padding: 10px 20px 18px; border-radius: 0 0 24px 24px; background: #fffffffa; }
@media (max-width: 980px) {
 .hero { padding-left: 28px; padding-right: 28px; }
 .hero-inner { grid-template-columns: minmax(0, 1fr); }
 .hero-copy { max-width: 600px; }
 .hero h1 { font-size: 64px; }
 .hero-media img { object-position: 70% 18%; }
 .hero-scrim { background: linear-gradient(90deg,#020b09ee 0%,#020b09af 50%,#020b0930),linear-gradient(0deg,#03120bef,transparent 40%); }
}
@media (max-width: 760px) {
 .hero { min-height: 0; padding: calc(var(--nav-h) + 30px) 20px 82px; }
 .hero h1 { font-size: 44px; max-width: 360px; }
 .hero-eyebrow { font-size: 8px; letter-spacing: .22em; margin-bottom: 12px; }
 .hero-lede { font-size: 14px; margin-top: 18px; max-width: 350px; }
 .hero-desktop-break { display: none; }
 .hero-actions { gap: 10px; margin-top: 20px; }
 .hero-explore, .hero-create { min-height: 44px; padding: 0 15px; gap: 7px; font-size: 12px; }
 .hero-categories { margin-top: 24px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
 .hero-categories button { padding: 0; border: 0; font-size: 11px; }
 .hero-media img { object-position: 73% top; }
 .hero-scrim { background: linear-gradient(90deg,#020b09e8,#020b098f),linear-gradient(0deg,#03120bf5,transparent 55%); }
 .library { margin-top: -38px; padding-left: 12px; padding-right: 12px; }
 .library .tabbar { padding: 10px 10px 4px; border-radius: 20px 20px 0 0; }
 .library .library-toolbar { padding: 10px 10px 14px; border-radius: 0 0 20px 20px; }
}

/* Compact supplied artwork, matched brand green and soft library handoff. */
.hero { height: clamp(360px, 40svh, 420px); min-height: 0; padding: calc(var(--nav-h) + 16px) 40px 52px; }
.hero-inner { min-height: 0; }
.hero h1 { font-size: clamp(38px, 3.4vw, 50px); line-height: 1.02; }
.hero h1 em { color: var(--green); }
.hero h1 em::after { background: var(--green); }
.hero-lede { margin-top: 14px; font-size: 16px; line-height: 1.45; }
.hero-actions { margin-top: 18px; }
.hero-explore, .hero-create { min-height: 46px; padding: 0 22px; font-size: 14px; }
.hero-explore { background: var(--green); border-color: var(--green); box-shadow: 0 8px 24px #28be6626; }
.hero-create svg { color: var(--green); }
.hero-media { top: var(--nav-h); background: #020c0a; }
.hero-media img { object-fit: contain; object-position: right top; }
.hero-scrim { background: linear-gradient(90deg,#020c0af0 0%,#020c0aaf 28%,#020c0a30 50%,transparent 72%); }
.hero::after { inset: auto 0 0; height: 96px; z-index: 0; background: linear-gradient(180deg,rgba(255,255,255,0),rgba(255,255,255,.35) 52%,#fff 100%); }
.library { margin-top: -32px; }
@media (max-width: 760px) {
 .hero { height: 360px; padding: calc(var(--nav-h) + 18px) 20px 56px; }
 .hero h1 { font-size: 36px; }
 .hero-lede { font-size: 14px; line-height: 1.45; margin-top: 12px; }
 .hero-actions { gap: 10px; margin-top: 16px; }
 .hero-explore, .hero-create { min-height: 44px; padding: 0 15px; font-size: 12px; }
 .hero-media img { object-fit: contain; object-position: right top; }
 .hero-scrim { background: linear-gradient(90deg,#020c0ae8,#020c0a77); }
 .hero::after { height: 76px; }
 .library { margin-top: -28px; }
}
/* Feather the artwork's own left edge into the added dark panel. */
.hero-media picture { position: relative; }
.hero-media img { position: absolute; top: 0; right: 0; width: auto; max-width: 100%; height: 100%; mask-image: linear-gradient(90deg, transparent, #000 22%); }
/* Taller hero: reserve a first-row head preview below the library controls. */
.hero { height: clamp(460px, calc(100svh - 340px), 660px); }
.hero::after { height: 150px; background: linear-gradient(180deg, rgba(2,12,10,0) 0%, rgba(2,12,10,.08) 58%, rgba(2,12,10,.48) 100%); }
.hero-media img { mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.15) 7%, rgba(0,0,0,.72) 18%, #000 31%); }
.library { margin-top: -32px; }
.library::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 80px; z-index: -1; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.08) 34%, rgba(255,255,255,.62) 72%, #fff); }
@media (max-width: 760px) {
 .hero { height: max(360px, calc(100svh - 410px)); }
 .hero::after { height: 110px; }
 .library { margin-top: -28px; }
}

/* Single-line desktop headline with a stronger display scale. */
.hero-inner { grid-template-columns: minmax(0, 1fr); }
.hero-copy { max-width: 1100px; }
.hero h1 { max-width: none; font-size: clamp(48px, 4.3vw, 74px); white-space: nowrap; line-height: 1.08; }
@media (max-width: 980px) { .hero h1 { font-size: clamp(38px, 5vw, 50px); } }
@media (max-width: 760px) { .hero-copy { max-width: 100%; } .hero h1 { font-size: clamp(32px, 8vw, 42px); white-space: normal; text-wrap: balance; } }

/* Library card metadata is compact once the inline save control is removed. */
#inspiration-grid .char-meta { height: auto; min-height: 52px; padding: 10px 12px; }
#inspiration-grid .char-tags { max-height: none; }
#inspiration-grid .char-bottom { left: 12px; right: 12px; bottom: 16px; }

/* Current hero artwork: preserve height, fit on the right, fill remaining width black. */
.hero, .hero-media { background-color: #000; }
.hero-media img { object-fit: contain; object-position: right top; }
.hero-scrim { background: linear-gradient(90deg,rgba(0,0,0,.96) 0%,rgba(0,0,0,.65) 28%,rgba(0,0,0,.12) 50%,transparent 72%); }

/* Face references stay completely visible within the bounded detail stage. */
#character-modal .cm-face-wrap { position: absolute; inset: 20px; width: auto; height: auto; aspect-ratio: auto; margin: 0; border: 0; border-radius: 12px; background: transparent; box-shadow: none; }
#character-modal .cm-face-wrap img, #character-modal .cm-face-wrap.is-direct img { width: 100%; height: 100%; object-fit: contain; object-position: center; transform: none; border-radius: 12px; }
#character-modal .cm-avatar { object-fit: cover; object-position: center; }
#apply-modal .mode-card { min-height: 44px; padding: 8px 12px; border-radius: 10px; }
/* Tighter product setup spacing within the compact apply form. */
#apply-modal .mode-form { margin-top: 10px; }
#apply-modal .product-empty { min-height: 64px; padding: 8px 10px; gap: 3px; }
#apply-modal .product-empty .drop-icon { width: 25px; height: 25px; border-radius: 8px; }
#apply-modal .product-empty .drop-icon svg { width: 18px; height: 18px; }
#apply-modal .product-empty strong { font-size: 12px; line-height: 1.4; }

/* Compact the gap between back navigation and apply heading. */
#apply-modal .apply-head { margin-top: 8px; }

/* Output format and optional brief share a single input surface. */
#apply-modal .ad-composer { border: 1px solid var(--line); border-radius: 12px; background: #fafafa; overflow: hidden; transition: border-color .16s, box-shadow .16s; }
#apply-modal .ad-composer:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px #28be6614; }
#apply-modal .ad-composer .ad-output-options { margin: 0; padding: 8px; gap: 4px; border-bottom: 1px solid #e6ebe7; }
#apply-modal .ad-composer .output-option { min-height: 32px; padding: 6px 14px; border-radius: 7px; border-color: transparent; background: transparent; font-size: 13px; line-height: 1.3; color: var(--muted); }
#apply-modal .ad-composer .output-option.is-active { border-color: #b6dfc4; background: #edf8f1; color: var(--green-deep); }
#apply-modal .ad-composer #ad-brief { min-height: 144px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
#apply-modal .ad-composer #ad-brief:focus-visible { outline: none; }

/* Shared reference-height dialogs and one spacing rhythm throughout the Apply form. */
#character-modal .character-dialog,
#apply-modal .apply-dialog { height: min(630px, 82svh); max-height: calc(100svh - 40px); }
#apply-modal .apply-panel { --apply-gap: 12px; gap: var(--apply-gap); }
#apply-modal .apply-scroll { flex: 1 0 auto; min-height: auto; overflow: visible; padding: 0; display: flex; flex-direction: column; gap: var(--apply-gap); }
#apply-modal .apply-head { margin: 0; display: flex; flex-direction: column; gap: var(--apply-gap); }
#apply-modal .apply-head h2,
#apply-modal .apply-head > p:last-child { margin: 0; }
#apply-modal .mode-grid,
#apply-modal .mode-form { margin: 0; }
#apply-modal .mode-form { display: flex; flex-direction: column; gap: var(--apply-gap); }
#apply-modal .field-head { margin: 0; }
#apply-modal .apply-footer { margin: 0; padding: 0; }
#apply-modal .form-error { margin: 0; }
#apply-modal .ad-composer #ad-brief { height: clamp(96px, 14svh, 144px); min-height: 96px; resize: none; }
#apply-modal #story-brief { height: clamp(160px, 24svh, 250px); min-height: 160px; resize: none; }
#character-modal .cm-body { overflow-y: auto; }
@media (max-width: 760px) {
 #character-modal .character-dialog,
 #apply-modal .apply-dialog { height: min(690px, calc(100svh - 24px)) !important; max-height: calc(100svh - 24px); overflow-y: auto; }
 #apply-modal .apply-media { flex-shrink: 0; }
 #apply-modal .apply-panel { flex: 1 0 auto; overflow: visible; }
 #apply-modal .apply-scroll { flex: 1 0 auto; overflow: visible; }
 #apply-modal .apply-footer { flex-shrink: 0; }
}

/* E-commerce library motion: short viewport reveals, independent of masonry layout. */
#inspiration-grid .char-card.is-pending { opacity: 0; transform: translateY(18px); }
#inspiration-grid .char-card.is-entering { animation: libraryCardEnter .32s cubic-bezier(.22,1,.36,1) var(--enter-delay, 0ms) both; }
#inspiration-grid .char-media > img { opacity: 0; transition: opacity .18s ease-out; }
#inspiration-grid .char-media > img.is-loaded { opacity: 1; }
@keyframes libraryCardEnter {
 from { opacity: 0; transform: translateY(18px); }
 to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
 #inspiration-grid .char-card.is-pending { opacity: 1; transform: none; }
 #inspiration-grid .char-card.is-entering { animation: none; }
 #inspiration-grid .char-media > img { opacity: 1; transition: none; }
}

/* Keep the first-screen artwork at the supplied reference's compact banner scale. */
.hero { height: clamp(480px, 63svh, 720px); }
.hero-media { bottom: -48px; }
.hero::after { bottom: -48px; height: 96px; background: linear-gradient(180deg, transparent, rgba(0,0,0,.24)); }
@media (max-width: 760px) {
 .hero { height: max(360px, calc(100svh - 410px)); }
 .hero-media { bottom: -36px; }
 .hero::after { bottom: -36px; }
}

/* Create shares the detail/apply frame; portrait guidance stays in the upload label. */
#create-modal .create-dialog { width: min(1100px, 66vw); min-width: min(720px, calc(100vw - 40px)); height: min(630px, 82svh); max-height: calc(100svh - 40px); padding: 24px; display: flex; flex-direction: column; gap: 20px; overflow: hidden; }
#create-modal .create-head h2 { font-size: 30px; line-height: 1.1; }
#create-modal .create-grid { flex: 1; min-height: 0; margin: 0; grid-template-columns: minmax(0,.92fr) minmax(0,1.08fr); gap: 24px; align-items: stretch; }
#create-modal .create-left { display: flex; flex-direction: column; min-height: 0; }
#create-modal .portrait-drop { flex: 1; min-height: 260px; }
#create-modal .portrait-empty { height: 100%; min-height: 260px; }
#create-modal .create-right { display: flex; flex-direction: column; min-width: 0; }
#create-modal .create-footer { margin-top: auto; padding-top: 20px; }
@media (max-width: 760px) {
 #create-modal { padding: 12px; }
 #create-modal .create-dialog { width: calc(100vw - 24px); min-width: 0; height: min(690px, calc(100svh - 24px)) !important; max-height: calc(100svh - 24px); border-radius: 20px; padding: 20px; overflow-y: auto; display: block; }
 #create-modal .create-head h2 { font-size: 24px; }
 #create-modal .create-grid { display: flex; flex-direction: column; margin-top: 20px; }
 #create-modal .portrait-drop, #create-modal .portrait-empty { min-height: 240px; }
}

/* My Characters uses the same five-column card scale as Inspiration. */
#mine-grid { --library-columns: 5; display: grid; columns: auto; grid-template-columns: repeat(var(--library-columns), minmax(0,1fr)); gap: 16px; align-items: start; }
#mine-grid .char-card { width: 100%; min-width: 0; margin: 0; border-radius: 14px; animation: none; }
#mine-grid .char-media { aspect-ratio: var(--ratio,.667); background: #ededed; }
#mine-grid .char-media > img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
#mine-grid .char-card:hover .char-media > img { transform: none; }
#mine-grid .char-name { font-size: 20px; line-height: 1.2; }
#mine-grid .char-bottom { left: 12px; right: 12px; bottom: 16px; }
#mine-grid .char-meta { height: auto; min-height: 52px; padding: 10px 12px; }
#mine-grid .char-tags { min-width: 0; max-height: none; }
#mine-grid .char-tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
#mine-grid .create-tile { width: 100%; height: 100%; min-height: 0; margin: 0; padding: 20px; border-radius: 14px; align-self: stretch; }
.library.is-mine .tabbar { border: 1px solid var(--line); border-radius: 24px; padding-bottom: 14px; }
.library.is-mine .mine-toolbar { margin: 24px 2px 20px; }
.library.is-mine .mine-toolbar h3 { margin: 0; font-size: 20px; line-height: 1.3; }
@media (max-width: 1199px) { #mine-grid { --library-columns: 4; } }
@media (max-width: 980px) { #mine-grid { --library-columns: 3; } }
@media (max-width: 760px) {
 #mine-grid { --library-columns: 2; gap: 12px; }
 #mine-grid .char-name { font-size: 16px; }
 #mine-grid .char-tag { font-size: 9px; }
 #mine-grid .create-tile { padding: 12px; }
 .library.is-mine .tabbar { border-radius: 20px; padding-bottom: 10px; }
}

/* Saving needs a small acknowledgement, not a decorated announcement. */
.toast.is-quiet { padding: 10px 14px; border: 1px solid #dedfdd; border-radius: 8px; background: #fff; color: var(--ink); font-size: 13px; box-shadow: 0 4px 18px #00000012; backdrop-filter: none; animation: quietNoticeIn .16s ease-out both; }
.toast.is-quiet .toast-icon { display: none; }
@keyframes quietNoticeIn { from { opacity: 0; } to { opacity: 1; } }

/* Destructive confirmation belongs to the page, above any open character dialog. */
#character-modal #cm-save.is-remove { color: #a33b32; border-color: #ddc2be; }
#remove-modal { z-index: 150; }
#remove-modal .modal-backdrop { background: #080b0938; backdrop-filter: blur(3px); }
#remove-modal .remove-dialog { width: min(420px, calc(100vw - 40px)); height: auto !important; max-height: calc(100svh - 40px); padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: white; color: var(--ink); }
#remove-modal h2 { margin: 0; font-size: 23px; line-height: 1.25; letter-spacing: -.025em; }
#remove-modal p { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
#remove-modal .remove-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
#remove-modal .btn { min-height: 42px; padding: 0 20px; }
#remove-modal #remove-confirm { background: #b64135; color: white; border: 1px solid #b64135; }
#remove-modal #remove-confirm:hover { background: #9f352c; }
#remove-modal #remove-confirm:disabled { opacity: .55; }
#remove-modal #remove-cancel { color: var(--ink); border-color: var(--line); background: #fff; }
#remove-modal #remove-cancel:hover { color: var(--ink); background: #f5f6f5; border-color: var(--line-strong); }

/* Short laptop windows need the same visible height reduction as larger screens. */
@media (min-width: 761px) and (max-height: 780px) {
 #apply-modal .apply-panel { padding: 20px; --apply-gap: 10px; }
 #apply-modal .apply-head h2 { font-size: 26px; }
 #apply-modal .apply-head > p:last-child { font-size: 12px; line-height: 1.45; }
 #apply-modal .ad-composer #ad-brief { height: 96px; }
 #apply-modal .apply-footer .btn { min-height: 44px; height: 44px; padding-top: 0; padding-bottom: 0; }
}

/* Native copy can use a different rhythm and line length from the English headline. */
:scope:not([lang="en"]):not([lang="en-US"]) .hero h1 { white-space: normal; max-width: min(740px, 57vw); font-size: clamp(36px, 3.7vw, 64px); text-wrap: balance; }
:scope:not([lang="en"]):not([lang="en-US"]) .hero-lede { max-width: min(580px, 48vw); }
:scope[dir="rtl"] .hero-copy { direction: rtl; text-align: right; }
:scope[dir="rtl"] .hero-inner { direction: ltr; }
:scope[dir="rtl"] .hero-actions { direction: rtl; justify-content: flex-start; }
:scope[dir="rtl"] .cm-panel,:scope[dir="rtl"] .apply-panel,:scope[dir="rtl"] .create-dialog { text-align: right; }
:scope[dir="rtl"] .modal-close { right: auto; left: 14px; }
:scope[dir="rtl"] .cm-media { border-right: 0; border-left: 1px solid var(--line); }
:scope[dir="rtl"] .brief-count { right: auto; left: 16px; }
:scope[dir="rtl"] #ad-brief,:scope[dir="rtl"] #story-brief { padding-left: 42px; padding-right: 13px; }
:scope[dir="rtl"] .back-link svg { transform: rotate(180deg); }
:scope[dir="rtl"] .char-name,:scope[dir="rtl"] .cm-avatar,:scope[dir="rtl"] #cm-id { unicode-bidi: isolate; }
@media (max-width: 760px) {
 :scope:not([lang="en"]):not([lang="en-US"]) .hero h1 { max-width: 100%; font-size: clamp(30px,7.5vw,40px); }
 :scope:not([lang="en"]):not([lang="en-US"]) .hero-lede { max-width: 100%; font-size: 13px; }
 .hero-actions { max-width: 420px; }
 :scope:not([lang="en"]):not([lang="en-US"]) .hero-actions>* { flex: 1 1 0; min-width: 0; padding-left: 10px; padding-right: 10px; font-size: 11px; white-space: normal; text-align: center; }
 :scope:not([lang="en"]):not([lang="en-US"]) .hero-actions svg { flex-shrink: 0; }
}

/* Locale review: keep Arabic copy on the artwork's dark left panel. */
:scope[lang="ar-SA"] { --sans: Tahoma, Arial, sans-serif; }
:scope[dir="rtl"] .hero-copy { width: min(620px,48vw); justify-self: start; }
:scope[dir="rtl"] .hero h1, :scope[dir="rtl"] .hero-lede { max-width: 100%; }
:scope[dir="rtl"] .hero h1 { line-height: 1.3; }
:scope[dir="rtl"] .hero-lede { font-size: 18px; line-height: 1.7; }
:scope[lang="ja-JP"] .hero h1 em { display: block; width: fit-content; }
:scope[lang="ko-KR"] .hero h1 { word-break: keep-all; }
@media (max-width: 760px) {
 :scope[dir="rtl"] .hero-copy { width: 100%; }
 :scope[dir="rtl"] .hero-lede { font-size: 14px; }
}

/* Fit the form more closely so the footer does not leave a large blank band. */
@media (min-width: 761px) and (max-height: 780px) {
 #character-modal .character-dialog,
 #apply-modal .apply-dialog,
 #create-modal .create-dialog { height: min(540px, calc(100svh - 44px)); }
 #apply-modal .apply-panel { --apply-gap: 8px; }
 :scope:has(#apply-modal:not([hidden]) .form-error:not([hidden])) #character-modal .character-dialog,
 :scope:has(#apply-modal:not([hidden]) .form-error:not([hidden])) #apply-modal .apply-dialog,
 :scope:has(#apply-modal:not([hidden]) .form-error:not([hidden])) #create-modal .create-dialog { height: min(580px, calc(100svh - 44px)); }
}
@media (min-width: 761px) and (min-height: 781px) {
 :scope:has(#apply-modal:not([hidden]) .form-error:not([hidden])) #character-modal .character-dialog,
 :scope:has(#apply-modal:not([hidden]) .form-error:not([hidden])) #apply-modal .apply-dialog,
 :scope:has(#apply-modal:not([hidden]) .form-error:not([hidden])) #create-modal .create-dialog { height: min(670px, calc(100svh - 44px)); }
}
@media (min-width: 761px) {
 #apply-modal .apply-stage > img { position: absolute; inset: 0; margin: auto; height: 100%; width: auto; max-height: 100%; }
}

/* Server-backed character task states. */
.char-job .char-media img { opacity:.45; }
.character-job-status { position:absolute;inset:42% 12% auto;padding:16px;background:rgba(255,255,255,.94);border-radius:14px;text-align:center;font-weight:600;color:#151814; }
#character-flow-modal { z-index:1500; }
#character-flow-modal .dialog { width:min(480px,calc(100vw - 32px)); }
#character-flow-actions { flex-wrap:wrap; }

#cm-save[hidden] { display:none; }

.character-tool-link{display:inline-block;color:var(--green-deep);margin-top:10px;font-size:13px;}
/* Keep mobile copy legible over the bright artwork and filters in stable rows.
   A block summary plus an inner flex row avoids native WebKit marker layout. */
@media (max-width: 760px) {
 .hero { height: auto; min-height: 420px; padding: 42px 20px 76px; }
 .hero-scrim { background: linear-gradient(90deg,rgba(0,0,0,.76),rgba(0,0,0,.52)),linear-gradient(0deg,#000,transparent 72%); }
 .hero h1 { text-shadow: 0 2px 16px rgba(0,0,0,.35); }
 .hero-lede { color: #fff; }
 .taxonomy-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
 .multi-filter { min-width: 0; }
 .multi-filter > summary { height: 44px; padding: 0 10px; }
 .multi-trigger { gap: 6px; }
 .multi-label, .multi-value { font-size: 12px; }
 .multi-label { overflow: hidden; text-overflow: ellipsis; }
 .multi-value { flex: 1; min-width: 0; text-align: end; }
 .multi-chevron { flex-shrink: 0; }
 .taxonomy-reset { justify-self: start; min-height: 44px; }
}

}
