:root {
  color-scheme: dark;
  --bg: #02040a;
  --page: #050814;
  --panel: #0b1020;
  --panel-strong: #11182a;
  --panel-muted: #0d1424;
  --ink: #f7fbff;
  --ink-soft: #d7e8ff;
  --muted: #8ea3bd;
  --faint: #60718a;
  --line: rgba(125, 211, 252, 0.16);
  --line-strong: rgba(125, 211, 252, 0.28);
  --brand: #38bdf8;
  --brand-strong: #60a5fa;
  --brand-soft: #071a36;
  --rose: #ff6bcb;
  --orange: #ff8a3d;
  --mint: #22d3ee;
  --green: #39ffb6;
  --yellow: #facc15;
  --lilac: #a78bfa;
  --slate: #94a3b8;
  --danger: #fb7185;
  --shadow: 0 22px 62px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.26);
  --radius: 8px;
  --sidebar: #050814;
  --toast: #f8fafc;
  --body-bg:
    radial-gradient(
      circle at 18% -8%,
      rgba(56, 189, 248, 0.2),
      transparent 32vw
    ),
    radial-gradient(
      circle at 86% 8%,
      rgba(167, 139, 250, 0.18),
      transparent 30vw
    ),
    radial-gradient(
      circle at 52% 112%,
      rgba(255, 107, 203, 0.11),
      transparent 36vw
    ),
    var(--bg);
  --shell-bg:
    linear-gradient(
      180deg,
      rgba(12, 18, 32, 0.7),
      rgba(5, 8, 20, 0.88) 460px,
      rgba(2, 4, 10, 0.96)
    ),
    linear-gradient(90deg, rgba(56, 189, 248, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  --nav-glass: rgba(5, 8, 20, 0.76);
  --bar-glass: rgba(11, 16, 32, 0.62);
  --dock-glass: color-mix(in srgb, var(--panel) 24%, transparent);
  --dock-inner:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0.025) 38%,
      rgba(56, 189, 248, 0.08)
    ),
    color-mix(in srgb, var(--panel) 22%, transparent);
  --pill-glass: rgba(11, 16, 32, 0.42);
  --preview-scrim: rgba(15, 23, 42, 0.16);
}

/* Polished theme pass inspired by the ChatGPT2API reference visual. */
:root,
:root[data-theme="dark"] {
  --bg: #05050d;
  --page: #070814;
  --panel: #101322;
  --panel-strong: #161a2e;
  --panel-muted: #111527;
  --ink: #f8f7ff;
  --ink-soft: #e7e5ff;
  --muted: #9aa0ba;
  --faint: #686f8d;
  --line: rgba(149, 130, 255, 0.18);
  --line-strong: rgba(149, 130, 255, 0.34);
  --brand: #8b5cf6;
  --brand-strong: #635bff;
  --brand-soft: rgba(139, 92, 246, 0.14);
  --rose: #f472b6;
  --orange: #ff9f43;
  --mint: #22d3ee;
  --green: #36f5a7;
  --yellow: #f6d365;
  --lilac: #b9a1ff;
  --slate: #aab3ca;
  --shadow: 0 26px 72px rgba(0, 0, 0, 0.48);
  --shadow-soft: 0 14px 38px rgba(2, 4, 12, 0.32);
  --sidebar: #090a16;
  --body-bg:
    radial-gradient(
      circle at 14% -12%,
      rgba(139, 92, 246, 0.24),
      transparent 34vw
    ),
    radial-gradient(
      circle at 86% 0%,
      rgba(34, 211, 238, 0.13),
      transparent 32vw
    ),
    radial-gradient(
      circle at 52% 116%,
      rgba(244, 114, 182, 0.1),
      transparent 38vw
    ),
    #05050d;
  --shell-bg:
    linear-gradient(
      180deg,
      rgba(10, 11, 24, 0.78),
      rgba(6, 7, 16, 0.94) 440px,
      rgba(5, 5, 13, 0.98)
    ),
    linear-gradient(90deg, rgba(149, 130, 255, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(149, 130, 255, 0.028) 1px, transparent 1px);
  --nav-glass: rgba(8, 9, 20, 0.82);
  --bar-glass: rgba(16, 19, 34, 0.62);
  --dock-glass: rgba(13, 15, 29, 0.2);
  --dock-inner:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.115),
      rgba(255, 255, 255, 0.026) 40%,
      rgba(139, 92, 246, 0.085)
    ),
    rgba(15, 17, 31, 0.18);
  --pill-glass: rgba(18, 21, 38, 0.46);
  --preview-scrim: rgba(7, 8, 18, 0.18);
}

:root[data-theme="light"] {
  --bg: #f7f8fe;
  --page: #f2f4fc;
  --panel: #ffffff;
  --panel-strong: #f7f8ff;
  --panel-muted: #eef1fb;
  --ink: #111327;
  --ink-soft: #252846;
  --muted: #626982;
  --faint: #8b92aa;
  --line: rgba(88, 86, 214, 0.13);
  --line-strong: rgba(88, 86, 214, 0.26);
  --brand: #6d5dfc;
  --brand-strong: #7c3aed;
  --brand-soft: rgba(109, 93, 252, 0.11);
  --rose: #e454ad;
  --orange: #f97316;
  --mint: #0891b2;
  --green: #059669;
  --yellow: #c99700;
  --lilac: #7c3aed;
  --slate: #515b73;
  --shadow: 0 22px 58px rgba(22, 24, 46, 0.13);
  --shadow-soft: 0 12px 30px rgba(22, 24, 46, 0.1);
  --sidebar: #ffffff;
  --body-bg:
    radial-gradient(
      circle at 14% -12%,
      rgba(109, 93, 252, 0.14),
      transparent 34vw
    ),
    radial-gradient(
      circle at 86% 0%,
      rgba(34, 211, 238, 0.1),
      transparent 32vw
    ),
    radial-gradient(
      circle at 52% 116%,
      rgba(228, 84, 173, 0.08),
      transparent 38vw
    ),
    #f7f8fe;
  --shell-bg:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.78),
      rgba(246, 247, 253, 0.92) 440px,
      rgba(247, 248, 254, 0.98)
    ),
    linear-gradient(90deg, rgba(109, 93, 252, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(109, 93, 252, 0.028) 1px, transparent 1px);
  --nav-glass: rgba(255, 255, 255, 0.82);
  --bar-glass: rgba(255, 255, 255, 0.7);
  --dock-glass: rgba(255, 255, 255, 0.22);
  --dock-inner:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.58),
      rgba(255, 255, 255, 0.22) 42%,
      rgba(109, 93, 252, 0.1)
    ),
    rgba(255, 255, 255, 0.18);
  --pill-glass: rgba(255, 255, 255, 0.58);
  --preview-scrim: rgba(12, 15, 30, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #05050d;
    --page: #070814;
    --panel: #101322;
    --panel-strong: #161a2e;
    --panel-muted: #111527;
    --ink: #f8f7ff;
    --ink-soft: #e7e5ff;
    --muted: #9aa0ba;
    --faint: #686f8d;
    --line: rgba(149, 130, 255, 0.18);
    --line-strong: rgba(149, 130, 255, 0.34);
    --brand: #8b5cf6;
    --brand-strong: #635bff;
    --brand-soft: rgba(139, 92, 246, 0.14);
    --rose: #f472b6;
    --orange: #ff9f43;
    --mint: #22d3ee;
    --green: #36f5a7;
    --yellow: #f6d365;
    --lilac: #b9a1ff;
    --slate: #aab3ca;
    --shadow: 0 26px 72px rgba(0, 0, 0, 0.48);
    --shadow-soft: 0 14px 38px rgba(2, 4, 12, 0.32);
    --sidebar: #090a16;
    --body-bg:
      radial-gradient(
        circle at 14% -12%,
        rgba(139, 92, 246, 0.24),
        transparent 34vw
      ),
      radial-gradient(
        circle at 86% 0%,
        rgba(34, 211, 238, 0.13),
        transparent 32vw
      ),
      radial-gradient(
        circle at 52% 116%,
        rgba(244, 114, 182, 0.1),
        transparent 38vw
      ),
      #05050d;
    --shell-bg:
      linear-gradient(
        180deg,
        rgba(10, 11, 24, 0.78),
        rgba(6, 7, 16, 0.94) 440px,
        rgba(5, 5, 13, 0.98)
      ),
      linear-gradient(90deg, rgba(149, 130, 255, 0.035) 1px, transparent 1px),
      linear-gradient(0deg, rgba(149, 130, 255, 0.028) 1px, transparent 1px);
    --nav-glass: rgba(8, 9, 20, 0.82);
    --bar-glass: rgba(16, 19, 34, 0.62);
    --dock-glass: rgba(13, 15, 29, 0.2);
    --dock-inner:
      linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.115),
        rgba(255, 255, 255, 0.026) 40%,
        rgba(139, 92, 246, 0.085)
      ),
      rgba(15, 17, 31, 0.18);
    --pill-glass: rgba(18, 21, 38, 0.46);
    --preview-scrim: rgba(7, 8, 18, 0.18);
  }
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg: #f7f8fe;
    --page: #f2f4fc;
    --panel: #ffffff;
    --panel-strong: #f7f8ff;
    --panel-muted: #eef1fb;
    --ink: #111327;
    --ink-soft: #252846;
    --muted: #626982;
    --faint: #8b92aa;
    --line: rgba(88, 86, 214, 0.13);
    --line-strong: rgba(88, 86, 214, 0.26);
    --brand: #6d5dfc;
    --brand-strong: #7c3aed;
    --brand-soft: rgba(109, 93, 252, 0.11);
    --rose: #e454ad;
    --orange: #f97316;
    --mint: #0891b2;
    --green: #059669;
    --yellow: #c99700;
    --lilac: #7c3aed;
    --slate: #515b73;
    --shadow: 0 22px 58px rgba(22, 24, 46, 0.13);
    --shadow-soft: 0 12px 30px rgba(22, 24, 46, 0.1);
    --sidebar: #ffffff;
    --body-bg:
      radial-gradient(
        circle at 14% -12%,
        rgba(109, 93, 252, 0.14),
        transparent 34vw
      ),
      radial-gradient(
        circle at 86% 0%,
        rgba(34, 211, 238, 0.1),
        transparent 32vw
      ),
      radial-gradient(
        circle at 52% 116%,
        rgba(228, 84, 173, 0.08),
        transparent 38vw
      ),
      #f7f8fe;
    --shell-bg:
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.78),
        rgba(246, 247, 253, 0.92) 440px,
        rgba(247, 248, 254, 0.98)
      ),
      linear-gradient(90deg, rgba(109, 93, 252, 0.035) 1px, transparent 1px),
      linear-gradient(0deg, rgba(109, 93, 252, 0.028) 1px, transparent 1px);
    --nav-glass: rgba(255, 255, 255, 0.82);
    --bar-glass: rgba(255, 255, 255, 0.7);
    --dock-glass: rgba(255, 255, 255, 0.22);
    --dock-inner:
      linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.58),
        rgba(255, 255, 255, 0.22) 42%,
        rgba(109, 93, 252, 0.1)
      ),
      rgba(255, 255, 255, 0.18);
    --pill-glass: rgba(255, 255, 255, 0.58);
    --preview-scrim: rgba(12, 15, 30, 0.1);
  }
}

.sidebar {
  box-shadow: 0 12px 34px rgba(2, 4, 12, 0.2);
}

.brand {
  gap: 10px;
  min-width: 188px;
}

.brand-mark {
  width: 86px;
  height: 86px;
}

.brand-mark img {
  transform: scale(1.13);
  transform-origin: center;
}

.brand-title {
  font-size: 19px;
}

.brand-subtitle {
  margin-top: 3px;
  color: color-mix(in srgb, var(--muted) 86%, var(--brand));
}

.nav-item.active,
.chip.active,
.theme-toggle.active,
.theme-toggle:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.button.primary {
  background: linear-gradient(135deg, #9b7bff, var(--brand-strong));
  border-color: rgba(185, 161, 255, 0.46);
  box-shadow: 0 12px 28px rgba(99, 91, 255, 0.25);
}

.button.primary:hover {
  background: linear-gradient(135deg, #a88bff, #5b55f4);
}

.inspiration-grid {
  column-width: 308px;
  column-gap: 24px;
}

.inspiration-grid .example-card {
  margin-bottom: 24px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.inspiration-grid .example-card:hover {
  transform: none;
  border-color: transparent;
}

.inspiration-cover,
.inspiration-grid .cover,
.inspiration-grid .cover.tall {
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: 0 14px 34px rgba(2, 4, 12, 0.2);
  transform: translateZ(0);
}

.inspiration-cover img,
.inspiration-grid .cover img {
  transition:
    transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.34s ease;
  will-change: transform;
}

.same-style-cover:hover,
.same-style-cover:focus-visible {
  border-color: transparent;
  outline: 0;
}

.same-style-cover:hover img,
.same-style-cover:focus-visible img {
  transform: scale(1.045);
  filter: saturate(1.06) contrast(1.02);
}

.same-style-cover::after {
  background:
    linear-gradient(to top, rgba(5, 5, 13, 0.46), transparent 45%),
    linear-gradient(to bottom, rgba(5, 5, 13, 0.22), transparent 32%);
}

.inspiration-card-label {
  left: 12px;
  top: 12px;
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  background: rgba(8, 9, 20, 0.58);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(16px) saturate(1.25);
}

.inspiration-cover .cover-action {
  left: 12px;
  right: 12px;
  bottom: 12px;
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  color: #111327;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 30px rgba(2, 4, 12, 0.24);
}

.create-prompt-dock {
  width: min(820px, calc(100vw - 56px));
}

.create-prompt-panel {
  border-radius: 34px;
  border-color: rgba(149, 130, 255, 0.3);
  background: var(--dock-glass);
  box-shadow:
    0 20px 54px rgba(99, 91, 255, 0.18),
    0 14px 40px rgba(0, 0, 0, 0.16);
}

.create-prompt-panel::before {
  background: conic-gradient(
    from 0deg,
    rgba(139, 92, 246, 0),
    rgba(139, 92, 246, 0),
    rgba(139, 92, 246, 0.92),
    rgba(34, 211, 238, 0.92),
    rgba(139, 92, 246, 0),
    rgba(139, 92, 246, 0)
  );
}

.create-prompt-panel::after {
  border-radius: 32px;
}

.prompt-input-box {
  min-height: 176px;
  border-radius: 40px;
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  background:
    radial-gradient(
      circle at 10% 0%,
      rgba(255, 255, 255, 0.18),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.105),
      rgba(255, 255, 255, 0.018) 38%,
      rgba(139, 92, 246, 0.075)
    ),
    color-mix(in srgb, var(--panel) 13%, transparent);
}

.hot-prompt {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
}

.hot-prompt:hover {
  background: rgba(139, 92, 246, 0.18);
  border-color: color-mix(in srgb, var(--brand) 60%, var(--line));
}

@media (max-width: 640px) {
  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 70px;
    height: 70px;
  }

  .brand-title {
    font-size: 18px;
  }

  .inspiration-grid {
    column-width: 178px;
    column-gap: 14px;
  }

  .inspiration-grid .example-card {
    margin-bottom: 14px;
  }

  .create-prompt-dock {
    width: calc(100vw - 20px);
  }

  .create-prompt-panel {
    border-radius: 30px;
  }

  .create-prompt-panel::after {
    border-radius: 28px;
  }

  .prompt-input-box {
    min-height: 176px;
    border-radius: 34px;
  }
}

/* Final UI overrides. Keep this block last. */
.header-health {
  padding: 0;
  border: 0;
  background: transparent;
  gap: 9px;
}

.theme-switch.compact {
  min-height: 34px;
  padding: 3px;
  border-radius: 999px;
}

.theme-switch.compact .theme-toggle {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  justify-content: center;
  border-radius: 999px;
}

.theme-switch.compact .theme-toggle span {
  display: none;
}

.quota-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel-strong) 58%, transparent);
  backdrop-filter: blur(12px) saturate(1.16);
}

.create-prompt-panel {
  background: rgba(12, 14, 28, 0.13);
}

:root[data-theme="light"] .create-prompt-panel {
  background: rgba(255, 255, 255, 0.16);
}

.create-prompt-panel::after {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.09),
      rgba(255, 255, 255, 0.018) 42%,
      rgba(139, 92, 246, 0.055)
    ),
    rgba(13, 15, 29, 0.1);
}

:root[data-theme="light"] .create-prompt-panel::after {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.46),
      rgba(255, 255, 255, 0.12) 42%,
      rgba(109, 93, 252, 0.07)
    ),
    rgba(255, 255, 255, 0.12);
}

.prompt-input-box {
  background:
    radial-gradient(
      circle at 10% 0%,
      rgba(255, 255, 255, 0.14),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.082),
      rgba(255, 255, 255, 0.012) 38%,
      rgba(139, 92, 246, 0.052)
    ),
    rgba(14, 17, 32, 0.1);
}

:root[data-theme="light"] .prompt-input-box {
  background:
    radial-gradient(
      circle at 10% 0%,
      rgba(255, 255, 255, 0.5),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.34),
      rgba(255, 255, 255, 0.08) 38%,
      rgba(109, 93, 252, 0.055)
    ),
    rgba(255, 255, 255, 0.12);
}

.example-card {
  position: relative;
}

.home-example-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.example-card:hover .home-example-actions,
.example-card:focus-within .home-example-actions {
  opacity: 1;
  transform: translateY(0);
}

.home-example-actions .icon-button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: #fff;
  background: rgba(7, 8, 18, 0.58);
  backdrop-filter: blur(12px) saturate(1.22);
}

.home-example-actions .icon-button:hover {
  color: #fff;
  background: rgba(139, 92, 246, 0.72);
}

.home-example-actions .icon-button.danger:hover {
  background: rgba(244, 63, 94, 0.76);
}

.home-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.home-admin-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.home-admin-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.home-admin-card-body {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.home-admin-card-body strong {
  color: var(--ink);
  font-size: 14px;
}

.home-admin-card-body span,
.home-admin-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.hot-admin-row {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.hot-admin-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 950;
}

.hot-prompt-manage {
  width: 28px;
  min-width: 28px;
  padding: 0;
  justify-content: center;
}

.hot-prompt-manage .icon {
  width: 14px;
  height: 14px;
}

@media (hover: none) {
  .home-example-actions {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .quota-pill {
    min-height: 32px;
    padding: 0 10px;
  }

  .home-admin-grid {
    grid-template-columns: 1fr;
  }

  .hot-admin-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .hot-admin-row .admin-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* Admin and final visual tuning. */
.header-health {
  padding: 0;
  border: 0;
  background: transparent;
  gap: 9px;
}

.theme-switch.compact {
  min-height: 34px;
  padding: 3px;
  border-radius: 999px;
}

.theme-switch.compact .theme-toggle {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  justify-content: center;
  border-radius: 999px;
}

.theme-switch.compact .theme-toggle span {
  display: none;
}

.quota-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel-strong) 58%, transparent);
  backdrop-filter: blur(12px) saturate(1.16);
}

.create-prompt-panel {
  background: rgba(12, 14, 28, 0.13);
}

:root[data-theme="light"] .create-prompt-panel {
  background: rgba(255, 255, 255, 0.16);
}

.create-prompt-panel::after {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.09),
      rgba(255, 255, 255, 0.018) 42%,
      rgba(139, 92, 246, 0.055)
    ),
    rgba(13, 15, 29, 0.1);
}

:root[data-theme="light"] .create-prompt-panel::after {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.46),
      rgba(255, 255, 255, 0.12) 42%,
      rgba(109, 93, 252, 0.07)
    ),
    rgba(255, 255, 255, 0.12);
}

.prompt-input-box {
  background:
    radial-gradient(
      circle at 10% 0%,
      rgba(255, 255, 255, 0.14),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.082),
      rgba(255, 255, 255, 0.012) 38%,
      rgba(139, 92, 246, 0.052)
    ),
    rgba(14, 17, 32, 0.1);
}

:root[data-theme="light"] .prompt-input-box {
  background:
    radial-gradient(
      circle at 10% 0%,
      rgba(255, 255, 255, 0.5),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.34),
      rgba(255, 255, 255, 0.08) 38%,
      rgba(109, 93, 252, 0.055)
    ),
    rgba(255, 255, 255, 0.12);
}

.example-card {
  position: relative;
}

.home-example-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.example-card:hover .home-example-actions,
.example-card:focus-within .home-example-actions {
  opacity: 1;
  transform: translateY(0);
}

.home-example-actions .icon-button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: #fff;
  background: rgba(7, 8, 18, 0.58);
  backdrop-filter: blur(12px) saturate(1.22);
}

.home-example-actions .icon-button:hover {
  color: #fff;
  background: rgba(139, 92, 246, 0.72);
}

.home-example-actions .icon-button.danger:hover {
  background: rgba(244, 63, 94, 0.76);
}

.home-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.home-admin-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.home-admin-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.home-admin-card-body {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.home-admin-card-body strong {
  color: var(--ink);
  font-size: 14px;
}

.home-admin-card-body span,
.home-admin-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.hot-admin-row {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.hot-admin-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 950;
}

.hot-prompt-manage {
  width: 28px;
  min-width: 28px;
  padding: 0;
  justify-content: center;
}

.hot-prompt-manage .icon {
  width: 14px;
  height: 14px;
}

@media (hover: none) {
  .home-example-actions {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .quota-pill {
    min-height: 32px;
    padding: 0 10px;
  }

  .home-admin-grid {
    grid-template-columns: 1fr;
  }

  .hot-admin-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .hot-admin-row .admin-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #02040a;
  --page: #050814;
  --panel: #0b1020;
  --panel-strong: #11182a;
  --panel-muted: #0d1424;
  --ink: #f7fbff;
  --ink-soft: #d7e8ff;
  --muted: #8ea3bd;
  --faint: #60718a;
  --line: rgba(125, 211, 252, 0.16);
  --line-strong: rgba(125, 211, 252, 0.28);
  --brand: #38bdf8;
  --brand-strong: #60a5fa;
  --brand-soft: #071a36;
  --rose: #ff6bcb;
  --orange: #ff8a3d;
  --mint: #22d3ee;
  --green: #39ffb6;
  --yellow: #facc15;
  --lilac: #a78bfa;
  --slate: #94a3b8;
  --danger: #fb7185;
  --shadow: 0 22px 62px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.26);
  --sidebar: #050814;
  --toast: #f8fafc;
  --body-bg:
    radial-gradient(
      circle at 18% -8%,
      rgba(56, 189, 248, 0.2),
      transparent 32vw
    ),
    radial-gradient(
      circle at 86% 8%,
      rgba(167, 139, 250, 0.18),
      transparent 30vw
    ),
    radial-gradient(
      circle at 52% 112%,
      rgba(255, 107, 203, 0.11),
      transparent 36vw
    ),
    var(--bg);
  --shell-bg:
    linear-gradient(
      180deg,
      rgba(12, 18, 32, 0.7),
      rgba(5, 8, 20, 0.88) 460px,
      rgba(2, 4, 10, 0.96)
    ),
    linear-gradient(90deg, rgba(56, 189, 248, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  --nav-glass: rgba(5, 8, 20, 0.76);
  --bar-glass: rgba(11, 16, 32, 0.62);
  --dock-glass: color-mix(in srgb, var(--panel) 24%, transparent);
  --dock-inner:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0.025) 38%,
      rgba(56, 189, 248, 0.08)
    ),
    color-mix(in srgb, var(--panel) 22%, transparent);
  --pill-glass: rgba(11, 16, 32, 0.42);
  --preview-scrim: rgba(15, 23, 42, 0.16);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f8ff;
  --page: #eef4ff;
  --panel: #ffffff;
  --panel-strong: #f1f6ff;
  --panel-muted: #eaf2ff;
  --ink: #0c1728;
  --ink-soft: #21334d;
  --muted: #5f6f87;
  --faint: #8b9bb0;
  --line: rgba(29, 78, 137, 0.14);
  --line-strong: rgba(14, 116, 144, 0.24);
  --brand: #0284c7;
  --brand-strong: #2563eb;
  --brand-soft: #e6f6ff;
  --rose: #db2777;
  --orange: #ea580c;
  --mint: #0891b2;
  --green: #059669;
  --yellow: #ca8a04;
  --lilac: #7c3aed;
  --slate: #475569;
  --danger: #e11d48;
  --shadow: 0 22px 58px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.1);
  --sidebar: #ffffff;
  --toast: #0f172a;
  --body-bg:
    radial-gradient(
      circle at 18% -8%,
      rgba(14, 165, 233, 0.18),
      transparent 32vw
    ),
    radial-gradient(
      circle at 86% 8%,
      rgba(124, 58, 237, 0.12),
      transparent 30vw
    ),
    radial-gradient(
      circle at 52% 112%,
      rgba(219, 39, 119, 0.08),
      transparent 36vw
    ),
    var(--bg);
  --shell-bg:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.66),
      rgba(238, 244, 255, 0.84) 460px,
      rgba(245, 248, 255, 0.96)
    ),
    linear-gradient(90deg, rgba(2, 132, 199, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(2, 132, 199, 0.045) 1px, transparent 1px);
  --nav-glass: rgba(255, 255, 255, 0.78);
  --bar-glass: rgba(255, 255, 255, 0.72);
  --dock-glass: rgba(255, 255, 255, 0.24);
  --dock-inner:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.56),
      rgba(255, 255, 255, 0.22) 42%,
      rgba(14, 165, 233, 0.12)
    ),
    rgba(255, 255, 255, 0.18);
  --pill-glass: rgba(255, 255, 255, 0.58);
  --preview-scrim: rgba(15, 23, 42, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #02040a;
    --page: #050814;
    --panel: #0b1020;
    --panel-strong: #11182a;
    --panel-muted: #0d1424;
    --ink: #f7fbff;
    --ink-soft: #d7e8ff;
    --muted: #8ea3bd;
    --faint: #60718a;
    --line: rgba(125, 211, 252, 0.16);
    --line-strong: rgba(125, 211, 252, 0.28);
    --brand: #38bdf8;
    --brand-strong: #60a5fa;
    --brand-soft: #071a36;
    --rose: #ff6bcb;
    --orange: #ff8a3d;
    --mint: #22d3ee;
    --green: #39ffb6;
    --yellow: #facc15;
    --lilac: #a78bfa;
    --slate: #94a3b8;
    --danger: #fb7185;
    --shadow: 0 22px 62px rgba(0, 0, 0, 0.42);
    --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.26);
    --sidebar: #050814;
    --toast: #f8fafc;
    --body-bg:
      radial-gradient(
        circle at 18% -8%,
        rgba(56, 189, 248, 0.2),
        transparent 32vw
      ),
      radial-gradient(
        circle at 86% 8%,
        rgba(167, 139, 250, 0.18),
        transparent 30vw
      ),
      radial-gradient(
        circle at 52% 112%,
        rgba(255, 107, 203, 0.11),
        transparent 36vw
      ),
      var(--bg);
    --shell-bg:
      linear-gradient(
        180deg,
        rgba(12, 18, 32, 0.7),
        rgba(5, 8, 20, 0.88) 460px,
        rgba(2, 4, 10, 0.96)
      ),
      linear-gradient(90deg, rgba(56, 189, 248, 0.06) 1px, transparent 1px),
      linear-gradient(0deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
    --nav-glass: rgba(5, 8, 20, 0.76);
    --bar-glass: rgba(11, 16, 32, 0.62);
    --dock-glass: color-mix(in srgb, var(--panel) 24%, transparent);
    --dock-inner:
      linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.025) 38%,
        rgba(56, 189, 248, 0.08)
      ),
      color-mix(in srgb, var(--panel) 22%, transparent);
    --pill-glass: rgba(11, 16, 32, 0.42);
    --preview-scrim: rgba(15, 23, 42, 0.16);
  }
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    color-scheme: light;
    --bg: #f5f8ff;
    --page: #eef4ff;
    --panel: #ffffff;
    --panel-strong: #f1f6ff;
    --panel-muted: #eaf2ff;
    --ink: #0c1728;
    --ink-soft: #21334d;
    --muted: #5f6f87;
    --faint: #8b9bb0;
    --line: rgba(29, 78, 137, 0.14);
    --line-strong: rgba(14, 116, 144, 0.24);
    --brand: #0284c7;
    --brand-strong: #2563eb;
    --brand-soft: #e6f6ff;
    --rose: #db2777;
    --orange: #ea580c;
    --mint: #0891b2;
    --green: #059669;
    --yellow: #ca8a04;
    --lilac: #7c3aed;
    --slate: #475569;
    --danger: #e11d48;
    --shadow: 0 22px 58px rgba(15, 23, 42, 0.12);
    --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.1);
    --sidebar: #ffffff;
    --toast: #0f172a;
    --body-bg:
      radial-gradient(
        circle at 18% -8%,
        rgba(14, 165, 233, 0.18),
        transparent 32vw
      ),
      radial-gradient(
        circle at 86% 8%,
        rgba(124, 58, 237, 0.12),
        transparent 30vw
      ),
      radial-gradient(
        circle at 52% 112%,
        rgba(219, 39, 119, 0.08),
        transparent 36vw
      ),
      var(--bg);
    --shell-bg:
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.66),
        rgba(238, 244, 255, 0.84) 460px,
        rgba(245, 248, 255, 0.96)
      ),
      linear-gradient(90deg, rgba(2, 132, 199, 0.055) 1px, transparent 1px),
      linear-gradient(0deg, rgba(2, 132, 199, 0.045) 1px, transparent 1px);
    --nav-glass: rgba(255, 255, 255, 0.78);
    --bar-glass: rgba(255, 255, 255, 0.72);
    --dock-glass: rgba(255, 255, 255, 0.24);
    --dock-inner:
      linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.56),
        rgba(255, 255, 255, 0.22) 42%,
        rgba(14, 165, 233, 0.12)
      ),
      rgba(255, 255, 255, 0.18);
    --pill-glass: rgba(255, 255, 255, 0.58);
    --preview-scrim: rgba(15, 23, 42, 0.1);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  touch-action: pan-x pan-y;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--body-bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  min-height: 100vh;
  background: var(--shell-bg);
  background-size:
    auto,
    48px 48px,
    48px 48px;
}

body[data-view="create"] .app-shell {
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 70px;
  padding: 12px max(24px, calc((100vw - 1360px) / 2 + 24px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  background: var(--nav-glass);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(125, 211, 252, 0.08);
  backdrop-filter: blur(22px) saturate(1.25);
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
}

body[data-view="create"] .workspace {
  height: calc(100dvh - 118px);
  min-height: 0;
  overflow: hidden;
}

.topbar {
  width: min(1360px, calc(100% - 48px));
  min-height: 68px;
  margin: 14px auto 0;
  padding: 12px;
  display: grid;
  grid-template-columns: auto;
  justify-content: end;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bar-glass);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(24px) saturate(1.22);
  z-index: 10;
}

.page {
  flex: 1;
  width: min(1360px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 268px;
}

body[data-view="create"] .page {
  overflow: hidden;
}

.mobile-nav {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 176px;
  padding: 0;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: transparent;
  box-shadow: var(--shadow-soft);
}

.brand-mark {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

.brand-title {
  font-size: 18px;
  font-weight: 950;
  line-height: 1.1;
}

.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nav-list {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.nav-item {
  width: auto;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: color-mix(in srgb, var(--panel-strong) 72%, transparent);
  color: var(--ink);
  border-color: var(--line);
}

.nav-item.active {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 24%, var(--line));
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--brand) 52%, transparent);
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-card {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.side-card-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

.side-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  word-break: break-all;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--faint);
  display: inline-block;
}

.status-dot.ok {
  background: var(--green);
}

.status-dot.warn {
  background: var(--orange);
}

.status-dot.bad {
  background: var(--danger);
}

.header-health {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 3px 10px 3px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: color-mix(in srgb, var(--panel-strong) 78%, transparent);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.header-health > span:not(.status-dot) + span:not(.status-dot)::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 12px;
  margin-right: 9px;
  vertical-align: -2px;
  background: var(--line-strong);
}

.searchbox {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.searchbox .icon {
  position: absolute;
  left: 13px;
  color: var(--muted);
}

.searchbox input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
}

.searchbox input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  backdrop-filter: blur(12px);
}

.theme-switch.compact {
  min-height: 32px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 58%, transparent);
}

.theme-switch.compact .theme-toggle {
  min-height: 26px;
  padding: 0 8px;
}

.theme-toggle {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.theme-toggle .icon {
  width: 15px;
  height: 15px;
}

.theme-toggle:hover,
.theme-toggle.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.avatar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.avatar-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand), var(--mint));
}

.avatar-text {
  min-width: 82px;
}

.avatar-name {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
}

.avatar-role {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.icon-button:hover {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
}

.section {
  margin-bottom: 28px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-kicker {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.section-title {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 900;
}

.section-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 18px;
  align-items: stretch;
}

.hero-banner {
  min-height: 328px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.hero-banner img {
  width: 100%;
  height: 100%;
  min-height: 328px;
  object-fit: cover;
}

.hero-copy {
  position: absolute;
  inset: auto 18px 18px 18px;
  max-width: 560px;
  padding: 16px;
  color: #fff;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
}

.hero-copy h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.hero-copy p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 700;
  line-height: 1.5;
}

.hero-tools {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.hero-panel {
  display: grid;
  gap: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.panel-card,
.result-card,
.setting-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 16, 32, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 16px 38px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(22px) saturate(1.18);
}

.metric-value {
  font-size: 24px;
  font-weight: 900;
}

.metric-label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(430px, 0.82fr);
  grid-template-areas:
    "copy composer"
    "stats composer";
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(
      circle at 18% 18%,
      rgba(56, 189, 248, 0.18),
      transparent 34%
    ),
    radial-gradient(
      circle at 88% 20%,
      rgba(167, 139, 250, 0.16),
      transparent 30%
    ),
    linear-gradient(
      135deg,
      rgba(12, 20, 38, 0.82),
      rgba(5, 9, 19, 0.72) 58%,
      rgba(22, 8, 31, 0.68)
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 48px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(18px) saturate(1.22);
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background:
    linear-gradient(
      90deg,
      transparent 0 31px,
      color-mix(in srgb, var(--line) 72%, transparent) 32px
    ),
    linear-gradient(
      0deg,
      transparent 0 31px,
      color-mix(in srgb, var(--line) 72%, transparent) 32px
    );
  background-size: 32px 32px;
  pointer-events: none;
}

.home-hero-copy,
.home-quick-panel,
.home-composer,
.home-stats {
  position: relative;
}

.home-hero-copy {
  grid-area: copy;
  align-self: center;
  max-width: 650px;
}

.brand-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: 999px;
  color: var(--brand);
  background: color-mix(in srgb, var(--panel) 78%, var(--brand-soft));
  font-size: 13px;
  font-weight: 950;
}

.home-hero-copy h1 {
  max-width: 12.5em;
  margin: 18px 0 0;
  color: var(--ink);
  font-size: 42px;
  line-height: 1.08;
  font-weight: 950;
}

.home-hero-copy p {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 760;
}

.home-quick-panel,
.home-composer {
  grid-area: composer;
  align-self: stretch;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, var(--brand));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.composer-mode-row {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.composer-mode {
  min-height: 36px;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 950;
}

.composer-mode.active {
  color: var(--brand);
  background: var(--panel);
  box-shadow: 0 6px 16px rgba(16, 32, 29, 0.08);
}

.home-prompt {
  width: 100%;
  min-height: 136px;
  max-height: 190px;
  resize: vertical;
  padding: 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: var(--panel);
  line-height: 1.6;
  font-weight: 760;
}

.home-prompt:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}

.prompt-tip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.prompt-tip {
  min-height: 36px;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--panel-strong);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 850;
}

.prompt-tip:hover {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
  background: var(--brand-soft);
}

.composer-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.home-stats {
  grid-area: stats;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.home-stats .metric-card {
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  backdrop-filter: blur(12px);
}

:root[data-theme="dark"] .home-hero {
  background: linear-gradient(135deg, #132821, var(--panel) 58%, #241723);
}

:root[data-theme="dark"] .home-hero-bg {
  opacity: 0.22;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .home-hero {
    background: linear-gradient(135deg, #132821, var(--panel) 58%, #241723);
  }

  :root[data-theme="system"] .home-hero-bg {
    opacity: 0.22;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: var(--radius);
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--panel) 64%, var(--panel-strong));
  border: 1px solid var(--line);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(16, 32, 29, 0.04);
}

.button:hover {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
}

.button.primary {
  color: #fff;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--brand) 92%, #fff),
    var(--brand-strong)
  );
  border-color: color-mix(in srgb, var(--brand) 74%, var(--line));
}

.button.primary:hover {
  color: #fff;
  background: var(--brand-strong);
}

.button.ghost {
  background: transparent;
}

.button.danger {
  color: var(--danger);
}

.chips,
.toolbar-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  min-height: 32px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.chip.active {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
}

.chip.small {
  min-height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.collection-card,
.example-card,
.work-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: 0 1px 0 rgba(16, 32, 29, 0.04);
  text-align: left;
  backdrop-filter: blur(12px);
}

.collection-card:hover,
.example-card:hover,
.work-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  transition:
    transform 0.16s ease,
    border-color 0.16s ease;
}

.cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--panel-strong);
  overflow: hidden;
}

.cover.tall {
  aspect-ratio: 3 / 4;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 36px 12px 12px;
  color: #fff;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.72), transparent);
  z-index: 1;
}

.cover-action {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  color: #fff;
  background: rgba(15, 23, 42, 0.68);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(12px);
  font-size: 13px;
  font-weight: 950;
  opacity: 0;
  transform: translate(-50%, -42%);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 3;
}

.same-style-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--preview-scrim);
  opacity: 0;
  transition: opacity 0.16s ease;
  z-index: 2;
}

.same-style-cover:hover::after,
.same-style-cover:focus-visible::after {
  opacity: 1;
}

.same-style-cover:hover .cover-action,
.same-style-cover:focus-visible .cover-action {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.inspiration-card-label {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 4;
  max-width: calc(100% - 20px);
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.68);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  opacity: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateY(-4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.inspiration-cover .cover-action {
  left: 10px;
  right: 10px;
  top: auto;
  bottom: 10px;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius);
  color: #141a24;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(14px) saturate(1.15);
  opacity: 0;
  transform: translateY(8px);
}

.inspiration-cover .cover-action .icon {
  color: var(--rose);
}

.same-style-cover:hover .inspiration-card-label,
.same-style-cover:focus-visible .inspiration-card-label {
  opacity: 1;
  transform: translateY(0);
}

.inspiration-cover:hover .cover-action,
.inspiration-cover:focus-visible .cover-action {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: none) {
  .inspiration-card-label,
  .inspiration-cover .cover-action {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-body {
  padding: 12px;
}

.card-title {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
  font-weight: 900;
}

.card-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 750;
}

.prompt-line {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.inspiration-grid {
  display: block;
  column-width: 270px;
  column-gap: 22px;
}

.inspiration-grid .example-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 22px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}

.inspiration-grid .example-card:hover {
  transform: none;
  border-color: transparent;
}

.inspiration-cover,
.inspiration-grid .cover,
.inspiration-grid .cover.tall {
  aspect-ratio: auto;
  border-radius: 12px;
  background: transparent;
}

.inspiration-cover img,
.inspiration-grid .cover img {
  height: auto;
  object-fit: unset;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.work-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.work-mini-action {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
}

.work-mini-action .icon {
  width: 15px;
  height: 15px;
}

.create-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.88fr) minmax(0, 1.12fr);
  gap: 18px;
  align-items: start;
}

.create-grid-floating {
  padding-bottom: 140px;
}

.composer-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.panel-card .section-kicker + .compact-status {
  margin-top: 12px;
}

.prompt-input {
  width: 100%;
  min-height: 96px;
  max-height: 132px;
  resize: vertical;
  padding: 14px;
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  line-height: 1.55;
  font-weight: 700;
}

.prompt-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 17%, transparent);
}

.prompt-input-box {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 104px;
  padding: 4px 3px 3px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.create-prompt-panel:not(.compact-prompt-panel):focus-within {
  border-color: color-mix(in srgb, var(--brand) 62%, var(--line));
  box-shadow:
    0 20px 48px rgba(14, 165, 233, 0.18),
    0 12px 36px rgba(16, 32, 29, 0.12),
    0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent),
    0 0 30px rgba(56, 189, 248, 0.16);
}

.create-prompt-dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 70;
  width: min(860px, calc(100vw - 56px));
  transform: translateX(-50%);
  pointer-events: none;
}

.create-prompt-panel {
  --prompt-dock-radius: 24px;
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: var(--prompt-dock-radius);
  background: var(--dock-glass);
  box-shadow:
    0 18px 46px rgba(14, 165, 233, 0.12),
    0 10px 34px rgba(16, 32, 29, 0.08);
  backdrop-filter: blur(36px) saturate(1.62) contrast(1.04);
  pointer-events: auto;
}

.create-prompt-panel::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 130%;
  aspect-ratio: 1;
  background: conic-gradient(
    from 0deg,
    rgba(56, 189, 248, 0),
    rgba(56, 189, 248, 0),
    rgba(59, 130, 246, 0.95),
    rgba(34, 211, 238, 0.92),
    rgba(56, 189, 248, 0),
    rgba(56, 189, 248, 0)
  );
  transform: translate(-50%, -50%);
  animation: promptBorderSpin 4.5s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.create-prompt-panel::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--prompt-dock-radius) - 1px);
  background: var(--dock-inner);
  backdrop-filter: blur(30px) saturate(1.58);
  pointer-events: none;
  z-index: 1;
}

.create-prompt-panel > * {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.create-prompt-panel:not(.compact-prompt-panel) {
  --prompt-dock-radius: 32px;
  overflow: visible;
  border-color: rgba(125, 211, 252, 0.34);
  background:
    linear-gradient(
      156deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0.02) 42%,
      rgba(56, 189, 248, 0.04)
    ),
    rgba(8, 12, 24, 0.58);
  box-shadow:
    0 18px 44px rgba(14, 165, 233, 0.14),
    0 10px 30px rgba(16, 32, 29, 0.12),
    0 0 22px rgba(56, 189, 248, 0.1);
  backdrop-filter: blur(32px) saturate(1.32) contrast(1.02);
}

.create-prompt-panel:not(.compact-prompt-panel)::before {
  inset: -1.5px;
  left: auto;
  top: auto;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  padding: 1.5px;
  border-radius: inherit;
  transform: none;
  background: conic-gradient(
    from 0deg,
    rgba(56, 189, 248, 0) 0deg,
    rgba(56, 189, 248, 0) 60deg,
    rgba(59, 130, 246, 0.98) 135deg,
    rgba(34, 211, 238, 0.96) 210deg,
    rgba(167, 139, 250, 0.92) 285deg,
    rgba(56, 189, 248, 0) 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.36))
    drop-shadow(0 0 14px rgba(59, 130, 246, 0.18));
  opacity: 0.9;
  animation:
    promptBorderSpinRing 4.8s linear infinite,
    promptPanelGlowPulse 2.9s ease-in-out infinite;
}

.create-prompt-panel:not(.compact-prompt-panel)::after {
  content: none;
}

@keyframes promptBorderSpin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes promptBorderSpinRing {
  to {
    transform: rotate(360deg);
  }
}

@keyframes promptPanelGlowPulse {
  0%,
  100% {
    opacity: 0.74;
    filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.22))
      drop-shadow(0 0 10px rgba(59, 130, 246, 0.1));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.44))
      drop-shadow(0 0 18px rgba(59, 130, 246, 0.2));
  }
}

@keyframes promptCompactBreath {
  0%,
  100% {
    opacity: 0.62;
    transform: scale(0.997);
    filter: drop-shadow(0 0 5px rgba(120, 215, 255, 0.22))
      drop-shadow(0 0 12px rgba(96, 165, 250, 0.12));
  }
  50% {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 10px rgba(120, 215, 255, 0.52))
      drop-shadow(0 0 22px rgba(167, 139, 250, 0.24));
  }
}

.create-dock-status {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.create-dock-status::-webkit-scrollbar {
  display: none;
}

.hot-prompt-row {
  display: flex;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  white-space: nowrap;
}

.hot-prompt-row::-webkit-scrollbar {
  display: none;
}

.hot-prompt {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: 999px;
  color: color-mix(in srgb, var(--ink-soft) 78%, var(--brand));
  background: var(--pill-glass);
  font-size: 11px;
  font-weight: 850;
}

.hot-prompt:hover {
  color: #fff;
  background: rgba(56, 189, 248, 0.14);
  border-color: color-mix(in srgb, var(--brand) 56%, var(--line));
}

.hot-prompt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hot-prompt-toggle .icon {
  width: 12px;
  height: 12px;
}

.prompt-input-floating {
  min-height: 44px;
  max-height: 184px;
  padding: 10px 12px 4px;
  border: 0;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow-y: hidden;
  resize: none;
  caret-color: #fff;
  box-sizing: border-box;
}

.prompt-input-floating::placeholder {
  color: #fff;
  opacity: 1;
}

.prompt-input-hint {
  position: absolute;
  top: 14px;
  left: 15px;
  right: 19px;
  color: rgba(214, 195, 174, 0.74);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 1;
  transition: opacity 160ms ease;
  z-index: 1;
}

.prompt-input-floating:not(:placeholder-shown) + .prompt-input-hint,
.prompt-input-hint.is-hidden {
  opacity: 0;
}

.prompt-input-floating:focus {
  box-shadow: none;
}

.compact-prompt-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

.compact-prompt-panel::before,
.compact-prompt-panel::after {
  content: none;
}

.create-prompt-dock.desktop-collapsed {
  width: clamp(172px, 22vw, 210px);
}

.prompt-compact {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 92px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(13, 18, 34, 0.62), rgba(8, 12, 24, 0.44)),
    rgba(10, 14, 28, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 24px rgba(2, 8, 23, 0.18);
}

.prompt-compact::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1.4px;
  border-radius: 18px;
  background: linear-gradient(
    120deg,
    rgba(120, 215, 255, 0.98) 0%,
    rgba(96, 165, 250, 0.92) 30%,
    rgba(167, 139, 250, 0.9) 62%,
    rgba(74, 222, 255, 0.96) 100%
  );
  background-size: 200% 200%;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: promptCompactBreath 2.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.prompt-compact > * {
  position: relative;
  z-index: 2;
}

.prompt-compact-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
  text-align: left;
}

.prompt-compact-label {
  display: block;
  overflow: hidden;
  color: rgba(244, 247, 255, 0.94);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.32;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.prompt-compact-hint {
  color: rgba(226, 233, 255, 0.56);
  font-size: 11px;
  line-height: 1.2;
}

.prompt-compact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(240, 244, 255, 0.86);
}

.prompt-compact-icon .icon {
  width: 18px;
  height: 18px;
}

.dock-reference-row,
.dock-ratio-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

.dock-reference-stack {
  flex: 0 0 auto;
  position: relative;
  width: var(--dock-control-width);
  min-width: var(--dock-control-width);
  max-width: var(--dock-control-width);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  overflow: visible;
}

.dock-control-strip {
  flex: 1 1 0;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: var(--dock-control-gap);
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

.dock-control-strip::-webkit-scrollbar {
  display: none;
}

.dock-reference-row {
  flex: 0 0 auto;
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  width: max-content;
  max-width: min(320px, calc(100vw - 64px));
  padding: 6px 6px 0 0;
  overflow-x: auto;
  overflow-y: visible;
}

.dock-ratio-row {
  flex: 0 0 auto;
  max-width: min(330px, 42vw);
}

.dock-reference-row::-webkit-scrollbar,
.dock-ratio-row::-webkit-scrollbar {
  display: none;
}

.dock-reference-item {
  position: relative;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  aspect-ratio: 1;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--pill-glass);
}

.dock-reference-thumb {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: zoom-in;
}

.dock-reference-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.dock-reference-thumb:hover img,
.dock-reference-thumb:focus-visible img {
  transform: scale(1.045);
  filter: saturate(1.04) contrast(1.02);
}

.dock-reference-badge {
  position: absolute;
  bottom: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(2, 4, 10, 0.9);
  box-shadow: 0 4px 10px rgba(2, 4, 10, 0.28);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
  transform: none;
}

.dock-reference-remove {
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  padding: 0;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(220, 38, 38, 0.94);
  box-shadow: 0 6px 14px rgba(127, 29, 29, 0.34);
  z-index: 3;
  transform: translate(22%, -22%);
}

.dock-reference-remove:hover,
.dock-reference-remove:focus-visible {
  color: #fff;
  background: rgba(239, 68, 68, 0.98);
}

.dock-reference-remove .icon {
  width: 10px;
  height: 10px;
  display: block;
  margin: 0;
}

.dock-ratio {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--pill-glass);
  font-size: 11px;
  font-weight: 900;
}

.dock-upload-button {
  flex: 0 0 auto;
  width: var(--dock-control-width);
  min-width: var(--dock-control-width);
  height: var(--dock-control-height);
  min-height: var(--dock-control-height);
  padding: 0 12px;
  box-sizing: border-box;
  border-radius: 999px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  justify-content: center;
}

.dock-reference-stack .dock-upload-button {
  width: var(--dock-control-width);
  min-width: var(--dock-control-width);
  align-self: flex-start;
}

.dock-reference-stack.upload-only {
  width: var(--dock-control-width);
  max-width: var(--dock-control-width);
}

.dock-upload-button .icon {
  width: 16px;
  height: 16px;
}

.ratio-select-pill {
  position: relative;
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 30px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.ratio-select-pill::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-64%) rotate(45deg);
  pointer-events: none;
}

.ratio-select-pill select {
  max-width: 84px;
  border: 0;
  outline: 0;
  appearance: none;
  color: var(--ink);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.dock-ratio.active {
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.34),
    rgba(167, 139, 250, 0.22)
  );
  border-color: color-mix(in srgb, var(--brand) 64%, var(--line));
}

.create-prompt-actions {
  --dock-control-width: 100px;
  --dock-control-height: 34px;
  --dock-control-gap: 6px;
  width: 100%;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--dock-control-gap);
  flex-wrap: nowrap;
}

.square-button {
  min-width: 38px;
  padding: 0;
}

.count-stepper {
  width: var(--dock-control-width);
  min-width: var(--dock-control-width);
  height: var(--dock-control-height);
  min-height: var(--dock-control-height);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
  padding: 0 8px 0 10px;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--pill-glass);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.count-stepper-label {
  color: var(--muted);
}

.count-stepper strong {
  min-width: 16px;
  text-align: center;
  color: var(--ink);
  font-size: 14px;
  line-height: 1;
}

.count-stepper-buttons {
  display: grid;
  gap: 1px;
  margin-left: auto;
}

.count-stepper button {
  width: 22px;
  height: 14px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 70%, transparent);
}

.count-stepper button:hover {
  color: #fff;
  background: var(--brand);
}

.count-stepper button:disabled {
  opacity: 0.42;
}

.count-stepper .icon {
  width: 13px;
  height: 13px;
}

.create-submit-button {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0;
  border-radius: 50%;
  box-shadow: 0 14px 28px color-mix(in srgb, var(--brand) 26%, transparent);
}

.create-submit-button .icon {
  width: 20px;
  height: 20px;
}

.compact-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.reference-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.reference-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reference-item button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(15, 23, 42, 0.68);
}

.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.results-stack {
  display: grid;
  gap: 14px;
}

.my-history-section {
  grid-template-columns: 1fr;
}

.my-history-section > .result-head,
.my-history-section > .empty-state {
  grid-column: 1 / -1;
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.result-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.result-delete-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
}

.result-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.result-images {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.history-result-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 4px;
  align-items: start;
}

.history-result-images {
  margin-top: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 4px;
  align-content: start;
  height: 132px;
}

.history-result-images[data-count="1"] {
  grid-template-columns: minmax(0, 1fr);
}

.history-result-images .image-tile {
  min-width: 0;
  height: 100%;
  aspect-ratio: auto;
}

.history-result-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-content: start;
  padding-top: 0;
  margin-left: -1px;
}

.history-result-head {
  display: grid;
  justify-content: start;
  gap: 4px;
  align-items: start;
}

.history-result-head .card-title {
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.history-result-head > div:first-child {
  min-width: 0;
}

.history-result-head .result-head-actions {
  display: inline-flex;
  justify-content: flex-start;
  gap: 6px;
  flex-shrink: 0;
}

.image-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  aspect-ratio: 1;
}

.image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-tile .tile-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  background: var(--panel-strong);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid color-mix(in srgb, var(--brand) 24%, transparent);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
  background: var(--panel-strong);
}

.state-pill.success {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 13%, transparent);
}

.state-pill.loading {
  color: var(--brand);
  background: var(--brand-soft);
}

.state-pill.error {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 13%, transparent);
}

.empty-state {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
  margin-bottom: 8px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  outline: 0;
  font-weight: 750;
}

.field input[type="checkbox"],
.field input[type="radio"] {
  width: auto;
  height: auto;
  min-height: 0;
  background: transparent;
  border: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}

.field textarea {
  min-height: 96px;
  padding: 12px;
  line-height: 1.55;
  resize: vertical;
}

.admin-panel.wide {
  grid-column: 1 / -1;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.admin-row img {
  width: 88px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

.admin-row strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.admin-row p {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.category-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.admin-category-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.admin-category-card .cover {
  width: 100%;
}

.admin-dialog {
  width: min(920px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  padding: 0;
  border: 0;
  overflow: hidden;
  border-radius: 28px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

dialog:not([open]) {
  display: none !important;
}

.admin-dialog--managed-user,
.admin-dialog--account-profile {
  width: min(456px, calc(100vw - 32px));
}

.admin-dialog--confirm {
  width: min(420px, calc(100vw - 32px));
}

.admin-dialog::backdrop {
  background: rgba(8, 13, 23, 0.58);
  backdrop-filter: blur(8px);
}

.login-dialog::backdrop {
  background: rgba(8, 13, 23, 0.5);
  backdrop-filter: none;
}

.login-dialog {
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border-radius: 22px;
}

.admin-editor {
  padding: 18px;
}

.admin-dialog .admin-editor-head .icon-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
}

.login-dialog .admin-editor {
  padding: 0;
}

.login-dialog .yanai-auth-card {
  position: relative;
  gap: 20px;
  padding: 26px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, var(--brand) 18%);
  border-radius: 22px;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 18px 44px -34px rgba(2, 6, 23, 0.55);
}

.login-dialog .yanai-auth-head {
  justify-content: flex-start;
  padding: 0;
  text-align: left;
}

.yanai-auth-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.yanai-auth-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: none;
  font-size: 20px;
  font-weight: 900;
}

.yanai-auth-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.yanai-auth-logo .icon {
  width: 34px;
  height: 34px;
  stroke-width: 2.4;
}

.login-dialog .yanai-auth-head .section-kicker {
  display: none;
  color: #a8a29e;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-dialog .yanai-auth-head .section-title {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  font-weight: 880;
  line-height: 1.12;
  letter-spacing: 0;
}

.login-dialog .yanai-auth-head .section-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.login-dialog .auth-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.auth-dialog-shell {
  display: grid;
  align-content: start;
  gap: 14px;
}

.admin-editor-head.auth-dialog-head {
  padding-bottom: 8px;
  margin-bottom: 0;
}

.auth-dialog-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.login-dialog .auth-dialog-tabs {
  gap: 6px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-strong) 86%, var(--brand-soft) 14%);
}

.auth-dialog-tabs .button {
  height: 42px;
  min-height: 42px;
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  line-height: 1;
  white-space: nowrap;
}

.login-dialog .auth-dialog-tabs .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 760;
  box-shadow: none;
}

.login-dialog .auth-dialog-tabs .button:hover,
.login-dialog .auth-dialog-tabs .button:focus-visible {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.login-dialog .auth-dialog-tabs .button.primary {
  color: var(--brand);
  background: color-mix(in srgb, var(--panel) 92%, #fff 8%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent);
}

.login-dialog .auth-dialog-tabs .button.primary:hover,
.login-dialog .auth-dialog-tabs .button.primary:focus-visible {
  color: var(--brand);
  background: color-mix(in srgb, var(--panel) 92%, #fff 8%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent);
  transform: none;
}

.account-overview-tabs .button:hover,
.account-overview-tabs .button:focus-visible {
  transform: none;
}

.login-dialog .auth-dialog-tabs .button .icon {
  width: 17px;
  height: 17px;
}

.auth-dialog-grid {
  gap: 14px;
}

.login-dialog .auth-dialog-grid {
  gap: 18px;
}

.login-dialog .field {
  display: grid;
  gap: 0;
}

.login-dialog .field label {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  white-space: normal;
}

.login-dialog .field input,
.login-dialog .auth-challenge-box {
  min-height: 48px;
  border-color: color-mix(in srgb, var(--line) 84%, var(--brand) 16%);
  border-radius: 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel-strong) 90%, transparent);
  box-shadow: none;
  font-size: 14px;
  font-weight: 620;
}

.login-dialog .field input {
  padding: 0 14px;
}

.login-dialog .field input::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.login-dialog .field input:focus,
.login-dialog .auth-challenge-box:focus-within {
  border-color: var(--brand);
  box-shadow: none;
}

.login-dialog .button.primary {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  font-size: 14px;
  font-weight: 850;
  box-shadow: none;
}

.login-dialog .button.primary:hover:not(:disabled),
.login-dialog .button.primary:focus-visible {
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
}

.login-dialog .auth-dialog-tabs .button,
.login-dialog .auth-dialog-tabs .button:hover,
.login-dialog .auth-dialog-tabs .button:focus-visible {
  color: #667085 !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.login-dialog .auth-dialog-tabs .button.primary,
.login-dialog .auth-dialog-tabs .button.primary:hover,
.login-dialog .auth-dialog-tabs .button.primary:focus-visible {
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong)) !important;
  border-color: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.login-dialog .auth-dialog-tabs .button.primary .icon,
.login-dialog .auth-dialog-tabs .button.primary span {
  color: #ffffff !important;
}

.login-dialog .auth-submit-row .button {
  width: 100%;
  min-width: 0;
}

.auth-admin-key-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.login-dialog .auth-admin-key-panel {
  padding-top: 0;
  border-top: 0;
}

.login-dialog .yanai-auth-admin-panel {
  gap: 14px;
}

.auth-admin-key-panel .toolbar-row {
  justify-content: flex-start;
}

.auth-admin-key-panel .button {
  min-height: 42px;
}

.auth-challenge-field {
  gap: 10px;
}

.auth-challenge-inline {
  display: block;
}

.auth-challenge-box {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: none;
  overflow: hidden;
}

.auth-challenge-inline input {
  flex: 1 1 auto;
  min-height: 38px;
  min-width: 0;
  height: 44px;
  padding: 0 142px 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.auth-challenge-box:focus-within {
  border-color: var(--brand);
}

.auth-challenge-inline input:focus {
  box-shadow: none;
}

.auth-challenge-badge {
  position: absolute;
  top: 5px;
  right: 48px;
  width: 92px;
  min-width: 92px;
  height: 34px;
  min-height: 34px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(65, 77, 94, 0.46);
  border-radius: 0;
  background: color-mix(in srgb, var(--panel) 72%, #ffffff 8%);
  color: #172033;
  box-shadow: none;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
}

.auth-challenge-badge.is-image {
  width: 92px;
  min-width: 92px;
  height: 34px;
  padding: 0;
  overflow: hidden;
}

.auth-challenge-image {
  width: 100%;
  height: 34px;
  display: block;
  object-fit: cover;
  background: var(--panel);
}

.auth-challenge-badge.is-loading,
.auth-challenge-badge.is-error {
  min-width: 92px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.01em;
  color: #4b5563;
}

.auth-challenge-refresh {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.auth-challenge-refresh:hover:not(:disabled),
.auth-challenge-refresh:focus-visible {
  border-color: rgba(186, 198, 216, 0.38);
  background: color-mix(in srgb, var(--brand-soft) 26%, transparent);
  color: var(--ink);
  transform: rotate(10deg);
}

.auth-challenge-refresh:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.auth-challenge-refresh .icon {
  width: 16px;
  height: 16px;
}

.login-dialog .auth-challenge-badge {
  top: 4px;
  right: 44px;
  width: 142px;
  min-width: 142px;
  height: 36px;
  min-height: 36px;
  border-color: color-mix(in srgb, var(--line) 84%, var(--brand) 16%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, #fff 12%);
  color: var(--ink);
  font-size: 12px;
}

.login-dialog .auth-challenge-badge.is-image {
  width: 142px;
  min-width: 142px;
  height: 36px;
}

.login-dialog .auth-challenge-image {
  height: 36px;
  object-fit: contain;
}

.login-dialog .auth-challenge-refresh {
  width: 42px;
  min-width: 42px;
  height: 48px;
  color: var(--muted);
  transition: none;
}

.login-dialog .auth-challenge-inline input {
  height: 46px;
  min-height: 46px;
  padding: 0 192px 0 14px;
  font-size: 14px;
  font-weight: 620;
}

.login-dialog .button,
.login-dialog input,
.login-dialog select,
.login-dialog textarea,
.login-dialog .auth-challenge-badge,
.login-dialog .auth-challenge-refresh {
  transition: none;
}

.login-dialog .auth-challenge-refresh:hover:not(:disabled),
.login-dialog .auth-challenge-refresh:focus-visible {
  transform: none;
}

.auth-code-field {
  gap: 10px;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.auth-code-row .button {
  min-width: 158px;
  white-space: nowrap;
}

.auth-code-note {
  margin: 0;
}

.login-dialog .auth-code-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.auth-error-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 99, 132, 0.24);
  border-radius: 14px;
  color: #ffb5c6;
  background: rgba(255, 99, 132, 0.08);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.login-dialog .auth-error-note {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
  color: color-mix(in srgb, var(--danger) 82%, var(--ink));
  background: color-mix(in srgb, var(--danger) 10%, var(--panel));
}

.auth-dialog-close {
  flex: 0 0 auto;
  border-radius: 999px;
}

.auth-inline-actions {
  justify-content: flex-start;
}

.auth-submit-row {
  justify-content: center;
  margin-top: 4px;
}

.login-dialog .auth-submit-row {
  margin-top: 4px;
}

.auth-submit-row .button {
  min-width: 148px;
  max-width: 100%;
}

.auth-admin-nav-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: -4px;
}

.auth-subtle-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-strong) 70%, transparent);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.auth-subtle-back-btn:hover {
  color: var(--ink);
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 25%, transparent);
}

.auth-subtle-back-btn .icon {
  width: 14px;
  height: 14px;
}

.yanai-auth-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding-top: 6px;
}

.auth-admin-entry-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, var(--muted) 65%, transparent);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}

.auth-admin-entry-btn:hover,
.auth-admin-entry-btn:focus-visible {
  color: var(--muted);
  background: color-mix(in srgb, var(--panel-strong) 80%, transparent);
}

.auth-admin-entry-btn .icon {
  width: 13px;
  height: 13px;
  opacity: 0.8;
}

.yanai-auth-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.yanai-auth-switch.auth-switch-centered {
  display: flex;
  justify-content: center;
  margin-top: 4px;
  padding-top: 6px;
}

.yanai-auth-switch button {
  padding: 0;
  border: 0;
  color: var(--brand);
  background: transparent;
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.yanai-auth-switch button:hover,
.yanai-auth-switch button:focus-visible {
  color: var(--brand-strong);
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 640px) {
  .login-dialog {
    width: min(500px, calc(100vw - 20px));
  }

  .login-dialog .yanai-auth-card {
    gap: 16px;
    padding: 24px 18px 20px;
  }

  .yanai-auth-logo {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    border-radius: 18px;
  }

  .login-dialog .yanai-auth-head .section-title {
    font-size: 24px;
  }

  .login-dialog .yanai-auth-head .section-note,
  .login-dialog .auth-dialog-tabs .button,
  .login-dialog .field input,
  .yanai-auth-switch {
    font-size: 14px;
  }

  .login-dialog .auth-dialog-tabs {
    min-height: 44px;
    border-radius: 14px;
  }

  .login-dialog .auth-dialog-tabs .button {
    min-height: 38px;
    border-radius: 11px;
  }

  .login-dialog .field input,
  .login-dialog .auth-challenge-box,
  .login-dialog .button.primary {
    min-height: 46px;
  }

  .login-dialog .auth-challenge-inline input {
    height: 44px;
    min-height: 44px;
    padding-right: 168px;
  }

  .login-dialog .auth-challenge-badge {
    top: 5px;
    width: 118px;
    min-width: 118px;
    height: 36px;
    min-height: 36px;
  }

  .login-dialog .auth-challenge-badge.is-image,
  .login-dialog .auth-challenge-image {
    height: 36px;
  }

  .login-dialog .auth-challenge-refresh {
    width: 42px;
    min-width: 42px;
    height: 46px;
  }

  .yanai-auth-footer-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
}

.admin-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.admin-textarea {
  width: 100%;
}

.admin-preview-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.admin-preview-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
}

.admin-preview-card strong {
  color: var(--ink);
  font-size: 15px;
}

.admin-preview-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-editor-actions {
  justify-content: flex-end;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.preview-dialog {
  position: relative;
  width: min(1120px, calc(100vw - 42px));
  max-height: calc(100vh - 42px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.preview-dialog::backdrop {
  background: rgba(8, 13, 23, 0.68);
  backdrop-filter: blur(8px);
}

.preview-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--preview-info-width, 340px);
  min-height: min(760px, calc(100vh - 42px));
}

.preview-shell.preview-shell-image-only {
  grid-template-columns: minmax(0, 1fr);
}

.preview-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  overscroll-behavior: contain;
  padding: 18px;
  background: var(--panel-muted);
  cursor: default;
}

.preview-art::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.preview-art::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
}

.preview-art-media {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-image-frame {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.preview-art img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  flex: 0 0 auto;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease;
}

.preview-art.zoomed {
  cursor: grab;
}

.preview-art.zoomed.dragging {
  cursor: grabbing;
}

.preview-art.dragging .preview-nav {
  opacity: 0;
  pointer-events: none;
}

.preview-art.zoomed .preview-art-media {
  width: calc(100% * 1.45);
  height: calc(100% * 1.45);
  min-width: calc(100% * 1.45);
  min-height: calc(100% * 1.45);
}

.preview-art.zoomed img {
  cursor: inherit;
}

.preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(15, 23, 42, 0.62);
}
