.ad-book-cover-frame {
  aspect-ratio: 2 / 3;
}

.mobile-preview-dock--floating .mobile-preview-avatar.ad-book-cover-frame {
  width: 4rem;
  height: 6rem;
}

.mobile-preview-dock--floating .mobile-preview-avatar.ad-book-cover-frame--strip {
  width: 3.25rem;
  height: 4.875rem;
}

.ad-placements-v2 {
  --bg: #090c12;
  --bg-2: #0b0f16;
  --surface: #0e131c;
  --card: #10151f;
  --card-2: #141a26;
  --border: rgba(140, 160, 190, 0.11);
  --border-hi: rgba(150, 172, 205, 0.22);
  --text-1: #e8ebf1;
  --text-2: #98a1b2;
  --text-mut: #6b7384;
  --text-faint: #474e5c;
  --gold: #fbbf24;
  --gold-soft: #f0b429;
  --blue: #5b9bf3;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(150, 170, 200, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 170, 200, 0.018) 1px, transparent 1px);
  background-size: 52px 52px;
  color: var(--text-1);
  padding: 58px 0 72px;
}

@media (max-width: 640px) {
  .ad-placements-v2 {
    padding: 34px 0 48px;
  }
}
.story-authoring { width: min(calc(100% - 48px), 1240px); margin: 28px auto 48px; container-type: inline-size; }
.story-authoring.story-authoring--embedded { width: 100%; margin: 0; }
.story-authoring input, .story-authoring textarea, .story-authoring select { font-size: 16px; }
.story-authoring__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 24px 0 28px; }
.story-authoring__heading h1 { margin: 0; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; font-weight: 700; color: var(--color-codex-gold, #fbbf24); text-wrap: balance; }
.story-authoring__columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); gap: 24px; align-items: start; }
.story-authoring__workspaces { display: grid; gap: 20px; min-width: 0; }
.story-authoring__workspace { scroll-margin-top: 128px; }
.story-authoring__workspace > summary { cursor: pointer; list-style: none; flex-wrap: wrap; }
.story-authoring__workspace > summary::-webkit-details-marker { display: none; }
.story-authoring__workspace > summary > div { flex: 1; min-width: 0; }
.story-authoring__workspace > summary:focus-visible { outline: 2px solid #fbbf24; outline-offset: -3px; border-radius: 12px; }
.story-authoring__workspace:not([open]) > summary { border-bottom: 0; }
.story-authoring__workspace[open] > summary { border-bottom-color: var(--border); }
.story-authoring__disclosure { display: grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0; }
.story-authoring__disclosure::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid #aab4c4; border-bottom: 1.5px solid #aab4c4; transform: rotate(45deg); }
.story-authoring__workspace[open] > summary .story-authoring__disclosure::after { transform: rotate(225deg); }
.story-authoring__entry .story-authoring__workspace[open] > summary .story-authoring__summary { display: none; }
.story-authoring__entry .story-authoring__workspace[open] > summary .story-authoring__summary--version { display: block; }
.story-authoring__summary { flex-basis: 100%; font-size: 12px; color: #8f9bac; line-height: 1.6; overflow-wrap: anywhere; }
.story-authoring__workspace-actions { padding: 16px 24px 0; }
.story-authoring__outcome { padding: 20px; }
.story-authoring__delta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-top: 14px; font-size: 13px; }
.story-authoring__delta[hidden] { display: none; }
.story-authoring__related-history > summary { min-height: 44px; overflow-wrap: anywhere; }
.story-authoring__columns:not(:has(.story-authoring__preview)) { grid-template-columns: minmax(0, 1fr); }
.story-authoring__delta > span:first-child { color: #aab4c4; }
.story-preview-context > div > .story-authoring__history { border: 1px solid #27303d; border-radius: 12px; padding: 20px; background: #0d121b; }
.story-connections { min-width: 0; border-top: 1px solid #303846; padding-top: 16px; }
.story-connections__heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }
.story-connections__heading h3 { font-size: 16px; font-weight: 600; }
.story-connections__heading h3 > span { display: inline-block; margin-left: 8px; font: 11px var(--font-mono, monospace); color: #aab4c4; font-weight: 400; }
.story-connections__list { display: grid; gap: 12px; margin-top: 12px; }
.story-connection { min-width: 0; padding: 12px 16px 16px; border: 1px solid #374151; border-radius: 10px; background: #0c131d; }
.story-connection__heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.story-connection__heading .form-label { margin: 0; }
.story-connection__remove { min-height: 44px; flex-shrink: 0; padding: 8px 0 8px 8px; color: #aab4c4; font-size: 12px; }
.story-connection__remove:hover { color: #fca5a5; }
.story-connection__role { margin-bottom: 12px; }
.story-connection__version { margin-top: 16px; }
.story-connection__version .text-help { margin-top: 8px; }
.story-connection select { min-height: 44px; }
.story-connection .system-searchable-select-trigger { min-height: 48px; }
.story-connection .system-searchable-select-clear { display: none; }
.story-connection .system-searchable-select-value .truncate { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.story-connection .system-searchable-select-value .font-bold { font-size: 16px; }
.story-connection .system-searchable-select-value .font-mono { font-size: 11px; color: #aab4c4; }
.story-connection .system-searchable-select-value { min-width: 0; }
.story-chapter-order { min-width: 0; border-top: 1px solid #303846; padding-top: 16px; }
.story-chapter-order select { min-height: 44px; }
.story-chapter-order__sequence { display: grid; gap: 6px; margin-top: 12px; padding-left: 12px; border-left: 1px solid #374151; font-size: 13px; color: #aab4c4; overflow-wrap: anywhere; }
.story-chapter-order__proposed { color: var(--color-codex-gold, #fbbf24); font-weight: 600; }
.story-authoring__event, .story-event-picker { --event-rgb: 251, 191, 36; --event-accent: rgb(var(--event-rgb)); }
[data-event-family="gain"], .story-event-picker__family[data-family="gain"] { --event-rgb: 251, 191, 36; --event-accent: rgb(var(--event-rgb)); }
[data-event-family="change"], .story-event-picker__family[data-family="change"] { --event-rgb: 192, 150, 255; --event-accent: rgb(var(--event-rgb)); }
[data-event-family="equipment"], .story-event-picker__family[data-family="equipment"] { --event-rgb: 74, 222, 151; --event-accent: rgb(var(--event-rgb)); }
[data-event-family="connections"], .story-event-picker__family[data-family="connections"] { --event-rgb: 103, 210, 235; --event-accent: rgb(var(--event-rgb)); }
[data-event-family="loss"], .story-event-picker__family[data-family="loss"] { --event-rgb: 248, 133, 144; --event-accent: rgb(var(--event-rgb)); }
[data-event-family="lore"], .story-event-picker__family[data-family="lore"] { --event-rgb: 165, 180, 202; --event-accent: rgb(var(--event-rgb)); }
.story-authoring__event { border-color: rgba(var(--event-rgb), .3); }
.story-authoring__event .story-authoring__event-marker { border-left-color: rgba(var(--event-rgb), .4); }
.story-authoring__event .story-authoring__event-marker::before { background: var(--event-accent); box-shadow: 0 0 10px rgba(var(--event-rgb), .25); }
.story-authoring__event-marker > .codex-eyebrow { color: var(--event-accent); }
.story-authoring__entry, .story-authoring__event { min-width: 0; }
.story-authoring__section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.story-authoring__section-heading h2 { font-weight: 600; font-size: 14px; line-height: 1.2; margin-top: 6px; color: var(--text-1); overflow-wrap: anywhere; }
.story-authoring__section-heading .codex-eyebrow { font-family: var(--font-interface); font-size: 12px; line-height: 16px; letter-spacing: normal; text-transform: none; color: var(--gold); }
.story-authoring__entry.card, .story-authoring__event.card { background: var(--surface); border-color: var(--border); box-shadow: none; }
.story-authoring__event > details > .story-authoring__section-heading { background: transparent; border-bottom-color: rgba(var(--event-rgb), .3); }
.story-authoring__section-heading .system-form-section-kicker { flex-shrink: 0; align-self: flex-start; line-height: 16px; }
.story-authoring__methods { display: flex; gap: 16px; flex-wrap: wrap; padding: 4px 24px; border-bottom: 1px solid #27303d; }
.story-authoring__method { min-height: 44px; background: transparent; border: 0; border-bottom: 2px solid transparent; color: #8893a5; font-size: 12px; }
.story-authoring__method[aria-pressed="true"] { color: #e5e7eb; border-bottom-color: #fbbf24; }
.story-source { padding: 24px; }
.story-source[hidden], .story-authoring__manual[hidden] { display: none; }
.story-source__scope { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; max-width: 360px; }
.story-source__scope .prompt-mode-pill { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; font-size: 14px; text-align: center; position: relative; }
.story-source__hint { margin: 10px 0 20px; font-size: 12px; line-height: 1.6; color: #8f9bac; }
.story-source__hint span { color: #b5bfce; }
.story-source__input textarea { display: block; min-height: 164px; resize: vertical; line-height: 1.6; }
.story-source__context { margin-top: 8px; }
.story-source__context summary { min-height: 44px; padding-block: 12px; color: #b5bfce; font-size: 13px; cursor: pointer; }
.story-source__context summary span { margin-left: 8px; color: #788597; font-size: 11px; }
.story-source__context-fields { display: grid; gap: 16px; padding: 4px 0 20px; }
.story-source__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.story-source__actions .btn-primary { margin-left: auto; }
.story-source__actions [hidden] { display: none; }
.story-source__allowance { color: #8f9bac; font-size: 11px; font-family: var(--font-system); }
.story-source__reassurance { margin-top: 12px; color: #8f9bac; font-size: 12px; line-height: 1.6; }
.contribution-guide__help { display: flex; justify-content: flex-end; padding: 0 24px; }
.contribution-guide__help button, .contribution-guide__dismiss { min-height: 44px; padding: 8px; font-size: 13px; color: #a9b5c8; text-decoration: underline; text-underline-offset: 4px; }
.contribution-guide { margin: 0 0 24px; padding: 12px 20px 20px; border: 1px solid #374151; border-radius: 12px; background: #0e1520; }
.contribution-guide[hidden] { display: none; }
.contribution-guide__header { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.contribution-guide__header h2 { font-size: 11px; color: #fbbf24; }
.contribution-guide__intro { max-width: 80ch; color: #c1c9d4; line-height: 1.65; font-size: 14px; margin-top: 8px; }
.story-source__status { margin-top: 12px; color: #b5bfce; font-size: 13px; line-height: 1.6; }
.story-source__status:empty { display: none; }
.story-source__status[data-state="error"] { color: #fda4af; }
.story-issues { margin-bottom: 24px; padding: 16px 20px 4px; border: 1px solid #65434e; border-radius: 12px; background: #14131c; scroll-margin-top: 120px; }
.story-issues h2 { display: flex; align-items: center; gap: 9px; color: #f4d8de; font-size: 15px; font-weight: 600; }
.story-issues__icon { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid #ac6376; border-radius: 50%; color: #fda4af; font-size: 12px; }
.story-issues > p { margin-top: 6px; font-size: 12px; line-height: 1.5; color: #a8a5b3; }
.story-issues ul { margin-top: 12px; }
.story-issues li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #342732; overflow-wrap: anywhere; }
.story-issues__detail { flex: 1; min-width: 0; }
.story-issues__detail strong { display: block; font-size: 13px; line-height: 1.5; color: #eee6eb; }
.story-issues__detail p { font-size: 12px; line-height: 1.5; color: #b8b1bd; margin-top: 2px; }
.story-issues__links { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 12px; max-width: 45%; }
.story-issues__links a, .story-issues__return, .story-extraction-check-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; color: #fde68a; font-size: 12px; }
.story-issues__links .story-issues__fix { min-width: 64px; padding: 0 12px; border: 1px solid #674552; border-radius: 8px; color: #f3ccd6; text-decoration: none; background: #271c26; }
.story-issues__links .story-issues__fix:hover { background: #3b2633; border-color: #b97086; }
.story-issues__links a:focus-visible { outline: 2px solid #fda4af; outline-offset: 3px; }
.story-issues__links a[hidden] { display: none; }
.story-field--invalid { border-left: 2px solid #fb7185; padding-left: 12px; }
.story-field-error { margin-top: 8px; color: #fda4af; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 639px) {
  .story-issues { padding: 14px 14px 4px; }
  .story-issues__links { max-width: 38%; }
  .story-issues__links a:not(.story-issues__fix) { text-align: right; line-height: 1.4; }
}
[data-story-field] { scroll-margin-top: 120px; }
.story-refresh-feedback { margin-bottom: 20px; padding: 16px 20px; border: 1px solid #536075; border-radius: 10px; background: #101827; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.story-refresh-feedback[hidden] { display: none; }
.story-refresh-feedback p { flex: 1 1 260px; font-size: 14px; line-height: 1.6; }
.story-source__image { margin-top: 12px; }
.story-source__image .system-custom-select-button,
.story-source__image .system-custom-select-option { min-height: 44px; font-size: 16px; }
.story-source__image [hidden], .story-extraction-feedback [hidden] { display: none; }
.story-source__review { margin-top: 24px; padding-top: 24px; border-top: 1px solid #27303d; }
.story-source__review > * + * { margin-top: 16px; }
.story-source__review input[type="radio"], .story-source__review input[type="checkbox"] { accent-color: var(--color-codex-gold, #fbbf24); }
.story-source { container-type: inline-size; }
.story-extraction-feedback { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 24px; padding: 16px 20px; border: 1px solid #313b4b; border-radius: 10px; background: #0d121b; font-size: 14px; line-height: 1.6; }
.story-extraction-feedback > div { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.story-extraction-feedback > button { margin-left: auto; }
.story-image-progress--busy { position: sticky; top: var(--story-image-progress-top, 8px); z-index: 25; border-color: #a17c28; background: #171810; box-shadow: 0 4px 16px #0004; }
.story-image-progress__heading { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.story-image-progress--busy .story-image-progress__heading { color: #facc15; }
.story-image-progress .text-help { color: #aeb8c8; }
.story-image-progress__spinner { width: 18px; height: 18px; flex-shrink: 0; border: 2px solid #facc1540; border-top-color: #facc15; border-radius: 50%; animation: story-image-spin 1s linear infinite; }
.story-extraction-feedback > .story-image-progress__actions { display: flex; flex: 0 1 auto; flex-wrap: wrap; gap: 12px; }
@keyframes story-image-spin { to { transform: rotate(360deg); } }
.image-arrived { animation: image-arrived-ring 700ms ease-out; }
.image-arrived > img { animation: image-arrived-pop 380ms cubic-bezier(.2, .8, .2, 1); }
@keyframes image-arrived-pop { from { opacity: 0; transform: scale(.9); } 65% { opacity: 1; transform: scale(1.05); } }
@keyframes image-arrived-ring { from { box-shadow: 0 0 0 0 #facc1580; } to { box-shadow: 0 0 0 10px #facc1500; } }
@media (prefers-reduced-motion: reduce) { .image-arrived { animation: none; } .image-arrived > img { animation: image-arrived-fade 200ms ease-out; } }
@keyframes image-arrived-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .story-image-progress__spinner { animation: none; } }
.story-extraction-feedback__notes { margin-top: 8px; }
.story-extraction-feedback__notes > summary { min-height: 44px; padding-block: 12px; cursor: pointer; color: #8f9bac; font-size: 13px; }
.story-source__original > summary { min-height: 44px; padding-block: 10px; color: #d1d5db; cursor: pointer; }
.story-source__original > summary span { margin-left: 8px; color: #9ca3af; font-size: 12px; }
.story-source__original[open] > summary { margin-bottom: 16px; }
.extraction-review__heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.extraction-review__heading h2 { font-size: 18px; font-weight: 600; }
.extraction-review__heading p { margin-top: 8px; font-size: 13px; line-height: 1.6; color: #8f9bac; }
.extraction-review__heading .badge { flex-shrink: 0; }
.extraction-review__version-plan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-block: 16px; border-block: 1px solid #27303d; }
.extraction-review__version-plan dt { margin-bottom: 8px; font-size: 10px; color: #8f9bac; }
.extraction-review__version-plan dd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; overflow-wrap: anywhere; }
.extraction-review__version-plan > div:last-child dd { color: #fbbf24; }
.extraction-review__bulk { display: flex; flex-wrap: wrap; gap: 8px; }
.extraction-review__group { display: grid; gap: 24px; padding-block: 12px; }
.extraction-comparison { min-width: 0; }
.extraction-comparison legend { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.extraction-comparison__choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.extraction-comparison__option { position: relative; display: block; min-width: 0; min-height: 44px; padding: 16px; border: 1px solid #313b4b; border-radius: 10px; background: #0b111a; cursor: pointer; }
.extraction-comparison__option:has(> input:checked) { border-color: #fbbf24; background: #fbbf240a; }
.extraction-comparison__option:has(> input:focus-visible) { outline: 2px solid #fbbf24; outline-offset: 3px; }
.extraction-comparison__option:has(> input:disabled) { opacity: .55; cursor: default; }
.extraction-comparison__label { display: flex; align-items: center; gap: 9px; min-height: 24px; margin-bottom: 14px; font-size: 12px; font-weight: 600; color: #b5bfce; }
.extraction-comparison__radio { display: inline-block; width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid #788597; border-radius: 50%; }
.extraction-comparison__option:has(> input:checked) .extraction-comparison__radio { border: 5px solid #fbbf24; }
.extraction-comparison__text { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; color: #e5e7eb; }
.extraction-comparison__empty { font-size: 13px; color: #788597; }
.extraction-comparison__text mark { border-radius: 2px; background: #34d39926; color: #a7f3d0; }
.extraction-comparison__option[data-side="current"] mark { background: #f8717126; color: #fecaca; }
.extraction-comparison__items { display: grid; gap: 12px; }
.extraction-comparison__items li { padding: 8px 10px; border: 1px solid transparent; border-radius: 4px; background: #111827; }
.extraction-comparison__items li[data-changed="true"] { border-color: #34d39966; }
.extraction-comparison__option[data-side="current"] li[data-changed="true"] { border-left-color: #f87171; }
.extraction-comparison__item-label { display: block; margin-bottom: 4px; font-size: 11px; color: #8f9bac; }
.extraction-comparison__items [data-effect-role="benefit"] .extraction-comparison__text { color: #34d399; }
.extraction-comparison__items [data-effect-role="restriction"] .extraction-comparison__text { color: #fca5a5; }
.extraction-review__unchanged { border-block: 1px solid #27303d; font-size: 13px; color: #8f9bac; }
.extraction-review__unchanged summary { cursor: pointer; min-height: 44px; padding-block: 14px; }
.extraction-review__unchanged dl { display: grid; gap: 12px; padding-bottom: 16px; }
.extraction-review__unchanged dt { color: #d1d5db; }
.extraction-review__unchanged dd { margin-top: 3px; }
.extraction-review__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 20px; border-top: 1px solid #27303d; }
.extraction-review__actions p { font-family: var(--font-system); font-size: 12px; color: #8f9bac; }
.extraction-review__actions .btn-primary { margin-left: auto; }
.extraction-review__empty { padding: 18px; border: 1px solid #27303d; border-radius: 8px; font-size: 14px; line-height: 1.6; color: #b5bfce; }
@container (min-width: 580px) {
  .extraction-comparison__choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 420px) {
  .extraction-review__actions .btn-primary { width: 100%; }
}
.story-authoring__picker, .story-authoring__existing { padding: 28px 24px; }
.story-authoring__tabs { display: flex; padding: 0 20px; border-bottom: 1px solid #27303d; gap: 8px; }
.story-authoring__tabs button { min-height: 52px; padding: 0 10px; color: #8993a3; background: transparent; border-bottom: 2px solid transparent; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.story-authoring__tabs button[aria-selected="true"] { color: #fbbf24; border-bottom-color: #fbbf24; }
.story-authoring__editor-panel { padding: 24px; display: grid; gap: 24px; }
.story-authoring__editor-panel[hidden] { display: none; }
.story-authoring__editor-panel .effect-fields .grid { grid-template-columns: minmax(0, 1fr); }
.story-authoring__editor-panel .effect-fields > .flex-1 { min-width: 0; }
.story-authoring__rail { display: grid; min-width: 0; gap: 24px; }
@media (min-width: 1024px) {
  .story-authoring__preview-dock .mobile-preview-dock-summary { background: none; border: 0; }
  .story-authoring__preview-dock .mobile-preview-dock-summary > div { padding: 0; }
  .story-authoring__preview-dock .mobile-preview-dock-summary h3 { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #8993a3; }
}
.story-authoring__event-body { display: grid; gap: 20px; padding: 24px; }
.story-authoring__event-marker { position: relative; border-left: 1px solid #59606a; padding-left: 20px; margin-left: 4px; }
.story-authoring__event-marker::before { content: ""; position: absolute; left: -4px; top: 4px; height: 7px; width: 7px; border-radius: 50%; background: #fbbf24; }
.story-event-picker { min-width: 0; }
.story-event-picker details { border: 1px solid #374151; border-radius: 10px; background: #0b111a; }
.story-event-picker__summary { min-height: 48px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; cursor: pointer; }
.story-event-picker__summary::-webkit-details-marker { display: none; }
.story-event-picker__summary:focus-visible { outline: 2px solid var(--event-accent); outline-offset: 3px; border-radius: 10px; }
.story-event-picker__selection { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.story-event-picker__toggle { flex-shrink: 0; font-size: 12px; color: #aab4c4; }
.story-event-picker__toggle::after { content: "Change event"; }
.story-event-picker details[open] .story-event-picker__toggle::after { content: "Hide choices"; }
.story-event-picker__families { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); border-block: 1px solid #27303d; gap: 4px; padding: 0 8px; }
.story-event-picker__family { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 66px; padding: 10px 4px; font-size: 11px; line-height: 1.3; color: #aab4c4; border-bottom: 2px solid transparent; background: transparent; }
.story-event-picker__family svg { color: var(--event-accent); opacity: .75; }
.story-event-picker__family[aria-selected="true"] { color: var(--event-accent); border-bottom-color: var(--event-accent); background: rgba(var(--event-rgb), .08); }
.story-event-picker__family[aria-selected="true"] svg { opacity: 1; }
.story-event-picker__panel { padding: 16px; }
.story-event-picker__panel[hidden] { display: none; }
.story-event-picker__family[hidden], .story-event-picker__tile[hidden], .story-event-picker__description[hidden] { display: none; }
.story-event-picker__prompt { color: var(--event-accent); font-size: 10px; margin-bottom: 12px; }
.story-event-picker__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.story-event-picker .story-event-picker__tile { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 9px; min-width: 0; min-height: 80px; padding: 12px 8px; font-size: 12px; line-height: 1.35; white-space: normal; text-align: center; background: #0d141e; color: #b5bfce; border: 1px solid #35404e; box-shadow: none; }
.story-event-picker .story-event-picker__tile:hover { background: rgba(var(--event-rgb), .06); color: #f3f4f6; border-color: rgba(var(--event-rgb), .6); }
.story-event-picker .story-event-picker__tile[aria-pressed="true"] { color: var(--event-accent); border-color: rgba(var(--event-rgb), .85); background: rgba(var(--event-rgb), .13); box-shadow: inset 0 1px 0 rgba(var(--event-rgb), .25), 0 0 12px rgba(var(--event-rgb), .08); }
.story-event-picker button:focus-visible { outline-color: var(--event-accent); }
.story-event-picker__description { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-top: 10px; border-left: 2px solid rgba(var(--event-rgb), .65); background: rgba(var(--event-rgb), .06); color: #b5bfce; font-size: 12px; line-height: 1.6; }
.story-event-picker__description svg { flex-shrink: 0; margin-top: 2px; color: var(--event-accent); }
.story-event-picker__description strong { color: #e5e7eb; font-weight: 600; }
.story-authoring__text-action { min-height: 44px; background: transparent; color: #a9b5c8; text-align: left; font-size: 12px; }
.story-authoring__history { display: grid; gap: 12px; min-width: 0; padding: 16px 0; border-block: 1px solid #27303d; overflow-wrap: anywhere; }
.story-authoring__history > header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.story-authoring__history-list { border-left: 1px solid #374151; margin-left: 4px; padding-left: 16px; }
.story-authoring__history-list:empty { display: none; }
.story-authoring__history-list > li { position: relative; padding: 8px 0; }
.story-authoring__history-list > li + li { border-top: 1px solid #27303d; }
.story-authoring__history-list > li::before { content: ""; position: absolute; left: -20px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: #6b7280; }
.story-authoring__history-list > li.story-authoring__history-new::before { background: #fbbf24; }
.story-authoring__history-list p + p { margin-top: 4px; }
.story-authoring__history-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.story-authoring__history-actions a { display: inline-flex; align-items: center; text-decoration: underline; text-underline-offset: 3px; }
.story-authoring__history-actions a:hover { color: #e5e7eb; }
.story-authoring__history-actions a:focus-visible { outline: 2px solid #fbbf24; outline-offset: 3px; border-radius: 4px; }
.story-event-preview { border: 1px solid #fbbf2433; border-radius: 8px; background: #fbbf2408; padding: 12px; overflow-wrap: anywhere; }
.story-event-preview__badge { color: #fbbf24; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.story-event-preview__facts { display: grid; gap: 8px; margin: 12px 0; font-size: 12px; }
.story-event-preview__facts:empty { display: none; }
.story-event-preview__facts dt { color: #9ca3af; }
.story-event-preview__facts dd { color: #e5e7eb; white-space: pre-line; }
.story-authoring__event-options { border-top: 1px solid #27303d; }
.story-authoring__event-options > summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 12px; color: #94a0b2; }
.story-authoring__event-options > .card { padding: 0; border: 0; box-shadow: none; }
.story-authoring__result { border-top: 1px solid #27303d; padding-top: 16px; }
.story-authoring__result p { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 12px; color: #b6bfcc; }
.story-authoring__scope { padding: 16px 24px; color: #a9b4c5; font-size: 12px; }
.story-authoring__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #27303d; }
.story-authoring__actions > span { margin-left: auto; }
.story-authoring__actions .btn-primary { margin-left: auto; }
.story-authoring button:focus-visible { outline: 2px solid #fbbf24; outline-offset: 3px; }
.story-authoring .btn-primary, .story-authoring .btn-secondary { min-height: 44px; }
.story-authoring .system-row-delete-button, .story-authoring .action-btn-danger { min-height: 44px; min-width: 44px; }
.story-authoring .modal-overlay:not(.is-open) { display: none; }
.story-review__facts { display: grid; gap: 14px; }
.story-review__facts > div { display: grid; grid-template-columns: minmax(100px, .3fr) minmax(0, 1fr); gap: 16px; font-size: 14px; }
.story-review__facts dt { color: #8f9bac; }
.story-review__facts dd { overflow-wrap: anywhere; }
.story-review__details > summary { display: flex; align-items: center; }
.proposal-version-plan { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 16px; border: 1px solid #fbbf2455; border-radius: 10px; background: #fbbf240b; overflow-wrap: anywhere; }
.proposal-story-timeline { border-left: 1px solid #374151; margin-left: 4px; padding-left: 20px; }
.proposal-story-timeline > li { position: relative; padding-bottom: 24px; }
.proposal-story-timeline > li:last-child { padding-bottom: 0; }
.proposal-story-timeline > li::before { content: ""; position: absolute; left: -24px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: #6b7280; }
.proposal-story-timeline > .proposal-story-timeline__marker { margin-block: 4px 24px; padding: 16px; border: 1px solid #fbbf2455; border-radius: 10px; background: #fbbf240b; }
.proposal-story-timeline > .proposal-story-timeline__marker::before { top: 21px; background: #fbbf24; box-shadow: 0 0 0 4px #fbbf2415; }
.proposal-story-timeline > .proposal-story-timeline__marker:last-child { padding-bottom: 16px; margin-bottom: 0; }
.proposal-story-timeline__marker-title { color: #fbbf24; }
.proposal-story-details > summary { min-height: 28px; }
/* A story event on an entry it leaves unchanged: the entry named compactly beside the event's facts. */
.event-only__entry { display: flex; align-items: center; gap: 12px; }
.event-only__icon { display: flex; flex-shrink: 0; align-items: center; justify-content: center; width: 48px; height: 48px; overflow: hidden; border: 1px solid var(--color-codex-border-mid); border-radius: 8px; background: var(--color-codex-slot); color: var(--color-codex-text-support); }
.event-only__icon img { width: 100%; height: 100%; object-fit: cover; }
.event-only__icon--rarity { border-color: var(--event-only-rarity); }

/* Review queue: compact rows, and the chosen item beside them when there's room or in their place when there isn't. */
.review-queue-page { padding-top: 16px; }
.review-queue-layout { container: queue / inline-size; margin-top: 12px; }
.review-queue { display: grid; gap: 20px; }
.review-queue--selected .review-queue__list { display: none; }
.review-queue:not(.review-queue--selected) .review-queue__detail { display: none; }
/* The list and the chosen item each rest on a card panel. Not .card itself: its overflow clip would stop the decision
   bar sticking to the bottom of the screen. */
.review-queue__list, .review-queue__detail { min-width: 0; padding: 16px; border: 1px solid var(--color-codex-border-strong); border-radius: 8px; background: var(--color-codex-card); }
.review-queue__detail .card { background: var(--color-codex-card-raised); }
.review-queue__header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.review-queue__filters { display: flex; gap: 6px; margin: 12px -16px 0; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
.review-queue__filters::-webkit-scrollbar { display: none; }
.review-queue__filters > a { flex-shrink: 0; white-space: nowrap; }
.review-queue__sort { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 12rem); gap: 8px; margin-top: 10px; }
.review-queue__rows { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.review-queue__empty, .review-queue__loading { padding: 32px 16px; text-align: center; font-size: 14px; color: var(--color-codex-text-support); }
.review-queue__empty { margin-top: 12px; border: 1px dashed var(--color-codex-border-strong); border-radius: 8px; }
.review-queue__hint { display: none; margin-top: 12px; font-size: 12px; color: var(--color-codex-text-support); }

.review-queue-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 60px; padding: 8px 10px; border: 1px solid var(--color-codex-border-strong); border-radius: 8px; background: var(--color-codex-card-raised); color: inherit; }
.review-queue-row:hover { border-color: rgba(150, 172, 205, 0.4); background: var(--color-codex-form-surface-raised); }
.review-queue-row:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
.review-queue-row__icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; overflow: hidden; border: 1px solid var(--color-codex-border-mid); border-radius: 8px; background: var(--color-codex-slot); }
.review-queue-row__icon img { width: 100%; height: 100%; object-fit: cover; }
.review-queue-row__body { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.review-queue-row__title { overflow: hidden; font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--color-codex-text-bright); text-overflow: ellipsis; white-space: nowrap; }
.review-queue-row--rarity .review-queue-row__icon { border-color: var(--review-queue-rarity); }
.review-queue-row--rarity .review-queue-row__title { color: var(--review-queue-rarity); }
.review-queue-row__tag { flex-shrink: 0; padding: 0 6px; border: 1px solid var(--color-codex-border-mid); border-radius: 999px; font-size: 11px; line-height: 18px; color: #cbd5e1; white-space: nowrap; }
.review-queue-row__details { display: flex; min-width: 0; align-items: center; gap: 6px; font-size: 12px; line-height: 1.35; color: var(--color-codex-text-support); }
.review-queue-row__details-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-queue-row__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; color: var(--color-codex-text-support); white-space: nowrap; }
.review-queue-row__checks { padding: 0 6px; border: 1px solid var(--color-codex-border-mid); border-radius: 999px; line-height: 18px; color: #e2e8f0; }

.review-queue-detail { min-width: 0; }
.review-queue-detail__nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--color-codex-border); }
.review-queue-detail__back { display: inline-flex; min-height: 40px; align-items: center; gap: 4px; font-size: 14px; color: #e2e8f0; }
.review-queue-detail__position { font-size: 12px; color: var(--color-codex-text-support); }
.review-queue-detail__steps { display: inline-flex; gap: 6px; margin-left: auto; }
.review-queue-detail__step { display: inline-flex; min-height: 40px; align-items: center; gap: 2px; padding: 0 10px; border: 1px solid var(--color-codex-border-strong); border-radius: 8px; font-size: 13px; color: #e2e8f0; }
.review-queue-detail__step:hover { border-color: rgba(150, 172, 205, 0.4); }
.review-queue-detail__step[aria-disabled="true"] { opacity: 0.4; }
.review-queue-detail__header { padding-top: 14px; }
.review-queue-detail__full { display: inline-block; margin-top: 8px; font-size: 13px; color: #fbbf24; text-decoration: underline; text-underline-offset: 3px; }
.review-queue-detail__note { margin-top: 14px; padding: 12px; border: 1px solid var(--color-codex-border-strong); border-radius: 10px; font-size: 14px; color: #cbd5e1; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-queue-checks { margin-top: 14px; }
.review-queue-checks__list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.review-queue-checks__list > li { display: flex; gap: 8px; font-size: 13px; line-height: 1.45; color: #cbd5e1; }

.review-queue-decision { position: sticky; bottom: 0; z-index: 5; display: grid; gap: 8px; margin: 24px -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--color-codex-border-strong); border-radius: 0 0 8px 8px; background: var(--color-codex-card); }
.review-queue-decision__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.review-queue-decision__actions > * { flex: 1 1 auto; }
.review-queue-decision__approve { display: flex; flex-basis: 100%; min-width: 0; }
.review-queue-decision__edit { display: flex; }
.review-queue-decision__button { flex: 1 1 auto; min-height: 44px; margin: 0; white-space: nowrap; }
.review-queue-decision__sending { font-size: 13px; color: var(--color-codex-text-support); }
.review-queue-decision__note-toggle { justify-self: start; font-size: 12px; color: var(--color-codex-text-support); cursor: pointer; }
.review-queue-decision__note-toggle:hover, .review-queue-decision__note-toggle[aria-expanded="true"] { color: #e2e8f0; }

@container queue (min-width: 720px) {
  /* Side by side, the queue fits the visible height (measured by the review-queue controller) and the list and the
     item scroll inside their panels, so scrolling either never moves the page. */
  .review-queue { grid-template-columns: clamp(280px, 40%, 380px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 20px;
    height: max(var(--review-queue-fit-height, calc(100dvh - 10rem)), 22.5rem); }
  .review-queue--empty { grid-template-columns: minmax(0, 1fr); height: auto; }
  .review-queue-row[aria-current="true"] { border-color: #fbbf2499; background: #fbbf240d; }
  .review-queue--selected .review-queue__list, .review-queue__detail { display: block; }
  .review-queue:not(.review-queue--selected) .review-queue__detail { display: block; }
  .review-queue__list, .review-queue__detail { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .review-queue__detail turbo-frame[busy] { opacity: 0.6; transition: opacity 150ms ease 100ms; }
  .review-queue__detail { padding: 20px; }
  .review-queue__filters { flex-wrap: wrap; margin-inline: 0; padding-inline: 0; overflow: visible; }
  .review-queue__sort { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .review-queue__hint { display: block; }
  .review-queue-detail__back { display: none; }
  .review-queue-decision__actions { flex-wrap: nowrap; }
  .review-queue-decision__approve { flex-basis: auto; }
  .review-queue-decision__edit { flex-grow: 0; }
  .review-queue-decision { bottom: -20px; align-items: start; margin: 24px -20px -20px; padding-inline: 20px; }
}
@container queue (min-width: 860px) {
  .review-queue { grid-template-columns: 380px minmax(0, 1fr); gap: 24px; }
  .review-queue--empty { grid-template-columns: minmax(0, 1fr); }
  .review-queue__sort { grid-template-columns: minmax(0, 1fr) minmax(0, 12rem); }
}
.version-comparison > summary, .proposal-new-event > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 20px; cursor: pointer; list-style: none; overflow-wrap: anywhere; }
.version-comparison > summary::-webkit-details-marker, .proposal-new-event > summary::-webkit-details-marker { display: none; }
.version-comparison > summary:hover, .proposal-new-event > summary:hover { background: #94a3b808; }
.version-comparison > summary:focus-visible, .proposal-new-event > summary:focus-visible { outline: 2px solid #fbbf24; outline-offset: -3px; border-radius: 12px; }
.version-comparison__toggle, .proposal-new-event__toggle { display: inline-flex; flex-shrink: 0; align-items: center; gap: 6px; font-size: 12px; color: #cbd5e1; }
.version-comparison__collapse, .version-comparison[open] > summary .version-comparison__expand { display: none; }
.version-comparison[open] > summary .version-comparison__collapse { display: inline; }
.version-comparison[open] > summary svg { transform: rotate(180deg); }
.version-comparison__side { padding: 12px; border: 1px solid; border-radius: 8px; overflow-wrap: anywhere; }
.version-comparison__side--from { --comparison-accent: #fca5a5; --comparison-highlight: #ef444440; border-color: #ef44442b; background: #ef444414; }
.version-comparison__side--to { --comparison-accent: #6ee7b7; --comparison-highlight: #10b98140; border-color: #10b9812b; background: #10b98114; }
.version-comparison__label { color: var(--comparison-accent); }
.version-comparison__side mark { background: var(--comparison-highlight); }
.version-comparison__status { color: #fde68a; background: #f59e0b15; border: 1px solid #f59e0b33; }
.version-comparison__status[data-status="added"] { color: #6ee7b7; background: #10b98115; border-color: #10b98133; }
.version-comparison__status[data-status="removed"] { color: #fca5a5; background: #ef444415; border-color: #ef444433; }
.proposal-new-event { container: event-details / inline-size; }
.proposal-new-event__collapse, .proposal-new-event[open] > summary .proposal-new-event__expand { display: none; }
.proposal-new-event[open] > summary .proposal-new-event__collapse { display: inline; }
.proposal-new-event[open] > summary svg { transform: rotate(180deg); }
.proposal-new-event__facts { display: grid; gap: 16px; overflow-wrap: anywhere; }
.proposal-new-event__facts dt { font-size: 12px; color: #9ca3af; }
.proposal-new-event__facts dd { margin-top: 4px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; color: #e5e7eb; }
@container event-details (min-width: 480px) {
  .proposal-new-event__facts > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; align-items: baseline; }
  .proposal-new-event__facts dd { margin-top: 0; }
}
@container (max-width: 819px) {
  .story-authoring__columns { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1024px) { @container (min-width: 820px) { .story-authoring__columns > .story-authoring__rail { position: sticky; top: 24px; } } }
@media (min-width: 980px) {
  @container (min-width: 820px) {
    .story-authoring__columns--comparing > .story-authoring__rail { position: sticky; top: 128px; max-height: calc(100dvh - 152px); overflow-y: auto; }
  }
}
.authoring-dialog { inset: 24px 0 auto; width: min(1340px, calc(100vw - 48px)); max-width: none; height: calc(100dvh - 48px); max-height: calc(100dvh - 48px); margin: 0 auto; padding: 0; color: #e5e7eb; background: #090c12; border: 1px solid #374151; border-radius: 14px; overflow: auto; scrollbar-gutter: stable; }
.authoring-dialog::backdrop { background: #000b; }
.authoring-dialog__header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 8px 20px; background: #0d121b; border-bottom: 1px solid #374151; }
.authoring-dialog__help { display: none; align-items: center; min-height: 44px; margin-right: auto; padding: 8px; border-radius: 8px; color: #a9b5c8; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.authoring-dialog:has([data-controller~="contribution-guide"]) .authoring-dialog__help { display: inline-flex; }
.authoring-dialog__help:hover { color: #f3f4f6; }
.authoring-dialog__help:focus-visible { outline: 2px solid #facc15; outline-offset: 2px; }
.authoring-dialog .contribution-guide__help, .authoring-dialog .breadcrumb-nav { display: none; }
.authoring-dialog .story-authoring { margin: 16px auto 32px; }
.authoring-dialog .story-authoring__heading { margin: 0 0 20px; }
.authoring-dialog__actions { display: flex; flex-shrink: 0; align-items: center; gap: 4px; }
.authoring-dialog__icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #9ca3af; cursor: pointer; }
.authoring-dialog__icon-button:hover, .authoring-dialog__icon-button:focus-visible { background: #1b2431; color: #f3f4f6; }
.authoring-dialog__icon-button:focus-visible { outline: 2px solid #facc15; outline-offset: 2px; }
.authoring-dialog__icon-button:active { background: #283345; }
.authoring-dialog .story-authoring__columns > aside, .authoring-dialog .proposal-review__rail { top: 88px; }
@media (max-width: 1023px) {
  .story-authoring { container-type: normal; }
  .story-authoring__workspaces { container-type: inline-size; }
  .story-authoring__columns { grid-template-columns: minmax(0, 1fr); }
  .story-authoring__workspaces > .card:has(.system-custom-select[data-state="open"]),
  .story-authoring__workspaces > .card:has(.system-searchable-select[data-state="open"]) { z-index: 20; }
  .story-authoring__preview-dock.mobile-preview-dock--floating { display: flex; flex-direction: column; padding: 8px clamp(16px, 6vw, 28px) calc(16px + env(safe-area-inset-bottom)); border-radius: 0; max-height: min(62dvh, 560px); background: #030712; backdrop-filter: none; box-shadow: 0 -12px 28px #0004; overflow: hidden; }
  .story-authoring__preview-dock .mobile-preview-dock-summary { flex: none; margin: 0; border: 0; border-radius: 0; background: none; }
  .story-authoring__preview-dock .mobile-preview-dock-drag-handle { margin: 6px auto; }
  .story-authoring__preview-dock .mobile-preview-dock-summary > div:not(.mobile-preview-dock-drag-handle) { min-height: 52px; padding: 0; }
  .story-authoring__preview-dock .mobile-preview-dock-summary h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #8993a3; }
  .story-authoring__preview-dock [data-mobile-preview-dock-target="toggleButton"] { min-height: 44px; flex-shrink: 0; }
  .story-authoring__preview-dock .mobile-preview-dock-details { min-height: 0; margin: 0; overflow-y: auto; overscroll-behavior: contain; }
  .story-authoring__preview-dock.mobile-preview-dock--expanded .mobile-preview-dock-details { margin-top: 12px; }
  .story-authoring__preview-dock .mobile-preview-avatar { width: 64px; height: 64px; }
  .story-authoring__preview-dock .mobile-preview-card-content { padding: 16px; }
  .story-authoring__preview-dock .mobile-preview-title { font-size: 16px; line-height: 1.25; }
}
.story-preview-tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 20px; margin-bottom: 12px; background: #030712; border-bottom: 1px solid #27303d; }
.story-preview-tabs button { min-height: 44px; padding: 8px 4px; border-bottom: 2px solid transparent; font-size: 13px; color: #9ca3af; cursor: pointer; }
.story-preview-tabs button[aria-selected="true"] { color: #facc15; border-color: #facc15; }
.story-preview-tabs button:focus-visible { outline: 2px solid #facc15; outline-offset: -2px; }
@media (min-width: 1024px) { .story-preview-tabs { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .story-authoring__preview-dock, .story-authoring__preview-dock .mobile-preview-dock-details, .story-authoring__preview-dock .mobile-preview-dock-toggle-icon { transition: none; }
}
@media (max-width: 979px) {
  .story-authoring__columns { grid-template-columns: minmax(0, 1fr); }
  .authoring-dialog { inset: 0; width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .authoring-dialog__header { padding: 10px 12px; }
  .story-authoring, .authoring-dialog .proposal-review { width: calc(100% - 32px); }
}
@media (max-width: 540px) {
  .authoring-dialog__header { gap: 8px; padding: 8px 12px; }
  .story-event-picker__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-event-picker .story-event-picker__tile { padding-inline: 6px; }
  .story-connection { padding: 8px 12px 12px; }
  .story-authoring__heading { flex-direction: column; gap: 12px; }
  .story-authoring__section-heading, .story-authoring__event-body, .story-authoring__editor-panel, .story-authoring__existing, .story-authoring__picker { padding: 18px; }
  .story-authoring__tabs { padding: 0 8px; gap: 0; }
  .story-authoring__tabs button { padding: 0 9px; font-size: 12px; }
  .story-authoring__methods { padding: 4px 18px; gap: 12px; }
  .story-source { padding: 18px; }
  .story-source__scope { max-width: none; }
  .story-source__actions .btn-primary { width: 100%; order: 1; }
  .story-source__actions .btn-secondary { margin-left: auto; }
  .story-authoring__actions > span { width: 100%; margin-left: 0; order: -1; }
  .story-authoring__actions .btn-primary { width: 100%; }
}
.book-hero,
.book-chapters {
  border: 1px solid rgb(55 65 81 / 0.6);
  border-radius: 0.75rem;
  background: rgb(17 24 39 / 0.65);
  padding: 1rem;
}

.book-chapters {
  margin-top: 1rem;
}

.book-hero__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.book-sibling-nav {
  display: flex;
  flex-shrink: 0;
  gap: 0.375rem;
}

.book-sibling-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 2rem;
  padding: 0 0.625rem;
  border: 1px solid rgb(55 65 81 / 0.7);
  border-radius: 0.5rem;
  background: rgb(31 41 55 / 0.5);
  color: #9ca3af;
  font-family: var(--font-system);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.book-sibling-nav__link:hover {
  border-color: rgb(251 191 36 / 0.45);
  color: #fde68a;
}

.book-hero__layout {
  display: grid;
  grid-template-columns: 6.75rem minmax(0, 1fr);
  column-gap: 1rem;
  row-gap: 1.25rem;
  align-items: start;
}

.book-hero__cover {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgb(75 85 99 / 0.7);
  border-radius: 0.375rem;
  background: #141c2b;
}

.book-hero__identity {
  align-self: center;
  min-width: 0;
}

.book-hero__facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.5rem;
  row-gap: 0.25rem;
  color: #9ca3af;
  font-family: var(--font-system);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.book-hero__title {
  margin-top: 0.375rem;
  color: var(--color-codex-gold);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.book-hero__actions,
.book-hero__description {
  grid-column: 1 / -1;
  min-width: 0;
}

.book-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.book-hero__editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.prose-text {
  max-width: 68ch;
  color: #d1d5db;
  font-size: 15px;
  line-height: 1.7;
}

.prose-text p + p {
  margin-top: 0.85em;
}

.prose-text strong {
  color: #f3f4f6;
  font-weight: 600;
}

[data-prose-clamp-state="collapsed"] > .prose-text {
  max-height: var(--prose-clamp-height, 15rem);
  overflow: hidden;
}

[data-prose-clamp-state="collapsed"][data-prose-clamp-overflowing] > .prose-text {
  mask-image: linear-gradient(to bottom, #000 calc(100% - 4.5em), rgb(0 0 0 / 0.15));
}

.prose-clamp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.25rem;
  color: var(--color-codex-gold);
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: 600;
}

.prose-clamp-toggle:hover {
  color: #fde68a;
}

[data-prose-clamp-state="expanded"] .prose-clamp-toggle svg {
  transform: rotate(180deg);
}

.book-chapters__header {
  display: flex;
  align-items: center;
  margin-bottom: 0.875rem;
}

.book-chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr));
  gap: 0.375rem;
}

.book-chapter-tile {
  position: relative;
  display: flex;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(55 65 81 / 0.6);
  border-radius: 0.375rem;
  background: rgb(31 41 55 / 0.6);
  color: #d1d5db;
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.book-chapter-legend__swatch {
  position: relative;
  display: inline-block;
  width: 0.875rem;
  height: 0.875rem;
  border: 1px solid rgb(55 65 81 / 0.6);
  border-radius: 0.25rem;
  background: rgb(31 41 55 / 0.6);
}

.book-chapter-tile:hover {
  border-color: rgb(251 191 36 / 0.5);
  color: #fff;
}

.book-chapter-tile--progression {
  border-color: rgb(251 191 36 / 0.3);
  color: #fde68a;
}

.book-chapter-tile--progression::after {
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 9999px;
  background: var(--color-codex-gold);
  content: "";
}

.book-chapter-tile--position {
  border-color: var(--color-reading-accent);
  background: color-mix(in srgb, var(--color-reading-accent) 16%, transparent);
  color: var(--color-reading-accent);
}

.book-chapter-tile--locked {
  background: rgb(17 24 39 / 0.6);
  color: #4b5563;
}

.book-chapter-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 0.875rem;
  color: #9ca3af;
  font-size: 12px;
}

.book-chapter-legend__swatch.book-chapter-tile--progression::after {
  bottom: 2px;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
}

@media (min-width: 640px) {
  .book-hero,
  .book-chapters {
    padding: 1.5rem;
  }

  .book-chapters {
    margin-top: 1.5rem;
  }

  .book-hero__topbar {
    margin-bottom: 1.5rem;
  }

  .book-hero__layout {
    grid-template-columns: 10rem minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 1.75rem;
    row-gap: 1.125rem;
  }

  .book-hero__cover {
    grid-row: 1 / span 3;
  }

  .book-hero__identity {
    align-self: start;
  }

  .book-hero__title {
    font-size: 1.875rem;
  }

  .book-hero__actions,
  .book-hero__description {
    grid-column: 2;
  }

  .book-hero__description {
    --prose-clamp-height: 32rem;
  }

  .book-chapter-grid {
    grid-template-columns: repeat(auto-fill, minmax(3.25rem, 1fr));
  }
}

@media (min-width: 1024px) {
  .book-hero__layout {
    grid-template-columns: 13rem minmax(0, 1fr);
    column-gap: 2.25rem;
  }

  .book-hero__title {
    font-size: 2.25rem;
  }

  .book-hero__editor-actions {
    margin-left: auto;
  }

  .prose-text {
    font-size: 16px;
  }
}
:root[data-codex-transition]::view-transition-group(codex-hero) {
  animation-duration: 320ms;
  animation-timing-function: cubic-bezier(0.3, 0, 0, 1);
}

:root[data-codex-transition]::view-transition-image-pair(codex-hero) {
  overflow: clip;
  border-radius: 0.5rem;
}

:root[data-codex-transition]::view-transition-old(codex-hero),
:root[data-codex-transition]::view-transition-new(codex-hero) {
  height: 100%;
  animation-duration: 320ms;
  object-fit: cover;
  object-position: top;
}

/* One copy of the artwork travels the whole way: the codex page's artwork going in, the same artwork coming back. */
:root[data-codex-transition].codex-transition-single-artwork::view-transition-image-pair(codex-hero) {
  animation: codex-hero-corners 320ms cubic-bezier(0.3, 0, 0, 1) both;
}

:root[data-codex-transition="in"].codex-transition-single-artwork::view-transition-old(codex-hero),
:root[data-codex-transition="out"].codex-transition-single-artwork::view-transition-new(codex-hero) {
  animation: none;
  opacity: 0;
}

:root[data-codex-transition="in"].codex-transition-single-artwork::view-transition-new(codex-hero),
:root[data-codex-transition="out"].codex-transition-single-artwork::view-transition-old(codex-hero) {
  animation: none;
  opacity: 1;
}

:root[data-codex-transition]::view-transition-group(codex-hero-title) {
  animation-duration: 320ms;
  animation-timing-function: cubic-bezier(0.3, 0, 0, 1);
}

:root[data-codex-transition]::view-transition-old(codex-hero-title),
:root[data-codex-transition]::view-transition-new(codex-hero-title) {
  height: 100%;
  animation-duration: 320ms;
  object-fit: contain;
  object-position: left center;
}

:root[data-codex-transition="in"]::view-transition-old(root) {
  animation: codex-page-recede 240ms cubic-bezier(0.4, 0, 1, 1) both;
}

:root[data-codex-transition="in"]::view-transition-new(root) {
  animation: codex-page-settle-in 300ms cubic-bezier(0, 0, 0, 1) 60ms both;
}

:root[data-codex-transition="out"]::view-transition-old(root) {
  animation: codex-page-lift-out 240ms cubic-bezier(0.4, 0, 1, 1) both;
}

:root[data-codex-transition="out"]::view-transition-new(root) {
  animation: codex-page-settle-back 300ms cubic-bezier(0, 0, 0, 1) 60ms both;
}

:root.codex-transition-fallback::view-transition-old(codex-hero) {
  animation: codex-hero-lift 280ms cubic-bezier(0.3, 0, 0, 1) both;
}

@keyframes codex-page-recede {
  to {
    opacity: 0;
    transform: scale(0.97);
  }
}

@keyframes codex-page-settle-in {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
}

@keyframes codex-page-lift-out {
  to {
    opacity: 0;
    transform: scale(1.02);
  }
}

@keyframes codex-page-settle-back {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}

@keyframes codex-hero-corners {
  from {
    border-radius: var(--codex-hero-radius-from, 0.5rem);
  }

  to {
    border-radius: var(--codex-hero-radius-to, 0.5rem);
  }
}

@keyframes codex-hero-lift {
  60% {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: scale(1.12);
  }
}
.recovery-page { width: min(100% - 32px, 960px); margin: 32px auto 64px; color: #e5e7eb; }
.recovery-page--confirm { max-width: 720px; }
.recovery-inspect-link { display: inline-block; margin-top: 12px; color: #bfdbfe; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.recovery-record { margin-top: 24px; padding-top: 24px; border-top: 1px solid #293341; }
.recovery-record-heading { display: flex; align-items: center; gap: 16px; }
.recovery-record-heading h2, .recovery-section-title { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.recovery-artwork { width: 72px; height: 72px; object-fit: contain; border-radius: 10px; border: 1px solid #46505f; flex-shrink: 0; }
.recovery-record-fields > div { margin-top: 16px; }
.recovery-record-fields dt { color: #9ca3af; font-size: 12px; margin-bottom: 4px; }
.recovery-record-fields dd { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.recovery-related { padding: 16px 0; border-bottom: 1px solid #293341; }
.recovery-related summary { cursor: pointer; overflow-wrap: anywhere; }
.recovery-panel { background: #0e141e; border: 1px solid #293341; border-radius: 14px; padding: 24px; box-shadow: 0 3px 8px #0003; margin-bottom: 16px; }
.recovery-heading { display: flex; align-items: flex-start; gap: 16px; }
.recovery-heading h1 { font-size: 24px; font-weight: 700; color: #ffc400; line-height: 1.3; margin: 0; }
.recovery-heading p, .recovery-impact > p, .recovery-target > p, .recovery-empty p { color: #9ca3af; font-size: 14px; line-height: 1.6; margin: 8px 0 0; }
.recovery-icon { flex: 0 0 44px; padding: 10px; border: 1px solid #765d1c; border-radius: 10px; color: #ffc400; background: #ffc40012; }
.recovery-icon svg { width: 22px; height: 22px; }
.recovery-filters { display: grid; grid-template-columns: 1fr 1.5fr 1fr 1fr; gap: 16px; margin-top: 24px; padding-top: 24px; border-top: 1px solid #293341; }
.recovery-filters > div { min-width: 0; }
.recovery-filter-panel { margin-top: 24px; padding-top: 20px; border-top: 1px solid #293341; }
.recovery-filter-panel > summary { cursor: pointer; font-size: 14px; color: #e5e7eb; }
.recovery-filter-panel > summary span { color: #9ca3af; margin-left: 8px; font-size: 12px; }
.recovery-filter-panel .recovery-filters { border: 0; margin-top: 16px; padding-top: 0; }
.recovery-page input[type="submit"]:disabled { opacity: .45; cursor: not-allowed; }
.recovery-page .form-input { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; color-scheme: dark; }
.recovery-filter-actions { display: flex; align-items: center; gap: 16px; grid-column: 1 / -1; }
.recovery-link, .recovery-breadcrumb a { color: #9ca3af; text-decoration: underline; text-underline-offset: 3px; }
.recovery-bulk { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 0 16px; font-size: 14px; color: #9ca3af; }
.recovery-item-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.recovery-item h2, .recovery-target h2 { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; margin: 4px 0 0; }
.recovery-series { color: #9ca3af; font-size: 12px; margin: 0; }
.recovery-status { padding: 4px 10px; border: 1px solid #46505f; border-radius: 999px; font-size: 12px; white-space: nowrap; background: #ffffff06; }
.recovery-status--pending { color: #fcd34d; border-color: #80641e; background: #fbbf2410; }
.recovery-status--restored { color: #6ee7b7; border-color: #276352; background: #34d39910; }
.recovery-reason { margin: 20px 0; border-left: 2px solid #46505f; padding: 4px 0 4px 16px; }
.recovery-reason p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: 14px; }
.recovery-history { color: #9ca3af; font-size: 12px; }
.recovery-history summary { cursor: pointer; line-height: 1.7; }
.recovery-history summary span { display: inline-block; margin-left: 12px; color: #bfdbfe; }
.recovery-history dl { border-top: 1px solid #293341; margin-top: 12px; padding-top: 12px; }
.recovery-history dl > div { display: flex; gap: 12px; margin: 8px 0; }
.recovery-history dt { min-width: 72px; color: #d1d5db; }
.recovery-history dd { margin: 0; }
.recovery-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #293341; margin-top: 20px; padding-top: 20px; }
.recovery-actions--end { justify-content: flex-end; }
.recovery-page .btn-primary, .recovery-page .btn-secondary { min-height: 44px; }
.recovery-selection { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; cursor: pointer; }
.recovery-selection input { width: 18px; height: 18px; accent-color: #ffc400; }
.recovery-empty { text-align: center; padding: 40px 24px; }
.recovery-empty h2 { font-weight: 600; }
.recovery-empty .btn-secondary { display: inline-flex; margin-top: 20px; }
.recovery-breadcrumb { display: flex; flex-wrap: wrap; gap: 10px; color: #9ca3af; font-size: 13px; margin-bottom: 20px; }
.recovery-target { margin-top: 24px; padding: 20px; border: 1px solid #293341; border-radius: 10px; background: #080d15; }
.recovery-impact { padding: 24px 0; }
.recovery-impact h2 { font-size: 15px; font-weight: 600; }
.recovery-counts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 16px 0; }
.recovery-counts li { padding: 5px 10px; background: #1a2432; border-radius: 6px; font-size: 13px; }
.recovery-note { font-size: 13px; color: #9ca3af; line-height: 1.6; margin-top: 8px; }
@media (max-width: 640px) {
  .recovery-page { margin-top: 20px; }
  .recovery-panel { padding: 18px; }
  .recovery-heading { gap: 12px; }
  .recovery-heading h1 { font-size: 21px; }
  .recovery-filters { grid-template-columns: 1fr 1fr; gap: 12px; }
  .recovery-filters > div:nth-of-type(-n+2) { grid-column: 1 / -1; }
  .recovery-bulk { align-items: flex-start; flex-direction: column; }
  .recovery-item-heading { flex-direction: column-reverse; gap: 10px; }
  .recovery-history summary span { display: block; margin: 4px 0 0; }
  .recovery-actions--end { justify-content: space-between; }
}
.for-authors-v2 {
  --bg: #090c12;
  --bg-2: #0b0f16;
  --surface: #0e131c;
  --nav: #0d111a;
  --card: #10151f;
  --card-2: #141a26;
  --slot: #131925;
  --border: rgba(140, 160, 190, 0.11);
  --border-hi: rgba(150, 172, 205, 0.22);
  --text-1: #e8ebf1;
  --text-2: #98a1b2;
  --text-mut: #6b7384;
  --text-faint: #474e5c;
  --gold: #fbbf24;
  --gold-soft: #f0b429;
  --blue: #5b9bf3;
  --green: #4ade80;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(150, 170, 200, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 170, 200, 0.018) 1px, transparent 1px);
  background-size: 52px 52px;
  color: var(--text-1);
}
body.home-page-body {
  background-color: var(--color-codex-canvas);
  background-image:
    linear-gradient(var(--color-codex-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-codex-grid-line) 1px, transparent 1px);
  background-size: 52px 52px;
}

.site-navbar--home {
  border-color: var(--color-codex-border);
  background: var(--color-codex-nav);
}

.home-marketing {
  --bg: var(--color-codex-canvas);
  --bg-2: var(--color-codex-canvas-raised);
  --surface: var(--color-codex-surface);
  --nav: var(--color-codex-nav);
  --card: var(--color-codex-card);
  --card-2: var(--color-codex-card-raised);
  --slot: var(--color-codex-slot);
  --border: var(--color-codex-border);
  --border-hi: var(--color-codex-border-strong);
  --text-1: var(--color-codex-text);
  --text-2: var(--color-codex-text-muted);
  --text-mut: var(--color-codex-text-subtle);
  --text-faint: var(--color-codex-text-faint);
  --gold: var(--color-codex-gold);
  --gold-soft: var(--color-codex-gold-soft);
  --blue: var(--color-codex-blue);
  --green: var(--color-codex-green);
  --epic: var(--color-codex-epic);

  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--color-codex-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-codex-grid-line) 1px, transparent 1px);
  background-size: 52px 52px;
}

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

.home-shell {
  width: min(100% - 48px, 1240px);
  margin: 0 auto;
}

.home-shell--narrow {
  width: min(100% - 48px, 1160px);
}

.home-hero {
  padding: 96px 0 122px;
}

.home-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(500px, 1.05fr);
  gap: 72px;
  align-items: center;
}

.home-hero__copy {
  max-width: 580px;
}

.home-hero__title {
  margin: 0;
  color: var(--text-1);
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.06;
  text-wrap: balance;
}

.home-hero__title span {
  color: var(--gold);
}

.home-hero__lede {
  max-width: 540px;
  margin: 24px 0 0;
  color: var(--text-2);
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.65;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.home-actions--center {
  justify-content: center;
}

.home-marketing .home-button,
.home-marketing .btn-primary,
.home-marketing .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 10px;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease, background 180ms ease;
}

.home-marketing .btn-primary {
  border: 1px solid #f0b429;
  background: var(--gold);
  color: #161207;
}

.home-marketing .btn-primary:hover {
  border-color: #fcd34d;
  background: #fcd34d;
  color: #161207;
}

.home-marketing .btn-secondary {
  border: 1px solid var(--border-hi);
  background: var(--card-2);
  color: var(--text-1);
  box-shadow: none;
}

.home-marketing .btn-secondary:hover {
  border-color: rgba(150, 172, 205, 0.38);
  background: #172031;
  color: #fff;
}

.home-card,
.home-character-card,
.home-series-card,
.home-spotlight {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.home-card:hover,
.home-series-card:hover,
.home-spotlight:hover {
  border-color: rgba(251, 191, 36, 0.38);
}

.home-stat-chip-row {
  display: grid;
  gap: 12px;
}

.home-stat-chip-row--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.home-stat-chip {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--slot);
  padding: 13px 14px;
  text-align: center;
}

.home-stat-chip span {
  display: block;
  color: var(--text-mut);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.home-stat-chip strong {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.home-character-card {
  position: relative;
  width: 100%;
  max-width: 620px;
  justify-self: end;
  overflow: hidden;
  background: rgba(16, 21, 31, 0.9);
  box-shadow: 0 30px 60px -48px rgba(0, 0, 0, 1);
}

.home-character-card__header {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: start;
  gap: 10px;
  padding: 20px 18px 14px;
  text-align: center;
}

.home-character-card__identity h2 {
  margin: 0;
  color: var(--gold);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.05;
}

.home-character-card__identity p {
  margin: 8px 0 0;
  color: var(--text-mut);
  font-size: 11px;
  font-weight: 700;
}

.home-character-card__identity span {
  color: var(--text-faint);
  margin: 0 6px;
}

.home-preview-chip {
  justify-self: end;
  border: 1px solid var(--border-hi);
  border-radius: 4px;
  padding: 5px 8px 4px;
  color: var(--text-2);
  font-family: var(--font-system);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.home-reading-panel {
  margin: 0 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--slot);
  padding: 8px 10px;
  color: var(--text-mut);
  font-size: 10px;
  font-weight: 700;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.home-reading-panel--looking-back {
  border-color: rgba(251, 191, 36, 0.32);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.06);
}

.home-reading-row {
  display: grid;
  grid-template-columns: minmax(168px, 0.78fr) minmax(130px, 1fr);
  align-items: center;
  gap: 10px;
}

.home-reading-status {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  background: #101728;
  padding: 7px 10px;
  white-space: nowrap;
  transition: border-color 180ms ease, background-color 180ms ease, padding-right 180ms ease;
}

.home-reading-status--looking-back {
  border-color: rgba(251, 191, 36, 0.34);
  background: rgba(251, 191, 36, 0.1);
}

.home-reading-status__icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--gold);
}

.home-reading-status__label {
  flex: 0 0 auto;
  color: var(--text-mut);
  font-weight: 700;
}

.home-reading-status--looking-back .home-reading-status__label,
.home-reading-status--looking-back .home-reading-status__separator {
  color: var(--gold-soft);
}

.home-reading-status__separator {
  flex: 0 0 auto;
  color: var(--text-faint);
}

.home-reading-status__chapter {
  min-width: 0;
  overflow: hidden;
  color: var(--text-1);
  font-weight: 800;
  text-overflow: ellipsis;
}

.home-reading-controls {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
}

.home-reading-arrow {
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  background: #131b2e;
  color: var(--text-mut);
}

.home-reading-arrow:hover:not(:disabled),
.home-reading-arrow:focus-visible:not(:disabled) {
  border-color: rgba(251, 191, 36, 0.34);
  background: rgba(251, 191, 36, 0.1);
  color: var(--gold);
  outline: none;
}

.home-reading-arrow:disabled {
  cursor: default;
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-faint);
  opacity: 0.62;
}

.home-reading-slider {
  --home-preview-progress: 100%;

  position: relative;
  height: 24px;
  border-radius: 999px;
}

.home-reading-slider::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-50%);
}

.home-reading-slider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: var(--home-preview-progress);
  height: 4px;
  border-radius: 999px;
  background: var(--gold);
  transform: translateY(-50%);
}

.home-reading-slider__remainder {
  position: absolute;
  top: 50%;
  right: 0;
  left: var(--home-preview-progress);
  z-index: 1;
  display: none;
  height: 4px;
  background: repeating-linear-gradient(90deg, rgba(251, 191, 36, 0.32) 0 5px, transparent 5px 9px);
  transform: translateY(-50%);
}

.home-reading-panel--looking-back .home-reading-slider__remainder {
  display: block;
}

.home-reading-slider__input {
  position: absolute;
  z-index: 4;
  inset: -6px -2px;
  width: calc(100% + 4px);
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.home-reading-slider__tick {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: var(--home-preview-tick);
  width: 5px;
  height: 5px;
  border: 1px solid rgba(251, 191, 36, 0.74);
  border-radius: 999px;
  background: #232a37;
  transform: translate(-50%, -50%);
}

.home-reading-slider__marker {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 0;
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background: var(--gold);
  transform: translate(50%, -50%);
}

.home-reading-slider__knob {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: var(--home-preview-progress);
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--gold);
  transform: translate(-50%, -50%);
  transition: left 220ms ease;
}

.home-character-tabs {
  display: flex;
  gap: 0;
  margin: 18px 14px 0;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
  overflow: hidden;
}

.home-character-tabs span {
  position: relative;
  flex: 1 1 0;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--text-mut);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 0 8px 11px;
  text-align: center;
  white-space: nowrap;
}

.home-character-tabs .active {
  border-bottom-color: currentColor;
  color: var(--gold);
}

.home-character-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 174px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
}

.home-equipment-column {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 9px;
  min-width: 0;
}

.home-equipment-bottom-row {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  min-width: 0;
}

.home-equipment-slot {
  --slot-preview-color: var(--blue);

  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid var(--slot-preview-color);
  border-radius: 8px;
  background: var(--slot);
  color: inherit;
  padding: 6px 7px;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.home-equipment-slot:hover,
.home-equipment-slot:focus-visible {
  z-index: 10;
  background: rgba(20, 26, 38, 0.96);
}

.home-equipment-slot:focus-visible {
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.28);
}

.home-equipment-slot--inferior {
  --slot-preview-color: #64748b;
}

.home-equipment-slot--common {
  --slot-preview-color: #9d9d9d;
}

.home-equipment-slot--uncommon {
  --slot-preview-color: #1eff00;
}

.home-equipment-slot--rare {
  --slot-preview-color: #0070dd;
}

.home-equipment-slot--epic {
  --slot-preview-color: #a335ee;
}

.home-equipment-slot--legendary {
  --slot-preview-color: #ff8000;
}

.home-equipment-slot__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--slot-preview-color);
  border-radius: 7px;
  color: var(--slot-preview-color);
  background: rgba(0, 0, 0, 0.12);
}

.home-equipment-slot__copy,
.home-equipment-slot__label,
.home-equipment-slot__name,
.home-equipment-slot__empty-label,
.home-equipment-slot__empty-initial {
  display: block;
  min-width: 0;
}

.home-equipment-slot__label {
  color: var(--text-mut);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.1;
  text-transform: uppercase;
}

.home-equipment-slot__name {
  margin-top: 3px;
  overflow: hidden;
  color: var(--slot-preview-color);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-equipment-slot--empty {
  border-style: dashed;
  border-color: rgba(150, 172, 205, 0.18);
  background: rgba(19, 25, 37, 0.62);
}

.home-equipment-slot--empty .home-equipment-slot__icon {
  border-color: rgba(150, 172, 205, 0.16);
  color: var(--text-faint);
  background: rgba(0, 0, 0, 0.12);
}


.home-equipment-slot__empty-label {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.home-character-portrait {
  position: relative;
  z-index: 1;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 7px;
  background: #0b0f16;
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.12);
}

.home-character-portrait__link {
  display: block;
  width: 100%;
  height: 100%;
}

.home-character-portrait__link:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.72);
  outline-offset: -3px;
}

.home-character-portrait__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}


.home-panel-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 0 14px 14px;
}

.home-panel-stat-grid .home-stat-chip {
  padding: 10px 6px;
}

.home-panel-stat-grid .home-stat-chip strong {
  margin-top: 6px;
  color: var(--text-1);
  font-size: 16px;
}

.home-section {
  padding: 76px 0;
}

.home-section--center {
  text-align: center;
}

.home-section-title {
  margin: 0;
  color: var(--text-1);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.08;
}

.home-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.home-section-head--stacked {
  display: block;
  max-width: 610px;
}

.home-text-link {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.home-text-link:hover {
  color: #fcd34d;
}

.home-step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 52px;
  text-align: left;
}

.home-step-card,
.home-feature-card {
  padding: 28px;
}

.home-step-card p {
  margin: 0 0 12px;
  color: var(--text-mut);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.home-step-card h3,
.home-feature-card h3 {
  margin: 0;
  color: var(--text-1);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.home-step-card span,
.home-feature-card p {
  display: block;
  margin: 12px 0 0;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
}

.home-series-rotator {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 14px;
  margin-top: 24px;
  max-width: 920px;
}

.home-series-rotator .home-series-card {
  grid-area: 1 / 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  visibility: hidden;
}

.home-series-rotator .home-series-card.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.home-series-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 920px;
  padding: 20px;
  color: inherit;
  text-decoration: none;
}

.home-series-card__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 118px;
  min-height: 144px;
  overflow: hidden;
  border: 1px solid rgba(150, 172, 205, 0.16);
  border-radius: 8px;
  background: #0b0f16;
}

.home-series-card__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.home-series-card__thumb-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(93, 84, 196, 0.3);
}

.home-series-card__body h3,
.home-spotlight__body h3 {
  margin: 0;
  color: var(--gold);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.home-byline {
  margin: 7px 0 0;
  color: var(--text-mut);
  font-size: 13px;
  font-weight: 600;
}

.home-byline strong {
  color: var(--gold-soft);
  font-weight: 800;
}

.home-series-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  color: var(--text-mut);
  font-size: 12px;
  font-weight: 600;
}

.home-series-card__meta strong {
  color: var(--text-1);
  font-weight: 700;
}

.home-series-rotator__controls {
  display: flex;
  grid-column: 1;
  grid-row: 2;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.home-series-rotator__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.home-series-rotator__dot span {
  display: block;
  width: 20px;
  height: 5px;
  border-radius: 999px;
  background: rgba(150, 172, 205, 0.22);
  transition: background-color 180ms ease, box-shadow 180ms ease, width 180ms ease;
}

.home-series-rotator__dot:hover span,
.home-series-rotator__dot:focus-visible span {
  background: rgba(251, 191, 36, 0.5);
}

.home-series-rotator__dot.is-active span {
  width: 26px;
  background: var(--gold);
}

.home-spotlight {
  position: relative;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 34px;
  overflow: hidden;
  padding: 34px;
  background: var(--card);
}

.home-spotlight__portrait {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid rgba(150, 172, 205, 0.16);
  border-radius: 10px;
  background: #0b0f16;
}

.home-spotlight__tag {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  border-radius: 6px;
  background: var(--gold);
  padding: 5px 8px 4px;
  color: #151006;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.home-spotlight__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.home-spotlight__fallback {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  background: var(--slot);
}

.home-spotlight__body {
  position: relative;
  z-index: 1;
  align-self: center;
  max-width: 610px;
}

.home-spotlight__body h3 {
  color: var(--text-1);
  font-size: 32px;
}

.home-spotlight__body > p:not(.home-byline) {
  margin: 22px 0 0;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.65;
}

.home-spotlight__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
}

.home-spotlight__actions span {
  color: var(--text-mut);
  font-size: 12px;
  font-weight: 700;
}

.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 52px;
  text-align: left;
}

.home-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 44px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}

.home-stats-strip__item {
  padding: 26px 18px;
  text-align: center;
}

.home-stats-strip__item + .home-stats-strip__item {
  border-left: 1px solid var(--border);
}

.home-stats-strip__item strong {
  display: block;
  color: var(--gold);
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
}

.home-stats-strip__item span {
  display: block;
  margin-top: 12px;
  color: var(--text-mut);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

.home-section--faqs {
  padding-top: 48px;
  padding-bottom: 78px;
}

.home-faq-list {
  display: grid;
  gap: 10px;
}

.home-faq-item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(16, 21, 31, 0.86);
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.home-faq-item:hover {
  border-color: var(--border-hi);
}

.home-faq-item[open] {
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(20, 26, 38, 0.92);
}

.home-faq-item summary {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 17px 18px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.home-faq-item summary::-webkit-details-marker {
  display: none;
}

.home-faq-item summary:focus {
  outline: none;
}

.home-faq-item summary:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.28);
  outline-offset: -4px;
}

.home-faq-item h3 {
  margin: 0;
  color: var(--text-1);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
}

.home-faq-toggle {
  position: relative;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.055);
}

.home-faq-toggle::before,
.home-faq-toggle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 999px;
  background: var(--gold);
  content: "";
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease, transform 180ms ease;
}

.home-faq-toggle::before {
  width: 10px;
  height: 2px;
}

.home-faq-toggle::after {
  width: 2px;
  height: 10px;
}

.home-faq-item[open] .home-faq-toggle::after {
  opacity: 0;
  transform: translate(-50%, -50%) scaleY(0.2);
}

.home-faq-answer {
  border-top: 1px solid var(--border);
  padding: 0 18px 17px;
}

.home-faq-answer p {
  margin: 15px 0 0;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.62;
}

.home-inline-link,
.home-faq-more a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

.home-inline-link:hover,
.home-faq-more a:hover {
  color: #fcd34d;
}

.home-faq-more {
  margin: 20px 0 0;
  color: var(--text-mut);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}

.home-final-cta {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border);
  padding: 96px 0 102px;
  text-align: center;
}

.home-final-cta__inner {
  position: relative;
  z-index: 1;
  max-width: 610px;
}

.home-final-cta h2 {
  margin: 0;
  color: var(--text-1);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
}

.home-final-cta p {
  margin: 18px auto 0;
  color: var(--text-2);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
}

body.home-page-body .site-footer {
  border-color: var(--color-codex-border);
  background: var(--color-codex-nav);
}

body.home-page-body .site-footer > div {
  width: min(100% - 48px, 1240px);
  margin: 0 auto;
  padding: 36px 0;
}

body.home-page-body .footer-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 0 16px rgba(93, 84, 196, 0.28);
}

body.home-page-body .footer-brand-mark img {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
}

@media (min-width: 1600px) {
  .home-shell {
    width: min(100% - 96px, 1360px);
  }

  .home-shell--narrow {
    width: min(100% - 96px, 1240px);
  }

  .home-hero {
    padding: 108px 0 136px;
  }

  .home-hero__grid {
    grid-template-columns: minmax(0, 620px) minmax(640px, 680px);
    gap: 112px;
    justify-content: center;
  }

  .home-hero__copy {
    max-width: 620px;
  }

  .home-hero__title {
    font-size: 64px;
  }

  .home-hero__lede {
    max-width: 580px;
    font-size: 17.5px;
  }

  .home-actions {
    margin-top: 32px;
  }

  .home-stat-chip {
    padding: 15px 16px;
  }

  .home-character-card {
    max-width: 680px;
  }

  .home-character-card__header {
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    padding: 24px 22px 16px;
  }

  .home-character-card__identity h2 {
    font-size: 25px;
  }

  .home-character-card__identity p {
    font-size: 12px;
  }

  .home-reading-panel {
    margin: 0 22px;
    padding: 9px 12px;
    font-size: 11px;
  }

  .home-character-tabs {
    margin: 20px 18px 0;
  }

  .home-character-tabs span {
    font-size: 12px;
  }

  .home-character-stage {
    grid-template-columns: minmax(0, 1fr) 196px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
  }

  .home-equipment-column {
    gap: 10px;
  }

  .home-equipment-bottom-row {
    gap: 10px;
  }

  .home-equipment-slot {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    min-height: 48px;
    padding: 7px 8px;
  }

  .home-equipment-slot__icon {
    width: 32px;
    height: 32px;
  }

  .home-equipment-slot__name {
    font-size: 11.5px;
  }

  .home-panel-stat-grid {
    gap: 9px;
    padding: 0 18px 18px;
  }

  .home-panel-stat-grid .home-stat-chip {
    padding: 12px 8px;
  }

  .home-panel-stat-grid .home-stat-chip strong {
    font-size: 18px;
  }

  .home-section {
    padding: 88px 0;
  }

  .home-section-title {
    font-size: 38px;
  }

  .home-step-grid,
  .home-feature-grid {
    gap: 22px;
  }

  .home-step-card,
  .home-feature-card {
    padding: 32px;
  }

  .home-series-card {
    max-width: 920px;
    grid-template-columns: 146px minmax(0, 1fr);
    gap: 28px;
    padding: 26px;
  }

  .home-series-card__thumb {
    width: 146px;
    min-height: 176px;
  }

  .home-spotlight {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 46px;
    padding: 42px;
  }

  .home-final-cta__inner {
    max-width: 680px;
  }

  body.home-page-body .site-footer > div {
    width: min(100% - 96px, 1360px);
  }
}

@media (max-width: 980px) {
  .home-hero__grid,
  .home-spotlight {
    grid-template-columns: 1fr;
  }

  .home-hero {
    padding-top: 64px;
  }

  .home-hero__copy,
  .home-character-card {
    max-width: none;
  }

  .home-character-card {
    justify-self: stretch;
  }

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

  .home-spotlight__portrait {
    max-width: 300px;
  }
}

@media (max-width: 760px) {
  .home-shell,
  .home-shell--narrow {
    width: min(100% - 28px, 1120px);
  }

  .home-hero__title {
    font-size: 44px;
  }

  .home-character-stage {
    grid-template-columns: 1fr;
  }

  .home-character-portrait {
    width: min(220px, 100%);
    margin: 0 auto;
    order: -1;
  }

  .home-reading-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .home-reading-status,
  .home-reading-controls {
    grid-column: 1 / -1;
  }

  .home-panel-stat-grid,
  .home-stat-chip-row--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-section-head {
    display: block;
  }

  .home-text-link {
    display: inline-flex;
    margin-top: 16px;
  }

  .home-series-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .home-shell,
  .home-shell--narrow {
    width: min(100% - 24px, 1120px);
  }

  .home-hero {
    padding-top: 34px;
    padding-bottom: 40px;
  }

  .home-hero__grid {
    gap: 28px;
  }

  .home-hero__title {
    max-width: 360px;
    font-size: 34px;
    line-height: 1.02;
  }

  .home-hero__lede {
    margin-top: 18px;
    font-size: 14.5px;
    line-height: 1.55;
  }

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

  .home-marketing .home-button,
  .home-marketing .btn-primary,
  .home-marketing .btn-secondary {
    min-height: 42px;
    padding: 0 12px;
    font-size: 12px;
  }

  .home-stat-chip-row {
    gap: 8px;
  }

  .home-stat-chip-row--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 22px;
  }

  .home-stat-chip {
    border-radius: 8px;
    padding: 10px 8px;
  }

  .home-stat-chip span {
    font-size: 7.5px;
    letter-spacing: 0.14em;
  }

  .home-stat-chip strong {
    margin-top: 6px;
    font-size: 19px;
  }

  .home-character-card {
    border-radius: 12px;
    display: block;
  }

  .home-character-card__header {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    gap: 6px;
    padding: 12px 10px 8px;
  }

  .home-character-card__identity h2 {
    font-size: 18px;
  }

  .home-character-card__identity p {
    margin-top: 5px;
    font-size: 9px;
  }

  .home-preview-chip {
    padding: 4px 6px 3px;
    font-size: 9px;
  }

  .home-reading-panel {
    margin: 0 8px;
    border-radius: 8px;
    padding: 5px 6px;
    font-size: 7.8px;
  }

  .home-reading-panel--looking-back {
    border-color: rgba(251, 191, 36, 0.16);
    box-shadow: none;
  }

  .home-reading-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .home-reading-status {
    min-height: 22px;
    gap: 4px;
    border-radius: 7px;
    padding: 5px 7px;
  }

  .home-reading-status--looking-back {
    border-color: rgba(251, 191, 36, 0.2);
    background: rgba(251, 191, 36, 0.055);
  }

  .home-reading-status__icon svg {
    width: 9px;
    height: 9px;
  }

  .home-reading-status__label {
    font-weight: 800;
  }

  .home-reading-status__chapter {
    white-space: nowrap;
  }

  .home-reading-controls {
    grid-template-columns: 20px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 5px;
    min-width: 0;
  }

  .home-reading-arrow {
    width: 20px;
    height: 20px;
    border-radius: 6px;
  }

  .home-reading-slider {
    grid-column: auto;
    min-width: 0;
    height: 14px;
  }

  .home-reading-slider::before,
  .home-reading-slider::after,
  .home-reading-slider__remainder {
    height: 2px;
  }

  .home-reading-slider__tick {
    width: 3px;
    height: 3px;
    border-color: rgba(251, 191, 36, 0.5);
  }

  .home-reading-slider__marker {
    width: 2px;
    height: 9px;
    opacity: 0.72;
  }

  .home-reading-slider__knob {
    width: 8px;
    height: 8px;
  }

  .home-character-tabs {
    margin: 11px 8px 0;
    padding: 0;
  }

  .home-character-tabs span {
    padding: 0 3px 8px;
    font-size: 8.5px;
  }

  .home-character-stage {
    grid-template-columns: minmax(0, 0.88fr) minmax(92px, 106px) minmax(0, 0.88fr);
    gap: 5px;
    padding: 8px;
  }

  .home-equipment-column {
    gap: 5px;
  }

  .home-equipment-bottom-row {
    gap: 5px;
  }

  .home-equipment-slot {
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 5px;
    min-height: 28px;
    border-radius: 7px;
    padding: 4px;
  }

  .home-equipment-slot__icon {
    width: 18px;
    height: 18px;
    border-radius: 6px;
  }

  .home-equipment-slot__icon svg {
    width: 12px;
    height: 12px;
  }

  .home-equipment-slot__label {
    font-size: 6px;
    letter-spacing: 0.1em;
  }

  .home-equipment-slot__name {
    margin-top: 2px;
    font-size: 7.5px;
  }

  .home-equipment-slot__empty-label {
    margin-top: 2px;
    font-size: 6px;
    letter-spacing: 0.12em;
  }

  .home-character-portrait {
    width: auto;
    margin: 0;
    order: 0;
    border-radius: 6px;
  }

  .home-panel-stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding: 0 8px 8px;
  }

  .home-panel-stat-grid .home-stat-chip {
    padding: 7px 3px;
  }

  .home-panel-stat-grid .home-stat-chip span {
    font-size: 6px;
  }

  .home-panel-stat-grid .home-stat-chip strong {
    margin-top: 4px;
    font-size: 12px;
  }

  .home-section {
    padding: 40px 0;
  }

  .home-section-title {
    font-size: 24px;
  }

  .home-section-head {
    margin-bottom: 18px;
  }

  .home-step-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 26px;
  }

  .home-step-card {
    padding: 14px;
  }

  .home-step-card p {
    margin: 0 0 5px;
    font-size: 8px;
    letter-spacing: 0.14em;
  }

  .home-step-card h3 {
    font-size: 14px;
  }

  .home-step-card span {
    display: none;
  }

  .home-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 22px;
  }

  .home-feature-card {
    display: block;
    min-height: 92px;
    padding: 12px;
  }

  .home-feature-card h3 {
    font-size: 12.5px;
    line-height: 1.2;
  }

  .home-feature-card p {
    display: none;
  }

  .home-series-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .home-series-card__thumb {
    width: 72px;
    min-height: 90px;
  }

  .home-series-card__thumb-logo {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .home-series-card__body h3 {
    font-size: 17px;
  }

  .home-byline {
    margin-top: 5px;
    font-size: 11.5px;
  }

  .home-series-card__meta {
    gap: 8px 10px;
    margin-top: 10px;
    padding-top: 10px;
    font-size: 10px;
  }

  .home-spotlight {
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 14px;
  }

  .home-spotlight__portrait {
    width: 86px;
    max-width: none;
    border-radius: 8px;
  }

  .home-spotlight__tag {
    left: 8px;
    top: 8px;
    border-radius: 5px;
    padding: 4px 6px 3px;
    font-size: 7px;
  }

  .home-spotlight__body h3 {
    font-size: 20px;
  }

  .home-spotlight__body > p:not(.home-byline) {
    display: none;
  }

  .home-spotlight__body .home-stat-chip-row--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
  }

  .home-spotlight__body .home-stat-chip {
    display: flex;
    min-height: 58px;
    flex-direction: column;
    justify-content: center;
    padding: 8px 5px;
  }

  .home-spotlight__body .home-stat-chip span {
    font-size: 6.5px;
    letter-spacing: 0.12em;
    white-space: nowrap;
  }

  .home-spotlight__body .home-stat-chip strong {
    font-size: 15px;
  }

  .home-spotlight__actions {
    margin-top: 12px;
  }

  .home-spotlight__actions span {
    display: none;
  }

  .home-spotlight__actions .home-button {
    width: 100%;
    min-height: 38px;
  }

  .home-stats-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
  }

  .home-stats-strip__item {
    padding: 14px 6px;
  }

  .home-stats-strip__item strong {
    font-size: 24px;
  }

  .home-stats-strip__item span {
    margin-top: 7px;
    font-size: 6.5px;
    line-height: 1.15;
  }

  .home-stats-strip__item + .home-stats-strip__item {
    border-left: 1px solid var(--border);
    border-top: 0;
  }

  .home-section--faqs {
    padding-top: 30px;
    padding-bottom: 42px;
  }

  .home-faq-list {
    gap: 8px;
  }

  .home-faq-item {
    border-radius: 10px;
  }

  .home-faq-item summary {
    gap: 10px;
    padding: 13px 14px;
  }

  .home-faq-item h3 {
    font-size: 13.5px;
  }

  .home-faq-toggle {
    width: 22px;
    height: 22px;
    border-radius: 7px;
  }

  .home-faq-answer {
    padding: 0 14px 13px;
  }

  .home-faq-answer p,
  .home-faq-more {
    font-size: 12.5px;
    line-height: 1.52;
  }

  .home-faq-more {
    margin-top: 14px;
  }

  .home-final-cta h2 {
    font-size: 28px;
  }

  .home-final-cta {
    padding: 58px 0 64px;
  }

  .home-final-cta p {
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  .home-shell,
  .home-shell--narrow {
    width: min(100% - 20px, 1120px);
  }

  .home-hero__title {
    font-size: 31px;
  }

  .home-hero__lede {
    font-size: 14px;
  }

  .home-character-card__header {
    grid-template-columns: 46px minmax(0, 1fr) 46px;
  }

  .home-character-stage {
    grid-template-columns: minmax(0, 0.82fr) minmax(88px, 96px) minmax(0, 0.82fr);
    gap: 4px;
    padding: 7px;
  }

  .home-equipment-slot {
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 4px;
    min-height: 27px;
    padding: 3px;
  }

  .home-equipment-slot__icon {
    width: 16px;
    height: 16px;
  }

  .home-equipment-slot__icon svg {
    width: 11px;
    height: 11px;
  }

  .home-equipment-slot__name {
    font-size: 7px;
  }

  .home-panel-stat-grid {
    gap: 4px;
    padding: 0 7px 7px;
  }

  .home-panel-stat-grid .home-stat-chip strong {
    font-size: 11px;
  }
}
/*
 * Brand overrides for the add-to-homescreen instruction modal
 * (vendored library in public/add-to-homescreen/, shown via
 * features/homescreen_prompt/add_to_homescreen_adapter.js).
 *
 * The library stylesheet is lazy-loaded after this one, so these
 * overrides need !important to win the cascade. Kept deliberately
 * minimal (typography and button colours only) so the library's
 * per-device instruction layouts stay intact.
 */

.adhs-container {
  font-family: var(--font-interface) !important;
}

.adhs-container .adhs-button {
  font-family: inherit !important;
  font-weight: 600 !important;
}

.adhs-container .adhs-button.adhs-button-install {
  background-color: #eab308 !important; /* yellow-500, matches .btn-primary */
  color: #111827 !important;            /* gray-900 */
}

.adhs-container .adhs-button.adhs-button-cancel {
  background-color: #374151 !important; /* gray-700, matches .btn-secondary */
  color: #e5e7eb !important;            /* gray-200 */
}
.illustration-field { border: 1px solid var(--color-codex-border-strong); border-radius: var(--radius-panel, 14px); background: var(--color-codex-form-card); overflow: hidden; position: relative; }
.illustration-field__heading, .illustration-field__selection, .illustration-field__versions, .illustration-field__preference, .illustration-field__explanation, .illustration-field__footer { padding: 1.25rem 1.5rem; }
.illustration-field__selection, .illustration-field__versions, .illustration-field__preference, .illustration-field__explanation, .illustration-field__footer, .illustration-field__browser { border-top: 1px solid color-mix(in srgb, var(--color-codex-border-strong) 55%, transparent); }
.illustration-field__heading h3 { font-size: 1.25rem; font-weight: 700; color: var(--color-codex-gold); margin: .35rem 0; }
.illustration-field__heading > p { max-width: 68ch; line-height: 1.65; }
.illustration-field__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.illustration-field__scope { border: 1px solid var(--color-codex-border-strong); border-radius: 4px; font-size: .6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: .1rem .35rem; color: var(--color-codex-text-muted); }
.illustration-field__selection { display: flex; align-items: flex-start; gap: 1rem; min-width: 0; }
.illustration-field__thumbnail { display: grid; place-items: center; flex: 0 0 112px; height: 112px; border: 1px solid var(--color-codex-gold); border-radius: 10px; background: var(--color-codex-canvas); overflow: hidden; color: var(--color-codex-text-muted); font-size: 2rem; }
.illustration-field__thumbnail img { width: 100%; height: 100%; object-fit: contain; object-position: top center; }
.illustration-field__name { font-size: 1.125rem; font-weight: 600; margin: .35rem 0; }
.illustration-field__summary .illustration-field__actions { margin-top: .75rem; }
.illustration-field__actions button { min-height: 44px; font-size: .8rem; }
.illustration-field__readers { margin-top: 1.25rem; }
.illustration-field__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: .625rem; margin-top: .5rem; }
.illustration-field__tile { display: flex; align-items: center; gap: .75rem; min-width: 0; padding: .75rem; border: 1px solid var(--color-codex-border-strong); border-radius: 10px; background: var(--color-codex-canvas); }
.illustration-field__tile > div:last-child { min-width: 0; overflow-wrap: anywhere; }
.illustration-field__tile strong { display: block; font-size: .85rem; line-height: 1.4; }
.illustration-field__tile p { color: var(--color-codex-text-muted); font-size: .75rem; margin-top: .15rem; }
.illustration-field__tile[data-kind="library"], .illustration-field__tile[data-kind="base"], .illustration-field__tile[data-kind="automatic"], .illustration-field__tile[data-kind="slot"], .illustration-field__tile[data-kind="type"] { border-color: color-mix(in srgb, var(--color-codex-gold) 28%, transparent); background: var(--color-codex-canvas); }
.illustration-field__tile-image { flex: 0 0 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--color-codex-gold); border-radius: 6px; }
.illustration-field__tile[data-kind="image"] .illustration-field__tile-image { border-color: var(--color-codex-blue, #389cff); }
.illustration-field__tile-image img, .illustration-field__version-image img { width: 100%; height: 100%; object-fit: contain; }
.illustration-field__browser { padding: 1.25rem 1.5rem; background: var(--color-codex-canvas); display: grid; gap: .85rem; }
.illustration-field__browser input { width: 100%; min-height: 44px; border: 1px solid var(--color-codex-border-strong); border-radius: 8px; background: var(--color-codex-form-card); color: var(--color-codex-text); padding: .6rem .8rem; font-size: 16px; }
.illustration-field__tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.illustration-field__tags button { padding: .3rem .85rem; min-height: 44px; border: 1px solid var(--color-codex-border-strong); border-radius: 24px; font-size: .8rem; }
.illustration-field__tags button[aria-pressed="true"] { color: var(--color-codex-gold); border-color: var(--color-codex-gold); background: #c9a22715; }
.illustration-field__browser .illustration-picker__grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); max-height: 480px; overflow-y: auto; padding: 3px; }
.illustration-field__browser .illustration-picker__card { position: relative; }
.illustration-field__browser .illustration-picker__card[aria-pressed="true"]::after { content: "✓"; position: absolute; right: .5rem; top: .5rem; border-radius: 50%; width: 1.4rem; height: 1.4rem; background: var(--color-codex-gold); color: #111; text-align: center; }
.illustration-field__utilities { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .625rem; }
.illustration-field__utilities button { min-height: 56px; padding: .75rem; border: 1px dashed var(--color-codex-border-strong); border-radius: 10px; font-size: .8rem; }
.illustration-field__utilities button:hover { border-color: var(--color-codex-gold); background: #c9a2270c; }
.illustration-field__preference .system-boolean-row { padding: 0; background: transparent; border: 0; margin: 0; }
.illustration-field__preference .system-toggle { flex-shrink: 0; }
.illustration-field__preference .system-toggle[data-state="on"]::before { background: color-mix(in srgb, var(--color-codex-gold) 25%, transparent); }
.illustration-field__preference .system-toggle[data-state="on"] .system-toggle-thumb { background: var(--color-codex-gold); }
.illustration-field__explanation summary, .illustration-field__versions summary { min-height: 44px; display: list-item; align-content: center; cursor: pointer; font-size: .85rem; color: var(--color-codex-text-muted); }
.illustration-field__explanation { padding-block: .3rem; }
.illustration-field__explanation[open] { padding-bottom: 1rem; }
.illustration-field__steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem; margin: .85rem 0; list-style: none; }
.illustration-field__steps li { border: 1px solid var(--color-codex-border-strong); border-radius: 8px; padding: .75rem; font-size: .8rem; }
.illustration-field__steps span { display: block; font-family: monospace; color: var(--color-codex-text-muted); margin-bottom: .4rem; }
.illustration-field__steps small { display: block; color: var(--color-codex-text-muted); margin-top: .25rem; }
.illustration-field__steps [aria-current="step"] { border-color: color-mix(in srgb, var(--color-codex-gold) 40%, transparent); background: #c9a2270c; }
.illustration-field__steps [aria-current="step"] span { color: var(--color-codex-gold); }
.illustration-field__footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; font-size: .75rem; color: var(--color-codex-text-muted); }
.illustration-field__footer a { color: var(--color-codex-blue, #389cff); }
.illustration-field__summary { min-width: 0; overflow-wrap: anywhere; }
.illustration-field__search { display: grid; gap: .5rem; min-width: 0; }
.illustration-field__search .system-searchable-select-option img { width: 48px; height: 48px; object-fit: contain; }
.illustration-field__search .system-searchable-select-option .text-gray-500 { white-space: normal; line-height: 1.5; }
.illustration-field__search .system-searchable-select-menu { max-height: 320px; }
.illustration-field__suggest { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; border-top: 1px solid var(--color-codex-border-strong); padding-top: 1rem; font-size: .8rem; }
.illustration-field__suggest > div { flex: 1 1 220px; }
.illustration-field__actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.illustration-field__default { color: var(--color-codex-text-muted); font-size: .8rem; text-decoration: underline; text-underline-offset: 4px; padding: .65rem .25rem; }
.illustration-picker { padding: 0; margin: auto; width: min(1120px, calc(100vw - 48px)); max-width: none; height: min(800px, calc(100dvh - 64px)); max-height: none; color: var(--color-codex-text); background: var(--color-codex-form-surface); border: 1px solid var(--color-codex-border-strong); border-radius: 20px; box-shadow: 0 30px 100px #000b; overflow: hidden; }
.illustration-picker::backdrop { background: #030611e6; }
.illustration-picker__shell { display: flex; flex-direction: column; height: 100%; }
.illustration-picker__header { display: flex; justify-content: space-between; gap: 1rem; padding: 1.4rem 1.5rem 1rem; }
.illustration-picker__header h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -.03em; margin: .2rem 0; }
.illustration-picker__close { width: 40px; height: 40px; flex-shrink: 0; font-size: 1.8rem; color: var(--color-codex-text-muted); border-radius: 50%; background: var(--color-codex-form-card); }
.illustration-picker__tools { display: flex; gap: .75rem; padding: 0 1.5rem; }
.illustration-picker__search { flex: 1; min-width: 0; }
.illustration-picker__search input { width: 100%; height: 44px; border: 1px solid var(--color-codex-border-strong); border-radius: 10px; background: var(--color-codex-canvas); color: var(--color-codex-text); padding: 0 1rem; }
.illustration-picker__tools select { max-width: 220px; height: 44px; font-size: .85rem; }
.illustration-picker__feedback { padding: .8rem 1.5rem; font-size: .8rem; color: var(--color-codex-text-muted); min-height: 2.7rem; }
.illustration-picker__body { display: grid; grid-template-columns: minmax(0, 1fr) 275px; flex: 1; min-height: 0; border-top: 1px solid var(--color-codex-border-strong); }
.illustration-picker__results { overflow-y: auto; overscroll-behavior: contain; padding: 1rem 1.5rem; min-width: 0; }
.illustration-picker__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .75rem; }
.illustration-picker__card { min-width: 0; text-align: left; border: 1px solid var(--color-codex-border-strong); border-radius: 12px; padding: .5rem; background: var(--color-codex-form-card); transition: border-color .15s, background .15s, transform .15s; }
.illustration-picker__card:hover { border-color: var(--color-codex-text-muted); background: var(--color-codex-card-raised); }
.illustration-picker__card[aria-pressed="true"] { border-color: var(--color-codex-gold); background: var(--color-codex-form-card); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-codex-gold) 35%, transparent); }
.illustration-picker__card img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: var(--color-codex-canvas); }
.illustration-picker__card span { display: block; margin-top: .6rem; font-size: .75rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.illustration-picker__detail { padding: 1.2rem; border-left: 1px solid var(--color-codex-border-strong); background: var(--color-codex-surface); overflow-y: auto; overscroll-behavior: contain; }
.illustration-picker__detail > img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: var(--color-codex-canvas); }
.illustration-picker__detail h3 { font-weight: 600; margin: 1rem 0 .5rem; overflow-wrap: anywhere; }
.illustration-picker__detail > p { font-size: .8rem; color: var(--color-codex-text-muted); line-height: 1.6; }
.illustration-picker__empty { display: grid; place-content: center; text-align: center; height: 100%; color: var(--color-codex-text-muted); font-size: .9rem; line-height: 1.8; }
.illustration-picker__tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; }
.illustration-picker__tags button { font-size: .7rem; border: 1px solid var(--color-codex-border-strong); background: var(--color-codex-form-card); border-radius: 20px; padding: .4rem .6rem; }
.illustration-picker__more { display: block; margin: 1rem auto 0; }
.illustration-picker__footer { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--color-codex-border-strong); background: var(--color-codex-form-card); }
.illustration-picker__footer > span { margin-right: auto; }
.illustration-picker button:focus-visible, .illustration-picker input:focus-visible, .illustration-picker select:focus-visible, .illustration-field button:focus-visible { outline: 2px solid var(--color-codex-gold); outline-offset: 3px; }
.illustration-picker button:disabled { opacity: .45; cursor: not-allowed; }
.illustration-field [hidden], .illustration-picker [hidden] { display: none; }
@media (max-width: 640px) {
  .illustration-field__heading, .illustration-field__selection, .illustration-field__preference, .illustration-field__explanation, .illustration-field__footer, .illustration-field__browser { padding-inline: 1rem; }
  .illustration-field__selection { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: .5rem 1rem; }
  .illustration-field__summary { display: contents; }
  .illustration-field__summary > .codex-eyebrow, .illustration-field__name { grid-column: 2; }
  .illustration-field__summary > .text-help, .illustration-field__summary > .illustration-field__actions { grid-column: 1 / -1; }
  .illustration-field__thumbnail { grid-column: 1; grid-row: 1 / 3; width: 72px; height: 72px; }
  .illustration-field__actions > .btn-secondary { flex: 1 1 140px; }
  .illustration-picker { width: 100vw; height: 96dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
  .illustration-picker__header { padding: 1rem; }
  .illustration-picker__header h2 { font-size: 1.2rem; }
  .illustration-picker__header .text-help { display: none; }
  .illustration-picker__tools { padding: 0 1rem; flex-wrap: wrap; gap: .5rem; }
  .illustration-picker__search { flex-basis: 100%; }
  .illustration-picker__tools select { max-width: 100%; height: 36px; }
  .illustration-picker__feedback { padding: .6rem 1rem; }
  .illustration-picker__body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .illustration-picker__results { padding: .75rem 1rem; }
  .illustration-picker__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .illustration-picker__detail { border-left: 0; border-top: 1px solid var(--color-codex-border-strong); max-height: 155px; padding: .75rem 1rem; }
  .illustration-picker__detail > img { width: 100px; height: 100px; float: left; margin-right: .8rem; }
  .illustration-picker__detail h3 { margin: 0 0 .3rem; font-size: .9rem; }
  .illustration-picker__detail > p { font-size: .75rem; }
  .illustration-picker__detail .illustration-picker__tags, .illustration-picker__empty { display: none; }
  .illustration-picker__detail:has(.illustration-picker__empty) { display: none; }
  .illustration-picker__footer { padding: .75rem 1rem max(.75rem, env(safe-area-inset-bottom)); }
  .illustration-picker__footer > span { display: none; }
  .illustration-picker__footer button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .illustration-picker__card, .illustration-field .system-toggle, .illustration-field .system-toggle-thumb { transition: none; } }
.illustration-field__version-list { display: grid; gap: .5rem; margin-top: .75rem; }
.illustration-field__version { display: flex; align-items: center; gap: .75rem; min-width: 0; padding: .5rem .75rem; border: 1px solid var(--color-codex-border-strong); border-radius: 10px; background: var(--color-codex-canvas); }
.illustration-field__version[aria-current] { border-color: color-mix(in srgb, var(--color-codex-gold) 45%, transparent); }
.illustration-field__version-image { flex: 0 0 40px; height: 40px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--color-codex-border-strong); border-radius: 6px; }
.illustration-field__version-text { display: grid; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-size: .85rem; }
.illustration-field__version-text small { color: var(--color-codex-text-muted); font-size: .75rem; }
.illustration-field__version-status { flex: 0 0 auto; font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--color-codex-text-muted); }
.illustration-field__version-status[data-status="own-image"] { color: var(--color-codex-gold); }
.illustration-field__version-link { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; font-size: .8rem; color: var(--color-codex-blue, #389cff); }
@media (max-width: 560px) { .illustration-field__version { flex-wrap: wrap; } .illustration-field__version-status { order: 3; } }
.policy-page {
  --bg: #090c12;
  --surface: #0e131c;
  --card: #10151f;
  --card-2: #141a26;
  --border: rgba(140, 160, 190, 0.11);
  --border-hi: rgba(150, 172, 205, 0.22);
  --text-1: #e8ebf1;
  --text-2: #98a1b2;
  --text-mut: #6b7384;
  --gold: #fbbf24;
  --gold-soft: #f0b429;
  --blue: #5b9bf3;
  min-height: 100vh;
  padding: 72px 0 96px;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(150, 170, 200, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 170, 200, 0.018) 1px, transparent 1px);
  background-size: 52px 52px;
  color: var(--text-1);
}

.policy-page__shell {
  width: min(100% - 40px, 920px);
  margin: 0 auto;
}

.policy-page__hero,
.policy-page__body {
  border: 1px solid var(--border-hi);
  border-radius: 16px;
  background: var(--color-codex-card);
}

.policy-page__hero {
  padding: clamp(32px, 5vw, 52px);
  text-align: center;
}

.policy-page h1,
.policy-page h2,
.policy-page p,
.policy-page ul {
  margin-top: 0;
}

.policy-page h1 {
  margin-bottom: 14px;
  color: var(--gold);
  font-size: clamp(42px, 7vw, 68px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 0.98;
}

.policy-page__lede {
  max-width: 680px;
  margin: 0 auto 14px;
  color: var(--text-1);
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 800;
  line-height: 1.25;
}

.policy-page__hero p:not(.policy-page__lede) {
  max-width: 690px;
  margin-right: auto;
  margin-bottom: 0;
  margin-left: auto;
  color: var(--text-2);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.65;
}

.policy-page__body {
  margin-top: 22px;
  padding: clamp(28px, 4vw, 48px);
}

.policy-page__body section + section {
  margin-top: 34px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
}

.policy-page h2 {
  margin-bottom: 14px;
  color: var(--text-1);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.policy-page h3 {
  margin-top: 26px;
  margin-bottom: 10px;
  color: var(--text-1);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.policy-page h3[id] {
  scroll-margin-top: 6rem;
}

.policy-page p,
.policy-page li {
  color: var(--text-2);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.72;
}

.policy-page p {
  margin-bottom: 14px;
}

.policy-page p:last-child,
.policy-page ul:last-child {
  margin-bottom: 0;
}

.policy-page ul {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding-left: 0;
  list-style: none;
}

.policy-page li {
  position: relative;
  padding-left: 22px;
}

.policy-page li::before {
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  content: "";
}

.policy-page strong {
  color: var(--gold);
  font-weight: 800;
}

.policy-art-treatment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 18px;
  margin: 24px 0;
  align-items: stretch;
}

.policy-art-treatment__entry {
  overflow: hidden;
  border: 1px solid rgba(201, 162, 39, 0.55);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.92);
}

.policy-art-treatment__rarity-bar {
  height: 3px;
  background: #22c55e;
}

.policy-art-treatment__entry-body {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 22px 24px 18px;
}

.policy-art-treatment__entry-icon,
.policy-art-treatment__portrait-frame {
  position: relative;
  overflow: hidden;
  border: 2px solid #c9a227;
  background: #02040a;
  box-shadow: inset 0 0 28px rgba(251, 191, 36, 0.08);
}

.policy-art-treatment__entry-icon {
  width: 78px;
  height: 78px;
  border-radius: 12px;
}

.policy-art-treatment__entry-image,
.policy-art-treatment__portrait-image {
  display: block;
  width: 100%;
  height: 100%;
}

.policy-art-treatment__entry-image {
  object-fit: contain;
  padding: 6px;
}

.policy-art-treatment__portrait-image {
  object-fit: cover;
  object-position: center top;
}

.policy-art-treatment__entry-copy h3 {
  margin: 0 0 8px;
  color: #22c55e;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.policy-art-treatment__metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.policy-art-treatment__rarity {
  border-radius: 5px;
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 7px;
}

.policy-art-treatment__type {
  color: var(--text-mut);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.policy-art-treatment__note {
  margin: 0 24px 22px;
  border-top: 1px solid rgba(150, 172, 205, 0.18);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  padding-top: 16px;
}

.policy-art-treatment__portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-radius: 14px;
  background: rgba(6, 12, 22, 0.7);
  padding: 18px 16px;
}

.policy-art-treatment__portrait-frame {
  width: 132px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.15),
    0 18px 30px -22px rgba(251, 191, 36, 0.8);
}

.policy-art-treatment__portrait .artwork-credit {
  margin-top: 12px;
}

.policy-page__contact {
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 14px;
  background: rgba(251, 191, 36, 0.045);
  padding: 22px;
}

.policy-page__link {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
  transition: color 180ms ease;
}

.policy-page__link:hover {
  color: #fcd34d;
}

.policy-faq-list {
  display: grid;
  gap: 12px;
}

.policy-faq-item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(14, 19, 28, 0.72);
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

.policy-faq-item:hover {
  border-color: var(--border-hi);
}

.policy-faq-item[open],
.policy-faq-item--contact[open] {
  border-color: rgba(251, 191, 36, 0.34);
  background: rgba(251, 191, 36, 0.04);
}

.policy-faq-item > summary {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.policy-faq-item > summary::-webkit-details-marker {
  display: none;
}

.policy-faq-item > summary:focus {
  outline: none;
}

.policy-faq-item > summary:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.34);
  outline-offset: -4px;
}

.policy-faq-item h2 {
  margin: 0;
  color: var(--text-1);
  font-size: 18px;
  line-height: 1.3;
}

.policy-faq-toggle {
  position: relative;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 9px;
  background: rgba(251, 191, 36, 0.06);
}

.policy-faq-toggle::before,
.policy-faq-toggle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 999px;
  background: var(--gold);
  content: "";
  transform: translate(-50%, -50%);
  transition: transform 180ms ease, opacity 180ms ease;
}

.policy-faq-toggle::before {
  width: 11px;
  height: 2px;
}

.policy-faq-toggle::after {
  width: 2px;
  height: 11px;
}

.policy-faq-item[open] .policy-faq-toggle::after {
  opacity: 0;
  transform: translate(-50%, -50%) scaleY(0.2);
}

.policy-faq-answer {
  border-top: 1px solid var(--border);
  padding: 18px 20px 20px;
}

.policy-faq-item--contact {
  border-color: rgba(251, 191, 36, 0.2);
  background: rgba(251, 191, 36, 0.035);
}

@media (max-width: 640px) {
  .policy-page {
    padding: 32px 0 56px;
  }

  .policy-page__shell {
    width: min(100% - 24px, 920px);
  }

  .policy-page__hero,
  .policy-page__body {
    border-radius: 14px;
  }

  .policy-page__body section + section {
    margin-top: 26px;
    padding-top: 26px;
  }

  .policy-faq-list {
    gap: 10px;
  }

  .policy-faq-item > summary {
    gap: 12px;
    padding: 16px;
  }

  .policy-faq-item h2 {
    font-size: 16px;
  }

  .policy-faq-answer {
    padding: 16px;
  }

  .policy-art-treatment {
    grid-template-columns: 1fr;
  }

  .policy-art-treatment__entry-body {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
  }

  .policy-art-treatment__entry-icon {
    width: 58px;
    height: 58px;
    border-radius: 10px;
  }

  .policy-art-treatment__entry-copy h3 {
    font-size: 17px;
  }

  .policy-art-treatment__note {
    margin-right: 18px;
    margin-left: 18px;
  }

  .policy-art-treatment__portrait-frame {
    width: min(150px, 56vw);
  }
}
.series-dashboard-shell {
  width: min(100%, 1280px);
  max-width: 1280px;
  margin-right: auto;
  margin-left: auto;
  padding: 16px 18px 18px;
}

.series-command-center {
  container: series-command-center / inline-size;
}

.series-command-center__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.series-character-frame {
  min-height: 10.75rem;
}

.series-lore-frame {
  min-height: 0;
}

.series-cover-section {
  container: series-cover-section / inline-size;
}

.series-cover-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.series-cover-card {
  --series-cover-accent: rgb(167 139 250);
  --series-cover-hairline: rgb(167 139 250 / 0.3);
  --series-cover-glow: rgb(167 139 250 / 0.16);
  display: block;
  min-width: 0;
  min-height: 44px;
  color: rgb(248 250 252);
  text-decoration: none;
  transition: transform 180ms ease;
}

.series-cover-card--display {
  --series-cover-accent: rgb(251 191 36);
  --series-cover-hairline: rgb(251 191 36 / 0.3);
  --series-cover-glow: rgb(251 191 36 / 0.14);
}

.series-cover-card__tile {
  position: relative;
  display: block;
  padding: 7px 7px 0 0;
}

.series-cover-card__sheet {
  position: absolute;
  display: block;
  width: calc(100% - 7px);
  aspect-ratio: 1;
  border: 1px solid rgb(255 255 255 / 0.07);
  border-radius: var(--radius-control);
}

.series-cover-card__sheet--1 {
  z-index: 1;
  top: 3px;
  left: 4px;
  background: #151d2e;
}

.series-cover-card__sheet--2 {
  z-index: 0;
  top: 0;
  left: 7px;
  background: #111828;
}

.series-cover-card__cover {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--series-cover-hairline);
  border-radius: var(--radius-control);
  background: #101728;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.series-cover-card__image,
.series-cover-card__fallback {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.series-cover-card__image {
  object-fit: cover;
  object-position: center;
  filter: saturate(0.78) brightness(0.78);
  transition: filter 180ms ease, transform 220ms ease;
}

.series-cover-card__fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding-bottom: 12%;
  background: #101728;
}

.series-cover-card__fallback-icon {
  color: var(--series-cover-accent);
}

.series-cover-card__fallback-icon svg {
  width: 24px;
  height: 24px;
}

.series-cover-card__fallback-label,
.series-cover-card__formula {
  color: var(--t2, rgb(148 163 184));
  font-family: var(--font-system);
}

.series-cover-card__fallback-label {
  font-size: 9.6px;
  line-height: 1;
}

.series-cover-card__scrim {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  background: linear-gradient(180deg, transparent 45%, rgb(8 11 18 / 0.9));
}

.series-cover-card__copy {
  position: absolute;
  z-index: 2;
  right: 9px;
  bottom: 8px;
  left: 9px;
  display: block;
  min-width: 0;
}

.series-cover-card__formula {
  display: block;
  margin-bottom: 2px;
  font-size: 9px;
  line-height: 1.15;
  white-space: nowrap;
}

.series-cover-card__metadata {
  display: flex;
  min-width: 0;
  align-items: end;
  gap: 0.5rem;
}

.series-cover-card__title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-cover-card__count {
  flex: 0 0 auto;
  color: var(--series-cover-accent);
  font-family: var(--font-system);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.15;
}

.series-cover-card:hover,
.series-cover-card:focus-visible {
}

.series-cover-card:focus-visible {
  outline: none;
}

.series-cover-card:hover .series-cover-card__cover,
.series-cover-card:focus-visible .series-cover-card__cover {
  border-color: var(--series-cover-accent);
  box-shadow: 0 14px 30px rgb(0 0 0 / 0.5);
}

.series-cover-card:hover .series-cover-card__image,
.series-cover-card:focus-visible .series-cover-card__image {
  filter: saturate(1) brightness(1);
  transform: scale(1.04);
}

.series-cover-grid:has(.series-cover-card:hover) .series-cover-card:focus-visible:not(:hover) .series-cover-card__image {
  filter: saturate(0.78) brightness(0.78);
  transform: none;
}

.series-card-spoiler-metadata,
.series-card-spoiler-metadata:hover {
  user-select: none;
  opacity: 0.3;
  filter: blur(6.5px) saturate(0.45);
}

.series-cover-card--gated .series-card-spoiler-artwork,
.series-cover-card--gated:hover .series-card-spoiler-artwork,
.series-cover-card--gated:focus-visible .series-card-spoiler-artwork {
  opacity: 0.32;
  filter: blur(14px) saturate(0.35) brightness(0.55);
  transform: none;
}



.entry-display-grid {
  align-items: stretch;
}

.entry-display-card {
  --entry-display-accent: rgb(251 191 36);
  display: grid;
  min-width: 0;
  min-height: 44px;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid rgb(251 191 36 / 0.3);
  border-radius: var(--radius-control);
  background: #101728;
  color: rgb(248 250 252);
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.entry-display-card:hover,
.entry-display-card:focus-visible {
  border-color: var(--entry-display-accent);
  outline: none;
  box-shadow: 0 14px 30px rgb(0 0 0 / 0.5);
}

.entry-display-preview-shell {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid rgb(251 191 36 / 0.18);
  background: #0b111d;
}

.entry-display-preview-shell::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 28px rgb(0 0 0 / 0.28);
  content: "";
  pointer-events: none;
}

.entry-display-preview-shell--catalog {
  width: 100%;
  border: 1px solid rgb(251 191 36 / 0.16);
  border-radius: 8px;
}

.entry-display-card__preview-bar {
  position: relative;
  z-index: 2;
  display: flex;
  height: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
  color: rgb(251 191 36 / 0.85);
  font-family: var(--font-system);
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.entry-display-card__preview-bar > :first-child {
  width: 5px;
  height: 2px;
  border-radius: 999px;
  background: var(--entry-display-accent);
  box-shadow: 8px 0 0 rgb(148 163 184 / 0.26), 14px 0 0 rgb(148 163 184 / 0.16);
}

.entry-display-card__details {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 8px 9px 9px;
}

.entry-display-card__heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 0.5rem;
}

.entry-display-card__title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-display-card__count {
  flex: 0 0 auto;
  color: var(--entry-display-accent);
  font-family: var(--font-system);
  font-size: 10px;
  font-weight: 700;
}

.entry-display-card__source {
  min-width: 0;
  margin-top: 3px;
  overflow: hidden;
  color: var(--t2, rgb(148 163 184));
  font-family: var(--font-system);
  font-size: 7.5px;
  line-height: 1.25;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.entry-display-card__placements {
  display: flex;
  min-height: 14px;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: auto;
  padding-top: 7px;
}

.entry-display-card__placement {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  padding: 2px 4px;
  border: 1px solid rgb(148 163 184 / 0.2);
  border-radius: 3px;
  color: rgb(148 163 184);
  font-family: var(--font-system);
  font-size: 6.5px;
  letter-spacing: 0.04em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.entry-display-card__placement > span {
  color: var(--entry-display-accent);
}

.entry-display-card__placement--empty {
  border-style: dashed;
  color: rgb(100 116 139);
}

.entry-display-card__placement--empty > span {
  color: rgb(100 116 139);
}

.entry-display-preview {
  position: absolute;
  z-index: 1;
  top: 18px;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  padding: 7px;
}

.entry-display-preview__image,
.entry-display-preview__image-fallback,
.entry-display-preview__empty-mark {
  display: block;
  width: 100%;
  height: 100%;
}

.entry-display-preview__image {
  object-fit: contain;
  object-position: center;
  filter: saturate(0.72) brightness(0.74);
  transition: filter 180ms ease, transform 220ms ease;
}

.entry-display-card:hover .entry-display-preview__image,
.entry-display-card:focus-visible .entry-display-preview__image {
  filter: saturate(1) brightness(1);
  transform: scale(1.04);
}

.entry-display-grid:has(.entry-display-card:hover) .entry-display-card:focus-visible:not(:hover) .entry-display-preview__image {
  filter: saturate(0.72) brightness(0.74);
  transform: none;
}

.entry-display-preview__image-fallback,
.entry-display-preview__empty-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: rgb(251 191 36 / 0.45);
}

.entry-display-preview__empty-mark {
  border: 1px dashed rgb(148 163 184 / 0.13);
  border-radius: inherit;
  background: rgb(30 41 59 / 0.26);
}

.entry-display-preview--grid {
  display: grid;
  grid-template-columns: repeat(var(--preview-columns), minmax(0, 1fr));
  align-items: center;
  gap: 3px 5px;
  padding: 5px 9px;
}

.entry-display-preview__grid-node {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
}

.entry-display-preview__grid-icon {
  display: block;
  width: min(100%, 30px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgb(148 163 184 / 0.28);
  border-radius: 4px;
  background: #000;
}

.entry-display-preview__grid-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: rgb(203 213 225);
  font-size: 5.5px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-display-preview--list {
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.entry-display-preview__list-row {
  display: grid;
  min-width: 0;
  height: 27px;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 2px 5px 2px 2px;
  border: 1px solid rgb(148 163 184 / 0.13);
  border-radius: 4px;
  background: rgb(17 24 39 / 0.8);
}

.entry-display-preview__list-thumb,
.entry-display-preview__table-thumb {
  display: block;
  width: 20px;
  height: 20px;
  overflow: hidden;
  border-radius: 3px;
}

.entry-display-preview__list-name,
.entry-display-preview__table-name,
.entry-display-preview__badge > :last-child,
.entry-display-preview__mini-card-name,
.entry-display-preview__spotlight-name {
  min-width: 0;
  overflow: hidden;
  color: rgb(203 213 225);
  font-size: 7px;
  font-weight: 600;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-display-preview__row-line,
.entry-display-preview__table-value,
.entry-display-preview__spotlight-line {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: rgb(148 163 184 / 0.18);
}

.entry-display-preview__list-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.entry-display-preview__list-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.entry-display-preview__list-name {
  max-width: 70%;
  color: rgb(251 191 36 / 0.9);
}

.entry-display-preview__list-rarity {
  width: 18px;
  height: 6px;
  border: 1px solid rgb(251 191 36 / 0.35);
  border-radius: 2px;
  background: rgb(251 191 36 / 0.08);
}

.entry-display-preview__list-type {
  color: rgb(100 116 139);
  font-size: 5px;
  line-height: 1;
  text-transform: uppercase;
}

.entry-display-preview__list-copy > .entry-display-preview__row-line {
  width: 64%;
}

.entry-display-preview--table {
  flex-direction: column;
  padding: 6px 7px;
}

.entry-display-preview__table-head,
.entry-display-preview__table-row {
  display: grid;
  min-width: 0;
  grid-template-columns: 16px minmax(34px, 1.35fr) minmax(24px, 0.85fr) 29px 13px minmax(20px, 0.8fr);
  align-items: center;
  gap: 3px;
}

.entry-display-preview__table-head {
  height: 12px;
  padding: 0 3px;
  border-bottom: 1px solid rgb(251 191 36 / 0.23);
}

.entry-display-preview__table-head span {
  overflow: hidden;
  color: rgb(148 163 184 / 0.7);
  font-family: var(--font-system);
  font-size: 4.5px;
  line-height: 1;
  text-overflow: clip;
}

.entry-display-preview__table-row {
  height: 23px;
  padding: 2px 3px;
  border-bottom: 1px solid rgb(148 163 184 / 0.1);
}

.entry-display-preview__table-row--empty .entry-display-preview__table-name {
  height: 2px;
  background: rgb(148 163 184 / 0.14);
}

.entry-display-preview__table-thumb {
  width: 16px;
  height: 16px;
}

.entry-display-preview__table-type,
.entry-display-preview__table-chapter {
  overflow: hidden;
  color: rgb(100 116 139);
  font-size: 4.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-display-preview__table-rarity {
  width: 20px;
  height: 6px;
  border-radius: 2px;
  background: rgb(251 191 36 / 0.3);
}

.entry-display-preview--timeline {
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 4px 7px 4px 11px;
}

.entry-display-preview__timeline-row {
  position: relative;
  display: grid;
  min-width: 0;
  height: 27px;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.entry-display-preview__timeline-row:not(:last-child)::after {
  position: absolute;
  z-index: -1;
  top: 18px;
  bottom: -5px;
  left: 8px;
  width: 1px;
  background: rgb(251 191 36 / 0.32);
  content: "";
}

.entry-display-preview__timeline-node {
  z-index: 1;
  display: flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border: 2px solid #0b111d;
  border-radius: 50%;
  background: rgb(251 191 36);
  color: #111827;
}

.entry-display-preview__timeline-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.entry-display-preview__timeline-chapter {
  color: rgb(251 191 36 / 0.9);
  font-family: var(--font-system);
  font-size: 4.5px;
  font-weight: 700;
  line-height: 1;
}

.entry-display-preview__timeline-card {
  display: grid;
  min-width: 0;
  height: 17px;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  overflow: hidden;
  padding: 1px 4px 1px 1px;
  border: 1px solid rgb(148 163 184 / 0.18);
  border-radius: 3px;
  background: rgb(17 24 39 / 0.9);
}

.entry-display-preview__timeline-thumb {
  display: block;
  width: 13px;
  height: 13px;
  overflow: hidden;
  border: 1px solid rgb(251 191 36 / 0.35);
  border-radius: 2px;
}

.entry-display-preview__timeline-name {
  overflow: hidden;
  color: rgb(203 213 225);
  font-size: 5.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-display-preview--badges {
  align-items: center;
  gap: 4px;
  overflow: hidden;
}

.entry-display-preview__badge {
  display: flex;
  min-width: 0;
  height: 32px;
  flex: 0 1 auto;
  align-items: center;
  gap: 3px;
  padding: 3px 6px 3px 3px;
  overflow: hidden;
  border: 1px solid rgb(251 191 36 / 0.28);
  border-radius: 5px;
  background: rgb(251 191 36 / 0.05);
}

.entry-display-preview__badge-thumb {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  overflow: hidden;
  border-radius: 3px;
}

.entry-display-preview__badge--empty > :first-child {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
}

.entry-display-preview__badge--empty > :last-child {
  width: 50%;
  height: 2px;
  background: rgb(148 163 184 / 0.15);
}

.entry-display-preview--inventory {
  display: grid;
  grid-template-columns: repeat(var(--preview-columns, 3), minmax(0, 1fr));
  gap: 5px;
  padding: 7px 10px;
}

.entry-display-preview--inventory-auto {
  --preview-columns: 6;
  padding: 7px;
}

.entry-display-preview__inventory-slot {
  position: relative;
  min-width: 0;
  overflow: hidden;
  aspect-ratio: 1;
  border: 2px solid rgb(55 65 81);
  border-radius: 4px;
  background: rgb(15 23 42 / 0.9);
}

.entry-display-preview__inventory-corner {
  position: absolute;
  z-index: 2;
  top: 2px;
  left: 2px;
  width: 4px;
  height: 4px;
  border-top: 1px solid rgb(251 191 36 / 0.45);
  border-left: 1px solid rgb(251 191 36 / 0.45);
}

.entry-display-preview__inventory-slot--auto {
  border-color: rgb(148 163 184 / 0.3);
  border-radius: 4px;
}

.entry-display-preview--card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.entry-display-preview__mini-card {
  display: grid;
  min-width: 0;
  grid-template-rows: minmax(0, 1fr) 12px;
  overflow: hidden;
  border: 1px solid rgb(251 191 36 / 0.2);
  border-radius: 4px;
  background: #111827;
}

.entry-display-preview__mini-card-image {
  display: block;
  min-height: 0;
  overflow: hidden;
}

.entry-display-preview__mini-card-name {
  align-self: center;
  padding: 0 3px;
  font-size: 5.5px;
}

.entry-display-preview__mini-card--empty {
  grid-template-rows: 1fr 12px;
}

.entry-display-preview__mini-card--empty > :last-child {
  width: 60%;
  height: 2px;
  align-self: center;
  justify-self: center;
  background: rgb(148 163 184 / 0.14);
}

.entry-display-preview--spotlight {
  position: absolute;
  display: grid;
  grid-template-columns: 40% minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  background: #05070c;
}

.entry-display-preview__spotlight-accent {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: rgb(251 191 36);
}

.entry-display-preview__spotlight-image {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgb(251 191 36 / 0.35);
  border-radius: 6px;
  background: #111827;
}

.entry-display-preview__spotlight-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.entry-display-preview__spotlight-line {
  width: 78%;
}

.entry-display-preview__spotlight-line:last-child {
  width: 52%;
}

.entry-display-preview__spotlight-name {
  color: rgb(226 232 240);
  font-size: 8px;
}

.entry-display-preview__spotlight-metadata {
  color: rgb(251 191 36 / 0.75);
  font-family: var(--font-system);
  font-size: 5px;
  line-height: 1;
}

.entry-display-preview__spotlight-name--empty {
  color: rgb(100 116 139);
  font-family: var(--font-system);
  font-size: 6px;
  text-transform: uppercase;
}

.entry-display-card--new {
  display: flex;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  color: var(--t2, rgb(148 163 184));
}

.entry-display-card__new-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.25rem 0.5rem;
  font-size: 12px;
  font-weight: 600;
}

.entry-display-card__new-plus {
  color: var(--entry-display-accent);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}

@container series-cover-section (min-width: 32rem) {
  .series-cover-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@container series-cover-section (max-width: 24rem) {
  .entry-display-card__placement {
    max-width: 100%;
    font-size: 5.5px;
  }

  .entry-display-preview__list-name,
  .entry-display-preview__table-name,
  .entry-display-preview__timeline-copy > :first-child,
  .entry-display-preview__badge > :last-child {
    display: none;
  }

  .entry-display-preview-shell[data-preview-kind="card_grid"] {
    aspect-ratio: 4 / 3;
  }

  .entry-display-preview--card-grid {
    gap: 3px;
    padding: 5px;
  }

  .entry-display-preview__mini-card,
  .entry-display-preview__mini-card--empty {
    grid-template-rows: minmax(0, 1fr) 10px;
  }

  .entry-display-preview__mini-card-name {
    display: block;
    padding: 0 2px;
    font-size: 4.75px;
  }
}

@container series-cover-section (min-width: 44rem) {
  .series-cover-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  @container series-cover-section (min-width: 48rem) {
    .series-cover-grid {
      grid-template-columns: repeat(5, minmax(0, 1fr));
    }
  }
}

.timeline-entry__rarity {
  min-width: 0;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-character-rail {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.series-character-card {
  position: relative;
  display: block;
  width: 6.5rem;
  height: 9rem;
  flex: 0 0 6.5rem;
  overflow: hidden;
  border: 1px solid rgb(55 65 81);
  border-radius: 0.5rem;
  background: rgb(3 7 18);
}

.series-character-card:focus-visible,
.series-character-card__add:focus-visible {
  outline: 2px solid rgb(250 204 21 / 0.8);
  outline-offset: -3px;
}

.series-character-card__image,
.series-character-card__fallback {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.series-character-card__image {
  object-fit: cover;
  object-position: top center;
  transition: transform 180ms ease;
}

.series-character-card:hover .series-character-card__image {
  transform: scale(1.025);
}

.series-character-card__fallback {
  background: rgb(31 41 55);
}

.series-character-card__tier {
  position: absolute;
  z-index: 1;
  top: 0.5rem;
  left: 0.5rem;
  max-width: calc(100% - 1rem);
  overflow: hidden;
  border: 1px solid rgb(234 179 8 / 0.5);
  border-radius: 0.25rem;
  background: rgb(0 0 0 / 0.82);
  padding: 0.125rem 0.375rem;
  color: rgb(253 224 71);
  font-size: 0.5rem;
  line-height: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-character-card__overlay {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: end;
  gap: 0.375rem;
  min-height: 4.5rem;
  padding: 2.5rem 0.5rem 0.5rem;
  background: linear-gradient(to top, rgb(0 0 0 / 0.97), rgb(0 0 0 / 0.72), transparent);
}

.series-character-card__name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-character-card__arrow {
  display: flex;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(107 114 128 / 0.7);
  border-radius: 999px;
  color: rgb(209 213 219);
  font-size: 0.75rem;
}

.series-character-card__add {
  display: flex;
  width: 5rem;
  height: 9rem;
  flex: 0 0 5rem;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border: 1px dashed rgb(75 85 99);
  border-radius: 0.5rem;
  color: rgb(107 114 128);
  font-size: 0.625rem;
  line-height: 0.875rem;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .series-story-progress__fill,
  .series-character-card__image,
  .series-cover-card,
  .series-cover-card__cover,
  .series-cover-card__image {
    transition: none;
  }

  .series-character-card:hover .series-character-card__image {
    transform: none;
  }

  .series-cover-card:hover,
  .series-cover-card:focus-visible,
  .series-cover-card:hover .series-cover-card__image,
  .series-cover-card:focus-visible .series-cover-card__image {
    transform: none;
  }
}

.series-hero-strip {
  min-height: 46px;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgb(55 65 81 / 0.7);
  border-radius: var(--radius-control);
  background: rgb(3 7 18 / 0.5);
}

.series-hero-strip__reader-count {
  padding: 3px 7px;
  border: 1px solid rgb(71 85 105 / 0.45);
  border-radius: 4px;
  color: rgb(148 163 184);
  font-size: 9px;
  white-space: nowrap;
}

.series-mobile-header {
  padding: 1px 0 2px;
}

.series-reading-position-pill {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--color-reading-accent) 45%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--color-reading-accent) 7%, transparent);
  color: rgb(203 213 225);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

.series-reading-position-pill__change {
  margin-left: 3px;
  padding-left: 7px;
  border-left: 1px solid color-mix(in srgb, var(--color-reading-accent) 35%, transparent);
  color: var(--color-reading-accent);
  font-size: 9px;
}

.series-mobile-log-event,
.series-dashboard-log-event {
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(234 179 8 / 0.55);
  border-radius: 6px;
  background: rgb(113 63 18 / 0.24);
  color: rgb(253 224 71);
  font-size: 10px;
  font-weight: 700;
}

.series-mobile-log-event {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 13px;
  white-space: nowrap;
}

.series-dashboard-log-event {
  min-height: 38px;
}

.hero-menu__trigger {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(71 85 105 / 0.45);
  border-radius: 6px;
  background: rgb(15 23 42 / 0.68);
  color: rgb(148 163 184);
  font-size: 18px;
  line-height: 1;
}

.hero-menu__trigger:hover,
.hero-menu__trigger:focus-visible {
  border-color: rgb(234 179 8 / 0.55);
  color: rgb(253 224 71);
  outline: none;
}

.hero-menu__menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 5px);
  right: 0;
  width: 190px;
  overflow: hidden;
  padding: 4px;
  border: 1px solid rgb(55 65 81);
  border-radius: 8px;
  background: rgb(17 24 39 / 0.98);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.55);
}

.hero-menu__menu form {
  display: block;
}

.hero-menu__item {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 9px;
  border-radius: 5px;
  color: rgb(203 213 225);
  font-size: 11px;
  text-align: left;
}

.hero-menu__item:hover,
.hero-menu__item:focus-visible {
  background: rgb(51 65 85 / 0.55);
  color: white;
  outline: none;
}

.hero-menu__item--tracking {
  color: rgb(74 222 128);
}

.hero-menu__rule {
  display: block;
  height: 1px;
  margin: 4px 6px;
  background: rgb(55 65 81 / 0.75);
}

.hero-menu__count {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgb(250 204 21);
  color: rgb(17 24 39);
  font-family: var(--font-system);
  font-size: 9px;
  font-weight: 800;
}

.series-command-center__left-column,
.series-story-panel,
.series-command-center__right-rail,
.series-character-panel,
.series-story-progress {
  min-height: 0;
}

.series-command-center__left-column,
.series-story-panel,
.series-character-panel,
.series-story-progress {
  display: flex;
  flex-direction: column;
}

.series-command-center__left-column {
  gap: 12px;
}

.series-character-panel {
  flex: 1 1 auto;
}

.series-story-panel {
  height: 20rem;
}

.series-story-panel__header {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
}

.series-story-panel__summary {
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  line-height: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-story-panel__full-link {
  position: relative;
  z-index: 2;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: -14px;
  margin-bottom: -14px;
}

.series-story-panel__body {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  padding-right: 3px;
}

.series-story-panel__body .series-lore-frame {
  display: block;
  height: 100%;
  overflow: hidden;
}

.timeline-spine-scrubber {
  --timeline-spine-gold: rgb(251 191 36);
  --timeline-spine-gold-line: rgb(250 204 21);
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  column-gap: 4px;
  row-gap: 5px;
}

.timeline-spine-scrubber__track {
  position: relative;
  min-height: 0;
  grid-column: 1;
  grid-row: 1;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.timeline-spine-scrubber__line {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 16px;
  width: 2px;
  border-radius: 999px;
  background: rgb(71 85 105 / 0.85);
}

.timeline-spine-scrubber__handle {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 5px;
  display: flex;
  width: 24px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgb(251 191 36 / 0.58);
  border-radius: 999px;
  background: #111827;
  color: var(--timeline-spine-gold);
  cursor: grab;
  box-shadow: 0 8px 16px rgb(0 0 0 / 0.48);
  touch-action: none;
  user-select: none;
  will-change: transform;
}

.timeline-spine-scrubber__handle:hover,
.timeline-spine-scrubber__handle:focus-visible,
.timeline-spine-scrubber--dragging .timeline-spine-scrubber__handle {
  border-color: var(--timeline-spine-gold);
  outline: none;
  box-shadow: 0 8px 18px rgb(0 0 0 / 0.52), 0 0 13px rgb(251 191 36 / 0.32), inset 0 1px 0 rgb(255 255 255 / 0.08);
}

.timeline-spine-scrubber--dragging .timeline-spine-scrubber__handle {
  cursor: grabbing;
}

.timeline-spine-scrubber__grip {
  display: flex;
  width: 10px;
  flex-direction: column;
  gap: 3px;
}

.timeline-spine-scrubber__grip > span {
  display: block;
  height: 1px;
  border-radius: 999px;
  background: var(--timeline-spine-gold);
}

.timeline-spine-scrubber__window {
  min-width: 0;
  min-height: 0;
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
  mask-image: linear-gradient(#000 0, #000 calc(100% - 18px), transparent);
  -webkit-mask-image: linear-gradient(#000 0, #000 calc(100% - 18px), transparent);
}

.timeline-spine-scrubber--away-from-start .timeline-spine-scrubber__window {
  mask-image: linear-gradient(transparent, #000 14px, #000 calc(100% - 18px), transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 14px, #000 calc(100% - 18px), transparent);
}

.timeline-spine-scrubber__inner {
  min-width: 0;
  will-change: transform;
}

.timeline-spine-scrubber .timeline-rail,
.timeline-spine-scrubber .timeline-node {
  display: none;
}

.timeline-spine-scrubber .timeline-chapter {
  display: block;
}

.timeline-spine-scrubber .timeline-chapter-content {
  width: 100%;
}

.timeline-spine-scrubber__footer {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  grid-row: 2;
  color: var(--t3, rgb(100 116 139));
  font-family: var(--font-system);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.11em;
  line-height: 12px;
  text-transform: uppercase;
  white-space: nowrap;
}

.timeline-spine-scrubber__footer-rule {
  height: 1px;
  min-width: 12px;
  flex: 1 1 auto;
  background: rgb(71 85 105 / 0.48);
}

.timeline-spine-scrubber--static {
  display: block;
  height: auto;
}

.timeline-spine-scrubber--static .timeline-spine-scrubber__track,
.timeline-spine-scrubber--static .timeline-spine-scrubber__footer {
  display: none;
}

.timeline-spine-scrubber--static .timeline-spine-scrubber__window {
  height: auto;
  overflow: visible;
  mask-image: none;
  -webkit-mask-image: none;
}

.series-character-frame {
  display: flex;
  min-height: 10.75rem;
  flex: 1 1 auto;
  flex-direction: column;
}

.series-character-card__role {
  position: absolute;
  z-index: 1;
  top: 0.5rem;
  right: 0.5rem;
  max-width: calc(100% - 1rem);
  overflow: hidden;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background: rgb(250 204 21 / 0.92);
  color: rgb(17 24 39);
  font-size: 0.5rem;
  font-weight: 800;
  line-height: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-character-card__copy {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
}

.series-character-card__subtitle {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: rgb(148 163 184);
  font-size: 8px;
  line-height: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-character-panel__stats {
  display: none;
}

.series-character-panel__stats > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: rgb(100 116 139);
  font-family: var(--font-system);
  font-size: 8px;
  line-height: 16px;
}

.series-character-panel__stats dd {
  color: rgb(148 163 184);
  font-weight: 700;
}

.series-story-progress {
  flex: 1 1 auto;
  overflow: hidden;
  border: 1px solid rgb(55 65 81 / 0.55);
  border-radius: var(--radius-panel);
  background: rgb(17 24 39 / 0.62);
}

.series-story-progress__header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 16px 20px;
  border-bottom: 1px solid rgb(55 65 81 / 0.5);
}

.series-story-progress__books {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
}

.series-story-progress__book {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgb(55 65 81 / 0.3);
  border-radius: 8px;
  background: rgb(31 41 55 / 0.3);
  transition: border-color 120ms ease, background-color 120ms ease;
}

.series-story-progress__book:hover,
.series-story-progress__book:focus-within {
  border-color: rgb(75 85 99 / 0.5);
  background: rgb(255 255 255 / 0.025);
}

.series-story-progress__book--current {
  border-color: rgb(251 191 36 / 0.35);
  background: rgb(251 191 36 / 0.06);
}

.series-story-progress__number {
  display: flex;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(71 85 105 / 0.45);
  border-radius: 8px;
  background: rgb(55 65 81 / 0.5);
  color: rgb(148 163 184);
  font-size: 12px;
  font-weight: 700;
}

.series-story-progress__book--current .series-story-progress__number {
  border-color: rgb(251 191 36 / 0.6);
  background: rgb(251 191 36);
  color: rgb(26 20 2);
}

.series-story-progress__title {
  display: block;
  overflow: hidden;
  color: rgb(226 232 240);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-story-progress__metadata {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 4px;
  color: rgb(100 116 139);
  font-size: 10px;
  line-height: 15px;
}

.series-story-progress__track {
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(51 65 85 / 0.7);
}

.series-story-progress__fill {
  height: 100%;
  border-radius: inherit;
  background: rgb(251 191 36);
}

.mobile-story-progress-panel {
  --mobile-story-surface: rgb(17 24 39 / 0.65);
  --mobile-story-card: rgb(22 30 45 / 0.92);
  --mobile-story-accent-dim: rgb(251 191 36 / 0.07);
  --mobile-story-accent-line: rgb(251 191 36 / 0.55);
  display: none;
  margin-top: 13px;
  overflow: hidden;
  border: 1px solid rgb(55 65 81 / 0.6);
  border-radius: 14px;
  background: var(--mobile-story-surface);
}

.mobile-story-progress-panel__header {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 7px;
  padding: 13px 14px 10px;
}

.mobile-story-progress-panel__header h2 {
  flex: 0 0 auto;
  color: rgb(241 245 249);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.2;
}

.mobile-story-progress-panel__summary {
  min-width: 0;
  overflow: hidden;
  color: rgb(100 116 139);
  font-family: var(--font-system);
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-story-progress-panel__all {
  min-width: 44px;
  min-height: 44px;
  margin: -13px -9px -10px auto;
  color: rgb(251 191 36);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.mobile-story-progress-panel__all:focus-visible,
.mobile-story-progress-card__open:focus-visible,
.mobile-story-progress-sheet__close:focus-visible {
  outline: 2px solid rgb(251 191 36);
  outline-offset: -2px;
}

.mobile-story-progress-rail {
  display: flex;
  align-items: stretch;
  gap: 7px;
  margin: 0 -14px;
  overflow-x: auto;
  padding: 0 14px 13px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.mobile-story-progress-rail::-webkit-scrollbar {
  display: none;
}

.mobile-story-progress-card {
  position: relative;
  display: flex;
  width: 200px;
  min-height: 94px;
  flex: 0 0 200px;
  overflow: hidden;
  border: 1px solid rgb(55 65 81 / 0.55);
  border-radius: 11px;
  background: var(--mobile-story-card);
  scroll-snap-align: start;
}

.mobile-story-progress-card--current {
  border-color: var(--mobile-story-accent-line);
  background: var(--mobile-story-accent-dim);
}

.mobile-story-progress-card__open {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
}

.mobile-story-progress-card__content {
  position: relative;
  z-index: 2;
  display: grid;
  min-width: 0;
  width: 100%;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: 12px 20px 15px auto;
  column-gap: 12px;
  padding: 10px 12px;
  pointer-events: none;
}

.mobile-story-progress-card__state-row {
  display: contents;
}

.mobile-story-progress-card__number {
  display: inline-flex;
  width: 32px;
  height: 32px;
  grid-column: 1;
  grid-row: 1 / span 3;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(71 85 105 / 0.45);
  border-radius: 8px;
  background: rgb(55 65 81 / 0.5);
  color: rgb(148 163 184);
  font-size: 12px;
  font-weight: 700;
}

.mobile-story-progress-card--finished .mobile-story-progress-card__number {
  border-color: rgb(16 185 129 / 0.55);
  background: rgb(6 78 59 / 0.28);
  color: rgb(52 211 153);
}

.mobile-story-progress-card--current .mobile-story-progress-card__number {
  border-color: rgb(251 191 36);
  background: rgb(251 191 36);
  color: rgb(26 20 2);
}

.mobile-story-progress-card__state {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  overflow: hidden;
  color: rgb(100 116 139);
  font-family: var(--font-system);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mobile-story-progress-card--finished .mobile-story-progress-card__state {
  color: rgb(52 211 153 / 0.82);
}

.mobile-story-progress-card--current .mobile-story-progress-card__state {
  color: rgb(253 230 138);
}

.mobile-story-progress-card__title {
  display: block;
  grid-column: 2;
  grid-row: 2;
  overflow: hidden;
  color: rgb(226 232 240);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-story-progress-card__metadata {
  display: flex;
  min-width: 0;
  grid-column: 2;
  grid-row: 3;
  align-items: baseline;
  gap: 4px 6px;
  overflow: hidden;
  color: rgb(100 116 139);
  font-size: 10px;
  line-height: 15px;
  white-space: nowrap;
}

.mobile-story-progress-card__read-link {
  position: relative;
  z-index: 3;
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 3px;
  pointer-events: auto;
}

.mobile-story-progress-card__read-link .book-read-link,
.mobile-story-progress-sheet__metadata .book-read-link {
  position: relative;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 9px;
  font-weight: 500;
  line-height: 15px;
}

.mobile-story-progress-card__read-link .book-read-link::after,
.mobile-story-progress-sheet__metadata .book-read-link::after {
  position: absolute;
  inset: -6px -3px;
  content: "";
}

.mobile-story-progress-card__read-link .book-read-link:hover,
.mobile-story-progress-sheet__metadata .book-read-link:hover {
  background: transparent;
  color: var(--book-read-link-color);
}

.mobile-story-progress-card__track {
  display: block;
  height: 4px;
  grid-column: 1 / -1;
  grid-row: 4;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(51 65 85 / 0.8);
}

.mobile-story-progress-card__track > span {
  display: block;
}

.mobile-story-progress-card--add {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border-style: dashed;
  background: transparent;
  color: rgb(100 116 139);
  font-size: 9px;
}

.mobile-story-progress-card--add > :first-child {
  color: rgb(148 163 184);
  font-size: 20px;
  line-height: 1;
}

.mobile-story-progress-panel__empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px 13px;
  color: rgb(148 163 184);
  font-size: 11px;
}

.mobile-story-progress-panel__empty a {
  color: rgb(251 191 36);
}

.mobile-story-progress-sheet[hidden] {
  display: none;
}

.mobile-story-progress-sheet {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.mobile-story-progress-sheet__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgb(2 6 23 / 0.82);
}

.mobile-story-progress-sheet__panel {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 40rem);
  height: 86dvh;
  max-height: 86%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgb(71 85 105 / 0.7);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: rgb(10 15 27);
  box-shadow: 0 -24px 60px rgb(0 0 0 / 0.6);
}

.mobile-story-progress-sheet__handle {
  width: 36px;
  height: 4px;
  flex: 0 0 4px;
  margin: 8px auto 2px;
  border-radius: 999px;
  background: rgb(71 85 105);
}

.mobile-story-progress-sheet__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 11px;
  border-bottom: 1px solid rgb(55 65 81 / 0.65);
}

.mobile-story-progress-sheet__header > div {
  min-width: 0;
  flex: 1 1 auto;
}

.mobile-story-progress-sheet__header h2 {
  color: rgb(241 245 249);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25rem;
}

.mobile-story-progress-sheet__header span {
  display: block;
  margin-top: 2px;
  color: rgb(100 116 139);
  font-family: var(--font-system);
  font-size: 8px;
}

.mobile-story-progress-sheet__close {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid rgb(71 85 105 / 0.6);
  border-radius: var(--radius-control);
  color: rgb(148 163 184);
  font-size: 16px;
}

.mobile-story-progress-sheet__books {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.mobile-story-progress-sheet__book {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgb(55 65 81 / 0.3);
  border-radius: 8px;
  background: rgb(31 41 55 / 0.3);
}

.mobile-story-progress-sheet__book--current {
  border-color: var(--mobile-story-accent-line, rgb(251 191 36 / 0.55));
  background: var(--mobile-story-accent-dim, rgb(251 191 36 / 0.07));
}

.mobile-story-progress-sheet__number {
  display: flex;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(71 85 105 / 0.45);
  border-radius: 8px;
  background: rgb(55 65 81 / 0.5);
  color: rgb(148 163 184);
  font-size: 12px;
  font-weight: 700;
}

.mobile-story-progress-sheet__book--finished .mobile-story-progress-sheet__number {
  border-color: rgb(16 185 129 / 0.55);
  background: rgb(6 78 59 / 0.28);
  color: rgb(52 211 153);
}

.mobile-story-progress-sheet__book--current .mobile-story-progress-sheet__number {
  border-color: rgb(251 191 36);
  background: rgb(251 191 36);
  color: rgb(26 20 2);
}

.mobile-story-progress-sheet__book-copy {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
}

.mobile-story-progress-sheet__title {
  display: block;
  grid-column: 1;
  grid-row: 1;
  overflow: hidden;
  color: rgb(226 232 240);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-story-progress-sheet__metadata {
  display: flex;
  min-width: 0;
  grid-column: 1 / -1;
  grid-row: 2;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 4px;
  overflow: hidden;
  color: rgb(100 116 139);
  font-size: 10px;
  line-height: 15px;
  white-space: nowrap;
}

.mobile-story-progress-sheet__book-action {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  color: rgb(251 191 36);
  font-size: 10px;
  font-weight: 500;
  line-height: 15px;
}

.mobile-story-progress-sheet__track {
  height: 4px;
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(51 65 85 / 0.8);
}

.mobile-story-progress-sheet__add {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgb(71 85 105 / 0.7);
  border-radius: 11px;
  color: rgb(148 163 184);
  font-size: 11px;
}

body.mobile-story-progress-sheet-open {
  overflow: hidden;
}

.series-timeline-entry__primary {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
}

.series-timeline-entry__copy {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
}

.series-timeline-entry__name {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-timeline-entry__mobile-meta {
  display: none;
}

.series-timeline-entry__right {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.series-timeline-entry__verb {
  color: rgb(100 116 139);
  font-size: 9px;
  white-space: nowrap;
}

.series-timeline-entry__subject {
  display: inline-flex;
  flex: 0 0 auto;
}

.series-codex-section {
  min-width: 0;
}

.series-codex-section__header {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.series-codex-section .series-cover-card__sheet,
.series-codex-section .series-cover-card__cover {
  aspect-ratio: 5 / 4;
}

.series-below-fold-sections,
.series-author-section {
  margin-top: 14px;
}

.series-public-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width: 639px) {
  .series-story-panel {
    height: 19rem;
  }

  .series-story-panel__header > span {
    display: none;
  }

  .series-character-rail {
    padding-bottom: 2px;
  }

  .series-character-card {
    width: 106px;
    height: 142px;
    flex-basis: 106px;
  }

  .series-character-card__add {
    width: 106px;
    height: 142px;
    flex-basis: 106px;
  }

  .series-timeline .timeline-chapters {
    gap: 0.65rem;
  }

  .series-timeline .timeline-card.timeline-entry {
    min-height: 44px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .series-timeline-entry__primary {
    min-height: 34px;
  }

  .series-timeline-entry__mobile-meta {
    display: block;
    overflow: hidden;
    color: rgb(100 116 139);
    font-size: 8px;
    line-height: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .series-timeline-entry__verb,
  .series-timeline-entry__subject {
    display: none;
  }

  .timeline-entry__rarity {
    max-width: 5rem;
  }

  .series-codex-section__header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .series-codex-section__header > :last-child {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 1023px) {
  .mobile-story-progress-panel {
    display: block;
  }

  .series-story-panel {
    height: 24rem;
  }

  .series-dashboard-shell > .reading-position-prompt {
    display: none;
  }
}

@media (min-width: 1024px) {
  .series-dashboard-shell {
    padding-bottom: 18px;
  }

  .series-command-center__grid {
    height: clamp(35rem, calc(100dvh - 9.25rem), 38.5rem);
    min-height: 35rem;
    max-height: 38.5rem;
    grid-template-columns: 228px minmax(0, 1fr) 340px;
    align-items: stretch;
  }

  .series-command-center__left-column,
  .series-command-center__right-rail,
  .series-story-panel {
    height: 100%;
  }

  .series-character-frame {
    height: 100%;
    min-height: 0;
  }

  .series-character-rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    flex: 1 1 auto;
    align-content: start;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .series-character-card {
    width: 100%;
    height: 12.5rem;
    flex: none;
  }

  .series-character-card__add {
    width: 100%;
    height: 3rem;
    flex: none;
  }

  .series-character-panel__stats {
    display: block;
    flex: 0 0 auto;
    margin-top: 7px;
    padding-top: 6px;
    border-top: 1px solid rgb(55 65 81 / 0.45);
  }

  .series-story-panel {
    height: auto;
  }

}
body:has(.series-library-v2) {
  background-color: var(--color-codex-canvas);
  background-image:
    linear-gradient(var(--color-codex-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-codex-grid-line) 1px, transparent 1px);
  background-size: 52px 52px;
}

.series-library-v2,
.series-library-card {
  --bg: var(--color-codex-canvas);
  --surface: var(--color-codex-surface);
  --card: var(--color-codex-card);
  --card-2: var(--color-codex-card-raised);
  --border: var(--color-codex-border);
  --border-hi: var(--color-codex-border-strong);
  --text-1: var(--color-codex-text);
  --text-2: var(--color-codex-text-muted);
  --text-mut: var(--color-codex-text-subtle);
  --text-faint: var(--color-codex-text-faint);
  --gold: var(--color-codex-gold);
  --gold-soft: var(--color-codex-gold-soft);
  --blue: var(--color-codex-blue);
}

.series-library-v2 {
  min-height: calc(100vh - 60px);
  padding: 32px 0 88px;
}

.series-library-v2 *,
.series-library-v2 *::before,
.series-library-v2 *::after {
  box-sizing: border-box;
}

.series-library-shell {
  width: min(100% - 48px, 1280px);
  margin: 0 auto;
}

.series-library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 28px;
  min-height: 118px;
  padding: 26px 32px;
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  background: var(--card);
}

.series-library-hero h1 {
  margin: 0;
  color: var(--gold);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.05;
}

.series-library-hero p:last-child {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
}

.series-library-hero__stats {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.series-library-stat {
  min-width: 76px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(16, 21, 31, 0.72);
  text-align: center;
}

.series-library-stat strong {
  display: block;
  color: var(--gold);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.series-library-stat span {
  display: block;
  margin-top: 7px;
  color: var(--text-mut);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.series-library-new-button,
.series-library-primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid #f0b429;
  border-radius: 10px;
  background: var(--gold);
  color: #161207;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease;
}

.series-library-new-button:hover,
.series-library-primary-button:hover {
  border-color: #fcd34d;
  background: #fcd34d;
  color: #161207;
}

.series-library-search {
  margin: 28px 0 24px;
}

.series-library-search__form {
  width: min(100%, 460px);
}

.series-library-search__field {
  position: relative;
  display: flex;
  align-items: center;
}

.series-library-search__icon {
  position: absolute;
  left: 14px;
  color: var(--text-faint);
  pointer-events: none;
}

.series-library-search__input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  background: rgba(20, 26, 38, 0.72);
  color: var(--text-1);
  padding: 0 42px 0 40px;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.series-library-search__input::placeholder {
  color: var(--text-faint);
}

.series-library-search__input:focus {
  border-color: rgba(251, 191, 36, 0.48);
  background: rgba(20, 26, 38, 0.9);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.08);
}

.series-library-search__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-mut);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 180ms ease, color 180ms ease;
}

.series-library-search__clear:hover {
  background: rgba(150, 172, 205, 0.1);
  color: var(--text-1);
}

.series-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
  gap: 24px;
  align-items: stretch;
}

.series-library-card {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 26px;
  min-height: 232px;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text-1);
  padding: 24px;
  text-decoration: none;
  box-shadow: 0 18px 44px -36px rgba(0, 0, 0, 0.85);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.series-library-card--compact {
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  min-height: 176px;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 16px 38px -32px rgba(0, 0, 0, 0.9);
}

.series-library-card:hover {
  border-color: rgba(251, 191, 36, 0.42);
  color: var(--text-1);
}

.series-library-card__thumb {
  position: relative;
  width: 138px;
  aspect-ratio: 2 / 3;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--border-hi);
  border-radius: 9px;
  background: var(--slot);
}

.series-library-card--compact .series-library-card__thumb {
  width: 92px;
  border-radius: 8px;
}

.series-library-card__thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.series-library-card__thumb-logo {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  opacity: 0.7;
  transform: translate(-50%, -50%);
}

.series-library-card__thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(251, 191, 36, 0.78);
}

.series-library-card__thumb--sponsored {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  border-color: rgba(251, 191, 36, 0.36);
  background: rgba(251, 191, 36, 0.06);
}

.series-library-card__sponsored-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(251, 191, 36, 0.38);
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.08);
  color: var(--gold);
}


.series-library-card__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding-top: 2px;
}

.series-library-card__heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.series-library-card--compact .series-library-card__heading-row {
  flex-direction: column;
  gap: 8px;
}

.series-library-card__title {
  margin: 0;
  color: var(--gold);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.18;
  overflow-wrap: anywhere;
  transition: color 180ms ease;
}

.series-library-card--compact .series-library-card__title {
  font-size: 18px;
}

.series-library-card:hover .series-library-card__title {
  color: #fcd34d;
}

.series-library-card__tag {
  flex: 0 0 auto;
  min-height: 24px;
  border: 1px solid rgba(251, 191, 36, 0.42);
  border-radius: 6px;
  background: rgba(20, 26, 38, 0.76);
  color: var(--gold);
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.series-library-card__byline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.series-library-card__byline {
  margin: 8px 0 0;
  color: var(--text-mut);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.series-library-card__byline-row .series-library-card__byline {
  margin: 0;
}

.series-library-card__byline strong {
  color: var(--gold-soft);
  font-weight: 800;
}

.series-library-card__description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}

.series-library-card--compact .series-library-card__description {
  -webkit-line-clamp: 2;
  margin-top: 12px;
  font-size: 13px;
}

.series-library-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border-hi);
  color: var(--text-mut);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.series-library-card--compact .series-library-card__meta {
  gap: 8px 12px;
  padding-top: 12px;
  font-size: 11px;
}

.series-library-card__meta strong {
  color: var(--text-1);
  font-weight: 700;
}

.series-library-card__placement-label {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em;
  min-width: 0;
}

.series-library-card__meta--action {
  align-items: center;
  justify-content: space-between;
}

.series-library-card__cta {
  color: var(--gold);
  font-weight: 800;
  transition: transform 180ms ease, color 180ms ease;
}

.series-library-card:hover .series-library-card__cta {
  color: #fcd34d;
  transform: translateX(2px);
}

.series-library-card--sponsored {
  border-color: var(--series-card-accent-border, rgba(251, 191, 36, 0.32));
  background: var(--card);
}

.series-library-card--sponsored:hover {
  border-color: var(--series-card-accent-border-hi, rgba(251, 191, 36, 0.54));
  background: var(--card);
}

.series-library-card--sponsored .series-library-card__title,
.series-library-card--sponsored:hover .series-library-card__title,
.series-library-card--sponsored .series-library-card__cta,
.series-library-card--sponsored:hover .series-library-card__cta,
.series-library-card--sponsored .series-library-card__meta strong {
  color: var(--series-card-accent, var(--gold));
}

.series-library-card--sponsored .series-library-card__tag {
  border-color: var(--series-card-accent-border, rgba(251, 191, 36, 0.42));
  color: var(--series-card-accent, var(--gold));
}

/* A book ad in the library: the frame carries the border so "Sponsored"
   can sit in it, and the card inside is the link. */
.series-library-ad-frame {
  height: 100%;
  border: 1px solid var(--series-card-accent-border, rgba(251, 191, 36, 0.32));
  border-radius: 14px;
  background: var(--color-codex-card);
  box-shadow: 0 18px 44px -36px rgba(0, 0, 0, 0.85);
  transition: border-color 180ms ease;
}

.series-library-ad-frame:has(.series-library-card:hover) {
  border-color: var(--series-card-accent-border-hi, rgba(251, 191, 36, 0.54));
}

.series-library-card--framed,
.series-library-card--framed:hover {
  height: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.series-library-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 72px 24px;
  text-align: center;
}

.series-library-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border: 1px solid var(--border-hi);
  border-radius: 16px;
  background: var(--card);
  color: var(--text-faint);
  box-shadow: 0 18px 48px -34px rgba(0, 0, 0, 0.9);
}

.series-library-empty h3 {
  margin: 24px 0 0;
  color: var(--text-1);
  font-size: 24px;
  font-weight: 800;
}

.series-library-empty p {
  max-width: 460px;
  margin: 10px auto 28px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .series-library-v2 {
    padding-top: 24px;
  }

  .series-library-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .series-library-hero__stats {
    justify-content: flex-start;
  }

  .series-library-new-button {
    justify-self: start;
  }
}

@media (max-width: 700px) {
  .series-library-shell {
    width: min(100% - 20px, 1280px);
  }

  .series-library-hero {
    padding: 22px;
  }

  .series-library-hero h1 {
    font-size: 30px;
  }

  .series-library-search__form {
    width: 100%;
  }

  .series-library-grid {
    gap: 14px;
  }

  .series-library-card {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
    min-height: 176px;
    padding: 16px;
    border-radius: 12px;
  }

  .series-library-card__thumb {
    width: 92px;
    border-radius: 8px;
  }

  .series-library-sponsored-badge {
    left: 8px;
    right: 8px;
    justify-content: center;
    padding: 0 5px;
    font-size: 8px;
  }

  .series-library-card__sponsored-icon {
    width: 38px;
    height: 38px;
  }

  .series-library-card__heading-row {
    flex-direction: column;
    gap: 8px;
  }

  .series-library-card__title {
    font-size: 18px;
  }

  .series-library-card__description {
    -webkit-line-clamp: 2;
    margin-top: 12px;
    font-size: 13px;
  }

  .series-library-card__meta {
    gap: 8px 12px;
    padding-top: 12px;
    font-size: 11px;
  }
}

@media (max-width: 440px) {
  .series-library-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
  }

  .series-library-card__thumb {
    width: 72px;
  }

  .series-library-card__description {
    display: none;
  }
}
.series-timeline .timeline-rail {
  left: 0.875rem;
}

.series-timeline .timeline-chapters {
  gap: 0.85rem;
}

.series-timeline .timeline-chapter {
  gap: 0.625rem;
}

.series-timeline .timeline-node {
  width: 1.75rem;
  height: 1.75rem;
  border-width: 2px;
}

.series-timeline .timeline-node svg {
  width: 0.8rem;
  height: 0.8rem;
}

.series-timeline .timeline-chapter-content {
  gap: 0.5rem;
}

.series-timeline .timeline-chapter-header {
  padding-top: 0.15rem;
}

.series-timeline .timeline-chapter-title {
  font-size: 0.75rem;
  line-height: 1.15rem;
}

.series-timeline .timeline-card {
  border-radius: 0.5rem;
}

.series-timeline .timeline-card > summary,
.series-timeline a.timeline-card,
.series-timeline div.timeline-card {
  padding: 0.45rem 0.55rem;
}

.timeline-entry-group > summary::-webkit-details-marker {
  display: none;
}

.series-timeline .timeline-entry-group > summary {
  min-height: 2.75rem;
  align-items: center;
}

.series-timeline .timeline-entry-group__context {
  margin-top: 0.1rem;
  line-height: 0.8rem;
}

.series-timeline .timeline-entry--world {
  border-color: rgba(59, 130, 246, 0.42);
  background: rgba(30, 64, 175, 0.12);
}

.timeline-subject {
  display: inline-flex;
  min-width: 0;
  max-width: 9rem;
  align-items: center;
  gap: 0.3rem;
  color: rgb(156 163 175);
  font-size: 0.625rem;
  line-height: 1rem;
}

a.timeline-subject {
  min-width: 1.5rem;
  min-height: 1.5rem;
}

@media (max-width: 639px) {
  a.timeline-subject {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
}

.timeline-subject__avatar {
  display: inline-flex;
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(107, 114, 128, 0.65);
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.92);
}

.timeline-subject--world {
  color: rgb(96 165 250);
}

.timeline-subject--world .timeline-subject__avatar {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(30, 64, 175, 0.25);
}

.timeline-subject__fallback {
  width: 0.65rem;
  height: 0.65rem;
}

@media (max-width: 639px) {
  .series-timeline .timeline-card > summary,
  .series-timeline a.timeline-card,
  .series-timeline div.timeline-card {
    padding: 0.4rem 0.5rem;
  }

  .series-timeline .timeline-chapter-title {
    font-size: 0.7rem;
  }

  .timeline-subject {
    max-width: 5.75rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .series-timeline .timeline-snapshot > summary,
  .series-timeline .timeline-snapshot > summary > svg {
    animation: none;
    transition: none;
  }
}
:root {
  --bg: var(--color-codex-form-canvas);
  --surface: var(--color-codex-form-surface);
  --surface-2: var(--color-codex-form-surface-raised);
  --card: var(--color-codex-form-card);
  --card-2: var(--color-codex-form-card-raised);
  --border: var(--color-codex-border-soft);
  --border-mid: var(--color-codex-border-mid);
  --gold: var(--color-codex-gold);
  --text-1: var(--color-codex-form-text);
  --text-2: var(--color-codex-form-text-muted);
  --text-3: var(--color-codex-form-text-subtle);
  --system-focus-border: rgba(251, 191, 36, 0.3);
  --system-focus-ring: rgba(251, 191, 36, 0.06);
  --system-option-height: 36px;
}

.system-form-shell {
  max-width: 980px;
  margin: 0 auto;
}

.system-form-page-header {
  margin-bottom: 22px;
}

.system-form-page-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.system-form-page-title-row .page-title,
.system-form-page-title {
  margin: 0;
  color: var(--gold);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0;
}

.system-form-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.07);
  color: var(--gold);
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.system-form-page-header .page-subtitle,
.system-form-page-subtitle {
  margin-top: 6px;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.5;
}

.system-form-page-header .breadcrumb-nav {
  margin-bottom: 0;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.5;
}

.system-form-page-header .breadcrumb-link {
  color: var(--text-3);
}

.system-form-page-header .breadcrumb-link:hover {
  color: var(--gold);
}

.system-form-page-header .breadcrumb-current {
  color: var(--text-2);
}

.system-form-page-header .breadcrumb-separator {
  color: rgba(90, 96, 114, 0.7);
}

.system-form {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
  padding: 28px;
  box-shadow: none;
  counter-reset: system-form-card-section;
}

.system-form--embedded {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.system-form--inline {
  width: auto;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  counter-reset: none;
}

.system-form > :first-child {
  margin-top: 0;
}

.system-form .card,
.system-form .manager-column,
.system-form .manager-column-side,
.system-form .manager-column-full {
  border-color: var(--border);
  background: transparent;
  box-shadow: none;
}

.system-form-section,
.system-form .form-section {
  counter-increment: system-form-card-section;
  margin-top: 28px;
  padding-top: 0;
  border-top: 0;
  display: block;
}

.system-form > .card {
  counter-increment: system-form-card-section;
}

.system-form > .card > .manager-header::before,
.system-form > .card > .manager-column-full > .manager-header::before,
.system-form > .card > .p-4 > .manager-header::before,
.system-form > .card > .p-4.sm\:p-6 > .manager-header::before {
  content: counter(system-form-card-section, decimal-leading-zero);
  margin-right: 12px;
  color: var(--gold);
  font-family: var(--font-system);
  font-size: 12px;
  font-weight: 600;
}

.system-form-section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.system-form-section-kicker {
  font-family: var(--font-system);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.system-form-section-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.system-form-section-copy h2 {
  margin: 0;
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.system-form-section-copy p {
  margin: 0;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.35;
}

.system-form .section-header-sm,
.system-form .manager-title {
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.system-form .section-subtitle,
.system-form .text-help,
.system-form .section-description {
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.45;
}

.system-form .template-settings-display-section + div {
  margin-top: 18px;
}

.form-label,
label.form-label,
.system-form .manager-header label,
.system-form label:not(.system-boolean-label):not(.system-custom-select-option):not([class*="cursor-pointer"]):not([class*="rounded-lg"]):not([class*="flex-1"]) {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.system-form .form-label abbr,
.system-form .required,
.system-required {
  color: var(--gold);
  text-decoration: none;
}

.form-input,
.form-select,
.form-textarea,
.manager-input,
.input,
.system-form input[type="text"],
.system-form input[type="email"],
.system-form input[type="url"],
.system-form input[type="search"],
.system-form input[type="tel"],
.system-form input[type="number"],
.system-form input[type="date"],
.system-form input[type="datetime-local"],
.system-form input[type="password"],
.system-form input[type="file"],
.system-form textarea,
.system-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--card-2);
  color: var(--text-1);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.4;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.system-form textarea,
.system-form .form-textarea {
  min-height: 108px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.manager-input:focus,
.input:focus,
.system-form input:focus,
.system-form textarea:focus,
.system-form select:focus {
  outline: none;
  border-color: var(--system-focus-border);
  box-shadow: 0 0 0 3px var(--system-focus-ring);
}

.system-form ::placeholder {
  color: rgba(90, 96, 114, 0.75);
}

.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:active,
.form-select:-webkit-autofill,
.form-select:-webkit-autofill:hover,
.form-select:-webkit-autofill:active,
.form-textarea:-webkit-autofill,
.form-textarea:-webkit-autofill:hover,
.form-textarea:-webkit-autofill:active,
.manager-input:-webkit-autofill,
.manager-input:-webkit-autofill:hover,
.manager-input:-webkit-autofill:active,
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:active,
.system-searchable-select-input:-webkit-autofill,
.system-searchable-select-input:-webkit-autofill:hover,
.system-searchable-select-input:-webkit-autofill:active,
.system-form input:-webkit-autofill,
.system-form input:-webkit-autofill:hover,
.system-form input:-webkit-autofill:active,
.system-form textarea:-webkit-autofill,
.system-form textarea:-webkit-autofill:hover,
.system-form textarea:-webkit-autofill:active {
  border-color: var(--border) !important;
  background-color: var(--card-2) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--card-2) inset !important;
  -webkit-text-fill-color: var(--text-1) !important;
  caret-color: var(--text-1) !important;
  transition: background-color 999999s ease-out, color 999999s ease-out, -webkit-text-fill-color 999999s ease-out;
}

.form-input:-webkit-autofill:focus,
.form-select:-webkit-autofill:focus,
.form-textarea:-webkit-autofill:focus,
.manager-input:-webkit-autofill:focus,
.input:-webkit-autofill:focus,
.system-searchable-select-input:-webkit-autofill:focus,
.system-form input:-webkit-autofill:focus,
.system-form textarea:-webkit-autofill:focus {
  border-color: var(--system-focus-border) !important;
  background-color: var(--card-2) !important;
  -webkit-box-shadow:
    0 0 0 1000px var(--card-2) inset,
    0 0 0 3px var(--system-focus-ring) !important;
  -webkit-text-fill-color: var(--text-1) !important;
  caret-color: var(--text-1) !important;
}

.form-input[readonly],
.form-textarea[readonly],
.manager-input[readonly],
.input[readonly],
.system-form input[readonly],
.system-form textarea[readonly] {
  color: var(--text-2);
  cursor: not-allowed;
  opacity: 0.75;
}

.system-form input[type="color"],
.form-input[type="color"],
.manager-input[type="color"] {
  min-height: 42px;
  padding: 4px;
}

.system-form input[type="radio"] {
  accent-color: var(--gold);
}

.system-form [data-sortable-item] {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-2);
  cursor: grab;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.system-form [data-sortable-item]:hover {
  border-color: var(--border-mid);
  background: var(--card);
}

.system-form .drag-handle {
  display: inline-grid;
  place-items: center;
  width: 12px;
  height: 16px;
  color: var(--text-3);
  cursor: grab;
}

.system-form .drag-handle:hover,
.system-form [data-sortable-item]:hover .drag-handle {
  color: var(--text-2);
}

.system-form .drag-handle svg {
  display: none;
}

.system-form .drag-handle::before {
  content: "";
  width: 2px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow:
    0 4px 0 currentColor,
    0 8px 0 currentColor,
    4px 0 0 currentColor,
    4px 4px 0 currentColor,
    4px 8px 0 currentColor;
}

.system-form .card,
.system-form .rounded-xl.border,
.system-form .rounded-lg.border {
  border-color: var(--border);
}

.system-form .bg-gray-800,
.system-form .bg-gray-800\/20,
.system-form .bg-gray-800\/30,
.system-form .bg-gray-800\/40,
.system-form .bg-gray-800\/50,
.system-form .bg-gray-900,
.system-form .bg-gray-900\/30,
.system-form .bg-gray-900\/40,
.system-form .bg-gray-900\/45,
.system-form .bg-gray-900\/50,
.system-form .bg-gray-950\/35,
.system-form .bg-gray-950\/40 {
  background-color: var(--card-2);
}

.system-form [data-controller~="searchable-select"] {
  width: 100%;
}

.system-form [data-controller~="searchable-select"] [role="button"],
.system-form [data-searchable-select-target~="search"] {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-2);
  color: var(--text-1);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.4;
  box-shadow: none;
}

.system-form [data-searchable-select-target~="search"] {
  padding-left: 36px;
}

.system-form [data-controller~="searchable-select"] [role="button"]:focus,
.system-form [data-searchable-select-target~="search"]:focus {
  outline: none;
  border-color: var(--system-focus-border);
  box-shadow: 0 0 0 3px var(--system-focus-ring);
}

.system-form [data-searchable-select-target~="dropdown"],
.system-form [data-searchable-select-target~="optionsContainer"] {
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  background: var(--surface-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.system-form [data-searchable-select-target~="option"] {
  border-left: 0;
  border-radius: 4px;
  color: var(--text-1);
  font-size: 13px;
}

.system-form [data-searchable-select-target~="option"]:hover {
  background: var(--card);
}

.system-form [data-controller~="image-generator"] [data-image-upload-preview-target="dropZone"] {
  border: 1px dashed var(--border-mid);
  border-radius: 8px;
  background: var(--card-2);
}

.system-form [data-controller~="image-generator"] [data-image-upload-preview-target="dropZone"]:hover {
  border-color: rgba(251, 191, 36, 0.3);
  background: var(--card);
}

.system-form [data-image-generator-target="optimizeButton"] {
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}

.system-form [data-image-generator-target="optimizeButton"]:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-1);
}

.system-custom-select {
  position: relative;
  width: 100%;
}

.system-custom-select[data-state="open"],
.system-searchable-select[data-state="open"] {
  z-index: 80;
}

/* Image source switcher (Upload file / Generate with AI): plain-text underline tabs
   sitting on a full-width divider; the active indicator overlaps the divider line. */
.image-mode-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid #374151;
}

.image-mode-tab {
  padding: 10px 2px;
  margin-bottom: -1px;
  border: 0;
  background: none;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: #7d879b;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.image-mode-tab:hover {
  color: #aab3c2;
}

.image-mode-tab[aria-pressed="true"] {
  color: #f5c33b;
  font-weight: 600;
  border-bottom-color: #f5c33b;
}

/* Step labels inside the generation flow ("1 · Describe", "2 · Extract & refine"). */
.image-step-label {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7d879b;
}

/* Prompt-source switch (Build from entry / Write my own prompt): compact pills. */
.prompt-mode-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.prompt-mode-pill {
  border: 0;
  background: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: #7d879b;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.prompt-mode-pill:hover {
  color: #aab3c2;
}

.prompt-mode-pill[aria-pressed="true"],
.prompt-mode-pill:has(input:checked) {
  color: #f5c33b;
  background: rgba(245, 195, 59, 0.1);
  font-weight: 600;
}

.prompt-mode-pill:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* A floating menu is clipped and painted under sibling cards when it opens inside
   a .card, which hides overflow. While a select is open, let its card overflow and
   lift it above neighbouring cards so the options stay fully visible. */
.card:has(.system-custom-select[data-state="open"]),
.card:has(.system-searchable-select[data-state="open"]) {
  overflow: visible;
  z-index: 60;
}

.system-custom-select-button {
  display: flex;
  min-height: 42px;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-2);
  color: var(--text-1);
  padding: 10px 12px;
  text-align: left;
  font-size: 13.5px;
  line-height: 1.4;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.system-custom-select-button:focus,
.system-custom-select[data-state="open"] .system-custom-select-button {
  outline: none;
  border-color: var(--system-focus-border);
  box-shadow: 0 0 0 3px var(--system-focus-ring);
}

.system-custom-select-button:hover {
  border-color: var(--border-mid);
  background: var(--card);
}

.system-custom-select-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.system-custom-select-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-custom-select-chevron {
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 14px;
  line-height: 1;
  transition: color 150ms ease, transform 150ms ease;
}

.system-custom-select[data-state="open"] .system-custom-select-chevron {
  color: var(--gold);
  transform: rotate(180deg);
}

.system-custom-select-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: max-content;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  background: var(--surface-2);
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.system-custom-select-option {
  display: grid;
  min-height: var(--system-option-height);
  width: 100%;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-1);
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  line-height: 1.25;
}

.system-custom-select-option:hover,
.system-custom-select-option:focus {
  outline: none;
  background: var(--card);
}

.system-custom-select-option[data-selected="true"] {
  background: rgba(251, 191, 36, 0.1);
  color: var(--gold);
}

.system-custom-select-check {
  color: var(--gold);
  font-size: 12px;
  line-height: 1;
}

.system-custom-select-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Wrapped menus keep their option labels fully readable at every width so long
   "Provider · Model · Credits · Cost" labels never truncate inside the panel. */
.system-custom-select[data-label-layout="wrap"] .system-custom-select-option {
  align-items: flex-start;
}

.system-custom-select[data-label-layout="wrap"] .system-custom-select-menu {
  min-width: 0;
}

.system-custom-select[data-label-layout="wrap"] .system-custom-select-option-label {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

@media (max-width: 639px) {
  .system-custom-select[data-label-layout="wrap"] .system-custom-select-button {
    align-items: flex-start;
  }

  .system-custom-select[data-label-layout="wrap"] .system-custom-select-label {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .system-custom-select[data-label-layout="wrap"] .system-custom-select-chevron {
    margin-top: 0.2em;
  }
}

.system-searchable-select {
  position: relative;
  width: 100%;
}

.system-searchable-select-trigger,
.system-searchable-select-input {
  display: flex;
  min-height: 42px;
  width: 100%;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-2);
  color: var(--text-1);
  padding: 10px 36px 10px 12px;
  text-align: left;
  font-size: 13.5px;
  line-height: 1.4;
  box-shadow: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.system-searchable-select-trigger {
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.system-searchable-select-trigger--compact {
  min-height: 38px;
  padding-block: 8px;
}

.system-searchable-select-input {
  display: block;
}

.system-searchable-select .system-searchable-select-input:not(.system-searchable-select-input--embedded) {
  padding-left: 35px;
  padding-right: 42px;
}

.system-searchable-select-input--embedded {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 13px;
}

.system-searchable-select-trigger:hover,
.system-searchable-select-input:hover {
  border-color: var(--border-mid);
  background: var(--card);
}

.system-searchable-select-trigger:focus,
.system-searchable-select-input:focus,
.system-searchable-select[data-state="open"] .system-searchable-select-trigger,
.system-searchable-select[data-state="open"] > .relative .system-searchable-select-input {
  outline: none;
  border-color: var(--system-focus-border);
  box-shadow: 0 0 0 3px var(--system-focus-ring);
}

.system-searchable-select-value {
  min-width: 0;
  overflow: hidden;
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-searchable-select-value.text-gray-200 {
  color: var(--text-1);
}

.system-searchable-select-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--text-3);
  padding: 4px;
  cursor: pointer;
  transition: color 150ms ease;
}

.system-searchable-select-clear:hover,
.system-searchable-select-clear:focus {
  color: var(--text-2);
  outline: none;
}

.system-searchable-select-chevron {
  flex: 0 0 auto;
  color: var(--text-3);
  transition: color 150ms ease, transform 150ms ease;
}

.system-searchable-select[data-state="open"] .system-searchable-select-chevron {
  color: var(--gold);
  transform: rotate(180deg);
}

.system-searchable-select [data-searchable-select-target~="searchIcon"] {
  color: var(--text-3);
}

.system-searchable-select .searchable-select-input.searchable-select-selected {
  padding-left: 35px;
}

.system-searchable-select-menu {
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  background: var(--surface-2);
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.system-searchable-select-search-panel {
  margin-bottom: 4px;
  padding: 4px;
  border-bottom: 1px solid var(--border);
}

.system-searchable-select-option,
.system-searchable-select-create {
  display: block;
  min-height: var(--system-option-height);
  width: 100%;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-1);
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.system-custom-select-option.hidden,
.system-searchable-select-option.hidden,
.system-searchable-select-create.hidden {
  display: none;
}

.system-searchable-select-option--compact {
  padding-block: 8px;
}

.system-searchable-select-option:hover,
.system-searchable-select-option[data-highlighted="true"],
.system-searchable-select-create:hover,
.system-searchable-select-create:focus {
  outline: none;
  background: var(--card);
}

.system-searchable-select-option[data-selected="true"] {
  background: rgba(251, 191, 36, 0.1);
  color: var(--gold);
}

.system-searchable-select-option[data-selected="true"] .text-gray-200 {
  color: var(--gold);
}

.system-searchable-select-option .text-gray-500 {
  color: var(--text-3);
}

.system-searchable-select [data-type-to-search],
.system-searchable-select [data-no-results],
.system-searchable-select [data-loading-results],
.system-searchable-select [data-result-limit] {
  color: var(--text-3);
}

.system-form .form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.system-form .form-actions > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.system-form .btn-secondary,
.system-form a.btn-secondary,
.system-form .btn-ghost {
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--text-2);
  box-shadow: none;
}

.system-form .btn-secondary:hover,
.system-form a.btn-secondary:hover,
.system-form .btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-1);
}

.system-form .btn-primary,
.system-form input[type="submit"].btn-primary,
.system-form button.btn-primary {
  border: 1px solid rgba(251, 191, 36, 0.5);
  background: var(--gold);
  color: #1a1208;
  font-weight: 600;
  box-shadow: 0 0 0 3px var(--system-focus-ring);
}

.system-form .btn-primary:hover,
.system-form input[type="submit"].btn-primary:hover,
.system-form button.btn-primary:hover {
  border-color: rgba(251, 191, 36, 0.7);
  background: #facc15;
  color: #1a1208;
}

.system-boolean-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-2);
  padding: 14px;
}

.system-boolean-row--disabled {
  opacity: 0.55;
}

.system-boolean-label {
  display: block;
  color: var(--text-1);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}

.system-boolean-description {
  margin: 3px 0 0;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.4;
}

.system-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  background: var(--card-2);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.system-toggle[data-state="on"] {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--system-focus-ring);
}

.system-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 150ms ease, background-color 150ms ease;
}

.system-toggle[data-state="on"] .system-toggle-thumb {
  transform: translateX(16px);
  background: #1a1208;
}

.system-toggle--touch,
.system-toggle--touch[data-state="on"] {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.system-toggle--touch::before {
  content: "";
  position: absolute;
  inset: 11px 3px;
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  background: var(--card-2);
}

.system-toggle--touch[data-state="on"]::before {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--system-focus-ring);
}

.system-toggle--touch .system-toggle-thumb { top: 14px; left: 6px; }

.system-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.system-toggle-column {
  min-width: 0;
}

.system-toggle-heading {
  margin: 0 0 8px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}


.system-reorderable-column-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.system-reorderable-column-label {
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.system-reorderable-column-line {
  min-width: 20px;
  flex: 1 1 auto;
  border-top: 1px solid var(--border);
}

.system-reorderable-add {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.system-reorderable-add:hover {
  color: #facc15;
}

.system-reorderable-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-2);
  padding: 8px 10px 8px 8px;
  cursor: grab;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.system-reorderable-row:hover {
  border-color: var(--border-mid);
  background: var(--card);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.system-form [data-sortable-item].system-dropdown-open-in-reorderable,
.system-form [data-sortable-item].system-dropdown-open-in-reorderable:hover,
.system-reorderable-row.system-dropdown-open-in-reorderable,
.system-reorderable-row.system-dropdown-open-in-reorderable:hover {
  position: relative;
  z-index: 90;
  transform: none;
}

.system-reorderable-row:active {
  cursor: grabbing;
}

.system-form .effect-fields[data-sortable-item],
.effect-fields.system-reorderable-row {
  align-items: flex-start;
  cursor: default;
}

.system-form .effect-fields[data-sortable-item]:hover,
.effect-fields.system-reorderable-row:hover {
  transform: none;
}

.system-form .effect-fields[data-sortable-item]:active,
.effect-fields.system-reorderable-row:active {
  cursor: default;
}

.effect-fields .form-textarea {
  resize: none;
}

.system-reorderable-fields {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: end;
  gap: 12px;
}

.system-drag-grip {
  display: grid;
  width: 10px;
  height: 14px;
  flex: 0 0 10px;
  grid-template-columns: repeat(2, 2px);
  grid-template-rows: repeat(3, 2px);
  gap: 2px;
  color: var(--text-3);
  cursor: grab;
}

.system-drag-grip::before,
.system-drag-grip::after {
  content: "";
}

.system-drag-grip {
  background-image: radial-gradient(currentColor 1px, transparent 1.2px);
  background-size: 4px 4px;
}

.system-reorderable-row:hover .system-drag-grip {
  color: var(--text-2);
}

.system-row-delete-button {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-3);
  transition: background-color 150ms ease, color 150ms ease;
}

.system-row-delete-button:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
}

.system-row-delete-button svg {
  width: 13px;
  height: 13px;
}

.codex-setup-wizard {
  width: min(100%, 1020px);
  margin: 0 auto;
  padding: 24px 16px 40px;
  font-family: var(--font-interface);
}

.codex-setup-page-header {
  margin-bottom: 20px;
}

.codex-setup-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.codex-setup-title-copy {
  min-width: 0;
}

.codex-setup-title {
  margin: 0;
  color: var(--gold);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.codex-setup-title span {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.codex-setup-description {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.5;
}

.codex-setup-ghost-link {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.codex-setup-ghost-link:hover,
.codex-setup-ghost-link:focus {
  outline: none;
  border-color: var(--border-mid);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-1);
}

.codex-setup-progress-meter {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.codex-setup-progress-label,
.codex-setup-progress-count,
.codex-setup-panel-number,
.codex-setup-panel-status,
.codex-setup-progress-label {
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.codex-setup-progress-track {
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--card-2);
}

.codex-setup-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.codex-setup-progress-count {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.codex-setup-tab-strip {
  position: relative;
  display: flex;
  gap: 4px;
  margin-top: 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}

.codex-setup-tab {
  position: relative;
  display: inline-flex;
  min-height: 38px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: var(--text-3);
  padding: 10px 14px 12px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  transition: color 150ms ease;
}

.codex-setup-tab-label {
  white-space: nowrap;
}

.codex-setup-tab::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  content: "";
}

.codex-setup-tab:hover {
  color: var(--text-2);
}

.codex-setup-tab-dot {
  display: inline-flex;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--text-4);
  border-radius: 999px;
  color: var(--text-3);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.codex-setup-tab--complete .codex-setup-tab-dot {
  border-color: var(--gold);
  background: var(--gold);
  color: #ffffff;
}

.codex-setup-tab--current {
  color: var(--gold);
}

.codex-setup-tab--current::after {
  background: var(--gold);
}

.codex-setup-tab--current .codex-setup-tab-dot {
  border-color: var(--gold);
  color: var(--gold);
}

.codex-setup-tab--disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.codex-setup-tab--disabled:hover {
  color: var(--text-3);
}

.codex-setup-content-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 240px;
  gap: 20px;
  max-width: 1020px;
}

.codex-setup-main-panel,
.codex-setup-about-rail {
  min-width: 0;
}

.codex-setup-about-rail {
  position: sticky;
  top: 16px;
  align-self: start;
}

.codex-setup-panel,
.codex-setup-about-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: none;
}

.system-form.codex-setup-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.codex-setup-panel-header {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-control) var(--radius-control) 0 0;
  background: var(--surface);
  padding: 14px 20px;
}

.codex-setup-panel-number {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.codex-setup-panel-header h2 {
  min-width: 0;
  flex: 1 1 auto;
  margin: 0;
  color: var(--text-1);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

.codex-setup-panel-status {
  flex: 0 0 auto;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.06);
  color: var(--gold);
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.codex-setup-panel-body {
  overflow: visible;
  padding: 16px 20px 20px;
}

.codex-setup-panel-description {
  max-width: 540px;
  margin: 0 0 14px;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.5;
}

.codex-setup-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  background: var(--card-2);
  padding: 12px 20px;
}

.codex-setup-skip-step {
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
}

.codex-setup-skip-step:hover,
.codex-setup-skip-step:focus {
  outline: none;
  color: var(--text-2);
}

.codex-setup-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.codex-setup-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.codex-setup-button--ghost {
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--text-2);
}

.codex-setup-button--ghost:hover,
.codex-setup-button--ghost:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.24);
  color: var(--text-1);
}

.codex-setup-button--primary {
  border: 1px solid rgba(251, 191, 36, 0.5);
  background: var(--gold);
  color: #1a1208;
  box-shadow: 0 0 0 3px var(--system-focus-ring);
}

.codex-setup-button--primary:hover,
.codex-setup-button--primary:focus {
  outline: none;
  border-color: rgba(251, 191, 36, 0.7);
  background: #facc15;
  color: #1a1208;
}

.codex-setup-about-card {
  padding: 14px;
}

.codex-setup-about-card h2 {
  margin: 0;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.codex-setup-about-card p {
  margin: 9px 0 0;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.55;
}

.codex-setup-about-card strong {
  color: var(--text-1);
  font-weight: 600;
}

.codex-setup-about-callout {
  display: none;
}

.codex-setup-table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-2);
  overflow: visible;
}

.codex-setup-table--select-open {
  position: relative;
  z-index: 40;
}

.codex-setup-rarity-editor {
  width: min(100%, 420px);
}

.codex-setup-stat-editor {
  width: min(100%, 520px);
}

.equipment-editor-layout {
  display: grid;
  max-width: 640px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

.equipment-editor-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-2);
  padding: 12px;
}

.equipment-editor-group--bottom {
  grid-column: 1 / -1;
}

.equipment-editor-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 72px;
  gap: 6px;
  padding-bottom: 18px;
}

.equipment-editor-list--bottom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-bottom: 0;
}

.equipment-editor-slot-row {
  display: grid;
  min-height: 32px;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  padding: 4px 6px;
}

.equipment-editor-slot-row.sortable-ghost {
  opacity: 0.5;
}

/* Touch-only affordances: hidden on desktop, revealed in the stacked layout below 768px. */
.equipment-editor-count,
.equipment-editor-col-toggle,
.equipment-editor-add-row {
  display: none;
}

.codex-setup-books-editor {
  width: min(100%, 560px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-2);
  overflow: hidden;
}

.codex-setup-book-header,
.codex-setup-book-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 80px 22px;
  align-items: center;
  column-gap: 10px;
}

.codex-setup-book-header {
  min-height: 28px;
  padding: 0 9px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.codex-setup-book-row {
  min-height: 34px;
  border-top: 1px solid var(--border);
  padding: 4px 9px;
}

.codex-setup-book-row:focus-within {
  position: relative;
  z-index: 5;
}

.codex-setup-display-row {
  overflow: visible;
  align-items: flex-start;
}

.codex-setup-display-row:focus-within {
  position: relative;
  z-index: 50;
}

.codex-setup-display-row .system-custom-select[data-state="open"] {
  z-index: 100;
}

.codex-setup-display-row .system-custom-select-menu {
  z-index: 10000;
  min-width: 192px;
}

.codex-setup-display-row .system-custom-select-option {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.codex-setup-display-row-body {
  display: grid;
  flex: 1 1 auto;
  gap: 14px;
}

.codex-setup-display-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12rem 5.5rem 5.5rem 2rem;
  align-items: end;
  gap: 12px;
}

.codex-setup-display-entry-type-group {
  display: grid;
  gap: 8px;
}

.codex-setup-display-entry-type-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.codex-setup-display-entry-type-option {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-2);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.codex-setup-display-entry-type-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--gold);
}

.codex-setup-display-toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.codex-setup-empty-state {
  max-width: 560px;
  border: 1px dashed var(--border-mid);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--text-3);
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.45;
}

.codex-setup-locked-entry-type input[readonly] {
  color: var(--text-2);
}

.codex-setup-locked-entry-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-3);
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.codex-setup-entry-type-fields {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.codex-setup-entry-type-name {
  min-width: 0;
}

.codex-setup-entry-type-action {
  justify-self: end;
}

.system-form .equipment-editor-input {
  width: 100%;
  min-height: 24px;
  height: 24px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-1);
  padding: 5px 7px;
  font-size: 13px;
  line-height: 1;
}

.system-form .equipment-editor-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 0 0 3px var(--system-focus-ring);
}

.codex-setup-table-header,
.codex-setup-table-row {
  display: grid;
  align-items: center;
  column-gap: 8px;
}

.codex-setup-rarity-grid {
  grid-template-columns: 24px minmax(0, 1fr) 42px 28px;
}

.codex-setup-stat-grid {
  grid-template-columns: 24px minmax(128px, 1fr) 116px 42px 28px;
}

.codex-setup-table-header {
  min-height: 28px;
  padding: 0 9px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.codex-setup-table-row {
  position: relative;
  min-height: 40px;
  padding: 5px 9px;
  border-top: 1px solid var(--border);
  background: transparent;
}

.system-form .codex-setup-table-row[data-sortable-item] {
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  cursor: default;
}

.codex-setup-table-row:focus-within {
  z-index: 5;
}

.codex-setup-table-row:has(.system-custom-select[data-state="open"]) {
  z-index: 1000;
}

.codex-setup-table-row--select-open {
  z-index: 1000;
}

.codex-setup-drag-grip,
.equipment-editor-grip {
  display: block;
  position: relative;
  width: 24px;
  height: 28px;
  justify-self: center;
  color: rgba(90, 96, 114, 0.82);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

.codex-setup-drag-grip::before,
.equipment-editor-grip::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow:
    0 6px 0 currentColor,
    0 12px 0 currentColor,
    6px 0 0 currentColor,
    6px 6px 0 currentColor,
    6px 12px 0 currentColor;
  content: "";
  transform: translate(-4px, -7px);
}

.codex-setup-drag-grip:active,
.equipment-editor-grip:active {
  cursor: grabbing;
}

.system-form .codex-setup-drag-grip.drag-handle,
.system-form .equipment-editor-grip.drag-handle {
  display: block;
  position: relative;
  width: 24px;
  height: 28px;
  color: rgba(90, 96, 114, 0.82);
  background-image: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

.system-form .codex-setup-drag-grip.drag-handle::before,
.system-form .equipment-editor-grip.drag-handle::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow:
    0 6px 0 currentColor,
    0 12px 0 currentColor,
    6px 0 0 currentColor,
    6px 6px 0 currentColor,
    6px 12px 0 currentColor;
  content: "";
  transform: translate(-4px, -7px);
}

.system-form .codex-setup-compact-input {
  width: 100%;
  min-height: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.025);
  color: var(--text-1);
  padding: 5px 9px;
  font-size: 13px;
  line-height: 1;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.system-form .codex-setup-compact-input:focus {
  outline: none;
  border-color: var(--system-focus-border);
  box-shadow: 0 0 0 3px var(--system-focus-ring);
}

.system-form .codex-setup-number-input {
  padding-right: 4px;
  padding-left: 4px;
  text-align: center;
  font-family: var(--font-system);
}

.codex-setup-type-select {
  position: relative;
  width: 100%;
  z-index: 1;
}

.codex-setup-type-select .system-custom-select[data-state="open"] {
  z-index: 100;
}

.codex-setup-stat-row .system-custom-select-button {
  min-height: 28px;
  height: 28px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  padding: 5px 8px;
  font-size: 13px;
  line-height: 1;
}

.codex-setup-stat-row .system-custom-select-chevron {
  font-size: 11px;
}

.codex-setup-stat-row .system-custom-select-menu {
  z-index: 10000;
  min-width: 144px;
}

.codex-setup-stat-row .system-custom-select-option {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 12px;
}

.system-form .codex-setup-color-swatch {
  display: inline-block;
  box-sizing: border-box;
  width: 24px;
  min-width: 24px;
  max-width: 24px;
  height: 24px;
  min-height: 24px;
  max-height: 24px;
  flex: 0 0 24px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  background: transparent;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}

.system-form input[type="color"].codex-setup-color-swatch {
  min-height: 24px;
  height: 24px;
  padding: 0;
}

.system-form .codex-setup-color-swatch:focus {
  outline: none;
  border-color: var(--system-focus-border);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12), 0 0 0 4px var(--system-focus-ring);
}

.system-form .codex-setup-color-swatch::-webkit-color-swatch-wrapper {
  padding: 0;
}

.system-form .codex-setup-color-swatch::-webkit-color-swatch {
  border: 0;
  border-radius: 999px;
}

.system-form .codex-setup-color-swatch::-moz-color-swatch {
  border: 0;
  border-radius: 999px;
}

.codex-setup-stat-controls {
  display: contents;
}

.codex-setup-stat-field {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: stretch;
}

.codex-setup-stat-field--colour {
  justify-content: center;
}

.codex-setup-stat-mobile-label {
  display: none;
}

.codex-setup-resource-color-placeholder {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  color: var(--text-4);
  font-size: 13px;
  line-height: 1;
}

.codex-setup-stat-field:not(.codex-setup-stat-field--empty) .codex-setup-resource-color-placeholder {
  display: none;
}

.codex-setup-stat-field--empty .codex-setup-resource-color {
  display: none;
}

.codex-setup-resource-color {
  display: flex;
  width: auto;
  min-width: 24px;
  align-items: center;
  justify-content: center;
}

.codex-setup-resource-color.hidden,
.codex-setup-resource-color-placeholder.hidden {
  display: none;
}

.codex-setup-delete-row {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-3);
  transition: background-color 150ms ease, color 150ms ease;
}

.codex-setup-delete-row:hover,
.codex-setup-delete-row:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
}

.codex-setup-delete-row svg {
  width: 12px;
  height: 12px;
}

.codex-setup-add-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  min-height: 30px;
  border: 1px dashed var(--border-mid);
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.codex-setup-add-row:hover,
.codex-setup-add-row:focus {
  outline: none;
  border-color: rgba(251, 191, 36, 0.36);
  background: rgba(251, 191, 36, 0.06);
  color: var(--gold);
}

@media (max-width: 900px) {
  .codex-setup-content-grid {
    grid-template-columns: 1fr;
  }

  .codex-setup-about-rail {
    position: static;
  }

  .codex-setup-display-main-grid,
  .codex-setup-display-toggle-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .codex-setup-wizard {
    padding: 18px 12px 32px;
  }

  .codex-setup-title-row,
  .codex-setup-panel-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .codex-setup-title-row {
    align-items: flex-start;
  }

  .codex-setup-progress-meter {
    grid-template-columns: 1fr auto;
  }

  .codex-setup-progress-label {
    grid-column: 1 / -1;
  }

  .codex-setup-footer-actions {
    justify-content: stretch;
    width: 100%;
  }

  .codex-setup-button,
  .codex-setup-footer-actions input[type="submit"].codex-setup-button {
    flex: 1 1 auto;
    width: 100%;
  }

  .codex-setup-tab-strip {
    margin-right: -12px;
    margin-left: -12px;
    padding: 0 12px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
  }

  .codex-setup-tab-strip::-webkit-scrollbar {
    display: none;
  }

  .codex-setup-tab {
    min-height: 44px;
    padding: 11px 13px 13px;
  }

  .codex-setup-about-rail {
    display: none;
  }

  .codex-setup-about-callout {
    display: block;
    margin: 0 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
  }

  .codex-setup-about-callout summary {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--gold);
    padding: 0 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    list-style: none;
    text-transform: uppercase;
  }

  .codex-setup-about-callout summary::-webkit-details-marker {
    display: none;
  }

  .codex-setup-about-callout p {
    margin: 0;
    border-top: 1px solid var(--border);
    color: var(--text-3);
    padding: 11px 12px 12px;
    font-size: 12px;
    line-height: 1.55;
  }

  .codex-setup-about-callout strong {
    color: var(--text-1);
    font-weight: 600;
  }

  .codex-setup-panel-header {
    padding: 13px 14px;
  }

  .codex-setup-panel-body {
    padding: 14px;
  }

  .codex-setup-panel-footer {
    padding: 12px 14px;
  }

  .codex-setup-rarity-editor,
  .codex-setup-stat-editor {
    width: 100%;
  }

  .codex-setup-rarity-editor .codex-setup-table-header,
  .codex-setup-stat-editor .codex-setup-table-header {
    display: none;
  }

  .codex-setup-rarity-row.codex-setup-rarity-grid {
    grid-template-columns: 28px minmax(0, 1fr) 44px 44px;
    gap: 8px;
    min-height: 54px;
    padding: 5px 8px;
  }

  .codex-setup-rarity-row .codex-setup-drag-grip,
  .codex-setup-rarity-row .codex-setup-delete-row {
    width: 32px;
    height: 44px;
  }

  .codex-setup-rarity-row .codex-setup-drag-grip {
    width: 28px;
  }

  .codex-setup-rarity-row .codex-setup-delete-row {
    justify-self: end;
  }

  .codex-setup-rarity-row .codex-setup-compact-input {
    min-height: 44px;
    height: 44px;
  }

  .codex-setup-stat-editor {
    border: 0;
    background: transparent;
  }

  .codex-setup-stat-editor .codex-setup-table-body {
    display: grid;
    gap: 9px;
  }

  .codex-setup-stat-row.codex-setup-stat-grid {
    grid-template-columns: 28px minmax(0, 1fr) 40px;
    grid-template-areas:
      "grip name remove"
      "controls controls controls";
    align-items: center;
    row-gap: 6px;
    column-gap: 8px;
    min-height: 0;
  }

  .system-form .codex-setup-stat-row[data-sortable-item] {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-2);
    padding: 8px 10px 10px;
  }

  .codex-setup-stat-row .codex-setup-drag-grip {
    grid-area: grip;
    width: 28px;
    height: 44px;
  }

  .codex-setup-stat-row input[id$="_display_name"] {
    grid-area: name;
    min-height: 44px;
    height: 44px;
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.018);
    padding: 0 10px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
  }

  .codex-setup-stat-row input[id$="_display_name"]::placeholder {
    color: transparent;
  }

  .codex-setup-stat-row input.codex-setup-stat-name-input--empty {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.025);
  }

  .codex-setup-stat-row input[id$="_display_name"]:focus {
    border-color: var(--system-focus-border);
    background: rgba(255, 255, 255, 0.035);
  }

  .codex-setup-stat-row .codex-setup-delete-row {
    grid-area: remove;
    width: 40px;
    height: 44px;
    justify-self: end;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-3);
  }

  .codex-setup-rarity-row .codex-setup-delete-row svg,
  .codex-setup-stat-row .codex-setup-delete-row svg {
    width: 16px;
    height: 16px;
  }

  .codex-setup-stat-row .codex-setup-delete-row:hover,
  .codex-setup-stat-row .codex-setup-delete-row:focus {
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-1);
  }

  .codex-setup-stat-row .codex-setup-stat-controls {
    display: grid;
    grid-area: controls;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding-left: 36px;
    padding-right: 48px;
  }

  .codex-setup-stat-row--resource .codex-setup-stat-controls {
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 8px;
    padding-right: 0;
  }

  .codex-setup-stat-row .codex-setup-stat-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .codex-setup-stat-row .codex-setup-stat-field--type {
    width: 100%;
  }

  .codex-setup-stat-row .codex-setup-stat-field--colour {
    flex: 0 0 40px;
    width: 100%;
    align-items: center;
    justify-content: center;
  }

  .codex-setup-stat-row .codex-setup-stat-field--empty {
    display: none;
  }

  .codex-setup-stat-mobile-label {
    display: none;
    color: var(--text-3);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: uppercase;
  }

  .codex-setup-stat-row .codex-setup-compact-input,
  .codex-setup-stat-row .system-custom-select-button {
    min-height: 44px;
    height: 44px;
  }

  .codex-setup-stat-row .system-custom-select-button {
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    padding-right: 10px;
    padding-left: 10px;
  }

  .codex-setup-stat-row .codex-setup-resource-color {
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .codex-setup-stat-row .codex-setup-resource-color-placeholder {
    display: none;
  }

  .system-form .codex-setup-entry-type-row {
    align-items: stretch;
    padding: 8px;
  }

  .codex-setup-entry-type-fields {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .codex-setup-entry-type-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    white-space: nowrap;
  }

  .codex-setup-entry-type-row .form-input {
    min-height: 40px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .codex-setup-entry-type-row .system-row-delete-button {
    width: 40px;
    height: 40px;
    margin-top: 0;
  }

  .codex-setup-entry-type-row .codex-setup-locked-entry-type-badge {
    min-height: 32px;
    padding-right: 9px;
    padding-left: 9px;
  }

  .codex-setup-panel-body > .btn-secondary.btn-sm[data-action="click->nested-form#addItem"] {
    width: 100%;
    min-height: 40px;
  }

  .system-form {
    padding: 18px;
  }

  .system-form.system-form--embedded,
  .system-form.system-form--inline {
    padding: 0;
  }

  .system-form-page-title-row {
    align-items: flex-start;
    gap: 8px;
  }

  .system-form-page-title-row .page-title,
  .system-form-page-title {
    font-size: 24px;
  }

  .system-form-section-header {
    align-items: flex-start;
    gap: 10px;
  }

  .system-form-section-copy {
    display: block;
  }

  .system-form-section-copy p {
    margin-top: 4px;
  }

  .form-input,
  .form-select,
  .form-textarea,
  .manager-input,
  .input,
  .system-form input[type="text"],
  .system-form input[type="email"],
  .system-form input[type="url"],
  .system-form input[type="search"],
  .system-form input[type="tel"],
  .system-form input[type="number"],
  .system-form input[type="date"],
  .system-form input[type="datetime-local"],
  .system-form input[type="password"],
  .system-form textarea,
  .system-form select,
  .system-custom-select-button,
  .system-custom-select-option,
  .system-searchable-select-trigger,
  .system-searchable-select-input,
  .system-searchable-select-option {
    font-size: 16px;
  }

  .system-custom-select-option,
  .system-searchable-select-option {
    min-height: 42px;
  }

  .system-form .form-actions,
  .system-form .form-actions > div {
    align-items: stretch;
    flex-direction: column-reverse;
    width: 100%;
  }

  .system-form .form-actions .btn-primary,
  .system-form .form-actions .btn-secondary,
  .system-form .form-actions .btn-ghost,
  .system-form .form-actions input[type="submit"],
  .system-form .form-actions button {
    width: 100%;
  }

  .system-toggle-grid {
    grid-template-columns: 1fr;
  }

  .system-boolean-row {
    align-items: flex-start;
    gap: 12px;
  }

  .system-reorderable-row {
    align-items: flex-start;
    padding: 10px;
  }

  .system-reorderable-fields {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .system-drag-grip {
    width: 14px;
    height: 18px;
    flex-basis: 14px;
    margin-top: 13px;
  }

  .system-row-delete-button {
    width: 34px;
    height: 34px;
    margin-top: 4px;
  }

  .system-row-delete-button svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 767.98px) {
  /* Stack the three equipment groups into one full-width column on touch. */
  .equipment-editor-layout {
    grid-template-columns: 1fr;
    max-width: none;
    gap: 14px;
  }

  .equipment-editor-group {
    padding: 10px 10px 12px;
  }

  .equipment-editor-group--bottom {
    grid-column: auto;
  }

  .equipment-editor-list,
  .equipment-editor-list--bottom {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    min-height: 0;
    gap: 8px;
    padding-bottom: 0;
  }

  /* Live per-group count beside the header label. */
  .equipment-editor-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }

  /* The header "+ Add" gives way to a full-width dashed row per group. */
  .equipment-editor-group .system-reorderable-add {
    display: none;
  }

  .equipment-editor-add-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin-top: 10px;
    border: 1px dashed var(--border-mid);
    border-radius: 8px;
    background: transparent;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
  }

  .equipment-editor-add-row:hover,
  .equipment-editor-add-row:focus,
  .equipment-editor-add-row:active {
    outline: none;
    border-color: rgba(251, 191, 36, 0.36);
    background: rgba(251, 191, 36, 0.06);
    color: var(--gold);
  }

  /* Compact one-line slot rows: grip | name | L/R/B toggle | trash. */
  .system-form .equipment-editor-slot-row {
    grid-template-columns: 28px minmax(0, 1fr) auto 40px;
    min-height: 52px;
    gap: 5px;
    padding: 5px 6px;
    background: rgba(255, 255, 255, 0.02);
  }

  .system-form .equipment-editor-slot-row .equipment-editor-grip {
    width: 28px;
    height: 44px;
  }

  .system-form .equipment-editor-input {
    min-height: 44px;
    height: 44px;
    padding: 0 10px;
    font-size: 16px;
  }

  /* Column toggle uses the design system's gold-dim active treatment. */
  .equipment-editor-col-toggle {
    display: inline-flex;
    align-items: stretch;
    height: 44px;
    padding: 2px;
    gap: 2px;
    border: 1px solid var(--border-mid);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
  }

  .equipment-editor-col-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 0 1px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
  }

  .equipment-editor-col-option.is-active {
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.14);
    color: var(--gold);
  }

  .system-form .equipment-editor-slot-row .system-row-delete-button {
    width: 40px;
    height: 44px;
    margin-top: 0;
    justify-self: center;
  }

  /* Safe-area padding for the wizard shell (status bar / notch). */
  .codex-setup-wizard {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  /* Action bar sticks to the bottom, clear of the home indicator. */
  .codex-setup-panel-footer {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.3);
  }
}
.equipment-slot-grid-item--grouped {
  overflow: visible;
}

.equipment-slot-group,
.equipment-slot-group-toggle {
  width: 100%;
  height: 100%;
}

.equipment-slot-group-toggle {
  position: relative;
  display: block;
  overflow: visible;
  border: 2.5px solid rgb(75 85 99);
  border-radius: 11px;
  background: rgb(17 24 39 / 0.9);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.4);
  cursor: pointer;
  list-style: none;
  transition: transform 160ms ease;
}

.equipment-slot-desktop-group-toggle::-webkit-details-marker {
  display: none;
}

.equipment-slot-group-toggle:active {
  transform: scale(0.95);
}

.equipment-slot-group-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
}

.equipment-slot-rarity-fan {
  position: absolute;
  right: 1px;
  bottom: 1px;
  left: 1px;
  z-index: 2;
  display: flex;
  height: 5px;
  gap: 1px;
  overflow: hidden;
  border-radius: 0 0 7px 7px;
}

.equipment-slot-rarity-fan > span {
  min-width: 0;
  flex: 1 1 0;
}

.equipment-slot-group-count {
  position: absolute;
  right: -7px;
  bottom: -6px;
  z-index: 3;
  min-width: 22px;
  padding: 2px 4px;
  border: 1.5px solid rgb(250 204 21);
  border-radius: 6px;
  background: rgb(15 23 42);
  color: rgb(250 204 21);
  font-family: var(--font-system);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.equipment-slot-group-sheet-heading {
  display: flex;
  padding-bottom: 14px;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid rgb(31 41 55);
}

.equipment-slot-group-sheet-heading strong {
  color: rgb(243 244 246);
  font-size: 18px;
}

.equipment-slot-group-sheet-heading span {
  color: rgb(107 114 128);
  font-family: var(--font-system);
  font-size: 12px;
}

.equipment-slot-group-row {
  display: grid;
  width: 100%;
  min-height: 64px;
  padding: 8px 0;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgb(31 41 55);
  text-align: left;
}

.equipment-slot-group-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border: 2px solid rgb(75 85 99);
  border-radius: 9px;
}

.equipment-slot-group-row-name {
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.equipment-slot-armory-card {
  height: 74px;
  min-height: 74px;
}

.equipment-slot-armory-grouped {
  position: relative;
  min-width: 0;
  padding: 0.5rem;
  border: 1px solid rgb(55 65 81);
  border-radius: 0.5rem;
  background: rgb(31 41 55 / 0.5);
}

.equipment-slot-desktop-group-toggle {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 100%;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
}

.equipment-slot-desktop-primary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 49px;
  height: 49px;
  flex: 0 0 49px;
  border: 2px solid rgb(75 85 99);
  border-radius: 0.5rem;
}

.equipment-slot-desktop-primary > .equipment-slot-icon,
.equipment-slot-desktop-primary > picture,
.equipment-slot-desktop-primary > picture > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.35rem;
}

.equipment-slot-desktop-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.equipment-slot-stacked-heading {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-slot-stacked-heading {
  color: rgb(156 163 175);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.equipment-slot-desktop-primary-name {
  display: -webkit-box;
  margin-top: 0.15rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.8rem;
  line-height: 1.2;
}

@media (min-width: 720px) and (min-height: 500px) and (max-width: 1023px) {
  .character-equipment-tablet .equipment-slot-armory-card {
    height: 60px;
    min-height: 60px;
    gap: 0.5rem;
    padding: 0.3125rem;
  }

  .character-equipment-tablet-grid {
    grid-template-columns: minmax(0, 1fr) 200px minmax(0, 1fr);
    column-gap: 10px;
  }

  .character-equipment-tablet-rail {
    gap: 10px;
  }

  .character-equipment-tablet .equipment-slot-armory-link,
  .character-equipment-tablet .equipment-slot-desktop-group-toggle {
    gap: 0.5rem;
  }

  .character-equipment-tablet .equipment-slot-armory-icon {
    width: 36px;
    height: 36px;
  }

  .character-equipment-tablet .equipment-slot-armory-add {
    width: 22px;
    height: 22px;
    margin-left: 0;
  }

  .character-equipment-tablet .equipment-slot-armory-add svg {
    width: 12px;
    height: 12px;
  }

  .character-equipment-tablet .equipment-slot-armory-label,
  .character-equipment-tablet .equipment-slot-stacked-heading {
    font-size: 9px;
    line-height: 1.2;
  }

  .character-equipment-tablet .equipment-slot-armory-name,
  .character-equipment-tablet .equipment-slot-desktop-primary-name {
    font-size: 12px;
    line-height: 1.2;
  }

  .character-equipment-tablet .equipment-slot-armory-empty {
    font-size: 11px;
    line-height: 1.2;
  }

  .character-equipment-tablet .equipment-slot-desktop-primary {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .character-equipment-tablet-bottom {
    gap: 12px;
    margin-top: 8px;
    padding: 20px 12px 12px;
    border-top: 1px solid rgb(55 65 81 / 0.65);
  }
}

.equipment-slot-complete-collection {
  position: absolute;
  top: var(--equipment-slot-panel-top, -1px);
  z-index: 40;
  display: flex;
  width: min(332px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 2rem));
  flex-direction: column;
  border: 1px solid rgb(55 65 81);
  border-radius: 0.65rem;
  background: rgb(17 24 39 / 0.99);
  box-shadow: 0 20px 52px rgb(0 0 0 / 0.62), inset 0 2px 0 rgb(250 204 21 / 0.75);
  color: rgb(156 163 175);
}

.equipment-slot-complete-collection[hidden] {
  display: none;
}

.relationship-entry-complete-collection {
  position: fixed;
  z-index: 70;
}

.relationship-entry-complete-collection::before {
  left: -7px;
  transform: rotate(45deg);
}

.relationship-entry-complete-collection--left::before {
  right: -7px;
  left: auto;
  transform: rotate(225deg);
}

.equipment-slot-armory-grouped--left .equipment-slot-complete-collection {
  left: calc(100% + 12px);
}

.equipment-slot-armory-grouped--right .equipment-slot-complete-collection {
  right: calc(100% + 12px);
}

.equipment-slot-armory-grouped--bottom .equipment-slot-complete-collection {
  top: auto;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
}

.equipment-slot-complete-collection::before {
  position: absolute;
  top: calc(var(--equipment-slot-panel-tail-center, 33px) - 6px);
  width: 12px;
  height: 12px;
  border-bottom: 1px solid rgb(55 65 81);
  border-left: 1px solid rgb(55 65 81);
  background: rgb(17 24 39);
  content: "";
}

.equipment-slot-armory-grouped--left .equipment-slot-complete-collection::before {
  left: -7px;
  transform: rotate(45deg);
}

.equipment-slot-armory-grouped--right .equipment-slot-complete-collection::before {
  right: -7px;
  transform: rotate(225deg);
}

.equipment-slot-armory-grouped--bottom .equipment-slot-complete-collection::before {
  top: auto;
  bottom: -7px;
  left: calc(50% - 6px);
  transform: rotate(315deg);
}

.equipment-slot-panel-header {
  display: grid;
  flex: 0 0 auto;
  padding: 13px 14px 11px;
  grid-template-columns: 1fr auto 28px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgb(55 65 81);
}

.equipment-slot-panel-header strong {
  color: rgb(250 204 21);
  font-size: 14px;
}

.equipment-slot-panel-header span {
  font-family: var(--font-system);
  font-size: 10px;
}

.equipment-slot-panel-close {
  width: 28px;
  height: 28px;
  border: 1px solid rgb(55 65 81);
  border-radius: 0.35rem;
  color: rgb(156 163 175);
}

.equipment-slot-panel-close:hover {
  border-color: rgb(250 204 21 / 0.65);
  color: rgb(250 204 21);
}

.equipment-slot-panel-items {
  min-height: 0;
  margin: 12px;
  padding: 0;
  border: 1px solid rgb(55 65 81 / 0.8);
  border-radius: 0.5rem;
  background: rgb(31 41 55 / 0.35);
  overflow: hidden;
  overflow-y: auto;
}

.equipment-slot-panel-group-heading {
  padding: 8px 10px 6px;
  border-bottom: 1px solid rgb(55 65 81 / 0.7);
  color: rgb(107 114 128);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.equipment-slot-collection-item {
  display: grid;
  max-width: 100%;
  min-width: 0;
  min-height: 60px;
  padding: 9px 10px;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgb(55 65 81 / 0.7);
  color: rgb(229 231 235);
  text-align: left;
  transition: background-color 150ms ease;
}

.equipment-slot-collection-item:last-child {
  border-bottom: 0;
}

.equipment-slot-collection-item:hover {
  background: rgb(55 65 81 / 0.72);
}

.equipment-slot-collection-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1.5px solid rgb(75 85 99);
  border-radius: 0.45rem;
  background: rgb(17 24 39);
}

.equipment-slot-collection-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.equipment-slot-collection-name {
  min-width: 0;
  color: rgb(229 231 235);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.equipment-slot-collection-meta {
  color: rgb(107 114 128);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.equipment-slot-panel-add {
  display: block;
  flex: 0 0 auto;
  padding: 9px 12px;
  border-top: 1px solid rgb(55 65 81);
  color: rgb(250 204 21);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.equipment-editor-slot-settings {
  grid-column: 2 / -1;
  max-width: 25rem;
}

.equipment-editor-slot-settings .system-boolean-row {
  min-height: 46px;
  padding: 8px 10px;
  background: rgb(255 255 255 / 0.02);
}
.timeline-event-list {
  container-type: inline-size;
}

.timeline-event-row-shell {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgb(55 65 81 / 0.85);
  border-radius: 0.5rem;
  background: rgb(17 24 39 / 0.7);
  background-clip: padding-box;
}

.timeline-event-row-shell > summary::-webkit-details-marker {
  display: none;
}

.timeline-event-group > summary:focus {
  outline: none;
}

.timeline-event-group > summary:focus-visible {
  outline: 2px solid rgb(251 191 36 / 0.28);
  outline-offset: -4px;
}

.timeline-event-row-shell--grouped {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.timeline-event-row {
  display: flex;
  min-height: 2.25rem;
  min-width: 0;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  color: rgb(209 213 219);
}

.timeline-event-row--standard {
  min-height: 4rem;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
}

.timeline-event-row--standard .timeline-event-row__identity {
  align-items: flex-start;
  gap: 0.75rem;
}

.timeline-event-row--standard .timeline-event-row__art {
  width: 2rem;
  height: 2rem;
  --timeline-rarity-frame-width: 2px;
}

.timeline-event-row--standard .timeline-event-row__copy {
  gap: 0.125rem;
}

.timeline-event-row--standard .timeline-event-row__name-line {
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
}

.timeline-event-row--standard .timeline-event-row__name {
  font-size: 0.875rem;
  line-height: 1.125rem;
}

.timeline-event-row__kind,
.timeline-event-row__notes {
  color: rgb(156 163 175);
  font-size: 0.6875rem;
  line-height: 0.9rem;
}

.timeline-event-row__notes {
  margin-top: 0.2rem;
  color: rgb(209 213 219);
}

.timeline-event-row--standard .timeline-event-row__rarity,
.timeline-event-row--standard .timeline-event-row__verb {
  border: 1px solid;
  border-radius: 0.2rem;
  padding: 0.0625rem 0.25rem;
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 0.875rem;
}

.timeline-event-row--standard .timeline-event-row__verb {
  border-color: rgb(34 197 94 / 0.15);
  background: rgb(20 83 45 / 0.45);
  color: rgb(110 231 183);
}

.timeline-event-row--standard .timeline-event-row__subline {
  font-size: 0.6875rem;
  line-height: 0.9rem;
}

.timeline-event-row--standard .timeline-event-row__subline--sources {
  align-items: flex-start;
  flex-wrap: wrap;
}

.timeline-event-row--standard .timeline-event-row__source-name {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.timeline-event-row--standard .timeline-event-row__right {
  align-self: stretch;
}

.timeline-event-row--standard .timeline-event-row__disclosure {
  min-height: 2rem;
}

.series-timeline .timeline-event-row-shell > .timeline-event-row {
  padding: 0.45rem 0.55rem;
}

summary.timeline-event-row {
  cursor: pointer;
}

.timeline-event-row:hover {
  background: rgb(31 41 55 / 0.4);
}

summary.timeline-event-row:focus {
  outline: none;
}

summary.timeline-event-row:focus-visible {
  outline: 2px solid rgb(251 191 36 / 0.28);
  outline-offset: -4px;
}

a.timeline-event-row:focus-visible,
a.timeline-event-source:focus-visible {
  outline: 2px solid rgb(251 191 36 / 0.28);
  outline-offset: -4px;
}

.timeline-event-row__identity {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.5rem;
}

.timeline-event-row__art,
.timeline-event-source__art,
.timeline-event-row__source-thumb {
  --timeline-rarity-color: rgb(75 85 99);
  --timeline-rarity-frame-width: 1px;
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 0;
  border-radius: 0.25rem;
  background: rgb(3 7 18 / 0.85);
}

.timeline-event-row__art::after,
.timeline-event-source__art::after,
.timeline-event-row__source-thumb::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 var(--timeline-rarity-frame-width) var(--timeline-rarity-color);
  content: "";
  pointer-events: none;
}

.timeline-event-row__art {
  width: 1.5rem;
  height: 1.5rem;
}

.timeline-event-row__art--mythical {
  box-shadow: 0 0 0.5rem rgb(232 121 249 / 0.16);
}

.timeline-event-row__copy,
.timeline-event-row__name-line,
.timeline-event-row__subline,
.timeline-event-row__source-summary {
  min-width: 0;
}

.timeline-event-row__copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.timeline-event-row__name-line,
.timeline-event-row__subline,
.timeline-event-row__source-summary {
  display: flex;
  align-items: center;
}

.timeline-event-row__name-line {
  gap: 0.35rem;
}

.timeline-event-row__name,
.timeline-event-row__source-name,
.timeline-event-source__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-event-row__name {
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 0.95rem;
}

a.series-timeline-entry__name {
  align-self: flex-start;
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}

.timeline-event-row__subline {
  gap: 0.3rem;
  color: rgb(100 116 139);
  font-size: 0.5625rem;
  line-height: 0.75rem;
  white-space: nowrap;
}

.timeline-event-row__relation {
  flex: none;
}

.timeline-event-row__source-summary {
  gap: 0.25rem;
  overflow: hidden;
}

.timeline-event-row__source-thumb {
  width: 0.875rem;
  height: 0.875rem;
}

.timeline-event-row__source-name {
  color: rgb(156 163 175);
}

.timeline-event-row__source-count,
.timeline-event-row__proposed,
.timeline-event-row__measure {
  flex: none;
  font-size: 0.5625rem;
  font-weight: 650;
}

.timeline-event-row__source-count {
  color: rgb(156 163 175);
}

.timeline-event-row__proposed {
  border: 1px solid rgb(234 179 8 / 0.35);
  border-radius: 0.2rem;
  padding: 0.0625rem 0.25rem;
  color: rgb(253 224 71);
  text-transform: uppercase;
}

.timeline-event-row__measure {
  border-radius: 0.2rem;
  padding: 0.0625rem 0.25rem;
  background: rgb(30 64 175 / 0.2);
  color: rgb(147 197 253);
}

.timeline-event-row__right {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.45rem;
}

.timeline-event-row__rarity,
.timeline-event-row__verb {
  white-space: nowrap;
  font-size: 0.5625rem;
}

.timeline-event-row__rarity {
  max-width: 8rem;
  overflow: hidden;
  border: 1px solid;
  border-radius: 0.2rem;
  padding: 0.0625rem 0.3rem;
  font-weight: 650;
  text-overflow: ellipsis;
}

.timeline-event-row__verb {
  color: rgb(100 116 139);
}

.timeline-event-row__character {
  min-width: 0;
}

.timeline-event-row__disclosure {
  display: inline-flex;
  min-height: 1.5rem;
  align-items: center;
  gap: 0.2rem;
  padding-left: 0.45rem;
  color: rgb(156 163 175);
  font-size: 0.5625rem;
  font-weight: 600;
  white-space: nowrap;
}

.timeline-event-row--expandable:hover .timeline-event-row__disclosure {
  color: rgb(253 224 71);
}

.timeline-event-row__chevron {
  display: inline-flex;
  width: 1rem;
  justify-content: center;
  transition: transform 150ms ease;
}

.timeline-event-row-shell[open] > summary .timeline-event-row__chevron {
  transform: rotate(180deg);
}

.timeline-event-group__rows > .timeline-event-row-shell--grouped + .timeline-event-row-shell--grouped {
  border-top: 1px solid rgb(55 65 81 / 0.85);
}

.timeline-event-drawer {
  border-top: 1px solid rgb(55 65 81 / 0.7);
  padding: 0.5rem 0.65rem 0.55rem;
  background: rgb(15 23 42 / 0.28);
}

.timeline-event-row-shell--grouped .timeline-event-drawer {
  margin-left: 0.5rem;
}

.timeline-event-drawer__heading {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.4rem;
  color: rgb(148 163 184);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 0.8rem;
}

.timeline-event-drawer__heading::before {
  width: 0.3rem;
  height: 0.3rem;
  flex: none;
  border-radius: 999px;
  background: rgb(148 163 184 / 0.7);
  content: "";
}

.timeline-event-drawer__sources {
  display: grid;
  gap: 0;
  border-top: 1px solid rgb(55 65 81 / 0.5);
}

.timeline-event-source {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  border-radius: 0;
  padding: 0.45rem 0.1rem;
  background: transparent;
}

.timeline-event-source + .timeline-event-source {
  border-top: 1px solid rgb(55 65 81 / 0.5);
}

.timeline-event-source:hover {
  background: rgb(31 41 55 / 0.4);
}

.timeline-event-source__art {
  width: 1.5rem;
  height: 1.5rem;
}

.timeline-event-row-shell--series .timeline-event-source {
  gap: 0.5rem;
  padding: 0.4rem 0.1rem;
}

.timeline-event-row-shell--series .timeline-event-source__art {
  width: 1.5rem;
  height: 1.5rem;
}

.timeline-event-source__meta {
  display: none;
}

.timeline-event-source__copy {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.timeline-event-source__name {
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1rem;
}

.timeline-event-source__meta,
.timeline-event-source__chapter,
.timeline-event-source__disposition {
  color: rgb(107 114 128);
  font-size: 0.6875rem;
  line-height: 0.875rem;
}

.timeline-event-source__timing {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.55rem;
}

.timeline-event-source__chapter,
.timeline-event-source__disposition {
  white-space: nowrap;
}

.timeline-event-source__chapter {
  color: rgb(156 163 175);
}

.timeline-event-source__chapter--compact {
  display: none;
}

.timeline-event-source__disposition {
  color: rgb(100 116 139);
}

.timeline-event-drawer__note {
  margin: 0.45rem 0 0;
  color: rgb(156 163 175);
  font-size: 0.6875rem;
  line-height: 1rem;
}

@container (max-width: 420px) {
  .timeline-event-row--standard {
    min-height: 3rem;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .timeline-event-row--standard .timeline-event-row__identity {
    gap: 0.5rem;
  }

  .timeline-event-row--standard .timeline-event-row__art {
    width: 1.75rem;
    height: 1.75rem;
  }

  .timeline-event-row--standard .timeline-event-row__name {
    font-size: 0.75rem;
    line-height: 1rem;
  }

  .timeline-event-row--expandable .timeline-event-row__kind,
  .timeline-event-row--expandable .timeline-event-row__subline,
  .timeline-event-row--expandable .timeline-event-row__notes {
    display: none;
  }

  .timeline-event-row--series {
    min-height: 2.75rem;
    gap: 0.45rem;
    padding: 0.35rem 0.5rem;
  }

  .timeline-event-row--series .timeline-event-row__verb,
  .timeline-event-row--series .timeline-event-row__character {
    display: none;
  }

  .timeline-event-row--series .timeline-event-row__right {
    gap: 0;
  }

  .timeline-event-row--series .timeline-event-row__disclosure {
    min-height: 2rem;
    padding-left: 0.4rem;
  }

  .timeline-event-drawer {
    padding: 0.4rem 0.45rem 0.45rem;
  }

  .timeline-event-row-shell--grouped .timeline-event-drawer {
    margin-left: 0.375rem;
  }

  .timeline-event-drawer__heading {
    margin-bottom: 0.3rem;
    font-size: 0.5625rem;
    line-height: 0.7rem;
  }

  .timeline-event-drawer__sources {
    gap: 0;
  }

  .timeline-event-source {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr);
    gap: 0.1rem 0.4rem;
    align-items: center;
    border: 0;
    border-radius: 0;
    padding: 0.35rem 0.1rem;
    background: transparent;
  }

  .timeline-event-source__art {
    grid-row: 1 / span 2;
    width: 1.5rem;
    height: 1.5rem;
  }

  .timeline-event-source__copy {
    display: contents;
  }

  .timeline-event-source__name {
    grid-column: 2;
    font-size: 0.625rem;
    line-height: 0.8rem;
  }

  .timeline-event-source__meta {
    display: none;
  }

  .timeline-event-source__timing {
    grid-column: 2;
    width: 100%;
    min-width: 0;
    padding-left: 0;
    gap: 0.3rem;
  }

  .timeline-event-source__chapter,
  .timeline-event-source__disposition {
    font-size: 0.5625rem;
    line-height: 0.7rem;
  }

  .timeline-event-source__chapter--full {
    display: none;
  }

  .timeline-event-source__chapter--compact {
    display: inline;
  }

  .timeline-event-source__disposition::before {
    margin-right: 0.3rem;
    content: "·";
  }

  .timeline-event-drawer__note {
    margin-top: 0.35rem;
    font-size: 0.625rem;
    line-height: 0.85rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .timeline-event-row__chevron {
    transition: none;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

@media (forced-colors: none) {
  :root {
    /* Match the production thumb while keeping the hover track dark and scrolling native. */
    scrollbar-color: #0b0d13 #161b27;
  }

  @supports selector(::-webkit-scrollbar) {
    :root { scrollbar-color: auto; }
    .codex-setup-tab-strip, .series-character-rail, .series-story-progress__books { scrollbar-color: #0b0d13 #161b27; }

    :where(*):not(.rich-tooltip, .mobile-tooltip-scroll-region, .timeline-spine-scrubber)::-webkit-scrollbar {
      background-color: transparent;
    }

    :where(*):not(.rich-tooltip, .mobile-tooltip-scroll-region, .timeline-spine-scrubber)::-webkit-scrollbar-thumb {
      background-color: #0b0d13;
      border-radius: 999px;
    }

    :where(*):not(.rich-tooltip, .mobile-tooltip-scroll-region, .timeline-spine-scrubber)::-webkit-scrollbar-track {
      background-color: #161b27;
    }
  }
}

.tooltip.rich-tooltip,
.mobile-tooltip-scroll-region,
.timeline-spine-scrubber {
  scrollbar-color: auto;
}
