
/* ================================================
   UI/UX Enhancement Layer - Desktop & Mobile
   优化层：不删除原有样式，在其基础上增强
   ================================================ */

/* ── Enhanced CSS Variables (覆盖并扩展) ── */
:root {
  /* 新增：间距token系统 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 20px;
  --space-xl: 28px;
  
  /* 新增：圆角token */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  
  /* 增强：阴影层级 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 18px 58px rgba(0, 0, 0, 0.12);
  --shadow-accent: 0 6px 16px rgba(220, 160, 0, 0.3);
  
  /* 新增：过渡token */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* 新增：触控目标 */
  --touch-target: 48px;
  --touch-gap: 12px;
  
  /* 增强现有变量 */
  --accent-hover: #c89000;
  --accent-glow: rgba(220, 160, 0, 0.4);
  --ink-soft: #2a2a2a;
  --muted-soft: #b0b0b5;
  --line-strong: rgba(0, 0, 0, 0.18);
}

[data-theme=dark] {
  /* 新增：深色模式额外层级 */
  --surface-deep: #05070C;
  --surface-mid: #0F131C;
  --surface-elevated: #161D2B;
  
  --accent-hover: #ffca28;
  --accent-glow: rgba(247, 181, 0, 0.4);
  --ink-soft: #e5e5e7;
  --muted-soft: #6e6e73;
  --line-strong: rgba(255, 255, 255, 0.18);
  
  /* 增强阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 58px rgba(0, 0, 0, 0.6);
}

/* ── 增强：深色模式背景层次 ── */
[data-theme=dark] body {
  background:
    radial-gradient(circle at 12% 10%, rgba(247, 181, 0, 0.08), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(106, 158, 192, 0.06), transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(247, 181, 0, 0.04), transparent 50%),
    linear-gradient(145deg, #05070C 0%, #0F131C 52%, #161D2B 100%) !important;
}

/* ── 增强：基础排版 ── */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── 增强：Hero区域 (桌面端优化) ── */
.hero {
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  transition: transform var(--transition-base);
}

.hero:hover {
  transform: translateY(-2px);
}

[data-theme=dark] .hero {
  background:
    linear-gradient(135deg, rgba(40, 42, 50, 0.95), rgba(28, 30, 37, 0.82)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent) !important;
}

/* ── 增强：导航按钮 ── */
.workbench-nav-item {
  min-height: 44px;
  transition: all var(--transition-base);
}

.workbench-nav {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.workbench-nav::-webkit-scrollbar {
  display: none;
}

/* ── 增强：表单元素 (移动端触控优化) ── */
input,
textarea,
select {
  transition: all var(--transition-base);
}

input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ── 增强：按钮反馈 ── */
.submit-btn,
.ghost-btn,
.tool-btn,
.mode-chip,
.tab-chip,
.hero-link {
  transition: all var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}

.submit-btn:hover,
.tool-btn:hover {
  box-shadow: var(--shadow-accent);
}

/* ── 增强：Panel组件 ── */
.panel {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: box-shadow var(--transition-base);
}

.panel:hover {
  box-shadow: var(--shadow-lg);
}

/* ================================================
   响应式优化：移动端特化
   ================================================ */

/* 平板断点 (1120px) */
@media (max-width: 1120px) {
  .hero {
    gap: var(--space-lg);
  }
  
  .page {
    padding: var(--space-lg) var(--space-md);
  }
}

/* 移动端主断点 (780px) */
@media (max-width: 780px) {
  :root {
    --space-xl: 20px;
    --space-lg: 16px;
  }
  
  /* 移动端：增加底部安全距离 */
  .page {
    padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
  }
  
  /* 移动端：Hero简化 */
  .hero {
    border-radius: var(--radius-md);
    padding: var(--space-lg);
  }
  
  .hero:hover {
    transform: none; /* 移动端禁用hover动画 */
  }
  
  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: var(--space-sm);
  }
  
  .hero-link,
  .hero-control {
    width: 100%;
    justify-content: center;
    min-height: var(--touch-target);
  }
  
  /* 移动端：底部导航栏 */
  .workbench-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    margin: 0;
    padding: var(--space-sm) var(--space-sm) calc(var(--space-sm) + env(safe-area-inset-bottom));
    border-radius: 0 !important;
    border: none;
    border-top: 1px solid var(--line);
    background: var(--panel-strong);
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
  }
  
  .workbench-nav-item {
    flex: 1;
    min-width: 64px;
    padding: 10px 8px;
    font-size: 0.8rem;
    text-align: center;
  }
  
  /* 移动端：表单增大 */
  input,
  textarea,
  select {
    padding: 16px 18px;
    font-size: 16px !important; /* 防止iOS自动缩放 */
    min-height: var(--touch-target);
  }
  
  /* 移动端：按钮增大 */
  .submit-btn,
  .ghost-btn,
  .tool-btn {
    min-height: var(--touch-target);
    padding: 14px 24px;
    font-size: 1rem;
  }
  
  .mode-chip,
  .tab-chip {
    min-height: var(--touch-target);
    padding: 14px 18px;
  }
  
  /* 移动端：Grid单列 */
  .mode-grid {
    grid-template-columns: 1fr;
  }
  
  .panel-title {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
}

/* 小屏手机 (480px) */
@media (max-width: 480px) {
  .workbench-nav-item {
    font-size: 0.75rem;
    padding: 8px 4px;
  }
  
  h1 {
    font-size: 1.75rem !important;
  }
}

/* ================================================
   触控设备特化 (仅触摸屏)
   ================================================ */
@media (hover: none) and (pointer: coarse) {
  /* 移除所有hover效果 */
  .hero:hover,
  .panel:hover,
  .mode-chip:hover,
  .hero-link:hover,
  .submit-btn:hover,
  .tool-btn:hover,
  .tab-chip:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  
  /* 增强active反馈 */
  .mode-chip:active,
  .hero-link:active,
  .submit-btn:active,
  .tab-chip:active {
    transform: scale(0.97);
    opacity: 0.9;
  }
  
  /* 触控高亮 */
  * {
    -webkit-tap-highlight-color: rgba(220, 160, 0, 0.12);
  }
  
  /* 增加所有可点击元素的触控目标 */
  button,
  a,
  .mode-chip,
  .tab-chip,
  .hero-link {
    min-height: var(--touch-target);
    min-width: var(--touch-target);
  }
}

/* ================================================
   性能与可访问性优化
   ================================================ */

/* 减弱动画模式 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 打印样式 */
@media print {
  body {
    background: white !important;
  }
  
  .workbench-nav,
  .hero-actions,
  button:not(.print-friendly) {
    display: none !important;
  }
  
  .panel {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* Focus可见性增强（键盘导航） */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

[data-theme=dark] :focus-visible {
  outline-color: var(--accent-hover);
}


/* ================================================
   原有样式（保留）
   ================================================ */

/* Scoped hidden rule: only force !important on tab-row buttons to prevent display overrides */
.tab-row [hidden] { display: none !important; }
/* Global hidden attribute falls back to UA default */
[hidden] { display: none; }

:root {
  --bg-1: #f8f4ec;
  --bg-2: #f3eee4;
  --ink: #000000;
  --muted: #8e8e93;
  --line: rgba(0, 0, 0, 0.10);
  --panel: rgba(255, 255, 255, 0.80);
  --panel-strong: rgba(255, 255, 255, 0.95);
  --accent: #dca000;
  --accent-soft: rgba(220, 160, 0, 0.12);
  --water: #2d5f82;
  --good: #228b22;
  --warn: #c81e1e;
  --shadow: 0 18px 58px rgba(0, 0, 0, 0.08);
}

[data-theme=dark] {
  --bg-1: #0a0a0c;
  --bg-2: #121316;
  --ink: #ffffff;
  --muted: #9a9a9f;
  --line: rgba(255, 255, 255, 0.10);
  --panel: rgba(28, 30, 37, 0.78);
  --panel-strong: rgba(40, 42, 50, 0.95);
  --accent: #f7b500;
  --accent-soft: rgba(247, 181, 0, 0.12);
  --water: #6a9ec0;
  --good: #30d158;
  --warn: #ff453a;
  --shadow: 0 18px 58px rgba(0, 0, 0, 0.45);
}

[data-theme=dark] body {
  background:
    radial-gradient(circle at 12% 10%, rgba(247, 181, 0, 0.06), transparent 50%),
    radial-gradient(circle at 85% 20%, rgba(247, 181, 0, 0.04), transparent 40%),
    radial-gradient(circle at 78% 82%, rgba(106, 158, 192, 0.06), transparent 45%),
    linear-gradient(145deg, #0a0a0c 0%, #121316 52%, #0d0d10 100%);
}

[data-theme=dark] body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Source Han Sans SC", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 240, 214, 0.88), transparent 28%),
    radial-gradient(circle at 85% 20%, rgba(208, 138, 54, 0.22), transparent 22%),
    radial-gradient(circle at 78% 82%, rgba(45, 95, 130, 0.16), transparent 30%),
    linear-gradient(145deg, var(--bg-1) 0%, #ead6b5 52%, var(--bg-2) 100%);
}

.page {
  position: relative;
  max-width: 1420px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.hero {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 248, 248, 0.98)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 20px;
  align-items: end;
}

.eyebrow {
  display: inline-flex;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 700;
}

.hero h1 {
  margin: 14px 0 8px;
  font-family: "Source Han Serif SC", "Songti SC", serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.hero-note {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: var(--panel);
  backdrop-filter: blur(8px);
}

.hero-note strong {
  display: block;
  font-size: 0.92rem;
}

.hero-note span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Workspace body: sidebar + main ── */
.workspace-body {
  display: flex;
  gap: 0;
  margin-top: 0;
  min-height: 60vh;
}

/* ── Sidebar ── */
.workspace-sidebar {
  flex-shrink: 0;
  width: 320px;
  transition: width 200ms ease;
  overflow: hidden;
  position: relative;
}
.workspace-sidebar.collapsed {
  width: 52px;
}

/* ── Old layout grid (result area) ── */
.layout {
  flex: 1;
  min-width: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.control-panel {
  padding: 20px;
  position: sticky;
  top: 16px;
  height: fit-content;
}

.panel-title,
.section-head,
.result-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.panel-title h2,
.result-top h2,
.section-head h3 {
  margin: 0;
}

.panel-title p,
.result-top p,
.helper,
.field small,
.empty-hint {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.9rem;
}

.badge-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(45, 95, 130, 0.1);
  color: var(--water);
  font-size: 0.82rem;
  font-weight: 700;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.mode-chip,
.tab-chip,
.ghost-btn,
.tool-btn,
.history-item {
  font: inherit;
}

.mode-chip,
.tab-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  min-height: 44px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.mode-chip.active,
.tab-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.mode-chip:hover,
.tab-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.mode-chip.active:hover,
.tab-chip.active:hover {
  box-shadow: 0 4px 14px rgba(220, 160, 0, 0.32);
}
.history-item:hover,
.ghost-btn:hover,
.tool-btn:hover,
.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(220, 160, 0, 0.3);
}
.submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(220, 160, 0, 0.25);
}

.fields,
.control-section,
.history-list,
.result-stack,
.analysis-grid,
.tab-row {
  display: grid;
  gap: 12px;
}

.fields { margin-top: 16px; }

.field { display: grid; gap: 7px; }

.field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

textarea { min-height: 96px; resize: vertical; }

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(220, 160, 0, 0.12);
}

.advanced {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--panel);
}

.advanced summary {
  cursor: pointer;
  font-weight: 700;
}

.submit-row {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.submit-btn {
  border: none;
  border-radius: 16px;
  padding: 14px 24px;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  background: linear-gradient(135deg, #dca000, #c88700);
  box-shadow: 0 4px 10px rgba(220, 160, 0, 0.22),
              0 12px 26px rgba(220, 160, 0, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.submit-btn:disabled {
  cursor: wait;
  opacity: 0.76;
}

.status {
  min-height: 1.4em;
  color: var(--muted);
  font-size: 0.9rem;
}
.status.ok { color: var(--good); }
.status.warn { color: var(--warn); }

.control-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.history-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}
.history-item:hover {
  border-color: var(--accent);
  background: rgba(220, 160, 0, 0.04);
}

.history-item strong { display: block; margin: 4px 0; }
.history-item span { color: var(--muted); font-size: 0.88rem; }

.history-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.history-label {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(45, 95, 130, 0.1);
  color: var(--water);
  font-size: 0.76rem;
  font-weight: 700;
}

.ghost-btn,
.tool-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.ghost-btn:disabled,
.tool-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tool-btn.primary {
  background: linear-gradient(135deg, #dca000, #c88700);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 10px 18px;
}
.tool-btn.primary:hover {
  background: linear-gradient(135deg, #c88700, #b07800);
}
.tool-btn.primary:active {
  transform: scale(0.96);
  transition: transform 60ms ease;
}
.tool-btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.result-panel {
  min-width: 0;
  max-width: 100%;
  min-height: 680px;
  padding: 20px;
}

.result-top { align-items: end; }
.result-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.result-meta { margin: 14px 0; }
.meta-shell {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(220, 160, 0, 0.08), rgba(208, 138, 54, 0.08)), rgba(255, 255, 255, 0.9);
}

.meta-shell h3 { margin: 0; }
.meta-shell p { margin: 8px 0 0; color: var(--muted); }

.tab-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 12px;
}

.result-card,
.empty-state,
.raw-output {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  overflow: hidden;
}

.result-card.accent {
  background: linear-gradient(135deg, rgba(220, 160, 0, 0.08), rgba(208, 138, 54, 0.08)), var(--panel-strong);
}

.result-card.soft {
  background: linear-gradient(135deg, rgba(45, 95, 130, 0.06), rgba(45, 106, 82, 0.06)), var(--panel-strong);
}

.card-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.card-head h3 { margin: 0; font-size: 1.02rem; }
.card-head p { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }
.card-body { padding: 14px 16px 16px; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(111, 74, 39, 0.08);
  font-size: 0.86rem;
  font-weight: 600;
}

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

.analysis-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel);
}

.analysis-item strong { display: block; }
.analysis-item span { color: var(--muted); font-size: 0.9rem; line-height: 1.55; }

.empty-state {
  padding: 24px 20px;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.quote {
  border-left: 4px solid rgba(208, 138, 54, 0.68);
  background: rgba(208, 138, 54, 0.11);
  padding: 12px 14px;
  border-radius: 0 12px 12px 0;
  color: #544230;
}

.code-block,
.raw-output pre {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 14px;
  padding: 12px 14px;
  background: #2a231c;
  color: #f3e8d7;
  font-family: "JetBrains Mono", "Sarasa Mono SC", "SFMono-Regular", monospace;
  font-size: 0.86rem;
  line-height: 1.6;
}

.raw-output {
  margin-top: 14px;
  padding: 12px;
}

.raw-output summary { cursor: pointer; font-weight: 700; }
.raw-output pre { margin-top: 10px; }

code {
  font-family: "JetBrains Mono", "Sarasa Mono SC", "SFMono-Regular", monospace;
  font-size: 0.92em;
  background: rgba(111, 74, 39, 0.08);
  border-radius: 7px;
  padding: 0.15em 0.4em;
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .workspace-sidebar {
    width: 280px;
  }
  .workspace-sidebar:not(.expanded) {
    width: 48px;
  }
}

@media (max-width: 780px) {
  .workspace-body {
    flex-direction: column;
    min-height: auto;
  }
  .workspace-sidebar {
    width: 100% !important;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .workspace-sidebar.expanded {
    width: 100% !important;
    max-height: 55vh;
    overflow-y: auto;
  }
  html, body { overflow-x: hidden; }
  .page { padding: 12px 8px 28px; max-width: 100vw; }
  .layout { max-width: 100%; }
  .result-panel { max-width: 100%; }
  .hero, .panel, .control-panel, .result-panel { border-radius: 14px; padding: 12px; }
  .field-row,
  .analysis-grid { grid-template-columns: 1fr; }
  .result-tools { flex-wrap: wrap; gap: 6px; }
  .tab-row { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tab-row::-webkit-scrollbar { display: none; }
  .panel-title, .section-head, .result-top { flex-wrap: wrap; }
  .mode-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .mode-chip { padding: 8px 10px; font-size: 0.78rem; }
  .workspace-body .layout { padding: 10px 0 0; }
}

/* ===== Store Page ===== */
.store-page .hero {
  grid-template-columns: 1fr;
  gap: 16px;
}
.store-hero-copy p {
  max-width: 52ch;
}
.store-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Hero Auth Panel */
.hero-auth-shell {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: var(--panel);
  backdrop-filter: blur(8px);
}
.hero-auth-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-auth-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.hero-auth-status {
  font-weight: 600;
  font-size: 0.92rem;
}
.hero-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Store Layout */
.store-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 20px;
  margin-top: 20px;
}
.store-products-panel {
  padding: 20px;
}
.store-compare-panel {
  padding: 20px;
}
.store-orders-panel {
  padding: 20px;
  margin-top: 20px;
}

/* Filter Row */
.store-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
}
.store-filter-row .ghost-btn.active {
  border-color: rgba(220, 160, 0, 0.42);
  background: linear-gradient(135deg, rgba(220, 160, 0, 0.12), rgba(208, 138, 54, 0.16));
  font-weight: 700;
}

/* Product Cards Grid */
.store-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

/* Product Card */
.store-product-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.store-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
  border-color: rgba(220, 160, 0, 0.25);
}
.store-product-card.recommended {
  border-color: rgba(208, 138, 54, 0.45);
  background: linear-gradient(135deg, rgba(208, 138, 54, 0.08), rgba(255, 252, 247, 0.82));
}
.store-product-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.store-product-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.store-product-title-wrap strong {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.store-product-type-label {
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.store-product-description {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.store-product-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(111, 74, 39, 0.06);
  font-size: 0.78rem;
  color: var(--muted);
}
.store-product-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}
.store-product-price {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

/* Tier Comparison Table */
.tier-compare-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px;
}
.tier-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 520px;
}
.tier-compare-table th,
.tier-compare-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.tier-compare-feature-col {
  text-align: left !important;
  font-weight: 600;
  color: var(--ink);
  min-width: 140px;
}
.tier-compare-name {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 2px;
}
.tier-compare-price {
  font-weight: 700;
  color: var(--accent);
}
.tier-price-unit {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
}
.tier-compare-recommend-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, rgba(208, 138, 54, 0.22), rgba(220, 160, 0, 0.14));
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.tier-check-yes {
  color: var(--good);
  font-weight: 700;
}
.tier-check-na {
  color: var(--muted);
  opacity: 0.5;
}
.tier-plus-col[data-recommended=true] {
  background: rgba(208, 138, 54, 0.06);
}
.tier-compare-table thead th {
  border-bottom: 2px solid var(--line);
  font-weight: 700;
  vertical-align: bottom;
}

/* Store section badge */
.store-section-badge {
  white-space: nowrap;
}

/* ===== Store Page Dark Mode ===== */
[data-theme=dark] .store-page .hero {
  background: linear-gradient(135deg, rgba(247, 181, 0, 0.1) 0%, rgba(106, 159, 192, 0.1) 100%);
}
[data-theme=dark] .store-page .hero h1,
[data-theme=dark] .store-page .hero p {
  color: var(--ink);
}
[data-theme=dark] .hero-auth-shell {
  background: rgba(28, 30, 37, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme=dark] .store-product-card {
  background: rgba(28, 30, 37, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme=dark] .store-product-card:hover {
  border-color: rgba(208, 138, 54, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}
[data-theme=dark] .store-product-card.recommended {
  border-color: rgba(208, 138, 54, 0.4);
  background: linear-gradient(135deg, rgba(208, 138, 54, 0.1), rgba(28, 30, 37, 0.8));
}
[data-theme=dark] .store-product-meta {
  background: rgba(0, 0, 0, 0.25);
  color: #a09080;
}
[data-theme=dark] .store-product-price {
  color: var(--accent);
}
[data-theme=dark] .store-filter-row .ghost-btn.active {
  background: rgba(208, 138, 54, 0.18);
  border-color: rgba(208, 138, 54, 0.4);
}
[data-theme=dark] .tier-plus-col[data-recommended=true] {
  background: rgba(208, 138, 54, 0.08);
}

/* ===== Store Page Mobile ===== */
@media (max-width: 900px) {
  .store-layout {
    grid-template-columns: 1fr;
  }
  .store-products-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 780px) {
  .store-page .hero {
    gap: 12px;
  }
  .hero-auth-actions {
    flex-direction: column;
  }
  .hero-auth-actions .auth-link-btn {
    width: 100%;
    text-align: center;
  }
  .store-products-panel,
  .store-compare-panel,
  .store-orders-panel {
    padding: 14px;
  }
  .store-product-foot {
    flex-wrap: wrap;
  }
  .tier-compare-table {
    min-width: 480px;
    font-size: 0.8rem;
  }
  .tier-compare-table th,
  .tier-compare-table td {
    padding: 8px 6px;
  }
}


/* ===== Workspace Framework ===== */
.workspace-shell {
  display: grid;
  gap: 14px;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.workspace-header-copy h3 {
  margin: 0;
  font-size: 1.05rem;
}

.workspace-header-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.workspace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.workspace-state-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workspace-state-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(111, 74, 39, 0.07);
  font-size: 0.8rem;
  font-weight: 600;
}

.workspace-state-pill.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.workspace-state-pill.good {
  background: rgba(45, 106, 82, 0.12);
  color: var(--good);
}

.workspace-state-pill.water {
  background: rgba(45, 95, 130, 0.1);
  color: var(--water);
}

.workspace-state-pill.warn {
  background: rgba(220, 160, 0, 0.1);
  color: var(--warn);
}

/* ===== Collapse Shell ===== */
.collapse-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.collapse-shell summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.92rem;
  background: rgba(255, 252, 247, 0.7);
  user-select: none;
}

.collapse-shell summary:hover {
  background: var(--panel-strong);
}

.collapse-body {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

/* ===== Key-Value Pills ===== */
.key-value-pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.key-value-pill {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel);
  text-align: center;
}

.key-value-pill small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.key-value-pill strong {
  display: block;
  font-size: 1.05rem;
}

/* ===== Metric Grid ===== */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.metric-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-metric {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel);
}

.stat-metric small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.stat-metric strong {
  display: block;
  font-size: 1.1rem;
}

.stat-metric.accent strong {
  color: var(--accent);
}

.stat-metric.water strong {
  color: var(--water);
}

.stat-metric.good strong {
  color: var(--good);
}

/* ===== Inline Actions ===== */
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ===== Pillar Grid (Bazi) ===== */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pillar-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.9), rgba(255, 255, 255, 0.7));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pillar-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.pillar-top strong {
  font-size: 1rem;
  line-height: 1.3;
}

.pillar-top span {
  color: var(--muted);
  font-size: 0.82rem;
}

.pillar-facts {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pillar-facts span {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ===== Wuxing Bars ===== */
.wuxing-bars {
  display: grid;
  gap: 10px;
}

.wuxing-bar-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
}

.wuxing-bar-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wuxing-bar-meta strong {
  font-size: 0.92rem;
}

.wuxing-bar-meta small {
  color: var(--muted);
  font-size: 0.78rem;
}

.wuxing-bar-track {
  height: 18px;
  border-radius: 9px;
  background: rgba(111, 74, 39, 0.08);
  overflow: hidden;
}

.wuxing-bar-fill {
  display: block;
  height: 100%;
  width: var(--wuxing-fill);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(208, 138, 54, 0.8), rgba(220, 160, 0, 0.6));
  transition: width 420ms ease;
}

/* ===== Timeline ===== */
.timeline-list {
  display: grid;
  gap: 8px;
}

.timeline-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel);
}

.timeline-item strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.timeline-item span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

/* ===== Line Visual (Yao Glyphs) ===== */
.line-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.line-visual-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.line-visual-card small {
  font-size: 0.72rem;
  color: var(--muted);
}

.line-visual-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.yao {
  display: inline-block;
  width: 28px;
  height: 10px;
  border-radius: 5px;
}

.yao.yang {
  background: linear-gradient(135deg, #e0a326, #c37c18);
  box-shadow: 0 4px 10px rgba(220, 160, 0, 0.32);
  width: 34px;
}

.yao.yang.wide {
  width: 38px;
}

.yao.yin {
  background: linear-gradient(135deg, rgba(111, 74, 39, 0.25), rgba(111, 74, 39, 0.35));
  clip-path: polygon(0% 0%, 100% 0%, 93% 100%, 7% 100%);
}

.line-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel);
  display: grid;
  gap: 8px;
}

.line-group.transformed {
  background: linear-gradient(135deg, rgba(45, 95, 130, 0.06), rgba(255, 255, 255, 0.82));
}

.line-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.line-group-head span {
  font-weight: 700;
  font-size: 0.88rem;
}

.line-group-head small {
  color: var(--muted);
  font-size: 0.78rem;
}

.line-group-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.line-group-meta strong {
  font-size: 0.92rem;
}

.line-group-meta span {
  color: var(--muted);
  font-size: 0.82rem;
}

.line-transform {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(45, 95, 130, 0.08);
  font-size: 0.82rem;
  color: var(--water);
  font-weight: 600;
}

/* ===== Mobile Line Glyphs ===== */
.mobile-line-glyphs {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 8px 0;
}

.mobile-line-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* ===== Liuyao Basic Board ===== */
.liuyao-basic-board {
  display: grid;
  gap: 8px;
}

.liuyao-basic-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(111, 74, 39, 0.06);
  font-weight: 700;
  font-size: 0.82rem;
}

.liuyao-basic-head-row {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr 0.8fr 1fr 1.5fr 0.8fr;
  gap: 8px;
  align-items: center;
}

.liuyao-basic-row {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr 0.8fr 1fr 1.5fr 0.8fr;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--panel);
  font-size: 0.84rem;
}

.liuyao-basic-row.changing {
  border-color: rgba(220, 160, 0, 0.3);
  background: linear-gradient(135deg, rgba(220, 160, 0, 0.06), rgba(255, 255, 255, 0.82));
}

.liuyao-basic-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.liuyao-basic-cell strong {
  font-size: 0.86rem;
}

.liuyao-basic-cell small {
  color: var(--muted);
  font-size: 0.74rem;
}

.liuyao-basic-cell em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--muted);
}

.liuyao-basic-lines {
  display: grid;
  gap: 8px;
}

.liuyao-basic-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.liuyao-basic-flag-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.liuyao-basic-switch-note {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}

.liuyao-basic-switch-note span {
  font-size: 0.72rem;
}

.liuyao-basic-switch-note strong {
  font-weight: 800;
  color: var(--accent);
}

/* ===== Liuyao Coin ===== */
.liuyao-coin-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.liuyao-coin-row.is-animating {
  gap: 12px;
}

.liuyao-coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(111, 74, 39, 0.2);
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.9), rgba(221, 195, 155, 0.5));
  font-size: 0;
  position: relative;
}

.liuyao-coin.locked.yang {
  border-color: rgba(220, 160, 0, 0.4);
  background: linear-gradient(135deg, rgba(208, 138, 54, 0.3), rgba(220, 160, 0, 0.2));
}

.liuyao-coin.locked.yin {
  border-color: rgba(111, 74, 39, 0.3);
  background: linear-gradient(135deg, rgba(111, 74, 39, 0.15), rgba(111, 74, 39, 0.08));
}

.liuyao-coin.live {
  animation: coinFlip 0.6s ease-in-out infinite;
}

.liuyao-coin-face {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.liuyao-coin-face.yang {
  background: linear-gradient(135deg, #d08a36, #aa4726);
}

.liuyao-coin-face.yin {
  background: linear-gradient(135deg, #8a7a65, var(--muted));
}

@keyframes coinFlip {
  0%, 100% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg); }
}

.liuyao-coin-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

/* ===== Liuyao Replay ===== */
.liuyao-replay-shell {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.88), rgba(255, 255, 255, 0.75));
}

.liuyao-replay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.liuyao-replay-head strong {
  font-size: 0.96rem;
}

.liuyao-replay-head span {
  color: var(--muted);
  font-size: 0.84rem;
}

.liuyao-replay-progress-meta {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(111, 74, 39, 0.05);
  font-size: 0.82rem;
  margin-bottom: 10px;
}

.liuyao-replay-progress {
  height: 8px;
  border-radius: 4px;
  background: rgba(111, 74, 39, 0.1);
  overflow: hidden;
  margin-bottom: 12px;
}

.liuyao-replay-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(135deg, #e0a326, #c37c18);
  box-shadow: 0 4px 10px rgba(220, 160, 0, 0.32);
  transition: width 300ms ease;
}

.liuyao-replay-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.liuyao-replay-stage {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.liuyao-replay-stage-caption {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.liuyao-replay-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.liuyao-replay-step strong {
  font-size: 0.9rem;
}

.liuyao-replay-step small {
  color: var(--muted);
  font-size: 0.76rem;
}

.liuyao-replay-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  font-style: normal;
}

.liuyao-replay-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.liuyao-replay-result strong {
  font-size: 0.9rem;
}

.liuyao-replay-result small {
  color: var(--muted);
  font-size: 0.76rem;
}

.liuyao-replay-current {
  border: 2px solid rgba(220, 160, 0, 0.3);
  border-radius: 14px;
  padding: 10px;
}

.liuyao-replay-note {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  padding: 8px;
}

.liuyao-replay-trigger {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, transform 160ms ease;
}

.liuyao-replay-trigger:hover {
  background: var(--panel-strong);
  transform: translateY(-1px);
}

.liuyao-replay-locked-list {
  display: grid;
  gap: 8px;
}

.liuyao-replay-locked-list-wrap {
  max-height: 360px;
  overflow-y: auto;
}

/* ===== Hexagram Panel ===== */
.hexagram-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.hexagram-reading-grid {
  display: grid;
  gap: 10px;
}

.hexagram-sidepanel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--panel);
}

.hexagram-mobile-list {
  display: grid;
  gap: 8px;
}

/* ===== Ziwei System ===== */
.ziwei-shell {
  display: grid;
  gap: 14px;
}

.ziwei-desktop-layout {
  display: grid;
  gap: 14px;
}

.ziwei-chart-shell {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px;
}

.ziwei-chart {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 10px;
  min-width: 720px;
}

.ziwei-palace {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel);
  grid-row: var(--ziwei-row);
  grid-column: var(--ziwei-col);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 160ms ease;
}

.ziwei-palace:hover {
  border-color: rgba(220, 160, 0, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.ziwei-palace.soul {
  border-color: rgba(220, 160, 0, 0.4);
  background: linear-gradient(135deg, rgba(220, 160, 0, 0.08), rgba(255, 252, 247, 0.82));
}

.ziwei-palace.body {
  border-color: rgba(45, 95, 130, 0.35);
  background: linear-gradient(135deg, rgba(45, 95, 130, 0.07), rgba(255, 252, 247, 0.82));
}

.ziwei-palace.origin {
  border-color: rgba(45, 106, 82, 0.35);
  background: linear-gradient(135deg, rgba(45, 106, 82, 0.07), rgba(255, 252, 247, 0.82));
}

.ziwei-palace-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ziwei-palace-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ziwei-palace-title strong {
  font-size: 0.94rem;
}

.ziwei-palace-title span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.ziwei-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ziwei-stars.major span {
  border-radius: 8px;
  padding: 3px 8px;
  background: rgba(220, 160, 0, 0.1);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.ziwei-stars.minor span {
  border-radius: 6px;
  padding: 2px 6px;
  background: rgba(45, 95, 130, 0.08);
  color: var(--water);
  font-size: 0.74rem;
  font-weight: 600;
}

.ziwei-stars.adjective span {
  border-radius: 6px;
  padding: 2px 6px;
  background: rgba(45, 106, 82, 0.08);
  color: var(--good);
  font-size: 0.72rem;
  font-weight: 600;
}

.ziwei-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.ziwei-labels span {
  border-radius: 5px;
  padding: 1px 6px;
  background: rgba(111, 74, 39, 0.06);
  color: var(--muted);
  font-size: 0.7rem;
}

.ziwei-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ziwei-meta-row.center {
  justify-content: center;
  margin-top: 4px;
}

.ziwei-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

.ziwei-foot strong {
  font-size: 0.8rem;
}

.ziwei-foot small {
  color: var(--muted);
  font-size: 0.72rem;
}

.ziwei-center {
  grid-row: 2;
  grid-column: 2 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.92), rgba(255, 255, 255, 0.78));
  text-align: center;
  gap: 6px;
}

.ziwei-center-eyebrow {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ziwei-center h4 {
  margin: 4px 0;
  font-size: 1.15rem;
}

.ziwei-center p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.ziwei-center > small {
  color: var(--muted);
  font-size: 0.72rem;
}

.ziwei-center-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.ziwei-center-meta span {
  font-size: 0.78rem;
  color: var(--muted);
}

.ziwei-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  font-size: 0.76rem;
  color: var(--muted);
}

/* ===== Ziwei Mobile ===== */
.ziwei-mobile-chart {
  display: none;
}

.ziwei-mobile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ziwei-mobile-core {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.9), rgba(255, 255, 255, 0.75));
  text-align: center;
}

.ziwei-mobile-core-eyebrow {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
}

.ziwei-mobile-core strong {
  display: block;
  font-size: 1.1rem;
  margin: 6px 0 4px;
}

.ziwei-mobile-core p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.ziwei-mobile-core > small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

.ziwei-mobile-core-foot {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  margin-top: 6px;
}

.ziwei-mobile-palace {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--panel);
  cursor: pointer;
}

.ziwei-mobile-palace.soul {
  border-color: rgba(220, 160, 0, 0.35);
  background: linear-gradient(135deg, rgba(220, 160, 0, 0.06), rgba(255, 252, 247, 0.82));
}

.ziwei-mobile-palace.body {
  border-color: rgba(45, 95, 130, 0.3);
  background: linear-gradient(135deg, rgba(45, 95, 130, 0.05), rgba(255, 252, 247, 0.82));
}

.ziwei-mobile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.ziwei-mobile-head strong {
  font-size: 0.86rem;
}

.ziwei-mobile-head span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.ziwei-mobile-corner {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 4px;
  text-align: right;
}

/* ===== Ziwei Focus Grid ===== */
.ziwei-focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ziwei-focus-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel);
}

.ziwei-focus-card.accent {
  background: linear-gradient(135deg, rgba(220, 160, 0, 0.06), rgba(255, 255, 255, 0.82));
}

.ziwei-focus-card.water {
  background: linear-gradient(135deg, rgba(45, 95, 130, 0.06), rgba(255, 255, 255, 0.82));
}

.ziwei-focus-label {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.ziwei-focus-card strong {
  display: block;
  font-size: 0.96rem;
  margin-bottom: 2px;
}

.ziwei-focus-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

/* ===== Ziwei Side Panel ===== */
.ziwei-sidepanel {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.ziwei-sidepanel-lower {
  margin-top: 0;
}

.ziwei-sidepanel-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.7);
}

.ziwei-sidepanel-head strong {
  display: block;
  font-size: 0.9rem;
}

.ziwei-sidepanel-head span {
  color: var(--muted);
  font-size: 0.8rem;
}

.ziwei-side-list {
  display: grid;
  gap: 0;
}

.ziwei-side-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 160ms ease;
}

.ziwei-side-item:last-child {
  border-bottom: none;
}

.ziwei-side-item:hover {
  background: rgba(255, 252, 247, 0.7);
}

.ziwei-side-item strong {
  display: block;
  font-size: 0.86rem;
}

.ziwei-side-item span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

.ziwei-side-item small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 4px;
}

/* ===== Fengshui System ===== */
.fengshui-layout-shell {
  display: grid;
  gap: 14px;
}

.fengshui-grid-shell {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fengshui-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 10px;
  min-width: 540px;
}

.fengshui-cell {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel);
  grid-row: var(--fengshui-row);
  grid-column: var(--fengshui-col);
}

.fengshui-cell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.fengshui-cell-head strong {
  font-size: 0.9rem;
}

.fengshui-cell-head span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.fengshui-cell-star {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(111, 74, 39, 0.05);
  margin-bottom: 6px;
}

.fengshui-cell-star b {
  font-size: 0.88rem;
}

.fengshui-cell-star small {
  color: var(--muted);
  font-size: 0.76rem;
}

.fengshui-cell-meta {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 6px;
}

.fengshui-cell p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.fengshui-sidepanel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--panel);
}

.fengshui-side-head {
  margin-bottom: 10px;
}

.fengshui-side-head strong {
  display: block;
  font-size: 0.9rem;
}

.fengshui-side-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ===== Markdown Rendering ===== */
.md-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.md-table th,
.md-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.md-table th {
  font-weight: 700;
  background: rgba(255, 252, 247, 0.7);
  font-size: 0.82rem;
}

.md-table tr:last-child td {
  border-bottom: none;
}

.md-code-block {
  margin: 10px 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 12px;
  padding: 12px 14px;
  background: #2a231c;
  color: #f3e8d7;
  font-family: "JetBrains Mono", "Sarasa Mono SC", "SFMono-Regular", monospace;
  font-size: 0.84rem;
  line-height: 1.6;
}

.md-quote {
  margin: 10px 0;
  border-left: 4px solid rgba(208, 138, 54, 0.68);
  background: rgba(208, 138, 54, 0.11);
  padding: 10px 14px;
  border-radius: 0 10px 10px 0;
  color: #544230;
}

.md-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.md-link:hover {
  color: #c85a32;
}

/* Markdown strong/bold — brand color */
.ai-report-body strong,
.ai-report-body b,
.markdown-render strong,
.markdown-render b {
  color: var(--gold-700);
  font-weight: 700;
}
[data-theme=dark] .ai-report-body strong,
[data-theme=dark] .ai-report-body b,
[data-theme=dark] .markdown-render strong,
[data-theme=dark] .markdown-render b {
  color: var(--gold-400);
}

/* Markdown emphasis — subtle accent */
.ai-report-body em,
.markdown-render em {
  color: var(--water);
  font-style: italic;
}

.md-hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

.md-ol,
.md-ul {
  margin: 8px 0;
  padding-left: 24px;
  line-height: 1.7;
}

.md-ol li,
.md-ul li {
  margin-bottom: 4px;
}

.md-inline-code {
  font-family: "JetBrains Mono", "Sarasa Mono SC", "SFMono-Regular", monospace;
  font-size: 0.9em;
  background: rgba(111, 74, 39, 0.08);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}

/* ===== AI Mode / Report ===== */
.ai-mode-disabled-shell {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.ai-mode-disabled-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--panel);
}

.ai-mode-disabled-mask {
  position: relative;
}

.ai-mode-disabled-mask::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(3px);
}

.ai-mode-disabled-preview {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.ai-report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(111, 74, 39, 0.05);
  font-size: 0.82rem;
}

.ai-report-meta-sep {
  color: var(--line);
}

.ai-report-meta-warn {
  color: var(--warn);
  font-weight: 600;
}

.ai-report-reading {
  line-height: 1.75;
  font-size: 0.94rem;
}

/* ── AI Progress Bar ── */
.ai-progress-wrap {
  margin: 4px 0 8px;
}
.ai-progress-bar {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.ai-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-500));
  border-radius: 3px;
  transition: width .5s ease;
}
.ai-progress-text {
  display: flex;
  gap: 16px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}
.ai-queue-note {
  color: var(--water);
  font-weight: 600;
}

/* ===== History Extensions ===== */
.history-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.history-summary-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(111, 74, 39, 0.06);
  font-size: 0.74rem;
  color: var(--muted);
}

.history-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-toggle {
  font: inherit;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.84rem;
}

.history-ai-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(45, 95, 130, 0.08);
  color: var(--water);
  font-size: 0.72rem;
  font-weight: 700;
}

.history-load-more {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: background 160ms ease;
}

.history-load-more:hover {
  background: rgba(255, 252, 247, 0.7);
}

/* ===== Reading Focus ===== */
.reading-focus-list {
  display: grid;
  gap: 8px;
}

.reading-focus-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--panel);
}

.reading-focus-item strong {
  display: block;
  font-size: 0.88rem;
}

.reading-focus-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.reading-text-block {
  line-height: 1.7;
  font-size: 0.92rem;
}

/* ===== Brand Easter Card ===== */
.brand-easter-card {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(208, 138, 54, 0.08), rgba(255, 252, 247, 0.75));
  text-align: center;
  font-size: 0.84rem;
  color: var(--muted);
}

/* ===== Source Notes ===== */
.source-note {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(111, 74, 39, 0.05);
  font-size: 0.76rem;
  color: var(--muted);
}

.source-note-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ===== Result Localization / Timezone ===== */
.result-localization-copy {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

.result-localization-state {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
}

.result-timezone-policy-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--panel);
}

/* ===== Timezone Memory ===== */
.timezone-memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.timezone-memory-board {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.88), rgba(255, 255, 255, 0.75));
}

.timezone-memory-board-copy {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.55;
}

.timezone-memory-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.timezone-memory-card-head strong {
  font-size: 0.94rem;
}

.timezone-memory-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.timezone-memory-current-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
}

.timezone-memory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.timezone-memory-health-score {
  text-align: center;
  padding: 14px;
}

.timezone-memory-health-score strong {
  display: block;
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.timezone-memory-health-copy {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.timezone-memory-health-sections {
  display: grid;
  gap: 12px;
}

.timezone-quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timezone-quick-picks button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.timezone-quick-picks button:hover {
  border-color: rgba(220, 160, 0, 0.3);
  background: var(--panel-strong);
}

/* Timezone Memory History */
.timezone-memory-history {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.timezone-memory-history-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.7);
}

.timezone-memory-history-head strong {
  display: block;
  font-size: 0.9rem;
}

.timezone-memory-history-list {
  display: grid;
  gap: 0;
}

.timezone-memory-history-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  transition: background 160ms ease;
}

.timezone-memory-history-item:last-child {
  border-bottom: none;
}

.timezone-memory-history-item:hover {
  background: rgba(255, 252, 247, 0.7);
}

.timezone-memory-history-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.timezone-memory-history-item-head strong {
  font-size: 0.86rem;
}

.timezone-memory-history-item-head span {
  color: var(--muted);
  font-size: 0.74rem;
}

.timezone-memory-history-empty {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.timezone-memory-history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
}

.timezone-memory-history-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timezone-memory-history-filter-summary {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 4px 0;
}

.timezone-memory-history-review {
  padding: 10px 14px;
}

.timezone-memory-history-action-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.timezone-memory-history-action-summary-head {
  font-size: 0.86rem;
  font-weight: 700;
}

.timezone-memory-history-action-recency {
  font-size: 0.74rem;
  color: var(--muted);
}

.timezone-memory-history-action-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.timezone-memory-history-action-insights {
  margin-top: 8px;
}

.timezone-memory-history-action-insight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* Timezone Memory Drift */
.timezone-memory-drift-stack {
  display: grid;
  gap: 12px;
}

.timezone-memory-drift-chip {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(45, 95, 130, 0.08);
  color: var(--water);
  font-size: 0.74rem;
  font-weight: 700;
}

.timezone-memory-drift-chip.warn {
  background: rgba(220, 160, 0, 0.1);
  color: var(--warn);
}

.timezone-memory-drift-distribution {
  display: grid;
  gap: 6px;
}

.timezone-memory-drift-change-list {
  display: grid;
  gap: 8px;
}

.timezone-memory-drift-change-items {
  display: grid;
  gap: 6px;
}

.timezone-memory-drift-change-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(111, 74, 39, 0.04);
  font-size: 0.84rem;
}

.timezone-memory-drift-impact {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel);
}

.timezone-memory-drift-impact-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.timezone-memory-drift-reason {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.55;
}

.timezone-memory-drift-suggestion {
  font-size: 0.84rem;
  line-height: 1.5;
}

.timezone-memory-drift-aligned {
  color: var(--good);
  font-weight: 600;
}

.timezone-memory-drift-benefit {
  font-size: 0.82rem;
  color: var(--muted);
}

.timezone-memory-drift-risk {
  font-size: 0.82rem;
  color: var(--warn);
}

.timezone-memory-drift-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timezone-memory-drift-post-align {
  font-size: 0.84rem;
  color: var(--muted);
}

.timezone-memory-drift-recommendation {
  font-weight: 700;
  color: var(--good);
}

.timezone-memory-drift-outliers {
  font-size: 0.82rem;
  color: var(--warn);
}

/* ===== Result Copy ===== */
.result-copy-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel);
}

.result-copy-section-snapshot {
  padding: 10px;
  border-radius: 10px;
  background: rgba(111, 74, 39, 0.04);
}

/* ===== Panel Toggle ===== */
.panel-toggle-copy {
  font-size: 0.82rem;
  color: var(--muted);
}

.panel-toggle-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 200ms ease;
}

details[open] .panel-toggle-glyph {
  transform: rotate(180deg);
}

/* ===== Workspace Feedback ===== */
.workspace-feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  font-size: 0.84rem;
  color: var(--muted);
}

/* ===== Auth Page Shell (if needed from page context) ===== */
.auth-page-shell {
  max-width: 480px;
}

.auth-page-shell .hero {
  grid-template-columns: 1fr;
  margin-bottom: 16px;
}

.auth-layout {
  display: grid;
  gap: 16px;
}

.auth-card {
  padding: 20px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-verify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap input {
  flex: 1;
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 6px;
  border-radius: 6px;
}

.password-toggle:hover {
  background: rgba(111, 74, 39, 0.08);
}

.auth-phone-shell {
  margin-top: 12px;
}

/* ===== datetime-local fix ===== */
.datetime-local {
  font-family: inherit;
}

/* ===== Analysis Grid Variants ===== */
.analysis-grid.dense {
  gap: 8px;
}

.analysis-grid.dense .analysis-item {
  padding: 8px;
}

/* ===== Tag Variants ===== */
.tag.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag.good {
  background: rgba(45, 106, 82, 0.12);
  color: var(--good);
}

.tag.water {
  background: rgba(45, 95, 130, 0.1);
  color: var(--water);
}

.tag.warn {
  background: rgba(220, 160, 0, 0.1);
  color: var(--warn);
}

.tag-row.compact {
  gap: 4px;
}

.tag-row.compact .tag {
  padding: 4px 8px;
  font-size: 0.78rem;
}

/* ===== Dark Mode Extensions ===== */
[data-theme=dark] .pillar-card,
[data-theme=dark] .ziwei-palace,
[data-theme=dark] .fengshui-cell,
[data-theme=dark] .key-value-pill,
[data-theme=dark] .analysis-item,
[data-theme=dark] .stat-metric,
[data-theme=dark] .timeline-item {
  background: rgba(28, 30, 37, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme=dark] .ziwei-center {
  background: linear-gradient(135deg, rgba(28, 30, 37, 0.9), rgba(24, 22, 18, 0.85));
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme=dark] .md-code-block {
  background: #1a1714;
  color: var(--ink);
}

[data-theme=dark] .md-quote {
  background: rgba(208, 138, 54, 0.08);
  border-left-color: rgba(208, 138, 54, 0.4);
  color: #c0b090;
}

[data-theme=dark] .md-table th {
  background: rgba(28, 30, 37, 0.8);
}

[data-theme=dark] .md-table th,
[data-theme=dark] .md-table td {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme=dark] .md-table-wrap {
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme=dark] .collapse-shell summary {
  background: rgba(28, 30, 37, 0.7);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme=dark] .line-group,
[data-theme=dark] .liuyao-basic-row {
  background: rgba(28, 30, 37, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme=dark] .liuyao-replay-shell,
[data-theme=dark] .timezone-memory-board {
  background: linear-gradient(135deg, rgba(28, 30, 37, 0.85), rgba(24, 22, 18, 0.78));
}

[data-theme=dark] .workspace-state-pill {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme=dark] .ziwei-stars.major span {
  background: rgba(247, 181, 0, 0.15);
  color: var(--accent);
}

[data-theme=dark] .ziwei-stars.minor span {
  background: rgba(106, 159, 192, 0.12);
  color: #6a9fc0;
}

[data-theme=dark] .ziwei-stars.adjective span {
  background: rgba(91, 184, 139, 0.12);
  color: #5bb88b;
}


/* iOS glass-morphism enhancement */
@supports (backdrop-filter: blur(12px)) {
  .hero,
  .panel,
  .hero-note,
  .result-panel,
  .control-panel {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  [data-theme=dark] .hero,
  [data-theme=dark] .panel,
  [data-theme=dark] .hero-note,
  [data-theme=dark] .result-panel,
  [data-theme=dark] .control-panel {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}
/* ===== Responsive Overrides for New Components ===== */
@media (max-width: 1120px) {
  .pillar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fengshui-layout-shell {
    grid-template-columns: 1fr;
  }
  .ziwei-chart {
    min-width: 600px;
  }
}

/* Consistent rounded corners — iOS design language */
button,
input,
select,
textarea,
.panel,
.control-panel,
.result-panel,
.hero-note,
.badge-pill,
.mode-chip,
.tab-chip,
.submit-btn,
.ghost-btn,
.tool-btn,
.ghost-input,
.ghost-select,
.store-product-card,
.auth-card,
.bench-card {
  border-radius: 12px;
}
.mode-chip,
.tab-chip,
.badge-pill,
.ghost-btn,
.tool-btn {
  border-radius: 20px;
}
.submit-btn {
  border-radius: 14px;
}
.hero {
  border-radius: 28px;
}
@media (max-width: 780px) {
  .pillar-grid {
    grid-template-columns: 1fr;
  }
  .ziwei-desktop-layout {
    display: none;
  }
  .ziwei-mobile-chart {
    display: block;
  }
  .ziwei-focus-grid {
    grid-template-columns: 1fr;
  }
  .metric-grid.compact,
  .metric-grid {
    grid-template-columns: 1fr;
  }
  .key-value-pills {
    grid-template-columns: 1fr;
  }
  .wuxing-bar-row {
    grid-template-columns: 100px minmax(0, 1fr) 40px;
    gap: 6px;
  }
  .fengshui-grid {
    min-width: 420px;
  }
  .timeline-item {
    padding: 10px;
  }
  .workspace-header {
    flex-direction: column;
  }
  .liuyao-basic-head-row,
  .liuyao-basic-row {
    grid-template-columns: 1fr 1fr 0.6fr 0.8fr 1fr 0.6fr;
    gap: 4px;
    font-size: 0.76rem;
  }
  .liuyao-coin-row {
    gap: 4px;
  }
  .liuyao-coin {
    width: 28px;
    height: 28px;
  }
  .timezone-memory-grid {
    grid-template-columns: 1fr;
  }
  .timezone-memory-drift-impact-stats {
    grid-template-columns: 1fr 1fr;
  }
}

/* ================================================================
   UI Optimization Layer — ichingTools Web
   Animation, interaction, accessibility, micro-polish.
   ================================================================ */

/* ----- Page Entrance ----- */
@keyframes pageReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.page {
  animation: pageReveal 360ms ease;
}

/* ----- Result Panel Transition ----- */
@keyframes resultEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-panel {
  animation: resultEnter 320ms ease;
}

/* Result content width containment */
.result-stack {
  min-width: 0;
  overflow-x: hidden;
}
.ai-report-reading {
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}
.ai-report-reading table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* ----- Tab Content Crossfade ----- */
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-stack > *,
.empty-state {
  animation: tabFadeIn 240ms ease;
}

/* ----- Stagger children in grids ----- */
.pillar-grid > *:nth-child(1) { animation-delay: 0ms; }
.pillar-grid > *:nth-child(2) { animation-delay: 50ms; }
.pillar-grid > *:nth-child(3) { animation-delay: 100ms; }
.pillar-grid > *:nth-child(4) { animation-delay: 150ms; }

.ziwei-chart > *:nth-child(1) { animation-delay: 0ms; }
.ziwei-chart > *:nth-child(2) { animation-delay: 30ms; }
.ziwei-chart > *:nth-child(3) { animation-delay: 60ms; }
.ziwei-chart > *:nth-child(4) { animation-delay: 90ms; }
.ziwei-chart > *:nth-child(5) { animation-delay: 120ms; }
.ziwei-chart > *:nth-child(6) { animation-delay: 150ms; }
.ziwei-chart > *:nth-child(7) { animation-delay: 180ms; }
.ziwei-chart > *:nth-child(8) { animation-delay: 210ms; }
.ziwei-chart > *:nth-child(9) { animation-delay: 240ms; }
.ziwei-chart > *:nth-child(10) { animation-delay: 270ms; }
.ziwei-chart > *:nth-child(11) { animation-delay: 300ms; }
.ziwei-chart > *:nth-child(12) { animation-delay: 330ms; }

.fengshui-grid > *:nth-child(1) { animation-delay: 0ms; }
.fengshui-grid > *:nth-child(2) { animation-delay: 40ms; }
.fengshui-grid > *:nth-child(3) { animation-delay: 80ms; }
.fengshui-grid > *:nth-child(4) { animation-delay: 120ms; }
.fengshui-grid > *:nth-child(5) { animation-delay: 160ms; }
.fengshui-grid > *:nth-child(6) { animation-delay: 200ms; }
.fengshui-grid > *:nth-child(7) { animation-delay: 240ms; }
.fengshui-grid > *:nth-child(8) { animation-delay: 280ms; }
.fengshui-grid > *:nth-child(9) { animation-delay: 320ms; }

/* ----- Card Entrance Base ----- */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pillar-card,
.ziwei-palace,
.fengshui-cell,
.ziwei-mobile-palace {
  animation: cardEnter 280ms ease both;
}

/* ----- Button Press Feedback ----- */
.submit-btn:active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px rgba(220, 160, 0, 0.28);
  transition: transform 80ms ease, box-shadow 80ms ease;
}

.mode-chip:active,
.tab-chip:active,
.ghost-btn:active,
.tool-btn:active {
  transform: scale(0.96);
  transition: transform 60ms ease;
}

/* ----- Mode Chip Nudge (for scroll hint) ----- */
@keyframes modeNudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.nudge-ready .mode-chip:first-child,
.nudge-ready .tab-chip:first-child {
  animation: modeNudge 1.2s ease-in-out 2;
  animation-delay: 0.6s;
}

.nudge-active .mode-chip:first-child,
.nudge-active .tab-chip:first-child {
  animation: modeNudge 0.8s ease-in-out 2;
}

/* ----- Status Pulse for Live Indicators ----- */
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status.live {
  animation: statusPulse 1.8s ease-in-out infinite;
}

/* ----- AI Thinking Shimmer ----- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.ai-shimmer-block {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg,
    rgba(111, 74, 39, 0.06) 25%,
    rgba(111, 74, 39, 0.12) 37%,
    rgba(111, 74, 39, 0.06) 63%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

.ai-shimmer-block.short { width: 60%; }
.ai-shimmer-block.medium { width: 82%; }
.ai-shimmer-block.long { width: 94%; }

.ai-shimmer-shell {
  display: grid;
  gap: 12px;
  padding: 16px;
}

/* ----- Smooth Collapse Height Transition ----- */
.collapse-shell {
  transition: border-color 200ms ease;
}

.collapse-body {
  overflow: hidden;
  transition: max-height 320ms ease, opacity 240ms ease, padding 240ms ease;
}

.collapse-shell:not([open]) .collapse-body {
  max-height: 0 !important;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.collapse-shell[open] .collapse-body {
  max-height: 2000px;
  opacity: 1;
}

/* ----- Custom Scrollbar ----- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(111, 74, 39, 0.04);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(220, 160, 0, 0.18);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(220, 160, 0, 0.32);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(220, 160, 0, 0.18) rgba(111, 74, 39, 0.04);
}

/* ----- Text Selection ----- */
::selection {
  background: rgba(208, 138, 54, 0.28);
  color: var(--ink);
}

/* ----- Focus Ring ----- */
:focus-visible {
  outline: 2px solid rgba(220, 160, 0, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

.mode-chip:focus-visible,
.tab-chip:focus-visible,
.submit-btn:focus-visible,
.ghost-btn:focus-visible {
  outline: 2px solid rgba(208, 138, 54, 0.6);
  outline-offset: 3px;
}

/* ----- Result Card Depth ----- */
.result-card {
  transition: box-shadow 260ms ease, border-color 260ms ease;
}

.result-card:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.result-card.accent:hover {
  box-shadow: 0 4px 24px rgba(220, 160, 0, 0.1);
}

/* ----- Pillar Card Polish ----- */
.pillar-card {
  transition: transform 180ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.pillar-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
  border-color: rgba(220, 160, 0, 0.22);
}

/* ----- Ziwei Palace Polish ----- */
.ziwei-palace {
  position: relative;
  overflow: hidden;
}

.ziwei-palace::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.18), transparent 60%);
  opacity: 0;
  transition: opacity 200ms ease;
}

.ziwei-palace:hover::after {
  opacity: 1;
}

/* ----- Fengshui Cell Polish ----- */
.fengshui-cell {
  transition: transform 160ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.fengshui-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  border-color: rgba(45, 95, 130, 0.22);
}

/* ----- Key-Value Pill Polish ----- */
.key-value-pill {
  transition: transform 140ms ease, border-color 180ms ease, background 180ms ease;
}

.key-value-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(220, 160, 0, 0.16);
}

/* ----- Timeline Polish ----- */
.timeline-item {
  transition: transform 140ms ease, border-color 180ms ease, background 180ms ease;
}

.timeline-item:hover {
  transform: translateX(4px);
  border-color: rgba(220, 160, 0, 0.18);
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.9), rgba(255, 255, 255, 0.82));
}

/* ----- History Item Entrance ----- */
@keyframes historyItemEnter {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.history-item {
  animation: historyItemEnter 200ms ease both;
}

.history-item:nth-child(1) { animation-delay: 0ms; }
.history-item:nth-child(2) { animation-delay: 30ms; }
.history-item:nth-child(3) { animation-delay: 60ms; }
.history-item:nth-child(4) { animation-delay: 90ms; }
.history-item:nth-child(5) { animation-delay: 120ms; }
.history-item:nth-child(6) { animation-delay: 150ms; }
.history-item:nth-child(7) { animation-delay: 180ms; }
.history-item:nth-child(8) { animation-delay: 210ms; }
.history-item:nth-child(9) { animation-delay: 240ms; }
.history-item:nth-child(10) { animation-delay: 270ms; }

/* ----- Tag Polish ----- */
.tag {
  transition: transform 120ms ease, background 160ms ease;
}

.tag:hover {
  transform: scale(1.04);
}

.tag.accent:hover { background: rgba(220, 160, 0, 0.18); }
.tag.good:hover { background: rgba(45, 106, 82, 0.18); }
.tag.water:hover { background: rgba(45, 95, 130, 0.16); }
.tag.warn:hover { background: rgba(220, 160, 0, 0.16); }

/* ----- Ziwei Side Item Polish ----- */
.ziwei-side-item {
  transition: background 160ms ease, transform 120ms ease;
}

.ziwei-side-item:hover {
  background: rgba(255, 252, 247, 0.8);
  transform: translateX(2px);
}

/* ----- Analysis Item Polish ----- */
.analysis-item {
  transition: border-color 160ms ease, background 160ms ease;
}

.analysis-item:hover {
  border-color: rgba(220, 160, 0, 0.14);
  background: rgba(255, 252, 247, 0.92);
}

/* ----- Stat Metric Polish ----- */
.stat-metric {
  transition: transform 140ms ease, border-color 160ms ease;
}

.stat-metric:hover {
  transform: translateY(-1px);
  border-color: rgba(220, 160, 0, 0.14);
}

/* ----- Form Field Enhancements ----- */
input,
textarea,
select {
  transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

input:hover,
textarea:hover,
select:hover {
  border-color: rgba(220, 160, 0, 0.18);
}

input:focus,
textarea:focus,
select:focus {
  background: rgba(255, 255, 252, 0.95);
  border-color: rgba(220, 160, 0, 0.45);
  box-shadow: 0 0 0 4px rgba(220, 160, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ----- Tab Chip Polish ----- */
.tab-chip {
  transition: border-color 180ms ease, background 180ms ease, transform 160ms ease, color 180ms ease;
  position: relative;
  overflow: hidden;
}

.tab-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(220, 160, 0, 0.06), rgba(208, 138, 54, 0.08));
  opacity: 0;
  transition: opacity 200ms ease;
}

.tab-chip:hover::before {
  opacity: 1;
}

.tab-chip.active {
  font-weight: 800;
}

/* ----- Mode Chip Polish ----- */
.mode-chip {
  transition: border-color 200ms ease, background 200ms ease, transform 160ms ease, box-shadow 200ms ease;
}

.mode-chip.active {
  box-shadow: 0 2px 12px rgba(220, 160, 0, 0.08);
}

/* ----- Liuy Yao Coin Polish ----- */
.liuyao-coin.locked {
  transition: transform 160ms ease, box-shadow 200ms ease;
}

.liuyao-coin.locked:hover {
  transform: scale(1.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ----- Replay Trigger Polish ----- */
.liuyao-replay-trigger {
  transition: background 180ms ease, transform 160ms ease, border-color 180ms ease, box-shadow 200ms ease;
}

.liuyao-replay-trigger:active {
  transform: scale(0.97);
}

/* ----- Hexagram Panel Polish ----- */
.hexagram-sidepanel {
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

/* ----- Wuxing Bar Animation ----- */
.wuxing-bar-fill {
  transition: width 520ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ----- Toast / Copy Feedback ----- */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

.copy-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  border-radius: 12px;
  padding: 10px 20px;
  background: var(--ink);
  color: #f3e8d7;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: toastIn 200ms ease;
  pointer-events: none;
}

.copy-toast.out {
  animation: toastOut 180ms ease forwards;
}

/* ----- Hero Polish ----- */
.hero {
  transition: box-shadow 360ms ease;
}

/* ----- Eyebrow Polish ----- */
.eyebrow {
  user-select: none;
}

/* ----- Profile Modal Backdrop Animation ----- */
@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.profile-modal-backdrop {
  animation: backdropIn 200ms ease;
}

/* ----- Liuy Yao Basic Row Polish ----- */
.liuyao-basic-row {
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
}

.liuyao-basic-row:hover {
  border-color: rgba(220, 160, 0, 0.16);
  background: rgba(255, 252, 247, 0.9);
}

.liuyao-basic-row.changing:hover {
  border-color: rgba(220, 160, 0, 0.35);
}

/* ----- Line Group Polish ----- */
.line-group {
  transition: border-color 160ms ease, background 160ms ease;
}

.line-group:hover {
  border-color: rgba(220, 160, 0, 0.14);
}

/* ----- Ziwei Stars Polish ----- */
.ziwei-stars.major span,
.ziwei-stars.minor span,
.ziwei-stars.adjective span {
  transition: transform 100ms ease;
}

.ziwei-stars.major span:hover,
.ziwei-stars.minor span:hover,
.ziwei-stars.adjective span:hover {
  transform: scale(1.06);
}

/* ----- Empty State Polish ----- */
.empty-state {
  text-align: center;
  transition: opacity 200ms ease;
}

/* ----- Code Block Polish ----- */
.code-block,
.md-code-block {
  transition: box-shadow 200ms ease;
}

.code-block:hover,
.md-code-block:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

/* ----- Store Product Card Polish ----- */
.store-product-card {
  transition: transform 200ms ease, box-shadow 240ms ease, border-color 200ms ease, background 200ms ease;
}

.store-product-card:hover {
  border-color: rgba(208, 138, 54, 0.3);
}

/* ----- Hero Auth Panel Polish ----- */
.hero-auth-shell {
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

/* ----- Ai Report Reading Polish ----- */
.ai-report-reading {
  animation: tabFadeIn 300ms ease;
}

.ai-report-reading h1,
.ai-report-reading h2,
.ai-report-reading h3 {
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

.ai-report-reading h1 { font-size: 1.35rem; }
.ai-report-reading h2 { font-size: 1.15rem; }
.ai-report-reading h3 { font-size: 1.05rem; }

.ai-report-reading p {
  margin: 0.6em 0;
  line-height: 1.78;
}

/* ----- Ziwei Center Polish ----- */
.ziwei-center {
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.ziwei-center:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* ----- Dark Mode Polish ----- */
[data-theme=dark] .result-card:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

[data-theme=dark] .pillar-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

[data-theme=dark] .ziwei-palace::after {
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.06), transparent 60%);
}

[data-theme=dark] .copy-toast {
  background: #f3e8d7;
  color: var(--ink);
}

[data-theme=dark] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
}

[data-theme=dark] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

[data-theme=dark] * {
  scrollbar-color: rgba(255, 255, 255, 0.12) rgba(0, 0, 0, 0.08);
}

[data-theme=dark] ::selection {
  background: rgba(208, 138, 54, 0.22);
}

[data-theme=dark] :focus-visible {
  outline-color: rgba(247, 181, 0, 0.5);
}

/* ----- Print Styles ----- */
@media print {
  body::before { display: none; }
  body {
    background: #fff;
    color: #1a1a1a;
  }
  .control-panel,
  .hero,
  .result-tools,
  .tab-row,
  .workspace-actions,
  .ghost-btn,
  .tool-btn,
  .liuyao-replay-shell,
  .history-list,
  .ai-mode-disabled-shell {
    display: none !important;
  }
  .layout {
    display: block;
  }
  .result-panel {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
  }
  .pillar-card,
  .ziwei-palace,
  .fengshui-cell,
  .analysis-item,
  .key-value-pill,
  .stat-metric {
    break-inside: avoid;
    border-color: #ddd;
    background: #fff;
    box-shadow: none;
  }
  .ziwei-chart {
    min-width: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ----- Reduced Motion ----- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ----- Mode Grid Responsive Refinements ----- */
@media (max-width: 780px) {
  .mode-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    gap: 8px;
    padding: 6px 0 8px;
    margin: 8px -4px 0;
  }
  .mode-grid::before,
  .mode-grid::after {
    content: '';
    flex-shrink: 0;
    width: 4px;
  }
  .mode-grid::-webkit-scrollbar { display: none; }
  .mode-chip {
    flex-shrink: 0;
    min-width: fit-content;
    min-height: 44px;
    scroll-snap-align: start;
    white-space: nowrap;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
  }

  .hero {
    padding: 18px;
  }

  .result-panel {
    padding: 14px;
  }

  .panel-title h2,
  .result-top h2 {
    font-size: 1.15rem;
  }
}

/* ----- Mobile Panel Toggle Button ----- */
.panel-toggle-btn {
  display: none;
}

@media (max-width: 1120px) {
  .panel-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px 10px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 160ms ease, transform 120ms ease;
  }
  .panel-toggle-btn:active {
    transform: scale(0.96);
  }
}

/* Desktop expand button — visible only when panel is collapsed at desktop widths */
.desktop-expand-panel {
  display: none;
}
@media (min-width: 1121px) {
  .layout-shell.panel-collapsed .desktop-expand-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 12px;
    top: 200px;
    width: 36px;
    height: 80px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    color: var(--ink);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 40;
    transition: background 160ms ease, transform 120ms ease;
    writing-mode: vertical-lr;
    box-shadow: var(--shadow);
  }
  .desktop-expand-panel:hover {
    background: rgba(220, 160, 0, 0.08);
    border-color: var(--accent);
  }
  .desktop-expand-panel:active {
    transform: scale(0.95);
  }
}

/* ===== Auth Page Polish ===== */
.auth-page-shell {
  max-width: 480px;
}

.auth-page-shell .hero {
  grid-template-columns: 1fr;
  margin-bottom: 16px;
}

.auth-hero {
  grid-template-columns: 1fr !important;
  text-align: center;
}

.auth-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.auth-layout {
  display: grid;
  gap: 16px;
}

.auth-card {
  padding: 24px;
}

.auth-card .panel-title {
  margin-bottom: 4px;
}

.panel-heading h2 {
  margin: 0 0 4px;
}

.panel-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.field-verify-row {
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
}

.auth-verify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding-bottom: 2px;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap input {
  flex: 1;
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 6px;
  border-radius: 6px;
  user-select: none;
  line-height: 1;
}

.password-toggle:hover {
  background: rgba(111, 74, 39, 0.08);
}

.auth-phone-shell {
  margin-top: 12px;
}

.auth-phone-shell summary {
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-alt-row {
  text-align: center;
  padding: 10px 0 4px;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-alt-row a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.auth-alt-row a:hover {
  text-decoration: underline;
}

.auth-link-btn {
  text-decoration: none;
  font-size: 0.84rem;
}

/* ===== Password Strength Bar ===== */
.password-strength {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.password-strength-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(111, 74, 39, 0.1);
  transition: background 300ms ease, width 300ms ease;
  width: 0%;
}

.password-strength-bar.weak {
  width: 25%;
  background: #c44;
}

.password-strength-bar.fair {
  width: 50%;
  background: #d08a36;
}

.password-strength-bar.good {
  width: 75%;
  background: #4a9;
}

.password-strength-bar.strong {
  width: 100%;
  background: var(--good);
}

/* ===== Theme Toggle Button ===== */
.theme-toggle-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 180ms ease, transform 160ms ease, border-color 180ms ease;
  backdrop-filter: blur(8px);
  z-index: 10;
}

.theme-toggle-btn:hover {
  background: var(--panel-strong);
  transform: scale(1.08);
  border-color: rgba(220, 160, 0, 0.25);
}

/* ===== AI Shimmer Skeleton ===== */
@keyframes aiShimmer {
  0% { background-position: -300px 0; }
  100% { background-position: 300px 0; }
}

.ai-loading-skeleton {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.ai-skeleton-line {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg,
    rgba(111, 74, 39, 0.06) 0%,
    rgba(111, 74, 39, 0.13) 40%,
    rgba(111, 74, 39, 0.06) 80%
  );
  background-size: 300px 100%;
  animation: aiShimmer 1.6s ease-in-out infinite;
}

.ai-skeleton-line:nth-child(1) { width: 55%; animation-delay: 0s; }
.ai-skeleton-line:nth-child(2) { width: 82%; animation-delay: 0.1s; }
.ai-skeleton-line:nth-child(3) { width: 94%; animation-delay: 0.2s; }
.ai-skeleton-line:nth-child(4) { width: 68%; animation-delay: 0.3s; }
.ai-skeleton-line:nth-child(5) { width: 76%; animation-delay: 0.4s; }
.ai-skeleton-line:nth-child(6) { width: 90%; animation-delay: 0.5s; }

/* ===== History Section Polish ===== */
.history-list {
  max-height: 480px;
  overflow-y: auto;
}

.history-section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-section-head h3 {
  margin: 0;
}

.history-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.history-toolbar-compact {
  gap: 4px;
}

/* Ghost input for history search */
.ghost-input {
  flex: 1;
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  font: inherit;
  font-size: 0.82rem;
  background: var(--panel);
  color: var(--ink);
  transition: border-color 180ms ease;
}

.ghost-input:focus {
  outline: none;
  border-color: rgba(220, 160, 0, 0.35);
}

.ghost-input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

/* Ghost select */
.ghost-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  font: inherit;
  font-size: 0.82rem;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 180ms ease;
  max-width: 140px;
}

.ghost-select:focus {
  outline: none;
  border-color: rgba(220, 160, 0, 0.35);
}

/* ===== Mobile Edit Panel ===== */
.mobile-panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-panel-actions {
  display: flex;
  gap: 6px;
}

.mobile-edit-panel {
  gap: 4px;
}

.mobile-edit-panel-main {
  font-weight: 700;
}

.mobile-edit-panel-caption {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ===== Panel Backdrop (mobile) ===== */
.panel-backdrop {
  display: none !important;
}

/* ===== Panel Toggle Button ===== */
.panel-toggle.icon-only {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  transition: background 160ms ease, transform 120ms ease;
}

.panel-toggle.icon-only:hover {
  background: var(--panel-strong);
}

/* ===== Mobile Mode Chip Short Names ===== */
.mode-chip-full { display: inline; }
.mode-chip-short { display: none; }

/* ===== Brand Easter Egg ===== */
.brand-easter-egg {
  padding: 10px 16px;
  margin: 10px auto 0;
  max-width: 600px;
  text-align: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(208, 138, 54, 0.12), rgba(220, 160, 0, 0.08));
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
  animation: tabFadeIn 300ms ease;
}

/* ===== App Build Info ===== */
.build-stamp {
  text-align: center;
  padding: 16px 0 6px;
  font-size: 0.74rem;
  opacity: 0.7;
}

/* ===== App Welcome Feedback ===== */
.app-welcome-feedback {
  text-align: center;
  padding: 12px 16px;
  margin: 0 auto;
  max-width: 600px;
  border-radius: 12px;
  background: rgba(45, 106, 82, 0.08);
  color: var(--good);
  font-size: 0.88rem;
  font-weight: 600;
}

/* ===== Profile Modal Polish ===== */
.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-modal[hidden] {
  display: none;
}

.profile-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(3px);
  border: none;
  cursor: pointer;
}

.profile-modal-card {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  background: var(--panel-strong);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  animation: resultEnter 240ms ease;
}

.profile-modal-card .section-head {
  margin-bottom: 16px;
}

/* ===== Dark Mode Auth Polish ===== */
[data-theme=dark] .auth-card {
  background: rgba(28, 30, 37, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme=dark] .ghost-input,
[data-theme=dark] .ghost-select {
  background: rgba(28, 30, 37, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

[data-theme=dark] .theme-toggle-btn {
  background: rgba(28, 30, 37, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme=dark] .profile-modal-card {
  background: #1c1e25;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme=dark] .ai-skeleton-line {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.07) 40%,
    rgba(255, 255, 255, 0.03) 80%
  );
}

/* ===== Mobile Auth Polish ===== */
@media (max-width: 780px) {
  .auth-page-shell {
    padding: 14px 10px 24px;
  }
  .auth-card {
    padding: 18px;
  }
  .field-verify-row {
    grid-template-columns: 1fr;
  }
  .theme-toggle-btn {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
  }
  .mode-chip-full { display: none; }
  .mode-chip-short { display: inline; }
  .history-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .ghost-select {
    max-width: none;
  }
}

/* ================================================================
   Panel Collapse/Expand System
   Shared-base architecture: collapsed & open share positioning
   ================================================================ */

/* Global: collapsed = single-column, hide panel (desktop/tablet) */
.layout-shell.panel-collapsed .layout {
  grid-template-columns: 1fr;
}
.layout-shell.panel-collapsed .control-panel {
  display: none;
}

/* Tablet (781-1120px): panel stays in grid, no overlay */
@media (min-width: 781px) and (max-width: 1120px) {
  .layout-shell:not(.panel-collapsed) .layout {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  }
  .layout-shell.panel-collapsed .layout {
    grid-template-columns: 1fr;
  }
  .layout-shell.panel-collapsed .control-panel {
    display: none;
  }
}

/* Mobile (≤780px): overlay panel with slide animation */
@media (max-width: 780px) {
  /* Shared base: BOTH states get position:fixed + full layout */
  .layout-shell.panel-collapsed .control-panel,
  .layout-shell.panel-open .control-panel {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(420px, 92vw);
    height: auto;
    z-index: 50;
    margin: 0;
    padding: 14px;
    border: none;
    border-right: 1px solid var(--line);
    border-radius: 0 18px 18px 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Collapsed: off-screen left, hidden, no pointer events */
  .layout-shell.panel-collapsed .control-panel {
    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;
    box-shadow: none;
    transition: transform 280ms cubic-bezier(0.4, 0.0, 0.2, 1),
                visibility 0s 280ms;
  }

  /* Open: on-screen, visible, interactive */
  .layout-shell.panel-open .control-panel {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    box-shadow: 6px 0 32px rgba(0, 0, 0, 0.16);
    transition: transform 280ms cubic-bezier(0.4, 0.0, 0.2, 1),
                visibility 0s 0s;
  }

  /* Backdrop overlay when panel is open */
  .layout-shell.panel-open .panel-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 45;
    border: none;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  /* Panel header divider in overlay */
  .layout-shell.panel-open .panel-title {
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
    margin-bottom: 10px;
    flex-direction: row;
    align-items: center;
  }

  /* Close button styling */
  .layout-shell.panel-open .panel-toggle.icon-only {
    background: rgba(111, 74, 39, 0.08);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.82rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  /* Sticky submit button inside overlay */
  .layout-shell.panel-open .submit-row {
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: var(--panel);
    padding: 10px 0 max(8px, env(safe-area-inset-bottom, 8px));
    margin-top: auto;
    border-top: 1px solid var(--line);
  }

  /* Form fields — prevent iOS zoom */
  .layout-shell.panel-open input[type="text"],
  .layout-shell.panel-open input[type="number"],
  .layout-shell.panel-open select,
  .layout-shell.panel-open textarea {
    font-size: 16px;
  }

  /* Mode chips — touch targets (min-height handled in mobile mode-grid) */
}

/* Small phones (≤420px): tighter overlay */
@media (max-width: 420px) {
  .layout-shell.panel-collapsed .control-panel,
  .layout-shell.panel-open .control-panel {
    width: min(340px, 94vw);
    border-radius: 0 14px 14px 0;
    padding: 14px 12px;
  }
}

/* Dark mode panel overrides */
[data-theme=dark] .layout-shell.panel-open .control-panel {
  box-shadow: 6px 0 32px rgba(0, 0, 0, 0.35);
  background: #1c1e25;
}
[data-theme=dark] .layout-shell.panel-open .panel-backdrop {
  background: rgba(0, 0, 0, 0.48);
}
[data-theme=dark] .layout-shell.panel-open .panel-toggle.icon-only {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}
[data-theme=dark] .layout-shell.panel-open .submit-row {
  background: #1c1e25;
}

/* ================================================================
   Design Tokens — spacing, type, radius, shadow, easing
   ================================================================ */
:root {
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;

  --text-xs: clamp(0.7rem, 0.7rem + 0.1vw, 0.75rem);
  --text-sm: clamp(0.78rem, 0.78rem + 0.1vw, 0.84rem);
  --text-base: clamp(0.88rem, 0.88rem + 0.15vw, 0.94rem);
  --text-md: clamp(0.94rem, 0.94rem + 0.2vw, 1.05rem);
  --text-lg: clamp(1.05rem, 1.05rem + 0.3vw, 1.2rem);
  --text-xl: clamp(1.2rem, 1.2rem + 0.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.5rem + 0.8vw, 2rem);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-2xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0.06, 0.68, 0.19);
  --dur-fast: 120ms;
  --dur-normal: 180ms;
  --dur-slow: 280ms;
}

/* ================================================================
   QOL Animations & Indicators
   ================================================================ */

@keyframes submitPulse {
  0%, 100% { opacity: 0.76; }
  50% { opacity: 0.5; }
}
.submit-btn:disabled {
  animation: submitPulse 1.6s ease-in-out infinite;
}

@keyframes touchRipple {
  0% { transform: scale(0); opacity: 0.3; }
  100% { transform: scale(2.5); opacity: 0; }
}
.touch-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(220, 160, 0, 0.16);
  pointer-events: none;
  z-index: 0;
  animation: touchRipple 480ms ease-out forwards;
}
[data-theme=dark] .touch-ripple {
  background: rgba(255, 255, 255, 0.1);
}

.mode-chip { position: relative; }
.mode-chip::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  transition: transform 200ms ease;
}
.mode-chip.active::after {
  transform: translateX(-50%) scaleX(1);
}

.tab-chip.active::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%) scaleX(1);
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.history-item.is-active {
  border-color: rgba(220, 160, 0, 0.3);
  background: linear-gradient(135deg, rgba(220, 160, 0, 0.06), rgba(255, 252, 247, 0.88));
}

.collapse-shell summary::marker {
  color: var(--accent);
  font-size: 0.9em;
}

.result-meta:empty { display: none; }
.result-meta:not(:empty) {
  animation: tabFadeIn 240ms ease;
}

.error-page-shell {
  text-align: center;
  padding: 60px 20px;
}
.error-page-shell h1 {
  font-size: 3rem;
  font-family: "Source Han Serif SC", "Songti SC", serif;
  margin: 0 0 12px;
}
.error-page-shell p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

/* ================================================================
   Floating Edit Button (mobile collapsed state)
   ================================================================ */

.mobile-edit-panel:not([hidden]) {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(220, 160, 0, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.mobile-edit-panel:not([hidden]):active {
  transform: scale(0.96);
}
.mobile-edit-panel .mobile-edit-panel-main {
  font-weight: 700;
  color: #fff;
}
.mobile-edit-panel .mobile-edit-panel-caption {
  display: block;
  font-size: 0.7rem;
  opacity: 0.8;
  color: #fff;
}

@media (max-width: 780px) {
  .layout-shell.panel-collapsed .mobile-edit-panel:not([hidden]),
  .layout-shell.panel-open .mobile-edit-panel:not([hidden]) {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 35;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.82rem;
    box-shadow: 0 4px 16px rgba(220, 160, 0, 0.25);
    white-space: nowrap;
    animation: fabIn 300ms cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  @keyframes fabIn {
    0%   { transform: translateX(-50%) translateY(-16px); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0);     opacity: 1; }
  }
  .layout-shell.panel-collapsed .mobile-edit-panel:not([hidden]):active {
    transform: translateX(-50%) scale(0.95);
  }
  .layout-shell.panel-collapsed .result-panel {
    /* FAB now at top, no bottom padding needed */
  }
}

/* Desktop: hide floating button (sidebar handles everything) */
@media (min-width: 781px) {
  .mobile-edit-panel { display: none !important; }
}

/* Tablet (781-1120px): FAB inline within result */
@media (min-width: 781px) and (max-width: 1120px) {
  .layout-shell.panel-collapsed .mobile-edit-panel:not([hidden]) {
    position: static;
    transform: none;
    animation: none;
  }
  .layout-shell.panel-collapsed .result-panel {
    padding-bottom: 16px;
  }
}

@media (max-width: 420px) {
  .layout-shell.panel-collapsed .mobile-edit-panel:not([hidden]) {
    padding: 12px 20px;
    font-size: 0.82rem;
    border-radius: 14px;
  }
  .layout-shell.panel-collapsed .result-panel {
    padding-bottom: 70px;
  }
}

[data-theme=dark] .mobile-edit-panel:not([hidden]) {
  box-shadow: 0 4px 16px rgba(247, 181, 0, 0.3);
}

/* ================================================================
   Tab Row Horizontal Scroll (mobile)
   ================================================================ */

@media (max-width: 780px) {
  .tab-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding-bottom: 4px;
    margin-bottom: 10px;
    scroll-snap-type: x proximity;
    gap: 8px;
  }
  .tab-row::-webkit-scrollbar { display: none; }
  .tab-chip {
    flex-shrink: 0;
    min-width: fit-content;
    min-height: 40px;
    white-space: nowrap;
    scroll-snap-align: start;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
  }
  .tab-row::after {
    content: "";
    position: sticky;
    right: 0;
    width: 24px;
    flex-shrink: 0;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.92));
    pointer-events: none;
  }
}

@keyframes tabRowScrollHint {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-8px); }
  70% { transform: translateX(8px); }
}
@media (max-width: 780px) {
  .tab-row.mobile-scroll-nudge {
    animation: tabRowScrollHint 0.8s ease-in-out 3;
    animation-delay: 0.8s;
  }
}

/* ================================================================
   Desktop Optimizations
   ================================================================ */

@media (min-width: 1281px) {
  .layout, .hero {
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 1121px) {
  .control-panel {
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(111, 74, 39, 0.2) transparent;
  }
  .control-panel::-webkit-scrollbar { width: 4px; }
  .control-panel::-webkit-scrollbar-thumb {
    background: rgba(111, 74, 39, 0.2);
    border-radius: 2px;
  }
}

@media (min-width: 781px) {
  .hero h1 {
    font-family: "Source Han Serif SC", "Songti SC", serif;
  }
  .panel-title h2,
  .result-top h2 {
    font-size: var(--text-lg);
  }
  .card-head h3 {
    font-size: var(--text-md);
  }
}

/* ================================================================
   Mobile Refinements
   ================================================================ */

@media (max-width: 780px) {
  .layout-shell.panel-collapsed .result-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .layout-shell.panel-collapsed .result-top h2 {
    font-size: 1.05rem;
  }
}

@media (max-width: 420px) {
  .hero { padding: 12px; }
  .hero h1 { font-size: 1.3rem; }
  .control-panel, .result-panel { padding: 10px; }
  .mode-chip { font-size: 0.82rem; padding: 12px 14px; min-height: 42px; }
  .submit-btn { padding: 12px; }
}

@media (max-width: 920px) and (orientation: landscape) {
  .pillar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .key-value-pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layout-shell.panel-open .history-list {
    max-height: 120px;
  }
}

@media (min-width: 781px) and (max-width: 1120px) {
  .pillar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ================================================================
   Site Footer (privacy, terms, copyright)
   ================================================================ */

.legal-footer {
  border-top: 1px solid var(--line);
  padding: 28px 16px 24px;
  margin-top: 36px;
  text-align: center;
}

.legal-footer-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legal-footer-summary {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}

.legal-footer-text {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.65;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.78;
}

.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm);
}

.legal-footer-link {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 180ms ease, background 180ms ease;
}

.legal-footer-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.legal-footer-sep {
  color: var(--line);
  user-select: none;
}

.legal-footer-copy {
  font-size: var(--text-xs);
  color: var(--muted);
  opacity: 0.65;
}

/* Dark mode footer */
[data-theme=dark] .legal-footer-link:hover {
  background: rgba(247, 181, 0, 0.1);
}

@media (max-width: 420px) {
  .legal-footer {
    padding: 20px 12px 18px;
    margin-top: 24px;
  }
  .legal-footer-links {
    flex-direction: column;
    gap: 2px;
  }
  .legal-footer-sep {
    display: none;
  }
}

/* ================================================================
   Dark Mode — CSS Variable Redefinition
   ================================================================ */

[data-theme=dark] {
  --bg-1: #0a0a0c;
  --bg-2: #14161a;
  --ink: #ffffff;
  --muted: #9a9a9f;
  --line: rgba(255, 255, 255, 0.10);
  --panel: rgba(28, 30, 37, 0.78);
  --panel-strong: rgba(40, 42, 50, 0.95);
  --accent: #f7b500;
  --accent-soft: rgba(247, 181, 0, 0.12);
  --water: #6a9ec0;
  --good: #30d158;
  --warn: #ff453a;
  --shadow: 0 18px 58px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
}

[data-theme=dark] body {
  background: var(--bg-1);
  color: var(--ink);
}
[data-theme=dark] body::before {
  opacity: 0.03;
}
[data-theme=dark] .tab-row::after {
  background: linear-gradient(to right, transparent, rgba(10, 10, 12, 0.92));
}

[data-theme=dark] input,
[data-theme=dark] select,
[data-theme=dark] textarea {
  background: rgba(28, 30, 37, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}
[data-theme=dark] input:focus,
[data-theme=dark] select:focus,
[data-theme=dark] textarea:focus {
  border-color: rgba(247, 181, 0, 0.4);
}

[data-theme=dark] .history-item.is-active {
  background: linear-gradient(135deg, rgba(247, 181, 0, 0.08), rgba(28, 30, 37, 0.88));
}

[data-theme=dark] .mode-grid::after {
  background: linear-gradient(to right, transparent, rgba(10, 10, 12, 0.92));
}
[data-theme=dark] .advanced {
  background: rgba(28, 30, 37, 0.6);
  border-color: rgba(255, 255, 255, 0.06);
}
[data-theme=dark] .panel-toggle.icon-only {
  background: rgba(28, 30, 37, 0.78);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme=dark] .panel-toggle.icon-only:hover {
  background: rgba(40, 42, 50, 0.9);
}
[data-theme=dark] .mode-chip:not(.active),
[data-theme=dark] .tab-chip:not(.active) {
  background: rgba(28, 30, 37, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}
[data-theme=dark] .mode-chip:not(.active):hover,
[data-theme=dark] .tab-chip:not(.active):hover {
  border-color: rgba(247, 181, 0, 0.3);
  background: rgba(247, 181, 0, 0.06);
}
[data-theme=dark] .ghost-input,
[data-theme=dark] .ghost-select {
  background: rgba(28, 30, 37, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

/* ================================================================
   Visual Polish — spacing, transitions, form, empty state
   ================================================================ */

/* Smooth result panel height transition */
.result-panel {
  transition: min-height 300ms ease;
}

/* Empty state visual placeholder */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
  gap: 8px;
}
.empty-state::before {
  content: "☰";
  font-size: 2.4rem;
  opacity: 0.3;
  margin-bottom: 4px;
}

/* Form field row spacing */
.field-row {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

/* Form labels */
.field-row label,
.fields label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 2px;
  letter-spacing: 0.02em;
}

/* Section heading refinements */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.section-head h3 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--muted);
  margin: 0;
  letter-spacing: 0.04em;
}

/* History toolbar compact */
.history-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Ghost input & select refinements */
.ghost-input,
.ghost-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.82rem;
  background: rgba(255, 252, 247, 0.6);
  color: var(--ink);
  transition: border-color 180ms ease, background 180ms ease;
}
.ghost-input:focus,
.ghost-select:focus {
  outline: none;
  border-color: rgba(220, 160, 0, 0.35);
  background: rgba(255, 255, 252, 0.9);
}

/* Badge pill refinements */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(220, 160, 0, 0.08);
  color: var(--accent);
  border: 1px solid rgba(220, 160, 0, 0.12);
}

/* Mobile hero refinements */
@media (max-width: 780px) {
  .hero {
    padding: 16px;
    gap: 12px;
  }
  .hero h1 {
    font-size: 1.25rem;
    line-height: 1.3;
  }
  .hero p,
  .hero-note {
    font-size: 0.84rem;
  }
  .eyebrow {
    font-size: 0.72rem;
  }

  /* Result panel spacing */
  .result-panel {
    padding: 14px;
    min-height: 200px;
  }

  /* Form field compact */
  .field-row {
    gap: 8px;
    margin-bottom: 8px;
  }

  /* History compact in overlay */
  .control-section {
    margin-top: 8px;
    padding-top: 8px;
  }
  .history-list {
    max-height: 200px;
  }
}

/* Small phone extra compact */
@media (max-width: 420px) {
  .hero {
    padding: 12px;
    border-radius: 20px;
  }
  .hero h1 {
    font-size: 1.15rem;
  }
  .result-panel {
    min-height: 160px;
  }
  .history-list {
    max-height: 150px;
  }
}

/* Desktop result panel minimum height */
@media (min-width: 781px) {
  .result-panel {
    min-height: 400px;
  }
}

/* Dark mode badge */
[data-theme=dark] .badge-pill {
  background: rgba(247, 181, 0, 0.12);
  border-color: rgba(247, 181, 0, 0.15);
  color: var(--accent);
}

/* Dark mode empty state */
[data-theme=dark] .empty-state {
  color: var(--muted);
}

/* Dark mode ghost inputs */
[data-theme=dark] .ghost-input,
[data-theme=dark] .ghost-select {
  background: rgba(28, 30, 37, 0.5);
  border-color: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}
[data-theme=dark] .ghost-input:focus,
[data-theme=dark] .ghost-select:focus {
  border-color: rgba(247, 181, 0, 0.3);
  background: rgba(28, 30, 37, 0.7);
}

/* ================================================================
   Layout Polish — grid balance, cards, transitions
   ================================================================ */

/* Mode grid: last item spans full width when odd */
.mode-chip:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* Status message states */
.status {
  font-size: 0.84rem;
  font-weight: 600;
  min-height: 1.5em;
  padding: 4px 0;
  transition: color 200ms ease;
}
.status.ok    { color: var(--good); }
.status.warn  { color: var(--accent); }
.status.error { color: #b0302a; }

/* Result card inner spacing */
.result-card {
  padding: 18px;
  border-radius: var(--radius-lg, 14px);
}

/* Card section dividers */
.result-card + .result-card {
  margin-top: 14px;
}

/* Pillar card inner spacing */
.pillar-card {
  padding: 16px;
}

/* Smooth result content transition */
.result-stack > * {
  animation: resultFadeIn 280ms ease both;
}
@keyframes resultFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Panel content max-width for readability */
.result-panel {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Code and preformatted text */
.md-code-block,
.code-block {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  padding: 14px;
  font-size: 0.84rem;
  line-height: 1.6;
  background: rgba(28, 30, 37, 0.06);
  border: 1px solid var(--line);
}

/* Table wrapper for mobile */
.md-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--line);
}

/* Blockquote styling */
.md-quote {
  border-left: 3px solid var(--accent);
  padding: 10px 16px;
  margin: 12px 0;
  background: rgba(220, 160, 0, 0.04);
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: var(--muted);
}

/* Inline code */
.md-inline-code {
  background: rgba(28, 30, 37, 0.06);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.88em;
  font-family: "SF Mono", "Source Han Sans SC", monospace;
}

/* Dark mode content refinements */
[data-theme=dark] .md-code-block,
[data-theme=dark] .code-block {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}
[data-theme=dark] .md-quote {
  background: rgba(247, 181, 0, 0.06);
  color: #b0a590;
}
[data-theme=dark] .md-inline-code {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

/* ================================================================
   Touch & Interaction Polish
   ================================================================ */

/* Larger touch targets for icon buttons */
.panel-toggle.icon-only {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Ghost button active state */
.ghost-btn:active {
  transform: scale(0.96);
  transition: transform 80ms ease;
}

/* Tool button hover */
.tool-btn:hover {
  background: rgba(220, 160, 0, 0.06);
  border-color: rgba(220, 160, 0, 0.16);
}

/* Select dropdown arrow color */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c5f50' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Mode chip press effect */
.mode-chip:active {
  transform: scale(0.95);
  transition: transform 80ms ease;
}

/* Tab chip press effect */
.tab-chip:active {
  transform: scale(0.96);
  transition: transform 80ms ease;
}

/* ================================================================
   Final Polish — hero, theme toggle, submit, skeleton
   ================================================================ */

/* Theme toggle button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 300ms ease, background 180ms ease, border-color 180ms ease;
}
.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(220, 160, 0, 0.25);
}
.theme-toggle-btn:active {
  transform: scale(0.9) rotate(30deg);
}

/* Submit button hover lift */
.submit-btn {
  transition: transform 180ms ease, box-shadow 200ms ease;
}
.submit-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(220, 160, 0, 0.28);
}
.submit-btn:not(:disabled):active {
  transform: translateY(0) scale(0.98);
}

/* Hero subtle inner glow */
.hero {
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(ellipse at 80% 20%, rgba(208, 138, 54, 0.06), transparent 50%),
              radial-gradient(ellipse at 20% 80%, rgba(45, 95, 130, 0.04), transparent 50%);
}

/* Advanced details summary hover */
.advanced summary:hover {
  color: var(--accent);
}

/* AI skeleton loading */
.ai-skeleton-line {
  height: 14px;
  border-radius: 7px;
  margin-bottom: 8px;
  background: linear-gradient(90deg,
    rgba(111, 74, 39, 0.06) 0%,
    rgba(111, 74, 39, 0.12) 40%,
    rgba(111, 74, 39, 0.06) 80%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.8s ease-in-out infinite;
}
@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Workspace state pill */
.workspace-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.6);
  color: var(--muted);
  transition: border-color 180ms ease, background 180ms ease;
}

/* Hexagram side panel */
.hexagram-sidepanel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 252, 247, 0.5);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

/* Dark mode: theme toggle */
[data-theme=dark] .theme-toggle-btn {
  background: rgba(28, 30, 37, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}
[data-theme=dark] .theme-toggle-btn:hover {
  background: rgba(40, 42, 50, 0.8);
  border-color: rgba(247, 181, 0, 0.25);
}

/* Dark mode: hero glow */
[data-theme=dark] .hero::after {
  background: radial-gradient(ellipse at 80% 20%, rgba(247, 181, 0, 0.04), transparent 50%),
              radial-gradient(ellipse at 20% 80%, rgba(106, 158, 192, 0.03), transparent 50%);
}

/* Dark mode: skeleton */
[data-theme=dark] .ai-skeleton-line {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.02) 0%,
    rgba(255, 255, 255, 0.06) 40%,
    rgba(255, 255, 255, 0.02) 80%);
}

/* Dark mode: workspace pill */
[data-theme=dark] .workspace-state-pill {
  background: rgba(28, 30, 37, 0.5);
  border-color: rgba(255, 255, 255, 0.06);
}

/* Dark mode: hexagram panel */
[data-theme=dark] .hexagram-sidepanel {
  background: rgba(28, 30, 37, 0.4);
  border-color: rgba(255, 255, 255, 0.06);
}

/* ================================================================
   Profile Page (/me) — Layout & Polish
   ================================================================ */

.profile-page {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 36px;
}

.profile-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 248, 248, 0.98));
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.profile-hero-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-hero-left h1 {
  margin: 0;
  font-size: var(--text-xl);
  font-family: "Source Han Serif SC", "Songti SC", serif;
}

.profile-hero-left p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.profile-hero-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Profile stat grid */
.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.profile-stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-stat-label {
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-stat-value {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--ink);
}

.profile-stat-card.accent {
  border-color: rgba(220, 160, 0, 0.25);
  background: linear-gradient(135deg, rgba(220, 160, 0, 0.06), rgba(255, 255, 255, 0.86));
}

.profile-stat-card.accent .profile-stat-value {
  color: var(--accent);
}

/* Profile sections */
.profile-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px;
  background: var(--panel);
  margin-bottom: 20px;
}

.profile-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.profile-section-header h2 {
  margin: 0;
  font-size: var(--text-md);
}

.profile-section-header p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Points display */
.points-balance-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  padding: 8px 0;
}

.points-balance-unit {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

/* Billing & Ledger table */
.billing-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.billing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.billing-table th,
.billing-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.billing-table th {
  font-weight: 700;
  color: var(--muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Redeem form */
.redeem-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.redeem-input {
  flex: 1;
  min-width: 200px;
}

/* Action modal */
.action-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(3px);
}

.action-modal-card {
  position: relative;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
  background: var(--panel-strong);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  animation: resultEnter 240ms ease;
}

.action-modal-card h2 {
  margin: 0 0 12px;
  font-size: var(--text-md);
}

/* Profile dark mode */
[data-theme=dark] .profile-hero {
  background: linear-gradient(135deg, rgba(28, 30, 37, 0.9), rgba(40, 42, 50, 0.8));
}

[data-theme=dark] .profile-stat-card {
  background: rgba(28, 30, 37, 0.7);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme=dark] .profile-stat-card.accent {
  border-color: rgba(247, 181, 0, 0.2);
}

[data-theme=dark] .profile-section {
  background: rgba(28, 30, 37, 0.7);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme=dark] .action-modal-card {
  background: #1c1e25;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

/* ================================================================
   Security Page (/me/security) — Layout & Polish
   ================================================================ */

.security-page {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 36px;
}

.security-page-header {
  margin-bottom: 24px;
}

.security-page-header h1 {
  margin: 0 0 6px;
  font-size: var(--text-xl);
  font-family: "Source Han Serif SC", "Songti SC", serif;
}

.security-page-header p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.security-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--panel);
  margin-bottom: 16px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.security-card:hover {
  border-color: rgba(220, 160, 0, 0.15);
  box-shadow: var(--shadow-sm);
}

.security-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.security-card-header h2 {
  margin: 0;
  font-size: var(--text-md);
  display: flex;
  align-items: center;
  gap: 8px;
}

.security-card-header p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-weight: 700;
}

.security-badge.enabled {
  background: rgba(45, 106, 82, 0.1);
  color: var(--good);
}

.security-badge.disabled {
  background: rgba(220, 160, 0, 0.08);
  color: var(--warn);
}

.security-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.security-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.security-field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.security-field-row .ghost-input {
  min-width: 0;
}

/* Security dark mode */
[data-theme=dark] .security-card {
  background: rgba(28, 30, 37, 0.7);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme=dark] .security-card:hover {
  border-color: rgba(247, 181, 0, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* ================================================================
   Store Page Fixes
   ================================================================ */

/* Ensure store layout doesn't inherit main grid */
.store-page .layout {
  display: block;
}

.store-page .page {
  padding-bottom: 48px;
}

/* Fix store hero on mobile */
@media (max-width: 780px) {
  .store-layout {
    grid-template-columns: 1fr;
  }

  .store-page .hero {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
  }

  .store-products-grid {
    grid-template-columns: 1fr;
  }

  .store-product-card {
    padding: 14px;
  }
}

/* Store dark mode additions */
[data-theme=dark] .store-filter-row .ghost-btn.active {
  border-color: rgba(247, 181, 0, 0.35);
  background: linear-gradient(135deg, rgba(247, 181, 0, 0.15), rgba(106, 159, 192, 0.1));
}

/* ================================================================
   Mobile Responsive Polish (profile + security)
   ================================================================ */

@media (max-width: 780px) {
  .profile-page,
  .security-page {
    padding: 14px 10px 24px;
  }

  .profile-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
  }

  .profile-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .profile-stat-card {
    padding: 12px;
  }

  .profile-section {
    padding: 14px;
  }

  .security-card {
    padding: 14px;
  }

  .security-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .security-field-row {
    grid-template-columns: 1fr;
  }

  .redeem-form-row {
    flex-direction: column;
  }

  .redeem-input {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .profile-stat-grid {
    grid-template-columns: 1fr;
  }

  .points-balance-display {
    font-size: 1.6rem;
  }
}

/* Mobile panel improvements */
@media (max-width: 780px) {
  .submit-btn,
  .tool-btn {
    min-height: 44px;
    padding: 12px 20px;
  }
  .mode-chip {
    min-height: 36px;
    padding: 8px 14px;
    font-size: 0.82rem;
  }
  .tab-chip {
    min-height: 36px;
    padding: 8px 16px;
    font-size: 0.82rem;
  }
  .ghost-input,
  .ghost-select {
    min-height: 40px;
  }
}

/* ===== Agent Dashboard ===== */
/* 2x2 hero card grid */
.agent-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0 0;
}
.agent-hero-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 160ms ease;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: inherit;
  font-size: inherit;
  color: var(--ink);
  width: 100%;
}
.agent-hero-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.agent-hero-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.agent-hero-card strong {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}
.agent-hero-card small {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}
/* Primary hero card (create) gets accent tint */
.agent-hero-card.primary {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.agent-hero-card.primary:hover {
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Collapsible more-actions */
.agent-more-actions {
  margin-top: 10px;
}
.agent-more-actions > summary {
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 2px;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.agent-more-actions > summary::-webkit-details-marker {
  display: none;
}
.agent-more-actions > summary::before {
  content: '+';
  display: inline-block;
  width: 16px;
  font-size: 0.9rem;
  color: var(--muted);
  transition: transform 140ms ease;
}
.agent-more-actions[open] > summary::before {
  content: '−';
}
.agent-more-actions .agent-shortcut-btn {
  font-size: 0.78rem;
  padding: 6px 12px;
}

/* Batch action strip */
.agent-batch-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding: 6px 0;
}
.agent-batch-strip .strip-sep {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 2px;
  align-self: center;
  flex-shrink: 0;
}

/* Existing agent-shortcut-btn polish (used in mobile dock and more-actions) */
.agent-shortcut-btn {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: var(--ink);
  transition: all 140ms ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.agent-shortcut-btn:hover {
  border-color: var(--accent);
}
.agent-shortcut-btn strong {
  font-size: 0.85rem;
  font-weight: 600;
}
.agent-shortcut-btn small {
  font-size: 0.72rem;
  color: var(--muted);
}

/* Agent shortcut grid (legacy, for mobile dock) */
.agent-shortcut-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Mobile dock */
.agent-mobile-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel-strong, rgba(28, 30, 37, 0.95));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 8px 12px;
  gap: 6px;
  z-index: 50;
  justify-content: center;
  flex-wrap: wrap;
}
.agent-mobile-dock .ghost-btn {
  font-size: 0.75rem;
  padding: 6px 12px;
  min-height: 36px;
}

/* Responsive */
@media (max-width: 700px) {
  .agent-hero-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .agent-hero-card {
    padding: 12px 14px;
  }
  .agent-mobile-dock {
    display: flex;
  }
  .agent-batch-strip {
    gap: 4px;
  }
}

/* Dark mode agent overrides */
[data-theme=dark] .agent-hero-card.primary {
  background: rgba(247, 181, 0, 0.10);
}
[data-theme=dark] .agent-mobile-dock {
  background: rgba(18, 19, 22, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ================================================================
   Public landing page and legal document surfaces
   ================================================================ */
.app-brand-lockup { display: flex; align-items: center; gap: 14px; }
.app-brand-logo { display: block; width: 56px; height: 56px; object-fit: contain; flex: 0 0 auto; }
.auth-brand-lockup { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 8px; }
.auth-brand-logo { display: block; width: 64px; height: 64px; object-fit: contain; }
.public-site {
  --public-ink: #201c16;
  --public-muted: #756e62;
  --public-paper: #e8e0c0;
  --public-paper-strong: #ede4cf;
  --public-gold: #c08e3a;
  --public-gold-deep: #78570f;
  background: var(--public-paper);
  color: var(--public-ink);
}
html[data-theme=dark] body.public-site {
  --public-ink: #f5efe2;
  --public-muted: #aaa193;
  --public-paper: #0e0e0d;
  --public-paper-strong: #171613;
  --public-gold: #f3b83d;
  --public-gold-deep: #f7c75e;
  background: var(--public-paper);
}
.public-page { max-width: 1440px; margin: 0 auto; padding: 0 32px; overflow: hidden; }
.public-nav { min-height: 82px; display: flex; justify-content: space-between; align-items: center; gap: 24px; border-bottom: 1px solid color-mix(in srgb, var(--public-ink) 14%, transparent); }
.public-brand, .public-nav a { color: var(--public-ink); text-decoration: none; }
.public-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.08rem; font-weight: 700; letter-spacing: -.02em; }
.public-brand-mark { display: inline-flex; width: 44px; height: 44px; overflow: hidden; flex: 0 0 auto; }
.public-brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.public-nav-links { display: flex; align-items: center; gap: 24px; font-size: .82rem; }
.public-nav-links a { color: var(--public-muted); transition: color 180ms ease; }
.public-nav-links a:hover { color: var(--public-gold-deep); }
.public-nav-login { border: 1px solid var(--public-ink); border-radius: 999px; padding: 9px 16px; color: var(--public-ink) !important; }
.public-theme-toggle { border: 0; background: transparent; color: var(--public-muted); cursor: pointer; font: inherit; font-size: .78rem; padding: 8px 0; }
.public-hero { position: relative; min-height: 700px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .82fr); align-items: center; gap: 36px; padding: 92px 6vw 112px; border-bottom: 1px solid color-mix(in srgb, var(--public-ink) 14%, transparent); isolation: isolate; }
.public-hero-canvas, .public-hero-grid { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.public-hero-canvas { z-index: -2; opacity: .88; }
.public-hero-grid { z-index: -1; opacity: .36; background-image: linear-gradient(color-mix(in srgb, var(--public-gold) 18%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--public-gold) 18%, transparent) 1px, transparent 1px); background-size: 58px 58px; mask-image: linear-gradient(90deg, transparent, black 18%, black 78%, transparent); }
.public-hero-content { max-width: 660px; }
.public-kicker { margin: 0 0 22px; color: var(--public-gold-deep); font: 600 .75rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; }
.public-hero h1 { margin: 0; max-width: 700px; font-family: "Source Han Serif SC", "Songti SC", serif; font-size: clamp(3.6rem, 7vw, 7.4rem); font-weight: 500; letter-spacing: -.075em; line-height: .96; }
.public-hero h1 em { color: var(--public-gold-deep); font-style: normal; }
.public-hero-copy { max-width: 480px; margin: 30px 0 0; color: var(--public-muted); font-size: 1.05rem; line-height: 1.85; }
.public-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 36px; }
.public-primary-btn, .public-secondary-btn { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 50px; border-radius: 999px; padding: 0 22px; text-decoration: none; font-size: .88rem; font-weight: 700; transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease; }
.public-primary-btn { background: var(--public-ink); color: var(--public-paper) !important; box-shadow: 0 12px 28px color-mix(in srgb, var(--public-ink) 18%, transparent); }
.public-primary-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 34px color-mix(in srgb, var(--public-gold) 26%, transparent); }
.public-secondary-btn { border: 1px solid color-mix(in srgb, var(--public-ink) 24%, transparent); color: var(--public-ink) !important; }
.public-secondary-btn:hover { border-color: var(--public-gold-deep); color: var(--public-gold-deep) !important; }
.public-hero-note { margin: 17px 0 0; color: var(--public-muted); font-size: .74rem; }
.public-hero-workbench { position: relative; min-width: 0; }
.public-workbench-window { border: 1px solid color-mix(in srgb, var(--public-gold) 58%, var(--public-ink)); border-radius: 20px; padding: 10px; background: color-mix(in srgb, var(--public-paper-strong) 72%, transparent); box-shadow: 0 30px 80px color-mix(in srgb, var(--public-gold) 18%, transparent); transform: rotate(2.5deg); }
.public-window-bar { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; color: var(--public-muted); font-size: .64rem; }
.public-window-bar span { width: 6px; height: 6px; border-radius: 50%; background: var(--public-gold); opacity: .72; }
.public-window-bar b { margin-left: auto; font-weight: 500; }
.public-window-body { display: grid; grid-template-columns: 78px 1fr; min-height: 330px; border: 1px solid color-mix(in srgb, var(--public-ink) 12%, transparent); border-radius: 12px; overflow: hidden; background: color-mix(in srgb, var(--public-paper) 88%, transparent); }
.public-window-sidebar { display: flex; flex-direction: column; gap: 8px; border-right: 1px solid color-mix(in srgb, var(--public-ink) 12%, transparent); padding: 18px 10px; color: var(--public-muted); font-size: .7rem; }
.public-window-sidebar span { padding: 7px 8px; border-radius: 7px; }
.public-window-sidebar .is-active { background: color-mix(in srgb, var(--public-gold) 18%, transparent); color: var(--public-gold-deep); font-weight: 700; }
.public-window-main { display: flex; flex-direction: column; padding: 24px; }
.public-window-heading { display: flex; justify-content: space-between; gap: 12px; color: var(--public-muted); font-size: .68rem; }
.public-window-heading strong { color: var(--public-ink); font-size: .84rem; }
.public-chart-lines { display: grid; gap: 17px; margin: 52px 0 auto; }
.public-chart-lines i { display: block; height: 7px; border-radius: 99px; background: linear-gradient(90deg, var(--public-gold-deep) 0 22%, color-mix(in srgb, var(--public-gold) 22%, transparent) 22% 55%, color-mix(in srgb, var(--public-ink) 12%, transparent) 55%); }
.public-chart-lines i:nth-child(2) { width: 82%; } .public-chart-lines i:nth-child(3) { width: 62%; } .public-chart-lines i:nth-child(4) { width: 92%; } .public-chart-lines i:nth-child(5) { width: 70%; } .public-chart-lines i:nth-child(6) { width: 48%; }
.public-window-footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid color-mix(in srgb, var(--public-ink) 12%, transparent); padding-top: 16px; color: var(--public-muted); font-size: .64rem; }
.public-features { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr); gap: 10vw; padding: 128px 6vw 140px; }
.public-section-intro h2 { margin: 0; font-family: "Source Han Serif SC", "Songti SC", serif; font-size: clamp(2.4rem, 4vw, 4.4rem); font-weight: 500; letter-spacing: -.06em; line-height: 1.05; }
.public-section-intro > p:last-child { max-width: 350px; margin-top: 28px; color: var(--public-muted); line-height: 1.8; }
.public-feature-list { border-top: 1px solid color-mix(in srgb, var(--public-ink) 18%, transparent); }
.public-feature-item { display: grid; grid-template-columns: 50px 1fr 24px; gap: 16px; align-items: start; padding: 24px 0; border-bottom: 1px solid color-mix(in srgb, var(--public-ink) 14%, transparent); }
.public-feature-index { color: var(--public-gold-deep); font: .7rem ui-monospace, SFMono-Regular, Consolas, monospace; padding-top: 4px; }
.public-feature-item h3 { margin: 0; font-family: "Source Han Serif SC", "Songti SC", serif; font-size: 1.35rem; font-weight: 600; }
.public-feature-item p { margin: 8px 0 0; color: var(--public-muted); font-size: .88rem; line-height: 1.7; }
.public-feature-arrow { color: var(--public-gold-deep); font-size: 1.2rem; }
.public-bridge { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 72px 6vw; border-radius: 22px; background: var(--public-ink); color: var(--public-paper); }
.public-bridge-mark { color: var(--public-gold); font-family: "Source Han Serif SC", serif; font-size: 2.3rem; }
.public-bridge h2 { margin: 12px 0 6px; font-family: "Source Han Serif SC", "Songti SC", serif; font-size: clamp(2rem, 4vw, 3.7rem); font-weight: 500; letter-spacing: -.06em; }
.public-bridge p { margin: 0; color: color-mix(in srgb, var(--public-paper) 64%, transparent); }
.public-primary-btn-dark { background: var(--public-gold); color: #1c1609 !important; box-shadow: none; white-space: nowrap; }
.public-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 52px 0 34px; color: var(--public-muted); font-size: .76rem; }
.public-footer-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--public-ink); font-weight: 700; }
.public-footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 18px; align-items: center; }
.public-footer-links a { color: var(--public-muted); text-decoration: none; } .public-footer-links a:hover { color: var(--public-gold-deep); }
.legal-page { max-width: 860px; margin: 0 auto; padding: 56px 28px 96px; color: var(--ink); }
.legal-page::before { content: none; }
.legal-page h1 { margin: 0 0 10px; font-family: "Source Han Serif SC", "Songti SC", serif; font-size: clamp(2.4rem, 5vw, 4rem); letter-spacing: -.06em; }
.legal-page .update-date { color: var(--muted); font-size: .85rem; margin-bottom: 52px; }
.legal-page h2 { margin: 42px 0 12px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 1.2rem; }
.legal-page p, .legal-page li { color: var(--muted); line-height: 1.85; font-size: .94rem; }
.legal-page strong { color: var(--ink); } .legal-page a { color: var(--accent); }
.public-action-icon { width: 16px; height: 16px; flex: 0 0 auto; }
.public-feature-arrow { display: block; width: 20px; height: 20px; margin-top: 2px; }
.public-bridge-mark { display: inline-flex; width: 30px; height: 30px; }
.public-bridge-mark svg { width: 100%; height: 100%; }
.auth-legal-consent { margin: 6px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.7; text-align: center; }
.auth-legal-consent a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.legal-site { background: var(--public-paper); color: var(--public-ink); }
.legal-nav { max-width: 860px; margin: 0 auto; padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid color-mix(in srgb, var(--public-ink) 14%, transparent); }
.legal-nav-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--public-ink); text-decoration: none; font-weight: 700; }
.legal-nav-mark { display: inline-flex; width: 40px; height: 40px; overflow: hidden; flex: 0 0 auto; }
.legal-nav-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.legal-nav-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 16px; font-size: .78rem; }
.legal-nav-links a { color: var(--public-muted); text-decoration: none; }
.legal-nav-links a:hover { color: var(--public-gold-deep); }
.legal-nav-links button { border: 1px solid color-mix(in srgb, var(--public-ink) 18%, transparent); border-radius: 999px; padding: 7px 11px; background: transparent; color: var(--public-muted); cursor: pointer; font: inherit; }
.legal-nav-links button:hover { color: var(--public-ink); border-color: var(--public-gold-deep); }
.legal-overline { margin: 0 0 18px !important; color: var(--public-gold-deep) !important; font: 600 .72rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace !important; letter-spacing: .1em; text-transform: uppercase; }
.legal-intro { max-width: 680px; margin: 20px 0 38px; padding: 18px 20px; border-left: 3px solid var(--public-gold); background: color-mix(in srgb, var(--public-gold) 11%, transparent); color: var(--public-ink) !important; }
.legal-footer-note { margin-top: 46px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--public-muted) !important; font-size: .82rem !important; }
.legal-page-footer { max-width: 860px; margin: 0 auto; padding: 0 28px 42px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--public-muted); font-size: .78rem; }
.legal-page-footer a { color: var(--public-muted); text-decoration: none; }
.legal-page-footer a:hover { color: var(--public-gold-deep); }
html[data-theme=dark] body.legal-site { --public-ink: #f5efe2; --public-muted: #aaa193; --public-paper: #171613; --public-paper-strong: #211f1a; --public-gold: #f3b83d; --public-gold-deep: #f7c75e; background: var(--public-paper); }
html[data-theme=dark] .legal-nav { border-color: rgba(255, 255, 255, .12); }
html[data-theme=dark] .legal-intro { background: rgba(243, 184, 61, .12); }
@media (max-width: 780px) {
  .public-page { padding: 0 16px; }
  .public-nav { min-height: 68px; } .public-nav-links { gap: 12px; } .public-nav-links > a:not(.public-nav-login), .public-theme-toggle { display: none; }
  .public-hero { display: block; min-height: auto; padding: 76px 10px 72px; } .public-hero h1 { font-size: clamp(3.2rem, 15vw, 5.5rem); } .public-hero-copy { font-size: .95rem; } .public-hero-workbench { margin: 58px 8px 0; } .public-window-body { min-height: 250px; } .public-window-sidebar { width: 64px; padding: 14px 6px; } .public-window-main { padding: 18px; }
  .public-features { display: block; padding: 88px 10px 96px; } .public-feature-list { margin-top: 52px; } .public-feature-item { grid-template-columns: 36px 1fr 18px; gap: 10px; } .public-feature-item p { font-size: .82rem; }
  .public-bridge { display: block; padding: 44px 28px; } .public-bridge .public-primary-btn { margin-top: 28px; } .public-footer { display: block; padding: 38px 10px 24px; } .public-footer-links { justify-content: flex-start; margin-top: 20px; }
  .legal-nav { padding: 18px; } .legal-nav-links { gap: 10px; } .legal-nav-links a:not(:last-of-type) { display: none; }
  .legal-page { padding: 38px 18px 64px; } .legal-page h2 { margin-top: 32px; } .legal-page p, .legal-page li { font-size: .9rem; } .legal-page-footer { padding: 0 18px 30px; }
}


/* Workbench redesign layer: iOS-aligned reading column with desktop expansion. */
:root {
  --wb-paper: #f6f0e4;
  --wb-surface: rgba(255, 252, 246, .86);
  --wb-surface-strong: #fffdf8;
  --wb-ink: #211d17;
  --wb-muted: #786f63;
  --wb-gold: #c28e36;
  --wb-gold-deep: #85601d;
  --wb-violet: #6e5d91;
  --wb-radius: 24px;
  --wb-shadow: 0 16px 42px rgba(73, 53, 29, .09);
}
[data-theme=dark] {
  --wb-paper: #11100f;
  --wb-surface: rgba(32, 29, 27, .9);
  --wb-surface-strong: #24211f;
  --wb-ink: #f5eee2;
  --wb-muted: #b3a89a;
  --wb-gold: #efbd59;
  --wb-gold-deep: #ffd477;
  --wb-violet: #b9a9d8;
  --wb-shadow: 0 16px 42px rgba(0, 0, 0, .26);
}
.workbench-nav {
  display: flex; align-items: center; gap: 6px; margin: 16px 0 10px;
  padding: 5px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--wb-surface); box-shadow: 0 8px 24px rgba(52, 41, 25, .05);
}
.workbench-nav-item {
  flex: 0 0 auto; border: 0; border-radius: 11px; padding: 10px 16px;
  background: transparent; color: var(--muted); cursor: pointer; font: inherit;
  font-weight: 650; transition: background .18s ease, color .18s ease;
}
.workbench-nav-item:hover, .workbench-nav-item.is-active { background: var(--accent-soft); color: var(--wb-gold-deep); }
.workbench-home-intro { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 28px 8px 14px; }
.workbench-home-greeting { display: block; color: var(--wb-gold-deep); font-size: .83rem; font-weight: 700; }
.workbench-home-intro h2 { margin: 8px 0 5px; color: var(--wb-ink); font-family: "Source Han Serif SC", "Songti SC", serif; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 600; letter-spacing: -.06em; }
.workbench-home-intro p { margin: 0; color: var(--wb-muted); line-height: 1.65; }
.workbench-home-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.workbench-primary-action, .workbench-secondary-action { min-height: 42px; border-radius: 13px; padding: 0 16px; cursor: pointer; font: inherit; font-weight: 700; }
.workbench-primary-action { border: 1px solid var(--wb-gold); background: var(--wb-gold); color: #241a0c; box-shadow: 0 8px 18px rgba(194, 142, 54, .18); }
.workbench-secondary-action { border: 1px solid var(--line); background: transparent; color: var(--wb-ink); }
.workbench-ai-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 10px 0 20px; }
.workbench-ai-entry { display: grid; grid-template-columns: 44px 1fr 20px; gap: 12px; align-items: center; min-height: 108px; padding: 18px; border: 1px solid var(--line); border-radius: var(--wb-radius); background: var(--wb-surface); box-shadow: var(--wb-shadow); color: var(--wb-ink); text-align: left; cursor: pointer; font: inherit; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.workbench-ai-entry:hover, .workbench-ai-entry:focus-visible { transform: translateY(-2px); border-color: color-mix(in srgb, var(--wb-gold) 62%, var(--line)); box-shadow: 0 20px 44px rgba(73, 53, 29, .13); outline: none; }
.workbench-ai-entry-dream { background: color-mix(in srgb, var(--wb-violet) 10%, var(--wb-surface)); }
.workbench-entry-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--wb-gold-deep); font-family: "Source Han Serif SC", serif; font-size: 1.28rem; font-weight: 700; }
.workbench-ai-entry-dream .workbench-entry-mark { background: color-mix(in srgb, var(--wb-violet) 17%, transparent); color: var(--wb-violet); }
.workbench-ai-entry strong { display: block; font-size: 1.04rem; }
.workbench-ai-entry small { display: block; margin-top: 6px; color: var(--wb-muted); font-size: .82rem; line-height: 1.5; }
.workbench-entry-arrow { color: var(--wb-gold-deep); font-size: 1.35rem; }
.workbench-mobile-nav { display: none; }
.workbench-ai-modal[hidden] { display: none; }
.workbench-ai-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(21, 17, 13, .48); backdrop-filter: blur(7px); }
.workbench-ai-backdrop { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; }
.workbench-ai-sheet { position: relative; width: min(680px, 100%); max-height: min(820px, calc(100vh - 48px)); overflow: auto; padding: 26px; border: 1px solid var(--line); border-radius: 28px; background: var(--wb-surface-strong); color: var(--wb-ink); box-shadow: 0 28px 90px rgba(0, 0, 0, .22); }
.workbench-ai-sheet-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.workbench-ai-kicker { color: var(--wb-gold-deep); font-size: .78rem; font-weight: 700; }
.workbench-ai-sheet h2 { margin: 7px 0 5px; font-family: "Source Han Serif SC", serif; font-size: 2rem; letter-spacing: -.05em; }
.workbench-ai-sheet p { margin: 0; color: var(--wb-muted); line-height: 1.6; }
.workbench-ai-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 15px; }
.workbench-ai-preset { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: transparent; color: var(--wb-ink); cursor: pointer; font: inherit; font-size: .84rem; }
.workbench-ai-preset:hover { border-color: var(--wb-gold); color: var(--wb-gold-deep); }
.workbench-ai-field { display: grid; gap: 8px; margin-top: 14px; color: var(--wb-ink); font-weight: 700; }
.workbench-ai-field textarea { width: 100%; resize: vertical; min-height: 108px; border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; background: color-mix(in srgb, var(--wb-surface-strong) 78%, var(--wb-paper)); color: var(--wb-ink); font: inherit; line-height: 1.65; }
.workbench-ai-field textarea:focus { outline: 2px solid color-mix(in srgb, var(--wb-gold) 48%, transparent); outline-offset: 1px; }
.workbench-ai-feedback { margin-top: 14px; padding: 11px 13px; border-radius: 12px; background: var(--accent-soft); color: var(--wb-gold-deep); line-height: 1.55; }
.workbench-ai-feedback.is-error { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }
.workbench-ai-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.workbench-ai-meta { color: var(--wb-muted); font-size: .8rem; }
.workbench-ai-result { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.workbench-ai-result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.workbench-ai-result-body { margin-top: 12px; color: var(--wb-ink); line-height: 1.8; white-space: pre-wrap; }
.workbench-dream-details { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--wb-surface) 74%, transparent); }
.workbench-dream-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.workbench-ai-field select, .workbench-ai-field input[type="datetime-local"] { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px; background: color-mix(in srgb, var(--wb-surface-strong) 78%, var(--wb-paper)); color: var(--wb-ink); font: inherit; }
.workbench-dream-symbols { display: flex; flex-wrap: wrap; gap: 8px; }
.workbench-dream-symbol { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: transparent; color: var(--wb-ink); cursor: pointer; font: inherit; font-size: .82rem; }
.workbench-dream-symbol.is-selected { border-color: var(--wb-gold); background: var(--accent-soft); color: var(--wb-gold-deep); }
.workbench-tools-modal[hidden] { display: none; }
.workbench-tools-modal { position: fixed; inset: 0; z-index: 101; display: grid; place-items: center; padding: 24px; background: rgba(21, 17, 13, .48); backdrop-filter: blur(7px); }
.workbench-tools-sheet { position: relative; width: min(820px, 100%); max-height: min(820px, calc(100vh - 48px)); overflow: auto; padding: 26px; border: 1px solid var(--line); border-radius: 28px; background: var(--wb-surface-strong); color: var(--wb-ink); box-shadow: 0 28px 90px rgba(0, 0, 0, .22); }
.workbench-tools-search { display: block; margin: 20px 0 8px; }
.workbench-tools-search input { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; background: color-mix(in srgb, var(--wb-surface-strong) 78%, var(--wb-paper)); color: var(--wb-ink); font: inherit; }
.workbench-tools-group { margin-top: 20px; }
.workbench-tools-group h3 { margin: 0 0 8px; color: var(--wb-gold-deep); font-size: .82rem; letter-spacing: .08em; }
.workbench-tools-group-items { display: grid; gap: 8px; }
.workbench-tool-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; width: 100%; border: 1px solid var(--line); border-radius: 15px; padding: 12px; background: var(--wb-surface); color: var(--wb-ink); cursor: pointer; font: inherit; text-align: left; }
.workbench-tool-row:hover:not(:disabled), .workbench-tool-row:focus-visible { border-color: var(--wb-gold); outline: none; }
.workbench-tool-row.is-disabled { cursor: not-allowed; opacity: .58; }
.workbench-tool-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--wb-gold-deep); font-family: "Source Han Serif SC", serif; font-weight: 700; }
.workbench-tool-copy strong, .workbench-tool-copy small { display: block; }
.workbench-tool-copy small { margin-top: 4px; color: var(--wb-muted); line-height: 1.45; }
.workbench-tool-state { color: var(--wb-gold-deep); font-size: .78rem; white-space: nowrap; }
.workbench-tools-empty { padding: 24px 0; color: var(--wb-muted); text-align: center; }
.workbench-settings-modal[hidden] { display: none; }
.workbench-settings-modal { position: fixed; inset: 0; z-index: 102; display: grid; place-items: center; padding: 24px; background: rgba(21, 17, 13, .48); backdrop-filter: blur(7px); }
.workbench-settings-sheet { position: relative; width: min(720px, 100%); max-height: min(820px, calc(100vh - 48px)); overflow: auto; padding: 26px; border: 1px solid var(--line); border-radius: 28px; background: var(--wb-surface-strong); color: var(--wb-ink); box-shadow: 0 28px 90px rgba(0, 0, 0, .22); }
.workbench-account-summary { margin-top: 22px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--wb-surface); }
.workbench-account-empty { display: grid; gap: 8px; color: var(--wb-muted); }
.workbench-account-empty strong { color: var(--wb-ink); font-size: 1.05rem; }
.workbench-account-empty .submit-btn { width: fit-content; margin-top: 4px; }
.workbench-account-identity { display: flex; align-items: center; gap: 12px; }
.workbench-account-identity strong, .workbench-account-identity small { display: block; }
.workbench-account-identity small { margin-top: 3px; color: var(--wb-muted); }
.workbench-account-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 15px; background: var(--accent-soft); color: var(--wb-gold-deep); font-family: "Source Han Serif SC", serif; font-size: 1.2rem; font-weight: 700; }
.workbench-account-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.workbench-account-metrics div { padding: 10px; border-radius: 13px; background: color-mix(in srgb, var(--wb-surface-strong) 70%, transparent); }
.workbench-account-metrics small, .workbench-account-metrics strong { display: block; }
.workbench-account-metrics small { color: var(--wb-muted); font-size: .76rem; }
.workbench-account-metrics strong { margin-top: 5px; color: var(--wb-ink); font-size: 1rem; }
.workbench-settings-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.workbench-settings-action { display: block; min-height: 88px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--wb-surface); color: var(--wb-ink); text-decoration: none; }
.workbench-settings-action:hover, .workbench-settings-action:focus-visible { border-color: var(--wb-gold); outline: none; }
.workbench-settings-action strong, .workbench-settings-action small { display: block; }
.workbench-settings-action small { margin-top: 6px; color: var(--wb-muted); line-height: 1.45; }
.workbench-settings-preferences { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.workbench-settings-preferences strong, .workbench-settings-preferences small { display: block; }
.workbench-settings-preferences small { margin-top: 4px; color: var(--wb-muted); }
.workbench-settings-logout { width: 100%; margin-top: 16px; padding: 11px 14px; border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); border-radius: 13px; background: transparent; color: var(--warn); cursor: pointer; font: inherit; font-weight: 700; }
.workbench-settings-group { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--wb-surface); overflow-wrap: anywhere; }
.workbench-history-record { display: grid; gap: 4px; }
.workbench-history-delete { justify-self: end; color: var(--warn); min-height: 36px; }
.workbench-ai-result-head { flex-wrap: wrap; }
.workbench-ai-result-head .inline-actions { flex-wrap: wrap; }
.workbench-ai-sheet-head > button { flex-shrink: 0; white-space: nowrap; }
.workbench-ai-sheet-head > div { min-width: 0; }
.workbench-settings-group > summary { cursor: pointer; padding: 6px 0; font-weight: 700; min-height: 32px; }
.workbench-settings-group p { color: var(--wb-muted); line-height: 1.7; }
.workbench-settings-group a { color: var(--wb-gold-deep); text-underline-offset: 3px; }
.workbench-account-details { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(0, 2fr); gap: 12px; font-size: .9rem; }
.workbench-account-details dt { color: var(--wb-muted); }
.workbench-account-details dd { margin: 0; text-align: right; overflow-wrap: anywhere; color: var(--wb-ink); }
.workbench-account-identity > div { min-width: 0; overflow-wrap: anywhere; }
.workbench-account-avatar { flex-shrink: 0; }
.workbench-preference-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; cursor: pointer; }
.workbench-preference-row input { width: 22px; height: 22px; accent-color: var(--wb-gold-deep); }
.workbench-ledger-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.workbench-ledger-item summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; cursor: pointer; min-height: 44px; }
.workbench-ledger-item summary span { min-width: 0; }
.workbench-ledger-item small { display: block; margin-top: 4px; color: var(--wb-muted); font-size: .8rem; }
.workbench-ledger-item strong { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.workbench-ledger-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: .85rem; }
.workbench-settings-sheet :is(button, a, input, summary):focus-visible,
.workbench-ai-sheet :is(button, a, input, select, textarea):focus-visible,
.workbench-tools-sheet :is(button, input, summary):focus-visible { outline: 2px solid var(--wb-gold-deep); outline-offset: 3px; }
.workbench-settings-sheet button, .workbench-ai-sheet button { min-height: 44px; }
.workbench-settings-sheet button:disabled, .workbench-ai-sheet button:disabled { opacity: .55; cursor: wait; }
body.workbench-history-open, body.workbench-settings-open, body.workbench-tools-open, body.workbench-ai-open { overflow: hidden; }
#workbench-history-detail { overflow-wrap: anywhere; }
#workbench-history-detail p { white-space: pre-wrap; line-height: 1.8; }
#workbench-ai-result-body { margin-top: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.workbench-ai-modal[data-mode="quick-ask"] .markdown-render strong,
.workbench-ai-modal[data-mode="quick-ask"] .markdown-render b,
.workbench-ai-modal[data-mode="quick-ask"] #workbench-ai-result-body strong,
.workbench-ai-modal[data-mode="quick-ask"] #workbench-ai-result-body b { color: var(--wb-gold-deep); }
.workbench-ai-modal[data-mode="dream"] .markdown-render strong,
.workbench-ai-modal[data-mode="dream"] .markdown-render b,
.workbench-ai-modal[data-mode="dream"] #workbench-ai-result-body strong,
.workbench-ai-modal[data-mode="dream"] #workbench-ai-result-body b { color: var(--wb-violet); }
.workbench-ai-modal[data-mode="quick-ask"] .markdown-render h1,
.workbench-ai-modal[data-mode="quick-ask"] .markdown-render h2,
.workbench-ai-modal[data-mode="quick-ask"] .markdown-render h3,
.workbench-ai-modal[data-mode="quick-ask"] #workbench-ai-result-body h1,
.workbench-ai-modal[data-mode="quick-ask"] #workbench-ai-result-body h2,
.workbench-ai-modal[data-mode="quick-ask"] #workbench-ai-result-body h3,
.workbench-ai-modal[data-mode="dream"] .markdown-render h1,
.workbench-ai-modal[data-mode="dream"] .markdown-render h2,
.workbench-ai-modal[data-mode="dream"] .markdown-render h3,
.workbench-ai-modal[data-mode="dream"] #workbench-ai-result-body h1,
.workbench-ai-modal[data-mode="dream"] #workbench-ai-result-body h2,
.workbench-ai-modal[data-mode="dream"] #workbench-ai-result-body h3 { color: var(--wb-violet); }
#workbench-ai-result-body table { display: block; max-width: 100%; overflow: auto; }
.workbench-ai-sheet [hidden], .workbench-settings-sheet [hidden] { display: none !important; }
html[data-large-text=true] { font-size: 19px; }
html[data-reduce-motion=true] *, html[data-reduce-motion=true] *::before, html[data-reduce-motion=true] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { html *, html *::before, html *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
[data-theme=dark] .workbench-ai-sheet { background: #24211f; }
[data-theme=dark] .workbench-tools-sheet { background: #24211f; }
[data-theme=dark] .workbench-settings-sheet { background: #24211f; }
@media (min-width: 1100px) { .page { max-width: 1560px; } .workbench-nav, .home-dashboard, .workbench-divider, .layout-shell { margin-left: 4vw; margin-right: 4vw; } .home-dashboard { max-width: 1240px; margin-left: auto; margin-right: auto; } }
@media (max-width: 780px) {
  .page { padding-bottom: 86px; }
  .workbench-nav { overflow-x: auto; scrollbar-width: none; margin-top: 10px; }
  .workbench-nav::-webkit-scrollbar { display: none; }
  .workbench-nav-item { padding: 9px 12px; font-size: .82rem; }
  .workbench-home-intro { display: block; padding: 20px 4px 12px; }
  .workbench-home-intro h2 { font-size: 2.1rem; }
  .workbench-home-actions { margin-top: 16px; }
  .workbench-primary-action, .workbench-secondary-action { flex: 1; padding: 0 11px; font-size: .84rem; }
  .workbench-ai-entry-grid { grid-template-columns: 1fr; gap: 9px; }
  .workbench-ai-entry { min-height: 92px; padding: 14px; border-radius: 18px; }
  .workbench-mobile-nav { position: fixed; display: grid; grid-template-columns: repeat(6, 1fr); left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 70; padding: 7px 5px; border: 1px solid var(--line); border-radius: 20px; background: color-mix(in srgb, var(--wb-surface-strong) 90%, transparent); box-shadow: 0 12px 36px rgba(0, 0, 0, .16); backdrop-filter: blur(18px); }
  .workbench-mobile-nav-item { display: grid; justify-items: center; gap: 3px; border: 0; background: transparent; color: var(--wb-muted); cursor: pointer; font: inherit; font-size: .7rem; font-weight: 650; }
  .workbench-mobile-nav-item span { display: grid; place-items: center; width: 27px; height: 24px; border-radius: 8px; font-size: 1rem; }
  .workbench-mobile-nav-item.is-active { color: var(--wb-gold-deep); }
  .workbench-mobile-nav-item.is-active span { background: var(--accent-soft); }
  .workbench-ai-modal { place-items: end center; padding: 0; }
  .workbench-ai-sheet { width: 100%; max-height: calc(100vh - 22px); padding: 22px 16px max(20px, env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  .workbench-ai-sheet h2 { font-size: 1.7rem; }
  .workbench-dream-detail-grid { grid-template-columns: 1fr; gap: 0; }
  .workbench-ai-actions { align-items: stretch; flex-direction: column; }
  .workbench-ai-actions .submit-btn { width: 100%; }
  .workbench-settings-modal { place-items: end center; padding: 0; }
  .workbench-settings-sheet { width: 100%; max-height: calc(100vh - 22px); padding: 22px 16px max(20px, env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  .workbench-account-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workbench-settings-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .workbench-ai-entry { transition: none; } }

/* Workbench scope outranks the legacy CSS appended by the release pipeline. */
body[data-workbench-screen] { --wb-ink: #302b23; --wb-muted: #71695d; --wb-gold: #c28e36; --wb-gold-deep: #976419; --wb-paper: #f5efe4; --wb-surface: #fbf8f2; --wb-surface-strong: #fffdf8; background: var(--wb-paper); color: var(--wb-ink); }
body[data-workbench-screen] .page { max-width: 1120px; padding: 18px 28px 100px; margin-inline: auto; }
body[data-workbench-screen] .hero { padding: 12px 0 20px; background: transparent; box-shadow: none; }
body[data-workbench-screen] .workbench-nav { margin: 0 0 24px; }
body[data-workbench-screen] #home-dashboard { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }
body[data-workbench-screen] .workbench-home-intro { grid-column: 1 / -1; display: block; padding: 20px 2px 8px; }
body[data-workbench-screen] .workbench-home-intro h2 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 32px; font-weight: 750; letter-spacing: -.025em; margin: 10px 0; }
body[data-workbench-screen] .workbench-home-actions { display: none; }
body[data-workbench-screen] .workbench-ai-entry-grid { grid-column: 1 / -1; margin: 0; gap: 16px; }
body[data-workbench-screen] .workbench-ai-entry { min-height: 160px; border-radius: 24px; padding: 24px; grid-template-columns: 48px minmax(0,1fr) 20px; background: var(--wb-surface-strong); box-shadow: 0 6px 22px #49351d08; }
body[data-workbench-screen] .workbench-ai-entry-dream { background: color-mix(in srgb, #9d8ba8 10%, var(--wb-surface-strong)); }
body[data-workbench-screen] .workbench-ai-entry strong { font-size: 20px; }
body[data-workbench-screen] .workbench-ai-entry small { font-size: 14px; line-height: 1.7; }
body[data-workbench-screen] #home-dashboard > .home-card { min-height: 100px; max-height: none; padding: 20px; border-radius: 22px; background: var(--wb-surface); }
body[data-workbench-screen] .home-fortune-dos, body[data-workbench-screen] .home-fortune-donts { white-space: normal; font-size: 13px; }
body[data-workbench-screen] .home-calendar-stack div, body[data-workbench-screen] .home-divination-label, body[data-workbench-screen] .home-hexagram-brief { font-size: 13px; }
body[data-workbench-screen] .home-lunar-date, body[data-workbench-screen] .home-divination-title, body[data-workbench-screen] .home-hexagram-name { font-size: 16px; }
body[data-workbench-screen] .ios-feature-page { display: none; max-width: 680px; margin: 0 auto; min-width: 0; }
body[data-workbench-screen=chart] #tool-page, body[data-workbench-screen=history] #history-page, body[data-workbench-screen=daily] #daily-page { display: block; animation: wb-sheet-in .22s ease-out; }
body[data-workbench-screen]:not([data-workbench-screen=home]) #home-dashboard, body[data-workbench-screen=home] #workbench-divider { display: none !important; }
body[data-workbench-screen] #workbench-divider { max-width: 680px; margin: 0 auto 24px; }
body[data-workbench-screen] .ios-feature-header { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 6px 0 24px; }
body[data-workbench-screen] .ios-feature-header h2 { font: 750 28px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; margin: 0 0 6px; color: var(--wb-ink); }
body[data-workbench-screen] .ios-feature-header p { color: var(--wb-muted); line-height: 1.65; margin: 0; font-size: 14px; }
body[data-workbench-screen] #fortune-form { padding: 0; position: static; height: auto; width: 100%; max-height: none; overflow: visible; background: none; border: 0; box-shadow: none; transform: none; }
body[data-workbench-screen] [hidden] { display: none !important; }
body[data-workbench-screen] .ios-input-group { padding: 22px; border-radius: 22px; border: 1px solid var(--line); background: var(--wb-surface-strong); margin: 0 0 16px; }
body[data-workbench-screen] .ios-input-group h3 { font-size: 16px; margin: 0 0 20px; color: var(--wb-ink); }
body[data-workbench-screen] .ios-input-group p { color: var(--wb-muted); line-height: 1.8; }
body[data-workbench-screen] .ios-input-group summary { cursor: pointer; min-height: 26px; font-weight: 650; }
body[data-workbench-screen] .ios-input-group[open] summary { margin-bottom: 18px; }
body[data-workbench-screen] .ios-submit { display: grid; gap: 14px; position: static; padding: 0 0 24px; }
body[data-workbench-screen] .ios-submit > .submit-btn { width: 100%; min-height: 52px; border-radius: 16px; }
body[data-workbench-screen] .ios-submit > .input-preview, body[data-workbench-screen] .ios-submit > .timezone-preview-strip { display: none; }
body[data-workbench-screen] .ios-feature-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
body[data-workbench-screen] .ios-feature-actions .ghost-btn { min-height: 44px; }
body[data-workbench-screen] #tool-result { min-width: 0; animation: wb-sheet-in .22s ease-out; }
body[data-workbench-screen] .history-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
body[data-workbench-screen] .history-toolbar input { flex: 1; min-width: 180px; }
body[data-workbench-screen] .casting-coins { display: flex; justify-content: center; gap: 22px; padding: 22px 0; }
body[data-workbench-screen] .casting-coins span { display: grid; place-items: center; width: 64px; height: 64px; border: 3px double var(--wb-gold); border-radius: 50%; color: var(--wb-gold-deep); font-size: 20px; background: var(--wb-paper); }
body[data-workbench-screen] .casting-lines { display: flex; flex-direction: column-reverse; list-style: none; padding: 0; }
body[data-workbench-screen] .casting-lines li { display: grid; grid-template-columns: 62px 1fr 110px; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
body[data-workbench-screen] .cast-line { height: 7px; background: var(--wb-gold); display: block; }
body[data-workbench-screen] .cast-line.yin { background: linear-gradient(to right,var(--wb-gold) 44%,transparent 44%,transparent 56%,var(--wb-gold) 56%); }
body[data-workbench-screen] .home-tool-shortcuts { grid-column: 1/-1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
body[data-workbench-screen] .home-tool-shortcuts button { padding: 18px 10px; min-height: 76px; border: 1px solid var(--line); border-radius: 18px; background: var(--wb-surface-strong); color: var(--wb-ink); font-weight: 650; cursor: pointer; }
body[data-workbench-screen] .daily-reading { font-size: 16px; line-height: 1.9; }
body[data-workbench-screen] .daily-hex-lines { width: 180px; display: grid; gap: 12px; margin: 32px auto; }
body[data-workbench-screen] .fortune-draw { text-align: center; }
body[data-workbench-screen] .fortune-vessel { width: 100px; height: 130px; margin: 24px auto; display: grid; place-items: center; border-radius: 16px 16px 36px 36px; border: 3px double var(--wb-gold); background: var(--wb-paper); color: var(--wb-gold-deep); font-size: 38px; }
body[data-workbench-screen] .fortune-draw h3 { font-size: 32px; color: var(--wb-gold-deep); margin-top: 30px; }
body[data-workbench-screen] .fortune-draw .submit-btn { margin-top: 22px; min-width: 180px; min-height: 50px; }
body[data-workbench-screen] #calendar-form .field { margin-bottom: 18px; }
body[data-workbench-screen] .home-card { color: var(--wb-ink); text-align: left; }
body[data-workbench-screen] button.home-card { cursor: pointer; }
@media (prefers-reduced-motion:reduce) { body[data-workbench-screen] * { animation: none !important; scroll-behavior: auto !important; } }
body[data-workbench-screen] .field[hidden], body[data-workbench-screen] .field-row[hidden] { display: none !important; }
body[data-workbench-screen] .field input, body[data-workbench-screen] .field select, body[data-workbench-screen] .field textarea { min-height: 48px; border-radius: 14px; color: var(--wb-ink); background: var(--wb-surface-strong); }
body[data-workbench-screen] .mode-chip { min-height: 44px; }
body[data-workbench-screen] :is(.workbench-tools-modal,.workbench-settings-modal,.workbench-ai-modal) { z-index: 11000; isolation: isolate; }
body[data-workbench-screen] .workbench-ai-backdrop { z-index: 0; }
body[data-workbench-screen] :is(.workbench-tools-sheet,.workbench-settings-sheet,.workbench-ai-sheet) { z-index: 1; width: min(760px,100%); max-height: calc(100dvh - 48px); background: var(--wb-surface-strong); overscroll-behavior: contain; animation: wb-sheet-in .22s ease-out both; }
body[data-workbench-screen] .workbench-ai-sheet-head { position: sticky; top: -26px; z-index: 2; background: var(--wb-surface-strong); padding: 12px 0; }
body[data-workbench-screen] .workbench-tools-group { padding: 12px 0; border-bottom: 1px solid var(--line); }
body[data-workbench-screen] .workbench-tools-group > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; min-height: 44px; font-size: 15px; font-weight: 700; color: var(--wb-muted); }
body[data-workbench-screen] .workbench-tools-group-items { grid-template-columns: repeat(2,minmax(0,1fr)); }
body[data-workbench-screen] .workbench-tool-row { min-height: 90px; }
body[data-workbench-screen] .workbench-tool-copy { min-width: 0; }
body[data-workbench-screen] .workbench-input-count { display: block; text-align: right; padding-top: 6px; color: var(--wb-muted); }
body[data-workbench-screen] #workbench-dream-details > summary { cursor: pointer; min-height: 44px; }
body[data-workbench-screen] #workbench-dream-summary { display: block; color: var(--wb-muted); font-size: 13px; margin-top: 8px; }
body[data-workbench-screen] .workbench-ai-sheet-head h2 { font: 750 28px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; margin: 8px 0; }
body[data-workbench-screen] .workbench-ai-sheet-head p { color: var(--wb-muted); font-size: 14px; line-height: 1.7; }
body[data-workbench-screen] .workbench-ai-field textarea { min-height: 180px; }
body[data-workbench-screen] #workbench-ai-context { min-height: 100px; }
body[data-workbench-screen] .workbench-tool-row:active, body[data-workbench-screen] .workbench-ai-entry:active { transform: scale(.985); }
body[data-workbench-screen] .workbench-ai-entry { transition: transform .22s ease, box-shadow .22s ease; }
body[data-workbench-screen] .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
body[data-workbench-screen] { --ink: var(--wb-ink); --muted: var(--wb-muted); --panel: var(--wb-surface); --panel-strong: var(--wb-surface-strong); }
body[data-workbench-screen] #tool-result :is(.meta-shell,.result-card,.analysis-item,.ios-input-group,.stat-metric,.key-value-pill) { background: var(--wb-surface-strong); border-color: var(--line); color: var(--wb-ink); }
body[data-workbench-screen] #tool-result :is(h2,h3,h4,strong,summary) { color: var(--wb-ink); }
body[data-workbench-screen] #tool-result :is(p,small,.analysis-item span,.workspace-state-pill) { color: var(--wb-muted); }
body[data-workbench-screen] #tool-result .workspace-state-pill { background: var(--wb-surface); border-color: var(--line); }
body[data-workbench-screen] :is(.ghost-btn,.tab-chip) { background: var(--wb-surface-strong); color: var(--wb-ink); border: 1px solid var(--line); box-shadow: none; min-height: 44px; }
body[data-workbench-screen] .tab-chip.active { background: var(--wb-gold-deep); color: var(--wb-paper); border-color: transparent; }
body[data-workbench-screen] .history-date-heading { margin: 20px 0 10px; padding: 8px 0; min-height: 44px; cursor: pointer; font-size: 17px; font-weight: 650; color: var(--wb-ink); }
body[data-workbench-screen] #workbench-ai-modal [hidden] { display: none !important; }
body[data-workbench-screen] #workbench-ai-modal { --journey-accent: var(--wb-gold-deep); }
body[data-workbench-screen] .workbench-ai-branches { display:flex; gap:4px; padding:4px; margin:0 0 22px; border:1px solid var(--line); border-radius:14px; background:var(--wb-surface-strong); }
body[data-workbench-screen] .workbench-ai-branches button { flex:1; min-width:0; min-height:44px; border:1px solid transparent; border-radius:10px; background:transparent; color:var(--wb-muted); font:inherit; cursor:pointer; }
body[data-workbench-screen] .workbench-ai-branches button[aria-pressed=true] { background:var(--wb-surface); color:var(--journey-accent); border-color:var(--line); font-weight:700; }
body[data-workbench-screen] .workbench-ai-branches button:focus-visible { outline:3px solid var(--journey-accent); outline-offset:2px; }
body[data-workbench-screen] #workbench-ai-modal[data-mode=dream] { --journey-accent: #7453a7; }
[data-theme=dark] body[data-workbench-screen] #workbench-ai-modal[data-mode=dream] { --journey-accent: #c5ade9; }
body[data-workbench-screen] #workbench-ai-modal .workbench-ai-sheet { width: min(680px,100%); }
body[data-workbench-screen] #workbench-ai-modal .workbench-ai-sheet-head { align-items: flex-start; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
body[data-workbench-screen] #workbench-ai-modal .workbench-ai-sheet-head .ghost-btn { flex-shrink: 0; }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-kicker { color: var(--journey-accent); font-size: 12px; }
body[data-workbench-screen] #workbench-ai-modal .workbench-ai-result { padding: 0; border: 0; background: transparent; }
body[data-workbench-screen] #workbench-ai-modal .workbench-ai-result-head { display: grid; gap: 16px; margin: 24px 0; }
body[data-workbench-screen] #workbench-ai-modal .workbench-ai-result-head > strong { font-size: 20px; color: var(--wb-ink); }
body[data-workbench-screen] #workbench-ai-result-body { color: var(--wb-ink); font-size: 16px; line-height: 1.9; overflow-wrap: anywhere; }
/* Report headings and emphasis use the mode palette below, not body ink. */
body[data-workbench-screen] .ai-journey-waiting { border: 1px solid var(--line); border-radius: 22px; padding: 28px 22px; background: color-mix(in srgb,var(--journey-accent) 7%,var(--wb-surface-strong)); text-align: center; }
body[data-workbench-screen] .ai-journey-waiting h3 { color: var(--wb-ink); font-size: 21px; margin: 20px 0 8px; }
body[data-workbench-screen] .ai-wait-question { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--wb-surface); text-align: left; }
body[data-workbench-screen] .ai-wait-question strong { color: var(--journey-accent); font-size: 12px; }
body[data-workbench-screen] .ai-wait-question blockquote { margin: 8px 0 0; padding: 0; border: 0; max-height: 5.4em; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.8; color: var(--wb-ink); }
body[data-workbench-screen] .ai-reading-nav .has-new-reply { border-color: var(--journey-accent); color: var(--journey-accent); font-weight: 700; }
body[data-workbench-screen] .workbench-ai-activity { grid-column:1/-1; min-width:0; }
body[data-workbench-screen] #workbench-ai-activity-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:12px; }
body[data-workbench-screen] .workbench-ai-activity-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; padding:20px; border:1px solid var(--line); border-radius:18px; background:var(--wb-surface); color:var(--wb-ink); text-align:left; cursor:pointer; min-width:0; }
body[data-workbench-screen] .workbench-ai-activity-card span { color:var(--wb-muted); font-size:13px; }
body[data-workbench-screen] .workbench-ai-activity-card small { grid-column:1/-1; color:var(--wb-muted); font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
body[data-workbench-screen] .workbench-ai-activity-card:focus-visible { outline:3px solid var(--gold-500); outline-offset:3px; }
body[data-workbench-screen] #workbench-ai-elapsed { font-variant-numeric: tabular-nums; color: var(--journey-accent); font-size: 13px; }
body[data-workbench-screen] #workbench-ai-server-status { color: var(--wb-muted); font-size: 14px; min-height: 44px; }
body[data-workbench-screen] .ai-journey-loader { width: 72px; height: 76px; display: flex; flex-direction: column; justify-content: space-between; margin: 8px auto 0; }
body[data-workbench-screen] .ai-journey-loader span { height: 7px; border-radius: 3px; background: var(--journey-accent); animation: journey-line-pulse 1.8s ease-in-out infinite; }
body[data-workbench-screen] .ai-journey-loader span:nth-child(even) { background: linear-gradient(to right,var(--journey-accent) 42%,transparent 42%,transparent 58%,var(--journey-accent) 58%); }
body[data-workbench-screen] .ai-journey-loader span:nth-child(2) { animation-delay: .15s; }
body[data-workbench-screen] .ai-journey-loader span:nth-child(3) { animation-delay: .3s; }
body[data-workbench-screen] .ai-journey-loader span:nth-child(4) { animation-delay: .45s; }
body[data-workbench-screen] .ai-journey-loader span:nth-child(5) { animation-delay: .6s; }
body[data-workbench-screen] .ai-journey-loader span:nth-child(6) { animation-delay: .75s; }
body[data-workbench-screen] #workbench-ai-modal[data-mode=dream] .ai-journey-loader { border-radius: 50%; border: 2px solid var(--journey-accent); position: relative; height: 72px; transform: rotate(-25deg); overflow: hidden; }
body[data-workbench-screen] #workbench-ai-modal[data-mode=dream] .ai-journey-loader span { position: absolute; inset: 0; height: 100%; border-radius: 50%; background: var(--journey-accent); opacity: .15; animation: journey-moon-pulse 2.5s ease-in-out infinite; }
body[data-workbench-screen] #workbench-ai-modal[data-mode=dream] .ai-journey-loader span:nth-child(n+2) { display: none; }
body[data-workbench-screen] #workbench-ai-modal[data-mode=dream] .ai-journey-loader:after { content: ''; position: absolute; width: 60px; height: 66px; border-radius: 50%; top: -8px; right: -14px; background: var(--wb-surface-strong); }
body[data-workbench-screen] .ai-journey-milestones { list-style: none; padding: 0; margin: 22px 0; text-align: left; }
body[data-workbench-screen] .ai-journey-milestones li { display: flex; align-items: center; justify-content: space-between; min-height: 44px; border-bottom: 1px solid var(--line); color: var(--wb-muted); }
body[data-workbench-screen] .ai-journey-milestones .is-active { color: var(--journey-accent); font-weight: 650; }
body[data-workbench-screen] .ai-journey-question { margin-top: 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--wb-surface); }
body[data-workbench-screen] .ai-journey-question summary { min-height: 32px; cursor: pointer; font-weight: 650; }
body[data-workbench-screen] .ai-journey-question p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
body[data-workbench-screen] .ai-basis-fields { display:grid; grid-template-columns:auto minmax(0,1fr); gap:12px 18px; font-size:14px; }
body[data-workbench-screen] .ai-basis-anchor { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; margin:18px 0; }
body[data-workbench-screen] .ai-basis-anchor > div { padding:14px; border:1px solid var(--line); border-radius:14px; background:var(--wb-surface-strong); min-width:0; }
body[data-workbench-screen] .ai-basis-anchor small { display:block; color:var(--wb-muted); margin-bottom:6px; }
body[data-workbench-screen] .ai-basis-anchor strong { display:block; color:var(--wb-ink); font-size:16px; overflow-wrap:anywhere; }
body[data-workbench-screen] .ai-basis-fields dt { color:var(--wb-muted); }
body[data-workbench-screen] .ai-basis-fields dd { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
body[data-workbench-screen] .ai-basis-lines { display:grid; gap:12px; list-style:none; padding:18px 0; margin:12px 0; max-width:420px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
body[data-workbench-screen] .ai-basis-lines li { display:grid; grid-template-columns:3em minmax(48px,1fr) 7em; gap:16px; align-items:center; color:var(--wb-muted); font-size:13px; }
body[data-workbench-screen] .ai-basis-line { height:8px; border-radius:2px; background:var(--journey-accent); }
body[data-workbench-screen] .ai-basis-line.is-yin { background:linear-gradient(to right,var(--journey-accent) 43%,transparent 43%,transparent 57%,var(--journey-accent) 57%); }
body[data-workbench-screen] .ai-journey-recovery { display: flex; gap: 12px; flex-wrap: wrap; padding: 18px 0; }
@keyframes journey-line-pulse { 0%,100% { opacity: .3; transform: scaleX(.85); } 50% { opacity: 1; transform: scaleX(1); } }
@keyframes journey-moon-pulse { 0%,100% { opacity: .2; } 50% { opacity: .85; } }
@media(prefers-reduced-motion:reduce) { body[data-workbench-screen] .ai-journey-loader span { animation: none !important; opacity: .75; } }
html[data-reduce-motion=true] body[data-workbench-screen] .ai-journey-loader span { animation: none !important; opacity: .75; }
@media(max-width:780px) { body[data-workbench-screen] #workbench-ai-modal .workbench-ai-sheet { width: 100%; } }
body[data-workbench-screen] .history-chat-message { padding: 16px; margin: 12px 0; border-radius: 14px; background: var(--wb-surface); overflow-wrap: anywhere; }
body[data-workbench-screen] .history-chat-message.is-user { border-left: 3px solid var(--wb-gold-deep); }
body[data-workbench-screen] #workbench-history-detail p { white-space: pre-wrap; overflow-wrap: anywhere; }
body[data-workbench-screen] .hexagram-library { display: grid; gap: 10px; }
body[data-workbench-screen] .hexagram-library-row { display: grid; grid-template-columns: 64px minmax(0,1fr); align-items: center; gap: 20px; width: 100%; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--wb-surface-strong); color: var(--wb-ink); text-align: left; cursor: pointer; }
body[data-workbench-screen] .hexagram-library-row > span { display: grid; gap: 6px; min-width: 0; }
body[data-workbench-screen] .hexagram-library-row small { color: var(--wb-muted); }
body[data-workbench-screen] .hexagram-library-row strong { font-size: 20px; }
body[data-workbench-screen] .hexagram-library-row > span > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--wb-muted); font-size: 13px; }
body[data-workbench-screen] .hexagram-library-row .daily-hex-lines { width: 64px; margin: 0; gap: 4px; }
body[data-workbench-screen] .hexagram-library-row .cast-line { height: 5px; }
body[data-workbench-screen] .hexagram-detail { display: grid; gap: 14px; margin-top: 16px; }
body[data-workbench-screen] .hexagram-detail p { line-height: 1.95; font-size: 16px; }
body[data-workbench-screen] .hexagram-detail summary { min-height: 44px; cursor: pointer; font-weight: 650; padding: 8px 0; }
body[data-workbench-screen] .hexagram-detail .hexagram-yao + .hexagram-yao { border-top: 1px solid var(--line); }
body[data-workbench-screen] .hexagram-related { display: flex; flex-wrap: wrap; gap: 8px; }
/* ========================================
   ichingtools 商店页面优化层
   目标：更宽的布局 + 更高的内容密度 + 首屏完整显示
   ======================================== */

/* ==================== 桌面端优化 ==================== */

/* 1. 增加页面最大宽度：1160px → 1400px */
body.ios-store .store-shell {
  width: min(100%, 1400px);
  max-width: 1400px;
  padding: 20px 32px 32px;
}

/* 2. 压缩Hero区域，减少50%垂直空间 */
body.ios-store .store-intro {
  padding: 32px 0 16px;
  text-align: center;
}

body.ios-store .store-intro .store-kicker {
  font-size: 12px;
  font-weight: 700;
  color: var(--shop-accent, #a97f13);
  letter-spacing: 1.5px;
  margin: 0 0 10px;
}

body.ios-store .store-intro h1 {
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 750;
  letter-spacing: -1.4px;
  line-height: 1.25;
  margin: 0 0 12px;
}

body.ios-store .store-intro > p:last-child {
  font-size: 14px;
  line-height: 1.7;
  color: var(--shop-muted);
  margin: 0;
}

/* 3. 压缩账户信息卡片 */
body.ios-store .store-account {
  max-width: 100%;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 16px 20px;
  gap: 20px;
  border-radius: 14px;
  background: var(--shop-card);
}

body.ios-store .store-account > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  text-align: left;
}

body.ios-store .store-account span,
body.ios-store .store-account small {
  font-size: 11px;
  color: var(--shop-muted);
}

body.ios-store .store-account strong {
  font-size: 15px;
}

body.ios-store .store-account #store-auth-points {
  font-size: 20px;
}

/* 4. 优化分段控件 */
body.ios-store .store-segments {
  margin: 0 auto 24px;
}

body.ios-store .store-segments button {
  min-width: 110px;
  padding: 10px 20px;
  font-size: 13px;
}

/* 5. 压缩章节标题 */
body.ios-store .store-section-heading {
  margin: 20px 0 16px;
  align-items: center;
}

body.ios-store .store-section-heading h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
}

body.ios-store .store-section-heading p {
  font-size: 12px;
  color: var(--shop-muted);
  margin: 0;
  line-height: 1.6;
}

/* 6. 优化产品网格 - 积分卡片3列 */
body.ios-store #store-products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* 7. 会员方案3列并排（桌面端） */
body.ios-store #store-products-grid.is-membership {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: none;
  gap: 14px;
}

/* 8. 压缩卡片内边距和间距 */
body.ios-store .store-catalog-card {
  padding: 18px 16px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--shop-line);
  background: var(--shop-card);
  position: relative;
  min-width: 0;
}

body.ios-store .store-catalog-card h3 {
  font-size: 14px;
  margin: 0 0 12px;
  font-weight: 650;
  color: var(--shop-muted);
}

/* 9. 优化积分卡片 - 压缩字体和间距 */
.store-point-total {
  font-size: 36px;
  font-weight: 750;
  letter-spacing: -1.5px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.store-point-total span {
  font-size: 13px;
  letter-spacing: 0;
  margin-left: 6px;
  font-weight: 500;
  color: var(--shop-muted);
}

.store-point-equation {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--shop-muted);
  min-height: auto;
  margin: 8px 0 10px;
}

.store-bonus {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 6px;
  color: #72520b;
  background: #f7e3a0;
  font-weight: 750;
  font-size: 10px;
}

.store-value-meter {
  height: 4px;
  border-radius: 3px;
  display: flex;
  overflow: hidden;
  background: var(--shop-line);
  margin: 0 0 14px;
}

body.ios-store .store-catalog-card .store-price {
  font-size: 20px;
  margin: 0 0 4px;
  letter-spacing: -0.4px;
}

.store-unit-price {
  font-size: 11px;
  color: var(--shop-muted);
  margin-bottom: 14px;
  display: block;
  font-variant-numeric: tabular-nums;
}

body.ios-store .store-catalog-card > button {
  margin-top: auto;
  min-height: 42px;
  background: transparent;
  border: 1px solid var(--shop-line);
  font-weight: 700;
  border-radius: 9px;
  color: var(--shop-text);
  font-size: 13px;
}

/* 10. 优化会员方案卡片 */
body.ios-store .store-plan {
  padding: 20px 16px;
}

.store-plan-name {
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -1.2px;
  margin: 0 0 6px;
}

.store-plan-caption {
  font-size: 12px;
  line-height: 1.6;
  color: var(--shop-muted);
  margin-bottom: 16px;
  min-height: auto;
}

.store-plan-cycle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--shop-line);
  padding-bottom: 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--shop-muted);
}

body.ios-store .store-plan-cycle select {
  width: 130px;
  min-width: 0;
  margin: 0;
  padding: 8px;
  font-size: 12px;
  color: var(--shop-text);
  background: var(--shop-bg);
  border: 1px solid var(--shop-line);
  border-radius: 8px;
}

.store-monthly-equivalent {
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -1.4px;
  line-height: 1.2;
  min-height: auto;
  font-variant-numeric: tabular-nums;
}

.store-monthly-equivalent small {
  font-size: 12px;
  font-weight: 450;
  letter-spacing: 0;
  color: var(--shop-muted);
  margin-left: 5px;
}

.store-cycle-total {
  font-size: 11px;
  color: var(--shop-muted);
  margin: 8px 0;
  line-height: 1.7;
  min-height: auto;
}

.store-plan-saving {
  min-height: auto;
  font-size: 11px;
  color: var(--shop-muted);
  margin-bottom: 14px;
}

.store-plan-features {
  list-style: none;
  padding: 16px 0 0;
  margin: 16px 0 0;
  border-top: 1px solid var(--shop-line);
  display: grid;
  gap: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.store-plan-features li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.store-plan-features svg {
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 1px;
  color: #ad8728;
}

/* 11. 优化billing switch */
body.ios-store .store-billing-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 4px auto 24px;
  border: 1px solid var(--shop-line);
  border-radius: 12px;
  background: var(--shop-card);
}

body.ios-store .store-billing-switch button {
  min-width: 90px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 9px 14px;
  color: var(--shop-muted);
  font-size: 13px;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.store-billing-switch button span {
  font-size: 9px;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--shop-bg);
  color: var(--shop-accent);
}

/* 12. 优化Plan Benefits表格 */
.store-plan-benefits {
  border-top: 1px solid var(--shop-line);
  margin: 16px 0 0;
  padding: 4px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.store-plan-benefits > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 10px 0;
  border-bottom: 1px solid var(--shop-line);
}

.store-plan-benefits dt {
  font-weight: 450;
  color: var(--shop-muted);
  font-size: 11px;
}

.store-plan-benefits dd {
  margin: 0;
  font-weight: 750;
  white-space: nowrap;
  color: var(--shop-text);
  font-size: 12px;
}

/* 13. 压缩脚注 */
.store-catalog-footnote {
  text-align: center;
  color: var(--shop-muted);
  font-size: 11px;
  line-height: 1.6;
  margin: 16px 0 28px;
}

/* 14. 优化FAQ */
body.ios-store .store-faq {
  margin-top: 32px;
  padding-top: 28px;
}

.store-faq details {
  padding: 14px 0;
}

.store-faq summary {
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.7;
}

.store-faq p {
  font-size: 12px;
  color: var(--shop-muted);
  line-height: 1.8;
  max-width: 820px;
  margin: 10px 0 0;
}

/* 15. 优化footer */
body.ios-store .store-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  padding: 24px 0 0;
}

/* ==================== 平板断点 (800px - 1100px) ==================== */
@media (min-width: 801px) and (max-width: 1100px) {
  body.ios-store .store-shell {
    width: min(100%, 1200px);
    max-width: 1200px;
    padding: 18px 28px 28px;
  }

  /* 会员方案保持3列 */
  body.ios-store #store-products-grid.is-membership {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  body.ios-store .store-plan {
    padding: 16px 12px;
  }

  .store-monthly-equivalent {
    font-size: 28px;
  }

  .store-plan-name {
    font-size: 24px;
  }
}

/* ==================== 移动端优化 (≤800px) ==================== */
@media (max-width: 800px) {
  body.ios-store .store-shell {
    padding: 16px 18px 24px;
  }

  body.ios-store .store-intro {
    padding: 24px 0 14px;
  }

  body.ios-store .store-intro h1 {
    font-size: 26px;
    line-height: 1.3;
    margin-bottom: 10px;
  }

  body.ios-store .store-intro .store-kicker {
    margin-bottom: 8px;
    font-size: 11px;
  }

  body.ios-store .store-intro > p:last-child {
    font-size: 13px;
  }

  body.ios-store .store-account {
    padding: 12px 14px;
    gap: 14px;
    margin-bottom: 18px;
  }

  body.ios-store .store-segments {
    margin-bottom: 18px;
  }

  body.ios-store .store-segments button {
    padding: 9px 10px;
    min-width: 0;
    flex: 1;
    font-size: 12px;
  }

  /* 积分卡片2列 */
  body.ios-store #store-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* 会员方案2列 */
  body.ios-store #store-products-grid.is-membership {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.ios-store .store-catalog-card {
    padding: 14px 12px;
  }

  body.ios-store .store-plan {
    padding: 16px 12px;
  }

  .store-monthly-equivalent {
    font-size: 28px;
  }

  .store-plan-name {
    font-size: 22px;
  }
}

/* ==================== 小屏手机 (≤540px) - 继续优化 ==================== */


/* ==================== 小屏手机优化 (≤540px) ==================== */
@media (max-width: 540px) {
  body.ios-store .store-shell {
    padding: 14px 14px 24px;
  }

  body.ios-store .store-intro {
    padding: 20px 0 12px;
  }

  body.ios-store .store-intro h1 {
    font-size: 24px;
    line-height: 1.3;
    letter-spacing: -0.8px;
    margin-bottom: 8px;
  }

  body.ios-store .store-intro .store-kicker {
    margin-bottom: 6px;
    font-size: 10px;
  }

  body.ios-store .store-intro > p:last-child {
    font-size: 12px;
  }

  body.ios-store .store-account {
    padding: 10px 12px;
    gap: 10px;
    margin-bottom: 16px;
  }

  body.ios-store .store-account strong {
    font-size: 13px;
  }

  body.ios-store .store-account > div {
    gap: 4px 8px;
  }

  body.ios-store .store-account #store-auth-points {
    font-size: 18px;
  }

  body.ios-store .store-segments {
    margin-bottom: 16px;
    width: 100%;
  }

  body.ios-store .store-segments button {
    min-height: 40px;
    padding: 8px 6px;
    font-size: 11px;
  }

  body.ios-store .store-section-heading {
    margin: 16px 0 12px;
  }

  body.ios-store .store-section-heading h2 {
    font-size: 17px;
    line-height: 1.4;
  }

  body.ios-store .store-section-heading p {
    font-size: 11px;
  }

  /* 移动端积分和会员都显示2列 */
  body.ios-store #store-products-grid,
  body.ios-store #store-products-grid.is-membership {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.ios-store .store-catalog-card {
    padding: 12px 10px;
    border-radius: 13px;
  }

  body.ios-store .store-catalog-card h3 {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .store-point-total {
    font-size: 28px;
    letter-spacing: -1px;
  }

  .store-point-total span {
    display: block;
    margin: 4px 0 0;
    font-size: 10px;
  }

  .store-point-equation {
    font-size: 10px;
    min-height: auto;
    margin: 6px 0 8px;
    gap: 4px;
    align-content: start;
  }

  .store-point-equation .store-bonus {
    font-size: 9px;
    padding: 3px 5px;
    line-height: 1.5;
  }

  .store-value-meter {
    margin-bottom: 10px;
  }

  body.ios-store .store-catalog-card .store-price {
    font-size: 18px;
  }

  .store-unit-price {
    font-size: 10px;
    line-height: 1.6;
    min-height: auto;
    margin-bottom: 10px;
  }

  .store-value-label {
    position: static;
    order: -1;
    font-size: 9px;
    min-height: auto;
    margin-bottom: 5px;
  }

  body.ios-store .store-catalog-card > button {
    min-height: 40px;
    font-size: 11px;
    padding: 8px 4px;
    line-height: 1.4;
  }

  body.ios-store .store-plan {
    padding: 14px 10px;
  }

  .store-plan-name {
    font-size: 20px;
    letter-spacing: -0.6px;
  }

  .store-plan-caption {
    font-size: 11px;
    line-height: 1.5;
    min-height: auto;
    margin-bottom: 12px;
  }

  .store-monthly-equivalent {
    font-size: clamp(20px, 6vw, 26px);
    letter-spacing: -0.8px;
    min-height: auto;
  }

  .store-monthly-equivalent small {
    display: block;
    margin: 4px 0 0;
    font-size: 10px;
  }

  .store-cycle-total {
    font-size: 10px;
    min-height: auto;
    margin: 6px 0;
    line-height: 1.6;
  }

  .store-plan-saving {
    min-height: auto;
    margin-bottom: 10px;
    font-size: 10px;
  }

  .store-annual-saving {
    padding: 5px;
    font-size: 10px;
    line-height: 1.6;
  }

  .store-saving-basis {
    font-size: 9px;
    line-height: 1.5;
    margin-top: 4px;
  }

  .store-plan-features {
    font-size: 10px;
    line-height: 1.6;
    gap: 7px;
    margin-top: 12px;
    padding-top: 12px;
  }

  .store-plan-features li {
    gap: 4px;
  }

  .store-plan-features svg {
    width: 11px;
    height: 11px;
    margin-top: 2px;
  }

  body.ios-store .store-billing-switch {
    margin-bottom: 16px;
    padding: 3px;
    width: 100%;
  }

  body.ios-store .store-billing-switch button {
    min-height: 40px;
    padding: 8px 4px;
    font-size: 11px;
  }

  .store-catalog-footnote {
    font-size: 10px;
    margin: 12px 0 20px;
    text-align: left;
  }

  .store-plan-benefits > div {
    min-height: auto;
    padding: 8px 0;
  }

  .store-plan-benefits dt {
    font-size: 10px;
  }

  .store-plan-benefits dd {
    font-size: 11px;
  }
}

/* ==================== 极小屏幕 (≤360px) ==================== */
@media (max-width: 360px) {
  body.ios-store .store-shell {
    padding: 12px 10px 20px;
  }

  body.ios-store .store-intro h1 {
    font-size: 22px;
  }

  .store-point-total {
    font-size: 24px;
  }

  .store-plan-name {
    font-size: 18px;
  }

  .store-monthly-equivalent {
    font-size: 22px;
  }
}

/* ==================== 商店特定组件优化 ==================== */

/* 订阅卡片优化 */
.store-subscription-card {
  max-width: none;
  padding: 0;
  overflow: hidden;
}

.store-subscription-top {
  padding: 24px 26px 18px;
  background: color-mix(in srgb, var(--shop-card) 93%, #dfaf26);
}

.store-subscription-top h3 {
  font-size: 30px;
  margin-bottom: 0;
}

.store-subscription-facts {
  margin: 0 26px;
  padding: 20px 0;
  border-top: 0;
}

.store-subscription-note {
  margin: 16px 26px;
  padding: 12px 14px;
  border-left: 3px solid #c8a242;
  background: var(--shop-bg);
  border-radius: 0 8px 8px 0;
  font-size: 12px;
}

.store-subscription-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 26px;
  border-top: 1px solid var(--shop-line);
}

.store-subscription-controls h3 {
  font-size: 14px;
  margin: 0 0 6px;
}

.store-subscription-controls p {
  font-size: 11px;
  color: var(--shop-muted);
  line-height: 1.7;
  margin: 0;
  max-width: 400px;
}

.store-subscription-actions {
  margin: 0;
  justify-content: flex-end;
  flex: none;
}

#store-subscription-feedback {
  margin: 0 26px 18px;
  padding: 10px 13px;
  background: var(--shop-bg);
  border-radius: 10px;
  font-size: 12px;
}

/* FAQ优化 */
body.ios-store .store-faq {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  padding-top: 32px;
  margin-top: 36px;
  border-top: 1px solid var(--shop-line);
}

.store-faq-intro h2 {
  font-size: 22px;
  letter-spacing: -0.6px;
  margin: 8px 0 10px;
}

.store-faq-intro p {
  font-size: 12px;
  line-height: 1.7;
  margin: 0 0 16px;
}

.store-faq-intro a {
  display: inline-block;
  font-size: 12px;
  min-height: 40px;
  line-height: 40px;
  color: var(--shop-accent);
}

.store-faq-items {
  border: 1px solid var(--shop-line);
  border-radius: 14px;
  background: var(--shop-card);
  overflow: hidden;
}

.store-faq-items details {
  padding: 0;
  border-bottom: 1px solid var(--shop-line);
}

.store-faq-items details:last-child {
  border-bottom: 0;
}

.store-faq-items summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  list-style: none;
  font-size: 13px;
  min-height: 40px;
}

.store-faq-items summary small {
  display: block;
  font-size: 9px;
  color: var(--shop-muted);
  font-weight: 450;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.store-faq-answer {
  padding: 0 18px 16px;
}

.store-faq-answer p {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
}

/* Checkout对话框优化 */
#store-product-dialog {
  width: min(660px, calc(100vw - 28px));
  padding: 0;
  background: var(--shop-card);
  border: 1px solid var(--shop-line);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

#store-product-dialog .store-dialog-head {
  padding: 16px 24px;
  border-bottom: 1px solid var(--shop-line);
  background: var(--shop-bg);
}

#store-product-dialog .store-dialog-head h2 {
  font-size: 13px;
  font-weight: 650;
  color: var(--shop-muted);
  margin: 0;
}

.store-checkout-shell {
  padding: 26px;
}

.store-checkout-summary {
  padding: 0 0 20px;
}

.store-checkout-shell h2 {
  font-size: 28px;
  letter-spacing: -0.7px;
  margin: 14px 0 6px;
}

.store-checkout-benefit {
  font-size: 12px;
  color: var(--shop-muted);
  line-height: 1.6;
  margin: 0;
}

.store-checkout-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 18px;
}

.store-checkout-price {
  font-size: 36px;
  letter-spacing: -1.3px;
  font-variant-numeric: tabular-nums;
}

.store-checkout-price-note {
  font-size: 11px;
  color: var(--shop-muted);
}

.store-checkout-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.store-checkout-meta-item {
  display: block;
  padding: 11px 12px;
  border: 1px solid var(--shop-line);
  border-radius: 9px;
  background: var(--shop-bg);
}

.store-checkout-meta-item strong {
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
}

.store-checkout-meta-item small {
  display: block;
  font-size: 10px;
  line-height: 1.5;
  color: var(--shop-muted);
  overflow-wrap: anywhere;
}

.store-checkout-before {
  border-top: 1px solid var(--shop-line);
  padding: 14px 0 4px;
}

.store-checkout-before p {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--shop-muted);
  font-size: 11px;
  line-height: 1.6;
  margin: 5px 0;
}

.store-checkout-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border: 0;
  border-radius: 10px;
  background: #dfaf26;
  color: #231b0b;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

/* 移动端订阅和FAQ响应式 */
@media (max-width: 900px) {
  .store-subscription-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .store-subscription-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .store-subscription-controls p {
    max-width: none;
  }

  body.ios-store .store-faq {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 20px;
  }
}

@media (max-width: 600px) {
  body.ios-store .store-intro {
    padding: 20px 0 16px;
  }

  body.ios-store .store-intro h1 {
    font-size: 25px;
  }

  body.ios-store .store-account {
    margin-bottom: 16px;
  }

  .store-subscription-card {
    padding: 0;
  }

  .store-subscription-top {
    padding: 18px 14px;
    gap: 10px;
  }

  .store-subscription-facts {
    margin: 0 14px;
    padding: 14px 0;
  }

  .store-subscription-note {
    margin: 12px 14px;
    padding: 10px;
    font-size: 11px;
  }

  .store-subscription-controls {
    padding: 16px 14px;
    gap: 12px;
    width: auto;
  }

  .store-subscription-actions {
    width: 100%;
    gap: 8px;
  }

  .store-subscription-actions > * {
    min-width: 0;
    font-size: 11px;
  }

  #store-subscription-feedback {
    margin: 0 14px 14px;
  }

  .store-subscription-top h3 {
    font-size: 26px;
  }

  body.ios-store .store-faq {
    display: block;
    margin-top: 28px;
    padding-top: 22px;
  }

  .store-faq-intro {
    position: relative;
    margin-bottom: 14px;
  }

  .store-faq-intro h2 {
    font-size: 20px;
    margin: 6px 0;
  }

  .store-faq-intro p {
    font-size: 11px;
    margin: 0;
  }

  .store-faq-intro br {
    display: none;
  }

  .store-faq-intro a {
    font-size: 11px;
    line-height: 1.4;
    min-height: 0;
    margin-top: 10px;
  }

  .store-faq-items summary {
    padding: 13px 14px;
    font-size: 12px;
    gap: 12px;
  }

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

  .store-faq-answer p {
    font-size: 11px;
    line-height: 1.8;
  }

  body.ios-store .store-footer {
    margin-top: 22px;
  }

  /* Checkout移动端 */
  #store-product-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
  }

  .store-checkout-shell {
    padding: 18px 14px max(16px, env(safe-area-inset-bottom));
  }

  .store-checkout-shell h2 {
    font-size: 23px;
    line-height: 1.3;
    letter-spacing: -0.4px;
    margin: 10px 0 5px;
  }

  .store-checkout-benefit {
    font-size: 12px;
  }

  .store-checkout-price {
    font-size: 30px;
  }

  .store-checkout-meta {
    gap: 0;
    margin-top: 14px;
    border-top: 1px solid var(--shop-line);
  }

  .store-checkout-meta-item {
    padding: 9px 0;
    border: 0;
    border-bottom: 1px solid var(--shop-line);
    border-radius: 0;
    background: transparent;
  }
}

@media (max-width: 360px) {
  .store-checkout-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .store-checkout-shell h2 {
    font-size: 21px;
  }
}
@keyframes wb-sheet-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
[data-theme=dark] body[data-workbench-screen] { --wb-paper: #191816; --wb-surface: #24221e; --wb-surface-strong: #2b2823; --wb-ink: #f2ede4; --wb-muted: #bcb2a3; --wb-gold-deep: #ebbd67; --line: #ffffff22; }
@media(max-width:780px) {
 body[data-workbench-screen] .page { padding: 12px 16px 100px; }
 body[data-workbench-screen] .workbench-nav { display: none; }
 body[data-workbench-screen] #home-dashboard { gap: 12px; }
 body[data-workbench-screen] .workbench-home-intro { padding-top: 12px; }
 body[data-workbench-screen] .workbench-home-intro h2 { font-size: 30px; }
 body[data-workbench-screen] .workbench-ai-entry-grid { grid-template-columns: 1fr; gap: 12px; }
 body[data-workbench-screen] .workbench-ai-entry { min-height: 124px; padding: 20px; }
 body[data-workbench-screen] #home-dashboard > .home-card { padding: 14px; min-height: 110px; }
 body[data-workbench-screen] .home-fortune-card { grid-column: 1/-1; }
 body[data-workbench-screen] .home-hexagram-card { grid-column: 1/-1; }
 body[data-workbench-screen] .workspace-body { grid-template-columns: 1fr; }
 body[data-workbench-screen] #workspace-sidebar .sidebar-panel { display: block; }
 body[data-workbench-screen] .field-row { grid-template-columns: 1fr; }
 body[data-workbench-screen] :is(.workbench-tools-modal,.workbench-settings-modal,.workbench-ai-modal) { padding: 0; place-items: stretch; background: var(--wb-surface-strong); backdrop-filter: none; }
 body[data-workbench-screen] :is(.workbench-tools-sheet,.workbench-settings-sheet,.workbench-ai-sheet) { width: 100%; height: 100dvh; max-height: 100dvh; padding: max(16px,env(safe-area-inset-top)) 20px max(24px,env(safe-area-inset-bottom)); border: 0; border-radius: 0; }
 body[data-workbench-screen] #workbench-ai-modal { top: var(--ai-visible-top,0px); bottom: auto; height: var(--ai-visible-height,100dvh); }
 body[data-workbench-screen] #workbench-ai-modal .workbench-ai-sheet { height: var(--ai-visible-height,100dvh); max-height: var(--ai-visible-height,100dvh); scroll-padding-block: 96px 24px; }
 body[data-workbench-screen] #workbench-ai-modal[data-compact-viewport] .workbench-ai-sheet-head { position: static; }
 body[data-workbench-screen] .workbench-ai-sheet-head { top: -16px; }
 body[data-workbench-screen] .workbench-tools-group-items { grid-template-columns: 1fr; }
 body[data-workbench-screen] .workbench-tool-row { min-height: 80px; }
 body[data-workbench-screen] .workbench-mobile-nav-item { min-height: 48px; }
 body[data-workbench-screen] .hero-auth-status, body[data-workbench-screen] .hero-link:not(.hero-link-profile):not(.hero-link-login) { display: none; }
}

/* Web workspace: roomy discovery, bounded reading, intrinsic mobile layout. */
body[data-workbench-screen] .page { width: 100%; max-width: 1600px; padding-inline: clamp(16px,3.2vw,56px); }
body[data-workbench-screen] #home-dashboard { max-width: none; gap: clamp(14px,1.5vw,24px); }
body[data-workbench-screen] .workbench-home-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: clamp(12px,1.2vw,20px); }
body[data-workbench-screen] .hero { max-width: none; margin-inline: 0; }
body[data-workbench-screen] .workbench-home-intro h2 { font-size: clamp(28px,3vw,44px); line-height: 1.25; }
body[data-workbench-screen] .workbench-search-launch { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--wb-surface-strong); color: var(--wb-muted); font: inherit; cursor: pointer; }
body[data-workbench-screen] .workbench-search-launch kbd { font: 12px/1.5 ui-monospace,monospace; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; }
body[data-workbench-screen] .workbench-section-heading { grid-column: 1/-1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
body[data-workbench-screen] .workbench-section-heading h3 { margin: 0 0 6px; color: var(--wb-ink); font-size: 20px; }
body[data-workbench-screen] .workbench-section-heading p { margin: 0; color: var(--wb-muted); font-size: 14px; line-height: 1.6; }
body[data-workbench-screen] .workbench-section-heading .ghost-btn { min-height: 44px; padding: 8px 14px; flex-shrink: 0; font: inherit; }
body[data-workbench-screen] .home-tool-shortcuts { padding-block: 12px; gap: 16px; }
body[data-workbench-screen] .home-tool-shortcuts > button { display: grid; align-content: center; gap: 8px; padding: 22px; text-align: left; min-height: 108px; font: inherit; }
body[data-workbench-screen] .home-tool-shortcuts > button strong { font-size: 17px; }
body[data-workbench-screen] .home-tool-shortcuts > button small { font-size: 13px; line-height: 1.6; color: var(--wb-muted); }
body[data-workbench-screen] .workbench-ai-entry { min-height: 190px; padding: clamp(22px,2.5vw,36px); }
body[data-workbench-screen] .workbench-ai-entry strong { font-size: clamp(21px,2vw,28px); }
body[data-workbench-screen] .workbench-ai-entry-ask { background: color-mix(in srgb,var(--wb-gold) 10%,var(--wb-surface-strong)); border-color: color-mix(in srgb,var(--wb-gold) 40%,var(--line)); }
body[data-workbench-screen] :is(button,input,textarea,select) { font-family: inherit; }
body[data-workbench-screen] :is(button,a,input,textarea,select,summary):focus-visible { outline: 3px solid var(--wb-gold-deep); outline-offset: 3px; }
body[data-workbench-screen] .ios-feature-page { max-width: 1080px; }
body[data-workbench-screen] #fortune-form { max-width: 780px; margin-inline: auto; }
body[data-workbench-screen] #tool-page[data-stage=result] { max-width: 1440px; }
body[data-workbench-screen] #workbench-divider { max-width: none; }
body[data-workbench-screen] #daily-content > :is(.daily-reading,.fortune-draw,#calendar-form) { max-width: 780px; margin-inline: auto; }
body[data-workbench-screen] .hexagram-library { grid-template-columns: repeat(auto-fit,minmax(min(100%,300px),1fr)); }
body[data-workbench-screen] :is(.workbench-tools-sheet,.workbench-settings-sheet) { width: min(960px,100%); }
body[data-workbench-screen] #workbench-ai-modal .workbench-ai-sheet { width: min(800px,100%); }
body[data-workbench-screen] #workbench-ai-modal[data-stage=result] .workbench-ai-sheet { width: min(1100px,100%); }
body[data-workbench-screen] .ai-reading-nav { position: sticky; bottom: -26px; z-index: 12; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 max(12px,env(safe-area-inset-bottom)); margin-top: 18px; border-top: 1px solid var(--line); background: var(--wb-surface); }
body[data-workbench-screen] .ai-reading-nav button { flex: 1; min-width: 0; min-height: 44px; padding: 10px 8px; font-size: 14px; }
body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-result,#workbench-ai-waiting,#workbench-ai-transcript summary,#workbench-ai-followup-input) { scroll-margin-top: 150px; scroll-margin-bottom: 90px; }
body[data-workbench-screen] #workbench-ai-transcript-body { display: grid; gap: 24px; padding-top: 16px; }
body[data-workbench-screen] .ai-conversation-turn { min-width: 0; }
body[data-workbench-screen] .ai-conversation-question { margin: 0 0 14px auto; max-width: 85%; padding: 12px 16px; border-radius: 18px 18px 4px 18px; background: color-mix(in srgb,var(--journey-accent) 12%,var(--wb-surface)); color: var(--wb-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
body[data-workbench-screen] .ai-conversation-question > span { display: block; color: var(--wb-muted); font-size: 12px; margin-bottom: 8px; }
body[data-workbench-screen] .ai-conversation-answer { padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--wb-surface-strong); }
body[data-workbench-screen] .ai-conversation-answer > summary { min-height: 44px; align-content: center; color: var(--journey-accent); cursor: pointer; font-weight: 650; }
body[data-workbench-screen] .ai-conversation-answer .markdown-render { max-width: 72ch; margin-inline: auto; font-size: 16px; line-height: 1.9; overflow-wrap: anywhere; }
body[data-workbench-screen] .ai-conversation-answer :is(pre,table) { display: block; max-width: 100%; overflow-x: auto; }
body[data-workbench-screen] .ai-conversation-answer img { max-width: 100%; height: auto; }
body[data-workbench-screen] .workbench-report-layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 24px; align-items: start; }
body[data-workbench-screen] .workbench-report-index { min-width: 0; border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: var(--wb-surface); }
body[data-workbench-screen] .workbench-report-index summary { cursor: pointer; min-height: 44px; align-content: center; font-weight: 700; }
body[data-workbench-screen] #workbench-report-links { display: grid; gap: 4px; }
body[data-workbench-screen] #workbench-report-links button { background: none; border: 0; border-radius: 8px; padding: 10px; color: var(--wb-muted); font: inherit; font-size: 14px; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
body[data-workbench-screen] #workbench-report-links button:hover { color: var(--wb-ink); background: var(--accent-soft); }
body[data-workbench-screen] #workbench-ai-result-body { width: 100%; max-width: 72ch; min-width: 0; margin-inline: auto; }
body[data-workbench-screen] #workbench-ai-result-body :is(h1,h2,h3) { scroll-margin-top: 112px; }
body[data-workbench-screen] #workbench-ai-result-body :is(pre,table) { max-width: 100%; overflow-x: auto; }
body[data-workbench-screen] #workbench-ai-result-body table { display: block; }
body[data-workbench-screen] #workbench-ai-result-body img { max-width: 100%; height: auto; }
body[data-workbench-screen] :is(.workbench-ai-sheet,.workbench-settings-sheet,.workbench-tools-sheet) { scrollbar-gutter: stable; }
body[data-workbench-screen] .workbench-ai-actions { flex-wrap: wrap; }
body[data-workbench-screen] .workbench-ai-sheet-head { top: -26px; }
@media(hover:hover) and (pointer:fine) {
 body[data-workbench-screen] :is(.home-tool-shortcuts > button,.workbench-search-launch,.workbench-ai-entry,.home-card):hover { border-color: var(--wb-gold); box-shadow: 0 8px 24px #302b2310; }
}
@media(min-width:1100px) {
 body[data-workbench-screen] #home-dashboard { grid-template-columns: repeat(3,minmax(0,1fr)); }
 body[data-workbench-screen] .workbench-ai-entry-grid { grid-template-columns: 1.2fr 1fr; }
 body[data-workbench-screen] .home-tool-shortcuts { grid-template-columns: repeat(3,minmax(0,1fr)); }
 body[data-workbench-screen] .workbench-report-layout:has(.workbench-report-index:not([hidden])) { grid-template-columns: 210px minmax(0,1fr); }
 body[data-workbench-screen] .workbench-report-index { position: sticky; top: 94px; max-height: calc(100dvh - 220px); overflow: auto; }
}
@media(min-width:781px) {
 body[data-workbench-screen] .workbench-nav { position: sticky; top: 12px; z-index: 60; background: var(--wb-surface-strong); flex-wrap: wrap; }
 body[data-workbench-screen] .ios-feature-header { scroll-margin-top: 96px; }
}
@media(min-width:1280px) {
 body[data-workbench-screen] .home-tool-shortcuts { grid-template-columns: repeat(6,minmax(0,1fr)); }
 body[data-workbench-screen] .home-tool-shortcuts > button { padding: 18px; }
}
@media(max-width:1099px) {
 body[data-workbench-screen] .workbench-home-intro { flex-wrap: wrap; }
 body[data-workbench-screen] .workbench-search-launch { width: 100%; }
 body[data-workbench-screen] .workbench-search-launch kbd { margin-left: auto; }
}
@media(max-width:780px) {
 body[data-workbench-screen] .page { padding-left: max(16px,env(safe-area-inset-left)); padding-right: max(16px,env(safe-area-inset-right)); padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
 body[data-workbench-screen] .ai-reading-nav { bottom: calc(-1 * max(24px,env(safe-area-inset-bottom))); }
 body[data-workbench-screen] #workbench-ai-modal[data-compact-viewport] :is(#workbench-ai-result,#workbench-ai-waiting,#workbench-ai-transcript summary,#workbench-ai-followup-input) { scroll-margin-top: 12px; }
 body[data-workbench-screen] .workbench-home-intro { gap: 20px; padding-block: 12px; }
 body[data-workbench-screen] .workbench-ai-entry { min-height: 134px; padding: 22px 18px; }
 body[data-workbench-screen] .home-tool-shortcuts { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
 body[data-workbench-screen] .home-tool-shortcuts > button { min-height: 104px; padding: 16px; }
 body[data-workbench-screen] .workbench-section-heading { align-items: flex-start; }
 body[data-workbench-screen] .workbench-section-heading h3 { font-size: 18px; }
 body[data-workbench-screen] .workbench-section-heading p { font-size: 13px; }
 body[data-workbench-screen] :is(.workbench-tools-sheet,.workbench-settings-sheet,.workbench-ai-sheet) { padding: max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); scrollbar-gutter: auto; }
 body[data-workbench-screen] .workbench-ai-sheet-head { top: calc(-1 * max(16px,env(safe-area-inset-top))); }
 body[data-workbench-screen] :is(input,textarea,select) { min-width: 0; max-width: 100%; font-size: 16px; }
 body[data-workbench-screen] .workbench-mobile-nav { left: max(8px,env(safe-area-inset-left)); right: max(8px,env(safe-area-inset-right)); }
 body[data-workbench-screen] .hero-actions { gap: 6px; flex-wrap: wrap; }
 body[data-workbench-screen] .app-brand-lockup { gap: 10px; }
 body[data-workbench-screen] .app-brand-logo { width: 40px; height: 40px; }
 body[data-workbench-screen] .hero-subtitle { display: none; }
 body[data-workbench-screen] .workbench-dream-detail-grid { grid-template-columns: 1fr; }
}
@media(max-width:380px) {
 body[data-workbench-screen] #home-dashboard { grid-template-columns: minmax(0,1fr); }
 body[data-workbench-screen] .casting-lines li { grid-template-columns: 48px minmax(0,1fr) 85px; gap: 8px; }
 body[data-workbench-screen] .casting-coins { gap: 12px; }
 body[data-workbench-screen] .casting-coins span { width: 52px; height: 52px; }
 body[data-workbench-screen] .workbench-ai-entry { grid-template-columns: 36px minmax(0,1fr) 16px; gap: 12px; }
 body[data-workbench-screen] .workbench-entry-mark { width: 36px; height: 36px; }
}
@media(pointer:coarse) { body[data-workbench-screen] .workbench-search-launch kbd { display: none; } }
html[data-theme=dark] body[data-workbench-screen] :is(.home-card,.workbench-section-heading .ghost-btn,.workbench-nav-item,.hero-theme-btn) { background: #2b2823; color: #f2ede4; border-color: #ffffff22; }
html[data-theme=dark] body[data-workbench-screen] #home-dashboard > .home-card { background: #2b2823; }
body[data-workbench-screen] .ai-restart-dialog { width: min(440px,calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--wb-surface-strong); color: var(--wb-ink); box-shadow: 0 20px 64px #0003; overflow: auto; overscroll-behavior: contain; }
body[data-workbench-screen] .ai-restart-dialog::backdrop { background: #0008; }
body[data-workbench-screen] .ai-restart-dialog h2 { margin: 0 0 14px; font-size: 22px; line-height: 1.4; }
body[data-workbench-screen] .ai-restart-dialog p { line-height: 1.8; overflow-wrap: anywhere; }
body[data-workbench-screen] .ai-restart-actions { display: grid; gap: 10px; margin-top: 20px; }
body[data-workbench-screen] .ai-restart-actions button { width: 100%; min-height: 44px; white-space: normal; }
body[data-workbench-screen] .ai-restart-dialog [hidden] { display: none !important; }
html[data-theme=dark] body[data-workbench-screen] .workbench-nav-item.is-active { background: #4b3b1e; color: #ebbd67; }
html[data-theme=dark] body[data-workbench-screen] .home-card :is(.home-divination-title,.home-hexagram-name,.home-hexagram-symbol) { color: #f2ede4; }
html[data-theme=dark] body[data-workbench-screen] .home-card :is(.home-divination-label,.home-hexagram-brief,.home-calendar-stack div) { color: #bcb2a3; }

/* Reading hierarchy: question and answer first; supporting data stays quiet. */
body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-question,#workbench-ai-transcript,#workbench-ai-basis,#workbench-ai-billing,#workbench-ai-history-actions,#workbench-ai-followup) { background: none; border: 0; border-radius: 0; padding: 16px 0; margin-top: 8px; }
body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-basis,#workbench-ai-billing,#workbench-ai-history-actions,#workbench-ai-followup) { border-top: 1px solid var(--line); margin-top: 20px; }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-question-label { font-size: 12px; line-height: 1.5; color: var(--wb-muted); font-weight: 500; margin: 0 0 6px; }
body[data-workbench-screen] #workbench-ai-question-text { font-size: 19px; font-weight: 650; line-height: 1.6; color: var(--wb-ink); margin: 0; }
body[data-workbench-screen] #workbench-ai-modal .ai-report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-answer { border: 0; background: none; border-radius: 0; padding: 0; }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-basis summary { min-height: 44px; font-size: 14px; color: var(--wb-muted); }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-billing { font-size: 13px; color: var(--wb-muted); }

/* History is a full reading page, not the old height-limited sidebar. */
body[data-workbench-screen=history] #workbench-divider { display: none; }
body[data-workbench-screen] #history-page { max-width: 1000px; }
body[data-workbench-screen] #history-page .ios-feature-header { align-items: baseline; gap: 12px; padding: 12px 0 20px; }
body[data-workbench-screen] #history-page .ios-feature-header h2 { margin: 0; }
body[data-workbench-screen] #history-page .history-content { min-width: 0; }
body[data-workbench-screen] #history-page .history-toolbar { display: grid; grid-template-columns: minmax(0,1fr) minmax(140px,180px) auto; gap: 10px; margin-bottom: 12px; }
body[data-workbench-screen] #history-page .history-toolbar :is(input,select,button) { min-width: 0; min-height: 44px; font-size: 15px; }
body[data-workbench-screen] #history-page #clear-history { background: none; box-shadow: none; color: var(--wb-muted); border-color: transparent; }
body[data-workbench-screen] #history-page #history-list { display: block; max-height: none; height: auto; overflow: visible; }
body[data-workbench-screen] #history-page .history-summary-strip { align-items: center; gap: 8px; margin-bottom: 8px; }
body[data-workbench-screen] #history-page .history-summary-pill { background: none; border-radius: 0; padding: 0; font-size: 12px; overflow-wrap: anywhere; }
body[data-workbench-screen] #history-page button.history-summary-pill { min-height: 44px; padding: 8px; }
body[data-workbench-screen] #history-page .history-date-heading { margin: 12px 0 0; padding: 14px 0; font-size: 14px; color: var(--wb-muted); }
body[data-workbench-screen] #history-page .workbench-history-record { display: grid; grid-template-columns: minmax(0,1fr) 48px; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
body[data-workbench-screen] #history-page .history-item { min-width: 0; background: none; border: 0; border-radius: 8px; box-shadow: none; padding: 16px 4px; color: var(--wb-ink); transform: none; animation: none; }
body[data-workbench-screen] #history-page .history-item:hover { background: var(--wb-surface); }
body[data-workbench-screen] #history-page .history-item strong { font-size: 17px; line-height: 1.5; margin: 6px 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
body[data-workbench-screen] #history-page .history-record-summary { font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
body[data-workbench-screen] #history-page .history-meta { flex-wrap: wrap; align-items: center; gap: 4px 12px; }
body[data-workbench-screen] #history-page .history-meta-tags { margin: 0; gap: 8px; }
body[data-workbench-screen] #history-page .history-label { background: none; padding: 0; border: 0; font-size: 12px; color: var(--wb-muted); font-weight: 500; }
body[data-workbench-screen] #history-page .history-meta .helper { font-size: 12px; white-space: nowrap; }
body[data-workbench-screen] #history-page .workbench-history-delete { min-height: 44px; width: 48px; padding: 8px 0; margin: 0; font-size: 12px; color: var(--wb-muted); border: 0; background: none; box-shadow: none; }
body[data-workbench-screen] #history-page .workbench-history-delete:hover { color: var(--warn); }
body[data-workbench-screen] #history-page .history-load-more { min-height: 44px; margin-top: 20px; border-style: solid; }
body[data-workbench-screen] #workbench-history-modal .workbench-settings-sheet { width: min(900px,100%); }
body[data-workbench-screen] #workbench-history-modal .workbench-ai-sheet-head { padding-bottom: 14px; margin-bottom: 8px; }
body[data-workbench-screen] #workbench-history-title { font-size: 17px; }
body[data-workbench-screen] #workbench-history-detail { max-width: 72ch; margin-inline: auto; }
body[data-workbench-screen] #workbench-history-detail .history-reading-header h3 { margin: 6px 0 12px; font-size: clamp(21px,2.3vw,28px); line-height: 1.5; color: var(--wb-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
body[data-workbench-screen] #workbench-history-detail .history-reading-meta { font-size: 12px; color: var(--wb-muted); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-workbench-screen] #workbench-history-detail :is(.history-primary-actions,.history-detail-actions) { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 20px; }
body[data-workbench-screen] #workbench-history-detail .history-primary-actions:empty { display: none; }
body[data-workbench-screen] #workbench-history-detail .history-primary-actions button { width: auto; min-height: 44px; padding: 10px 16px; font-size: 14px; border-radius: 12px; box-shadow: none; }
body[data-workbench-screen] #workbench-history-detail :is(.history-conversation,.history-snapshot) > h4 { margin: 20px 0 8px; font-size: 13px; font-weight: 500; color: var(--wb-muted); }
body[data-workbench-screen] #workbench-history-detail .history-chat-message { background: none; border: 0; border-radius: 0; padding: 0; margin: 16px 0 26px; }
body[data-workbench-screen] #workbench-history-detail .history-chat-message > strong { display: block; margin-bottom: 10px; color: var(--wb-muted); font-size: 12px; font-weight: 500; }
body[data-workbench-screen] #workbench-history-detail .history-chat-message.is-user { padding-top: 18px; border-top: 1px solid var(--line); }
body[data-workbench-screen] #workbench-history-detail .history-chat-message.is-user p { font-size: 18px; font-weight: 650; color: var(--wb-ink); }
body[data-workbench-screen] #workbench-history-detail .markdown-render { color: var(--wb-ink); font-size: 16px; line-height: 1.85; min-width: 0; }
body[data-workbench-screen] #workbench-history-detail .markdown-render :is(h1,h2) { font-size: 21px; line-height: 1.5; margin: 22px 0 10px; }
body[data-workbench-screen] #workbench-history-detail .markdown-render h3 { font-size: 18px; line-height: 1.5; }
body[data-workbench-screen] #workbench-history-detail .markdown-render :is(pre,table) { max-width: 100%; overflow-x: auto; }
body[data-workbench-screen] #workbench-history-detail .markdown-render pre { white-space: pre-wrap; overflow-wrap: anywhere; }
body[data-workbench-screen] #workbench-history-detail .history-reference { border-top: 1px solid var(--line); margin-top: 24px; }
body[data-workbench-screen] #workbench-history-detail .history-reference summary { min-height: 44px; padding: 14px 0; cursor: pointer; font-size: 14px; color: var(--wb-muted); }
body[data-workbench-screen] #workbench-history-detail .history-reference dl { margin: 0; }
body[data-workbench-screen] #workbench-history-detail .history-reference dl > div { margin: 0 0 16px; }
body[data-workbench-screen] #workbench-history-detail .history-reference dt { color: var(--wb-muted); font-size: 12px; margin-bottom: 6px; }
body[data-workbench-screen] #workbench-history-detail .history-reference dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
body[data-workbench-screen] #workbench-history-detail .history-reading-footnote { font-size: 12px; color: var(--wb-muted); margin-top: 24px; }
@media(max-width:780px) {
 body[data-workbench-screen] #history-page .history-toolbar { grid-template-columns: minmax(0,1fr) auto; }
 body[data-workbench-screen] #history-page #history-search { grid-column: 1 / -1; font-size: 16px; }
 body[data-workbench-screen] #history-page .ios-feature-header { gap: 6px; padding-top: 8px; }
 body[data-workbench-screen] #history-page .ios-feature-header p { font-size: 13px; }
 body[data-workbench-screen] #workbench-history-modal .workbench-settings-sheet { width: 100%; }
}

/* Professional tools: compact native grouping with a single primary action. */
body[data-workbench-screen=chart] #workbench-divider { display: none; }
body[data-workbench-screen=chart] #tool-page[data-stage=input] { max-width: 780px; }
body[data-workbench-screen=chart] #tool-page .ios-feature-header { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 14px; padding: 12px 0 18px; }
body[data-workbench-screen=chart] #tool-page .ios-feature-header h2 { font-size: 24px; margin-bottom: 3px; }
body[data-workbench-screen=chart] #tool-page .tool-back { min-height: 44px; padding: 8px 12px; border-radius: 12px; }
body[data-workbench-screen=chart] #fortune-form .ios-input-group { padding: 16px; border-radius: 18px; margin-bottom: 12px; }
body[data-workbench-screen=chart] #fortune-form .ios-input-group h3 { margin: 0 0 14px; font-size: 14px; }
body[data-workbench-screen=chart] #fortune-form .fields { margin-top: 0; gap: 14px; }
body[data-workbench-screen=chart] #fortune-form .field { min-width: 0; gap: 6px; align-content: start; }
body[data-workbench-screen=chart] #fortune-form .field-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; align-items: start; }
body[data-workbench-screen=chart] #fortune-form :is(input,select,textarea) { min-width: 0; max-width: 100%; min-height: 44px; padding: 10px; border-radius: 11px; font-size: 16px; }
body[data-workbench-screen=chart] #fortune-form textarea { min-height: 78px; }
body[data-workbench-screen=chart] #fortune-form .field small { font-size: 12px; line-height: 1.55; color: var(--wb-muted); }
body[data-workbench-screen=chart] #fortune-form .tool-choice-row .field small { display: none; }
body[data-workbench-screen=chart] #fortune-form .tool-time-row { grid-template-columns: minmax(100px,.8fr) minmax(0,1.2fr); }
body[data-workbench-screen=chart] #fortune-form .advanced { padding-block: 0; }
body[data-workbench-screen=chart] #fortune-form .advanced > summary { min-height: 52px; padding-block: 15px; font-size: 14px; }
body[data-workbench-screen=chart] #fortune-form .advanced[open] { padding-bottom: 16px; }
body[data-workbench-screen=chart] #fortune-form .advanced[open] > summary { margin-bottom: 4px; }
body[data-workbench-screen=chart] .tool-settings-hint { font-size: 12px; color: var(--wb-muted); font-weight: 400; margin-left: 8px; }
body[data-workbench-screen=chart] #fortune-form .timezone-quick-picks { display: flex; flex-wrap: wrap; gap: 6px; }
body[data-workbench-screen=chart] #fortune-form .timezone-quick-pick { min-height: 44px; }
body[data-workbench-screen=chart] #fortune-form .ios-submit { gap: 8px; padding-bottom: 16px; }
body[data-workbench-screen=chart] #fortune-form .submit-btn { min-height: 48px; border-radius: 14px; box-shadow: none; }
body[data-workbench-screen=chart] #fortune-form #status:empty { display: none; }
body[data-workbench-screen=chart] #liuyao-casting > p { font-size: 13px; line-height: 1.6; margin: 8px 0; }
body[data-workbench-screen=chart] #liuyao-casting .casting-coins { padding: 12px 0; }
body[data-workbench-screen=chart] #liuyao-casting .ios-feature-actions { margin: 12px 0 8px; display: grid; grid-template-columns: minmax(0,1fr) auto; }
body[data-workbench-screen=chart] #casting-toss { background: var(--wb-gold); color: #fff; font-weight: 700; border-color: transparent; }
body[data-workbench-screen=chart] #casting-toss:disabled { opacity: .55; }
body[data-workbench-screen=chart] .tool-result-actions { display: flex; gap: 8px; margin-bottom: 12px; }
body[data-workbench-screen=chart] .tool-result-actions #result-timestamp { margin-right: auto; font-size: 12px; }
body[data-workbench-screen=chart] .tool-export { margin-left: auto; }
body[data-workbench-screen=chart] .tool-export > summary { cursor: pointer; min-height: 44px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 13px; }
body[data-workbench-screen=chart] .tool-export[open] { flex-basis: 100%; }
body[data-workbench-screen=chart] .tool-export > div { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
body[data-workbench-screen=chart] #tool-result #result-tabs { margin-bottom: 14px; }
@media(min-width:1000px) {
 body[data-workbench-screen=chart] #tool-page[data-tool=liuyao][data-stage=input] { max-width: 1000px; }
 body[data-workbench-screen=chart] #tool-page[data-tool=liuyao] #fortune-form { max-width: none; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 20px; align-items: start; }
 body[data-workbench-screen=chart] #tool-page[data-tool=liuyao] .tool-basic { grid-column: 1; grid-row: 1; }
 body[data-workbench-screen=chart] #tool-page[data-tool=liuyao] #liuyao-casting { grid-column: 2; grid-row: 1 / span 3; }
 body[data-workbench-screen=chart] #tool-page[data-tool=liuyao] .advanced { grid-column: 1; grid-row: 2; }
 body[data-workbench-screen=chart] #tool-page[data-tool=liuyao] .ios-submit { grid-column: 1; grid-row: 3; }
}
@media(max-width:540px) {
 body[data-workbench-screen=chart] #tool-page .ios-feature-header { gap: 10px; padding: 8px 0 14px; }
 body[data-workbench-screen=chart] #tool-page .ios-feature-header h2 { font-size: 22px; }
 body[data-workbench-screen=chart] #tool-page .ios-feature-header p { font-size: 12px; }
 body[data-workbench-screen=chart] #tool-page .tool-back { font-size: 13px; padding-inline: 10px; }
 body[data-workbench-screen=chart] #fortune-form .ios-input-group { padding-inline: 14px; }
 body[data-workbench-screen=chart] #tool-page[data-tool=fengshui] .tool-basic .field-row { grid-template-columns: minmax(0,1.6fr) minmax(76px,.7fr); }
 body[data-workbench-screen=chart] #tool-result .tool-result-actions { gap: 6px; }
}
/* Keep continuation available while reading, as in the native conversation inset. */
@media(max-height:540px) {
 body[data-workbench-screen] #workbench-ai-modal .workbench-ai-sheet-head { position: static; }
 body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-result,#workbench-ai-waiting,#workbench-ai-transcript summary,#workbench-ai-result-body :is(h1,h2,h3)) { scroll-margin-top: 12px; }
}
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock { position: sticky; bottom: -26px; z-index: 12; margin-top: 20px; padding: 10px 0 max(10px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--wb-surface-strong); }
body[data-workbench-screen] #workbench-ai-modal[data-stage=input] .ai-conversation-dock { display: none; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock #workbench-ai-followup { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 12px; margin: 0; padding: 0; border: 0; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock .workbench-ai-field { margin: 0; gap: 2px; }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-followup-input { min-height: 48px; height: 48px; max-height: 100px; padding: 10px 12px; resize: vertical; font-size: 16px; line-height: 1.5; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock .inline-actions { margin: 0; align-self: start; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock #workbench-ai-followup-note { grid-column: 1 / -1; font-size: 12px; max-height: 3.4em; overflow: auto; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock #workbench-ai-followup-note:empty { display: none; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock .ai-reading-nav { position: static; margin: 4px 0 0; padding: 0; border: 0; background: none; }
body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-result,#workbench-ai-waiting,#workbench-ai-transcript summary) { scroll-margin-bottom: 210px; }
@media(max-width:780px) {
 body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock { bottom: calc(-1 * max(24px,env(safe-area-inset-bottom))); }
 body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock #workbench-ai-followup { gap: 4px 8px; }
 body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock .inline-actions { max-width: 144px; }
 body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock .inline-actions button { width: 100%; padding: 10px 8px; font-size: 13px; }
}

/* AI journey pass 154: make waiting and completion states match the native journey. */
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-branches[hidden]{display:none!important}
body[data-workbench-screen] .ai-journey-waiting-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;text-align:left}
body[data-workbench-screen] .ai-journey-waiting-head h3{margin:0 0 6px}
body[data-workbench-screen] .ai-journey-waiting-head p{margin:0;color:var(--wb-muted);font-size:13px;font-variant-numeric:tabular-nums}
body[data-workbench-screen] #workbench-ai-progress-percent{color:var(--journey-accent);font-size:14px;font-variant-numeric:tabular-nums;padding-top:4px}
body[data-workbench-screen] .ai-journey-progress{height:8px;margin:18px 0 4px;border-radius:999px;background:color-mix(in srgb,var(--journey-accent) 14%,var(--wb-surface));overflow:hidden}
body[data-workbench-screen] .ai-journey-progress span{display:block;width:8%;height:100%;border-radius:inherit;background:linear-gradient(90deg,color-mix(in srgb,var(--journey-accent) 60%,white),var(--journey-accent));transition:width .35s ease}
body[data-workbench-screen] .ai-journey-milestones li{gap:14px;align-items:flex-start;padding:12px 0;min-height:58px}
body[data-workbench-screen] .ai-journey-milestones .ai-milestone-copy{display:grid;gap:3px;min-width:0;text-align:left}
body[data-workbench-screen] .ai-journey-milestones .ai-milestone-copy strong{font-size:14px;color:inherit}
body[data-workbench-screen] .ai-journey-milestones .ai-milestone-copy small{font-size:12px;line-height:1.5;color:var(--wb-muted);font-weight:400}
body[data-workbench-screen] .ai-journey-milestones .ai-milestone-state{flex:0 0 auto;color:var(--wb-muted);font-size:12px;white-space:nowrap;padding-top:2px}
body[data-workbench-screen] .ai-journey-milestones .is-active .ai-milestone-state{color:var(--journey-accent)}
body[data-workbench-screen] .ai-journey-milestones .is-done .ai-milestone-state{color:var(--good,#4a9)}
body[data-workbench-screen] .ai-journey-complete{display:flex;align-items:center;gap:12px;margin:24px 0 8px;padding:14px 16px;border:1px solid color-mix(in srgb,var(--journey-accent) 34%,var(--line));border-radius:16px;background:color-mix(in srgb,var(--journey-accent) 8%,var(--wb-surface));color:var(--wb-ink)}
body[data-workbench-screen] .ai-journey-complete-mark{width:24px;height:24px;flex:0 0 24px;border:2px solid var(--journey-accent);border-radius:50%;position:relative}
body[data-workbench-screen] .ai-journey-complete-mark:after{content:'';position:absolute;width:9px;height:5px;left:5px;top:6px;border-left:2px solid var(--journey-accent);border-bottom:2px solid var(--journey-accent);transform:rotate(-45deg)}
body[data-workbench-screen] .ai-journey-complete strong{font-size:16px}
body[data-workbench-screen] .ai-journey-complete p{margin:3px 0 0;color:var(--wb-muted);font-size:12px}
body[data-workbench-screen] #workbench-ai-modal[data-stage=result] #workbench-ai-compose,
body[data-workbench-screen] #workbench-ai-modal[data-stage=waiting] #workbench-ai-compose{display:none!important}
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-followup{display:grid;gap:10px}
body[data-workbench-screen] #workbench-ai-modal .ai-followup-heading h3{margin:0;font-size:16px;color:var(--wb-ink)}
body[data-workbench-screen] #workbench-ai-modal .ai-followup-heading p{margin:3px 0 0;color:var(--wb-muted);font-size:12px;line-height:1.6}
@media(max-width:540px){
 body[data-workbench-screen] .ai-journey-waiting{padding:22px 16px}
 body[data-workbench-screen] .ai-journey-milestones li{gap:8px}
 body[data-workbench-screen] .ai-journey-milestones .ai-milestone-copy small{font-size:11px}
 body[data-workbench-screen] .ai-journey-milestones .ai-milestone-state{font-size:11px}
}
@media(prefers-reduced-motion:reduce){body[data-workbench-screen] .ai-journey-progress span{transition:none}}

/* Responsive journey pass 155: preserve reading space and keep the composer usable. */
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock #workbench-ai-followup { grid-template-areas: "heading heading" "input actions" "note note"; }
body[data-workbench-screen] #workbench-ai-modal .ai-followup-heading { grid-area: heading; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
body[data-workbench-screen] #workbench-ai-modal .ai-followup-heading p { margin: 0; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock .workbench-ai-field { grid-area: input; min-width: 0; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock .inline-actions { grid-area: actions; }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-followup-note { grid-area: note; }
body[data-workbench-screen] #workbench-ai-modal .ai-journey-complete { margin: 12px 0; padding: 10px 0; border: 0; border-radius: 0; background: none; }
body[data-workbench-screen] #workbench-ai-modal .ai-journey-complete strong { font-size: 14px; }
body[data-workbench-screen] #workbench-ai-modal .workbench-ai-result-head { margin: 12px 0; }
body[data-workbench-screen] #workbench-ai-modal .workbench-report-index { padding: 4px 12px; border-radius: 10px; }
body[data-workbench-screen] #workbench-ai-progress-percent { flex-shrink: 0; white-space: nowrap; font-size: 12px; }
body[data-workbench-screen] #workbench-ai-server-status { min-height: 0; margin-block: 12px; }
body[data-workbench-screen] .ai-journey-waiting-head h3 { text-wrap: balance; }
@media(min-width:1100px) {
 body[data-workbench-screen] #workbench-ai-modal .ai-journey-milestones { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 24px; }
 body[data-workbench-screen] #workbench-ai-modal .ai-journey-waiting { padding: 24px 28px; }
 body[data-workbench-screen] #workbench-ai-modal .ai-journey-loader { margin-bottom: 20px; }
}
@media(max-width:780px) {
 body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock #workbench-ai-followup { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "input input" "heading actions" "note note"; }
 body[data-workbench-screen] #workbench-ai-modal .ai-followup-heading { align-self: center; }
 body[data-workbench-screen] #workbench-ai-modal .ai-followup-heading h3 { font-size: 13px; }
 body[data-workbench-screen] #workbench-ai-modal .ai-followup-heading p { display: none; }
 body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock .inline-actions { max-width: none; }
 body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock .inline-actions button { min-height: 44px; }
 body[data-workbench-screen] #workbench-ai-modal .ai-reading-nav [data-ai-reading=followup] { display: none; }
 body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock .ai-reading-nav { margin-top: 4px; }
 body[data-workbench-screen] #workbench-ai-modal .ai-journey-waiting { padding: 16px; border-radius: 16px; }
 body[data-workbench-screen] #workbench-ai-modal .ai-journey-loader { margin: 0 auto 16px; width: 52px; height: 54px; }
 body[data-workbench-screen] #workbench-ai-modal[data-mode=dream] .ai-journey-loader { width: 54px; height: 54px; }
 body[data-workbench-screen] #workbench-ai-modal[data-mode=dream] .ai-journey-loader:after { width: 44px; height: 48px; top: -6px; right: -10px; }
 body[data-workbench-screen] #workbench-ai-modal .ai-journey-waiting-head h3 { font-size: 18px; margin: 0 0 4px; }
 body[data-workbench-screen] #workbench-ai-modal .ai-journey-milestones { margin: 14px 0; }
 body[data-workbench-screen] #workbench-ai-modal .ai-journey-milestones li { min-height: 0; padding: 9px 0; }
 body[data-workbench-screen] #workbench-ai-modal .ai-journey-milestones .ai-milestone-copy small { font-size: 12px; }
 body[data-workbench-screen] #workbench-ai-modal .ai-wait-question { padding: 10px 0; border: 0; border-radius: 0; background: none; }
 body[data-workbench-screen] #workbench-ai-modal .workbench-report-layout { gap: 12px; }
 body[data-workbench-screen] #workbench-ai-modal .workbench-ai-result-head > strong { font-size: 16px; }
 body[data-workbench-screen] #workbench-ai-modal #workbench-ai-result-body > :first-child { margin-top: 8px; }
}
@media(max-height:540px) {
 body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock { position: static; }
 body[data-workbench-screen] #workbench-ai-modal .workbench-ai-sheet-head { position: static; }
}

/* Journey pass 156: visible completion anchor and explicit estimated stages. */
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-complete { scroll-margin-block: 112px 0; }
body[data-workbench-screen] #workbench-ai-modal .ai-journey-estimate-note { margin: 8px 0; color: var(--wb-muted); font-size: 12px; line-height: 1.5; }
@media(max-width:780px) {
 body[data-workbench-screen] #workbench-ai-modal #workbench-ai-complete { scroll-margin-top: 16px; }
}
@media(max-height:540px) {
 body[data-workbench-screen] #workbench-ai-modal #workbench-ai-complete { scroll-margin-top: 12px; }
}

/* Journey pass 157: direct question and compact, opt-in chapter navigation. */
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-question { padding: 10px 0 6px; margin-top: 4px; scroll-margin-top: 112px; }
@media(max-width:1099px) {
 body[data-workbench-screen] #workbench-ai-modal .workbench-report-index { padding: 0; border: 0; border-radius: 0; background: none; }
 body[data-workbench-screen] #workbench-ai-modal .workbench-report-index summary { min-height: 44px; width: fit-content; max-width: 100%; padding-inline: 2px 12px; font-size: 13px; font-weight: 500; color: var(--wb-muted); }
 body[data-workbench-screen] #workbench-ai-modal .workbench-report-layout { gap: 4px; }
 body[data-workbench-screen] #workbench-ai-modal #workbench-report-links { border-inline-start: 1px solid var(--line); margin-bottom: 12px; padding-inline-start: 6px; }
 body[data-workbench-screen] #workbench-ai-modal #workbench-report-links button { min-height: 44px; }
}
@media(max-width:780px) {
 body[data-workbench-screen] #workbench-ai-modal[data-stage=result] .workbench-ai-sheet-head { margin-bottom: 4px; padding-bottom: 10px; }
 body[data-workbench-screen] #workbench-ai-modal #workbench-ai-question { padding: 8px 0 4px; margin-top: 0; scroll-margin-top: 104px; }
 body[data-workbench-screen] #workbench-ai-modal #workbench-ai-question-text { font-size: 18px; line-height: 1.55; }
 body[data-workbench-screen] #workbench-ai-modal .workbench-ai-result-head { margin: 6px 0 0; }
 body[data-workbench-screen] #workbench-ai-modal .ai-journey-complete { margin: 6px 0; padding: 6px 0; }
}
@media(max-height:540px) {
 body[data-workbench-screen] #workbench-ai-modal #workbench-ai-question { scroll-margin-top: 12px; }
}

/* Journey pass 158: iOS gold / dream violet report hierarchy and primary restart action. */
body[data-workbench-screen] #workbench-ai-modal {
 --ai-report-title: #996000; --ai-report-emphasis: #9d6500;
 --ai-report-action: #f7b500; --ai-report-action-ink: #30230b;
}
html[data-theme=dark] body[data-workbench-screen] #workbench-ai-modal {
 --ai-report-title: #f7b500; --ai-report-emphasis: #fbb050;
}
body[data-workbench-screen] #workbench-ai-modal[data-mode=dream] {
 --ai-report-title: #6f53c2; --ai-report-emphasis: #6f53c2;
 --ai-report-action: #6f53c2; --ai-report-action-ink: #fff;
}
html[data-theme=dark] body[data-workbench-screen] #workbench-ai-modal[data-mode=dream] {
 --ai-report-title: #bbabf6; --ai-report-emphasis: #bbabf6;
 --ai-report-action: #bbabf6; --ai-report-action-ink: #201733;
}
body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-result-body,.ai-conversation-answer .markdown-render) :is(h1,h2,h3,h4,h5,h6) {
 color: var(--ai-report-title); font-family: inherit; font-weight: 700; line-height: 1.5; letter-spacing: normal; margin: 24px 0 10px; text-align: start;
}
body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-result-body,.ai-conversation-answer .markdown-render) h1 { font-size: 24px; }
body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-result-body,.ai-conversation-answer .markdown-render) h2 { font-size: 20px; }
body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-result-body,.ai-conversation-answer .markdown-render) :is(h3,h4,h5,h6) { font-size: 17px; }
body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-result-body,.ai-conversation-answer .markdown-render) :is(strong,b) { color: var(--ai-report-emphasis); font-weight: 700; }
body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-result-body,.ai-conversation-answer .markdown-render) :is(h1,h2,h3,h4,h5,h6) :is(strong,b) { color: inherit; }
body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-result-body,.ai-conversation-answer .markdown-render) > :first-child { margin-top: 4px; }
body[data-workbench-screen] #workbench-ai-modal .ai-report-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
body[data-workbench-screen] #workbench-ai-modal .ai-report-utilities { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-new {
 display: inline-flex; align-items: center; justify-content: center; min-height: 46px; max-width: 100%; padding: 11px 22px;
 border: 1px solid transparent; border-radius: 14px; background: var(--ai-report-action); color: var(--ai-report-action-ink); font: inherit; font-weight: 700; line-height: 1.5; cursor: pointer;
}
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-new:hover:not(:disabled) { background: color-mix(in srgb,var(--ai-report-action) 90%,var(--ai-report-action-ink)); }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-new:focus-visible { outline: 3px solid var(--ai-report-title); outline-offset: 3px; }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-new:disabled { opacity: .55; cursor: not-allowed; }
@media(max-width:780px) {
 body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-result-body,.ai-conversation-answer .markdown-render) h1 { font-size: 22px; }
 body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-result-body,.ai-conversation-answer .markdown-render) h2 { font-size: 18px; }
 body[data-workbench-screen] #workbench-ai-modal .ai-report-actions { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; }
 body[data-workbench-screen] #workbench-ai-modal .ai-report-utilities { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
 body[data-workbench-screen] #workbench-ai-modal .ai-report-utilities button { min-height: 44px; }
}

/* Journey pass 159: continuous conversation and a compact iOS-style composer. */
body[data-workbench-screen] #workbench-ai-modal .workbench-ai-sheet-head { border: 0; }
body[data-workbench-screen] #workbench-ai-modal[data-stage=result] #workbench-ai-kicker { display: none; }
body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-question,.ai-conversation-question) { width: fit-content; max-width: 88%; margin: 16px 0 18px auto; padding: 12px 16px; border: 0; border-radius: 18px 18px 4px 18px; background: color-mix(in srgb,var(--ai-report-action) 10%,var(--wb-surface-strong)); }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-question-text { font-size: 16px; font-weight: 500; line-height: 1.7; }
body[data-workbench-screen] #workbench-ai-modal :is(#workbench-ai-question-label,.ai-conversation-question span) { font-size: 11px; margin: 0 0 4px; color: var(--wb-muted); }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-transcript { margin: 0; padding: 0; }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-transcript-body { padding: 0; gap: 24px; }
body[data-workbench-screen] #workbench-ai-modal .ai-message-author { font-size: 12px; color: var(--wb-muted); margin: 0 0 8px; }
body[data-workbench-screen] #workbench-ai-modal .ai-message-receipt { font-size: 11px; color: var(--wb-muted); }
body[data-workbench-screen] #workbench-ai-modal .ai-journey-complete { margin: 0 0 10px; padding: 0; gap: 6px; }
body[data-workbench-screen] #workbench-ai-modal .ai-journey-complete :is(strong,.ai-journey-complete-mark) { display: none; }
body[data-workbench-screen] #workbench-ai-modal .ai-journey-complete p { margin: 0; font-size: 11px; color: var(--wb-muted); }
body[data-workbench-screen] #workbench-ai-modal .workbench-ai-result-head { margin: 0 0 4px; }
body[data-workbench-screen] #workbench-ai-modal .workbench-ai-result-head > strong { font-size: 12px; color: var(--wb-muted); font-weight: 500; }
body[data-workbench-screen] #workbench-ai-modal .ai-report-actions { border: 0; padding: 0; margin-top: 18px; display: flex; justify-content: space-between; align-items: center; }
body[data-workbench-screen] #workbench-ai-modal .ai-report-utilities { display: flex; gap: 4px; }
body[data-workbench-screen] #workbench-ai-modal .ai-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 12px; color: var(--wb-muted); background: transparent; cursor: pointer; }
body[data-workbench-screen] #workbench-ai-modal .ai-icon-button:hover { color: var(--ai-report-title); background: color-mix(in srgb,var(--ai-report-action) 10%,transparent); }
body[data-workbench-screen] #workbench-ai-modal :is(.ai-icon-button,.ai-send-button):focus-visible { outline: 2px solid var(--ai-report-title); outline-offset: 3px; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-details { margin-top: 12px; padding: 0; border: 0; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-details > summary { min-height: 44px; align-content: center; cursor: pointer; color: var(--wb-muted); font-size: 12px; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-details :is(#workbench-ai-history-actions,#workbench-ai-basis,#workbench-ai-billing) { border: 0; padding: 8px 0; margin: 0; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock { border: 0; margin-top: 12px; padding-top: 8px; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock #workbench-ai-followup { grid-template-columns: minmax(0,1fr) 44px; grid-template-areas: "input actions" "meta meta" "note note"; gap: 4px 10px; align-items: end; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock .inline-actions { align-self: end; }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-followup-input { min-height: 48px; max-height: 100px; border-radius: 18px; resize: none; padding: 11px 14px; background: var(--wb-surface); }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-followup-send { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; padding: 10px; margin-bottom: 2px; border: 0; border-radius: 50%; background: var(--ai-report-action); color: var(--ai-report-action-ink); cursor: pointer; }
body[data-workbench-screen] #workbench-ai-modal #workbench-ai-followup-send:disabled { background: var(--line); color: var(--wb-muted); cursor: not-allowed; }
body[data-workbench-screen] #workbench-ai-modal .ai-composer-meta { grid-area: meta; display: flex; align-items: center; gap: 4px; min-height: 22px; color: var(--wb-muted); font-size: 11px; }
body[data-workbench-screen] #workbench-ai-modal #workbench-followup-count { margin: 0 0 0 auto; font-size: 11px; font-weight: 400; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-dock .ai-reading-nav { display: none; }
body[data-workbench-screen] #workbench-ai-modal[data-stage=waiting] .ai-reading-nav { display: flex; }
body[data-workbench-screen] #workbench-ai-modal .ai-conversation-answer { padding: 0; border: 0; }
@media(max-width:780px) {
 body[data-workbench-screen] #workbench-ai-modal #workbench-ai-new { min-height: 44px; padding: 10px 16px; font-size: 14px; }
}

/* Workbench masthead: one aligned row, plain controls, one balance and tier link. */
body[data-workbench-screen] .hero {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap;
  gap: 20px; padding: 8px 0 16px; min-height: 60px;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
body[data-workbench-screen] .hero::before,
body[data-workbench-screen] .hero::after { display: none; }
body[data-workbench-screen] .hero-brand { flex: 0 0 auto; min-width: 0; }
body[data-workbench-screen] .app-brand-lockup { display: flex; align-items: center; gap: 9px; }
body[data-workbench-screen] .app-brand-logo { width: 28px; height: 28px; flex: 0 0 28px; }
body[data-workbench-screen] .hero h1 { font-size: 24px; line-height: 1.2; margin: 0; white-space: nowrap; }
body[data-workbench-screen] .hero-subtitle { display: none; }
body[data-workbench-screen] .hero-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 16px; min-width: 0; }
body[data-workbench-screen] .hero-control,
body[data-workbench-screen] .hero-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  color: var(--wb-ink); font: 500 13px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  white-space: nowrap; text-decoration: none; letter-spacing: 0; transform: none;
}
body[data-workbench-screen] .hero-actions [hidden] { display: none !important; }
body[data-workbench-screen] .hero-user-chip { display: block; min-height: 0; max-width: 170px; overflow: hidden; text-overflow: ellipsis; color: var(--wb-muted); }
body[data-workbench-screen] .hero-account-link { flex: 0 0 auto; gap: 6px; font-variant-numeric: tabular-nums; }
body[data-workbench-screen] .hero-auth-points { color: var(--wb-gold-deep); }
body[data-workbench-screen] .hero-auth-membership { font-weight: 650; }
body[data-workbench-screen] .hero-account-divider { color: var(--wb-muted); }
body[data-workbench-screen] .hero-theme-btn { width: 32px; flex: 0 0 32px; justify-content: center; font-size: 18px; cursor: pointer; }
body[data-workbench-screen] .hero-actions :is(a,button):hover { color: var(--wb-gold-deep); background: transparent; border: 0; text-decoration: none; transform: none; }
body[data-workbench-screen] .hero-actions :is(a,button):focus-visible { outline: 2px solid var(--wb-gold-deep); outline-offset: 3px; }
html[data-theme=dark] body[data-workbench-screen] .hero { background: transparent; border: 0; box-shadow: none; }
html[data-theme=dark] body[data-workbench-screen] .hero-control,
html[data-theme=dark] body[data-workbench-screen] .hero-link { background: transparent; border: 0; color: var(--wb-ink); }
@media(max-width:1000px) {
  body[data-workbench-screen] .hero-user-chip { display: none; }
}
@media(max-width:780px) {
  body[data-workbench-screen] .hero { gap: 8px; padding: 0 0 12px; min-height: 52px; }
  body[data-workbench-screen] .app-brand-lockup { gap: 6px; }
  body[data-workbench-screen] .app-brand-logo { width: 24px; height: 24px; flex-basis: 24px; }
  body[data-workbench-screen] .hero h1 { font-size: 18px; }
  body[data-workbench-screen] .hero-actions { gap: 8px; }
  body[data-workbench-screen] .hero-control,
  body[data-workbench-screen] .hero-link { font-size: 12px; }
  body[data-workbench-screen] .hero-user-chip { display: none; }
  body[data-workbench-screen] .hero-link:not(.hero-link-profile):not(.hero-link-login) { display: none; }
  body[data-workbench-screen] .hero-link-profile { max-width: 52px; flex: 0 0 52px; overflow: visible; text-overflow: clip; white-space: nowrap; }
  body[data-workbench-screen] .hero-account-link { gap: 4px; }
  body[data-workbench-screen] .hero-theme-btn { width: 28px; flex-basis: 28px; font-size: 17px; }
}
@media(max-width:360px) {
  body[data-workbench-screen] .hero { gap: 6px; }
  body[data-workbench-screen] .hero h1 { font-size: 16px; }
  body[data-workbench-screen] .hero-actions { gap: 5px; }
}



/* History reading refresh: one clear type line, quiet metadata, and mode-led accents. */
body[data-workbench-screen] #history-page .workbench-history-record { position: relative; grid-template-columns: minmax(0,1fr) 48px; padding-left: 12px; }
body[data-workbench-screen] #history-page .workbench-history-record::before { content: ''; position: absolute; inset: 16px auto 16px 0; width: 3px; border-radius: 3px; background: var(--history-tone, var(--wb-gold-deep)); }
body[data-workbench-screen] #history-page .history-record-tone-dream { --history-tone: #7656c8; }
body[data-workbench-screen] #history-page .history-record-tone-quick-ask { --history-tone: var(--wb-gold-deep); }
body[data-workbench-screen] #history-page .history-record-tone-liuyao { --history-tone: #8b5e3c; }
body[data-workbench-screen] #history-page .history-record-tone-ziwei { --history-tone: #b65f54; }
body[data-workbench-screen] #history-page .history-record-tone-fengshui { --history-tone: #9b7a3e; }
body[data-workbench-screen] #history-page .history-record-tone-wuxing { --history-tone: #4f897e; }
body[data-workbench-screen] #history-page .history-record-tone-tongzi,
body[data-workbench-screen] #history-page .history-record-tone-bazi { --history-tone: var(--wb-gold-deep); }
body[data-workbench-screen] #history-page .history-record-kicker { display: flex; align-items: center; gap: 9px; min-width: 0; margin-bottom: 4px; }
body[data-workbench-screen] #history-page .history-record-type { color: var(--history-tone, var(--wb-gold-deep)); font-size: 12px; font-weight: 700; }
body[data-workbench-screen] #history-page .history-record-state { color: var(--wb-muted); font-size: 12px; }
body[data-workbench-screen] #history-page .history-record-state.good { color: var(--history-tone, var(--wb-gold-deep)); }
body[data-workbench-screen] #history-page .history-record-state.warn { color: var(--warn); }
body[data-workbench-screen] #history-page .history-item strong { margin: 0 0 5px; }
body[data-workbench-screen] #history-page .history-record-summary { color: var(--wb-muted); }
body[data-workbench-screen] #history-page .history-meta { margin-top: 7px; }
body[data-workbench-screen] #history-page .history-meta .helper { color: var(--wb-muted); }
body[data-workbench-screen] #history-page .workbench-history-delete { align-self: center; }

/* Detail flow: AI is readable first; inputs are available without competing with the answer. */
body[data-workbench-screen] #workbench-history-detail .history-reading-header { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
body[data-workbench-screen] #workbench-history-detail .history-reading-header.history-reading-tone-dream { --history-tone: #7656c8; }
body[data-workbench-screen] #workbench-history-detail .history-reading-header.history-reading-tone-quick-ask { --history-tone: var(--wb-gold-deep); }
body[data-workbench-screen] #workbench-history-detail .history-reading-header.history-reading-tone-liuyao { --history-tone: #8b5e3c; }
body[data-workbench-screen] #workbench-history-detail .history-reading-header.history-reading-tone-ziwei { --history-tone: #b65f54; }
body[data-workbench-screen] #workbench-history-detail .history-reading-header.history-reading-tone-fengshui { --history-tone: #9b7a3e; }
body[data-workbench-screen] #workbench-history-detail .history-reading-header.history-reading-tone-wuxing { --history-tone: #4f897e; }
body[data-workbench-screen] #workbench-history-detail .history-reading-header::before { content: ''; display: block; width: 32px; height: 3px; margin-bottom: 12px; border-radius: 3px; background: var(--history-tone, var(--wb-gold-deep)); }
body[data-workbench-screen] #workbench-history-detail .history-reading-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; white-space: normal; overflow: visible; }
body[data-workbench-screen] #workbench-history-detail .history-reading-type { color: var(--history-tone, var(--wb-gold-deep)); font-weight: 700; }
body[data-workbench-screen] #workbench-history-detail .history-reading-subtitle { margin: 0; color: var(--wb-muted); font-size: 13px; line-height: 1.6; }
body[data-workbench-screen] #workbench-history-detail .history-conversation > h4,
body[data-workbench-screen] #workbench-history-detail .history-snapshot > h4,
body[data-workbench-screen] #workbench-history-detail .history-chart-summary > h4 { color: var(--history-tone, var(--wb-gold-deep)); }
body[data-workbench-screen] #workbench-history-detail .history-chat-message.is-assistant .markdown-render :is(h1,h2,h3,h4,h5,h6,strong,b) { color: var(--history-tone, var(--wb-gold-deep)); }
body[data-workbench-screen] #workbench-history-detail .history-chat-message.is-user p { margin-bottom: 0; }
body[data-workbench-screen] #workbench-history-detail .history-chart-summary { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
body[data-workbench-screen] #workbench-history-detail .history-chart-summary p { margin: 0; color: var(--wb-muted); line-height: 1.8; }
body[data-workbench-screen] #workbench-history-detail .history-reference { margin-top: 22px; }
body[data-workbench-screen] #workbench-history-detail .history-detail-actions { padding-top: 4px; }
@media(max-width:780px) {
  body[data-workbench-screen] #history-page .history-toolbar { gap: 8px; }
  body[data-workbench-screen] #history-page .workbench-history-record { grid-template-columns: minmax(0,1fr) 42px; padding-left: 10px; }
  body[data-workbench-screen] #history-page .history-item { padding: 14px 2px; }
  body[data-workbench-screen] #history-page .history-record-kicker { gap: 7px; }
  body[data-workbench-screen] #history-page .history-record-type,
  body[data-workbench-screen] #history-page .history-record-state { font-size: 11px; }
  body[data-workbench-screen] #history-page .history-item strong { font-size: 16px; line-height: 1.45; }
  body[data-workbench-screen] #history-page .history-record-summary { font-size: 12px; line-height: 1.55; }
  body[data-workbench-screen] #workbench-history-detail .history-reading-header h3 { font-size: 22px; line-height: 1.45; }
  body[data-workbench-screen] #workbench-history-detail .markdown-render { font-size: 15px; line-height: 1.8; }
  body[data-workbench-screen] #workbench-history-detail .history-chat-message.is-user p { font-size: 17px; }
  body[data-workbench-screen] #workbench-history-detail :is(.history-primary-actions,.history-detail-actions) { display: grid; grid-template-columns: minmax(0,1fr); }
  body[data-workbench-screen] #workbench-history-detail :is(.history-primary-actions,.history-detail-actions) button { width: 100%; }
}
/* Announcement rail: continuous belt, compact controls, and dismiss per session. */
body[data-workbench-screen=home] #workbench-admin-notice { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 8px; min-width: 0; height: 36px; margin: -2px 0 2px; padding: 5px 8px 5px 12px; overflow: hidden; border-left: 3px solid var(--notice-accent, var(--wb-gold-deep)); background: color-mix(in srgb, var(--notice-accent, var(--wb-gold-deep)) 7%, transparent); color: var(--wb-ink); font-size: 12px; line-height: 20px; }
body[data-workbench-screen=home] #workbench-admin-notice.notice-template-gold { --notice-accent: #c48700; }
body[data-workbench-screen=home] #workbench-admin-notice.notice-template-violet { --notice-accent: #7656c8; }
body[data-workbench-screen=home] #workbench-admin-notice.notice-template-ink { --notice-accent: var(--wb-ink); }
body[data-workbench-screen=home] #workbench-admin-notice .notice-label { color: var(--notice-accent, var(--wb-gold-deep)); font-size: 11px; font-weight: 750; white-space: nowrap; }
body[data-workbench-screen=home] #workbench-admin-notice .notice-window { min-width: 0; overflow: hidden; white-space: nowrap; }
body[data-workbench-screen=home] #workbench-admin-notice .notice-belt { display: inline-flex; width: max-content; will-change: transform; }
body[data-workbench-screen=home] #workbench-admin-notice .notice-tile { display: inline-flex; align-items: center; flex: none; white-space: nowrap; }
body[data-workbench-screen=home] #workbench-admin-notice strong { color: var(--notice-accent, var(--wb-gold-deep)); }
body[data-workbench-screen=home] #workbench-admin-notice .notice-inline-button strong { color: #fff !important; }
body[data-workbench-screen=home] #workbench-admin-notice em { color: var(--wb-muted); }
body[data-workbench-screen=home] #workbench-admin-notice .notice-inline-link { color: var(--notice-accent, var(--wb-gold-deep)); text-decoration: underline; text-underline-offset: 2px; }
body[data-workbench-screen=home] #workbench-admin-notice .notice-inline-button { display: inline-flex; align-items: center; min-height: 22px; margin-left: 5px; padding: 1px 8px; border-radius: 999px; background: var(--notice-accent, var(--wb-gold-deep)); color: #fff !important; text-decoration: none; font-size: 11px; font-weight: 700; }
body[data-workbench-screen=home] #workbench-admin-notice :is(.notice-pause,.notice-close) { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--wb-muted); cursor: pointer; }
body[data-workbench-screen=home] #workbench-admin-notice .notice-close { font-size: 18px; line-height: 1; }
body[data-workbench-screen=home] #workbench-admin-notice :is(.notice-pause,.notice-close):hover { color: var(--notice-accent, var(--wb-gold-deep)); }
body[data-workbench-screen=home] #workbench-admin-notice :is(.notice-pause,.notice-close):focus-visible { outline: 2px solid var(--notice-accent, var(--wb-gold-deep)); outline-offset: 2px; }
@media(prefers-reduced-motion:reduce) { body[data-workbench-screen=home] #workbench-admin-notice .notice-belt { transform: none; } }
@media(max-width:780px) { body[data-workbench-screen=home] #workbench-admin-notice { height: 34px; margin: 0; padding: 4px 5px 4px 8px; gap: 5px; font-size: 11px; } body[data-workbench-screen=home] #workbench-admin-notice .notice-label { font-size: 10px; } body[data-workbench-screen=home] #workbench-admin-notice .notice-inline-button { min-height: 20px; padding-inline: 7px; } }
/* AI journey pass 160: a shared mode-aware waiting and report hierarchy. */
body[data-workbench-screen] #result[data-ai-report-mode="liuyao"], body[data-workbench-screen] #result[data-ai-report-mode="quick-ask"] { --ai-report-title:#996000; --ai-report-emphasis:#9d6500; --ai-report-action:#f7b500; --ai-report-action-ink:#30230b; }
body[data-workbench-screen] #result[data-ai-report-mode="ziwei"] { --ai-report-title:#586aa9; --ai-report-emphasis:#586aa9; --ai-report-action:#586aa9; --ai-report-action-ink:#fff; }
body[data-workbench-screen] #result[data-ai-report-mode="analyze"], body[data-workbench-screen] #result[data-ai-report-mode="wuxing"] { --ai-report-title:#397d68; --ai-report-emphasis:#397d68; --ai-report-action:#4f9a7e; --ai-report-action-ink:#fff; }
body[data-workbench-screen] #result[data-ai-report-mode="tongzi"] { --ai-report-title:#a64b40; --ai-report-emphasis:#a64b40; --ai-report-action:#b75a4d; --ai-report-action-ink:#fff; }
body[data-workbench-screen] #result[data-ai-report-mode="fengshui"] { --ai-report-title:#3c7591; --ai-report-emphasis:#3c7591; --ai-report-action:#4b8eaa; --ai-report-action-ink:#fff; }
html[data-theme=dark] body[data-workbench-screen] #result[data-ai-report-mode="liuyao"], html[data-theme=dark] body[data-workbench-screen] #result[data-ai-report-mode="quick-ask"] { --ai-report-title:#f7b500; --ai-report-emphasis:#fbb050; --ai-report-action:#f7b500; --ai-report-action-ink:#30230b; }
html[data-theme=dark] body[data-workbench-screen] #result[data-ai-report-mode="ziwei"] { --ai-report-title:#aebaff; --ai-report-emphasis:#aebaff; --ai-report-action:#7687d1; --ai-report-action-ink:#fff; }
html[data-theme=dark] body[data-workbench-screen] #result[data-ai-report-mode="analyze"], html[data-theme=dark] body[data-workbench-screen] #result[data-ai-report-mode="wuxing"] { --ai-report-title:#9ed8c1; --ai-report-emphasis:#9ed8c1; --ai-report-action:#70b796; --ai-report-action-ink:#12241c; }
html[data-theme=dark] body[data-workbench-screen] #result[data-ai-report-mode="tongzi"] { --ai-report-title:#f0aaa0; --ai-report-emphasis:#f0aaa0; --ai-report-action:#c8756b; --ai-report-action-ink:#2a1714; }
html[data-theme=dark] body[data-workbench-screen] #result[data-ai-report-mode="fengshui"] { --ai-report-title:#9cd0e3; --ai-report-emphasis:#9cd0e3; --ai-report-action:#75b5cf; --ai-report-action-ink:#10212a; }
body[data-workbench-screen] .ai-analysis-overview { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 0 16px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
body[data-workbench-screen] .ai-analysis-overview > div { display:grid; gap:4px; min-width:0; }
body[data-workbench-screen] .ai-analysis-overline { color:var(--ai-report-title); font-size:11px; font-weight:700; letter-spacing:.06em; }
body[data-workbench-screen] .ai-analysis-overview strong { font-size:20px; line-height:1.35; }
body[data-workbench-screen] .ai-analysis-overview small { color:var(--wb-muted); font-size:13px; line-height:1.55; }
body[data-workbench-screen] .ai-analysis-overview-status { flex:0 0 auto; padding:6px 10px; border-radius:999px; background:color-mix(in srgb,var(--line) 60%,transparent); color:var(--wb-muted); font-size:12px; }
body[data-workbench-screen] .ai-analysis-overview-status.is-active { background:color-mix(in srgb,var(--ai-report-action) 18%,transparent); color:var(--ai-report-title); }
body[data-workbench-screen] .ai-analysis-overview-status.is-done { background:color-mix(in srgb,var(--good,#4a9) 16%,transparent); color:var(--good,#287d5d); }
body[data-workbench-screen] .ai-analysis-overview-status.is-error { background:color-mix(in srgb,var(--tone-accent,#b34) 14%,transparent); color:var(--tone-accent,#b34); }
body[data-workbench-screen] .ai-analysis-stages { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; list-style:none; margin:0; padding:18px 0 6px; }
body[data-workbench-screen] .ai-analysis-stages li { display:grid; grid-template-columns:28px minmax(0,1fr); gap:8px; align-items:center; min-width:0; color:var(--wb-muted); }
body[data-workbench-screen] .ai-analysis-stage-index { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; border:1px solid var(--line); font-size:12px; }
body[data-workbench-screen] .ai-analysis-stage-copy { display:grid; gap:2px; min-width:0; }
body[data-workbench-screen] .ai-analysis-stage-copy strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
body[data-workbench-screen] .ai-analysis-stage-copy small { font-size:11px; }
body[data-workbench-screen] .ai-analysis-stages li.is-active { color:var(--ai-report-title); }
body[data-workbench-screen] .ai-analysis-stages li.is-active .ai-analysis-stage-index { border-color:var(--ai-report-title); background:color-mix(in srgb,var(--ai-report-action) 16%,transparent); }
body[data-workbench-screen] .ai-analysis-stages li.is-done .ai-analysis-stage-index { border-color:var(--good,#4a9); color:var(--good,#287d5d); }
body[data-workbench-screen] .ai-report-icon-action { display:inline-flex; align-items:center; justify-content:center; width:42px; padding:8px; }
body[data-workbench-screen] .ai-report-icon-action svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
@media(max-width:780px) { body[data-workbench-screen] .ai-analysis-overview { align-items:flex-start; padding-block:14px; } body[data-workbench-screen] .ai-analysis-overview strong { font-size:17px; } body[data-workbench-screen] .ai-analysis-overview small { font-size:12px; } body[data-workbench-screen] .ai-analysis-stages { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 8px; padding-top:14px; } body[data-workbench-screen] .ai-analysis-stage-copy strong { font-size:11px; } body[data-workbench-screen] .ai-report-icon-action { width:40px; min-height:40px; } }
@media(prefers-reduced-motion:reduce) { body[data-workbench-screen] #workbench-ai-modal .ai-journey-loader span { animation:none!important; opacity:.7; } }

/* History library: compact rows and a continuous reading surface. */
body[data-workbench-screen] #history-page { max-width:1040px; }
body[data-workbench-screen] #history-page .history-date-heading { display:list-item; margin:18px 0 0; padding:10px 0; font-size:12px; font-weight:600; }
body[data-workbench-screen] #history-page .history-item { display:block; text-align:left; padding:18px 4px; }
body[data-workbench-screen] #history-page .history-record-kicker { gap:8px; margin:0 0 6px; flex-wrap:wrap; }
body[data-workbench-screen] #history-page .history-record-time { margin-left:auto; color:var(--wb-muted); font-size:12px; font-weight:400; white-space:nowrap; font-variant-numeric:tabular-nums; }
body[data-workbench-screen] #history-page .history-item strong { margin:0 0 4px; font-size:16px; line-height:1.55; font-weight:650; }
body[data-workbench-screen] #history-page .history-record-summary { font-size:13px; -webkit-line-clamp:1; }
body[data-workbench-screen] #history-page .workbench-history-record { gap:12px; padding-left:14px; }
body[data-workbench-screen] #history-page .workbench-history-record::before { inset:22px auto 22px 0; width:2px; opacity:.65; }
body[data-workbench-screen] #history-page .workbench-history-delete { opacity:.75; border-radius:8px; }
body[data-workbench-screen] #history-page .workbench-history-delete:hover { opacity:1; background:color-mix(in srgb,var(--warn) 7%,transparent); }
body[data-workbench-screen] #history-page :is(.history-item,.workbench-history-delete):focus-visible { outline:2px solid var(--wb-gold-deep); outline-offset:2px; }
body[data-workbench-screen] #workbench-history-modal .workbench-settings-sheet { padding:0 32px 32px; border-radius:20px; }
body[data-workbench-screen] #workbench-history-modal .workbench-ai-sheet-head { position:sticky; top:0; z-index:3; margin:0 0 24px; padding:14px 0; background:var(--wb-surface-strong); border-bottom:1px solid var(--line); }
body[data-workbench-screen] #workbench-history-modal .workbench-ai-sheet-head button { border:0; box-shadow:none; background:none; padding:8px 0 8px 16px; font-size:13px; }
body[data-workbench-screen] #workbench-history-detail { max-width:700px; --history-tone:var(--wb-gold-deep); }
body[data-workbench-screen] #workbench-history-detail.history-reading-tone-dream { --history-tone:#7656c8; }
body[data-workbench-screen] #workbench-history-detail.history-reading-tone-liuyao { --history-tone:#8b5e3c; }
body[data-workbench-screen] #workbench-history-detail.history-reading-tone-ziwei { --history-tone:#b65f54; }
body[data-workbench-screen] #workbench-history-detail.history-reading-tone-wuxing { --history-tone:#4f897e; }
body[data-workbench-screen] #workbench-history-detail.history-reading-tone-fengshui { --history-tone:#9b7a3e; }
body[data-theme=dark][data-workbench-screen] #workbench-history-detail.history-reading-tone-dream { --history-tone:#bda2ff; }
body[data-theme=dark][data-workbench-screen] #workbench-history-detail.history-reading-tone-liuyao { --history-tone:#d5aa87; }
body[data-theme=dark][data-workbench-screen] #workbench-history-detail.history-reading-tone-ziwei { --history-tone:#efa69b; }
body[data-theme=dark][data-workbench-screen] #workbench-history-detail.history-reading-tone-wuxing { --history-tone:#8bc6b8; }
body[data-theme=dark][data-workbench-screen] #workbench-history-detail.history-reading-tone-fengshui { --history-tone:#d8ba7c; }
body[data-workbench-screen] #workbench-history-detail .history-reading-header { border:0; padding-bottom:0; --history-tone:inherit; }
body[data-workbench-screen] #workbench-history-detail .history-reading-header::before { display:none; }
body[data-workbench-screen] #workbench-history-detail .history-reading-header h3 { font-size:clamp(21px,2vw,26px); line-height:1.55; margin:12px 0; letter-spacing:-.025em; }
body[data-workbench-screen] #workbench-history-detail .history-primary-actions { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0 28px; padding-bottom:20px; border-bottom:1px solid var(--line); }
body[data-workbench-screen] #workbench-history-detail .history-primary-actions button { width:auto; border-radius:9px; padding:9px 14px; font-size:13px; }
body[data-workbench-screen] #workbench-history-detail .history-primary-actions .submit-btn { background:var(--history-tone); color:var(--wb-surface-strong); border-color:transparent; }
body[data-workbench-screen] #workbench-history-detail .history-primary-actions .ghost-btn { border:0; background:transparent; color:var(--wb-muted); }
body[data-workbench-screen] #workbench-history-detail .history-chat-message { margin:0 0 28px; }
body[data-workbench-screen] #workbench-history-detail .history-chat-message > strong { margin-bottom:12px; font-weight:600; letter-spacing:.04em; }
body[data-workbench-screen] #workbench-history-detail .history-chat-message.is-user { border-top:1px solid var(--line); padding:22px 0 0; margin-top:32px; }
body[data-workbench-screen] #workbench-history-detail .history-chat-message.is-user p { white-space:pre-wrap; }
body[data-workbench-screen] #workbench-history-detail .markdown-render { overflow-wrap:anywhere; }
body[data-workbench-screen] #workbench-history-detail :is(.history-snapshot,.history-chat-message.is-assistant) .markdown-render :is(h1,h2,h3,h4,h5,h6,strong,b) { color:var(--history-tone); }
body[data-workbench-screen] #workbench-history-detail .markdown-render :is(h1,h2) { font-size:20px; }
body[data-workbench-screen] #workbench-history-detail .markdown-render :is(h3,h4) { font-size:17px; }
body[data-workbench-screen] #workbench-history-detail .markdown-render :is(blockquote,.md-callout,.md-highlight) { border-radius:0; box-shadow:none; }
body[data-workbench-screen] #workbench-history-detail .markdown-render table { display:block; overflow-x:auto; overscroll-behavior-x:contain; }
body[data-workbench-screen] #workbench-history-detail .history-chart-summary { border:0; padding:0; margin:20px 0; }
body[data-workbench-screen] #workbench-history-detail .history-chart-summary h4 { margin:0 0 8px; font-size:13px; }
body[data-workbench-screen] #workbench-history-detail .history-chart-summary p { color:var(--wb-ink); }
body[data-workbench-screen] #workbench-history-detail .history-reference dl { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 28px; padding:4px 0 12px; }
body[data-workbench-screen] #workbench-history-detail .history-reference dl > div { min-width:0; margin:0; }
body[data-workbench-screen] #workbench-history-detail .history-reference dd { font-size:14px; }
body[data-workbench-screen] #workbench-history-detail .history-reading-footnote { border-top:1px solid var(--line); padding-top:16px; line-height:1.75; }
@media(max-width:780px) {
 body[data-workbench-screen] #history-page .history-item { padding:15px 0; }
 body[data-workbench-screen] #history-page .workbench-history-record { padding-left:10px; gap:4px; grid-template-columns:minmax(0,1fr) 38px; }
 body[data-workbench-screen] #history-page .history-record-time { font-size:11px; }
 body[data-workbench-screen] #history-page .history-record-kicker { gap:5px; }
 body[data-workbench-screen] #history-page .workbench-history-delete { width:38px; }
 body[data-workbench-screen] #history-page .history-record-state { font-size:10px; }
 body[data-workbench-screen] #workbench-history-modal .workbench-settings-sheet { padding:0 20px max(24px,env(safe-area-inset-bottom)); border-radius:0; }
 body[data-workbench-screen] #workbench-history-modal .workbench-ai-sheet-head { padding-top:max(10px,env(safe-area-inset-top)); margin-bottom:20px; }
 body[data-workbench-screen] #workbench-history-detail .history-reading-header h3 { font-size:21px; }
 body[data-workbench-screen] #workbench-history-detail .history-primary-actions { margin:16px 0 24px; gap:4px; }
 body[data-workbench-screen] #workbench-history-detail .history-primary-actions button { width:auto; font-size:12px; padding:8px 12px; }
 body[data-workbench-screen] #workbench-history-detail .markdown-render { font-size:15px; line-height:1.85; }
 body[data-workbench-screen] #workbench-history-detail .history-reference dl { grid-template-columns:minmax(0,1fr); }
}

body[data-workbench-screen] #workbench-history-detail .history-reading-header[class*="history-reading-tone-"] { --history-tone:inherit; }

/* History reading navigation: quiet controls and a document outline. */
body[data-workbench-screen] #history-page .history-group-count { margin-left:10px; font-size:11px; font-weight:400; opacity:.8; }
body[data-workbench-screen] #history-page .history-summary-pill-reset { border:0; box-shadow:none; background:none; color:var(--wb-gold-deep); text-decoration:underline; text-underline-offset:4px; }
body[data-workbench-screen] #history-page .history-summary-strip { padding-bottom:8px; border-bottom:1px solid var(--line); }
body[data-workbench-screen] #workbench-history-modal .history-sheet-navigation { display:flex; align-items:center; gap:18px; }
body[data-workbench-screen] #workbench-history-modal .history-sheet-navigation button { padding:8px 0; }
body[data-workbench-screen] #workbench-history-modal [data-history-top] { color:var(--wb-muted); }
body[data-workbench-screen] #workbench-history-detail .history-contents { margin:-8px 0 28px; border-bottom:1px solid var(--line); }
body[data-workbench-screen] #workbench-history-detail .history-contents summary { padding:12px 0; min-height:44px; cursor:pointer; color:var(--wb-muted); font-size:13px; }
body[data-workbench-screen] #workbench-history-detail .history-contents nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:2px 24px; padding:0 0 16px; }
body[data-workbench-screen] #workbench-history-detail .history-contents button { min-width:0; min-height:44px; text-align:left; border:0; border-radius:6px; box-shadow:none; background:transparent; color:var(--history-tone); font:inherit; font-size:13px; line-height:1.6; padding:8px; overflow-wrap:anywhere; }
body[data-workbench-screen] #workbench-history-detail .history-contents button:hover { background:color-mix(in srgb,var(--history-tone) 7%,transparent); }
body[data-workbench-screen] #workbench-history-detail .markdown-render :is(h1,h2,h3) { scroll-margin-top:90px; }
body[data-workbench-screen] #workbench-history-detail .markdown-render :is(h2,h3) { margin-top:30px; margin-bottom:12px; }
body[data-workbench-screen] #workbench-history-detail .markdown-render p { margin:0 0 16px; }
body[data-workbench-screen] #workbench-history-detail .markdown-render li { margin-block:6px; }
body[data-workbench-screen] #workbench-history-detail .markdown-render blockquote { margin:18px 0; padding:4px 0 4px 16px; background:none; border-left:2px solid var(--history-tone); color:var(--wb-muted); }
body[data-workbench-screen] #workbench-history-detail .history-chat-message > strong { color:var(--history-tone); }
body[data-workbench-screen] #workbench-history-detail :is(.history-contents button,.history-contents summary):focus-visible { outline:2px solid var(--history-tone); outline-offset:2px; }
@media(max-width:780px) {
 body[data-workbench-screen] #workbench-history-detail .history-contents nav { grid-template-columns:minmax(0,1fr); gap:0; }
 body[data-workbench-screen] #workbench-history-modal .history-sheet-navigation { gap:16px; }
 body[data-workbench-screen] #workbench-history-modal .history-sheet-navigation button { font-size:12px; }
 body[data-workbench-screen] #workbench-history-detail .markdown-render :is(h1,h2,h3) { scroll-margin-top:80px; }
}

/* AI-first home hierarchy. */
body[data-workbench-screen] #home-dashboard .workbench-home-intro {padding:16px 0 8px}
body[data-workbench-screen] #home-dashboard .workbench-home-intro h2 {font-size:30px;letter-spacing:-.03em;margin:6px 0 8px}
body[data-workbench-screen] #home-dashboard .workbench-ai-entry-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
body[data-workbench-screen] #home-dashboard .workbench-ai-entry {min-height:164px;padding:24px;border:0;border-radius:18px;box-shadow:none;background:color-mix(in srgb,var(--wb-gold) 12%,var(--wb-surface-strong))}
body[data-workbench-screen] #home-dashboard .workbench-ai-entry-dream {background:color-mix(in srgb,var(--wb-violet) 12%,var(--wb-surface-strong))}
body[data-workbench-screen] #home-dashboard .workbench-ai-entry strong {font-size:23px}
body[data-workbench-screen] #home-dashboard .workbench-ai-entry small {font-size:14px;line-height:1.65}
body[data-workbench-screen] #home-dashboard .workbench-entry-mark {background:none;color:var(--wb-gold-deep)}
body[data-workbench-screen] #home-dashboard .workbench-ai-entry-dream .workbench-entry-mark {color:var(--wb-violet)}
body[data-workbench-screen] #home-dashboard .home-tool-shortcuts {grid-template-columns:repeat(2,minmax(0,1fr));gap:0 32px;padding:12px 0 0}
body[data-workbench-screen] #home-dashboard .home-tool-shortcuts > button {min-height:70px;padding:14px 2px;gap:4px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:none;box-shadow:none}
body[data-workbench-screen] #home-dashboard .home-tool-shortcuts > button strong {font-size:15px}
body[data-workbench-screen] #home-dashboard .home-tool-shortcuts > button small {font-size:13px}
body[data-workbench-screen] #home-dashboard .workbench-section-heading h3 {font-size:17px}
body[data-workbench-screen] #home-dashboard .workbench-section-heading .ghost-btn {min-height:44px;padding:8px 0;border:0;background:none;box-shadow:none;font-size:13px}
body[data-workbench-screen] #home-dashboard > .home-card {grid-column:1/-1;min-height:72px;padding:12px 2px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:none;box-shadow:none}
body[data-workbench-screen] #home-dashboard :is(.home-calendar-icon,.home-divination-icon,.home-hexagram-symbol) {background:none;box-shadow:none}
body[data-workbench-screen] #home-dashboard button:focus-visible {outline:2px solid var(--wb-gold-deep);outline-offset:4px}
@media(max-width:780px){body[data-workbench-screen] #home-dashboard .workbench-ai-entry-grid {grid-template-columns:1fr;gap:10px} body[data-workbench-screen] #home-dashboard .workbench-ai-entry {min-height:112px;padding:18px 16px;grid-template-columns:36px minmax(0,1fr) 18px} body[data-workbench-screen] #home-dashboard .workbench-ai-entry strong {font-size:20px} body[data-workbench-screen] #home-dashboard .workbench-ai-entry small {font-size:13px} body[data-workbench-screen] #home-dashboard .home-tool-shortcuts {gap:0 20px} body[data-workbench-screen] #home-dashboard .workbench-home-intro h2 {font-size:26px}}
body[data-workbench-screen] #home-dashboard .workbench-search-launch {width:auto;flex:0 0 auto;min-height:44px;padding:8px 0;border:0;border-radius:0;background:none;font-size:13px;gap:6px}
body[data-workbench-screen] #home-dashboard .workbench-search-launch kbd {display:none}

/* Daily exploration: dark list rows match the AI-first home hierarchy. */
html[data-theme=dark] body[data-workbench-screen] #home-dashboard > button.home-card {
  background: transparent;
  color: var(--wb-ink);
  padding: 16px 12px;
  min-height: 84px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  gap: 16px;
  text-align: left;
  transform: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}
html[data-theme=dark] body[data-workbench-screen] #home-dashboard :is(.home-calendar-icon,.home-divination-icon,.home-hexagram-symbol) {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 12px;
  background: var(--wb-surface-strong);
  color: var(--wb-gold-deep);
  font-size: 24px;
  line-height: 1;
  box-shadow: none;
}
html[data-theme=dark] body[data-workbench-screen] #home-dashboard :is(.home-calendar-stack,.home-divination-stack,.home-hexagram-stack) {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 4px;
}
html[data-theme=dark] body[data-workbench-screen] #home-dashboard :is(.home-lunar-date,.home-divination-title,.home-hexagram-name) {
  color: var(--wb-ink);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.5;
}
html[data-theme=dark] body[data-workbench-screen] #home-dashboard :is(.home-solar-date,.home-ganzhi,.home-divination-label,.home-hexagram-brief) {
  color: var(--wb-muted);
  font-size: 13px;
  line-height: 1.6;
}
html[data-theme=dark] body[data-workbench-screen] #home-dashboard :is(.home-divination-score,.home-hexagram-arrow) {
  color: var(--wb-gold-deep);
  opacity: 1;
}
html[data-theme=dark] body[data-workbench-screen] #home-dashboard > button.home-card:focus-visible {
  outline: 2px solid var(--wb-gold-deep);
  outline-offset: 3px;
  background: var(--wb-surface);
}
@media(hover:hover) {
  html[data-theme=dark] body[data-workbench-screen] #home-dashboard > button.home-card:hover {
    background: var(--wb-surface);
    border-bottom-color: var(--wb-gold-deep);
    box-shadow: none;
    transform: none;
  }
}
@media(max-width:780px) {
  html[data-theme=dark] body[data-workbench-screen] #home-dashboard > button.home-card { padding: 14px 4px; gap: 12px; min-height: 80px; }
  html[data-theme=dark] body[data-workbench-screen] #home-dashboard .home-lunar-date { font-size: 15px; }
}
@media(prefers-reduced-motion:reduce) {
  html[data-theme=dark] body[data-workbench-screen] #home-dashboard > button.home-card { transition: none; }
}

/* Account points badge: pair foreground and surface for each theme. */
body[data-workbench-screen] #hero-auth-account .hero-auth-points {
  color: #704b16;
  background: #f4e8cf;
  border: 1px solid #d8bd8c;
  font-variant-numeric: tabular-nums;
}
html[data-theme=dark] body[data-workbench-screen] #hero-auth-account .hero-auth-points {
  color: #ebbd67;
  background: #3a3020;
  border-color: #715a34;
}

/* Calendar workspace: one reading surface, explicit matching, responsive controls. */
body[data-workbench-screen] #daily-page[data-calendar-tool] {max-width:1080px}
body[data-workbench-screen] #daily-page[data-calendar-tool] .ios-feature-header {padding-bottom:20px}
body[data-workbench-screen] .calendar-workspace {--calendar-good:#35735c;--calendar-caution:#aa5348}
body[data-workbench-screen] .calendar-switch {display:inline-flex;gap:4px;padding:4px;margin:0 0 24px;background:var(--line);border-radius:12px}
body[data-workbench-screen] .calendar-switch button {min-height:44px;padding:10px 24px;border:0;border-radius:9px;box-shadow:none;background:transparent;color:var(--wb-muted);font:inherit;font-size:14px}
body[data-workbench-screen] .calendar-switch [aria-pressed=true] {background:var(--wb-surface-strong);color:var(--wb-ink);font-weight:650}
body[data-workbench-screen] .calendar-layout {display:grid;grid-template-columns:280px minmax(0,1fr);gap:40px;align-items:start}
body[data-workbench-screen] .calendar-workspace #calendar-form {min-width:0;margin:0;padding:0;border:0;background:none;box-shadow:none}
body[data-workbench-screen] .calendar-workspace #calendar-form h3 {font-size:18px;margin:0 0 20px}
body[data-workbench-screen] .calendar-workspace #calendar-form .field {margin:0 0 16px;min-width:0}
body[data-workbench-screen] .calendar-workspace :is(input,select) {width:100%;min-width:0;max-width:100%;box-sizing:border-box;min-height:46px;padding:10px 12px;font-size:16px;border:1px solid var(--line);border-radius:10px;background:var(--wb-surface-strong);color:var(--wb-ink)}
body[data-workbench-screen] .calendar-workspace .field > span {font-size:13px;font-weight:600}
body[data-workbench-screen] .calendar-workspace .field small {color:var(--wb-muted);font-size:12px;line-height:1.65}
body[data-workbench-screen] .calendar-fields {display:grid;gap:0 12px;grid-template-columns:minmax(0,1fr)}
body[data-workbench-screen] .calendar-note {font-size:12px;line-height:1.7;color:var(--wb-muted);margin:8px 0 16px;overflow-wrap:anywhere}
body[data-workbench-screen] .calendar-custom {padding:0 0 8px}
body[data-workbench-screen] .calendar-custom summary {min-height:44px;cursor:pointer;font-size:13px;line-height:1.6;padding:10px 0}
body[data-workbench-screen] .calendar-submit-row {display:flex;flex-wrap:wrap;align-items:center;gap:8px}
body[data-workbench-screen] .calendar-submit-row .submit-btn {width:100%;min-height:48px;padding:12px 18px;border:0;border-radius:12px;background:var(--wb-gold-deep);color:#fff;box-shadow:none;font-size:15px}
body[data-workbench-screen] .calendar-workspace button {cursor:pointer}
body[data-workbench-screen] .calendar-workspace button:disabled {opacity:.5;cursor:default}
body[data-workbench-screen] .calendar-text-button {min-height:44px;padding:8px 0;border:0;border-radius:6px;background:none;box-shadow:none;color:var(--wb-gold-deep);font:inherit;font-size:13px}
body[data-workbench-screen] .calendar-date-nav {display:flex;justify-content:space-between;gap:6px;margin:0 0 16px}
body[data-workbench-screen] .calendar-date-nav button {flex:1;min-height:44px;border:0;border-radius:8px;background:none;box-shadow:none;color:var(--wb-gold-deep);font-size:13px}
body[data-workbench-screen] .calendar-output {min-width:0;border-left:1px solid var(--line);padding-left:32px}
body[data-workbench-screen] #calendar-feedback {font-size:13px;line-height:1.7;color:var(--wb-muted);margin:0 0 16px}
body[data-workbench-screen] #calendar-feedback:empty {display:none}
body[data-workbench-screen] .calendar-empty {padding:32px 0;color:var(--wb-muted)}
body[data-workbench-screen] .calendar-empty h3 {color:var(--wb-ink);font-size:19px;margin:0 0 12px}
body[data-workbench-screen] .calendar-empty p {font-size:14px;line-height:1.8}
body[data-workbench-screen] .calendar-reading {padding:0;border:0;background:none;box-shadow:none}
body[data-workbench-screen] .calendar-reading header {padding:4px 0 20px}
body[data-workbench-screen] .calendar-reading h3 {font-size:clamp(20px,2vw,26px);line-height:1.5;margin:8px 0;letter-spacing:-.02em}
body[data-workbench-screen] .calendar-reading header p {color:var(--wb-muted);font-size:14px;margin:6px 0;line-height:1.7}
body[data-workbench-screen] .calendar-reading .calendar-eyebrow {font-size:12px;color:var(--wb-gold-deep);font-weight:650}
body[data-workbench-screen] .calendar-almanac-lines > section {display:grid;grid-template-columns:28px minmax(0,1fr);gap:16px;padding:20px 0;border-top:1px solid var(--line)}
body[data-workbench-screen] .calendar-almanac-lines h4 {margin:0;font-size:19px;line-height:1.85;color:var(--calendar-good)}
body[data-workbench-screen] .calendar-almanac-lines .calendar-ji h4 {color:var(--calendar-caution)}
body[data-workbench-screen] .calendar-almanac-lines p {margin:0;font-size:15px;line-height:1.95;overflow-wrap:anywhere;color:var(--wb-ink)}
body[data-workbench-screen] .calendar-facts {border-top:1px solid var(--line);margin-top:8px}
body[data-workbench-screen] .calendar-facts summary {min-height:48px;padding:14px 0;cursor:pointer;color:var(--wb-muted);font-size:14px}
body[data-workbench-screen] .calendar-facts dl {margin:0}
body[data-workbench-screen] .calendar-facts dl > div {display:grid;grid-template-columns:84px minmax(0,1fr);gap:12px;padding:12px 0;border-top:1px solid var(--line);font-size:13px;line-height:1.7}
body[data-workbench-screen] .calendar-facts dt {color:var(--wb-muted)}
body[data-workbench-screen] .calendar-facts dd {margin:0;overflow-wrap:anywhere}
body[data-workbench-screen] .calendar-result-heading h3 {font-size:21px;margin:0 0 8px}
body[data-workbench-screen] .calendar-result-heading p {font-size:12px;color:var(--wb-muted);margin:0 0 20px}
body[data-workbench-screen] .calendar-result-controls {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}
body[data-workbench-screen] .calendar-filters {display:flex;flex-wrap:wrap;gap:4px}
body[data-workbench-screen] .calendar-filters button {min-height:44px;padding:8px 10px;border:0;border-radius:8px;background:none;box-shadow:none;font-size:13px;color:var(--wb-muted)}
body[data-workbench-screen] .calendar-filters button[aria-pressed=true] {color:var(--wb-gold-deep);background:var(--accent-soft);font-weight:600}
body[data-workbench-screen] .calendar-filters span {font-variant-numeric:tabular-nums}
body[data-workbench-screen] .calendar-sort {display:flex;align-items:center;gap:8px;color:var(--wb-muted);font-size:12px}
body[data-workbench-screen] .calendar-sort select {width:auto;font-size:13px;min-height:44px;background:none}
body[data-workbench-screen] .calendar-candidate {display:grid;grid-template-columns:124px minmax(0,1fr) 12px;gap:16px;align-items:center;width:100%;min-height:90px;padding:18px 2px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:none;box-shadow:none;color:var(--wb-ink);text-align:left}
body[data-workbench-screen] .calendar-candidate-date,body[data-workbench-screen] .calendar-candidate-copy {display:grid;gap:6px;min-width:0}
body[data-workbench-screen] .calendar-candidate-date strong {font-size:15px;font-weight:650}
body[data-workbench-screen] .calendar-candidate-date small {color:var(--wb-muted);font-size:12px}
body[data-workbench-screen] .calendar-candidate-copy {font-size:12px;line-height:1.6;color:var(--wb-muted);overflow-wrap:anywhere}
body[data-workbench-screen] .calendar-match-label {font-weight:600}
body[data-workbench-screen] .calendar-match-label.is-match {color:var(--calendar-good)}
body[data-workbench-screen] .calendar-match-label.is-conflict {color:var(--calendar-caution)}
body[data-workbench-screen] .calendar-chevron {font-size:22px;color:var(--wb-muted)}
body[data-workbench-screen] .calendar-detail-match {font-size:14px;line-height:1.8;padding:16px 0;border-bottom:1px solid var(--line)}
body[data-workbench-screen] .calendar-disclaimer {border-top:1px solid var(--line);margin:32px 0 0;padding-top:18px;color:var(--wb-muted);font-size:12px;line-height:1.8}
html[data-theme=dark] body[data-workbench-screen] .calendar-workspace,body[data-theme=dark][data-workbench-screen] .calendar-workspace {--calendar-good:#94cbb2;--calendar-caution:#eda798}
body[data-workbench-screen] .calendar-workspace button:focus-visible {outline:2px solid var(--wb-gold-deep);outline-offset:3px}
@media(hover:hover){body[data-workbench-screen] .calendar-candidate:hover {background:color-mix(in srgb,var(--line) 30%,transparent)}}
@media(max-width:780px){
 body[data-workbench-screen] .calendar-switch {display:flex;margin-bottom:20px}
 body[data-workbench-screen] .calendar-switch button {flex:1;padding-inline:12px}
 body[data-workbench-screen] .calendar-layout {grid-template-columns:minmax(0,1fr);gap:24px}
 body[data-workbench-screen] .calendar-fields {grid-template-columns:repeat(2,minmax(0,1fr))}
 body[data-workbench-screen] [data-calendar-tool=almanac] .calendar-fields {grid-template-columns:1fr}
 body[data-workbench-screen] .calendar-output {border-left:0;border-top:1px solid var(--line);padding:22px 0 0}
 body[data-workbench-screen] .calendar-candidate {grid-template-columns:104px minmax(0,1fr) 10px;gap:10px}
 body[data-workbench-screen] .calendar-candidate-date strong {font-size:14px}
 body[data-workbench-screen] .calendar-workspace #calendar-form h3 {font-size:17px;margin-bottom:16px}
 body[data-workbench-screen] .calendar-filters button {padding-inline:8px;font-size:12px}
 body[data-workbench-screen] .calendar-reading h3 {font-size:21px}
}

/* Compact calendar navigation and readable action colors. */
body[data-workbench-screen=daily]:has(#daily-page[data-calendar-tool]) #workbench-divider {display:none}
body[data-workbench-screen] #daily-page[data-calendar-tool] .ios-feature-header {gap:12px;padding:12px 0 18px}
body[data-workbench-screen] #daily-page[data-calendar-tool] .ios-feature-header > button {border:0;border-radius:0;background:none;box-shadow:none;padding:8px 0;min-height:44px;color:var(--wb-muted);font-size:13px}
body[data-workbench-screen] .calendar-workspace .calendar-submit-row .submit-btn {background:#805818;color:#fff}
html[data-theme=dark] body[data-workbench-screen] .calendar-workspace .calendar-submit-row .submit-btn,body[data-theme=dark][data-workbench-screen] .calendar-workspace .calendar-submit-row .submit-btn {background:#ebbd67;color:#282015}
body[data-workbench-screen] [data-calendar-tool=almanac] #calendar-form {display:grid;grid-template-columns:minmax(0,1fr) 72px;gap:0 10px}
body[data-workbench-screen] [data-calendar-tool=almanac] #calendar-form h3 {display:none}
body[data-workbench-screen] [data-calendar-tool=almanac] .calendar-fields {grid-column:1}
body[data-workbench-screen] [data-calendar-tool=almanac] .calendar-submit-row {grid-column:2;grid-row:1;align-self:end;margin-bottom:16px}
body[data-workbench-screen] [data-calendar-tool=almanac] .calendar-submit-row .submit-btn {padding:10px 6px;min-height:46px}
body[data-workbench-screen] [data-calendar-tool=almanac] .calendar-date-nav {grid-column:1/-1;grid-row:2;margin:0}
body[data-workbench-screen] [data-calendar-tool=almanac] #calendar-form > .calendar-note {grid-column:1/-1;margin:4px 0 0}
@media(max-width:780px){
 body[data-workbench-screen] #daily-page[data-calendar-tool] .ios-feature-header h2 {font-size:24px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .ios-feature-header p {font-size:13px}
 body[data-workbench-screen] .calendar-switch {margin-bottom:18px}
 body[data-workbench-screen] .calendar-layout {gap:18px}
 body[data-workbench-screen] .calendar-output {padding-top:18px}
}

/* Pick known almanac activities instead of entering unsupported keywords. */
body[data-workbench-screen] .calendar-preset-fieldset {min-width:0;margin:16px 0;padding:0;border:0}
body[data-workbench-screen] .calendar-preset-fieldset legend {padding:0;font-size:14px;font-weight:650;color:var(--wb-ink)}
body[data-workbench-screen] .calendar-preset-group {margin:14px 0}
body[data-workbench-screen] .calendar-preset-group h4 {margin:0 0 8px;font-size:12px;font-weight:500;color:var(--wb-muted)}
body[data-workbench-screen] .calendar-preset-options {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
body[data-workbench-screen] .calendar-preset-option {position:relative;display:block;min-width:0;cursor:pointer}
body[data-workbench-screen] .calendar-preset-option input {position:absolute;width:1px;height:1px;min-height:0;padding:0;margin:0;opacity:0}
body[data-workbench-screen] .calendar-preset-option span {display:flex;align-items:center;justify-content:center;min-height:44px;padding:6px;border:1px solid var(--line);border-radius:9px;font-size:13px;color:var(--wb-muted);background:transparent;box-sizing:border-box}
body[data-workbench-screen] .calendar-preset-option input:checked + span {color:var(--wb-gold-deep);border-color:var(--wb-gold-deep);background:var(--accent-soft);font-weight:650}
body[data-workbench-screen] .calendar-preset-option input:checked + span::before {content:"✓";margin-right:4px}
body[data-workbench-screen] .calendar-preset-option input:focus-visible + span {outline:2px solid var(--wb-gold-deep);outline-offset:3px}
body[data-workbench-screen] .calendar-preset-fieldset .calendar-note {margin-bottom:10px}
body[data-workbench-screen] .calendar-preset-fieldset [data-calendar-clear] {padding:6px 0}

/* Compact optional almanac selection; horizontal rows stay inside the form. */
body[data-workbench-screen] .calendar-preset-disclosure {min-width:0;margin:12px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
body[data-workbench-screen] .calendar-preset-disclosure > summary {display:flex;align-items:center;gap:8px;min-height:48px;padding:10px 0;cursor:pointer;list-style:none;font-size:14px;font-weight:600;color:var(--wb-ink)}
body[data-workbench-screen] .calendar-preset-disclosure > summary::-webkit-details-marker {display:none}
body[data-workbench-screen] .calendar-preset-disclosure > summary::after {content:"⌄";margin-left:auto;color:var(--wb-muted)}
body[data-workbench-screen] .calendar-preset-disclosure[open] > summary::after {transform:rotate(180deg)}
body[data-workbench-screen] .calendar-preset-count {font-size:12px;font-weight:400;color:var(--wb-muted)}
body[data-workbench-screen] .calendar-preset-disclosure .calendar-preset-fieldset {margin:0 0 12px}
body[data-workbench-screen] .calendar-preset-disclosure .calendar-preset-fieldset legend {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
body[data-workbench-screen] .calendar-preset-disclosure .calendar-preset-options {display:flex;gap:8px;overflow-x:auto;max-width:100%;padding:4px 3px 8px;scrollbar-width:thin;overscroll-behavior-x:contain;scroll-padding-inline:3px}
body[data-workbench-screen] .calendar-preset-disclosure .calendar-preset-option {flex:0 0 68px}
body[data-workbench-screen] .calendar-preset-disclosure .calendar-preset-group {margin:10px 0}
body[data-workbench-screen] .calendar-preset-disclosure .calendar-preset-group h4 {margin-bottom:3px}
body[data-workbench-screen] .calendar-preset-actions {display:flex;align-items:center;justify-content:space-between;gap:12px}
body[data-workbench-screen] .calendar-preset-actions [data-calendar-done] {font-weight:650}

/* Professional AI: continuous reading, honest waiting states, native mode colors. */
body[data-workbench-screen] #tool-page[data-result-view=report] #result-meta { display:none; }
body[data-workbench-screen] #tool-page[data-result-view=report] .tool-result-actions { margin-bottom:8px; }
body[data-workbench-screen] #tool-page[data-result-view=report] #result-timestamp { font-size:11px; background:none; border:0; color:var(--wb-muted); }
body[data-workbench-screen] #tool-page #result-tabs { display:flex; flex-wrap:nowrap; overflow-x:auto; scroll-behavior:auto; scroll-snap-type:none; mask-image:none; -webkit-mask-image:none; gap:6px; padding:8px 0 14px; max-width:100%; }
body[data-workbench-screen] #tool-page #result-tabs .tab-chip { flex:0 0 auto; min-height:44px; padding:9px 16px; }
body[data-workbench-screen] #result .pro-ai-document { max-width:1120px; margin:0 auto; padding:20px 0 32px; color:var(--wb-ink); min-width:0; }
body[data-workbench-screen] #result .pro-ai-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:24px; }
body[data-workbench-screen] #result .pro-ai-heading > div { min-width:0; }
body[data-workbench-screen] #result .pro-ai-eyebrow { font-size:12px; color:var(--ai-report-title); margin:0 0 6px; }
body[data-workbench-screen] #result .pro-ai-heading h3 { font-size:clamp(21px,2.2vw,28px); line-height:1.4; letter-spacing:-.025em; margin:0; color:var(--wb-ink); }
body[data-workbench-screen] #result .pro-ai-tools { display:flex; gap:4px; flex-shrink:0; }
body[data-workbench-screen] #result .ai-report-icon-action { width:44px; min-height:44px; border:0; border-radius:10px; background:none; color:var(--ai-report-title); box-shadow:none; cursor:pointer; }
body[data-workbench-screen] #result .ai-report-icon-action:hover { background:color-mix(in srgb,var(--ai-report-action) 10%,transparent); }
body[data-workbench-screen] #result .pro-ai-primary { background:var(--ai-report-action); color:var(--ai-report-action-ink); border:0; border-radius:12px; min-height:48px; padding:12px 22px; font:inherit; font-weight:650; cursor:pointer; }
body[data-workbench-screen] #result .pro-ai-intro { max-width:700px; padding:0 0 22px; }
body[data-workbench-screen] #result .pro-ai-intro > p { font-size:16px; line-height:1.8; margin:0 0 18px; color:var(--wb-ink); }
body[data-workbench-screen] #result .pro-ai-intro .pro-ai-context { font-size:14px; color:var(--wb-muted); }
body[data-workbench-screen] #result .pro-ai-intro .pro-ai-caption { font-size:12px; margin:10px 0 0; color:var(--wb-muted); }
body[data-workbench-screen] #result .pro-ai-wait { display:grid; grid-template-columns:80px minmax(0,1fr); align-items:center; gap:24px; padding:24px 0 32px; max-width:760px; }
body[data-workbench-screen] #result .pro-ai-orbit { width:80px; height:80px; fill:none; stroke:var(--ai-report-title); stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; animation:pro-ai-breathe 2.4s ease-in-out infinite; }
body[data-workbench-screen] #result .pro-ai-orbit[data-symbol=liuyao] { stroke-dasharray:80; animation:pro-ai-lines 3s ease-in-out infinite; }
body[data-workbench-screen] #result .pro-ai-orbit[data-symbol=fengshui] { animation:pro-ai-compass 4s ease-in-out infinite; }
body[data-workbench-screen] #result .pro-ai-wait-status { margin:0 0 10px; font-size:16px; line-height:1.7; color:var(--wb-ink); }
body[data-workbench-screen] #result .pro-ai-time { display:flex; flex-wrap:wrap; gap:4px 16px; font-size:12px; line-height:1.65; font-variant-numeric:tabular-nums; margin:0; color:var(--wb-muted); }
body[data-workbench-screen] #result .pro-ai-queue { font-size:12px; color:var(--wb-muted); margin:8px 0; }
body[data-workbench-screen] #result .pro-ai-queue:empty { display:none; }
body[data-workbench-screen] #result .pro-ai-text-action { border:0; background:none; color:var(--ai-report-title); font:inherit; font-size:13px; padding:10px 0; min-height:44px; cursor:pointer; }
body[data-workbench-screen] #result .pro-ai-reference { border:0; background:none; box-shadow:none; margin:8px 0; padding:0; }
body[data-workbench-screen] #result .pro-ai-reference summary { font-size:13px; min-height:44px; padding:12px 0; color:var(--wb-muted); cursor:pointer; }
body[data-workbench-screen] #result .pro-ai-reference p { font-size:13px; line-height:1.8; color:var(--wb-muted); overflow-wrap:anywhere; }
body[data-workbench-screen] #result .pro-ai-topics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 28px; list-style:none; padding:0; margin:8px 0 16px; color:var(--wb-muted); font-size:13px; }
body[data-workbench-screen] #result .pro-ai-reading-layout { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; min-width:0; }
body[data-workbench-screen] #result .pro-ai-outline { background:none; border:0; margin:0; padding:0; min-width:0; }
body[data-workbench-screen] #result .pro-ai-outline summary { min-height:44px; padding:10px 0; font-size:13px; color:var(--wb-muted); cursor:pointer; }
body[data-workbench-screen] #result .pro-ai-outline nav { display:grid; gap:2px; }
body[data-workbench-screen] #result .pro-ai-outline button { text-align:left; min-height:44px; padding:8px; border:0; border-radius:8px; background:none; color:var(--ai-report-title); font:inherit; font-size:13px; line-height:1.6; overflow-wrap:anywhere; cursor:pointer; }
body[data-workbench-screen] #result .ai-report-reading { max-width:800px; min-width:0; margin:0; padding:0; border:0; border-radius:0; box-shadow:none; background:none; }
body[data-workbench-screen] #tool-result #result .ai-report-body { color:var(--wb-ink); font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; font-size:16px; line-height:1.9; overflow-wrap:anywhere; }
body[data-workbench-screen] #tool-result #result .ai-report-body :is(p,li) { color:var(--wb-ink); line-height:inherit; }
body[data-workbench-screen] #tool-result #result .ai-report-body p { margin:0 0 18px; }
body[data-workbench-screen] #tool-result #result .ai-report-body :is(h1,h2,h3,h4,h5,h6) { color:var(--ai-report-title); font-family:inherit; line-height:1.55; margin:28px 0 12px; scroll-margin-top:24px; }
body[data-workbench-screen] #tool-result #result .ai-report-body :is(h1,h2) { font-size:21px; }
body[data-workbench-screen] #tool-result #result .ai-report-body :is(h3,h4,h5,h6) { font-size:18px; }
body[data-workbench-screen] #tool-result #result .ai-report-body > :first-child { margin-top:0; }
body[data-workbench-screen] #tool-result #result .ai-report-body :is(strong,b) { color:var(--ai-report-emphasis); font-weight:700; }
body[data-workbench-screen] #tool-result #result .ai-report-body :is(blockquote,.md-callout,.md-highlight) { background:none; border:0; border-left:3px solid var(--ai-report-title); border-radius:0; box-shadow:none; padding:4px 0 4px 16px; margin:20px 0; }
body[data-workbench-screen] #result .ai-report-body :is(pre,.md-table-wrap) { max-width:100%; overflow-x:auto; }
body[data-workbench-screen] #result .ai-report-body .md-table { min-width:360px; table-layout:auto; }
body[data-workbench-screen] #result .ai-report-body .md-table :is(th,td) { min-width:96px; }
body[data-workbench-screen] #result .pro-ai-footer { max-width:800px; margin:28px 0 0 auto; font-size:12px; color:var(--wb-muted); }
body[data-workbench-screen] #result .pro-ai-notice { color:var(--ai-report-title); font-size:14px; line-height:1.7; }
body[data-workbench-screen] #result .pro-ai-document :is(button,summary):focus-visible { outline:2px solid var(--ai-report-title); outline-offset:3px; }
@keyframes pro-ai-breathe { 0%,100% { opacity:.5; transform:scale(.94); } 50% { opacity:1; transform:scale(1); } }
@keyframes pro-ai-lines { 0%,100% { opacity:.5; stroke-dashoffset:12; } 50% { opacity:1; stroke-dashoffset:0; } }
@keyframes pro-ai-compass { 0%,100% { transform:rotate(-8deg); opacity:.65; } 50% { transform:rotate(8deg); opacity:1; } }
@media(min-width:1100px) {
 body[data-workbench-screen] #result .pro-ai-reading-layout:has(.pro-ai-outline:not([hidden])) { grid-template-columns:180px minmax(0,1fr); gap:32px; }
 body[data-workbench-screen] #result .pro-ai-outline { position:sticky; top:24px; align-self:start; max-height:calc(100dvh - 60px); overflow:auto; }
}
@media(max-width:780px) {
 body[data-workbench-screen] #result .pro-ai-document { padding:12px 0 24px; }
 body[data-workbench-screen] #result .pro-ai-heading { align-items:flex-start; gap:8px; margin-bottom:18px; }
 body[data-workbench-screen] #result .pro-ai-heading h3 { font-size:21px; }
 body[data-workbench-screen] #result .pro-ai-wait { grid-template-columns:52px minmax(0,1fr); gap:16px; padding:12px 0 20px; }
 body[data-workbench-screen] #result .pro-ai-orbit { width:52px; height:52px; }
 body[data-workbench-screen] #result .pro-ai-tools { gap:0; }
 body[data-workbench-screen] #tool-result #result .ai-report-body { font-size:15px; line-height:1.85; }
 body[data-workbench-screen] #tool-result #result .ai-report-body :is(h1,h2) { font-size:19px; }
 body[data-workbench-screen] #result .pro-ai-primary { width:100%; }
 body[data-workbench-screen] #tool-page #result-tabs .tab-chip { padding-inline:13px; }
}
@media(prefers-reduced-motion:reduce) { body[data-workbench-screen] #result .pro-ai-orbit { animation:none; opacity:1; } }
html[data-reduce-motion=true] body[data-workbench-screen] #result .pro-ai-orbit { animation:none; opacity:1; }


/* Shared professional navigation and calendar layout, September 2026. */
body[data-workbench-screen] :is(#tool-page,#daily-page) > .ios-feature-header {display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:14px;padding:12px 0 18px}
body[data-workbench-screen] :is(#tool-page,#daily-page) > .ios-feature-header h2 {font-size:24px;line-height:1.3;margin:0 0 3px}
body[data-workbench-screen] :is(#tool-page,#daily-page) .tool-back {display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:12px;background:var(--wb-surface-strong);box-shadow:none;color:var(--wb-ink);font:inherit;font-size:14px;white-space:nowrap;text-decoration:none}
body[data-workbench-screen] :is(#tool-page,#daily-page) .tool-back svg {width:16px;height:16px;flex:none}
body[data-workbench-screen] #daily-page[data-calendar-tool] {max-width:960px}
body[data-workbench-screen] #daily-page[data-calendar-tool=almanac] {max-width:800px}
body[data-workbench-screen] #daily-page[data-calendar-tool] .ios-feature-header > .tool-back {min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:12px;background:var(--wb-surface-strong);box-shadow:none;color:var(--wb-ink);font-size:14px}
body[data-workbench-screen] .calendar-workspace .calendar-switch {display:flex;width:max-content;max-width:100%;padding:3px;gap:3px;margin:0 0 20px;background:color-mix(in srgb,var(--line) 55%,transparent);border-radius:11px}
body[data-workbench-screen] .calendar-switch button {min-height:44px;min-width:114px;padding:9px 20px;border-radius:8px;font-size:14px}
body[data-workbench-screen] .calendar-layout {display:block}
body[data-workbench-screen] .calendar-workspace #calendar-form {display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(0,.75fr);gap:14px 18px;padding:20px;border:1px solid var(--line);border-radius:16px;background:var(--wb-surface-strong)}
body[data-workbench-screen] .calendar-workspace #calendar-form h3 {display:none}
body[data-workbench-screen] .calendar-workspace #calendar-form > .field {grid-column:1;grid-row:1}
body[data-workbench-screen] .calendar-workspace .calendar-fields {display:contents}
body[data-workbench-screen] .calendar-workspace #calendar-form .field {display:grid;align-content:start;gap:7px;margin:0}
body[data-workbench-screen] .calendar-workspace #calendar-form :is(input[type=date],select) {min-height:46px;border:1px solid var(--line);border-radius:10px;background:var(--wb-surface);font-size:15px;box-shadow:none}
body[data-workbench-screen] .calendar-workspace #calendar-range {grid-column:1/-1;margin:-5px 0 0;font-size:12px}
body[data-workbench-screen] .calendar-workspace .calendar-preset-disclosure {grid-column:1/-1;margin:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
body[data-workbench-screen] .calendar-workspace .calendar-preset-disclosure > summary {min-height:44px;padding:8px 0;font-size:13px}
body[data-workbench-screen] .calendar-workspace #calendar-purpose-help {grid-column:1/3;align-self:center;margin:0;font-size:12px;line-height:1.65}
body[data-workbench-screen] .calendar-workspace .calendar-submit-row {grid-column:3;grid-row:4;align-self:center}
body[data-workbench-screen] .calendar-workspace .calendar-submit-row .submit-btn {min-height:46px;border-radius:10px;font-size:14px;white-space:nowrap}
body[data-workbench-screen] .calendar-workspace .calendar-timezone-note {grid-column:1/-1;font-size:11px;margin:-4px 0 0}
body[data-workbench-screen] .calendar-output {padding:24px 0 0;border:0}
body[data-workbench-screen] #calendar-feedback {margin:0 0 12px;font-size:12px}
body[data-workbench-screen] .calendar-result-heading {display:flex;align-items:center;justify-content:space-between}
body[data-workbench-screen] .calendar-result-heading h3 {font-size:20px;line-height:1.5;margin:0 0 5px}
body[data-workbench-screen] .calendar-result-heading p {margin:0 0 16px}
body[data-workbench-screen] .calendar-result-controls {gap:12px;padding:0 0 12px;border-bottom:1px solid var(--line)}
body[data-workbench-screen] .calendar-filters {gap:4px}
body[data-workbench-screen] .calendar-filters button {min-height:44px;border-radius:8px}
body[data-workbench-screen] .calendar-candidate {grid-template-columns:164px minmax(0,1fr) 16px;min-height:86px;padding:17px 4px;gap:20px}
body[data-workbench-screen] .calendar-candidate-date strong {font-size:16px}
body[data-workbench-screen] .calendar-candidate-copy {gap:5px;font-size:13px}
body[data-workbench-screen] .calendar-match-label {font-size:13px}
body[data-workbench-screen] .calendar-empty {display:flex;align-items:center;gap:18px;min-height:132px;padding:26px 4px}
body[data-workbench-screen] .calendar-empty > svg {width:36px;height:36px;flex:none;color:var(--wb-muted);opacity:.7}
body[data-workbench-screen] .calendar-empty h3 {font-size:17px;margin:0 0 6px}
body[data-workbench-screen] .calendar-empty p {font-size:13px;margin:0;line-height:1.7}
body[data-workbench-screen] .calendar-candidates .calendar-empty {display:block}
body[data-workbench-screen] .calendar-disclaimer {margin:24px 0 0;padding-top:16px;font-size:11px}
body[data-workbench-screen] .calendar-preset-disclosure .calendar-preset-fieldset {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 24px;margin:0 0 8px}
body[data-workbench-screen] .calendar-preset-fieldset > .calendar-note,body[data-workbench-screen] .calendar-preset-actions {grid-column:1/-1}
body[data-workbench-screen] .calendar-preset-disclosure .calendar-preset-group {min-width:0;margin:4px 0}
body[data-workbench-screen] .calendar-preset-disclosure .calendar-preset-options {min-width:0}
body[data-workbench-screen] [data-calendar-tool=almanac] .calendar-workspace #calendar-form {grid-template-columns:minmax(190px,1fr) 72px minmax(230px,1fr);gap:12px 18px;align-items:end}
body[data-workbench-screen] [data-calendar-tool=almanac] .calendar-fields > .field {grid-column:1;grid-row:1}
body[data-workbench-screen] [data-calendar-tool=almanac] .calendar-workspace .calendar-submit-row {grid-column:2;grid-row:1;margin:0}
body[data-workbench-screen] [data-calendar-tool=almanac] .calendar-date-nav {grid-column:3;grid-row:1;gap:4px;margin:0}
body[data-workbench-screen] [data-calendar-tool=almanac] .calendar-date-nav button {min-height:46px}
body[data-workbench-screen] [data-calendar-tool=almanac] #calendar-form > .calendar-note {grid-column:1/-1;margin:0}
body[data-workbench-screen] .calendar-reading header {display:flex;align-items:center;gap:24px;padding:10px 0 24px}
body[data-workbench-screen] .calendar-date-number {font-size:64px;line-height:1;font-weight:650;letter-spacing:-.07em;font-variant-numeric:tabular-nums;color:var(--wb-gold-deep)}
body[data-workbench-screen] .calendar-reading h3 {font-size:23px;margin:0 0 6px;line-height:1.4}
body[data-workbench-screen] .calendar-reading header p {margin:0;font-size:14px}
body[data-workbench-screen] .calendar-almanac-lines > section {grid-template-columns:32px minmax(0,1fr);gap:18px;padding:22px 0}
body[data-workbench-screen] .calendar-almanac-lines h4 {font-size:22px;line-height:1.6;font-weight:600}
body[data-workbench-screen] .calendar-almanac-lines p {font-size:15px;line-height:1.95}
body[data-workbench-screen] .calendar-back {margin-bottom:12px}
body[data-workbench-screen] .calendar-detail-match {margin:0 0 12px;padding:10px 0 16px;font-size:13px}
body[data-workbench-screen] .calendar-facts dl {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px}
body[data-workbench-screen] .calendar-facts dl > div {min-width:0;grid-template-columns:70px minmax(0,1fr)}
@media(max-width:780px){
 body[data-workbench-screen] .calendar-workspace #calendar-form {grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:14px;border-radius:14px}
 body[data-workbench-screen] .calendar-workspace #calendar-form > .field {grid-column:1/-1}
 body[data-workbench-screen] .calendar-workspace #calendar-purpose-help {grid-column:1/-1;font-size:12px}
 body[data-workbench-screen] .calendar-workspace .calendar-submit-row {grid-column:1/-1;grid-row:auto}
 body[data-workbench-screen] .calendar-workspace .calendar-timezone-note {grid-column:1/-1;margin:0}
 body[data-workbench-screen] .calendar-workspace .calendar-switch {width:100%;margin-bottom:16px}
 body[data-workbench-screen] .calendar-switch button {flex:1;min-width:0}
 body[data-workbench-screen] .calendar-output {padding-top:20px}
 body[data-workbench-screen] .calendar-candidate {grid-template-columns:112px minmax(0,1fr) 12px;gap:12px;min-height:86px;padding:16px 2px}
 body[data-workbench-screen] .calendar-candidate-date strong {font-size:14px}
 body[data-workbench-screen] .calendar-candidate-copy {font-size:12px}
 body[data-workbench-screen] .calendar-preset-disclosure .calendar-preset-fieldset {display:block}
 body[data-workbench-screen] .calendar-preset-disclosure .calendar-preset-group {margin:10px 0}
 body[data-workbench-screen] [data-calendar-tool=almanac] .calendar-workspace #calendar-form {grid-template-columns:minmax(0,1fr) 72px;gap:8px 12px}
 body[data-workbench-screen] [data-calendar-tool=almanac] .calendar-date-nav {grid-column:1/-1;grid-row:2}
 body[data-workbench-screen] .calendar-date-number {font-size:52px}
 body[data-workbench-screen] .calendar-reading header {gap:18px;padding:4px 0 20px}
 body[data-workbench-screen] .calendar-reading h3 {font-size:19px}
 body[data-workbench-screen] .calendar-reading header p {font-size:13px}
 body[data-workbench-screen] .calendar-almanac-lines > section {gap:12px;padding:18px 0}
 body[data-workbench-screen] .calendar-facts dl {grid-template-columns:minmax(0,1fr)}
}
@media(max-width:540px){
 body[data-workbench-screen] :is(#tool-page,#daily-page) > .ios-feature-header {gap:10px;padding:8px 0 14px}
 body[data-workbench-screen] :is(#tool-page,#daily-page) > .ios-feature-header h2,body[data-workbench-screen] #daily-page[data-calendar-tool] .ios-feature-header h2 {font-size:22px}
 body[data-workbench-screen] :is(#tool-page,#daily-page) > .ios-feature-header p,body[data-workbench-screen] #daily-page[data-calendar-tool] .ios-feature-header p {font-size:12px}
 body[data-workbench-screen] :is(#tool-page,#daily-page) .tool-back,body[data-workbench-screen] #daily-page[data-calendar-tool] .ios-feature-header > .tool-back {font-size:13px;padding-inline:10px}
}

/* Shared professional tool surfaces: inputs, readings and result actions. */
body[data-workbench-screen] :is(#tool-page,#daily-page) {--tool-gap:16px;--tool-radius:14px;max-width:960px;min-width:0}
body[data-workbench-screen] #tool-page[data-stage=result] {max-width:1440px}
body[data-workbench-screen] #daily-page[data-calendar-tool=almanac] {max-width:800px}
body[data-workbench-screen] :is(#tool-page,#daily-page) > .ios-feature-header {display:grid;grid-template-columns:auto minmax(0,1fr);gap:14px;align-items:center;padding:12px 0 20px}
body[data-workbench-screen] :is(#tool-page,#daily-page) > .ios-feature-header > div {min-width:0}
body[data-workbench-screen] :is(#tool-page,#daily-page) > .ios-feature-header h2 {font-size:24px;line-height:1.35;margin:0 0 4px}
body[data-workbench-screen] :is(#tool-page,#daily-page) > .ios-feature-header p {font-size:13px;line-height:1.65;margin:0;color:var(--wb-muted)}
body[data-workbench-screen] :is(#tool-page,#daily-page) .tool-back {display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:12px;background:var(--wb-surface-strong);color:var(--wb-ink);box-shadow:none;font-size:14px;white-space:nowrap}
body[data-workbench-screen] :is(#tool-page,#daily-page) .tool-back svg {width:16px;height:16px;flex:none}
body[data-workbench-screen] #tool-page #fortune-form {max-width:none;width:100%;margin:0}
body[data-workbench-screen] #tool-page #fortune-form .ios-input-group {padding:18px;border:1px solid var(--line);border-radius:var(--tool-radius);background:var(--wb-surface-strong);box-shadow:none;margin-bottom:14px}
body[data-workbench-screen] #tool-page #fortune-form .ios-input-group h3 {font-size:15px;line-height:1.5;margin:0 0 14px}
body[data-workbench-screen] #tool-page #fortune-form .field {gap:7px}
body[data-workbench-screen] #tool-page #fortune-form .field > span {font-size:13px;font-weight:600}
body[data-workbench-screen] #tool-page #fortune-form :is(input,select,textarea) {font-size:16px;min-height:46px;border-radius:10px;box-shadow:none}
body[data-workbench-screen] #tool-page #fortune-form .advanced {padding-block:0}
body[data-workbench-screen] #tool-page #fortune-form .advanced[open] {padding-bottom:18px}
body[data-workbench-screen] :is(#tool-page,#daily-page) .ghost-btn {min-height:44px;border-radius:10px;box-shadow:none;font-size:13px}
body[data-workbench-screen] :is(#tool-page,#daily-page) .submit-btn {min-height:48px;border-radius:10px;box-shadow:none;font-size:15px}
body[data-workbench-screen] #tool-page #fortune-form .ios-submit {padding-bottom:20px}
body[data-workbench-screen] #tool-page .tool-result-actions {display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:0 0 18px;padding:12px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
body[data-workbench-screen] #tool-page .tool-result-actions #result-timestamp {font-size:12px;color:var(--wb-muted)}
body[data-workbench-screen] #tool-page .tool-export > summary {border-radius:10px;min-height:44px;padding:10px 12px;font-size:13px}
body[data-workbench-screen] #daily-content > :is(.daily-reading,.fortune-draw) {max-width:760px;margin:0 auto;padding:22px 0;border:0;border-top:1px solid var(--line);border-radius:0;background:none;box-shadow:none}
body[data-workbench-screen] #daily-content .daily-reading {font-size:15px;line-height:1.9}
body[data-workbench-screen] #daily-content .daily-reading :is(h3,h4) {color:var(--wb-ink);line-height:1.5}
body[data-workbench-screen] #daily-content .daily-reading h3 {font-size:24px;margin:8px 0 18px}
body[data-workbench-screen] #daily-content .daily-reading h4 {font-size:16px;margin:24px 0 8px}
body[data-workbench-screen] #daily-content .daily-reading p {margin:8px 0 16px;overflow-wrap:anywhere}
body[data-workbench-screen] #daily-content .daily-reading details {border-top:1px solid var(--line);padding:12px 0}
body[data-workbench-screen] #daily-content .daily-reading summary {min-height:44px;padding:10px 0;cursor:pointer;font-size:15px;font-weight:600}
body[data-workbench-screen] #daily-content > .fortune-draw {padding-block:24px;max-width:600px}
body[data-workbench-screen] #daily-content .fortune-draw h3 {font-size:24px;margin:20px 0 12px}
body[data-workbench-screen] #daily-content .fortune-draw p {font-size:14px;line-height:1.85;color:var(--wb-muted)}
body[data-workbench-screen] #daily-content .fortune-vessel {width:76px;height:98px;margin:20px auto;font-size:28px;border-width:2px;border-radius:12px 12px 26px 26px}
body[data-workbench-screen] #daily-content .fortune-draw .submit-btn {width:min(100%,320px);margin-top:16px}
body[data-workbench-screen] #daily-content > .field {margin:0 0 16px;gap:7px}
body[data-workbench-screen] #daily-content #hexagram-search {min-height:46px;border-radius:10px;font-size:16px}
body[data-workbench-screen] #daily-content #hexagram-count {font-size:12px;color:var(--wb-muted);margin:8px 0 12px}
body[data-workbench-screen] #daily-content .hexagram-library {grid-template-columns:repeat(2,minmax(0,1fr));gap:0 28px}
body[data-workbench-screen] #daily-content .hexagram-library-row {grid-template-columns:46px minmax(0,1fr);gap:16px;min-height:96px;padding:16px 2px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:none;box-shadow:none}
body[data-workbench-screen] #daily-content .hexagram-library-row strong {font-size:17px}
body[data-workbench-screen] #daily-content .hexagram-library-row small {font-size:12px}
body[data-workbench-screen] #daily-content .hexagram-library-row .daily-hex-lines {width:46px;gap:4px;margin:0}
body[data-workbench-screen] #daily-content .hexagram-library-row .cast-line {height:4px}
body[data-workbench-screen] #daily-content .hexagram-detail {max-width:760px;margin:16px auto 0;gap:0}
body[data-workbench-screen] #daily-content .hexagram-detail > .ios-input-group {padding:20px 0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:none;box-shadow:none;margin:0}
body[data-workbench-screen] #daily-content .hexagram-detail > details.ios-input-group {padding:0}
body[data-workbench-screen] #daily-content .hexagram-detail > details > summary {padding:16px 0;min-height:48px;font-size:16px}
body[data-workbench-screen] #daily-content .hexagram-detail h3 {font-size:18px}
body[data-workbench-screen] #daily-content .hexagram-detail .daily-reading h3 {font-size:26px}
body[data-workbench-screen] #daily-content .hexagram-detail p {font-size:15px;line-height:1.95;margin:8px 0 20px;overflow-wrap:anywhere}
body[data-workbench-screen] #daily-content .hexagram-related {display:flex;flex-wrap:wrap;gap:8px}
body[data-workbench-screen] #daily-content [data-library-back] {margin-bottom:8px}
@media(hover:hover){
 body[data-workbench-screen] #daily-content .hexagram-library-row:hover {background:color-mix(in srgb,var(--line) 25%,transparent)}
}
@media(max-width:780px){
 body[data-workbench-screen] #daily-content .hexagram-library {grid-template-columns:minmax(0,1fr)}
 body[data-workbench-screen] #tool-page #fortune-form .ios-input-group {padding:14px;border-radius:14px}
 body[data-workbench-screen] #tool-page #fortune-form .advanced {padding-block:0}
 body[data-workbench-screen] #tool-page #fortune-form .advanced[open] {padding-bottom:14px}
 body[data-workbench-screen] #daily-content > :is(.daily-reading,.fortune-draw) {padding-block:16px}
 body[data-workbench-screen] #daily-content .hexagram-detail > .ios-input-group {padding-block:16px}
 body[data-workbench-screen] #daily-content .hexagram-detail > details.ios-input-group {padding-block:0}
}
@media(max-width:540px){
 body[data-workbench-screen] :is(#tool-page,#daily-page) > .ios-feature-header {gap:10px;padding:8px 0 16px}
 body[data-workbench-screen] :is(#tool-page,#daily-page) > .ios-feature-header h2 {font-size:22px}
 body[data-workbench-screen] :is(#tool-page,#daily-page) > .ios-feature-header p {font-size:12px}
 body[data-workbench-screen] :is(#tool-page,#daily-page) .tool-back {font-size:13px;padding-inline:10px}
 body[data-workbench-screen] #tool-page .tool-result-actions {gap:8px}
 body[data-workbench-screen] #daily-content .daily-hex-lines {width:140px;gap:9px;margin:22px auto}
 body[data-workbench-screen] #daily-content .hexagram-library-row .daily-hex-lines {width:46px;gap:4px;margin:0}
}

body[data-workbench-screen] #tool-page > .ios-feature-header .tool-back,body[data-workbench-screen] #daily-page > .ios-feature-header .tool-back,body[data-workbench-screen] #daily-content [data-library-back].tool-back {border-radius:12px;min-height:44px;box-shadow:none}

body[data-workbench-screen=chart] #tool-page[data-stage=input] {max-width:960px}
body[data-workbench-screen=chart] #tool-page[data-tool=liuyao][data-stage=input] {max-width:960px}
body[data-workbench-screen] #tool-page #fortune-form > .ios-submit > .submit-btn,body[data-workbench-screen] #daily-content .fortune-draw .submit-btn {background:#805818;color:#fff;border:0;box-shadow:none}
html[data-theme=dark] body[data-workbench-screen] #tool-page #fortune-form > .ios-submit > .submit-btn,html[data-theme=dark] body[data-workbench-screen] #daily-content .fortune-draw .submit-btn {background:#ebbd67;color:#282015}
body[data-workbench-screen] #tool-page #fortune-form :is(input,select,textarea) {font-weight:400;background:var(--wb-surface);border:1px solid var(--line)}
/* Per-tool reading surfaces. Preserve the shared AI report and input components. */
body[data-workbench-screen] #tool-page{--tool-color:#996000;--tool-contrast:#fff}
body[data-workbench-screen] #tool-page[data-tool-mode=ziwei]{--tool-color:#586aa9}
body[data-workbench-screen] #tool-page:is([data-tool-mode=analyze],[data-tool-mode=wuxing]){--tool-color:#397d68}
body[data-workbench-screen] #tool-page[data-tool-mode=tongzi]{--tool-color:#a64b40}
body[data-workbench-screen] #tool-page[data-tool-mode=fengshui]{--tool-color:#3c7591}
[data-theme=dark] body[data-workbench-screen] #tool-page{--tool-color:#f7b500;--tool-contrast:#161718}
[data-theme=dark] body[data-workbench-screen] #tool-page[data-tool-mode=ziwei]{--tool-color:#aebaff}
[data-theme=dark] body[data-workbench-screen] #tool-page:is([data-tool-mode=analyze],[data-tool-mode=wuxing]){--tool-color:#9ed8c1}
[data-theme=dark] body[data-workbench-screen] #tool-page[data-tool-mode=tongzi]{--tool-color:#f0aaa0}
[data-theme=dark] body[data-workbench-screen] #tool-page[data-tool-mode=fengshui]{--tool-color:#9cd0e3}
body[data-workbench-screen] #tool-page #result-tabs .tab-chip.active{background:var(--tool-color);color:var(--tool-contrast);box-shadow:none}
body[data-workbench-screen] #tool-page .tool-input-receipt{font-size:12px;color:var(--wb-muted);margin:0 0 6px}
body[data-workbench-screen] #tool-page .tool-input-receipt>summary{min-height:44px;display:list-item;align-content:center;cursor:pointer;overflow-wrap:anywhere;color:var(--wb-muted)}
body[data-workbench-screen] #tool-page .tool-input-receipt .meta-shell{margin:0;padding:12px;background:transparent;border:0;box-shadow:none}
body[data-workbench-screen] #tool-page:not([data-result-view=report]) #result{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
body[data-workbench-screen] #tool-page:not([data-result-view=report]) #result .result-stack>.result-card{background:transparent;border:0;box-shadow:none;padding:12px 0;max-width:1200px;width:100%;margin:0 auto}
body[data-workbench-screen] #tool-page:not([data-result-view=report]) #result .result-card>.card-head{padding:0 0 16px;border:0}
body[data-workbench-screen] #tool-page:not([data-result-view=report]) #result .result-card>.card-body{padding:0}
body[data-workbench-screen] #tool-page:not([data-result-view=report]) #result :is(h3,h4,p,small,strong){font-family:inherit}
body[data-workbench-screen] #tool-page:not([data-result-view=report]) #result .card-head h3{font-size:20px;color:var(--tool-color)}
body[data-workbench-screen] #tool-page:not([data-result-view=report]) #result .card-head p{font-size:13px;line-height:1.65;margin-top:6px}
body[data-workbench-screen] #tool-page #result .tool-section-link{color:var(--tool-color)}
body[data-workbench-screen] #tool-page #result .tool-evidence-list p{color:var(--wb-ink)}
body[data-workbench-screen] #tool-page #result .tool-palace-focus article{border-color:var(--tool-color)}
#result .tool-pillars caption.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#result .tool-section-link{display:inline-flex;align-items:center;gap:10px;min-height:44px;padding:8px 0;margin:6px 18px 0 0;background:none;border:0;border-radius:6px;color:var(--pro-ai-ink,var(--accent));font:inherit;font-size:13px;font-weight:650;text-align:left;cursor:pointer;white-space:normal}
#result .tool-section-link:focus-visible{outline:2px solid currentColor;outline-offset:4px}
#result .tool-inline-facts{display:flex;flex-wrap:wrap;gap:18px 30px;margin:20px 0}
#result .tool-inline-facts>div{display:grid;gap:5px}
#result .tool-inline-facts dt,#result :is(.tool-palace-focus,.tool-direction-grid,.tool-hex-glance,.tool-question,.tool-evidence-list) small{color:var(--muted);font-size:12px;line-height:1.6}
#result .tool-inline-facts dd{margin:0;font-size:16px;font-weight:650;color:var(--ink)}
#result .tool-pillar-wrap{max-width:100%;overflow-x:auto}
#result .tool-pillars{width:100%;table-layout:fixed;border-collapse:collapse;text-align:center;font-size:13px}
#result .tool-pillars :is(th,td){padding:12px 5px;border:0;overflow-wrap:anywhere}
#result .tool-pillars th{font-weight:500;color:var(--muted)}
#result .tool-pillars th:first-child{width:44px;font-size:12px}
#result .tool-pillars .is-day{background:color-mix(in srgb,#397d68 10%,transparent)}
#result .tool-pillars .pillar-glyph-row td{font-size:32px;font-weight:600;line-height:1.3;color:var(--ink)}
#result .tool-pillars .pillar-glyph-row .is-day{color:#397d68}
[data-theme=dark] #result .tool-pillars .pillar-glyph-row .is-day{color:#9ed8c1}
#result .tool-elements{display:grid;gap:20px;padding:12px 0 20px}
#result .tool-element{--element-color:#397d68;display:grid;grid-template-columns:28px minmax(0,1fr) 66px;align-items:center;column-gap:12px;row-gap:4px}
#result .tool-element[data-element="1"]{--element-color:#b95545}
#result .tool-element[data-element="2"]{--element-color:#986d2f}
#result .tool-element[data-element="3"]{--element-color:#887440}
#result .tool-element[data-element="4"]{--element-color:#497baa}
[data-theme=dark] #result .tool-element{--element-color:#9ed8c1}
[data-theme=dark] #result .tool-element[data-element="1"]{--element-color:#f0aaa0}
[data-theme=dark] #result .tool-element[data-element="2"]{--element-color:#d8b481}
[data-theme=dark] #result .tool-element[data-element="3"]{--element-color:#e0cc8b}
[data-theme=dark] #result .tool-element[data-element="4"]{--element-color:#a4c7ec}
#result .tool-element>strong{grid-row:span 2;font-size:22px;color:var(--element-color)}
#result .tool-element>b{text-align:right;font-size:13px;font-variant-numeric:tabular-nums;color:var(--ink)}
#result .tool-element>small{grid-column:2/4;color:var(--muted);font-size:11px}
#result .tool-element-track{height:8px;background:var(--line);border-radius:8px;overflow:hidden}
#result .tool-element-track span{display:block;height:100%;background:var(--element-color);border-radius:inherit}
#result .tool-question{margin:0 0 20px}
#result .tool-question h3{font-size:clamp(18px,2vw,25px);line-height:1.55;margin:5px 0;overflow-wrap:anywhere;color:var(--ink)}
#result .tool-hex-glance{display:grid;grid-template-columns:minmax(150px,1fr) minmax(0,1fr);gap:24px;align-items:center;padding:12px 0 22px}
#result .tool-hex-lines{display:grid;gap:12px}
#result .tool-hex-line{display:grid;grid-template-columns:42px minmax(50px,1fr) 48px;gap:8px;align-items:center;color:var(--ink)}
#result .tool-hex-line b{font-size:11px;font-weight:600}
#result .tool-hex-line.is-moving{color:#996000}
[data-theme=dark] #result .tool-hex-line.is-moving{color:#f7b500}
#result .tool-yao{display:flex;gap:0;height:7px;color:inherit}
#result .tool-yao.yin{gap:12px}
#result .tool-yao i{flex:1;background:currentColor}
#result .tool-hex-reading h3{font-size:24px;margin:8px 0;color:var(--ink)}
#result .tool-palace-focus{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:28px;padding:10px 0}
#result .tool-palace-focus article{padding:0 0 0 16px;border-left:3px solid #aebaff}
#result .tool-palace-focus h3{font-size:22px;margin:8px 0;color:var(--ink)}
#result .tool-palace-focus p{font-size:16px;line-height:1.7;margin:8px 0;color:var(--ink)}
#result .tool-direction-layout{display:grid;grid-template-columns:minmax(240px,1fr) minmax(180px,.8fr);gap:28px;align-items:center}
#result .tool-direction-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;text-align:center}
#result :is(.tool-direction-cell,.tool-direction-center){display:flex;flex-direction:column;justify-content:center;gap:4px;padding:12px 4px;min-width:0;border-radius:10px;background:var(--panel);overflow-wrap:anywhere}
#result .tool-direction-cell strong{font-size:16px;color:var(--ink)}
#result .tool-direction-cell span{font-size:12px;color:var(--ink)}
#result .tool-direction-cell[data-luck=good]{background:color-mix(in srgb,#397d68 10%,transparent)}
#result .tool-direction-cell[data-luck=caution]{background:color-mix(in srgb,#a64b40 10%,transparent)}
#result .tool-direction-center{background:none}
#result .tool-direction-center strong{font-size:27px;color:var(--ink)}
#result .tool-direction-note h3{font-size:18px;color:var(--ink)}
#result .tool-direction-note p{line-height:1.85}
#result .tool-evidence-list{padding:0;list-style:none;counter-reset:evidence;display:grid;gap:24px;margin:12px 0 24px}
#result .tool-evidence-list li{position:relative;padding-left:40px;counter-increment:evidence;min-width:0}
#result .tool-evidence-list li:before{content:counter(evidence,decimal-leading-zero);position:absolute;left:0;top:3px;font-size:12px;font-variant-numeric:tabular-nums;color:var(--muted)}
#result .tool-evidence-list h4{font-size:17px;margin:0 0 6px;color:var(--ink)}
#result .tool-evidence-list p{margin:0 0 6px;line-height:1.85;overflow-wrap:anywhere;color:var(--ink)}
#result .tool-reading-list{padding-left:20px;line-height:1.9}
@media(max-width:600px){
 #result .tool-palace-focus{grid-template-columns:1fr;gap:20px}
 #result .tool-palace-focus h3{font-size:19px}
 #result .tool-direction-layout{grid-template-columns:1fr;gap:16px}
 #result .tool-hex-glance{grid-template-columns:1fr;gap:18px}
 #result .tool-hex-lines{max-width:340px;width:100%}
 #result .tool-hex-reading h3{font-size:20px;display:inline;margin-right:12px}
 #result .tool-hex-reading>small:last-child{display:block;margin-top:8px}
 #result .tool-hex-reading p{display:inline}
 #result .tool-hex-reading>small:first-child{display:block}
 #result .tool-pillars :is(th,td){padding:10px 3px;font-size:11px}
 #result .tool-pillars .pillar-glyph-row td{font-size:27px}
 #result .tool-inline-facts{gap:14px 22px;margin:16px 0}
}


/* Mobile calendar: readable date inputs, compact form and stacked result controls. */
@media (max-width:640px) {
 body[data-workbench-screen] #daily-page[data-calendar-tool] {width:100%;min-width:0;padding-bottom:calc(84px + env(safe-area-inset-bottom,0px))}
 body[data-workbench-screen] #daily-page[data-calendar-tool] > .ios-feature-header {gap:10px;padding:8px 0 14px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-workspace {min-width:0}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-switch {margin:0 0 18px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-switch button {min-height:44px;padding:8px 12px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-workspace #calendar-form {grid-template-columns:minmax(166px,1.65fr) minmax(0,1fr);gap:10px 12px;padding:0 0 18px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;box-shadow:none}
 body[data-workbench-screen] #daily-page[data-calendar-tool] #calendar-form .field {min-width:0;gap:6px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] #calendar-form .field > span {font-size:13px;font-weight:550;line-height:1.4}
 body[data-workbench-screen] #daily-page[data-calendar-tool] #calendar-form :is(input[type=date],select) {box-sizing:border-box;display:block;width:100%;min-width:0;max-width:100%;height:46px;min-height:46px;margin:0;padding:10px 11px;font-family:inherit;font-size:16px;font-weight:400;line-height:24px;background:var(--wb-surface-strong)}
 body[data-workbench-screen] #daily-page[data-calendar-tool] #calendar-form input[type=date]::-webkit-date-and-time-value {text-align:left;min-height:24px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] #calendar-range {margin:0;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-preset-disclosure {border-bottom:0}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-preset-disclosure > summary {min-height:44px;padding:10px 0}
 body[data-workbench-screen] #daily-page[data-calendar-tool] #calendar-purpose-help {margin:-4px 0 0;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-submit-row {display:flex;gap:8px;margin:2px 0 0;min-width:0}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-submit-row .submit-btn {flex:1;width:auto;height:46px;min-height:46px;padding:10px 12px;font-size:15px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-timezone-note {line-height:1.5;font-size:11px;overflow-wrap:anywhere}
 body[data-workbench-screen] #daily-page[data-calendar-tool=almanac] .calendar-workspace #calendar-form {grid-template-columns:minmax(0,1fr) 70px;gap:8px 10px}
 body[data-workbench-screen] #daily-page[data-calendar-tool=almanac] .calendar-submit-row {align-self:end;margin:0}
 body[data-workbench-screen] #daily-page[data-calendar-tool=almanac] .calendar-date-nav {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0}
 body[data-workbench-screen] #daily-page[data-calendar-tool=almanac] .calendar-date-nav button {min-height:44px;padding:8px;font-size:14px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-output {min-width:0;padding-top:18px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] #calendar-feedback {margin:0 0 8px;font-size:12px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-result-heading {display:block}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-result-heading h3 {font-size:18px;line-height:1.5;overflow-wrap:anywhere}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-result-heading p {font-size:12px;margin:0 0 12px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-result-controls {display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding:0 0 10px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-filters {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;width:100%;min-width:0}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-filters button {min-width:0;min-height:44px;padding:8px 4px;font-size:12px;white-space:nowrap}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-sort {justify-content:space-between;width:100%;font-size:13px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-sort select {min-height:44px;font-size:16px;max-width:70%;padding:8px 10px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-candidate {grid-template-columns:minmax(88px,.85fr) minmax(0,1.15fr) 12px;gap:10px;min-height:80px;padding:14px 0}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-candidate-date strong {font-size:14px;line-height:1.5}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-candidate-copy {font-size:13px;line-height:1.6;overflow-wrap:anywhere}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-reading header {gap:14px;align-items:center;padding:6px 0 16px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-reading header > div {min-width:0}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-date-number {flex:none;font-size:44px;letter-spacing:-.04em}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-reading h3 {font-size:17px;line-height:1.5;margin:0 0 4px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-reading header p {font-size:13px;line-height:1.6}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-almanac-lines > section {grid-template-columns:24px minmax(0,1fr);gap:12px;padding:16px 0}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-almanac-lines h4 {font-size:20px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-almanac-lines p {font-size:14px;line-height:1.9}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-empty {min-height:100px;padding:18px 0;gap:14px}
 body[data-workbench-screen] #daily-page[data-calendar-tool] .calendar-disclaimer {margin-top:18px;padding-top:14px;font-size:12px;line-height:1.7}
 body[data-workbench-screen] #daily-page[data-calendar-tool] :is(button,input,select,summary) {scroll-margin-bottom:100px}
}

/* Align almanac date controls at every viewport size. */
body[data-workbench-screen] #daily-page[data-calendar-tool=almanac] .calendar-workspace .calendar-submit-row {align-self:end;margin:0}
body[data-workbench-screen] #daily-page[data-calendar-tool=almanac] #calendar-form .submit-btn {box-sizing:border-box;height:46px;min-height:46px;padding-block:10px;line-height:24px}


/* ================================================
   移动端专属增强 (新增)
   ================================================ */
/* ================================================
   移动端 UX 专属增强
   针对 iOS/Android 触控体验的细化优化
   ================================================ */

/* ── 移动端视口检测 ── */
@media (max-width: 780px) {
  
  /* Safe Area 支持 (iOS notch) */
  :root {
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
    --safe-left: env(safe-area-inset-left);
    --safe-right: env(safe-area-inset-right);
  }
  
  /* ── 移动端专属：滚动优化 ── */
  body {
    -webkit-overflow-scrolling: touch;
  }
  
  /* 禁用iOS缩放 */
  input,
  textarea,
  select {
    font-size: 16px !important; /* 防止iOS自动放大 */
  }
  
  /* ── 移动端编辑面板 ── */
  #mobile-edit-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--surface-panel-strong);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
    padding: var(--space-md) var(--space-md) calc(var(--space-md) + var(--safe-bottom, 0px));
    transition: transform var(--transition-base);
  }
  
  #mobile-edit-panel[hidden] {
    transform: translateY(100%);
  }
  
  .mobile-edit-panel-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 20px;
    min-height: var(--touch-target);
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
  }
  
  .mobile-edit-panel-main:active {
    transform: scale(0.97);
    opacity: 0.9;
  }
  
  /* ── 移动端模式网格 ── */
  .mobile-mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--space-sm);
    padding: var(--space-md);
  }
  
  .mobile-mode-grid > button {
    min-height: 56px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
  }
  
  /* ── 紫微移动端布局 ── */
  .ziwei-mobile-chart {
    display: grid;
    gap: var(--space-md);
    padding: var(--space-md);
  }
  
  .ziwei-mobile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .ziwei-mobile-core {
    padding: var(--space-lg);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  
  .ziwei-mobile-core-eyebrow {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }
  
  .ziwei-mobile-core-foot {
    display: block;
    margin-top: var(--space-sm);
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
  }
  
  .ziwei-mobile-palace {
    padding: var(--space-md);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-panel);
    transition: all var(--transition-base);
  }
  
  .ziwei-mobile-palace:active {
    transform: scale(0.98);
    background: var(--accent-soft);
  }
  
  .ziwei-mobile-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
  }
  
  .ziwei-mobile-head strong {
    font-size: 1.1rem;
    color: var(--ink);
  }
  
  .ziwei-mobile-head span {
    font-size: 0.9rem;
    color: var(--muted);
  }
  
  .ziwei-mobile-corner {
    position: absolute;
    top: var(--space-xs);
    right: var(--space-xs);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 600;
  }
  
  .ziwei-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
  }
  
  .ziwei-meta-row.compact {
    gap: 6px;
  }
  
  /* ── 六爻移动端列表 ── */
  .hexagram-mobile-list {
    display: grid;
    gap: var(--space-md);
  }
  
  .mobile-line-card {
    padding: var(--space-md);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-panel);
    cursor: pointer;
  }
  
  .mobile-line-card.changing {
    border-color: var(--accent);
    background: var(--accent-soft);
  }
  
  .mobile-line-card summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    font-weight: 600;
    list-style: none;
  }
  
  .mobile-line-card summary::-webkit-details-marker {
    display: none;
  }
  
  .mobile-line-card[open] summary {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--line);
  }
  
  /* ── 移动端表单增强 ── */
  .field-row {
    grid-template-columns: 1fr !important; /* 移动端强制单列 */
  }
  
  /* ── 移动端按钮组 ── */
  .button-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
  }
  
  .button-group > button,
  .button-group > a {
    width: 100%;
    justify-content: center;
  }
  
  /* ── 移动端卡片列表 ── */
  .history-list,
  .result-stack,
  .analysis-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* ── 移动端工作区侧边栏 ── */
  .workspace-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1001;
    width: 85vw !important;
    max-width: 320px;
    background: var(--surface-panel-strong);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%);
    transition: transform var(--transition-base);
  }
  
  .workspace-sidebar.expanded {
    transform: translateX(0);
  }
  
  .workspace-sidebar.collapsed {
    width: 0 !important;
    transform: translateX(-100%);
  }
  
  /* 移动端侧边栏遮罩 */
  .workspace-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
  }
  
  .workspace-sidebar.expanded ~ .workspace-sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  
  /* ── 移动端面板标题 ── */
  .panel-title {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-md);
  }
  
  .panel-title h2 {
    font-size: 1.25rem;
  }
  
  /* ── 移动端 Hero 区域 ── */
  .hero-brand {
    width: 100%;
  }
  
  .app-brand-lockup {
    flex-direction: row;
    align-items: center;
  }
  
  .app-brand-logo {
    width: 48px;
    height: 48px;
  }
  
  /* ── 移动端字体缩放 ── */
  h1 {
    font-size: clamp(1.75rem, 8vw, 2.5rem) !important;
    line-height: 1.2;
  }
  
  h2 {
    font-size: clamp(1.25rem, 5vw, 1.75rem) !important;
  }
  
  h3 {
    font-size: clamp(1.1rem, 4vw, 1.5rem) !important;
  }
  
  /* ── 移动端间距调整 ── */
  .page {
    padding: var(--space-md) var(--space-md) calc(80px + var(--safe-bottom, 0px));
  }
  
  .control-panel,
  .result-panel {
    padding: var(--space-md);
  }
  
  /* ── 移动端滚动容器 ── */
  .scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .scroll-container::-webkit-scrollbar {
    display: none;
  }
  
  /* ── 移动端 Tab 滚动 ── */
  .tab-row {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    display: flex;
    gap: var(--space-sm);
    padding-bottom: var(--space-xs);
  }
  
  .tab-row::-webkit-scrollbar {
    display: none;
  }
  
  .tab-chip {
    flex-shrink: 0;
    min-width: 100px;
  }
}

/* ── 小屏手机额外优化 (480px) ── */
@media (max-width: 480px) {
  :root {
    --space-lg: 12px;
    --space-md: 10px;
  }
  
  .hero {
    padding: var(--space-md);
    border-radius: var(--radius-sm);
  }
  
  .panel {
    border-radius: var(--radius-md);
  }
  
  .workbench-nav-item {
    font-size: 0.7rem;
    padding: 8px 6px;
  }
  
  .app-brand-logo {
    width: 40px;
    height: 40px;
  }
}

/* ── 横屏模式优化 ── */
@media (max-width: 780px) and (orientation: landscape) {
  .page {
    padding-bottom: calc(60px + var(--safe-bottom, 0px));
  }
  
  .workbench-nav {
    padding: 6px var(--space-sm) calc(6px + var(--safe-bottom, 0px));
  }
  
  .workbench-nav-item {
    padding: 8px 12px;
    font-size: 0.75rem;
  }
}



/* ========== 商店页面优化层 (2026-10-03) ========== */
/* ========================================
   ichingtools 商店页面优化层
   目标：更宽的布局 + 更高的内容密度 + 首屏完整显示
   ======================================== */

/* ==================== 桌面端优化 ==================== */

/* 1. 增加页面最大宽度：1160px → 1400px */
body.ios-store .store-shell {
  width: min(100%, 1400px);
  max-width: 1400px;
  padding: 20px 32px 32px;
}

/* 2. 压缩Hero区域，减少50%垂直空间 */
body.ios-store .store-intro {
  padding: 32px 0 16px;
  text-align: center;
}

body.ios-store .store-intro .store-kicker {
  font-size: 12px;
  font-weight: 700;
  color: var(--shop-accent, #a97f13);
  letter-spacing: 1.5px;
  margin: 0 0 10px;
}

body.ios-store .store-intro h1 {
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 750;
  letter-spacing: -1.4px;
  line-height: 1.25;
  margin: 0 0 12px;
}

body.ios-store .store-intro > p:last-child {
  font-size: 14px;
  line-height: 1.7;
  color: var(--shop-muted);
  margin: 0;
}

/* 3. 压缩账户信息卡片 */
body.ios-store .store-account {
  max-width: 100%;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 16px 20px;
  gap: 20px;
  border-radius: 14px;
  background: var(--shop-card);
}

body.ios-store .store-account > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  text-align: left;
}

body.ios-store .store-account span,
body.ios-store .store-account small {
  font-size: 11px;
  color: var(--shop-muted);
}

body.ios-store .store-account strong {
  font-size: 15px;
}

body.ios-store .store-account #store-auth-points {
  font-size: 20px;
}

/* 4. 优化分段控件 */
body.ios-store .store-segments {
  margin: 0 auto 24px;
}

body.ios-store .store-segments button {
  min-width: 110px;
  padding: 10px 20px;
  font-size: 13px;
}

/* 5. 压缩章节标题 */
body.ios-store .store-section-heading {
  margin: 20px 0 16px;
  align-items: center;
}

body.ios-store .store-section-heading h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
}

body.ios-store .store-section-heading p {
  font-size: 12px;
  color: var(--shop-muted);
  margin: 0;
  line-height: 1.6;
}

/* 6. 优化产品网格 - 积分卡片3列 */
body.ios-store #store-products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* 7. 会员方案3列并排（桌面端） */
body.ios-store #store-products-grid.is-membership {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: none;
  gap: 14px;
}

/* 8. 压缩卡片内边距和间距 */
body.ios-store .store-catalog-card {
  padding: 18px 16px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--shop-line);
  background: var(--shop-card);
  position: relative;
  min-width: 0;
}

body.ios-store .store-catalog-card h3 {
  font-size: 14px;
  margin: 0 0 12px;
  font-weight: 650;
  color: var(--shop-muted);
}

/* 9. 优化积分卡片 - 压缩字体和间距 */
.store-point-total {
  font-size: 36px;
  font-weight: 750;
  letter-spacing: -1.5px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.store-point-total span {
  font-size: 13px;
  letter-spacing: 0;
  margin-left: 6px;
  font-weight: 500;
  color: var(--shop-muted);
}

.store-point-equation {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--shop-muted);
  min-height: auto;
  margin: 8px 0 10px;
}

.store-bonus {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 6px;
  color: #72520b;
  background: #f7e3a0;
  font-weight: 750;
  font-size: 10px;
}

.store-value-meter {
  height: 4px;
  border-radius: 3px;
  display: flex;
  overflow: hidden;
  background: var(--shop-line);
  margin: 0 0 14px;
}

body.ios-store .store-catalog-card .store-price {
  font-size: 20px;
  margin: 0 0 4px;
  letter-spacing: -0.4px;
}

.store-unit-price {
  font-size: 11px;
  color: var(--shop-muted);
  margin-bottom: 14px;
  display: block;
  font-variant-numeric: tabular-nums;
}

body.ios-store .store-catalog-card > button {
  margin-top: auto;
  min-height: 42px;
  background: transparent;
  border: 1px solid var(--shop-line);
  font-weight: 700;
  border-radius: 9px;
  color: var(--shop-text);
  font-size: 13px;
}

/* 10. 优化会员方案卡片 */
body.ios-store .store-plan {
  padding: 20px 16px;
}

.store-plan-name {
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -1.2px;
  margin: 0 0 6px;
}

.store-plan-caption {
  font-size: 12px;
  line-height: 1.6;
  color: var(--shop-muted);
  margin-bottom: 16px;
  min-height: auto;
}

.store-plan-cycle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--shop-line);
  padding-bottom: 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--shop-muted);
}

body.ios-store .store-plan-cycle select {
  width: 130px;
  min-width: 0;
  margin: 0;
  padding: 8px;
  font-size: 12px;
  color: var(--shop-text);
  background: var(--shop-bg);
  border: 1px solid var(--shop-line);
  border-radius: 8px;
}

.store-monthly-equivalent {
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -1.4px;
  line-height: 1.2;
  min-height: auto;
  font-variant-numeric: tabular-nums;
}

.store-monthly-equivalent small {
  font-size: 12px;
  font-weight: 450;
  letter-spacing: 0;
  color: var(--shop-muted);
  margin-left: 5px;
}

.store-cycle-total {
  font-size: 11px;
  color: var(--shop-muted);
  margin: 8px 0;
  line-height: 1.7;
  min-height: auto;
}

.store-plan-saving {
  min-height: auto;
  font-size: 11px;
  color: var(--shop-muted);
  margin-bottom: 14px;
}

.store-plan-features {
  list-style: none;
  padding: 16px 0 0;
  margin: 16px 0 0;
  border-top: 1px solid var(--shop-line);
  display: grid;
  gap: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.store-plan-features li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.store-plan-features svg {
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 1px;
  color: #ad8728;
}

/* 11. 优化billing switch */
body.ios-store .store-billing-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 4px auto 24px;
  border: 1px solid var(--shop-line);
  border-radius: 12px;
  background: var(--shop-card);
}

body.ios-store .store-billing-switch button {
  min-width: 90px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 9px 14px;
  color: var(--shop-muted);
  font-size: 13px;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.store-billing-switch button span {
  font-size: 9px;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--shop-bg);
  color: var(--shop-accent);
}

/* 12. 优化Plan Benefits表格 */
.store-plan-benefits {
  border-top: 1px solid var(--shop-line);
  margin: 16px 0 0;
  padding: 4px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.store-plan-benefits > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 10px 0;
  border-bottom: 1px solid var(--shop-line);
}

.store-plan-benefits dt {
  font-weight: 450;
  color: var(--shop-muted);
  font-size: 11px;
}

.store-plan-benefits dd {
  margin: 0;
  font-weight: 750;
  white-space: nowrap;
  color: var(--shop-text);
  font-size: 12px;
}

/* 13. 压缩脚注 */
.store-catalog-footnote {
  text-align: center;
  color: var(--shop-muted);
  font-size: 11px;
  line-height: 1.6;
  margin: 16px 0 28px;
}

/* 14. 优化FAQ */
body.ios-store .store-faq {
  margin-top: 32px;
  padding-top: 28px;
}

.store-faq details {
  padding: 14px 0;
}

.store-faq summary {
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.7;
}

.store-faq p {
  font-size: 12px;
  color: var(--shop-muted);
  line-height: 1.8;
  max-width: 820px;
  margin: 10px 0 0;
}

/* 15. 优化footer */
body.ios-store .store-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  padding: 24px 0 0;
}

/* ==================== 平板断点 (800px - 1100px) ==================== */
@media (min-width: 801px) and (max-width: 1100px) {
  body.ios-store .store-shell {
    width: min(100%, 1200px);
    max-width: 1200px;
    padding: 18px 28px 28px;
  }

  /* 会员方案保持3列 */
  body.ios-store #store-products-grid.is-membership {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  body.ios-store .store-plan {
    padding: 16px 12px;
  }

  .store-monthly-equivalent {
    font-size: 28px;
  }

  .store-plan-name {
    font-size: 24px;
  }
}

/* ==================== 移动端优化 (≤800px) ==================== */
@media (max-width: 800px) {
  body.ios-store .store-shell {
    padding: 16px 18px 24px;
  }

  body.ios-store .store-intro {
    padding: 24px 0 14px;
  }

  body.ios-store .store-intro h1 {
    font-size: 26px;
    line-height: 1.3;
    margin-bottom: 10px;
  }

  body.ios-store .store-intro .store-kicker {
    margin-bottom: 8px;
    font-size: 11px;
  }

  body.ios-store .store-intro > p:last-child {
    font-size: 13px;
  }

  body.ios-store .store-account {
    padding: 12px 14px;
    gap: 14px;
    margin-bottom: 18px;
  }

  body.ios-store .store-segments {
    margin-bottom: 18px;
  }

  body.ios-store .store-segments button {
    padding: 9px 10px;
    min-width: 0;
    flex: 1;
    font-size: 12px;
  }

  /* 积分卡片2列 */
  body.ios-store #store-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* 会员方案2列 */
  body.ios-store #store-products-grid.is-membership {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.ios-store .store-catalog-card {
    padding: 14px 12px;
  }

  body.ios-store .store-plan {
    padding: 16px 12px;
  }

  .store-monthly-equivalent {
    font-size: 28px;
  }

  .store-plan-name {
    font-size: 22px;
  }
}

/* ==================== 小屏手机 (≤540px) - 继续优化 ==================== */
/* ==================== 小屏手机优化 (≤540px) ==================== */
@media (max-width: 540px) {
  body.ios-store .store-shell {
    padding: 14px 14px 24px;
  }

  body.ios-store .store-intro {
    padding: 20px 0 12px;
  }

  body.ios-store .store-intro h1 {
    font-size: 24px;
    line-height: 1.3;
    letter-spacing: -0.8px;
    margin-bottom: 8px;
  }

  body.ios-store .store-intro .store-kicker {
    margin-bottom: 6px;
    font-size: 10px;
  }

  body.ios-store .store-intro > p:last-child {
    font-size: 12px;
  }

  body.ios-store .store-account {
    padding: 10px 12px;
    gap: 10px;
    margin-bottom: 16px;
  }

  body.ios-store .store-account strong {
    font-size: 13px;
  }

  body.ios-store .store-account > div {
    gap: 4px 8px;
  }

  body.ios-store .store-account #store-auth-points {
    font-size: 18px;
  }

  body.ios-store .store-segments {
    margin-bottom: 16px;
    width: 100%;
  }

  body.ios-store .store-segments button {
    min-height: 40px;
    padding: 8px 6px;
    font-size: 11px;
  }

  body.ios-store .store-section-heading {
    margin: 16px 0 12px;
  }

  body.ios-store .store-section-heading h2 {
    font-size: 17px;
    line-height: 1.4;
  }

  body.ios-store .store-section-heading p {
    font-size: 11px;
  }

  /* 移动端积分和会员都显示2列 */
  body.ios-store #store-products-grid,
  body.ios-store #store-products-grid.is-membership {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.ios-store .store-catalog-card {
    padding: 12px 10px;
    border-radius: 13px;
  }

  body.ios-store .store-catalog-card h3 {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .store-point-total {
    font-size: 28px;
    letter-spacing: -1px;
  }

  .store-point-total span {
    display: block;
    margin: 4px 0 0;
    font-size: 10px;
  }

  .store-point-equation {
    font-size: 10px;
    min-height: auto;
    margin: 6px 0 8px;
    gap: 4px;
    align-content: start;
  }

  .store-point-equation .store-bonus {
    font-size: 9px;
    padding: 3px 5px;
    line-height: 1.5;
  }

  .store-value-meter {
    margin-bottom: 10px;
  }

  body.ios-store .store-catalog-card .store-price {
    font-size: 18px;
  }

  .store-unit-price {
    font-size: 10px;
    line-height: 1.6;
    min-height: auto;
    margin-bottom: 10px;
  }

  .store-value-label {
    position: static;
    order: -1;
    font-size: 9px;
    min-height: auto;
    margin-bottom: 5px;
  }

  body.ios-store .store-catalog-card > button {
    min-height: 40px;
    font-size: 11px;
    padding: 8px 4px;
    line-height: 1.4;
  }

  body.ios-store .store-plan {
    padding: 14px 10px;
  }

  .store-plan-name {
    font-size: 20px;
    letter-spacing: -0.6px;
  }

  .store-plan-caption {
    font-size: 11px;
    line-height: 1.5;
    min-height: auto;
    margin-bottom: 12px;
  }

  .store-monthly-equivalent {
    font-size: clamp(20px, 6vw, 26px);
    letter-spacing: -0.8px;
    min-height: auto;
  }

  .store-monthly-equivalent small {
    display: block;
    margin: 4px 0 0;
    font-size: 10px;
  }

  .store-cycle-total {
    font-size: 10px;
    min-height: auto;
    margin: 6px 0;
    line-height: 1.6;
  }

  .store-plan-saving {
    min-height: auto;
    margin-bottom: 10px;
    font-size: 10px;
  }

  .store-annual-saving {
    padding: 5px;
    font-size: 10px;
    line-height: 1.6;
  }

  .store-saving-basis {
    font-size: 9px;
    line-height: 1.5;
    margin-top: 4px;
  }

  .store-plan-features {
    font-size: 10px;
    line-height: 1.6;
    gap: 7px;
    margin-top: 12px;
    padding-top: 12px;
  }

  .store-plan-features li {
    gap: 4px;
  }

  .store-plan-features svg {
    width: 11px;
    height: 11px;
    margin-top: 2px;
  }

  body.ios-store .store-billing-switch {
    margin-bottom: 16px;
    padding: 3px;
    width: 100%;
  }

  body.ios-store .store-billing-switch button {
    min-height: 40px;
    padding: 8px 4px;
    font-size: 11px;
  }

  .store-catalog-footnote {
    font-size: 10px;
    margin: 12px 0 20px;
    text-align: left;
  }

  .store-plan-benefits > div {
    min-height: auto;
    padding: 8px 0;
  }

  .store-plan-benefits dt {
    font-size: 10px;
  }

  .store-plan-benefits dd {
    font-size: 11px;
  }
}

/* ==================== 极小屏幕 (≤360px) ==================== */
@media (max-width: 360px) {
  body.ios-store .store-shell {
    padding: 12px 10px 20px;
  }

  body.ios-store .store-intro h1 {
    font-size: 22px;
  }

  .store-point-total {
    font-size: 24px;
  }

  .store-plan-name {
    font-size: 18px;
  }

  .store-monthly-equivalent {
    font-size: 22px;
  }
}

/* ==================== 商店特定组件优化 ==================== */

/* 订阅卡片优化 */
.store-subscription-card {
  max-width: none;
  padding: 0;
  overflow: hidden;
}

.store-subscription-top {
  padding: 24px 26px 18px;
  background: color-mix(in srgb, var(--shop-card) 93%, #dfaf26);
}

.store-subscription-top h3 {
  font-size: 30px;
  margin-bottom: 0;
}

.store-subscription-facts {
  margin: 0 26px;
  padding: 20px 0;
  border-top: 0;
}

.store-subscription-note {
  margin: 16px 26px;
  padding: 12px 14px;
  border-left: 3px solid #c8a242;
  background: var(--shop-bg);
  border-radius: 0 8px 8px 0;
  font-size: 12px;
}

.store-subscription-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 26px;
  border-top: 1px solid var(--shop-line);
}

.store-subscription-controls h3 {
  font-size: 14px;
  margin: 0 0 6px;
}

.store-subscription-controls p {
  font-size: 11px;
  color: var(--shop-muted);
  line-height: 1.7;
  margin: 0;
  max-width: 400px;
}

.store-subscription-actions {
  margin: 0;
  justify-content: flex-end;
  flex: none;
}

#store-subscription-feedback {
  margin: 0 26px 18px;
  padding: 10px 13px;
  background: var(--shop-bg);
  border-radius: 10px;
  font-size: 12px;
}

/* FAQ优化 */
body.ios-store .store-faq {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  padding-top: 32px;
  margin-top: 36px;
  border-top: 1px solid var(--shop-line);
}

.store-faq-intro h2 {
  font-size: 22px;
  letter-spacing: -0.6px;
  margin: 8px 0 10px;
}

.store-faq-intro p {
  font-size: 12px;
  line-height: 1.7;
  margin: 0 0 16px;
}

.store-faq-intro a {
  display: inline-block;
  font-size: 12px;
  min-height: 40px;
  line-height: 40px;
  color: var(--shop-accent);
}

.store-faq-items {
  border: 1px solid var(--shop-line);
  border-radius: 14px;
  background: var(--shop-card);
  overflow: hidden;
}

.store-faq-items details {
  padding: 0;
  border-bottom: 1px solid var(--shop-line);
}

.store-faq-items details:last-child {
  border-bottom: 0;
}

.store-faq-items summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  list-style: none;
  font-size: 13px;
  min-height: 40px;
}

.store-faq-items summary small {
  display: block;
  font-size: 9px;
  color: var(--shop-muted);
  font-weight: 450;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.store-faq-answer {
  padding: 0 18px 16px;
}

.store-faq-answer p {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
}

/* Checkout对话框优化 */
#store-product-dialog {
  width: min(660px, calc(100vw - 28px));
  padding: 0;
  background: var(--shop-card);
  border: 1px solid var(--shop-line);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

#store-product-dialog .store-dialog-head {
  padding: 16px 24px;
  border-bottom: 1px solid var(--shop-line);
  background: var(--shop-bg);
}

#store-product-dialog .store-dialog-head h2 {
  font-size: 13px;
  font-weight: 650;
  color: var(--shop-muted);
  margin: 0;
}

.store-checkout-shell {
  padding: 26px;
}

.store-checkout-summary {
  padding: 0 0 20px;
}

.store-checkout-shell h2 {
  font-size: 28px;
  letter-spacing: -0.7px;
  margin: 14px 0 6px;
}

.store-checkout-benefit {
  font-size: 12px;
  color: var(--shop-muted);
  line-height: 1.6;
  margin: 0;
}

.store-checkout-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 18px;
}

.store-checkout-price {
  font-size: 36px;
  letter-spacing: -1.3px;
  font-variant-numeric: tabular-nums;
}

.store-checkout-price-note {
  font-size: 11px;
  color: var(--shop-muted);
}

.store-checkout-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.store-checkout-meta-item {
  display: block;
  padding: 11px 12px;
  border: 1px solid var(--shop-line);
  border-radius: 9px;
  background: var(--shop-bg);
}

.store-checkout-meta-item strong {
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
}

.store-checkout-meta-item small {
  display: block;
  font-size: 10px;
  line-height: 1.5;
  color: var(--shop-muted);
  overflow-wrap: anywhere;
}

.store-checkout-before {
  border-top: 1px solid var(--shop-line);
  padding: 14px 0 4px;
}

.store-checkout-before p {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--shop-muted);
  font-size: 11px;
  line-height: 1.6;
  margin: 5px 0;
}

.store-checkout-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border: 0;
  border-radius: 10px;
  background: #dfaf26;
  color: #231b0b;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

/* 移动端订阅和FAQ响应式 */
@media (max-width: 900px) {
  .store-subscription-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .store-subscription-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .store-subscription-controls p {
    max-width: none;
  }

  body.ios-store .store-faq {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 20px;
  }
}

@media (max-width: 600px) {
  body.ios-store .store-intro {
    padding: 20px 0 16px;
  }

  body.ios-store .store-intro h1 {
    font-size: 25px;
  }

  body.ios-store .store-account {
    margin-bottom: 16px;
  }

  .store-subscription-card {
    padding: 0;
  }

  .store-subscription-top {
    padding: 18px 14px;
    gap: 10px;
  }

  .store-subscription-facts {
    margin: 0 14px;
    padding: 14px 0;
  }

  .store-subscription-note {
    margin: 12px 14px;
    padding: 10px;
    font-size: 11px;
  }

  .store-subscription-controls {
    padding: 16px 14px;
    gap: 12px;
    width: auto;
  }

  .store-subscription-actions {
    width: 100%;
    gap: 8px;
  }

  .store-subscription-actions > * {
    min-width: 0;
    font-size: 11px;
  }

  #store-subscription-feedback {
    margin: 0 14px 14px;
  }

  .store-subscription-top h3 {
    font-size: 26px;
  }

  body.ios-store .store-faq {
    display: block;
    margin-top: 28px;
    padding-top: 22px;
  }

  .store-faq-intro {
    position: relative;
    margin-bottom: 14px;
  }

  .store-faq-intro h2 {
    font-size: 20px;
    margin: 6px 0;
  }

  .store-faq-intro p {
    font-size: 11px;
    margin: 0;
  }

  .store-faq-intro br {
    display: none;
  }

  .store-faq-intro a {
    font-size: 11px;
    line-height: 1.4;
    min-height: 0;
    margin-top: 10px;
  }

  .store-faq-items summary {
    padding: 13px 14px;
    font-size: 12px;
    gap: 12px;
  }

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

  .store-faq-answer p {
    font-size: 11px;
    line-height: 1.8;
  }

  body.ios-store .store-footer {
    margin-top: 22px;
  }

  /* Checkout移动端 */
  #store-product-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
  }

  .store-checkout-shell {
    padding: 18px 14px max(16px, env(safe-area-inset-bottom));
  }

  .store-checkout-shell h2 {
    font-size: 23px;
    line-height: 1.3;
    letter-spacing: -0.4px;
    margin: 10px 0 5px;
  }

  .store-checkout-benefit {
    font-size: 12px;
  }

  .store-checkout-price {
    font-size: 30px;
  }

  .store-checkout-meta {
    gap: 0;
    margin-top: 14px;
    border-top: 1px solid var(--shop-line);
  }

  .store-checkout-meta-item {
    padding: 9px 0;
    border: 0;
    border-bottom: 1px solid var(--shop-line);
    border-radius: 0;
    background: transparent;
  }
}

@media (max-width: 360px) {
  .store-checkout-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .store-checkout-shell h2 {
    font-size: 21px;
  }
}


/* Android workbench masthead: keep account controls inside the viewport. */
@media (max-width: 780px) {
  html[data-android-web="true"] body[data-workbench-screen] .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
  }
  html[data-android-web="true"] body[data-workbench-screen] .hero-brand {
    width: auto;
    min-width: 0;
    flex: initial;
  }
  html[data-android-web="true"] body[data-workbench-screen] .app-brand-lockup {
    min-width: 0;
    width: auto;
  }
  html[data-android-web="true"] body[data-workbench-screen] .hero h1 {
    font-size: 18px !important;
    line-height: 1.2;
  }
  html[data-android-web="true"] body[data-workbench-screen] .hero-actions {
    width: auto;
    min-width: 0;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
  }
  html[data-android-web="true"] body[data-workbench-screen] .hero-actions .hero-control,
  html[data-android-web="true"] body[data-workbench-screen] .hero-actions .hero-link {
    width: auto;
    min-width: 0;
  }
}

