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

  :root {
    --bg: #0a0a0a;
    --surface: #111111;
    --surface2: #1a1a1a;
    --border: #222222;
    --border2: #2e2e2e;
    --accent: #c8a96e;
    --accent-dim: #7a6440;
    --text: #e8e4dc;
    --text-secondary: #888880;
    --text-dim: #857f73;
    --danger: #8b3a3a;
    --mono: 'IBM Plex Mono', monospace;
    --sans: 'IBM Plex Sans', sans-serif;
    --serif: 'EB Garamond', Garamond, 'Times New Roman', serif;
    --ink: #ece5d8;
    --muted: #8d8576;
    --overdue: #d0605a;
    --radius: 4px;
  }

  html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }

  #app { display: flex; flex-direction: column; height: 100dvh; max-width: 720px; margin: 0 auto; }

  /* ── Header ── */
  #header { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 10; flex-shrink: 0; }
  #header-left { display: flex; align-items: center; gap: 10px; }

  /* Logo */
  #logo-mark { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
  .logo-img { display: block; border-radius: 22%; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAMAAADQmBKKAAAAkFBMVEX+yE/7wkz6v0r0vk34u0f2t0Pvtkfws0Pxrz3sr0HlrULppzngnzbNnT+8jTmeeTZ+YjJgTC1CNykuKSYpJSUoJSUnJSUnJCUmJCcmJCYmJCUlJCclJCYlJCUmIyYlIyYlIyUlIyQkIyYkIyUlIiYlIiUkIiYkIiUkIiQjIiUhICQeHiQbHCQYGSMWGCMUFiJqiLt9AAAL90lEQVR42u2a6XbiOhKAgbCEEGw24zZXsRSrhcDY8P5vN7VIskM3cM/8mjNHkCYEbOtT7VXugfwfewwiUASKQBEoAkWgCBSBIlAEikARKAJFoAgUgSJQBIpAESgCRaAIFI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v3kgJPwE2B0uCvfOhV0sV5Bo8fmethxUn7bSGurzBfB8btod9s+qGxT6GIUSU1LxpFbmtU4mcPGmtMZ2udA3LlL1xzo0orYVdsFIBDkJW90n4xiwCs8DfSAoPAR/ulPhlyvIlUg7SufnI8poRXlW9crOIKTOfaHZO9JnTARaYNt7KCGc/OCBS+DBwCx9kSxQ5Fz/Fmgj2C/hWJZixLlGGa2vu/5dOfUjwxZE9lu6O0oWJxew0Ce52mMbCjxb6pP1jzk7mMMvnslS7am6MUAOZdM7b9enWT/C9ZNBIXtDYPphGSXb+omEiOcTLJR8pmdvLsIUeM8CXgVOQXlhQZXu/nxJ38HVmoO7FYpjddk5GMbtr94NE5I8ES2wyH4IhPkSDGi1vWR0y08r5W/juEBUgLKgjBNFF9cpkRzO53XyvtzVB1+vFXSm6iq3Toc+4wFRCrbXZg+Bmi1IZ7VtjwdAqX4MBrjHFBT3/gH5uNJCkaAgNOzV9bJJU81VDnkA1ueS9+T99O5WS1Y3m+R9fXsItEmS9e5a76T2XXHQmOCuzpEVsjc45vtLKssvtw1YhO6lfddEll1C+XnDrsgbkOz6IdBq3bbH7NBNcPzs1u/S5U3u7lQ3yyYBmDyDNhBTH8ZFOKYUfw7qZWjh+FJZcduu4/9siEARKAJFoAgUgSJQBIpAESgCRaAIFIEiUASKQBEoAkWgCBSBItD/C9B/AFY2kw/ppyPUAAAAAElFTkSuQmCC) center / cover no-repeat; }

  #title { font-family: var(--serif); font-size: 19px; font-weight: 500; letter-spacing: 0.01em; line-height: 1; color: var(--ink); }
  #header-right { display: flex; align-items: center; gap: 8px; }

  .icon-btn { width: 44px; height: 44px; border: none; background: transparent; color: var(--text-secondary); cursor: pointer; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; transition: color 0.15s, background 0.15s; }
  .icon-btn:hover { color: var(--text); background: var(--surface2); }
  .icon-btn svg { width: 16px; height: 16px; }

  /* ── Status bar ── */

  /* ── Messages ── */

  .msg { display: flex; flex-direction: column; gap: 3px; animation: fadeUp 0.2s ease; }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }




  .msg-bubble { padding: 12px 14px; border-radius: var(--radius); line-height: 1.65; font-size: 14px; }
  .msg.assistant .msg-bubble { background: var(--surface); border: 1px solid var(--border); border-left: 2px solid var(--accent-dim); color: var(--text); align-self: flex-start; max-width: 92%; }

  .msg-bubble p { margin-bottom: 8px; }
  .msg-bubble p:last-child { margin-bottom: 0; }
  .msg-bubble strong { color: var(--accent); font-weight: 500; }
  .msg-bubble em { color: var(--text-secondary); font-style: italic; }
  .msg-bubble ul, .msg-bubble ol { padding-left: 16px; margin: 6px 0; }
  .msg-bubble li { margin-bottom: 3px; }
  .msg-bubble code { font-family: var(--mono); font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 2px; color: var(--accent); }

  /* Thinking */
  @keyframes dot-pulse { 0%,80%,100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

  /* ── Shared form controls ── */
  .tb-add-row { display: flex; gap: 6px; }
  .tb-input { flex: 1; background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text); font-family: var(--sans); font-size: 16px; padding: 8px 10px; min-height: 44px; outline: none; min-width: 0; }
  .tb-input:focus { border-color: var(--accent-dim); }
  .tb-input::placeholder { color: var(--text-dim); }
  .tb-btn { padding: 7px 14px; min-height: 44px; background: transparent; border: 1px solid var(--border2); border-radius: var(--radius); color: var(--ink); font-family: var(--mono); font-size: 11px; cursor: pointer; transition: background 0.15s; white-space: nowrap; flex-shrink: 0; }
  .tb-btn:hover { border-color: var(--accent-dim); color: var(--accent); }

  .msg-heading { color: var(--accent); font-weight: 600; display: inline; }

  /* ── Today screen ── */
  .today-inner { gap: 14px; padding-top: 16px; padding-bottom: 24px; }
  .rank-art { margin: 0 0 4px; padding: 5px; background: var(--surface); border: 1px solid var(--accent-dim); border-radius: 8px; }
  .rank-art img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; }
  .today-hero { display: flex; flex-direction: column; gap: 4px; padding: 0 2px 2px; }
  .today-hello { font-family: var(--serif); font-size: 30px; font-weight: 400; color: var(--ink); line-height: 1.15; }
  .today-teaser { margin-top: 28px; }
  .today-teaser-sub { font-family: var(--sans); font-size: 13px; color: var(--muted); margin: -6px 0 10px; }
  .today-teaser-sub:empty { display: none; }
  .today-next { margin: 4px 0 12px; padding: 0 2px; }
  .today-next-line { margin: 0; font-family: var(--sans); font-size: 14px; line-height: 1.45; color: var(--muted); }
  .today-clock { font-variant-numeric: tabular-nums lining-nums; color: var(--accent); font-weight: 500; white-space: nowrap; }
  .today-link { background: none; border: none; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  .today-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .s-bigclock { font-family: var(--serif); font-size: 52px; line-height: 1; font-variant-numeric: tabular-nums lining-nums; color: var(--accent); }
  .today-teaser-h { font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--ink); margin: 0 0 10px; }
  .today-date { font-family: var(--sans); font-size: 13px; color: var(--muted); }
  .today-weather { font-size: 12.5px; color: var(--text-secondary); margin-top: 6px; min-height: 18px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 2px; }
  .tw-temp { font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--ink); margin-right: 2px; }
  .tw-city { color: var(--text-secondary); }
  .tw-sep { color: var(--text-dim); margin: 0 5px; }
  .today-link:hover { color: var(--accent); }

  /* ── Briefing: CTA + loading ── */
  .brief-cta { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
  .brief-cta-title { font-family: var(--serif); font-size: 21px; line-height: 1.25; color: var(--ink); }
  .brief-cta-desc { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
  .brief-cta-btn { align-self: flex-start; margin-top: 6px; padding: 9px 18px; min-height: 44px; background: var(--accent); color: #14110a; border: none; border-radius: var(--radius); font-family: var(--sans); font-size: 13.5px; font-weight: 500; cursor: pointer; }
  .brief-cta-btn:hover { filter: brightness(1.08); }
  .brief-cta-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  .brief-cta-err { font-size: 13px; color: var(--overdue); }
  .brief-dots { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
  .brief-dots span { width: 4px; height: 4px; border-radius: 50%; background: var(--accent-dim); animation: dot-pulse 1.2s infinite; }
  .brief-dots span:nth-child(2) { animation-delay: 0.2s; }
  .brief-dots span:nth-child(3) { animation-delay: 0.4s; }

  /* ── Briefing page ── */
  .msg.assistant.briefing .msg-bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 0; max-width: 100%; align-self: stretch; overflow: hidden; }
  .today-brief { animation: none; }
  .bp { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 18px; }
  .bp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .bp-title { font-size: 13px; font-weight: 500; color: var(--muted); }

  .bp-verse { position: relative; margin: 2px 0 0; padding-left: 26px; }
  .bp-qmark { position: absolute; left: -3px; top: -16px; font-family: var(--serif); font-size: 68px; line-height: 1; color: var(--accent); }
  .bp-verse blockquote { font-family: var(--serif); font-size: 23px; line-height: 1.42; color: var(--ink); text-wrap: pretty; }
  .bp-verse figcaption { margin-top: 10px; font-size: 12.5px; color: var(--accent); letter-spacing: 0.01em; }
  .bp-reflect { padding-left: 26px; margin-top: -6px; }
  .bp-reflect p { font-size: 14px; line-height: 1.65; color: var(--muted); margin: 0; }
  .bp-reflect p + p { margin-top: 8px; }

  .bp-sec { border-top: 1px solid var(--border); padding-top: 14px; }
  .bp-label { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
  .bp-fact { display: grid; grid-template-columns: 22px 1fr 14px; gap: 10px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--border); cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .bp-fact:last-child { border-bottom: none; padding-bottom: 2px; }
  .bp-fact:focus-visible { outline: 1px solid var(--accent-dim); outline-offset: 2px; border-radius: 2px; }
  .bp-ficon { color: var(--muted); padding-top: 3px; display: flex; }
  .bp-ftopic { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
  .bp-flead { font-size: 14.5px; line-height: 1.5; color: var(--ink); }
  .bp-fmore { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin-top: 6px; }
  .bp-chev { color: var(--muted); margin-top: 5px; transition: transform 0.2s ease; }
  .bp-fact.open .bp-chev { transform: rotate(180deg); }
  .bp-fopen { display: none; }
  .bp-fact.open .bp-fopen { display: block; }

  .bp-wline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
  .bp-wword { font-family: var(--serif); font-size: 30px; line-height: 1.15; color: var(--ink); }
  .bp-wpos { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--muted); }
  .bp-wdef { font-size: 14.5px; line-height: 1.55; color: var(--ink); margin: 6px 0 0; }
  .bp-wex { font-family: var(--serif); font-style: italic; font-size: 16.5px; line-height: 1.5; color: var(--muted); margin: 6px 0 0; }

  .bp-plain p { margin-bottom: 10px; }
  .bp-plain .msg-heading { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
  .bp-plain .msg-heading + br { display: none; }
  .sec-icon { width: 12px; height: 12px; flex-shrink: 0; opacity: 0.9; }
  .sec-icon svg { display: block; width: 12px; height: 12px; }
  @media (min-width: 560px) { .bp { padding: 24px 26px 20px; } .bp-verse blockquote { font-size: 26px; } }
  @media (prefers-reduced-motion: reduce) { .bp-chev, .tab-btn { transition: none; } }

  /* Settings: a full-screen page, same voice as the Habits tab. Every choice saves on tap. */
  #settings-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 150; display: none; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #settings-overlay.open { display: block; }
  #settings-box { width: 100%; max-width: 560px; margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) 16px max(28px, calc(env(safe-area-inset-bottom) + 20px)); display: flex; flex-direction: column; gap: 0; font-family: var(--sans); color: var(--ink); }
  #settings-box-header { position: sticky; top: 0; z-index: 2; background: var(--bg); display: flex; align-items: center; justify-content: space-between; padding: 8px 0 10px; }
  #settings-box-title { font-family: var(--serif); font-size: 28px; font-weight: 400; color: var(--ink); line-height: 1.1; }
  #settings-box-header .s-x { margin-right: -10px; }
  .set-sec { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid #1f1f1f; padding: 20px 0; }
  .set-sec h3 { font-size: 17px; font-weight: 500; color: var(--ink); }
  .set-field { display: flex; flex-direction: column; gap: 8px; }
  .set-field + .set-field { margin-top: 6px; }
  .set-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .set-label { font-size: 14px; color: #b5ad9d; }
  .set-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
  .set-desc { font-size: 14px; line-height: 1.45; color: var(--muted); }
  .set-desc:empty { display: none; }
  .set-status { color: #b5ad9d; }
  .settings-action-btn { width: 100%; padding: 10px 14px; min-height: 48px; background: #1a1a1a; border: 1px solid #333333; border-radius: 6px; color: var(--ink); font-family: var(--sans); font-size: 15px; cursor: pointer; transition: border-color 0.15s, color 0.15s; text-align: left; }
  .settings-action-btn:hover { border-color: var(--accent-dim); }
  .settings-action-btn.primary { background: #1c1710; border-color: var(--accent); color: #e6cf9f; font-weight: 500; }
  .settings-action-btn.danger { background: transparent; border-color: #3a2222; color: #d08a8a; }
  .settings-action-btn.danger:hover { border-color: var(--danger); }
  .settings-action-btn:focus-visible, .lang-opt:focus-visible, .char-tile:focus-visible, .fact-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .app-version { font-size: 12px; color: var(--text-dim); text-align: center; margin-top: 10px; }
  .settings-lang-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .lang-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 64px; padding: 10px 12px; background: #1a1a1a; border: 1px solid #333333; border-radius: 6px; text-align: left; cursor: pointer; font-family: var(--sans); transition: border-color 0.15s; }
  .lang-opt:hover { border-color: var(--accent-dim); }
  .lang-opt.selected { border-color: var(--accent); background: #1c1710; }
  .lang-opt-label { font-size: 15px; font-weight: 500; color: var(--ink); }
  .lang-opt.selected .lang-opt-label { color: #e6cf9f; }
  .lang-opt-desc { font-size: 12.5px; line-height: 1.3; color: var(--muted); }
  #settings-fact-grid .fact-opt { font-family: var(--sans); font-size: 14px; letter-spacing: 0; min-height: 44px; padding: 6px 14px; border-radius: 22px; background: #1a1a1a; border-color: #333333; color: var(--ink); }
  #settings-fact-grid .fact-opt.selected { background: #1c1710; border-color: var(--accent); color: #e6cf9f; }
  #settings-fact-grid.full .fact-opt:not(.selected) { color: #6f6a60; border-color: #262626; }
  /* Character picked by picture, in setup and in Settings */
  .char-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  #settings-box .tb-btn { font-family: var(--sans); font-size: 15px; color: var(--ink); background: #1a1a1a; border-color: #333333; border-radius: 6px; padding: 7px 16px; }
  .char-tile { display: flex; flex-direction: column; padding: 0; background: #1a1a1a; border: 1px solid #333333; border-radius: 8px; overflow: hidden; cursor: pointer; text-align: left; font-family: var(--sans); color: var(--ink); }
  .char-tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 30% 50%; background: #141414; opacity: 0.55; transition: opacity 0.15s; }
  .char-tile span { padding: 9px 12px; font-size: 15px; font-weight: 500; }
  .char-tile.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
  .char-tile.selected img { opacity: 1; }
  .char-tile.selected span { color: #e6cf9f; background: #1c1710; }

  @media (max-width: 480px) {
    #header { padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
    .msg.assistant .msg-bubble { max-width: 98%; }
  }
  #setup-screen { position: fixed; inset: 0; background: var(--bg); z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 24px; padding-top: max(24px, env(safe-area-inset-top)); padding-bottom: max(32px, calc(env(safe-area-inset-bottom) + 24px)); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #setup-screen.hidden { display: none; }
  .setup-box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; margin: auto 0; }
  .setup-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 8px; }
  .setup-logo { display: flex; align-items: center; justify-content: center; }
  .setup-logo .logo-img { box-shadow: 0 0 18px rgba(200,169,110,0.18); }
  .setup-title { font-family: var(--serif); font-size: 19px; font-weight: 500; color: var(--muted); }
  .setup-heading { font-family: var(--serif); font-size: 30px; font-weight: 400; color: var(--ink); line-height: 1.15; text-align: center; }
  .setup-fields { display: flex; flex-direction: column; gap: 12px; }
  .setup-field { display: flex; flex-direction: column; gap: 5px; }
  .setup-label { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--muted); }
  .setup-input { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text); font-family: var(--sans); font-size: 16px; padding: 10px 12px; min-height: 44px; outline: none; transition: border-color 0.15s; }
  .setup-input:focus { border-color: var(--accent-dim); }
  .setup-input::placeholder { color: var(--text-dim); }
  .setup-tip { font-size: 12px; color: var(--text-dim); padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); border-left: 2px solid var(--accent-dim); line-height: 1.5; }
  .setup-tip strong { color: var(--accent); font-weight: 500; }
  .setup-submit { padding: 13px; background: transparent; border: 1px solid var(--accent-dim); border-radius: var(--radius); color: var(--accent); font-family: var(--sans); font-size: 15px; font-weight: 500; cursor: pointer; transition: background 0.15s; }
  .setup-submit:hover { background: var(--accent); color: var(--bg); }
  .setup-lang-grid-setup { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .setup-fact-grid { display: flex; flex-wrap: wrap; gap: 6px; }
  .fact-opt { font-family: var(--mono); font-size: 11.5px; padding: 5px 12px; min-height: 40px; display: inline-flex; align-items: center; border: 1px solid var(--border2); border-radius: var(--radius); cursor: pointer; color: var(--text-secondary); letter-spacing: 0.04em; transition: all 0.15s; }
  .fact-opt:hover { border-color: var(--accent-dim); color: var(--text); }
  .fact-opt.selected { border-color: var(--accent); background: #1a1508; color: var(--accent); }
  .lang-opt-setup { border: 1px solid var(--border2); border-radius: var(--radius); padding: 8px 6px; text-align: center; cursor: pointer; transition: all 0.15s; }
  .lang-opt-setup:hover { border-color: var(--accent-dim); }
  .lang-opt-setup.selected { border-color: var(--accent); background: #1a1508; }
  .lang-opt-setup .lang-opt-label { font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--text-secondary); text-transform: none; }
  .lang-opt-setup.selected .lang-opt-label { color: var(--accent); }
  .lang-opt-setup .lang-opt-desc { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
  #tab-nav { display: flex; border-top: 1px solid var(--border); background: var(--bg); flex-shrink: 0; padding-bottom: env(safe-area-inset-bottom); }
  .tab-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px 7px; font-family: var(--sans); font-size: 11px; letter-spacing: 0.01em; background: transparent; border: none; color: var(--muted); cursor: pointer; transition: color 0.15s; -webkit-tap-highlight-color: transparent; }
  .tab-ico { width: 22px; height: 22px; }
  .tab-btn.active { color: var(--accent); }
  .tab-btn:focus-visible { outline: 1px solid var(--accent-dim); outline-offset: -3px; }
  .tab-btn:hover:not(.active) { color: var(--text-secondary); }

  /* ── Views ── */
  .view { display: none; flex-direction: column; flex: 1; overflow: hidden; min-height: 0; }
  .view.active { display: flex; }
  .view-scroll { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border2) transparent; -webkit-overflow-scrolling: touch; }
  .view-inner { padding: 16px; display: flex; flex-direction: column; gap: 10px; max-width: 600px; margin: 0 auto; width: 100%; }
  /* ── Season (Habits tab) ── */
  #season-root { max-width: 600px; margin: 0 auto; width: 100%; }
  #season-root button, #sheet-box button, #reveal-box button, #timer-root button { font-family: var(--sans); -webkit-tap-highlight-color: transparent; }
  #season-root h2, #season-root h3, #sheet-box h2, #sheet-box h3 { margin: 0; font-weight: 500; }
  #season-root p, #sheet-box p, #reveal-box p { margin: 0; }
  .s-flow { padding: 28px 16px 28px; display: flex; flex-direction: column; gap: 18px; }
  .s-head { display: flex; flex-direction: column; gap: 8px; }
  .s-eyebrow { font-size: 13px; color: var(--muted); }
  .s-title { font-family: var(--serif); font-size: 34px; line-height: 1.08; font-weight: 400 !important; color: var(--ink); }
  .s-desc { font-size: 14px; line-height: 1.5; color: #a39b8b; }
  .s-name { display: block; font-size: 16px; color: inherit; }
  .s-sub { display: block; font-size: 13px; line-height: 1.4; color: #a39b8b; }
  .s-note { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
  .s-list { display: flex; flex-direction: column; }
  .s-pair { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 12px 0; border-top: 1px solid #1f1f1f; }
  .s-pair-k { font-size: 13px; color: var(--muted); }
  .s-pair-k.gold { color: var(--accent); }
  .s-fact { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: baseline; padding: 15px 0; border-top: 1px solid #1f1f1f; }
  .s-fact-n { font-family: var(--serif); font-size: 34px; line-height: 1; color: var(--accent); }
  .s-fact-t { font-size: 15px; font-weight: 500; margin-bottom: 3px; }
  .s-pillar { display: flex; flex-direction: column; gap: 6px; }
  .s-pillar-n { font-family: var(--serif); font-size: 22px; line-height: 1.1; font-weight: 400 !important; margin-bottom: 2px !important; }
  .s-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 7px 12px; background: #131313; border: 1px solid #262626; border-radius: 6px; color: #b5ad9d; text-align: left; cursor: pointer; }
  .s-opt .s-ring { flex-shrink: 0; color: #4f4f4f; }
  .s-opt .s-sub { color: var(--muted); }
  .s-opt.on { background: #1c1710; border-color: var(--accent); color: var(--ink); }
  .s-opt.on .s-ring { color: var(--accent); }
  .s-opt.on .s-sub { color: #b9ad94; }
  .s-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
  .s-count { font-size: 13px; color: var(--muted); }
  .s-btn { min-height: 50px; padding: 8px 14px; border-radius: 6px; border: none; background: var(--accent); color: #0a0a0a; font-size: 15px; font-weight: 500; cursor: pointer; }
  .s-btn:disabled { background: #2a2620; color: #8d8576; cursor: default; }
  .s-btn2 { min-height: 48px; padding: 8px 14px; border-radius: 6px; border: 1px solid #333333; background: transparent; color: var(--ink); font-size: 15px; cursor: pointer; }
  .s-box { font-size: 13.5px; line-height: 1.5; color: #a39b8b; padding: 12px 14px; border: 1px solid #262626; border-radius: 6px; }
  .s-link { background: none; border: none; padding: 12px 0; min-height: 44px; font-size: 13.5px; color: var(--accent); cursor: pointer; text-align: right; }
  .s-x { width: 44px; height: 44px; flex-shrink: 0; background: none; border: none; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }

  .s-banner { position: relative; aspect-ratio: 13 / 5; max-height: 232px; width: 100%; overflow: hidden; background: #131313; }
  .s-banner img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 36%; }
  .s-banner-fade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(10,10,10,0) 48%, rgba(10,10,10,0.75) 82%, #0a0a0a 100%); }
  .s-banner-empty { aspect-ratio: auto; height: 64px; }
  .s-banner-empty .s-banner-fade { display: none; }
  .s-banner-text { position: absolute; left: 16px; right: 16px; bottom: 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .s-rank { font-family: var(--serif); font-size: 34px; line-height: 1; color: #ffffff; }
  .s-level { font-size: 15px; font-weight: 500; color: #e6cf9f; white-space: nowrap; }
  .s-body { padding: 12px 16px 28px; display: flex; flex-direction: column; gap: 22px; }
  .s-toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 4px 8px 14px; background: #1c1710; border: 1px solid var(--accent); border-radius: 6px; }
  .s-toast-l { font-family: var(--serif); font-size: 22px; line-height: 1.1; color: #e6cf9f; }
  .s-toast .s-sub { color: #b9ad94; }
  .s-toast .s-x { color: #b9ad94; }
  .s-prog { display: flex; flex-direction: column; gap: 10px; }
  .s-bar { height: 8px; border-radius: 4px; background: #1f1f1f; overflow: hidden; }
  .s-bar > div { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s ease; }
  .s-bar-sm { height: 6px; }
  .s-bar-sm > div { background: #8d7a4e; }
  .s-row2 { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
  .s-daylist { display: flex; flex-direction: column; gap: 8px; }
  .s-sec { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid #1f1f1f; padding-top: 20px; }
  .s-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 12px; }
  .s-sec-head h3, .s-sec-head .s-link { white-space: nowrap; }
  .s-sec-head h3 { font-size: 15px; color: var(--ink); }
  .s-weekday { font-weight: 400; color: var(--muted); }
  .s-meta { font-size: 13px; color: var(--muted); white-space: nowrap; }
  .s-habit, .s-wild, .s-bonus { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 14px; border-radius: 6px; text-align: left; }
  .s-habit { background: #1a1a1a; border: 1px solid #333333; color: var(--ink); cursor: pointer; }
  .s-habit.done { background: #131313; border-color: #222222; color: var(--muted); }
  .s-habit.done .s-sub { color: var(--muted); }
  .s-check { width: 24px; height: 24px; flex-shrink: 0; border: 1px solid #5c5c5c; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
  .s-check { color: #f0c870; }
  .s-habit.done .s-check, .sh-row.done .s-check { border-color: #d9b264; background: #2a2010; }
  .s-habit { position: relative; }
  .s-plus { position: absolute; right: 16px; top: 50%; font-size: 15px; font-weight: 600; color: #f0c870; pointer-events: none; opacity: 0; animation: sPlus 0.9s ease-out; }
  @keyframes sPlus { 0% { opacity: 0; transform: translateY(-30%); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-160%); } }
  .s-habit.pop .s-check { animation: sPop 0.35s ease-out; }
  @keyframes sPop { 0% { transform: scale(0.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
  .s-bonus.pop { animation: sGlow 1s ease-out; }
  @keyframes sGlow { 0% { box-shadow: 0 0 0 0 rgba(200,169,110,0.6); } 100% { box-shadow: 0 0 0 10px rgba(200,169,110,0); } }
  @media (prefers-reduced-motion: reduce) { .s-plus, .s-habit.pop .s-check, .s-bonus.pop { animation: none; } .s-plus { display: none; } }
  .s-habit-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
  .s-pts { font-size: 13px; color: var(--muted); }
  .s-pts-done { color: #f0c870; }
  .s-pts-gold { color: var(--accent); font-weight: 500; }
  .s-bonus { min-height: 52px; border: 1px solid #222222; color: #b5ad9d; }
  .s-bonus .s-ring { flex-shrink: 0; width: 24px; height: 24px; color: #5c5c5c; }
  .s-bonus .s-sub { color: var(--muted); }
  .s-bonus.on { background: #1c1710; border-color: var(--accent); color: #e6cf9f; }
  .s-bonus.on .s-ring { color: var(--accent); }
  .s-bonus.on .s-sub { color: #b9ad94; }
  .s-bonus.on .s-pts { color: var(--accent); font-weight: 500; }
  .s-wild { background: transparent; border: 1px dashed #6f5d3a; color: var(--ink); cursor: pointer; }
  .s-star { color: var(--accent); display: flex; flex-shrink: 0; }
  .s-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 26px); grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 5px; }
  .s-cell { border-radius: 4px; border: none; padding: 0; display: flex; align-items: center; justify-content: center; min-width: 0; }
  button.s-cell { cursor: pointer; }
  .s-full { background: var(--accent); }
  .s-part { background: #6f5d3a; }
  .s-miss { background: #3a3a3a; }
  .s-cell.s-today { border: 2px solid var(--ink); background: #3d3423; }
  .s-left { color: var(--accent); font-weight: 500; }
  .s-cell.s-future { border: 1px solid #1c1c1c; }
  .s-pre { background: repeating-linear-gradient(135deg, #1d1d1d 0 3px, #111111 3px 6px); }
  .s-dot { width: 6px; height: 6px; border-radius: 3px; background: var(--ink); }
  .s-full .s-dot { background: #0a0a0a; }
  .s-weeks { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 5px; font-size: 11px; color: var(--muted); text-align: center; }
  .s-weeklabel { font-size: 12px; color: var(--muted); text-align: center; margin-top: -6px; }
  .s-pace { font-size: 13px; line-height: 1.5; color: #b5ad9d; }
  .s-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
  .s-legend span { display: inline-flex; align-items: center; gap: 6px; }
  .s-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; }
  .s-legend b { width: 5px; height: 5px; border-radius: 3px; background: var(--ink); }
  .s-rec { display: grid; grid-template-columns: minmax(0, 132px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
  .s-rec-n { color: #b5ad9d; line-height: 1.3; }
  .s-rec-v { color: var(--muted); text-align: right; white-space: nowrap; }
  .s-stat { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #1f1f1f; font-size: 14px; }
  .s-stat span { color: #a39b8b; }
  .s-stat b { font-weight: 500; text-align: right; }
  .s-stat b.ok { color: #7fc296; }
  .s-stat.dim b { color: var(--muted); font-weight: 400; }
  .s-endgrid { display: flex; flex-direction: column; gap: 12px; }
  .s-flow .rank-art { margin: 0; }
  .tab-ico-wrap { position: relative; display: flex; }
  #habits-badge { position: absolute; top: -5px; right: -12px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: var(--accent); color: #0a0a0a; font-family: var(--sans); font-size: 10.5px; font-weight: 500; line-height: 16px; text-align: center; }

  /* Bottom sheet */
  #sheet-overlay { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,0.72); display: none; align-items: flex-end; justify-content: center; }
  #sheet-overlay.open { display: flex; }
  #timer-dot { position: absolute; top: -3px; right: -7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
  .s-hrow { display: flex; gap: 8px; }
  .s-hrow .s-habit { flex: 1; min-width: 0; width: auto; }
  .s-timebtn { flex-shrink: 0; width: 52px; display: flex; align-items: center; justify-content: center; border: 1px solid #333333; border-radius: 6px; background: #1a1a1a; color: var(--accent); cursor: pointer; }
  .tm { padding: 28px 16px 28px; display: flex; flex-direction: column; gap: 22px; max-width: 600px; margin: 0 auto; color: var(--ink); font-family: var(--sans); }
  .tm h2, .tm h3 { margin: 0; font-weight: 500; }
  .tm-dial { position: relative; width: min(72vw, 280px); aspect-ratio: 1; margin: 2px auto 0; }
  .tm-dial svg { width: 100%; height: 100%; display: block; }
  .tm-track { fill: none; stroke: #222222; stroke-width: 5; }
  .tm-prog { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }
  .tm-dial.done .tm-prog { stroke: #5a9e6f; stroke-dashoffset: 0; }
  .tm-read { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
  .tm-clock { font-family: var(--serif); font-size: 60px; line-height: 1; font-variant-numeric: tabular-nums lining-nums; color: var(--ink); }
  .tm-of { font-size: 13px; color: var(--muted); }
  .tm-ask { font-size: 15px; line-height: 1.4; color: var(--ink); text-align: center; margin: 0 0 2px; }
  .tm-sec { display: flex; flex-direction: column; gap: 8px; }
  .tm-sec h3 { font-size: 15px; color: var(--ink); margin-bottom: 2px; }
  .tm-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 14px; border: 1px solid #262626; border-radius: 6px; background: #131313; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
  .tm-row .s-name { flex: 1; min-width: 0; }
  .tm-row.on { border-color: var(--accent); background: #1c1710; }
  .tm-row.done .s-name { color: var(--muted); }
  .tm-row.done .s-check { border-color: #d9b264; background: #2a2010; }
  .tm-row:disabled, .tm-chip:disabled { opacity: 0.5; cursor: default; }
  .tm-presets { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
  .tm-chip { min-height: 46px; border: 1px solid #262626; border-radius: 6px; background: #131313; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
  .tm-chip.on { border-color: var(--accent); background: #1c1710; color: var(--accent); }
  .s-timebtn:focus-visible, .tm-row:focus-visible, .tm-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  #sheet-box:focus, #reveal-box:focus { outline: none; }
  .s-habit:focus-visible, .s-wild:focus-visible, .s-opt:focus-visible, .s-btn:focus-visible, .s-btn2:focus-visible, .s-link:focus-visible, .s-x:focus-visible, .s-cell:focus-visible, .sh-card:focus-visible, .sw-row:focus-visible, .sw-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  #sheet-box { width: 100%; max-width: 600px; max-height: 88%; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #141414; border-top: 1px solid #2a2a2a; border-radius: 14px 14px 0 0; padding: 18px 16px max(22px, calc(env(safe-area-inset-bottom) + 14px)); color: var(--ink); font-family: var(--sans); }
  #sheet-body { display: flex; flex-direction: column; gap: 16px; }
  .sh-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .sh-head > div { display: flex; flex-direction: column; gap: 4px; }
  .sh-head .s-x { margin: -8px -10px 0 0; }
  .sh-title { font-family: var(--serif); font-size: 26px; line-height: 1.1; font-weight: 400 !important; }
  .sh-group { display: flex; flex-direction: column; gap: 7px; }
  .sh-group h3 { font-size: 13px; color: #a39b8b; }
  .sh-cards { display: grid; grid-template-columns: 1fr; gap: 6px; }
  .sh-card { min-height: 52px; padding: 9px 14px; background: #1c1c1c; border: 1px solid #303030; border-radius: 6px; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer; }
  .sh-card.on { background: #1c1710; border-color: var(--accent); color: #e6cf9f; font-weight: 500; }
  .sh-card-n, .sh-card-d { display: block; }
  .sh-card-n { font-size: 15px; }
  .sh-card-d { margin-top: 2px; font-size: 13.5px; font-weight: 400; line-height: 1.4; color: var(--muted); }
  .sh-card.on .sh-card-d { color: #d8d0c0; }
  .sh-card.rest .sh-card-n { text-decoration: line-through; }
  .sh-card:disabled { cursor: default; }
  .sh-card:disabled:not(.on):not(.rest) { color: #77726a; }
  .sh-card.rest { background: transparent; border-color: #1f1f1f; color: #77726a; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
  .sh-card.rest em { font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
  .s-nudge-box { display: flex; flex-direction: column; gap: 10px; }
  .sh-foot { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid #262626; padding: 14px 0 10px; position: sticky; bottom: 0; background: #141414; box-shadow: 0 40px 0 #141414; }
  .sh-rows { display: flex; flex-direction: column; border-top: 1px solid #262626; padding-top: 4px; }
  .sh-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-size: 15px; color: var(--muted); }
  .sh-row .s-check { width: 20px; height: 20px; border-color: #3a3a3a; }
  .sh-row span:nth-child(2) { flex: 1; }
  .sh-row b { font-size: 13px; font-weight: 400; color: #5c5c5c; }
  .sh-row.done { color: var(--ink); }
  .sh-row.done b { color: #7fc296; }
  .sh-sum { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #262626; padding-top: 12px; font-size: 14px; color: var(--muted); }
  .sh-sum > div { display: flex; justify-content: space-between; gap: 12px; }
  .sh-sum .strong { color: var(--ink); font-weight: 500; }
  .sh-swap { display: flex; flex-direction: column; gap: 6px; }
  .sw-row { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr) auto; gap: 10px; align-items: center; width: 100%; min-height: 52px; padding: 6px 12px; background: #131313; border: 1px solid #262626; border-radius: 6px; color: var(--ink); text-align: left; cursor: pointer; }
  .sw-open { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; background: #131313; border: 1px solid #6f5d3a; border-radius: 6px; }
  .sw-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-height: 44px; background: none; border: none; padding: 0; color: inherit; text-align: left; cursor: pointer; }
  .sw-open .s-opt { background: #1a1a1a; border-color: #303030; }
  .sw-open .s-opt.on { background: #1c1710; border-color: var(--accent); }

  /* Full-screen reveal */
  #reveal-overlay { position: fixed; inset: 0; z-index: 160; background: var(--bg); display: none; justify-content: center; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #reveal-overlay.open { display: flex; }
  #reveal-box { width: 100%; max-width: 600px; min-height: 100%; display: flex; flex-direction: column; padding: max(28px, env(safe-area-inset-top)) 16px max(20px, calc(env(safe-area-inset-bottom) + 12px)); color: var(--ink); font-family: var(--sans); }
  #reveal-body { flex: 1; display: flex; flex-direction: column; gap: 18px; }
  .rv-main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; text-align: center; }
  .rv-main .rank-art { margin: 6px 0; }
  .rv-label { font-size: 14px; font-weight: 500; color: var(--accent); }
  .rv-name { font-family: var(--serif); font-size: 60px; line-height: 1; }
  .rv-big { font-family: var(--serif); font-size: 92px; line-height: 0.95; }
  .rv-rank { font-family: var(--serif); font-style: italic; font-size: 28px; color: var(--accent); }
  .rv-sub { font-size: 15px; color: #a39b8b; }
  .rv-msg { font-size: 15px; line-height: 1.55; color: #b5ad9d; padding: 0 12px; }
  .rv-list { text-align: left; border-top: 1px solid #1f1f1f; margin-top: 6px; }
  .bk-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
  @media (prefers-reduced-motion: reduce) { .s-bar > div { transition: none; } }

  /* Fact topic picker (first open of v0.93, and after setup) */
  #topic-overlay { position: fixed; inset: 0; z-index: 400; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; padding-top: env(safe-area-inset-top); }
  #topic-overlay[hidden] { display: none; }
  .tp-flow { max-width: 520px; margin: 0 auto; padding-bottom: 0; }
  #tp-title:focus { outline: none; }
  .tp-list { display: flex; flex-direction: column; gap: 8px; }
  .tp-list .s-opt { align-items: center; }
  .tp-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .tp-ico { flex-shrink: 0; width: 22px; display: flex; justify-content: center; color: #7a6f5c; }
  .tp-list .s-opt.on .tp-ico { color: var(--accent); }
  .tp-list .s-opt.tp-full { opacity: 0.45; }
  .tp-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -16px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--border); }
  .tp-count { font-size: 13px; color: var(--muted); }
  .tp-foot .s-btn { min-width: 150px; }

  /* v0.94: habit sheet, routines, books, season summary */
  .setup-restore { background: none; border: none; color: var(--accent); font-size: 14px; padding: 10px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
  .setup-restore-status { text-align: center; }
  .s-wildhint { font-size: 12.5px; color: #c8a96e; margin: -4px 0 2px; }
  .s-rec-sum { font-size: 12.5px; line-height: 1.45; color: var(--muted); margin: -2px 0 6px; }
  .s-rec-sum .s-link { font-size: 12.5px; padding: 0; min-height: 0; }
  .hs-timer { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--accent); }
  .hs-msg { color: #d9b264; }
  .hs-sec { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid #262626; }
  .hs-sec h3 { font-size: 13px; color: #a39b8b; font-weight: 400; }
  .hs-items { display: flex; flex-direction: column; gap: 6px; }
  .hs-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--ink); }
  .hs-item i { font-style: normal; color: var(--muted); font-size: 13px; }
  .hs-num { width: 96px; text-align: right; }
  .hs-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .hs-chip { min-height: 40px; padding: 6px 14px; border-radius: 20px; border: 1px solid #333333; background: #1a1a1a; color: var(--ink); font-size: 14px; cursor: pointer; }
  .hs-chip.on { border-color: var(--accent); background: #1c1710; color: #e6cf9f; }
  .hs-finish { display: flex; align-items: center; justify-content: center; gap: 8px; }
  .hs-books { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; color: var(--ink); }
  .hs-date { color: var(--muted); font-size: 12.5px; }
  .rt-rows { display: flex; flex-direction: column; gap: 8px; }
  .rt-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px 72px 36px; gap: 6px; align-items: center; }
  .rt-row .setup-input { min-width: 0; }
  .rt-x { width: 36px; height: 44px; }
  .sh-actions { display: flex; gap: 8px; }
  .sh-actions > * { flex: 1; }

  /* v0.95: past-day logs, wildcard collection, Sunday recap */
  .sh-log { display: block; font-size: 13px; line-height: 1.4; color: var(--muted); margin-top: 2px; }
  .sh-log-b { margin: 4px 0 0; }
  .wc-group { display: flex; flex-direction: column; gap: 6px; }
  .wc-g { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
  .wc-cards { display: flex; flex-wrap: wrap; gap: 6px; }
  .wc-card { font-size: 12px; line-height: 1.2; padding: 5px 8px; border: 1px solid #262626; border-radius: 5px; color: #5f5a51; }
  .wc-card.on { border-color: var(--accent); background: #1c1710; color: #e6cf9f; }
  .wc-card b { font-weight: 500; color: var(--accent); }
  .today-recap { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 12px 6px 14px 16px; display: flex; flex-direction: column; gap: 12px; }
  .today-recap[hidden] { display: none; }
  .rc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .rc-eye { font-family: var(--serif); font-size: 20px; line-height: 1.15; color: var(--ink); }
  .rc-range { font-size: 13px; color: var(--muted); margin-top: 2px; }
  .rc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-right: 10px; }
  .rc-stats div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .rc-stats b { font-size: 16px; font-weight: 500; color: #e6cf9f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rc-stats span { font-size: 11px; color: var(--muted); line-height: 1.25; }
  .rc-logs { list-style: none; margin: 0; padding: 10px 10px 0 0; border-top: 1px solid #1f1f1f; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.4; color: #a39b8b; }
  .rc-logs li span { color: var(--ink); }
