/* =====================================================================
   Today Lab — 「墨与印」 Ink & Seal
   Warm paper, ink type, one vermilion seal. Editorial, quiet, precise:
   hairlines instead of floating cards, serif for what you read,
   monospace for time and numbers, the accent only where it means something.
   ===================================================================== */

:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --bg-rail: #eeebe4;
  --surface: #fbfaf7;
  --surface-2: #ffffff;
  --sunken: #ebe7df;
  --ink: #1c1b18;
  --ink-2: #47443d;
  --ink-3: #85806f;
  --ink-4: #b2ac9f;
  --line: #e0dbcf;
  --line-soft: #ebe7de;
  --line-strong: #c9c2b3;
  --accent: #c8452d;
  --accent-hover: #ad3720;
  --accent-soft: #f5e2da;
  --accent-ink: #fff7f2;
  --user-bg: #26241f;
  --user-ink: #f3efe6;
  --good: #3f7a57;
  --good-soft: #e3eee5;
  --warn: #a8711b;
  --warn-soft: #f4ead6;
  --bad: #b23f2a;
  --bad-soft: #f6e0da;
  --info: #3c6688;
  --info-soft: #e1eaf1;
  --shadow-1: 0 1px 2px rgba(28, 27, 24, 0.05);
  --shadow-pop: 0 1px 0 rgba(28, 27, 24, 0.04), 0 18px 40px -12px rgba(28, 27, 24, 0.22), 0 0 0 1px rgba(28, 27, 24, 0.05);
  --r-xs: 4px;
  --r-sm: 6px;
  --r: 9px;
  --r-lg: 13px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", ui-serif, Georgia, serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --rail-w: 248px;
  --drawer-w: 452px;
  /* old names some inline styles still read */
  --paper: var(--bg);
  --muted: var(--ink-3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131210;
    --bg-rail: #0f0e0c;
    --surface: #1a1916;
    --surface-2: #1f1e1a;
    --sunken: #0f0e0c;
    --ink: #ede9df;
    --ink-2: #c6c0b3;
    --ink-3: #8e8879;
    --ink-4: #5d5950;
    --line: #2d2b26;
    --line-soft: #24221e;
    --line-strong: #3c3932;
    --accent: #e0664c;
    --accent-hover: #ea7a61;
    --accent-soft: #3a201a;
    --accent-ink: #1a0f0b;
    --user-bg: #ede9df;
    --user-ink: #1c1b18;
    --good: #79b38c;
    --good-soft: #1d2b21;
    --warn: #d8a24c;
    --warn-soft: #2e2516;
    --bad: #e3765e;
    --bad-soft: #351c16;
    --info: #86aecd;
    --info-soft: #18242e;
    --shadow-1: none;
    --shadow-pop: 0 0 0 1px #2d2b26, 0 20px 44px -12px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131210; --bg-rail: #0f0e0c; --surface: #1a1916; --surface-2: #1f1e1a; --sunken: #0f0e0c;
  --ink: #ede9df; --ink-2: #c6c0b3; --ink-3: #8e8879; --ink-4: #5d5950;
  --line: #2d2b26; --line-soft: #24221e; --line-strong: #3c3932;
  --accent: #e0664c; --accent-hover: #ea7a61; --accent-soft: #3a201a; --accent-ink: #1a0f0b;
  --user-bg: #ede9df; --user-ink: #1c1b18;
  --good: #79b38c; --good-soft: #1d2b21; --warn: #d8a24c; --warn-soft: #2e2516; --bad: #e3765e; --bad-soft: #351c16; --info: #86aecd; --info-soft: #18242e;
  --shadow-1: none; --shadow-pop: 0 0 0 1px #2d2b26, 0 20px 44px -12px rgba(0, 0, 0, 0.7);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body, #app {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft); color: var(--ink); }
button, input, textarea, select { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
button:disabled { opacity: 0.42; cursor: default; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
input, textarea, select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input:focus, textarea:focus, select:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px var(--line-soft); }
textarea { resize: vertical; line-height: 1.7; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
label { display: block; font-size: 12.5px; font-weight: 550; color: var(--ink-2); margin: 16px 0 6px; }
kbd { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--r-xs); padding: 0 5px; line-height: 17px; background: var(--surface); }
kbd:empty { display: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- 拾日's face (the mascot) ---------- */
.seal {
  --s: 28px;
  width: var(--s);
  height: var(--s);
  flex: none;
  display: inline-block;
  border-radius: 24%;
  overflow: hidden;
  background: #1e2558;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12);
  line-height: 0;
  user-select: none;
}
.seal .mascot { width: 100%; height: 100%; display: block; }
.seal-xs { --s: 18px; border-radius: 28%; }
.seal-sm { --s: 22px; }
.seal-msg { --s: 26px; margin-top: 2px; }
.seal-xl { --s: 64px; }
.seal-xxl { --s: 96px; }
.seal-call { --s: 112px; }
.mascot .m-eyes-happy, .mascot .m-eyes-asleep, .mascot .m-brows { display: none; }
.mascot .m-eyes-open, .mascot .m-halo, .mascot .m-sun { transform-box: fill-box; transform-origin: center; }
/* idle: a blink every few seconds */
.mascot-idle .m-eyes-open { animation: m-blink 5.6s infinite; }
@keyframes m-blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.12); } }
/* thinking: the eyes glance side to side */
.mascot-thinking .m-eyes-open { animation: m-glance 2.6s ease-in-out infinite; }
@keyframes m-glance { 0%, 100% { transform: translate(-30px, -6px); } 50% { transform: translate(30px, -6px); } }
/* working: the glow breathes, eyes up and focused */
.mascot-working .m-halo { animation: m-breathe 1.8s ease-in-out infinite; }
.mascot-working .m-eyes-open { transform: translateY(-16px); }
@keyframes m-breathe { 50% { opacity: 0.35; transform: scale(1.05); } }
/* happy: smiling eyes */
.mascot-happy .m-eyes-open { display: none; }
.mascot-happy .m-eyes-happy { display: inline; }
/* worried: brows, eyes a little smaller */
.mascot-worried .m-brows { display: inline; }
.mascot-worried .m-eyes-open { transform: scale(0.88); }
/* asleep (late at night, nothing running): eyes closed, the sun sinks a little */
.mascot-asleep .m-eyes-open { display: none; }
.mascot-asleep .m-eyes-asleep { display: inline; }
.mascot-asleep .m-sun, .mascot-asleep .m-eyes-asleep { transform: translateY(40px); }
.seal.listening .m-halo { animation: m-breathe 1.4s ease-in-out infinite; }

/* ---------- shell ---------- */
.shell {
  height: 100%;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  overflow: hidden;
}
.shell.with-drawer { grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--drawer-w); }
.main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.content { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
/* the document never scrolls or bounces as a whole; only the lists inside do */
html, body { overscroll-behavior: none; }
.page-scroll { padding: 36px 56px 140px; scroll-padding-top: 20px; }
.page { width: 100%; max-width: 780px; margin: 0 auto; }
.page-today { max-width: 1120px; }
.page-settings, .page-assistant { max-width: 720px; }

/* ---------- rail ---------- */
.rail {
  background: var(--bg-rail);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 12px 12px;
  overflow: hidden;
}
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.rail-brand .seal { --s: 26px; }
.rail-word { font-family: var(--serif); font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.rail-word-sub { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--accent); text-transform: uppercase; align-self: flex-start; margin: 3px 0 0 -4px; }
.rail-nav { display: grid; gap: 1px; }
.rail-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 13.5px;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.rail-item svg { width: 17px; height: 17px; color: var(--ink-3); }
.rail-item:hover { background: var(--line-soft); color: var(--ink); }
.rail-item.active { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1), 0 0 0 1px var(--line-soft); }
.rail-item.active svg { color: var(--accent); }
.rail-item.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--accent); }
.rail-count { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--accent); }
.rail-live { margin-top: 26px; display: grid; gap: 1px; min-height: 0; overflow: auto; }
.rail-section { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--ink-3); text-transform: uppercase; padding: 0 10px 8px; }
.rail-quiet { font-size: 12.5px; color: var(--ink-4); padding: 0 10px; }
.rail-run { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--r-sm); font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.rail-run:hover { background: var(--line-soft); color: var(--ink); }
.rail-run-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-run .spinner { width: 11px; height: 11px; }
.rail-run-dot { width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--warn); flex: none; }
.rail-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 1px; }
.rail-me { display: flex; align-items: center; gap: 10px; padding: 8px 8px 2px; min-width: 0; }
.rail-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--sunken); color: var(--ink-2); display: grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; }
.rail-email { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar {
  height: 52px;
  min-height: 52px;
  padding: 0 20px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
}
.topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.topbar-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); padding-left: 10px; border-left: 1px solid var(--line); }
.top-actions { display: flex; align-items: center; gap: 4px; }
.icon-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.icon-button:hover { background: var(--line-soft); color: var(--ink); }
.icon-button svg { width: 17px; height: 17px; }
.ask-toggle { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 7px; margin-left: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); }
.ask-toggle:hover { border-color: var(--line-strong); color: var(--ink); }
.ask-toggle.on { background: var(--sunken); }

/* ---------- ask bar ---------- */
.askbar {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 48px));
  height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 14px;
  background: var(--surface-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  color: var(--ink-3);
  font-size: 13.5px;
  z-index: 5;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.askbar:hover { transform: translateX(-50%) translateY(-1px); color: var(--ink-2); }
.askbar-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- drawer ---------- */
.drawer { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); background: var(--surface); animation: drawer-in 0.22s var(--ease); }
@keyframes drawer-in { from { transform: translateX(16px); opacity: 0; } }
.drawer-head { height: 52px; min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line-soft); }
.drawer-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13.5px; }
.drawer .chat-scroll { padding: 18px 22px 24px; }
.drawer .composer-wrap { padding: 10px 16px 16px; }
.drawer .message.assistant { grid-template-columns: 22px minmax(0, 1fr); gap: 12px; }
.drawer .seal-msg { --s: 22px; }
.drawer .inspiration-fab { display: none; }

/* ---------- page headings ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 26px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.page-title, .settings-title { font-family: var(--serif); font-size: 32px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; margin: 0; }
.subtitle { color: var(--ink-3); font-size: 13.5px; margin: 6px 0 24px; line-height: 1.7; }
.settings-title + .subtitle { margin-top: 6px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 0 12px; }
.section-heading h2 { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-3); }
.section-label, .settings-section-title { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-3); margin: 34px 0 10px; }
.eyebrow, .section-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--ink-3); text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.small-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--accent); font-weight: 500; }
.small-link:hover { color: var(--accent-hover); }
.small-link svg { width: 14px; height: 14px; }

/* ---------- buttons ---------- */
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.primary, .secondary, .pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 15px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.12s var(--ease), border-color 0.12s var(--ease), color 0.12s var(--ease);
}
.primary { background: var(--accent); color: #fff; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12); }
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary.small { height: 30px; padding: 0 12px; }
.secondary, .pill-button { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.secondary:hover:not(:disabled), .pill-button:hover { box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--surface); }
.pill-button svg { width: 15px; height: 15px; }
.danger { color: var(--bad); }
.icon-button.round-add { box-shadow: inset 0 0 0 1px var(--line); background: var(--surface-2); }

/* ---------- chips ---------- */
.chip, .round-chip, .brief-chip, .interest-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  line-height: 1;
  padding: 6px 9px;
  border-radius: var(--r-xs);
  color: var(--ink-2);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  margin: 0;
}
.chip { padding: 4px 7px; font-size: 11.5px; }
.chip.warn { color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 35%, transparent); }
.chip.muted { color: var(--ink-3); }
.round-chip { cursor: pointer; }
.round-chip:hover { box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink); }
.round-chip.active { background: var(--ink); color: var(--bg); box-shadow: none; }
.tone-good { color: var(--good); }
.tone-bad { color: var(--bad); }
.tone-warn { color: var(--warn); }
.tone-info { color: var(--info); }

/* ---------- generic surfaces ---------- */
.card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin: 12px 0;
}
.card p { font-size: 14px; line-height: 1.75; color: var(--ink-2); margin: 8px 0; }
.card.warm { border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 45%, var(--surface-2)); }
.card.sage { background: var(--surface-2); }
.card-title { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.45; margin: 6px 0 6px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font-size: 12px; color: var(--ink-3); }
.card-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.body-preview { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two-cols .card { margin: 0; }
.list-card { border-top: 1px solid var(--line); margin: 4px 0 22px; }
.list-card:empty { display: none; }
.row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--line-soft); }
.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 14px; line-height: 1.6; color: var(--ink); }
.row-meta { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.6; }
.row button { flex-shrink: 0; }
.row .circle { width: 17px; height: 17px; margin-top: 3px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); display: grid; place-items: center; }
.row .circle svg { width: 11px; height: 11px; stroke-width: 2.4; }
.row.done .row-title { color: var(--ink-4); text-decoration: line-through; }
.row.done .circle { background: var(--ink); box-shadow: none; color: var(--bg); }
.empty { text-align: center; padding: 64px 24px; color: var(--ink-3); font-size: 13.5px; line-height: 1.8; }
.empty svg { width: 30px; height: 30px; color: var(--ink-4); margin-bottom: 14px; }
.empty strong { display: block; font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.empty .secondary { margin-top: 16px; }
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); display: inline-block; margin-right: 6px; }
.status-dot.off { background: var(--ink-4); }
.top-status { font-size: 12px; color: var(--ink-3); }

/* segmented controls: underlined tabs, not pills */
.segments, .wide-segments, .inspiration-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 6px 0 20px; background: none; padding: 0; width: auto; }
.segments button, .wide-segments button, .inspiration-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0 11px;
  font-size: 13.5px;
  color: var(--ink-3);
  border-radius: 0;
  background: none;
  flex: none;
}
.segments button:hover, .wide-segments button:hover, .inspiration-tab:hover { color: var(--ink); }
.segments button.selected, .wide-segments button.selected, .inspiration-tab.active { color: var(--ink); font-weight: 600; background: none; box-shadow: none; }
.segments button.selected::after, .wide-segments button.selected::after, .inspiration-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.wide-segments svg { width: 15px; height: 15px; }

/* switches */
.switch, .toggle { position: relative; width: 34px; height: 20px; border-radius: 10px; background: var(--line-strong); flex: none; transition: background 0.15s var(--ease); display: inline-block; }
.switch::after, .toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: left 0.15s var(--ease); }
.switch.on, .toggle.on { background: var(--accent); }
.switch.on::after, .toggle.on::after { left: 16px; }

/* =====================================================================
   TODAY — the daily edition
   ===================================================================== */
.masthead { padding: 6px 0 22px; margin-bottom: 30px; border-bottom: 3px double var(--line-strong); }
.masthead-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--accent); text-transform: uppercase; margin-bottom: 10px; }
.masthead-date { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; font-family: var(--serif); font-size: 46px; font-weight: 650; line-height: 1.08; letter-spacing: -0.015em; }
.masthead-week { font-size: 24px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.masthead-line { margin: 12px 0 0; font-size: 15px; color: var(--ink-2); }
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; }
.today-main { min-width: 0; }
.today-side { position: sticky; top: 0; display: grid; gap: 30px; min-width: 0; }
.side-block { min-width: 0; }
.side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 9px; margin-bottom: 12px; border-bottom: 1px solid var(--ink); }
.side-head h3 { font-size: 12px; font-weight: 650; letter-spacing: 0.08em; color: var(--ink); }
.side-quiet { font-size: 13px; color: var(--ink-3); line-height: 1.7; }

/* agenda: a vertical run of time */
.agenda-list { list-style: none; margin: 0; padding: 0; position: relative; }
.agenda-list::before { content: ""; position: absolute; left: 53px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.agenda-row { display: grid; grid-template-columns: 44px 18px minmax(0, 1fr); align-items: start; padding: 5px 0; }
.agenda-time { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding-top: 2px; font-variant-numeric: tabular-nums; }
.agenda-tick { position: relative; width: 7px; height: 7px; margin: 7px 0 0 6px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--ink-4); z-index: 1; }
.agenda-body { display: flex; flex-direction: column; min-width: 0; }
.agenda-title { font-size: 13.5px; color: var(--ink); line-height: 1.5; }
.agenda-meta { font-size: 11.5px; color: var(--ink-3); }
.agenda-done .agenda-title, .agenda-done .agenda-time { color: var(--ink-4); }
.agenda-done .agenda-tick { background: var(--ink-4); box-shadow: none; }
.agenda-now .agenda-time { color: var(--accent); }
.agenda-now .agenda-tick { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.agenda-now .agenda-title { font-weight: 600; }

/* care (money and mail) */
.care-card { background: none; border: 0; padding: 0; margin: 0; }
.care-card .eyebrow { display: none; }
.care-card .card-head-row { padding-bottom: 9px; margin-bottom: 4px; border-bottom: 1px solid var(--ink); }
.care-card .card-head-row::before { content: "为你着想"; font-size: 12px; font-weight: 650; letter-spacing: 0.08em; }
.mail-card { display: flex; flex-direction: column; gap: 0; }
.mail-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.mail-item:last-of-type { border-bottom: 0; }
.mail-item .agenda-title { font-size: 13.5px; }
.mail-item.important .agenda-title { color: var(--ink); font-weight: 600; }
.mail-item.important .agenda-title::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin: 0 8px 2px 0; }
.mail-item .row-meta { margin: 0; }
.mail-item .buttons { margin-top: 6px; gap: 6px; }
.mail-item .buttons .secondary, .mail-item .buttons .primary { height: 26px; padding: 0 9px; font-size: 12px; font-weight: 500; }
.interest-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.interest-tag { color: var(--ink-2); }

/* the edition: briefs and followed updates as numbered stories */
.edition-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 4px; padding-bottom: 9px; border-bottom: 1px solid var(--ink); }
.edition-head + .edition-lede { margin-top: 14px; }
.today-main > .edition-head:not(:first-child) { margin-top: 44px; }
.edition-name { font-size: 12px; font-weight: 650; letter-spacing: 0.08em; }
.edition-time { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.edition-lede { font-family: var(--serif); font-size: 18px; line-height: 1.6; color: var(--ink-2); margin: 14px 0 4px; font-style: italic; }
.edition-foot { padding: 10px 0 0; }
.edition-pending { padding: 22px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.edition-pending-title { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.4; margin: 10px 0 6px; }
.edition-pending-copy { color: var(--ink-2); margin: 0; }

.story { padding: 24px 0 26px; border-bottom: 1px solid var(--line); }
.brief-category { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.story-no { font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 500; }
.story-cat { font-size: 12px; color: var(--ink-3); letter-spacing: 0.04em; }
.brief-category svg { display: none; }
.brief-headline { font-family: var(--serif); font-size: 23px; font-weight: 650; line-height: 1.42; letter-spacing: -0.005em; margin: 0 0 10px; text-wrap: pretty; }
.brief-summary { font-size: 15px; line-height: 1.8; color: var(--ink-2); margin: 0; max-width: 64ch; }
.brief-block { margin-top: 18px; }
.brief-block-title { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 8px; }
/* timeline: stops on a rule */
.brief-timeline-row { display: flex; position: relative; border-top: 1px solid var(--line-strong); }
.brief-stop { flex: 1; min-width: 0; position: relative; padding: 14px 12px 0 0; }
.brief-dot { position: absolute; top: -4px; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.brief-stop.tone-warn .brief-dot, .brief-stop.tone-bad .brief-dot { background: var(--accent); box-shadow: none; }
.brief-stop-date { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.brief-stop-label { font-size: 13.5px; font-weight: 600; color: var(--ink); margin: 2px 0 4px; }
.brief-badge { font-size: 11.5px; color: var(--ink-3); }
.brief-stop.tone-warn .brief-badge, .brief-stop.tone-bad .brief-badge { color: var(--accent); }
/* metrics: figures between vertical rules */
.brief-metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.brief-metric { padding: 12px 16px 12px 0; min-width: 0; }
.brief-metric + .brief-metric { padding-left: 16px; border-left: 1px solid var(--line); }
.brief-metric-label { font-size: 11.5px; color: var(--ink-3); }
.brief-metric-value { font-family: var(--serif); font-size: 26px; font-weight: 650; line-height: 1.25; margin: 2px 0; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.brief-metric-value.tone-good { color: var(--good); }
.brief-metric-value.tone-bad, .brief-metric-value.tone-warn { color: var(--accent); }
.brief-metric-note { font-size: 12px; color: var(--ink-3); }
/* list: label · value on hairlines */
.brief-list-row { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.brief-block > .brief-list-row:first-of-type, .brief-block-title + .brief-list-row { border-top: 1px solid var(--line-soft); }
.brief-list-top { display: flex; align-items: baseline; gap: 12px; font-size: 13.5px; }
.brief-list-title { flex: 1; min-width: 0; color: var(--ink-2); font-weight: 400; }
.brief-list-value { margin-left: auto; font-weight: 600; color: var(--ink); text-align: right; }
.brief-list-title.tone-good ~ .brief-list-value { color: var(--good); }
.brief-list-title.tone-warn ~ .brief-list-value, .brief-list-title.tone-bad ~ .brief-list-value { color: var(--accent); }
.brief-list-title.tone-good, .brief-list-title.tone-warn, .brief-list-title.tone-bad, .brief-list-title.tone-info { color: var(--ink-2); }
.brief-list-detail { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.6; }
.brief-bar { height: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.brief-bar-fill { height: 100%; background: var(--ink); }
.brief-compare-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.brief-compare-col { padding: 12px 16px 4px 0; }
.brief-compare-col + .brief-compare-col { padding-left: 16px; border-left: 1px solid var(--line); }
.brief-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.brief-chip.tone-bad, .brief-chip.tone-warn { color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.brief-note { font-size: 13.5px; line-height: 1.75; color: var(--ink-2); margin: 0; padding-left: 14px; border-left: 2px solid var(--accent); }
.brief-actions { margin-top: 18px; }
.brief-sources, .proactive-sources { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 12px; }
.brief-sources a, .proactive-sources a { color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; }
.brief-sources a::before, .proactive-sources a::before { content: "↗ "; color: var(--accent); }
.feed-interest { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12px; color: var(--ink-3); }
.feed-interest span { flex: 1; }
.feed-interest svg { width: 13px; height: 13px; }

/* ready list (artifacts) */
.ready-list { border-top: 1px solid var(--ink); }
.ready-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 14px; align-items: baseline; width: 100%; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.ready-row:hover .ready-title { color: var(--accent); }
.ready-kind { font-size: 11.5px; color: var(--ink-3); }
.ready-title { font-family: var(--serif); font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ready-date { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }

/* feedback */
.rating-box { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.rating-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rating-row .row-meta { margin: 0 6px 0 0; font-size: 12px; }
.rating-row .round-chip { padding: 5px 8px; font-size: 11.5px; }
.rating-note-row { flex-wrap: nowrap; }
.rating-note { flex: 1; min-width: 0; height: 30px; padding: 4px 10px; font-size: 12.5px; border-radius: var(--r-sm); }

/* =====================================================================
   CONVERSATION
   ===================================================================== */
.chat-content { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.chat-scroll { flex: 1; min-height: 0; overflow: auto; padding: 32px max(32px, calc((100% - 740px) / 2)) 28px; }
.welcome { max-width: 560px; margin: 8vh auto 0; text-align: left; }
.welcome .seal { margin-bottom: 26px; }
.welcome h2 { font-family: var(--serif); font-size: 34px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; margin: 0 0 12px; }
.welcome p { font-size: 15px; color: var(--ink-2); line-height: 1.8; white-space: pre-line; margin: 0; }
.suggestions { display: grid; gap: 0; margin-top: 30px; border-top: 1px solid var(--line); }
.suggestions button { display: flex; align-items: center; justify-content: space-between; padding: 13px 2px; border-bottom: 1px solid var(--line-soft); font-size: 14px; color: var(--ink); background: none; box-shadow: none; height: auto; border-radius: 0; font-weight: 400; }
.suggestions button::after { content: "→"; color: var(--ink-4); transition: transform 0.15s var(--ease), color 0.15s; }
.suggestions button:hover::after { transform: translateX(3px); color: var(--accent); }

.message { margin: 0 0 30px; display: flex; min-width: 0; }
.message.assistant { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 16px; }
.message.user { justify-content: flex-end; }
.message.user .bubble-column { align-items: flex-end; max-width: 78%; }
.bubble { min-width: 0; overflow-wrap: anywhere; font-size: 15px; line-height: 1.8; color: var(--ink); }
.message.user .bubble { max-width: 78%; background: var(--user-bg); color: var(--user-ink); padding: 10px 15px; border-radius: 14px 14px 3px 14px; font-size: 14.5px; line-height: 1.7; }
.message.user .bubble-column .bubble { max-width: 100%; }
.message.user .bubble a { color: inherit; text-decoration: underline; }
.bubble-column { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.message.assistant .bubble-column { width: 100%; }
.message .avatar { display: none; }

/* prose (assistant writing) */
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 2px; }
.prose .gap { height: 12px; }
.prose h3 { font-family: var(--serif); font-size: 18px; font-weight: 650; margin: 18px 0 6px; line-height: 1.45; }
.prose h4 { font-size: 14.5px; font-weight: 650; margin: 14px 0 4px; }
.prose strong { font-weight: 650; color: var(--ink); }
.message.user .prose strong { color: inherit; }
.prose ul, .prose ol { margin: 4px 0 8px; padding-left: 22px; }
.prose li { margin: 3px 0; padding-left: 2px; }
.prose ul li::marker { color: var(--accent); }
.prose ol li::marker { color: var(--ink-3); font-family: var(--mono); font-size: 0.86em; }
.prose blockquote { margin: 8px 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--accent); color: var(--ink-2); }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--sunken); padding: 1px 5px; border-radius: var(--r-xs); }
.prose pre { margin: 10px 0; padding: 14px 16px; background: var(--sunken); border-radius: var(--r); overflow: auto; font-size: 12.5px; line-height: 1.65; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose hr { margin: 16px 0; }
.table-wrap { margin: 12px 0; overflow-x: auto; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line-strong); }
.prose table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.55; }
.prose th { text-align: left; font-size: 11.5px; font-weight: 650; letter-spacing: 0.04em; color: var(--ink-3); padding: 9px 14px 8px 0; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.prose td { padding: 9px 14px 9px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; font-variant-numeric: tabular-nums; }
.prose tr:last-child td { border-bottom: 0; }
.message.user .prose code { background: rgba(255, 255, 255, 0.14); }

/* under-message lines */
.origin-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.origin-line svg { width: 13px; height: 13px; }
.origin-line.needs-user { color: var(--warn); }
.file-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-width: 380px; }
.file-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); cursor: pointer;
  transition: border-color .15s, background .15s; }
.file-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.file-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-card > svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.file-mark { flex: none; display: grid; place-items: center; width: 34px; height: 40px; border-radius: 6px; color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.file-word { background: #2b5797; } .file-excel { background: #1e7145; } .file-ppt { background: #c4482c; }
.file-pdf { background: #b3261e; } .file-md { background: var(--ink-3); }
.file-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.file-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-text .row-meta { font-size: 12px; }
.memory-line { color: var(--ink-3); }
.memory-line svg { color: var(--accent); }
.origin-action { font-size: 12px; color: var(--accent); padding: 0 2px; }
.origin-action:hover { text-decoration: underline; text-underline-offset: 3px; }
.reaction-chip { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }
.run-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -14px 0 26px 42px; font-size: 12px; color: var(--ink-3); }
.run-status-note { order: 10; flex-basis: 100%; white-space: pre-wrap; font-size: 13.5px; line-height: 1.75; color: var(--ink-2); padding: 10px 14px; border-left: 2px solid var(--warn); background: var(--warn-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.proactive-extras { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; width: 100%; }
.proactive-extras .brief-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.choice-box { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding: 14px 16px; width: 100%; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.choice-question { font-weight: 600; font-size: 14px; }
.choice-options { display: flex; flex-wrap: wrap; gap: 6px; }
.choice-chip { padding: 8px 12px; font-size: 13px; }
.choice-box .primary.small { align-self: flex-start; }
/* live reply */
.live-row .bubble-column { gap: 8px; }
.live-status { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-3); min-height: 26px; }
.live-label { color: var(--ink-2); }
.live-count { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.live-status .small-link { margin-left: auto; }
.live-bubble::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; vertical-align: -0.15em; background: var(--accent); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* composer */
.composer-wrap { position: relative; padding: 10px max(28px, calc((100% - 760px) / 2)) 22px; }
.composer {
  background: var(--surface-2);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  padding: 8px 8px 8px 10px;
  transition: box-shadow 0.15s var(--ease);
}
.composer:focus-within { box-shadow: inset 0 0 0 1px var(--line-strong), 0 0 0 4px var(--line-soft); }
.composer-row { display: flex; align-items: flex-end; gap: 4px; }
.composer-row textarea { flex: 1; border: 0; background: transparent; box-shadow: none; resize: none; min-height: 34px; max-height: 180px; padding: 6px 6px; font-size: 14.5px; line-height: 1.6; border-radius: 0; }
.composer-row textarea:focus, .composer-row textarea:focus-visible { box-shadow: none; outline: none; }
.composer-row .icon-button { width: 34px; height: 34px; flex: none; }
.send-button { width: 34px; height: 34px; border-radius: var(--r); display: grid; place-items: center; background: var(--ink); color: var(--bg); flex: none; transition: background 0.12s var(--ease); }
.send-button:not(:disabled):hover { background: var(--accent); color: #fff; }
.send-button svg { width: 16px; height: 16px; stroke-width: 2; }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 2px 6px; }
.attachments:empty { display: none; }
.attachment-chip { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 8px; border-radius: var(--r-xs); background: var(--sunken); font-size: 12px; color: var(--ink-2); }
.attachment-chip svg { width: 13px; height: 13px; }
.attachment-chip button { color: var(--ink-3); font-size: 14px; line-height: 1; }
.follow-chip { color: var(--accent); }
.inspiration-fab { display: none !important; position: absolute; right: max(28px, calc((100% - 760px) / 2)); top: -34px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); padding: 4px 2px; }
.inspiration-fab:hover { color: var(--accent); }
.inspiration-fab svg { width: 14px; height: 14px; }

/* popovers */
.plus-pop { position: fixed; z-index: 60; min-width: 220px; padding: 6px; background: var(--surface-2); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); animation: pop 0.14s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(0.98); } }
.plus-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); font-size: 13.5px; color: var(--ink); }
.plus-item:hover { background: var(--line-soft); }
.plus-item svg { width: 16px; height: 16px; color: var(--ink-3); }
.plus-scope { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px 6px; margin-top: 4px; border-top: 1px solid var(--line-soft); }

/* =====================================================================
   TASKS
   ===================================================================== */
.thread-group { border-top: 1px solid var(--line); margin: 0 0 26px; }
.thread-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 2px; border-bottom: 1px solid var(--line-soft); }
.thread-row:hover .thread-title { color: var(--accent); }
.thread-title { flex: 1; min-width: 0; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-count { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); flex: none; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.thread-back { display: inline-flex; margin: 0 0 12px; }
.thread-heading { font-family: var(--serif); font-size: 28px; font-weight: 650; line-height: 1.3; margin: 6px 0 6px; }
.thread-asked, .thread-steps { margin: 14px 0 0; padding: 0; font-size: 13.5px; border-top: 1px solid var(--line-soft); }
.thread-asked summary, .thread-steps summary { cursor: pointer; padding: 10px 0; color: var(--ink-2); font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; list-style: none; }
.thread-asked summary::before, .thread-steps summary::before { content: "＋ "; color: var(--ink-4); font-weight: 400; }
.thread-asked[open] summary::before, .thread-steps[open] summary::before { content: "－ "; }
.thread-asked-text { white-space: pre-wrap; line-height: 1.75; color: var(--ink-2); padding: 0 0 12px; }
.thread-step { display: grid; grid-template-columns: 16px auto minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 4px 0; font-size: 13px; }
.thread-step-mark { color: var(--good); }
.thread-step.failed .thread-step-mark, .thread-step.failed .thread-step-detail { color: var(--bad); }
.thread-step-tool { color: var(--ink); font-weight: 500; }
.thread-step-detail { color: var(--ink-3); overflow-wrap: anywhere; }
.thread-result { margin: 18px 0 8px; font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
.thread-rounds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.thread-composer { margin-top: 22px; }
.thread-composer .composer-tools { display: flex; align-items: center; justify-content: space-between; }
.template-row { display: flex; align-items: center; gap: 14px; padding: 14px 2px; border-bottom: 1px solid var(--line-soft); }
.template-row:first-of-type { border-top: 1px solid var(--line); }
.template-row > svg { width: 18px; height: 18px; color: var(--ink-3); }
.template-body { flex: 1; min-width: 0; }
.template-title { font-size: 14.5px; font-weight: 600; }
.template-desc { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.6; }
.timeline { margin: 12px 0; border-left: 1px solid var(--line-strong); padding-left: 18px; }
.timeline-entry { font-size: 12.5px; line-height: 1.75; margin: 12px 0; color: var(--ink-3); position: relative; }
.timeline-entry::before { content: ""; position: absolute; left: -22px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.timeline-entry strong { color: var(--ink); font-weight: 600; }

/* =====================================================================
   MEMORY
   ===================================================================== */
.folder-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 30px; }
.folder-tile { display: flex; flex-direction: column; align-items: flex-start; min-height: 118px; padding: 16px 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); text-align: left; transition: border-color 0.12s var(--ease), transform 0.12s var(--ease); }
.folder-tile:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.folder-tile-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--sunken); color: var(--ink-2); margin-bottom: auto; }
.folder-tile-icon svg { width: 16px; height: 16px; }
.folder-tile.accent .folder-tile-icon { background: var(--accent-soft); color: var(--accent); }
.folder-tile-title { font-family: var(--serif); font-size: 17px; font-weight: 650; margin-top: 18px; }
.folder-tile-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.profile-card { margin: 4px 0 30px; padding: 26px 30px 22px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); position: relative; }
.profile-card::before { content: ""; position: absolute; left: 30px; top: 0; width: 44px; height: 3px; background: var(--accent); }
.profile-crown { display: none; }
.profile-title { font-family: var(--serif); font-size: 24px; font-weight: 650; line-height: 1.35; margin: 4px 0 4px; }
.profile-meta { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.profile-body, .profile-empty { font-family: var(--serif); font-size: 16px; line-height: 1.95; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-body.collapsed { max-height: 15.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.profile-body h2, .profile-body h3 { font-size: 16px; margin: 8px 0; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.profile-fixes { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); display: grid; gap: 4px; }
.profile-fix { font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.memory-group-title { display: flex; align-items: center; gap: 7px; margin: 30px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-3); }
.memory-group-title svg { width: 14px; height: 14px; }
.doc-row > svg { width: 17px; height: 17px; margin-top: 3px; color: var(--ink-3); }
.doc-open { text-align: left; }
.doc-open:hover .row-title { color: var(--accent); }
.document { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px 32px; margin-top: 18px; }
.document p { font-size: 15px; line-height: 1.95; white-space: pre-wrap; }
.document .card-title { font-size: 26px; }
.interest-why { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; margin-top: 2px; }
.interest-row { align-items: center; }
.interest-row .row-body.clickable { cursor: pointer; }
.interest-row .row-body.clickable:hover .row-title { color: var(--accent); }
.date-line { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); margin: 4px 0 8px; }

/* =====================================================================
   ASSISTANT
   ===================================================================== */
.assistant-head { position: relative; display: grid; justify-items: start; padding: 8px 0 26px; margin-bottom: 26px; border-bottom: 3px double var(--line-strong); }
.assistant-avatar { position: relative; display: inline-block; border-radius: 18px; }
.avatar-edit { position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; box-shadow: var(--shadow-pop); color: var(--ink-2); }
.avatar-edit svg { width: 12px; height: 12px; }
.assistant-name { font-family: var(--serif); font-size: 40px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.15; margin: 22px 0 6px; }
.assistant-since { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin: 0; }
.assistant-tools { display: flex; gap: 16px; margin-top: 12px; }
.assistant-gear { position: absolute; right: 0; top: 0; }
.diary-card { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 18px; width: 100%; text-align: left; padding: 18px 0; border-bottom: 1px solid var(--line-soft); align-items: start; }
.diary-card:hover .diary-title { color: var(--accent); }
.today-side .diary-card { grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 2px 0 0; border: 0; }
.diary-badge { width: 100%; text-align: center; border-top: 2px solid var(--accent); padding-top: 4px; }
.diary-badge-week { font-size: 11px; color: var(--ink-3); }
.diary-badge-day { font-family: var(--serif); font-size: 22px; font-weight: 650; line-height: 1.1; }
.diary-card-body { min-width: 0; }
.diary-title { font-family: var(--serif); font-size: 17px; font-weight: 650; line-height: 1.4; margin-bottom: 4px; transition: color 0.12s; }
.today-side .diary-title { font-size: 15px; }
.diary-preview { font-size: 13.5px; color: var(--ink-2); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.profile-header { padding: 18px 0 26px; }
.profile-header h2 { font-family: var(--serif); font-size: 26px; margin: 12px 0 4px; }
.profile-header p { font-size: 12.5px; color: var(--ink-3); }

/* =====================================================================
   SETTINGS
   ===================================================================== */
.settings-hero { margin: 8px 0 28px; padding: 0; background: none; border: 0; }
.member-card {
  position: relative;
  width: min(360px, 100%);
  aspect-ratio: 1.62;
  margin: 0 0 22px;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #f4efe5;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(200, 69, 45, 0.55), transparent 55%),
    linear-gradient(160deg, #2a2722, #171612);
  box-shadow: var(--shadow-pop);
}
.member-card::after { content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 7px); pointer-events: none; }
.member-brand { font-family: var(--serif); font-size: 17px; font-weight: 650; letter-spacing: 0.01em; }
.member-brand::after { content: none; }
.member-stamp { position: absolute; right: 22px; top: 18px; width: 30px; height: 30px; border-radius: 6px; background: var(--accent); box-shadow: inset 0 0 0 2px #c8452d, inset 0 0 0 3.5px rgba(255, 255, 255, 0.35); border: 0; }
.member-stamp::after { content: "拾"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 16px; color: #fff7f2; border: 0; }
.member-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.member-name { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 600; }
.member-tier { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: var(--r-xs); padding: 1px 6px; color: rgba(255, 255, 255, 0.8); }
.member-date { font-family: var(--mono); font-size: 11.5px; color: rgba(255, 255, 255, 0.6); }
.hero-plan { font-size: 14px; font-weight: 600; margin-top: 2px; }
.hero-plan-sub, .hero-note { font-size: 12.5px; color: var(--ink-3); margin: 3px 0 0; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 14px 0; border-top: 1px solid var(--line); margin-top: 16px; text-align: left; }
.hero-label { font-size: 14px; font-weight: 600; }
.hero-usage-value { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.hero-usage .row-meta { margin: 0; }
.hero-usage > svg { width: 14px; height: 14px; color: var(--ink-4); }
.usage-bar { width: 96px; height: 3px; background: var(--line); overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--accent); }
.model-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.model-choice { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); text-align: left; min-width: 0; }
.model-choice:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.model-choice.active { box-shadow: inset 0 0 0 1.5px var(--ink); }
.model-choice-text { min-width: 0; }
.model-choice-name { font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-choice-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-choice .radio { width: 15px; height: 15px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); flex: none; }
.model-choice.active .radio { box-shadow: inset 0 0 0 4.5px var(--accent); }
.model-choice.add { justify-content: center; color: var(--ink-3); background: none; box-shadow: inset 0 0 0 1px var(--line); border: 0; outline: 1px dashed var(--line-strong); outline-offset: -1px; }
.settings-group { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); margin: 0 0 8px; overflow: hidden; }
.setting-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); text-align: left; transition: background 0.12s var(--ease); }
.setting-row:hover { background: var(--surface); }
.setting-row:last-child { border-bottom: 0; }
.setting-row svg { width: 17px; height: 17px; color: var(--ink-3); }
.setting-row .label { flex: 1; font-size: 14px; }
.setting-row .value { color: var(--ink-3); font-size: 12.5px; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setting-row .chevron, .setting-row2 > svg { width: 14px; height: 14px; color: var(--ink-4); }
.setting-row2 { padding: 13px 18px; }
.setting-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.setting-row2 .label { font-size: 14px; }
.setting-sub { font-size: 12px; color: var(--ink-3); line-height: 1.55; }
.connector-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.connector { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); text-align: left; min-width: 0; }
.connector:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.connector svg { width: 20px; height: 20px; color: var(--ink-2); }
.connector strong { display: block; font-size: 13.5px; font-weight: 600; }
.connector small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.usage-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.usage-grid div { padding: 14px 16px 14px 0; }
.usage-grid div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.usage-grid strong { display: block; font-family: var(--serif); font-size: 26px; font-weight: 650; }
.usage-grid small { font-size: 11.5px; color: var(--ink-3); }
.model-card { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.model-card:last-child { border: 0; }
.model-card .row-title { font-weight: 600; }
.autosync-box { padding: 14px 16px; margin: 14px 0 6px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.autosync-box .modal-copy { margin: 4px 0 8px; }
.autosync-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.mailbox-list { display: flex; flex-direction: column; gap: 0; margin: 8px 0; border-top: 1px solid var(--line); }
.mailbox-row { padding: 12px 2px; border-bottom: 1px solid var(--line-soft); }
.skill-list { border-top: 1px solid var(--line); }
.skill-row { align-items: center; }
.skill-open { text-align: left; }
.skill-name { font-weight: 600; font-family: var(--mono); font-size: 13px; }
.skill-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skill-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.skill-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; max-height: 46vh; overflow: auto; font-size: 13.5px; }
.skill-files { font-family: var(--mono); font-size: 12px; white-space: pre-line; color: var(--ink-2); }
textarea.mono { font-family: var(--mono); font-size: 12.5px; }
.brief-defs { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.brief-def-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.brief-def-row .rating-note { flex: 1 1 120px; }

/* =====================================================================
   DIALOGS, TOAST, AUTH
   ===================================================================== */
dialog {
  width: min(600px, calc(100% - 32px));
  max-height: 88dvh;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
}
dialog[open] { animation: dialog-in 0.2s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
dialog::backdrop { background: rgba(22, 20, 16, 0.32); backdrop-filter: blur(2px); }
.modal-body { padding: 26px 28px 24px; overflow: auto; max-height: 87dvh; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-family: var(--serif); font-size: 22px; font-weight: 650; letter-spacing: -0.005em; }
.modal-copy { font-size: 13.5px; color: var(--ink-2); line-height: 1.8; }
.modal-body .buttons { justify-content: flex-end; }
.modal-body pre { white-space: pre-wrap; word-break: break-word; background: var(--sunken); padding: 12px 14px; border-radius: var(--r); font-family: var(--mono); font-size: 12px; max-height: 300px; overflow: auto; }
.modal-error, .auth-error { font-size: 12.5px; color: var(--bad); margin-top: 14px; line-height: 1.7; }
.search-input { margin: 12px 0 10px; }
dialog:has(.inspiration) { width: min(1000px, calc(100% - 40px)); }
.inspiration-group { font-size: 12px; font-weight: 650; letter-spacing: 0.08em; color: var(--ink-3); margin: 22px 0 8px; }
.inspiration-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.inspiration-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); transition: background 0.12s; }
.inspiration-card:hover { background: var(--surface); }
.inspiration-card:hover .inspiration-title { color: var(--accent); }
.inspiration-card svg { width: 16px; height: 16px; margin-top: 3px; color: var(--accent); }
.inspiration-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.inspiration-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
#toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 10px);
  max-width: min(520px, 86%);
  padding: 10px 16px;
  border-radius: var(--r);
  background: var(--user-bg);
  color: var(--user-ink);
  font-size: 13px;
  line-height: 1.55;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
.connection-banner { font-size: 12px; color: var(--warn); background: var(--warn-soft); padding: 8px 16px; text-align: center; }
.call-view { text-align: center; padding: 26px 0 6px; }
.call-view .seal { margin: 18px auto 30px; }
.call-view .transcript { min-height: 76px; font-family: var(--serif); font-size: 18px; line-height: 1.8; padding: 0 16px; }
.call-view .buttons { justify-content: center; }

.auth-shell { height: 100%; overflow: auto; display: grid; place-items: center; padding: 32px 22px; background: var(--bg); background-image: radial-gradient(80% 60% at 50% 0%, var(--surface) 0%, transparent 70%); }
.auth-box { width: 100%; max-width: 360px; }
.auth-box > .seal { margin: 0 0 28px; }
.auth-box h1 { font-family: var(--serif); font-size: 36px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 8px; }
.auth-box .subtitle { font-size: 13.5px; margin-bottom: 18px; }
.auth-box .primary { width: 100%; height: 42px; margin-top: 24px; font-size: 14px; }
.auth-bottom { font-size: 12.5px; color: var(--ink-3); margin-top: 18px; }
.auth-note { font-size: 11.5px; color: var(--ink-4); line-height: 1.8; margin-top: 30px; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
.mobile-nav { display: none; }
@media (max-width: 1380px) {
  .today-grid { grid-template-columns: minmax(0, 1fr) 272px; gap: 44px; }
  .page-scroll { padding-left: 44px; padding-right: 44px; }
}
/* with the conversation drawer out, the edition goes to one column unless the screen is very wide */
@media (max-width: 1679px) {
  .with-drawer .today-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .with-drawer .today-side { position: static; order: -1; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 28px; }
  .with-drawer .page-scroll { padding-left: 36px; padding-right: 36px; }
  .with-drawer .masthead-date { font-size: 38px; }
}
@media (max-width: 1099px) {
  :root { --rail-w: 64px; }
  .rail { padding: 16px 10px 10px; align-items: center; }
  .rail-brand { padding: 4px 0 20px; }
  .rail-word, .rail-word-sub, .rail-label, .rail-live, .rail-email, .rail-count { display: none; }
  .rail-item { width: 40px; justify-content: center; padding: 0; }
  .rail-item.active::before { left: -10px; }
  .rail-foot { width: 100%; justify-items: center; }
  .rail-me { padding: 8px 0 2px; }
  .today-grid { grid-template-columns: minmax(0, 1fr); }
  .today-side { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .masthead-date { font-size: 40px; }
}
@media (max-width: 760px) {
  html, body, #app { font-size: 14px; }
  .shell, .shell.with-drawer { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .main { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .topbar { height: calc(48px + env(safe-area-inset-top)); min-height: calc(48px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 18px; }
  .page-scroll { padding: 22px 18px 130px; }
  .chat-scroll { padding: 18px 18px 18px; }
  .composer-wrap { padding: 8px 12px 10px; }
  .inspiration-fab { right: 16px; }
  .askbar { bottom: calc(70px + env(safe-area-inset-bottom)); width: calc(100% - 28px); }
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    justify-content: space-around;
    height: calc(58px + env(safe-area-inset-bottom));
    padding: 6px 8px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .mobile-item { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 56px; padding-top: 4px; font-size: 10.5px; color: var(--ink-3); }
  .mobile-item svg { width: 20px; height: 20px; }
  .mobile-item.active { color: var(--ink); font-weight: 600; }
  .mobile-item.active svg { color: var(--accent); }
  .masthead-date { font-size: 34px; gap: 10px; }
  .masthead-week { font-size: 19px; }
  .today-side { grid-template-columns: minmax(0, 1fr); }
  .brief-headline { font-size: 20px; }
  .brief-timeline-row { overflow-x: auto; }
  .brief-stop { min-width: 92px; }
  .brief-compare-grid, .two-cols { grid-template-columns: 1fr; }
  .brief-metric-value { font-size: 22px; }
  .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .connector-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .message.assistant { grid-template-columns: 22px minmax(0, 1fr); gap: 12px; }
  .seal-msg { --s: 22px; }
  .message.user .bubble, .message.user .bubble-column { max-width: 88%; }
  .run-status { margin-left: 34px; }
  .page-title, .settings-title { font-size: 27px; }
  .modal-body { padding: 22px 20px; }
  .auth-shell { padding-top: calc(36px + env(safe-area-inset-top)); }
  #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- interface styles: hooks used by some styles, hidden in 墨与印 ---------- */
.term, .clock, .nowline, .today-tiles { display: none; }
.style-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.style-name { font-size: 14.5px; font-weight: 650; }
.style-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }
.rail-section { display: flex; justify-content: space-between; }
.rail-section-count { color: var(--accent); }
.picked { display: none; }
.seal-md { --s: 44px; }
.member-stamp .mascot { width: 100%; height: 100%; display: block; position: relative; z-index: 1; }
.member-stamp::after { content: none !important; }

/* new task + working line inside a task */
.task-starters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.thread-working { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.new-task-composer textarea { min-height: 72px; }
.thread-composer textarea { width: 100%; border: 0; background: none; resize: none; outline: none; box-shadow: none; padding: 4px 2px; font: inherit; color: inherit; }
.thread-composer textarea:focus { border: 0; box-shadow: none; }

/* 简报设置 */
.brief-settings { display: grid; gap: 12px; }
.brief-setting { display: grid; gap: 10px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); }
.brief-setting-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.brief-setting-name { font-weight: 600; font-size: 15px; }
.brief-setting-row { display: flex; align-items: center; gap: 8px; }
.brief-setting-row input { width: auto; }
.brief-setting .small-link { justify-self: start; }
.edition-head .icon-button { margin-left: 4px; width: 26px; height: 26px; color: var(--ink-3); }

/* 录音笔记 */
.note-head { display: flex; align-items: center; gap: 10px; }
.note-dot { width: 10px; height: 10px; border-radius: 50%; background: #e5484d; animation: note-pulse 1.4s ease-in-out infinite; }
@keyframes note-pulse { 50% { opacity: 0.35; } }
.note-clock { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.note-transcript { min-height: 120px; max-height: 260px; overflow: auto; white-space: pre-wrap; padding: 12px 14px; border-radius: 12px; background: var(--sunken); color: var(--ink-2); font-size: 14px; line-height: 1.6; margin: 10px 0 14px; }
@media (prefers-reduced-motion: reduce) { .note-dot { animation: none; } }

/* Conversation docked on the left of the page (rail | conversation | page), like Today AI's two panes. */
:root { --dock-w: clamp(360px, 33vw, 480px); }
.shell.with-drawer { grid-template-columns: var(--rail-w) var(--dock-w) minmax(0, 1fr); }
.drawer.dock { border-left: 0; border-right: 1px solid var(--line); animation: none; }

/* Two panes on wide screens: conversation | switchable panel */
:root { --chat-w: clamp(380px, 40vw, 560px); }
.shell.two-pane, [data-ui] .shell.two-pane { grid-template-columns: var(--chat-w) minmax(0, 1fr); }
.pane-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.pane-chat-head { height: 52px; min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 18px; }
.pane-chat-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pane-chat-name { font-weight: 600; font-size: 14px; }
.pane-chat .chat-content { flex: 1; }
.panel-bar { height: 56px; min-height: 56px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 16px; }
.panel-bar-side { display: flex; align-items: center; min-width: 0; }
.panel-bar-side:last-child { justify-content: flex-end; }
.panel-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--sunken); }
.panel-tab { position: relative; height: 30px; padding: 0 16px; border-radius: 999px; font-size: 13.5px; color: var(--ink-2); }
.panel-tab.active { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.04); }
.panel-tab:hover:not(.active) { color: var(--ink); }
.panel-tab-dot { position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.panel-live { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; color: var(--ink-2); background: var(--sunken); }
.panel-live .spinner { width: 10px; height: 10px; }

/* the model account stopped working */
.model-alert { display: flex; align-items: center; gap: 8px; margin: 8px 16px 0; padding: 10px 12px; border-radius: 12px; background: rgba(229, 72, 77, 0.08); color: #b4232a; font-size: 13px; line-height: 1.45; }
.model-alert svg { width: 16px; height: 16px; flex: none; }
.model-alert-text { flex: 1; min-width: 0; }
.model-alert .small-link { color: inherit; font-weight: 600; white-space: nowrap; }

/* 用量 by kind of work */
.usage-kinds { display: grid; gap: 10px; margin: 4px 0 8px; }
.usage-kind-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; margin-bottom: 4px; }
.usage-kind-bar { height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.usage-kind-fill { height: 100%; border-radius: 999px; background: var(--accent); }

/* 搜索 */
.search-input { width: 100%; height: 40px; border-radius: 10px; padding: 0 12px; font-size: 15px; }
.search-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; min-height: 28px; }
.search-results { display: grid; gap: 2px; max-height: 52vh; overflow: auto; }
.search-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: start; text-align: left; padding: 9px 10px; border-radius: 10px; }
.search-row.is-on { background: var(--sunken); }
.search-kind { font-size: 12px; color: var(--ink-3); padding-top: 2px; }
.search-main { display: grid; gap: 2px; min-width: 0; }
.search-title { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search-snippet { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-when { font-size: 12px; color: var(--ink-4); padding-top: 2px; }

/* 健康 */
.health-card { cursor: pointer; }
.health-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.health-big { display: flex; gap: 20px; margin: 4px 0 10px; }
.health-stat { display: flex; flex-direction: column; gap: 1px; }
.health-stat strong { font-size: 24px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--ink); }
.health-stat-label { font-size: 12px; color: var(--ink-3); }
.health-bars { display: block; width: 100%; height: auto; }
.health-bars.is-stretch { height: 60px; }
.health-bars rect, .health-bars line { stroke: none; }
.health-bars .bar-label { stroke: none; }
.health-bars .bar { fill: var(--line-strong); }
.health-bars .bar-now { fill: var(--accent); }
.health-bars .bar-empty { fill: var(--line); }
.health-bars .bar-guide { stroke: var(--ink-4) !important; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.health-bars .bar-label { font-size: 9px; fill: var(--ink-3); }
.health-reading { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.health-reading.is-low, .health-readings .is-low { color: var(--warn); }
.health-readings { margin: 0 0 18px; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.health-section { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.health-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.health-section-head h3 { margin: 0; font-size: 15px; }
.health-note { margin: 8px 0 0; }
.health-workouts { display: grid; gap: 6px; }
.health-workout { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.health-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.sleep-card .sleep-card-more { margin-top: 10px; }
.sleep-card.is-short .brief-bar-fill { background: var(--warn); }
.sleep-card.is-short .brief-cat-icon { color: var(--warn); }

/* 让手机登录 */
.pair-code { font-size: 44px; font-weight: 700; letter-spacing: .12em; font-variant-numeric: tabular-nums; text-align: center;
  padding: 18px 0 6px; color: var(--ink); }
.pair-code.is-expired { color: var(--ink-4); text-decoration: line-through; }
.pair-left { text-align: center; margin: 0 0 16px; }
.auth-code { font-size: 26px; letter-spacing: .2em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-code-switch { width: 100%; margin-top: 8px; }
.remote-url { font-size: 17px; font-weight: 600; text-align: center; padding: 14px 0; word-break: break-all; user-select: all; }
