/* ==========================================================================
   TapNod · 黑白星历报 (Monochrome Broadsheet Edition)
   Dual Theme: Daylight Newsprint (白报) & Midnight Ink (黑报)
   Zero AI-Slop · Zero Gradients · Zero Glassmorphism · Pure Print Craft
   ========================================================================== */

:root,
[data-theme="light"] {
  color-scheme: light;
  --paper: #f8f8f6;
  --paper-sub: #efefea;
  --paper-hover: #e7e7e0;
  --ink: #111111;
  --ink-2: #3f3f3c;
  --ink-3: #787872;
  --ink-faint: #a6a69e;
  --rule: #161616;
  --rule-soft: #dcdcd5;
  --inv-bg: #111111;
  --inv-fg: #f8f8f6;
  --danger: #a82d22;
  --danger-bg: #f6e7e5;
  --ok: #1f6b48;
  --backdrop: rgba(17, 17, 17, 0.48);
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0c0c0b;
  --paper-sub: #161614;
  --paper-hover: #1f1f1c;
  --ink: #f3f3ee;
  --ink-2: #bdbdb5;
  --ink-3: #7d7d76;
  --ink-faint: #52524c;
  --rule: #e8e8e1;
  --rule-soft: #262622;
  --inv-bg: #f3f3ee;
  --inv-fg: #0c0c0b;
  --danger: #e88479;
  --danger-bg: #261614;
  --ok: #7ac9a2;
  --backdrop: rgba(0, 0, 0, 0.72);
}

:root {
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
}

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

html {
  background: var(--paper);
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.82;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  transition: background-color 180ms ease, color 180ms ease;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

button {
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--rule-soft);
  border-radius: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

button:hover:not(:disabled) {
  border-color: var(--rule);
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 2px;
}

h1, h2, h3, .serif {
  font-family: var(--font-serif);
  font-weight: 600;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Broadsheet Column Container (Mobile Full-Bleed, Desktop Framed Print Sheet)
   ========================================================================== */

.sheet-column {
  width: min(560px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

@media (min-width: 600px) {
  body {
    background: var(--paper-sub);
  }
  .sheet-column {
    border-left: 1px solid var(--rule-soft);
    border-right: 1px solid var(--rule-soft);
  }
}

/* ==========================================================================
   Newspaper Masthead Header
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 2px solid var(--rule);
}

.topbar-main {
  padding: 13px 18px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-logo-svg {
  display: block;
  height: 22px;
  width: auto;
  color: var(--ink);
  transform: translateY(1.5px);
}

.brand-edition {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  padding-left: 9px;
  border-left: 1px solid var(--rule-soft);
  line-height: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mast-btn {
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid var(--rule-soft);
  background: transparent;
  color: var(--ink-2);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mast-btn:hover:not(:disabled) {
  border-color: var(--rule);
  color: var(--ink);
}

.theme-icon {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.2px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

.topbar-sub {
  padding: 7px 18px;
  border-top: 1px solid var(--rule-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.profile-pill {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-pill:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.profile-pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-meta {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================================================
   VIEW 1: Welcome & Broadsheet Cover Onboarding
   ========================================================================== */

.welcome-shell {
  padding: 0 0 48px;
}

.cover-block {
  padding: 28px 20px 24px;
  border-bottom: 1px solid var(--rule);
}

.cover-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.cover-block h1 {
  font-size: clamp(32px, 8vw, 44px);
  line-height: 1.24;
  letter-spacing: -0.01em;
  margin: 12px 0 12px;
  color: var(--ink);
}

.cover-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-2);
}

.cover-links {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.link-underline {
  border: 0;
  padding: 2px 0;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.link-underline.muted {
  color: var(--ink-3);
  font-weight: 400;
}

.link-underline:hover:not(:disabled) {
  opacity: 0.68;
}

/* Newspaper Form */
.entry-form {
  padding: 24px 20px 12px;
  display: grid;
  gap: 20px;
}

.entry-head h2 {
  margin: 0;
  font-size: 20px;
}

.entry-head p {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.field-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-3);
}

.input-box {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-soft);
  padding: 9px 2px;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  font-variant-numeric: tabular-nums;
  border-radius: 0;
}

.input-box:focus {
  border-bottom-color: var(--rule);
}

.input-box::placeholder {
  color: var(--ink-faint);
}

select.input-box {
  border: 1px solid var(--rule-soft);
  padding: 9px 10px;
  background: var(--paper);
}

/* Sharp Monochrome Segmented Controls */
.seg-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--rule);
}

.seg-btn {
  border: 0;
  border-right: 1px solid var(--rule-soft);
  padding: 9px 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: transparent;
  text-align: center;
  white-space: nowrap;
}

.seg-btn:last-child {
  border-right: 0;
}

.seg-btn[aria-pressed="true"] {
  background: var(--inv-bg);
  color: var(--inv-fg);
  font-weight: 600;
}

.period-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.period-btn {
  padding: 9px 11px;
  border: 1px solid var(--rule-soft);
  text-align: left;
  display: grid;
  gap: 2px;
}

.period-btn strong {
  font-size: 13px;
}

.period-btn small {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}

.period-btn[aria-pressed="true"] {
  background: var(--inv-bg);
  color: var(--inv-fg);
  border-color: var(--inv-bg);
}

.period-btn[aria-pressed="true"] small {
  color: var(--inv-fg);
  opacity: 0.72;
}

.precision-note-box {
  padding: 11px 13px;
  border-left: 2px solid var(--rule);
  background: var(--paper-sub);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

/* Smart City Picker */
.city-picker {
  position: relative;
}

.city-input-row {
  position: relative;
  display: flex;
  align-items: center;
}

.city-status {
  position: absolute;
  right: 2px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ok);
  pointer-events: none;
}

.city-status.invalid {
  color: var(--danger);
}

.city-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 25;
  background: var(--paper);
  border: 1px solid var(--rule);
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.city-option {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--rule-soft);
  padding: 10px 12px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: var(--ink);
}

.city-option:last-child {
  border-bottom: 0;
}

.city-option:hover {
  background: var(--paper-sub);
}

.city-chips,
.focus-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-chip {
  padding: 5px 10px;
  border: 1px solid var(--rule-soft);
  font-size: 12px;
  color: var(--ink-2);
  background: transparent;
}

.pill-chip:hover:not(:disabled) {
  border-color: var(--rule);
  color: var(--ink);
}

.pill-chip[aria-pressed="true"] {
  background: var(--inv-bg);
  color: var(--inv-fg);
  border-color: var(--inv-bg);
  font-weight: 600;
}

.save-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
}

.save-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--ink);
  margin: 0;
}

.btn-primary {
  width: 100%;
  border: 1px solid var(--inv-bg);
  padding: 13px 16px;
  background: var(--inv-bg);
  color: var(--inv-fg);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.88;
}

.btn-secondary {
  padding: 8px 14px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--paper-sub);
}

.form-error {
  padding: 10px 12px;
  background: var(--danger-bg);
  border-left: 2px solid var(--danger);
  color: var(--danger);
  font-size: 12.5px;
}

/* ==========================================================================
   VIEW 2: Broadsheet Reading Feed (Zero Card Nesting!)
   ========================================================================== */

.feed-shell {
  padding-bottom: 84px;
}

.banner {
  padding: 11px 18px;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--paper-sub);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
}

.banner-btn {
  padding: 4px 10px;
  border: 1px solid var(--rule);
  font-size: 11.5px;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--ink);
}

.edition-section {
  padding: 24px 20px;
  border-bottom: 1px solid var(--rule-soft);
}

.edition-section.strong-end {
  border-bottom: 1px solid var(--rule);
}

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

.section-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* Letterpress 4-Pillar Grid (Flush Full-Bleed) */
.pillars-band {
  border-bottom: 1px solid var(--rule);
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pillar-tile {
  border: 0;
  border-right: 1px solid var(--rule-soft);
  padding: 15px 6px 13px;
  text-align: center;
  display: grid;
  gap: 4px;
  justify-items: center;
  background: transparent;
  color: var(--ink);
}

.pillar-tile:last-child {
  border-right: 0;
}

.pillar-tile:hover {
  background: var(--paper-sub);
}

.pillar-tile.is-day {
  background: var(--inv-bg);
  color: var(--inv-fg);
}

.pillar-tile.is-day:hover {
  background: var(--inv-bg);
  opacity: 0.92;
}

.pillar-tile.is-missing {
  background: var(--paper-sub);
  color: var(--ink-3);
}

.pillar-pos {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  opacity: 0.62;
}

.pillar-gz {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.06em;
}

.pillar-god {
  font-size: 11px;
  opacity: 0.8;
}

.pillar-popover {
  padding: 13px 20px;
  border-top: 1px solid var(--rule-soft);
  background: var(--paper-sub);
  font-size: 13px;
  display: grid;
  gap: 8px;
}

.pillar-popover-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

/* Editorial Prose & Minimalist Hairline Loader */
.preview-box {
  padding: 12px 14px;
  border-left: 2px solid var(--rule);
  background: var(--paper-sub);
  margin-bottom: 16px;
}

.preview-box-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin: 0 0 5px;
}

.preview-box p {
  margin: 4px 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-2);
}

.preview-box a {
  color: var(--ink);
}

.reading-prose {
  display: grid;
  gap: 14px;
  font-size: 15px;
  line-height: 1.92;
  color: var(--ink-2);
}

.reading-prose p {
  margin: 0;
  white-space: pre-wrap;
}

.reading-prose .lead-para {
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.48;
  color: var(--ink);
  font-weight: 600;
}

.status-line {
  display: grid;
  gap: 10px;
  padding: 6px 0;
}

.status-label-row {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

.hairline-loader {
  height: 1px;
  width: 100%;
  background: var(--rule-soft);
  overflow: hidden;
  position: relative;
}

.hairline-loader::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 38%;
  background: var(--ink);
  animation: sweep 1.3s infinite ease-in-out;
}

@keyframes sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

.section-foot {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Basis Disclosure */
.basis-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-soft);
  display: grid;
  gap: 12px;
}

.basis-item {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}

.basis-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.basis-item strong {
  font-size: 12.5px;
  color: var(--ink);
}

.basis-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-2);
}

.basis-item small {
  font-size: 11px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

.basis-item a {
  color: var(--ink);
  margin-left: 6px;
}

/* Year Rhythm Band */
.stage-meter {
  margin-bottom: 16px;
  display: grid;
  gap: 7px;
}

.stage-meter-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
}

.stage-meter-top strong {
  font-family: var(--font-serif);
  color: var(--ink);
}

.stage-meter-top span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.meter-track {
  height: 2px;
  background: var(--rule-soft);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: var(--ink);
}

.stage-meter-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.65;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--rule-soft);
  margin-top: 16px;
}

.topic-pill {
  border: 0;
  border-right: 1px solid var(--rule-soft);
  padding: 9px 4px;
  font-size: 12.5px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.topic-pill:last-child {
  border-right: 0;
}

.topic-pill:hover:not(:disabled) {
  background: var(--paper-sub);
  color: var(--ink);
}

.topic-pill.priority {
  background: var(--inv-bg);
  color: var(--inv-fg);
  font-weight: 600;
}

/* Astrology Spec Table + Copperplate Engraved SVG */
.astro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.astro-spec {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
}

.astro-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13px;
}

.astro-spec-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.astro-spec-row span:first-child {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.astro-spec-row strong {
  font-weight: 500;
  color: var(--ink);
}

.natal-svg {
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  color: var(--ink);
}

.aspect-list {
  display: grid;
}

.aspect-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--rule-soft);
  padding: 9px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 12.5px;
  text-align: left;
  color: var(--ink-2);
}

.aspect-row:last-child {
  border-bottom: 0;
}

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

/* Contextual Prompts & Broadsheet Table of Contents (INDEX) */
.prompt-list,
.toc-list {
  display: grid;
}

.prompt-item,
.toc-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--rule-soft);
  padding: 13px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  color: var(--ink);
}

.prompt-item:last-child,
.toc-row:last-child {
  border-bottom: 0;
}

.prompt-item:hover:not(:disabled),
.toc-row:hover:not(:disabled) {
  background: var(--paper-sub);
  padding-left: 6px;
  padding-right: 6px;
}

.toc-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.toc-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.toc-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
}

.toc-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* ==========================================================================
   Fixed Broadsheet Bottom Ask Bar (点点)
   ========================================================================== */

.floating-ask {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  pointer-events: none;
}

.floating-ask-inner {
  width: min(560px, 100%);
  margin: 0 auto;
  pointer-events: auto;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
}

@media (min-width: 600px) {
  .floating-ask-inner {
    border-left: 1px solid var(--rule-soft);
    border-right: 1px solid var(--rule-soft);
  }
}

.floating-ask-btn {
  width: 100%;
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.floating-ask-placeholder {
  flex: 1;
  text-align: left;
  font-size: 13.5px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.floating-ask-cta {
  padding: 7px 14px;
  background: var(--inv-bg);
  color: var(--inv-fg);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================================================
   Monochrome Editorial Drawers (Chat / Deep Dive / Archive)
   ========================================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--backdrop);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.drawer-sheet {
  width: min(560px, 100%);
  max-height: 88dvh;
  background: var(--paper);
  border-top: 2px solid var(--rule);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 600px) {
  .drawer-backdrop {
    align-items: center;
    padding: 24px;
  }
  .drawer-sheet {
    border: 1px solid var(--rule);
    border-top: 2px solid var(--rule);
    max-height: 84dvh;
  }
}

.drawer-header {
  padding: 15px 20px 13px;
  border-bottom: 1px solid var(--rule-soft);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.drawer-header h2 {
  margin: 0;
  font-size: 18px;
}

.drawer-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 3px;
}

.close-btn {
  border: 0;
  padding: 4px 2px;
  font-size: 12.5px;
  color: var(--ink-3);
}

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

.drawer-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 28px;
  display: grid;
  gap: 18px;
  align-content: start;
}

/* Editorial Interview-Style Chat Transcript */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-context-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}

.chat-turn {
  display: grid;
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule-soft);
}

.chat-turn:last-child {
  border-bottom: 0;
}

.chat-speaker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.chat-turn.assistant .chat-speaker {
  color: var(--ink);
  font-weight: 600;
}

.chat-text {
  font-size: 14.5px;
  line-height: 1.88;
  color: var(--ink);
  white-space: pre-wrap;
}

.chat-turn.assistant .chat-text {
  color: var(--ink-2);
}

.chat-followups {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
}

.chat-composer {
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
  background: var(--paper);
  display: grid;
  gap: 10px;
  flex-shrink: 0;
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.composer-input {
  flex: 1;
  min-width: 0;
  resize: none;
  max-height: 110px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-soft);
  padding: 8px 2px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}

.composer-input:focus {
  outline: none;
  border-bottom-color: var(--rule);
}

.composer-send {
  padding: 8px 16px;
  border: 1px solid var(--inv-bg);
  background: var(--inv-bg);
  color: var(--inv-fg);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Deep Module Visuals (Pure Monochrome Print Spec) */
.deep-reading-box {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule-soft);
  display: grid;
  gap: 10px;
}

.deep-reading-box:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.deep-reading-box h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink);
}

.deep-reading-box p {
  margin: 0;
  font-size: 14px;
  line-height: 1.88;
  color: var(--ink-2);
  white-space: pre-wrap;
}

.wuxing-bars {
  display: grid;
  gap: 9px;
}

.wx-bar-row {
  display: grid;
  grid-template-columns: 28px 1fr 24px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-family: var(--font-mono);
}

.wx-bar-track {
  height: 4px;
  background: var(--rule-soft);
}

.wx-bar-fill {
  height: 100%;
  background: var(--ink);
}

.timeline-scroll {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border: 1px solid var(--rule-soft);
}

.timeline-card {
  min-width: 92px;
  padding: 10px 9px;
  border: 0;
  border-right: 1px solid var(--rule-soft);
  text-align: left;
  display: grid;
  gap: 3px;
  flex-shrink: 0;
  color: var(--ink);
}

.timeline-card:last-child {
  border-right: 0;
}

.timeline-card[aria-pressed="true"] {
  background: var(--inv-bg);
  color: var(--inv-fg);
}

.timeline-card[aria-pressed="true"] small {
  color: var(--inv-fg);
  opacity: 0.72;
}

.timeline-card strong {
  font-family: var(--font-serif);
  font-size: 20px;
}

.timeline-card small {
  font-size: 10.5px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.star-tag {
  padding: 6px 11px;
  border: 1px solid var(--rule-soft);
  font-size: 12px;
  color: var(--ink-2);
}

.star-tag[aria-pressed="true"] {
  background: var(--inv-bg);
  color: var(--inv-fg);
  border-color: var(--inv-bg);
}

/* Archive Items */
.archive-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.archive-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.archive-meta strong {
  font-size: 14px;
}

.archive-meta small {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.danger-btn {
  padding: 10px 14px;
  border: 1px solid var(--danger);
  background: transparent;
  color: var(--danger);
  font-size: 12.5px;
}

.site-footer {
  margin-top: auto;
  padding: 20px 18px 28px;
  border-top: 1px solid var(--rule-soft);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

@media (max-width: 360px) {
  .brand-edition {
    display: none;
  }
}

@media (max-width: 400px) {
  .pillar-gz {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
