/* Thinking Life · design.markdown V2.1. Shared visual layer for every entry page. */
:root {
  --ds-surface: #fff; --ds-paper: #FAFBF8; --ds-ink: #222721;
  --ds-muted: #686A64; --ds-line: #E3E6DF; --ds-edge: #D4D9CE;
  --ds-soft: #F2F4ED; --ds-lime: #E9F4BD; --ds-accent: #B33A13;
  --ds-orange: #FA572B; --ds-on-lime: #222721; --ds-grid: rgba(34,39,33,.035);
  --font-body: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: var(--font-body); --sans: var(--font-body); --serif: var(--font-body);
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --bg: var(--ds-paper); --paper: var(--ds-surface); --ink: var(--ds-ink);
  --text: var(--ds-ink); --muted: var(--ds-muted); --card: var(--ds-surface);
  --card-strong: var(--ds-surface); --line: var(--ds-line); --soft: var(--ds-soft);
  --gray-1: var(--ds-ink); --gray-2: var(--ds-muted); --gray-3: var(--ds-edge); --gray-4: var(--ds-soft);
  --blue: var(--ds-accent); --red: var(--ds-accent); --yellow: var(--ds-lime);
  --accent: var(--ds-accent); --accent2: var(--ds-accent); --mint: #2E7D5B;
  --bauhaus-blue: var(--ds-accent); --bauhaus-red: var(--ds-accent); --bauhaus-yellow: var(--ds-lime);
  --vermilion: var(--ds-accent); --shadow: none; --radius: 8px;
  --home-gold: var(--ds-accent); --nav-height: 60px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ds-surface: #20211D; --ds-paper: #171815; --ds-ink: #F4F5ED;
  --ds-muted: #B4B7A9; --ds-line: #41443A; --ds-edge: #4A5143;
  --ds-soft: #2B2E25; --ds-accent: #FF9972; --ds-orange: #FF8056;
  --ds-grid: rgba(244,245,237,.04); --mint: #91CDAE; color-scheme: dark;
}
html { scroll-padding-top: calc(var(--nav-height) + 24px); }
html body { background: var(--ds-paper); color: var(--ds-ink); font-family: var(--font-body); font-size: 16px; line-height: 1.75; }
body::before, body::after { display: none; }
body :is(h1,h2,h3,h4,h5,h6) { font-family: var(--font-body); font-weight: 650; letter-spacing: -.025em; text-shadow: none; -webkit-text-stroke: 0; }
body h1::first-line { color: inherit; }
body h1 { font-size: 32px; line-height: 1.25; }
body h2 { font-size: 24px; line-height: 1.4; border: 0; padding-bottom: 0; }
body h3 { font-size: 19px; line-height: 1.5; }
body :is(button,input,textarea,select) { font-family: var(--font-body); }
body :is(p,li) { overflow-wrap: anywhere; }
body :is(input,textarea,select) { color: var(--ds-ink); background: var(--ds-surface); border: 1px solid var(--ds-edge); border-radius: 8px; }
body input::placeholder, body textarea::placeholder { color: var(--ds-muted); opacity: 1; }
body :is(a,button,input,textarea,select,[tabindex]):focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 3px; }
body :is(button,a) { -webkit-tap-highlight-color: transparent; }
body :is(button,a,.card) { transition-property: background-color, color, border-color; transition-duration: .16s; }
body :is(.wrap,.shell) { max-width: 1144px; padding: 0 28px 64px; margin-inline: auto; }
body :is(.hero,.flu-hero) { padding: 40px 0 32px; gap: 32px; border-bottom: 1px solid var(--ds-line); }
body .hero { grid-template-columns: minmax(0,1fr) 220px; align-items: center; }
body :is(.hero,.flu-hero) h1 { margin: 12px 0 16px; font-size: 32px; line-height: 1.3; }
body :is(.hero,.flu-hero) p { font-size: 16px; line-height: 1.75; color: var(--ds-muted); }
body .hero::after, body .card::before, body .card::after, body .product-card::after, body .flu-stat::after { display: none; }
body :is(.kicker,.eyebrow,.home-kicker,.flu-kicker) { font-size: 11px; line-height: 1.5; font-weight: 650; letter-spacing: .12em; color: var(--ds-accent); }
body .hero-card { min-height: 148px; padding: 20px; border: 1px solid var(--ds-edge); border-radius: 10px; background: var(--ds-soft); color: var(--ds-ink); transform: none; }
body .hero-card .big { color: var(--ds-accent); font-size: 52px; line-height: 1.05; font-weight: 650; }
body .hero-card .small { font-size: 13px; line-height: 1.7; font-weight: 400; color: var(--ds-muted); margin-top: 12px; }
body .notice { border: 1px solid var(--ds-line); border-radius: 8px; background: var(--ds-soft); color: var(--ds-muted); font-size: 13px; font-weight: 400; padding: 12px 14px; }

/* A steady, compact header shared by the atlas pages and the home page. */
body :is(.nav,.home-nav) { height: var(--nav-height); min-height: var(--nav-height); position: sticky; top: 0; z-index: 40; margin: 0; padding: 0; gap: 16px; flex-wrap: nowrap; border: 0; border-bottom: 1px solid var(--ds-line); border-radius: 0; background: var(--ds-paper); box-shadow: none; backdrop-filter: none; }
body :is(.brand,.home-brand) { gap: 10px; flex-shrink: 0; }
body :is(.mark,.home-mark,.shelf-brand-logo) { width: 32px; height: 32px; flex-basis: 32px; border: 1px solid var(--ds-edge); border-radius: 8px; box-shadow: none; background: var(--ds-surface); }
body :is(.mark img,.home-mark img) { border-radius: 7px; }
body :is(.brand-text b,.home-brand-text b) { font-size: 15px; font-weight: 650; line-height: 1.4; color: var(--ds-ink); }
body :is(.brand-text span,.home-brand-text span) { display: none; }
body :is(.nav-actions,.home-links) { display: flex; align-items: center; gap: 4px; flex: 1; flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
body :is(.nav-actions .btn,.home-link,.home-link.primary,.home-link.current,.nav-actions .btn.nav-home) { min-height: 36px; padding: 7px 9px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; line-height: 1.5; font-weight: 500; white-space: nowrap; color: var(--ds-muted); background: transparent; flex-shrink: 0; }
body :is(.nav-actions .btn:hover,.home-link:hover,.home-link.primary:hover,.nav-actions .btn.nav-home:hover) { color: var(--ds-ink); background: var(--ds-soft); border-color: var(--ds-line); transform: none; box-shadow: none; }
body :is(.home-link.current,.home-link[aria-current="page"],.nav-actions .btn[aria-current="page"]) { background: var(--ds-lime); border-color: var(--ds-edge); color: var(--ds-on-lime); }
.site-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
body .site-switch { max-width: 148px; height: 36px; font-size: 12px; padding: 5px 26px 5px 9px; }
body .site-theme { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--ds-edge); border-radius: 8px; background: var(--ds-surface); color: var(--ds-muted); cursor: pointer; }
.site-theme svg { width: 17px; height: 17px; }
body .site-theme:hover { background: var(--ds-soft); color: var(--ds-accent); }

/* Browse, filter and read. Content widths are shared; illustrations keep their meaning. */
body .toolbar { margin: 24px 0; gap: 16px; grid-template-columns: minmax(260px,.8fr) 1.4fr; }
body .search { padding: 11px 14px; font-size: 16px; min-height: 46px; border: 1px solid var(--ds-edge); border-radius: 8px; box-shadow: none; }
body .filters { gap: 6px; padding: 4px 2px 6px; scrollbar-width: thin; }
body :is(.filter,.tag,.evidence,.badge,.pill) { border: 1px solid var(--ds-line); border-radius: 6px; font-weight: 500; }
body .filter { padding: 7px 11px; background: var(--ds-surface); color: var(--ds-muted); font-size: 13px; }
body :is(.filter.active,.filter[aria-pressed="true"]) { background: var(--ds-lime); border-color: var(--ds-edge); color: var(--ds-on-lime); font-weight: 650; }
body .grid { gap: 16px; grid-template-columns: repeat(3,minmax(0,1fr)); }
body .grid .card { min-height: 224px; padding: 20px; border: 1px solid var(--ds-line); border-radius: 10px; background: var(--ds-surface); box-shadow: none; }
body .grid .card:hover { background: var(--ds-surface); border-color: var(--ds-accent); transform: none; box-shadow: none; }
body :is(.num,.no,.detail-num,.detail-no) { font-family: var(--font-body); font-weight: 500; color: var(--ds-accent); }
body .card :is(.num,.no) { font-size: 24px; line-height: 1.2; margin-bottom: 16px; }
body .card .cn { font-family: var(--font-body); font-size: 20px; font-weight: 650; color: var(--ds-ink); line-height: 1.4; }
body .card :is(.en,.desc,.source-title) { color: var(--ds-muted); }
body .card .desc { font-size: 14px; line-height: 1.75; margin-top: 14px; }
body :is(.tag,.evidence) { padding: 4px 8px; font-size: 11px; background: var(--ds-soft); color: var(--ds-muted); }
body .section { margin-top: 48px; scroll-margin-top: calc(var(--nav-height) + 24px); }
body :is(.section-title,.section-head) { align-items: start; gap: 32px; margin-bottom: 20px; }
body :is(.section-title,.section-head) h2 { font-size: 24px; line-height: 1.45; }
body :is(.section-title,.section-head) p { color: var(--ds-muted); font-size: 15px; line-height: 1.75; }
body :is(.flow-item,.scenario,.stat-card,.map-card,.method-card,.book-card,.concept-card,.concept-group,.mapping-card,.filter-panel) { border: 1px solid var(--ds-line); border-radius: 8px; background: var(--ds-surface); box-shadow: none; }
body :is(.flow-item,.scenario,.stat-card,.method-card) { padding: 20px; }
body :is(.flow-item span,.scenario p,.scenario ol,.stat-card span,.stat-desc,.method-card p) { color: var(--ds-muted); font-size: 14px; line-height: 1.75; }
body :is(.flow-item b,.scenario h3,.stat-card b) { font-size: 17px; font-weight: 650; }
body :is(.flow-item .num,.flow-item .no,.method-num,.stat-num) { color: var(--ds-accent); font-size: 30px; }
body :is(.footer,.home-footer,.flu-footer) { margin-top: 48px; border-top: 1px solid var(--ds-line); padding-top: 20px; color: var(--ds-muted); font-size: 12px; font-weight: 400; }
body .empty { border: 1px dashed var(--ds-edge); border-radius: 8px; background: var(--ds-soft); color: var(--ds-muted); }
body .panel { width: min(768px,100vw); padding: 24px 36px 48px; background: var(--ds-surface); border-left: 1px solid var(--ds-edge); box-shadow: none; }
body .panel-head { padding-bottom: 20px; border-bottom: 1px solid var(--ds-line); }
body :is(.detail-num,.detail-no) { font-size: 24px; line-height: 1.4; }
body :is(.detail-cn,.panel-head h2) { font-size: 32px; line-height: 1.35; font-weight: 650; color: var(--ds-ink); }
body :is(.detail,.entry-content) { color: var(--ds-ink); font-size: 16px; line-height: 1.75; }
body .detail :is(p,li,ul,ol) { color: var(--ds-ink); font-size: 16px; line-height: 1.75; }
body .detail h3 { color: var(--ds-ink); font-size: 20px; font-weight: 650; text-shadow: none; -webkit-text-stroke: 0; letter-spacing: -.02em; margin-top: 28px; }
body :is(.quote,.practice,.practice-card,.d-principle,.d-risk,.d-quote,.d-notapply,.training-stage,.lesson-turn,.distinction-card,.concept-contrast,.training-guide) { border: 1px solid var(--ds-line); border-radius: 8px; background: var(--ds-soft); box-shadow: none; color: var(--ds-ink); }
body .concept-board { min-height: 128px; border: 1px solid var(--ds-line); border-radius: 8px; background: var(--ds-soft); box-shadow: none; display: grid; align-items: center; padding: 20px; }
body .concept-board::before, body .concept-board::after { display: none; }
body .board-card { position: static; min-height: 0; border: 0; padding: 0; background: transparent; box-shadow: none; }
body .board-card b { font-size: 22px; color: var(--ds-ink); }
body .board-card span { color: var(--ds-muted); font-size: 14px; }
body .training-kicker, body .fact-table th { background: var(--ds-lime); color: var(--ds-on-lime); border: 1px solid var(--ds-edge); border-radius: 6px; }
body .training-stage[class] { background: var(--ds-soft); }
body .training-stage::before { border: 1px solid var(--ds-edge); border-radius: 6px; background: var(--ds-lime); color: var(--ds-on-lime); }
body .lesson-turn, body .concept-contrast { border: 0; background: transparent; }
body .lesson-turn > div, body .concept-contrast > div { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 8px; }
body .training-option, body .training-feedback, body .answer-key, body .training-field textarea { background: var(--ds-surface); color: var(--ds-ink); border: 1px solid var(--ds-edge); border-radius: 8px; }
body .training-option:hover, body .training-option:focus-visible { transform: none; }
body .training-option.is-correct { background: var(--ds-soft); border-color: var(--mint); }
body .training-option.is-wrong { background: var(--ds-soft); border-color: var(--ds-accent); }
body .method-num { background: var(--ds-soft); color: var(--ds-accent); border-radius: 6px; }
body :is(.btn,.close,.source-link,.cid-btn,.cid-cta,.flu-btn) { border: 1px solid var(--ds-edge); border-radius: 8px; box-shadow: none; font-weight: 650; color: var(--ds-ink); background: var(--ds-surface); }
body :is(.btn:hover,.close:hover,.source-link:hover,.cid-btn:hover,.cid-cta:hover,.flu-btn:hover) { transform: none; box-shadow: none; background: var(--ds-soft); }
body :is(.btn-primary,.cid-btn.primary,.cid-cta,.flu-btn-primary,.flu-btn-yellow) { color: var(--ds-on-lime); background: var(--ds-lime); border-color: var(--ds-edge); }
body :is(.btn-primary:hover,.cid-btn.primary:hover,.cid-cta:hover,.flu-btn-primary:hover) { background: var(--ds-lime); border-color: var(--ds-accent); color: var(--ds-on-lime); }
body .cid { margin-top: 24px; border: 1px solid var(--ds-edge); border-radius: 10px; background: var(--ds-soft); box-shadow: none; }
body :is(.cid-title,.cid-kicker,.cid-sub) { color: var(--ds-ink); }
body :is(.cid-panel,.cid-drop,.cid-result .rbox) { background: var(--ds-surface); border: 1px solid var(--ds-edge); border-radius: 10px; box-shadow: none; color: var(--ds-ink); }

/* Homepage: quiet grid paper, an existing illustration, and clear entry points. */
body .system-home { background: var(--ds-paper); }
body .home-shell { max-width: 1136px; margin-inline: auto; padding: 0 28px 40px; }
body .home-hero { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr); padding: 48px 0; gap: 48px; align-items: center; border-bottom: 1px solid var(--ds-line); background-image: linear-gradient(var(--ds-grid) 1px,transparent 1px),linear-gradient(90deg,var(--ds-grid) 1px,transparent 1px); background-size: 24px 24px; }
body .home-hero h1 { font-size: clamp(44px,5vw,64px); line-height: 1.15; font-weight: 650; letter-spacing: -.045em; margin: 18px 0 20px; }
body .home-title-accent { color: var(--ds-accent); }
body .home-hero p { color: var(--ds-muted); font-size: 16px; line-height: 1.75; max-width: 500px; }
body .home-hero-card { min-height: 340px; height: 100%; max-height: 410px; border: 1px solid var(--ds-line); border-radius: 10px; background: var(--ds-surface); padding: 0; overflow: hidden; box-shadow: none; transform: none; }
body .home-hero-card:hover { transform: none; box-shadow: none; border-color: var(--ds-edge); }
body .home-hero-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; mix-blend-mode: normal; filter: none; }
body .home-hero-card:hover img { transform: none; }
body .home-hero-card::after { background: linear-gradient(transparent 48%,rgba(20,24,18,.8)); }
body .home-hero-card .big { position: absolute; inset: auto auto 76px 24px; margin: 0; padding: 0; border: 0; background: transparent; font-size: 44px; font-weight: 500; color: #fff; }
body .home-hero-card .small { position: absolute; inset: auto 24px 22px 24px; color: #fff; padding: 0; margin: 0; border: 0; font-size: 13px; font-weight: 400; line-height: 1.6; }
body .home-section { margin-top: 0; padding: 40px 0; border-bottom: 1px solid var(--ds-line); }
body .home-section-head { grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 24px; }
body .home-section h2 { font-size: 28px; line-height: 1.35; font-weight: 650; }
body .entry-title span { display: inline; white-space: normal; }
body .home-section-head p { font-size: 15px; color: var(--ds-muted); line-height: 1.75; }
body .product-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
body .home-shell .product-card { min-height: 240px; padding: 22px; border: 1px solid var(--ds-line); border-radius: 10px; box-shadow: none; background: var(--ds-surface); }
body .product-card.locked { background: var(--ds-soft); }
body .product-card:hover { transform: none; box-shadow: none; border-color: var(--ds-accent); }
body .product-count { font-size: 32px; color: var(--ds-accent); font-weight: 500; line-height: 1.2; }
body .product-badge { border: 0; padding: 0; font-size: 10px; color: var(--ds-muted); background: transparent; font-weight: 500; letter-spacing: .1em; }
body .product-card h3 { font-size: 21px; font-weight: 650; margin: 18px 0 10px; }
body .product-card p { font-size: 14px; line-height: 1.75; color: var(--ds-muted); }
body .product-action { border: 1px solid var(--ds-edge); border-radius: 6px; background: var(--ds-lime); color: var(--ds-on-lime); font-size: 12px; font-weight: 650; align-self: start; padding: 6px 10px; margin-top: 20px; }
body :is(.workflow,.task-grid) { gap: 16px; }
body :is(.workflow-step,.task-card) { border: 1px solid var(--ds-line); border-radius: 8px; background: var(--ds-surface); padding: 20px; }
body :is(.workflow-step b,.task-card b) { font-size: 17px; color: var(--ds-ink); font-weight: 650; }
body :is(.workflow-step span,.task-card span) { color: var(--ds-muted); font-size: 14px; line-height: 1.75; }

/* Shelf and its article / editor / chat views. */
body #shelfTopbar { min-height: 60px; padding: 10px 28px; background: var(--ds-paper); border-bottom: 1px solid var(--ds-line); gap: 16px; flex-wrap: nowrap; }
body #shelfTopbar .logo { font-size: 19px; font-weight: 650; }
body #shelfTopbar .sub { display: none; }
body #shelfTopbar .search-input { border: 1px solid var(--ds-edge); border-radius: 8px; background: var(--ds-surface); min-height: 38px; flex: 1 1 220px; min-width: 120px; width: auto; max-width: 400px; }
body #shelfTopbar .site-switch { max-width: 116px; }
body #shelfTopbar .top-actions { flex-shrink: 0; }
body #app { max-width: 1144px; margin-inline: auto; padding: 28px; }
body #app > .page { padding: 0; }
body .entry-page { max-width: 768px; padding: 24px 36px 48px; border: 1px solid var(--ds-line); border-radius: 10px; background: var(--ds-surface); }
body .entry-head h1 { font-size: 32px; font-weight: 650; line-height: 1.35; }
body .entry-content { font-size: 16px; line-height: 1.75; }
body .entry-content :is(p,li), body .my-note-block .content, body .ai-summary-content { font-size: 16px; line-height: 1.75; }
body .type-tabs { background: transparent; border-color: var(--ds-line); gap: 6px; padding-bottom: 8px; }
body .type-tab { border: 1px solid transparent; border-radius: 6px; padding: 9px 14px; min-height: 42px; color: var(--ds-muted); }
body .type-tab.active { background: var(--ds-lime); color: var(--ds-on-lime); border-color: var(--ds-edge); }
body .type-tab.active::after { display: none; }
body .type-tab .count { color: var(--ds-muted); }
body .type-tab.active .count { color: var(--ds-on-lime); }
body .view-switch button { border: 1px solid var(--ds-edge); border-radius: 6px; background: var(--ds-surface); color: var(--ds-muted); }
body .view-switch button.active { background: var(--ds-lime); color: var(--ds-on-lime); }
body .tag-chip { background: var(--ds-lime) !important; color: var(--ds-on-lime) !important; border: 1px solid var(--ds-edge); border-radius: 6px; }
body :is(.ai-summary-block,.mindmap-block) { border: 1px solid var(--ds-line); border-radius: 8px; background: var(--ds-surface); }
body :is(.subj-head,.mindmap-head,.mindmap-heading,.mindmap-foot) { border-color: var(--ds-line); border-width: 1px; }
body .subj-info h1 { font-size: 32px; line-height: 1.35; }
body .ai-summary-content .placeholder { color: var(--ds-muted); }
body .mindmap-canvas { background-image: none; }
body :is(.entry-card,.topic-card,.subject-card,.collection-card,.stat-card,.my-note-block,.getnote-item,.update-day,.access-card,.modal,.chat-panel) { border: 1px solid var(--ds-line); border-radius: 8px; box-shadow: none; background: var(--ds-surface); }
body .entry-card:hover { transform: none; box-shadow: none; border-color: var(--ds-accent); }
body .entry-head, body .access-card-head, body .modal-header { border-bottom: 1px solid var(--ds-line); }
body .access-gate { background: var(--ds-paper); }
body .access-card { max-width: 460px; }
body .access-card-head h1 { font-size: 28px; line-height: 1.3; }
body :is(.tabs,.home-tools,.stats-strip,.section-tabs,.subject-tabs,.chat-form) { border-color: var(--ds-line); }
body .shelf-system { border: 1px solid var(--ds-line); border-radius: 10px; background: var(--ds-soft); box-shadow: none; }
body .shelf { background: var(--ds-soft); height: 220px; gap: 8px; border-bottom: 1px solid var(--ds-edge); border-image: none; box-shadow: none; }
body .shelf:has(.shelf-empty) { height: 80px; }
body .shelf-empty { padding: 20px 0; color: var(--ds-muted); font-style: normal; }
body .book { background: var(--ds-surface) !important; color: var(--ds-ink) !important; border: 1px solid var(--ds-edge); border-left: 5px solid var(--ds-edge); border-radius: 6px 6px 0 0; box-shadow: none; }
body .book::before, body .book::after, body .stat-card::after { display: none; }
body .book .badge { background: var(--ds-lime); color: var(--ds-on-lime); }
body .shelf-system::before { display: none; }
body .book:hover { transform: none; outline: 2px solid var(--ds-accent); outline-offset: 3px; }
body :is(.menu-pop,.mindmap-view,.mindmap-canvas) { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 8px; box-shadow: none; }

/* Fluency retains timer, recording and practice state; tabs stay within reach. */
body[data-page="fluency"] > .home-nav { max-width: 1088px; margin-inline: auto; }
body .flu-hero h1 em { color: var(--ds-accent); }
body .flu-demo { border: 1px solid var(--ds-edge); border-radius: 10px; background: var(--ds-soft); box-shadow: none; padding: 24px; }
body .flu-tabs { position: sticky; top: var(--nav-height); z-index: 30; background: var(--ds-paper); border-bottom: 1px solid var(--ds-line); flex-wrap: nowrap; overflow-x: auto; padding: 8px 0; gap: 6px; margin-top: 24px; }
body .flu-tab { min-height: 42px; border: 1px solid transparent; border-radius: 6px; padding: 9px 14px; margin: 0; font-weight: 500; white-space: nowrap; flex-shrink: 0; }
body .flu-tab.active { background: var(--ds-lime); color: var(--ds-on-lime); border-color: var(--ds-edge); }
body .flu-panel { border: 1px solid var(--ds-line); border-radius: 10px; padding: 28px; margin-top: 16px; background: var(--ds-surface); scroll-margin-top: calc(var(--nav-height) + 78px); }
body .flu-panel-head h2 { font-size: 24px; }
body .flu-panel-head p { font-size: 16px; line-height: 1.75; }
body :is(.flu-topic,.flu-round,.flu-row,.flu-live-cell,.flu-transcript,.flu-repair-stage,.flu-shadow-item,.flu-stat,.flu-mile,.flu-chart-wrap,.flu-result,.flu-note,.flu-warn) { border: 1px solid var(--ds-line); border-radius: 8px; background: var(--ds-paper); box-shadow: none; }
body :is(.flu-topic.on,.flu-round.now,.flu-shadow-item.on) { border-color: var(--ds-accent); background: var(--ds-soft); box-shadow: none; }
body .flu-topic:hover { transform: none; box-shadow: none; border-color: var(--ds-accent); background: var(--ds-soft); }
body .flu-transcript .ph { color: var(--ds-muted); }
body .flu-bar { height: 22px; border: 1px solid var(--ds-edge); border-radius: 6px; }
body .flu-clock { font-size: clamp(52px,7vw,76px); line-height: 1.1; }
body .flu-btn { letter-spacing: 0; font-size: 14px; }
body .flu-btn-red { color: var(--ds-accent); background: var(--ds-surface); }
body .flu-btn:active { transform: none; }

/* Layout atlas uses the same shell while keeping the original image viewer. */
body[data-page="layouts"] .topbar { max-width: 1088px; height: 60px; min-height: 60px; margin-inline: auto; padding: 0; border: 0; border-bottom: 1px solid var(--ds-line); background: var(--ds-paper); }
body[data-page="layouts"] main { max-width: 1144px; margin-inline: auto; padding: 0 28px; }
body[data-page="layouts"] .hero { grid-template-columns: 1fr 1fr; min-height: 0; padding: 40px 0 32px; }
body[data-page="layouts"] .hero h1 { font-size: 32px; }
body[data-page="layouts"] .hero-copy { font-size: 16px; line-height: 1.75; }
body[data-page="layouts"] .controls { background: var(--ds-paper); border: 0; border-bottom: 1px solid var(--ds-line); top: 60px; padding: 16px 0; box-shadow: none; }
body[data-page="layouts"] .search-wrap { border: 0; box-shadow: none; }
body[data-page="layouts"] .search-wrap input { min-height: 46px; padding: 10px 14px; font-size: 16px; }
body[data-page="layouts"] :is(.tab,.tabs button) { border: 1px solid var(--ds-line); border-radius: 6px; background: var(--ds-surface); color: var(--ds-muted); box-shadow: none; }
body[data-page="layouts"] [aria-selected="true"] { background: var(--ds-lime); color: var(--ds-on-lime); border-color: var(--ds-edge); }
body[data-page="layouts"] :is(.layout-card,.card,.thumb,.caption) { border-color: var(--ds-line); box-shadow: none; border-radius: 8px; background-color: var(--ds-surface); color: var(--ds-ink); }
body[data-page="layouts"] :is(.layout-card,.card):hover { transform: none; box-shadow: none; border-color: var(--ds-accent); }
body[data-page="layouts"] :is(.subheading,.category-head) { border-color: var(--ds-line); }
body[data-page="layouts"] :is(.subheading h2,.category-head h2) { font-size: 24px; }
body[data-page="layouts"] footer { max-width: 1088px; margin: 48px auto 32px; color: var(--ds-muted); border-color: var(--ds-line); }
body[data-page="layouts"] dialog { border: 1px solid var(--ds-edge); border-radius: 10px; background: var(--ds-surface); color: var(--ds-ink); box-shadow: none; }
body[data-page="layouts"] :is(.viewer-info,.viewer-actions button,.viewer-actions a) { background: var(--ds-surface); color: var(--ds-ink); border-color: var(--ds-line); }

@media (max-width: 1000px) {
  body .grid, body .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body .toolbar { grid-template-columns: 1fr; gap: 10px; }
  body .home-hero { gap: 28px; }
  body .nav-actions .btn { padding-inline: 7px; }
}
@media (max-width: 760px) {
  :root { --nav-height: 104px; }
  body :is(.wrap,.shell,.home-shell) { padding: 0 20px 40px; }
  body :is(.nav,.home-nav) { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: 52px 52px; gap: 0 12px; align-items: center; }
  body :is(.brand,.home-brand) { grid-column: 1; grid-row: 1; }
  body :is(.nav-actions,.home-links) { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; width: 100%; height: 52px; }
  body .site-tools { grid-column: 2; grid-row: 1; }
  body .site-switch { max-width: 132px; }
  body :is(.hero,.flu-hero) { grid-template-columns: 1fr; gap: 20px; padding: 28px 0 24px; }
  body :is(.hero,.flu-hero) h1 { font-size: 27px; line-height: 1.35; }
  body .hero-card { min-height: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 20px; padding: 16px; }
  body .hero-card .big { font-size: 38px; }
  body .hero-card .small { margin: 0; }
  body .home-hero { grid-template-columns: 1fr; padding: 32px 0; gap: 24px; }
  body .home-hero h1 { font-size: clamp(34px,9vw,52px); margin-top: 14px; }
  body .home-hero-card { min-height: 270px; height: 270px; }
  body .home-section { padding: 32px 0; }
  body .home-section-head { display: block; }
  body .home-section-head p { margin-top: 14px; }
  body .home-section h2 { font-size: 25px; }
  body :is(.section-title,.section-head) { display: block; }
  body :is(.section-title,.section-head) p { margin-top: 12px; }
  body .panel { padding: 24px 20px 40px; }
  body :is(.detail-cn,.panel-head h2) { font-size: 26px; }
  body .footer { flex-direction: column; gap: 6px; }
  body #shelfTopbar { padding: 0 20px; display: grid; height: 104px; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: 52px 52px; gap: 0 10px; }
  body #shelfTopbar .brand { grid-column: 1; grid-row: 1; }
  body #shelfTopbar .top-actions { grid-column: 2; grid-row: 2; margin: 0; gap: 6px; }
  body #shelfTopbar .access-role-badge { display: none; }
  body #shelfTopbar .top-actions .btn { display: inline-flex; padding: 7px 9px; font-size: 12px; }
  body #shelfTopbar .search-input { grid-column: 1; grid-row: 2; min-width: 0; width: 100%; max-width: none; }
  body #app { padding: 20px; }
  body .entry-page { padding: 24px 20px 40px; }
  body .entry-head h1 { font-size: 26px; }
  body .subj-info h1 { font-size: 26px; }
  body[data-page="fluency"] > .home-nav { margin-inline: 20px; }
  body .flu-panel { padding: 20px; }
  body .flu-live, body .flu-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body .flu-topic-grid { grid-template-columns: 1fr; }
  body[data-page="layouts"] .topbar { margin-inline: 20px; height: 104px; display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: 52px 52px; gap: 0 8px; }
  body[data-page="layouts"] .topbar .brand { font-size: 13px; }
  body[data-page="layouts"] .topbar .site-tools { grid-column: 2; grid-row: 2; }
  body[data-page="layouts"] .topbar .source-link { display: inline-flex; justify-self: start; grid-column: 1; grid-row: 2; }
  body[data-page="layouts"] .controls { top: 104px; }
  body[data-page="layouts"] main { padding: 0 20px; }
  body[data-page="layouts"] .hero { grid-template-columns: 1fr; gap: 16px; padding: 28px 0 24px; }
  body[data-page="layouts"] .hero h1 { font-size: 27px; }
  body[data-page="layouts"] footer { margin-inline: 20px; }
}
@media (max-width: 560px) {
  body .grid, body .product-grid, body .workflow, body .task-grid, body .map-grid, body .flow, body .method-grid { grid-template-columns: 1fr; }
  body .grid .card { min-height: 0; }
  body .product-card { min-height: 224px; }
  body .section { margin-top: 40px; }
  body[data-page="layouts"] .site-switch { width: 105px; }
  body[data-page="layouts"] .source-link { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  :root { --ds-surface: #fff; --ds-paper: #fff; --ds-ink: #222721; --ds-muted: #686A64; --ds-line: #D4D9CE; --ds-soft: #F2F4ED; color-scheme: light; }
  body :is(.nav,.home-nav,.topbar,.site-tools,.toolbar,.filters,.close,.cid,.flu-controls,.flu-tabs,.controls) { display: none !important; }
  body .drawer.open { position: static; }
  body:has(.drawer.open) > .wrap { display: none; }
  body .drawer.open .panel { position: static; width: 100%; height: auto; overflow: visible; transform: none; border: 0; }
  body .drawer.open .shade { display: none; }
  body :is(.card,.product-card,.entry-page,.flow-item) { break-inside: avoid; box-shadow: none; }
  body .home-hero { background-image: none; }
}
