/* Dark Academia: the service shell and explicit components only.
   Legacy pages and author-controlled narrative content keep their own styles. */
@font-face {
  font-family: "IS DM Sans";
  src: url("../fonts/dark-academia/DM-Sans.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "IS Cormorant Garamond";
  src: url("../fonts/dark-academia/Cormorant-Garamond.ttf") format("truetype");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

/* Scoped aliases extend the existing --is-* vocabulary, without changing the
   values inherited by existing reader, studio, profile or staff content. */
:where(.da-shell, .da-scope) {
  --is-font-ui: "IS DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --is-font-display: "IS Cormorant Garamond", Georgia, serif;
  --is-bg: #1b1513;
  --is-bg-soft: #231b17;
  --is-surface: #29201b;
  --is-surface-muted: #241b17;
  --is-surface-strong: #352820;
  --is-text: #e8dccb;
  --is-text-muted: #bcae9b;
  --is-text-inverse: #1b1513;
  --is-accent: #c5a779;
  --is-accent-strong: #e0c196;
  --is-border: #554334;
  --is-border-strong: #9b846a;
  --is-focus-ring: #edc58b;
  --is-focus: #edc58b33;
  --is-action: #753b46;
  --is-action-hover: #8b4654;
  --is-action-text: #f5e8d5;
  --is-success: #b9d5ad;
  --is-warning: #efcf91;
  --is-danger: #ffc2bc;
  --is-space-1: .25rem;
  --is-space-2: .5rem;
  --is-space-3: .75rem;
  --is-space-4: 1rem;
  --is-space-5: 1.5rem;
  --is-space-6: 2rem;
  --is-space-7: 3rem;
  --is-radius-sm: 3px;
  --is-radius-md: 6px;
  --is-radius-lg: 8px;
  --is-radius-card: 3px;
  --is-shadow-sm: 0 3px 10px #0003;
  --is-shadow-md: 0 12px 32px #0005;
  --is-shadow-lg: 0 22px 60px #0008;
  color: var(--is-text);
  font-family: var(--is-font-ui);
  font-size: 1rem;
  line-height: 1.55;
  letter-spacing: 0;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
}
body.da-app { background: radial-gradient(ellipse at top, #38291c66, transparent 40%), #1b1513; }
.da-app > .backgroundIS { display: none; }
:where(.da-shell, .da-scope) ::selection { color: #1b1513; background: #e0c196; }
:where(.da-shell, .da-scope) [hidden] { display: none !important; }
:where(.da-shell, .da-scope) :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--is-focus-ring);
  outline-offset: 4px;
}
:where(.da-shell, .da-scope) :is(a, button, summary, input, select) { scroll-margin-block: 1.5rem; }
:where(.da-shell, .da-scope) a { color: inherit; text-decoration: none; }
:where(.da-shell, .da-scope) a:hover { color: var(--is-accent-strong); text-decoration: underline; text-underline-offset: 4px; }
:where(.da-shell, .da-scope) button { font: inherit; }
.da-wrap { width: min(1280px, calc(100% - 40px)); margin-inline: auto; }
.da-muted { color: var(--is-text-muted); }
.da-skip { position: fixed; z-index: 2000; top: 8px; left: 8px; padding: 12px 16px; background: #e8dccb; color: #1b1513; transform: translateY(-160%); font: 1rem/1.4 "IS DM Sans", sans-serif; }
.da-skip:focus { transform: none; color: #1b1513; }

/* One header, one mobile menu. Bootstrap retains its real modal/offcanvas
   backdrop, scrolling, focus management and dismissal mechanisms. */
.site-navbar.da-shell { top: 0; padding: 0; min-height: 0; background: #211914; border: 0; border-bottom: 1px solid var(--is-border); box-shadow: none; transform: none; filter: none; backdrop-filter: none; contain: none; z-index: 1030; }
.da-shell .site-navbar-inner { width: min(1280px, calc(100% - 40px)); min-height: 80px; margin: 0 auto; padding: 0; display: flex; align-items: center; flex-wrap: nowrap; gap: 12px; position: static; transform: none; filter: none; backdrop-filter: none; contain: none; }
.da-shell .site-brand { display: flex; flex: 0 1 auto; align-items: center; gap: 10px; padding: 0; margin: 0 auto 0 0; min-width: 0; }
.da-shell .site-brand-mark { width: 44px; height: 44px; border: 1px solid var(--is-border); border-radius: 8px; object-fit: contain; flex-shrink: 0; box-shadow: none; filter: none; }
.da-shell .site-brand-name { display: block; width: 106px; font: 500 15px/1.16 var(--is-font-ui); color: var(--is-text); letter-spacing: -.02em; white-space: normal; }
.da-shell .site-nav-primary { display: none; }
.da-shell .site-nav-account { display: flex; align-items: center; gap: 0; margin: 0; flex: 0 0 auto; }
.da-shell .site-nav-item { display: block; }
.da-shell .site-nav-link { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 8px; gap: 8px; background: transparent; border: 1px solid transparent; border-radius: 5px; color: var(--is-text); box-shadow: none; font: 400 14px/1.4 var(--is-font-ui) !important; text-shadow: none; }
.da-shell .site-nav-link:is(:hover, .active) { color: var(--is-accent-strong); background: var(--is-surface); border-color: var(--is-border); }
.da-shell .site-nav-link .site-nav-label { display: none; }
.da-shell .site-nav-link > svg { width: 21px; height: 21px; flex: 0 0 auto; }
.da-shell .site-nav-link::after { display: none; }
.da-shell .notification-dropdown { position: static; }
.da-shell .notification-bell { position: relative; }
.da-shell #notificationBadge { position: absolute; display: inline-flex; align-items: center; justify-content: center; inset: -3px -3px auto auto; min-width: 21px; height: 21px; padding: 2px 4px; border: 1px solid #d69e9a; border-radius: 12px; color: #fff1e3; background: #753b46; font: 600 11px/1 var(--is-font-ui); box-shadow: none; }
.da-shell #notificationBadge[hidden] { display: none; }
.da-shell .notification-preview { position: absolute; top: calc(100% + 4px); right: max(16px, calc((100vw - 1280px) / 2)); left: auto; width: min(420px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 104px); max-height: calc(100dvh - 104px); margin: 0; padding: 0; border: 1px solid var(--is-border-strong); border-radius: var(--is-radius-md); background: var(--is-surface); color: var(--is-text); box-shadow: var(--is-shadow-lg); overflow: hidden; transform: none; }
.da-shell .notification-preview.show { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.da-shell .notification-preview-head { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--is-border); background: var(--is-surface); }
.da-shell .notification-preview-head strong { font-size: 16px; color: var(--is-text); }
.da-shell .notification-preview-read-all { min-height: 44px; padding: 8px 0; background: transparent; border: 0; color: var(--is-accent-strong); font-size: 14px; text-align: left; }
.da-shell .notification-preview-list { min-height: 0; max-height: min(360px, calc(100dvh - 240px)); overflow: auto; overscroll-behavior: contain; }
.da-shell .notification-preview-item { display: block; padding: 14px 18px; border-bottom: 1px solid var(--is-border); background: transparent; color: var(--is-text); }
.da-shell .notification-preview-item:is(:hover, :focus-visible) { background: #352820; color: var(--is-text); }
.da-shell .notification-preview-item.is-unread { background: #3a2729; border-left: 3px solid var(--is-accent); }
.da-shell .notification-preview-copy { display: block; color: var(--is-text); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; white-space: normal; -webkit-line-clamp: none; }
.da-shell .notification-preview-date, .da-shell .notification-preview-status { display: block; color: var(--is-text-muted); font-size: 13px; }
.da-shell .notification-preview-status { padding: 18px; }
.da-shell .notification-preview-all { display: flex; align-items: center; min-height: 48px; padding: 12px 18px; background: var(--is-surface); border-top: 1px solid var(--is-border); color: var(--is-accent-strong); font-size: 14px; }

#userMenu.da-shell { width: min(440px, 100%); max-width: 100%; background: var(--is-surface) !important; color: var(--is-text) !important; border-left: 1px solid var(--is-border-strong); box-shadow: var(--is-shadow-lg); }
#userMenu.da-shell::before { content: none; }
#userMenu.da-shell .offcanvas-header { padding: 18px 22px; background: var(--is-surface); border-bottom: 1px solid var(--is-border); color: var(--is-text); flex: 0 0 auto; }
#userMenu.da-shell .site-user-menu-heading { font: 500 30px/1.1 var(--is-font-display); text-shadow: none; color: var(--is-text); }
#userMenu.da-shell .site-user-menu-subtitle { margin: 4px 0 0; color: var(--is-text-muted); font-size: 13px; }
#userMenu.da-shell .site-user-menu-mark { display: none; }
#userMenu.da-shell .site-user-menu-close { display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; padding: 0; border: 1px solid var(--is-border-strong); border-radius: 4px; background: transparent; color: var(--is-text); font-size: 24px; box-shadow: none; }
#userMenu.da-shell .offcanvas-body { padding: 18px 22px 28px; background: var(--is-surface); overflow-y: auto; overscroll-behavior: contain; }
.da-menu-links { display: grid; gap: 4px; margin-bottom: 24px; }
.da-menu-links a { display: flex; align-items: center; min-height: 48px; padding: 10px 12px; border-bottom: 1px solid var(--is-border); font-size: 16px; color: var(--is-text); }
.da-menu-links a[aria-current] { background: var(--is-bg); color: var(--is-accent-strong); }
.da-menu-heading { color: var(--is-accent); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin: 24px 0 12px; }
#userMenu.da-shell :is(.accordion-item, .accordion-header, .accordion-button, .accordion-body, .user-menu-panel, .list-group-item) { background: transparent; color: var(--is-text); border-color: var(--is-border); text-shadow: none; }
#userMenu.da-shell .accordion-button { min-height: 52px; padding: 12px 8px; gap: 10px; box-shadow: none; font-family: var(--is-font-ui); font-size: 15px; }
#userMenu.da-shell .accordion-button:not(.collapsed) { background: var(--is-bg); color: var(--is-accent-strong); }
#userMenu.da-shell .accordion-body { padding: 12px 0; }
#userMenu.da-shell .accordion-button::after { filter: brightness(0) invert(1); }
#userMenu.da-shell .accordion-button .chevron { display: none; }
#userMenu.da-shell .user-menu-accordion-icon { background: transparent; color: var(--is-accent); border: 0; }
#userMenu.da-shell .list-group-item { min-height: 48px; padding: 12px; border-color: var(--is-border); font-size: 15px; overflow-wrap: anywhere; }
#userMenu.da-shell .list-group-item.active { background: var(--is-bg); color: var(--is-accent-strong); }
#userMenu.da-shell .user-menu-event-card { background: var(--is-bg); border: 1px solid var(--is-border); border-radius: 4px; padding: 18px; box-shadow: none; color: var(--is-text); }
#userMenu.da-shell :is(.user-menu-card-title, .user-menu-note, .user-menu-status) { color: var(--is-text-muted); font: 400 14px/1.6 var(--is-font-ui); text-shadow: none; }
#userMenu.da-shell :is(.btn-parchment, .btn-outline-light, .btn-logout) { min-height: 46px; background: transparent; border: 1px solid var(--is-border-strong); border-radius: 3px; color: var(--is-text); font: 500 14px/1.5 var(--is-font-ui); text-shadow: none; box-shadow: none; padding: 10px 14px; }
#userMenu.da-shell .btn-logout { color: var(--is-danger); }
#userMenu.da-shell .user-menu-divider { background: var(--is-border); }

/* Filter, consent and welcome are shell dialogs, never narrative content. */
#formIstoriesSearch.da-shell .filter-modal-card, #newsModal.da-shell .news-modal-card { background: var(--is-surface); color: var(--is-text); border-color: var(--is-border-strong); }
#formIstoriesSearch.da-shell :is(.filter-modal-header, .filter-modal-footer), #newsModal.da-shell :is(.news-modal-header, .news-modal-body) { background: var(--is-surface); color: var(--is-text); border-color: var(--is-border); }
#formIstoriesSearch.da-shell .filter-modal-title, #newsModal.da-shell .news-modal-title { color: var(--is-text); font: 500 32px/1.1 var(--is-font-display); }
#formIstoriesSearch.da-shell .btn-close, #newsModal.da-shell .btn-close { filter: invert(1) grayscale(1); opacity: 1; min-width: 44px; min-height: 44px; background-size: 14px; }
#formIstoriesSearch.da-shell :is(.filter-btn-close, .filter-btn-search) { min-height: 46px; border-radius: 3px; font-family: var(--is-font-ui); font-size: 15px; }
#formIstoriesSearch.da-shell .filter-btn-search { background: var(--is-action); border-color: #b1848c; color: var(--is-action-text); }
#formIstoriesSearch.da-shell .filter-switch-row { min-height: 48px; }
#formIstoriesSearch.da-shell .form-floating > label { opacity: 1; }
#newsModal.da-shell .news-modal-copy p { color: var(--is-text); font-family: var(--is-font-ui); }
.cookie-banner-fantasy.da-shell { background: #29201b; color: var(--is-text); border: 1px solid var(--is-border-strong); border-radius: 6px; box-shadow: var(--is-shadow-lg); }
.cookie-banner-fantasy.da-shell p, .cookie-banner-fantasy.da-shell .cookie-preference-row { color: var(--is-text); font-family: var(--is-font-ui); font-size: 15px; }
.cookie-banner-fantasy.da-shell .cookie-preference-row { background: var(--is-bg); border-color: var(--is-border); }
.cookie-banner-fantasy.da-shell .cookie-preference-row small { color: var(--is-text-muted); }
.cookie-banner-fantasy.da-shell a { color: var(--is-accent-strong); text-decoration: underline; }
.cookie-banner-fantasy.da-shell .btn-fantasy { min-height: 46px; font: 500 14px/1.4 var(--is-font-ui); text-shadow: none; color: var(--is-text); background: transparent; border: 1px solid var(--is-border-strong); border-radius: 3px; box-shadow: none; }
.cookie-banner-fantasy.da-shell .btn-fantasy:first-child { background: var(--is-action); color: var(--is-action-text); border-color: #b1848c; }
.da-footer { margin-top: 64px; padding: 32px 0; background: #16110f; border-top: 1px solid var(--is-border); }
.da-footer-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 28px; }
.da-footer-brand { display: flex; align-items: center; gap: 16px; max-width: 440px; }
.da-footer-brand img { width: 76px; height: 76px; object-fit: contain; border-radius: 8px; }
.da-footer-brand p { font: 500 25px/1.15 var(--is-font-display); margin: 0 0 6px; }
.da-footer-brand small { color: var(--is-text-muted); font-size: 13px; }
.da-footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: 14px; }
.da-footer-links a { min-height: 44px; display: inline-flex; align-items: center; }
.da-footer-bottom { padding-top: 18px; margin-top: 24px; border-top: 1px solid var(--is-border); font-size: 13px; color: var(--is-text-muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.da-footer .site-cookie-preferences { position: static; padding: 0; margin: 0; background: none; border: 0; width: auto; }
.da-footer .cookie-preferences-link { position: static; min-height: 44px; background: none; border: 0; color: var(--is-text-muted); padding: 8px 0; font: 400 14px/1.4 var(--is-font-ui); }

/* Composition from C: literary opening, framed book, numbered shelves. */
.da-scope :is(h1, h2, h3, p, figure) { margin: 0; }
.da-scope :is(h1, h2, h3) { font-family: var(--is-font-display); font-weight: 500; line-height: 1.12; letter-spacing: -.025em; text-wrap: balance; }
.da-scope h2 { font-size: 34px; }
.da-hero { padding-top: 34px; text-align: center; }
.da-hero-grid { display: grid; gap: 32px; }
.da-eyebrow { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--is-accent); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 18px !important; }
.da-eyebrow::before, .da-eyebrow::after { content: ''; width: 24px; height: 1px; background: var(--is-accent); flex: 0 0 auto; }
.da-hero h1 { font-size: 48px; line-height: 1.02; font-weight: 400; letter-spacing: -.03em; }
.da-hero h1 em { color: var(--is-accent); font-style: italic; font-weight: 400; }
.da-intro { max-width: 430px; margin: 22px auto 26px !important; color: var(--is-text-muted); font-size: 15px; line-height: 1.7; }
.da-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 46px; padding: 12px 20px; border: 1px solid var(--is-border-strong); border-radius: 3px; color: var(--is-text); background: transparent; font: 500 14px/1.5 var(--is-font-ui); text-decoration: none; }
.da-button--primary { background: var(--is-action); color: var(--is-action-text); border-color: #b1848c; }
.da-button--primary:hover { background: var(--is-action-hover); color: var(--is-action-text); text-decoration: none; }
.da-scope :is(button, input, select, textarea):disabled, .da-scope .da-button[aria-disabled="true"] { opacity: .65; cursor: not-allowed; }
.da-featured-book { position: relative; display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); align-items: center; gap: 20px; padding: 26px 20px; margin: 0; text-align: left; border: 1px solid var(--is-border); background: linear-gradient(110deg, #3b2a21, #231c18); box-shadow: inset 0 0 0 6px #201813, 0 15px 50px #0003; }
.da-featured-book::before, .da-featured-book::after { content: '✦'; position: absolute; color: var(--is-accent); font-size: 12px; top: 5px; left: 6px; line-height: 1; }
.da-featured-book::after { inset: auto 6px 5px auto; }
.da-featured-book > .da-cover { transform: rotate(-4deg); box-shadow: 8px 10px 14px #0008; }
.da-featured-book figcaption { min-width: 0; }
.da-feature-label { font-size: 12px; line-height: 1.5; text-transform: uppercase; letter-spacing: .04em; color: var(--is-accent); margin-bottom: 10px !important; }
.da-featured-book h2 { font-size: 29px; line-height: 1; }
.da-byline { color: var(--is-text-muted); font-size: 14px; overflow-wrap: anywhere; margin-top: 10px !important; }
.da-feature-action { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; margin-top: 12px; font-size: 14px; }
.da-feature-action a { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; }
.da-feature-action strong { white-space: nowrap; }
.da-motto { display: none; }
.da-catalog-nav { margin-top: 36px; border-block: 1px solid var(--is-border); display: flex; gap: 28px; overflow-x: auto; scrollbar-width: thin; }
.da-catalog-nav a { display: inline-flex; align-items: center; min-height: 56px; white-space: nowrap; color: var(--is-text-muted); font-size: 14px; }
.da-catalog-nav a:first-child { color: var(--is-accent); border-bottom: 1px solid var(--is-accent); }
.da-section { margin-top: 40px; scroll-margin-top: 108px; }
.da-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin-bottom: 24px; border-bottom: 1px solid var(--is-border); }
.da-section-title { display: flex; gap: 10px; align-items: baseline; }
.da-section-title > span { font: 400 18px/1.4 var(--is-font-display); color: var(--is-accent); }
.da-section-heading p { color: var(--is-text-muted); font-size: 14px; line-height: 1.5; margin-top: 8px; }
.da-section-more { display: flex; align-items: center; gap: 8px; min-width: 44px; min-height: 44px; flex: 0 0 auto; justify-content: flex-end; font-size: 14px; }
.da-section-more span:first-child { display: none; }
.da-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 77%; gap: 24px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scroll-padding: 4px; padding: 6px 4px 20px; margin-inline: -4px; scrollbar-width: thin; scrollbar-color: var(--is-border-strong) transparent; }
.da-card { display: flex; flex-direction: column; position: relative; min-width: 0; scroll-snap-align: start; }
.da-card-art { position: relative; min-width: 0; align-self: start; width: 100%; }
.da-card-cover-link { display: block; }
.da-cover { width: 100%; aspect-ratio: 3 / 4; position: relative; overflow: hidden; border: 1px solid #69503b; border-radius: 1px 5px 5px 1px; background: var(--is-surface); box-shadow: 6px 9px 0 #100c09, 7px 10px 0 #5b4734; }
.da-cover > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center; }
.da-cover::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 5px 0 8px #0005, inset -2px 0 2px #0005; }
.da-cover-empty { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 18px; border: 1px dashed var(--is-border-strong); background: linear-gradient(140deg, #342b27, #201b18); color: var(--is-text); font-size: 15px; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
.da-cover-empty::before { content: ''; width: 38px; height: 1px; background: var(--is-accent); }
.da-badge { position: absolute; top: 8px; left: 8px; right: 8px; width: fit-content; max-width: calc(100% - 16px); padding: 6px 8px; border: 1px solid #a1756b; background: #492d30f5; color: #f6f3ee; font-size: 12px; line-height: 1.45; pointer-events: none; overflow-wrap: anywhere; }
.da-card-body { display: flex; flex-direction: column; min-width: 0; flex: 1; padding-top: 20px; }
.da-genres { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 44px; color: var(--is-accent); font-size: 14px; margin-bottom: 8px; }
.da-genres > span + span::before { content: '·'; margin-right: 6px; }
.da-genres-more { font-size: 13px; max-width: 100%; }
.da-genres-more summary { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; min-width: 44px; min-height: 44px; padding: 4px 8px; list-style: none; border: 1px solid var(--is-border-strong); border-radius: 3px; color: var(--is-text); }
.da-genres-more summary::-webkit-details-marker { display: none; }
.da-genres-more[open] { flex: 1 0 100%; }
.da-genres-more ul { margin: 12px 0; padding-left: 20px; color: var(--is-text); }
.da-card .da-card-title { font-size: 28px; line-height: 1.12; overflow-wrap: anywhere; }
.da-card-title a { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.da-card-author { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; color: var(--is-text-muted); font-size: 14px; line-height: 1.5; margin-top: 8px !important; }
.da-card-meta { display: flex; flex-wrap: wrap; gap: 5px 8px; font-size: 13px; line-height: 1.5; color: var(--is-text-muted); margin: 12px 0 14px !important; }
.da-card-meta span + span::before { content: '·'; margin-right: 8px; }
.da-card-summary { color: var(--is-text-muted); font-size: 14px; line-height: 1.7; margin: 12px 0 !important; overflow-wrap: anywhere; }
.da-estimate { color: var(--is-accent); font-size: 14px; margin: 12px 0 !important; }
.da-card-bottom { margin-top: auto; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--is-border); color: var(--is-text-muted); font-size: 13px; }
.da-card-bottom strong { color: var(--is-text); font-size: 14px; white-space: nowrap; }
.da-card-bottom a { color: var(--is-text); display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.da-card--horizontal .da-card-summary { display: none; }
.da-state { padding: 28px 24px; margin-top: 24px; border: 1px solid var(--is-border-strong); border-radius: 4px; background: var(--is-surface); }
.da-state h2 { font-size: 30px; }
.da-state p { margin: 14px 0; color: var(--is-text-muted); }
.da-state--error { border-left: 4px solid var(--is-danger); }
.da-state--warning { border-left: 4px solid var(--is-warning); }
.da-state--success { border-left: 4px solid var(--is-success); }
.da-state--loading { border-style: dashed; }
.da-field { display: grid; gap: 8px; margin-block: 20px; }
.da-field :is(input, textarea, select) { width: 100%; min-height: 48px; padding: 12px 14px; background: var(--is-bg); color: var(--is-text); border: 1px solid var(--is-border-strong); border-radius: 3px; font: 400 1rem/1.4 var(--is-font-ui); }
.da-field :is(input, textarea, select):focus { border-color: var(--is-focus-ring); }
.da-field [aria-invalid="true"] { border-color: var(--is-danger); }
.da-field small { color: var(--is-text-muted); font-size: 14px; }
.da-field .da-field-error { color: var(--is-danger); }

@media (max-width: 359px) {
  .da-wrap, .da-shell .site-navbar-inner { width: calc(100% - 32px); }
  .da-shell .site-navbar-inner { gap: 2px; }
  .da-shell .site-brand { gap: 7px; }
  .da-shell .site-brand-mark { width: 36px; height: 36px; }
  .da-shell .site-brand-name { width: 82px; font-size: 13px; }
  .da-hero h1 { font-size: 42px; }
  .da-featured-book { padding: 23px 14px; gap: 16px; }
  .da-featured-book h2 { font-size: 26px; }
  .da-feature-action { display: block; }
  .da-feature-action strong { display: block; margin-top: 6px; }
  .da-eyebrow { letter-spacing: .07em; }
}
@media (min-width: 540px) {
  .da-featured-book { width: min(580px, 100%); margin-inline: auto; grid-template-columns: 170px minmax(0, 1fr); }
  .da-featured-book h2 { font-size: 37px; }
  .da-rail { grid-auto-columns: calc((100% - 24px) / 2); }
}
@media (min-width: 800px) {
  .da-hero { padding-top: 45px; text-align: left; }
  .da-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 60px; align-items: center; }
  .da-hero-grid--text { grid-template-columns: 1fr; }
  .da-hero .da-eyebrow { justify-content: flex-start; }
  .da-hero .da-eyebrow::after { display: none; }
  .da-hero h1 { font-size: 70px; }
  .da-intro { margin-left: 0 !important; }
  .da-featured-book { width: 100%; padding: 44px 28px; grid-template-columns: 42% minmax(0, 1fr); gap: 28px; }
  .da-featured-book h2 { font-size: 36px; }
  .da-motto { display: block; margin-top: 32px !important; font: 400 20px/1.4 var(--is-font-display); color: var(--is-accent); text-align: center; }
  .da-catalog-nav { justify-content: center; gap: 46px; }
  .da-section { margin-top: 56px; }
  .da-section-more span:first-child { display: inline; }
  .da-rail { grid-auto-columns: calc((100% - 3 * 34px) / 4); gap: 34px; }
  .da-rail--announcements { grid-auto-columns: calc((100% - 34px) / 2); }
  .da-card--horizontal { display: grid; grid-template-columns: minmax(0, 32%) minmax(0, 1fr); gap: 28px; padding: 24px; border: 1px solid var(--is-border); background: var(--is-surface-muted); align-items: start; }
  .da-card--horizontal .da-card-body { padding: 0; height: 100%; }
  .da-card--horizontal .da-card-title { font-size: 30px; }
  .da-card--horizontal .da-card-summary { display: block; }
}
@media (min-width: 1100px) {
  .da-shell .site-navbar-inner { min-height: 90px; }
  .da-shell .site-nav-primary { display: flex; gap: 24px; margin-left: auto; }
  .da-shell .site-nav-primary .site-nav-link { width: auto; min-width: 0; padding: 8px 0; border: 0; border-radius: 0; color: var(--is-text-muted); }
  .da-shell .site-nav-primary .site-nav-link.active { color: var(--is-accent-strong); border-bottom: 1px solid var(--is-accent); }
  .da-shell .site-nav-primary .site-nav-label { display: inline; }
  .da-shell .site-nav-primary .site-nav-link i { display: none; }
  .da-shell .site-nav-account { margin-left: 12px; }
}
@media (max-height: 500px) {
  .da-shell .site-navbar-inner { min-height: 64px; }
  .da-shell .notification-preview { max-height: calc(100dvh - 80px); }
  .da-shell .notification-preview-list { max-height: calc(100dvh - 220px); }
  #userMenu.da-shell .offcanvas-header { padding-block: 10px; }
  .da-hero { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  :where(.da-shell, .da-scope) *, :where(.da-shell, .da-scope) *::before, :where(.da-shell, .da-scope) *::after { transition: none !important; animation: none !important; scroll-behavior: auto; }
}

/* Lot 3A: real shelves, catalogue and progressive navigation. */
.da-feature-gallery { min-width: 0; }
.da-feature-gallery[data-da-gestures] { touch-action: pan-y pinch-zoom; }
.da-gallery-controls { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 14px; font-size: 13px; color: var(--is-text-muted); }
.da-gallery-controls .da-button, .da-rail-controls .da-button { min-width: 44px; padding: 8px 12px; }
.da-highlight-links { margin-top: 8px; font-size: 12px; color: var(--is-text-muted); }
.da-highlight-links summary, .da-more-shelves > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 12px; }
.da-highlight-links summary::before, .da-more-shelves > summary::after { content: '+'; color: var(--is-accent); }
.da-highlight-links[open] summary::before, .da-more-shelves[open] > summary::after { content: '−'; }
.da-highlight-links li { padding-block: 8px; overflow-wrap: anywhere; }
.da-rail-controls { display: flex; justify-content: flex-end; gap: 8px; margin: -12px 0 12px; }
.da-catalog-nav { justify-content: flex-start; gap: 26px; }
.da-themes { color: var(--is-text-muted); font-size: 12px; margin-block: 8px; }
.da-themes summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.da-themes summary::after { content: '+'; margin-left: 8px; color: var(--is-accent); }
.da-themes[open] summary::after { content: '−'; }
.da-themes li { margin-block: 6px; overflow-wrap: anywhere; }
.da-follow-hint { font-size: 12px; color: var(--is-text-muted); line-height: 1.5; margin-top: 8px !important; }
.da-more-shelves { margin-top: 48px; border-block: 1px solid var(--is-border); padding-block: 16px; }
.da-more-shelves > summary { font: 500 28px/1.2 var(--is-font-display); justify-content: space-between; }
.da-catalog { padding-top: 32px; }
.da-catalog-header { padding-block: 16px 28px; border-bottom: 1px solid var(--is-border); margin-bottom: 28px; }
.da-catalog-header .da-eyebrow { justify-content: flex-start; }
.da-catalog-header .da-eyebrow::after { display: none; }
.da-catalog-header h1 { font-size: clamp(40px, 5vw, 66px); margin-bottom: 16px; }
.da-catalog-header p:not(.da-eyebrow) { color: var(--is-text-muted); margin-block: 14px; }
.da-result-count strong { color: var(--is-accent); }
.da-catalog-tools { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.da-catalog-tools svg { width: 20px; height: 20px; flex-shrink: 0; }
.da-active-filters { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin-block: 24px; }
.da-active-filters li { max-width: 100%; padding: 8px 12px; border: 1px solid var(--is-border); font-size: 13px; overflow-wrap: anywhere; }
.da-catalog-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px 24px; }
.da-catalog-grid .da-card { width: min(100%, 340px); margin-inline: auto; }
.da-catalog-grid .da-card-art { max-width: 100%; }
.da-pagination { display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 40px 12px; }
.da-pagination .da-button { min-width: 44px; padding: 8px 12px; }
.da-pagination [aria-current="page"] { background: var(--is-action); color: var(--is-action-text); border-color: #b1848c; }
.da-scope :is(.da-featured-book h2, .da-intro, .da-card-meta, .da-section-heading h2) { overflow-wrap: anywhere; }
.da-shop .da-hero { padding-top: 24px; }
.da-shop .da-intro { margin-block: 16px 20px !important; }
.da-shop .da-hero-grid { gap: 24px; }
.da-shop .da-featured-book { padding-block: 20px; }
.da-shop .da-hero h1 { font-size: clamp(38px, 10vw, 48px); }
.da-shop .da-featured-book h2 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.da-shop .da-featured-book { grid-template-columns: minmax(0, 30%) minmax(0, 1fr); }
@media (min-width: 540px) {
  .da-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .da-catalog-grid .da-card { width: 100%; }
}
@media (min-width: 800px) {
  .da-catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 32px; }
  .da-shop .da-hero { padding-top: 45px; }
  .da-shop .da-hero-grid { gap: 60px; }
  .da-shop .da-hero h1 { font-size: 70px; }
  .da-shop .da-featured-book { padding: 44px 28px; grid-template-columns: 42% minmax(0, 1fr); }
  .da-shop .da-featured-book h2 { font-size: 36px; }
}
@media (min-width: 1100px) { .da-catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px 34px; } }
/* Existing filter parameters and submission logic are retained. */
#formIstoriesSearch.da-shell :is(input, select, button):focus-visible { outline: 3px solid var(--is-accent); outline-offset: 3px; }
#formIstoriesSearch.da-shell .filter-modal-card { max-height: calc(100dvh - 24px); }
#formIstoriesSearch.da-shell .filter-modal-body { overflow-y: auto; overscroll-behavior: contain; }
#formIstoriesSearch.da-shell select[multiple] { min-height: 132px; }
#formIstoriesSearch.da-shell .filter-modal-footer { flex-shrink: 0; }

.da-featured-book .da-byline { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.da-synopsis { font-size: 13px; line-height: 1.6; color: var(--is-text-muted); margin-bottom: 12px; }
.da-synopsis summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; }
.da-synopsis summary::after { content: '+'; color: var(--is-accent); }
.da-synopsis[open] summary::after { content: '−'; }
.da-synopsis p { overflow-wrap: anywhere; white-space: pre-line; }
.da-card--horizontal .da-synopsis .da-card-summary { display: block; }
.da-featured-book .da-synopsis { margin-top: 8px; margin-bottom: 0; }

/* Lot 3B: shared book headers, personal collections and explicit capabilities. */
.da-story-header { display: grid; grid-template-columns: minmax(0,30%) minmax(0,1fr); align-items: start; gap: 24px; padding-block: 28px; border-bottom: 1px solid var(--is-border); }
.da-story-book { min-width: 0; padding: 5px 8px 10px 0; }
.da-story-heading { min-width: 0; }
.da-story-heading .da-eyebrow { justify-content: flex-start; font-size: 11px; letter-spacing: .06em; }
.da-story-heading .da-eyebrow::after { display: none; }
.da-story-heading h1 { font-size: clamp(32px,6vw,64px); overflow-wrap: anywhere; }
.da-story-author { margin-block: 14px !important; color: var(--is-text-muted); font-size: 14px; overflow-wrap: anywhere; }
.da-story-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--is-text-muted); font-size: 13px; overflow-wrap: anywhere; }
.da-story-offer { margin-top: 20px !important; font-size: 19px; font-weight: 600; }
.da-story-back { padding-block: 18px 0; font-size: 14px; }
.da-story-back a { min-height: 44px; display: inline-flex; align-items: center; }
.da-preview-page { padding-bottom: 24px; }
.da-preview-body { padding-top: 28px; }
.da-editorial { margin-bottom: 32px; }
.da-editorial h2 { font-size: 30px; margin-bottom: 18px; }
.da-editorial p { line-height: 1.8; overflow-wrap: anywhere; }
.da-author-message { padding: 24px; border-left: 2px solid var(--is-accent); background: var(--is-surface-muted); }
.da-follow-panel { padding: 24px; margin-top: 28px; border: 1px solid var(--is-border); background: var(--is-surface); }
.da-action-note { color: var(--is-text-muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.da-follow-panel .da-action-note { margin-top: 18px; }
.da-hype-panel { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--is-border); min-width: 0; }
.da-hype-reaction { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; }
.da-hype-panel .da-hype-count { display: inline-flex; align-items: baseline; gap: .35em; flex: 0 1 auto; margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--is-text); font-size: 15px; font-weight: 600; }
.da-hype-panel .da-hype-button { flex: 1 1 160px; width: auto; min-width: 0; min-height: 64px; padding: 10px 14px; justify-content: flex-start; gap: 10px; border-color: #ad7d57; background: #35251c; color: #f5dfc4; white-space: normal; overflow-wrap: anywhere; }
.da-hype-button-text { display: grid; gap: 2px; text-align: start; line-height: 1.35; }
.da-hype-button [data-hype-label] { font-size: 16px; font-weight: 600; }
.da-hype-remove { font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.da-hype-flame { width: 34px; height: 40px; flex: 0 0 auto; overflow: visible; transform-origin: 50% 85%; }
.da-hype-flame-outer { fill: transparent; stroke: #e7ad77; stroke-width: 1.6; stroke-linejoin: round; }
.da-hype-flame-core { fill: #e7ad77; }
.da-hype-panel .da-hype-button[aria-pressed="true"] { background: #e7ad77; color: #291a12; border-color: #f3c99c; }
.da-hype-button[aria-pressed="true"] .da-hype-flame-outer { fill: #863917; stroke: #753115; }
.da-hype-button[aria-pressed="true"] .da-hype-flame-core { fill: #ffe4aa; }
.da-hype-panel .da-hype-button:hover { border-color: #f3c99c; box-shadow: inset 0 0 0 1px #f3c99c; text-decoration: none; }
.da-hype-panel .da-hype-button:disabled { cursor: wait; opacity: .75; }
.da-hype-panel .da-hype-button:disabled:not([aria-busy]) { cursor: default; }
.da-hype-panel .da-action-note { margin: 12px 0 0; }
.da-hype-panel .da-hype-status:not(.visually-hidden) { font-size: 13px; line-height: 1.6; margin: 12px 0 0; color: var(--is-danger); overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) {
  .da-hype-button.is-celebrating .da-hype-flame { animation: da-hype-spark .62s ease-out; }
  @keyframes da-hype-spark {
    0%, 100% { transform: scale(1) rotate(0); }
    28% { transform: scale(1.2) rotate(-8deg); }
    58% { transform: scale(1.1) rotate(6deg); }
  }
}
.da-card-actions:empty { display: none; }
.da-card-actions { margin-top: 18px; display: grid; gap: 10px; }
.da-card-actions .da-button { width: 100%; padding: 10px 14px; white-space: normal; overflow-wrap: anywhere; }
.da-card-menu > summary { cursor: pointer; min-height: 44px; padding: 10px 12px; border: 1px solid var(--is-border); font-size: 13px; }
.da-card-menu > div { display: grid; gap: 10px; padding-top: 12px; }
.da-card-menu .da-action-note { padding: 10px 12px; border-left: 2px solid var(--is-border-strong); }
.da-reading-progress { margin-top: 16px !important; padding: 10px 12px; background: var(--is-surface); border-left: 2px solid var(--is-accent); color: var(--is-text); font-size: 13px; overflow-wrap: anywhere; }
.da-shell .da-confirm-label { display: block; margin-block: 18px 8px; }
.da-card .modal form { min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.da-personal-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; padding-block: 32px; border-bottom: 1px solid var(--is-border); }
.da-personal-heading .da-eyebrow { justify-content: flex-start; }
.da-personal-heading .da-eyebrow::after { display: none; }
.da-personal-heading h1 { font-size: clamp(44px,7vw,70px); }
.da-personal-heading p:not(.da-eyebrow) { color: var(--is-text-muted); font-size: 14px; margin-top: 16px; }
.da-collection-picker { margin-block: 24px; border: 1px solid var(--is-border); }
.da-collection-picker summary { cursor: pointer; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px; min-height: 48px; font-size: 14px; }
.da-collection-picker summary > span { margin-left: auto; }
.da-collection-picker nav { display: grid; gap: 4px; padding: 8px; border-top: 1px solid var(--is-border); }
.da-collection-picker a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; font-size: 14px; }
.da-collection-picker a[aria-current] { background: var(--is-surface-strong); color: var(--is-accent); }
.da-library .library-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 20px; margin-block: 24px; }
.da-library .library-panel-head h2 { font-size: 32px; }
.da-library .library-panel-head p { margin-top: 10px; color: var(--is-text-muted); font-size: 14px; }
.da-library .library-panel-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.da-library .library-pill { font-size: 13px; color: var(--is-accent); }
.da-library .library-options-btn { min-height: 44px; padding: 10px 14px; border: 1px solid var(--is-border-strong); border-radius: 3px; color: var(--is-text); background: var(--is-surface); font: inherit; font-size: 14px; }
.da-library .dropdown-menu { min-width: min(260px,calc(100vw - 40px)); max-width: calc(100vw - 32px); background: var(--is-surface); color: var(--is-text); border-color: var(--is-border-strong); padding: 8px; }
.da-library .dropdown-item { color: var(--is-text); white-space: normal; min-height: 44px; padding: 10px 12px; font-size: 14px; }
.da-library .dropdown-item:hover, .da-library .dropdown-item:focus { color: var(--is-text); background: var(--is-surface-strong); }
.da-library .dropdown-item:disabled { color: var(--is-text-muted); }
.da-library .dropdown-divider { border-color: var(--is-border); }
.da-library .library-saga-tools { margin-block: 24px; padding: 16px; border: 1px solid var(--is-border); }
.da-library .library-saga-tools summary { min-height: 44px; cursor: pointer; font-size: 14px; }
.da-library .library-saga-row { display: grid; gap: 14px; margin-top: 16px; }
.da-library .library-saga-create { display: flex; flex-wrap: wrap; gap: 10px; }
.da-library .library-saga-create input { min-width: 0; flex: 1 1 160px; }
.da-library .library-saga-create button { min-height: 44px; padding: 8px 16px; border: 1px solid var(--is-border-strong); color: var(--is-text); background: var(--is-surface); border-radius: 3px; }
.da-library :is(.form-control,.form-select,.js-saga-select) { background-color: var(--is-surface); color: var(--is-text); border: 1px solid var(--is-border-strong); border-radius: 3px; min-height: 44px; font: 400 14px/1.5 var(--is-font-ui); }
.da-library .library-status:not(:empty) { padding: 14px; margin-block: 20px; background: var(--is-surface); border-left: 3px solid var(--is-success); }
.da-library .library-status.is-error { border-color: var(--is-danger); }
.da-library-grid,.da-library .library-saga-folder-body { display: grid; grid-template-columns: minmax(0,1fr); gap: 40px 24px; margin: 0; }
.da-library .library-card-cell { display: flex; flex-direction: column; min-width: 0; padding: 0; }
.da-library .library-card-cell > .da-card { flex: 1; }
.da-library .library-manage-bar { display: none; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px; margin-bottom: 16px; background: var(--is-surface); border: 1px solid var(--is-border-strong); }
.da-library .is-sort-mode .library-manage-bar { display: flex; }
.da-library .library-move-btn { min-width: 44px; min-height: 44px; background: var(--is-bg); border: 1px solid var(--is-border-strong); color: var(--is-text); }
.da-library .library-drag-handle { color: var(--is-text-muted); font-size: 12px; }
.da-library .library-card-saga { width: 100%; }
.da-library .js-saga-select { width: 100%; padding: 8px; }
.da-library .library-card-cell.is-dragging { opacity: .55; border: 1px dashed var(--is-accent); }
.da-library .library-saga-badge { display: none; }
.da-library .library-saga-folder { grid-column: 1/-1; width: 100%; padding: 0; }
.da-library .library-saga-folder > summary { display: flex; align-items: baseline; gap: 12px; padding-block: 16px; margin-bottom: 24px; border-bottom: 1px solid var(--is-border); cursor: pointer; font: 500 30px/1.2 var(--is-font-display); }
.da-library .library-saga-folder-count { font: 400 13px/1.4 var(--is-font-ui); color: var(--is-text-muted); margin-left: auto; }
.da-library .is-sort-mode .da-card-actions { pointer-events: none; opacity: .5; }
.da-library .da-state { grid-column: 1/-1; }
@media (min-width:540px) {
 .da-library-grid,.da-library .library-saga-folder-body { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .da-collection-picker nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (min-width:800px) {
 .da-story-header { grid-template-columns: 240px minmax(0,1fr); align-items: center; gap: 56px; padding-block: 40px; }
 .da-story-heading .da-eyebrow { font-size: 12px; }
 .da-story-header .da-story-book { transform: rotate(-3deg); }
 .da-preview-body { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 0 48px; }
 .da-preview-body > :not(.da-follow-panel) { grid-column: 1; }
 .da-follow-panel { grid-column: 2; grid-row: 1; align-self: start; margin-top: 0; }
 .da-library-grid,.da-library .library-saga-folder-body { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 48px 32px; }
 .da-library .library-saga-row { grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); }
 .da-collection-picker nav { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (min-width:1100px) { .da-library-grid,.da-library .library-saga-folder-body { grid-template-columns: repeat(4,minmax(0,1fr)); } }

/* Metadata and action surfaces are scoped separately from narrative excerpts. */
.da-detail-page { padding-bottom: 32px; }
.da-detail-tools { display: grid; gap: 24px; margin-block: 24px; }
.da-detail-tools .istory-meta-box { background: none; border: 0; padding: 0; margin: 0; box-shadow: none; }
.da-detail-tools .istory-buttons { justify-content: flex-start; flex-wrap: wrap; gap: 12px; }
.da-detail-tools :is(.like-button,.like-display,.played-display,.share-button) { min-height: 44px; background: var(--is-surface); color: var(--is-text); border: 1px solid var(--is-border); border-radius: 3px; box-shadow: none; padding: 10px 14px; font: 400 14px/1.5 var(--is-font-ui); }
.da-detail-page .da-detail-tabs { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; padding: 0 0 16px; margin: 0; border-bottom: 1px solid var(--is-border); background: none; box-shadow: none; }
.da-detail-tabs .tab-btn { min-height: 44px; padding: 10px 16px; border: 1px solid var(--is-border); border-radius: 3px; background: var(--is-surface); color: var(--is-text-muted); text-shadow: none; box-shadow: none; font: 500 14px/1.5 var(--is-font-ui); }
.da-detail-tabs .tab-btn.is-active { color: var(--is-accent-strong); background: var(--is-surface-strong); border-color: var(--is-border-strong); }
.da-detail-layout { display: grid; gap: 32px; }
.da-detail-main { min-width: 0; }
.da-detail-page .da-detail-panel { width: 100%; max-width: none; margin: 0; border-radius: 3px; padding: 24px; box-shadow: none; }
.da-detail-page .da-detail-panel:not([data-da-narrative="true"]) { background: var(--is-surface-muted); border: 1px solid var(--is-border); color: var(--is-text); font-family: var(--is-font-ui); }
.da-detail-panel.da-scope :is(h2,h3) { font-family: var(--is-font-display); text-shadow: none; color: var(--is-text); }
.da-detail-panel.da-scope .section-title { font-family: var(--is-font-display); color: var(--is-accent); font-size: 25px; letter-spacing: 0; margin-block: 24px 12px; text-transform: none; }
.da-detail-panel.da-scope :is(li,p) { overflow-wrap: anywhere; }
.da-detail-panel.da-scope .badge { font: 400 13px/1.4 var(--is-font-ui); padding: 8px 10px; border: 1px solid var(--is-border); border-radius: 3px !important; box-shadow: none !important; }
.da-detail-panel.da-scope .text-bg-light { background: var(--is-surface-strong) !important; color: var(--is-accent-strong) !important; }
.da-detail-panel.da-scope .text-bg-dark { background: var(--is-bg) !important; color: var(--is-text-muted) !important; }
.da-detail-access { min-width: 0; padding: 24px; border: 1px solid var(--is-border); border-radius: 3px; background: var(--is-surface); scroll-margin-top: 110px; }
.da-detail-access h2 { font-size: 28px; margin-bottom: 24px; }
.da-detail-access #istory-management { scroll-margin-top: 110px; }
.da-detail-access :is(.reader-save-panel,.backStyle,.action-forge,.eligibility-banner) { border-radius: 3px; box-shadow: none; background: transparent; border-color: var(--is-border); padding: 16px 0 !important; color: var(--is-text); }
.da-detail-access :is(.action-forge,.reader-save-main,.reader-save-actions,.reader-save-options) { display: flex; flex-direction: column; gap: 12px; }
.da-detail-access .reader-save-copy { min-width: 0; }
.da-detail-access :is(a,button,p,span,strong,label) { overflow-wrap: anywhere; }
.da-detail-access .btn { min-height: 44px; white-space: normal; border-radius: 3px; font-family: var(--is-font-ui); font-size: 14px; box-shadow: none; }
.da-detail-access .btn-primary { background: var(--is-action); color: var(--is-action-text); border: 1px solid #b1848c; }
.da-detail-access .btn-info { background: transparent; color: var(--is-text); border-color: var(--is-border-strong); }
.da-detail-access .row { margin-inline: 0; }
.da-detail-related { margin-top: 40px; }
#storyTrophiesModal.da-shell .st-dialog { background: var(--is-surface); color: var(--is-text); border-color: var(--is-border-strong); }
@media (min-width:540px) { .da-detail-tabs .tab-btn { flex: 0 1 auto; } }
@media (min-width:1000px) {
 .da-detail-layout { grid-template-columns: minmax(0,1fr) 340px; align-items: start; }
}
@media (max-width:539px) {
 .da-detail-page .da-detail-panel { padding: 18px; }
 .da-detail-tabs .tab-btn { flex: 1 1 calc(50% - 8px); }
 .da-detail-access { padding: 18px; }
}

.da-detail-page .da-detail-tools .tabs-wood.da-detail-tabs { flex-direction: row; }
.da-detail-page .da-detail-tabs .tab-btn { width: auto; flex: 0 1 auto; }
.da-detail-page .da-detail-tools .istory-meta-box { display: block; padding: 0; background: none; border: 0; }
.da-detail-page .da-detail-tools .istory-meta-box .istory-buttons { margin: 0; padding: 0; justify-content: flex-start; background: none; border: 0; box-shadow: none; }
/* Reading cards put the current save and the primary action within easy reach. */
.da-library--reading .da-library-grid { grid-template-columns: minmax(0,1fr); }
.da-library--reading .da-card { display: grid; grid-template-columns: minmax(0,30%) minmax(0,1fr); gap: 8px 20px; padding: 20px; border: 1px solid var(--is-border); background: var(--is-surface-muted); }
.da-library--reading .da-card-art { grid-column: 1; grid-row: 1; align-self: start; }
.da-library--reading .da-card-body { display: contents; }
.da-library--reading .da-card-body > * { grid-column: 2; min-width: 0; }
.da-library--reading .da-card-body > :is(.da-synopsis,.da-card-bottom,.da-reading-progress,.da-action-note,.da-card-actions) { grid-column: 1 / -1; }
.da-library--reading .da-genres { margin-bottom: 0; }
.da-library--reading .da-card-title { font-size: 28px; }
.da-library--reading .da-card-meta { margin-block: 8px !important; }
@media(min-width:1000px){ .da-library--reading .da-library-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:539px){
 .da-detail-page .da-detail-tabs .tab-btn { flex: 1 1 calc(50% - 8px); }
 .da-library--reading .da-card,.da-library--creations .da-card { display: grid; grid-template-columns: minmax(0,30%) minmax(0,1fr); gap: 8px 16px; padding: 16px; border: 1px solid var(--is-border); background: var(--is-surface-muted); }
 .da-library--creations .da-card-art { grid-column: 1; grid-row: 1; align-self: start; }
 .da-library--creations .da-card-body { display: contents; }
 .da-library--creations .da-card-body > * { grid-column: 2; min-width: 0; }
 .da-library--creations .da-card-body > :is(.da-synopsis,.da-card-bottom,.da-reading-progress,.da-action-note,.da-card-actions,.da-follow-hint) { grid-column: 1 / -1; }
 .da-library .da-card-title { font-size: 26px; }
 .da-library .da-card-meta { margin-block: 8px !important; }
}

.da-library input::placeholder,.da-detail-panel.da-scope :is(input,textarea)::placeholder { color: var(--is-text-muted); opacity: 1; }

.da-library .da-card-core { min-width: 0; }
.da-library--reading .da-card-core { display: flex; flex-direction: column; align-self: start; gap: 12px; }
.da-library .da-card-core > * { margin: 0 !important; }
@media(max-width:539px) {
 .da-library--creations .da-card-core { display: flex; flex-direction: column; align-self: start; gap: 10px; }
 .da-library .da-card-art .da-cover-empty { padding: 8px; font-size: 11px; gap: 8px; }
 .da-library .da-card-art .da-badge { font-size: 10px; padding: 4px 5px; max-width: 100%; }
}

/* The save controls adapt to the sidebar's width, rather than the viewport. */
.da-detail-access .reader-save-panel { display: flex; flex-direction: column; align-items: stretch; margin: 0 !important; gap: 16px; }
.da-detail-access :is(.reader-save-main,.reader-save-actions,.reader-save-options) { align-items: stretch; width: 100%; }
.da-detail-access .reader-save-copy { width: 100%; align-items: flex-start; gap: 12px; }
.da-detail-access .reader-save-copy > div { flex: 1; min-width: 0; }
.da-detail-access .reader-save-copy strong { color: var(--is-text); font: 600 15px/1.4 var(--is-font-ui); }
.da-detail-access .reader-save-copy :is(span,b) { color: var(--is-text-muted); font-size: 13px; font-weight: 400; line-height: 1.6; }
.da-detail-access .reader-save-icon { width: 36px; height: 36px; border-radius: 3px; }
.da-detail-access .reader-save-chip { border-radius: 3px; padding: 4px 8px; }
.da-detail-access .backStyle .btn-primary { background: var(--is-action); color: var(--is-action-text); border-color: #b1848c; border-radius: 3px; box-shadow: none; }
.da-detail-access .backStyle .btn-info { background: transparent; color: var(--is-text); border-color: var(--is-border-strong); border-radius: 3px; box-shadow: none; }
.da-detail-access .reader-journey-list { margin: 0; }
.da-detail-access :is(.chapter-block,.chapter-header,.reader-screen-row) { background: var(--is-surface-muted); border-color: var(--is-border); border-radius: 3px; box-shadow: none; color: var(--is-text); }
.da-detail-access .chapter-header { width: 100%; text-align: left; flex-wrap: wrap; gap: 8px; }
.da-detail-access .chapter-header strong { color: var(--is-accent) !important; font-size: 15px; }
.da-detail-access .chapter-header .text-muted { background: var(--is-surface); border-color: var(--is-border); color: var(--is-text-muted) !important; font-size: 12px; font-weight: 400; }
.da-detail-access .reader-screen-link { color: var(--is-text); }
.da-detail-access .reader-screen-link:hover .reader-screen-row { background: var(--is-surface-strong); }
.da-detail-access .reader-screen-icon { color: var(--is-text); background: var(--is-surface); border-color: var(--is-border); border-radius: 3px; }

.da-detail-page .da-detail-tools .istory-meta-box { text-align: left; }
.da-detail-access :is(.eligibility-title,.eligibility-sub) { color: var(--is-text-muted); }
.da-detail-access .eligibility-banner { margin: 0; border-width: 1px; border-style: solid; }
.da-detail-access .action-forge::before,.da-detail-access .action-forge::after { content: none; }
.da-detail-access .action-forge .action-btn { min-height: 60px; padding: 14px; border-radius: 3px; background: var(--is-surface-muted); color: var(--is-text); border: 1px solid var(--is-border-strong); box-shadow: none; text-shadow: none; font-family: var(--is-font-ui); }
.da-detail-access .action-forge .action-btn--write { background: var(--is-action); color: var(--is-action-text); border-color: #b1848c; }
.da-detail-access .action-forge .action-btn small { color: var(--is-text-muted); }
.da-detail-access .action-forge .action-btn--write small { color: var(--is-action-text); }
.da-detail-access #saveManagerModal.save-manager-modal {
 --save-bg: var(--is-surface); --save-panel: var(--is-surface-muted); --save-muted-panel: var(--is-surface-strong);
 --save-ink: var(--is-text); --save-muted: var(--is-text-muted); --save-line: var(--is-border-strong);
 --save-gold: var(--is-accent); --save-good: var(--is-success); --save-bad: var(--is-danger); --save-blue: var(--is-accent-strong);
}
.da-detail-access #saveManagerModal .save-card-name { background: var(--is-bg); color: var(--is-text); border-color: var(--is-border-strong); font-weight: 400; border-radius: 3px; }
.da-detail-access #saveManagerModal :is(.addSave,.save-select-action,.removeSave) { background: var(--is-surface-strong); border-color: var(--is-border-strong); border-radius: 3px; white-space: normal; min-height: 44px; }
.da-detail-access #saveManagerModal.save-manager-modal .addSave { color:#251b16; background:#dfc799; border-color:#dfc799; opacity:1; }
.da-detail-access #saveManagerModal.save-manager-modal .addSave:disabled { color:#d6c9b8; background:#3b3029; border-color:#806b55; opacity:1; }
.da-detail-access #saveManagerModal .save-select-action { color:var(--is-text); }
.da-detail-access #saveManagerModal .save-card.is-active .save-select-action { color:var(--is-success); }
.da-detail-access #saveManagerModal .removeSave { color:var(--is-danger); }
.da-detail-access #saveManagerModal .save-select-action:has(.save-radio:focus-visible) { outline: 3px solid var(--is-focus-ring); outline-offset: 4px; }
.da-detail-access #saveManagerModal .modal-content { border-radius: 3px; color: var(--is-text); }

/* Lot 4: profile and account surfaces. Narrative, catalogue and library keep their composition. */
.da-profile .profile-shell { width: min(1280px,calc(100% - 40px)); margin: 32px auto 60px; }
.da-profile .profile-hero { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 24px; padding-block: 24px 32px; border-bottom: 1px solid var(--is-border); }
.da-profile :is(.profile-avatar-frame,.profile-avatar-link) { display: block; }
.da-profile .profile-avatar-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--is-border-strong); }
.da-profile .profile-identity,.da-profile .profile-title-row { min-width: 0; }
.da-profile .profile-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.da-profile .profile-username { font-size: clamp(34px,5vw,64px); overflow-wrap: anywhere; }
.da-profile :is(.profile-subline,.profile-note__label) { font-size: 13px; color: var(--is-text-muted); }
.da-profile .profile-note form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.da-profile .profile-note input { min-width: 0; flex: 1 1 180px; }
.da-profile :is(.profile-note,.profile-note div) { overflow-wrap: anywhere; }
.da-profile .profile-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.da-profile :is(.profile-stat,.profile-icon-btn) { background: var(--is-surface); color: var(--is-text); border: 1px solid var(--is-border-strong); padding: 10px 12px; border-radius: 3px; min-height: 44px; }
.da-profile .profile-stat { display: flex; align-items: baseline; gap: 8px; text-align: left; }
.da-profile .profile-stat strong { font-family: var(--is-font-display); font-size: 26px; color: var(--is-accent-strong); }
.da-profile .profile-stat span { font-size: 12px; }
.da-profile .da-profile-layout { display: grid; gap: 24px; margin-top: 24px; }
.da-profile .da-profile-nav { min-width: 0; border: 1px solid var(--is-border); align-self: start; }
.da-profile .da-profile-nav summary { cursor: pointer; padding: 14px; min-height: 48px; }
.da-profile .profile-tabs { display: grid; padding: 8px; gap: 4px; }
.da-profile .profile-tab { text-align: left; min-height: 44px; padding: 12px; background: transparent; border: 1px solid transparent; color: var(--is-text-muted); border-radius: 3px; }
.da-profile .profile-tab.is-active { background: var(--is-surface-strong); color: var(--is-accent-strong); border-color: var(--is-border); }
.da-profile .da-profile-panels { min-width: 0; }
.da-profile .profile-panel { min-width: 0; padding: 24px; background: var(--is-surface-muted); border: 1px solid var(--is-border); }
.da-profile .profile-panel h2 { font-size: 32px; margin-bottom: 24px; }
.da-profile :is(.profile-story-summary,.profile-badge-grid,.profile-community-grid) { display: grid; gap: 16px; }
.da-profile .profile-story-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
.da-profile .profile-story-summary__card { display: grid; align-content: start; gap: 8px; padding: 18px; background: var(--is-surface); border: 1px solid var(--is-border); min-width: 0; overflow-wrap: anywhere; }
.da-profile .profile-story-summary__card strong { font-family: var(--is-font-display); font-size: 28px; }
.da-profile .profile-story-summary__card span { font-size: 13px; color: var(--is-text-muted); }
.da-profile :is(.profile-badges-head,.profile-support-card__head) { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.da-profile :is(.profile-badge-card,.profile-community-section,.profile-support-card,.profile-public-metric,.profile-empty-state) { padding: 20px; border: 1px solid var(--is-border); background: var(--is-surface); overflow-wrap: anywhere; }
.da-profile .profile-badge-card__name { font-size: 26px; }
.da-profile :is(.profile-badge-card__desc,.profile-badges-subtitle,.profile-support-card__notice,.profile-support-card__head span) { color: var(--is-text-muted); font-size: 14px; }
.da-profile .profile-chip { display: inline-block; border: 1px solid var(--is-border-strong); padding: 4px 8px; margin: 4px 4px 4px 0; color: var(--is-text-muted); font-size: 12px; }
.da-profile .profile-person-list,.da-profile .profile-public-stack { display: grid; gap: 16px; }
.da-profile .profile-person-card { display: flex; gap: 12px; min-width: 0; padding-block: 12px; border-bottom: 1px solid var(--is-border); overflow-wrap: anywhere; }
.da-profile .profile-person-card img { width: 52px; height: 52px; object-fit: cover; border-radius: 4px; }
.da-profile .profile-person-card span { display: block; min-width: 0; font-size: 13px; }
.da-profile .profile-person-card strong { font-size: 15px; }
.da-profile :is(.profile-support-form,.profile-account-menu,.profile-support-settings,.profile-public-action,.profile-public-action__copy) { display: grid; gap: 16px; }
.da-profile .profile-support-settings { padding-block: 24px; border-block: 1px solid var(--is-border); }
.da-profile .profile-support-form label { display: grid; gap: 8px; }
.da-profile :is(.profile-support-submit,.profile-follow-btn,.profile-account-action,.profile-account-link,.btn) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 14px; background: var(--is-surface); color: var(--is-text); border: 1px solid var(--is-border-strong); border-radius: 3px; font-size: 14px; white-space: normal; }
.da-profile :is(.profile-support-submit,.profile-follow-btn--follow,.profile-account-link--accent,.btn-primary) { background: var(--is-action); color: var(--is-action-text); border-color: #b1848c; }
.da-profile :is(input:not([type=radio]):not([type=checkbox]),textarea,select) { max-width: 100%; min-height: 44px; padding: 10px 12px; background: var(--is-bg); color: var(--is-text); border: 1px solid var(--is-border-strong); border-radius: 3px; font: inherit; }
.da-profile input::placeholder { color: var(--is-text-muted); opacity: 1; }
.da-profile :is(p,span,strong,label,button,a) { overflow-wrap: anywhere; }
.da-profile .profile-trophy-story { border: 1px solid var(--is-border); margin-block: 16px; }
.da-profile .profile-trophy-story__toggle { width: 100%; min-height: 48px; background: var(--is-surface); color: var(--is-text); padding: 14px; border: 0; text-align: left; }
.da-profile .profile-trophy-story__body { display: none; padding: 16px; }
.da-profile .profile-trophy-story.is-open .profile-trophy-story__body { display: block; }
.da-profile .profile-trophy-grid { display: grid; gap: 16px; }
.da-profile .profile-trophy-card { background: var(--is-surface); border-color: var(--is-border); color: var(--is-text); }
.da-activity-links { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 16px; }
.da-settings-group { padding-block: 24px; border-bottom: 1px solid var(--is-border); }
.da-settings-group h3,.da-settings-group summary { font: 500 27px/1.3 var(--is-font-display); margin-bottom: 16px; }
.da-settings-group p { color: var(--is-text-muted); }
.da-setting-choice { display: flex; gap: 12px; align-items: center; padding-block: 12px; min-height: 44px; }
.da-setting-choice input { width: 20px; height: 20px; accent-color: var(--is-action); }
.da-install-layout { display: grid; gap: 32px; margin-block: 32px 60px; }
.da-install-state { align-self: start; background: var(--is-surface); border: 1px solid var(--is-border-strong); padding: 24px; }
.da-install-state h2 { font-size: 32px; margin-bottom: 24px; }
.da-install-state p { margin-bottom: 20px; overflow-wrap: anywhere; }
.da-install-instructions summary { cursor: pointer; min-height: 44px; }
.da-install-instructions li { margin-block: 16px; padding-left: 8px; }
@media(min-width:800px){
 .da-profile .profile-hero { grid-template-columns: 160px minmax(0,1fr); gap: 40px; padding-block: 32px 40px; }
 .da-profile .da-profile-layout { grid-template-columns: 230px minmax(0,1fr); gap: 32px; }
 .da-profile :is(.profile-badge-grid,.profile-community-grid) { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .da-profile .profile-story-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
 .da-install-layout { grid-template-columns: 360px minmax(0,1fr); gap: 56px; }
}
@media(max-width:539px){
 .da-profile .profile-shell { margin-top: 20px; }
 .da-profile .profile-hero { grid-template-columns: 64px minmax(0,1fr); gap: 16px; }
 .da-profile .profile-stats { grid-column: 1/-1; }
 .da-profile .profile-note,.da-profile .profile-stats { margin-left: -80px; }
 .da-profile .profile-note { margin-top: 24px !important; }
 .da-profile .profile-panel { padding: 16px; }
 .da-profile .profile-story-summary__card { padding: 12px; }
 .da-profile .profile-story-summary__card strong { font-size: 24px; }
}

.da-profile .da-profile-resources { grid-column: 1/-1; }
.da-profile .da-profile-resources summary { cursor: pointer; min-height: 44px; padding-block: 12px; color: var(--is-accent); }

.da-profile .profile-push-settings { color: var(--is-text); background: var(--is-surface); border-color: var(--is-border); border-radius: 3px; }
.da-profile .profile-push-settings p { color: var(--is-text-muted); }

.da-profile .da-account-help summary { cursor: pointer; min-height: 44px; padding: 14px 0; color: var(--is-text-muted); }
