@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&family=Spectral:wght@500;600&family=Noto+Serif+SC:wght@500;600;700&family=Noto+Sans+SC:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ============================================================
   BlueLifeOS v2 · 昼仪 — 个人生命数据库复核台
   A rigorous blue-on-white system. Premium · rhythmic · disciplined.
   ============================================================ */
.app, .app * { box-sizing: border-box; }
.app {
  /* ---- palette (strict) ---- */
  --brand: #2f6bed; --brand-press: #2356cf; --brand-soft: #7ba0f4;
  --brand-wash: rgba(47,107,237,.065); --brand-wash-2: rgba(47,107,237,.11);
  --brand-line: rgba(47,107,237,.22); --brand-glow: 0 6px 18px -7px rgba(47,107,237,.55);
  --bg: #eceff5; --surface: #ffffff; --surface-2: #f5f7fb; --rail: #fbfcfe;
  --mark-bg: #0f1726; --mark-fg: #ffffff; --bar-bg: rgba(255,255,255,.66); --on-accent: #ffffff;
  --ink-900: #0f1726; --ink-700: #2a3445; --ink-500: #5a6678; --ink-400: #8b96a8; --ink-300: #b3bcc9;
  --line: rgba(15,23,38,.085); --line-2: rgba(15,23,38,.05);
  --ok: #1f9d6b; --ok-wash: rgba(31,157,107,.10);
  --warn: #d98a2b; --warn-wash: rgba(217,138,43,.12);
  --alert: #df5a3d; --alert-wash: rgba(223,90,61,.10);
  --mute: #97a3b4;
  /* ---- type ---- */
  --sans: "Hanken Grotesk", "Noto Sans SC", sans-serif;
  --serif: "Spectral", "Noto Serif SC", serif;
  --mono: "IBM Plex Mono", monospace;
  /* ---- elevation ---- */
  --sh-1: 0 1px 2px rgba(15,23,38,.04), 0 8px 20px -16px rgba(15,23,38,.16);
  --sh-2: 0 1px 2px rgba(15,23,38,.04), 0 16px 34px -22px rgba(15,23,38,.20);
  --rad: 16px; --rad-sm: 11px; --rad-xs: 8px;

  position: fixed; inset: 0; display: flex; overflow: hidden;
  font-family: var(--sans); color: var(--ink-700);
  background: radial-gradient(130% 80% at 88% -8%, rgba(47,107,237,.07), transparent 55%), var(--bg);
  -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.5;
}
.app .mono { font-family: var(--mono); font-variant-numeric: tabular-nums lining-nums; }
.app .ser { font-family: var(--serif); }

/* ---------------- RAIL ---------------- */
.rail { width: 268px; flex: 0 0 268px; display: flex; flex-direction: column; padding: 26px 16px 20px; background: var(--rail); border-right: 1px solid var(--line); box-shadow: 12px 0 38px -28px rgba(15,23,38,.3); z-index: 3; position: relative; }
.brand { display: flex; align-items: center; gap: 13px; padding: 0 8px 18px; }
.brand[role="button"] { cursor: pointer; border-radius: 14px; transition: background .16s ease, transform .16s ease; }
.brand[role="button"]:hover { background: rgba(91,132,255,.08); }
.brand[role="button"]:active { transform: translateY(1px); }
.brand[role="button"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; background: var(--mark-bg); color: var(--mark-fg); display: grid; place-items: center; box-shadow: 0 8px 20px -8px rgba(15,23,38,.5); }
.brand-mark svg { width: 23px; height: 23px; stroke-width: 1.7; }
.brand-name { font-size: 17px; font-weight: 800; color: var(--ink-900); letter-spacing: .005em; line-height: 1.05; }
.brand-tag { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-400); margin-top: 4px; }

.me-chip { display: flex; align-items: center; gap: 10px; margin: 0 6px 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--rad-sm); background: var(--surface); box-shadow: var(--sh-1); }
.me-av { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.me-name { font-size: 13.5px; font-weight: 700; color: var(--ink-900); }
.me-role { font-family: var(--mono); font-size: 9.5px; letter-spacing: .07em; color: var(--ink-400); margin-top: 2px; text-transform: uppercase; white-space: nowrap; }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-wash); margin-left: auto; flex: 0 0 auto; }

.nav { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.nav-cap { font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-400); padding: 0 14px; margin: 16px 0 8px; display: flex; align-items: center; gap: 9px; }
.nav-cap::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.nav-cap:first-child { margin-top: 2px; }
.nav-item { display: flex; align-items: center; gap: 13px; padding: 11px 14px; border-radius: var(--rad-sm); font-size: 14.5px; font-weight: 600; color: var(--ink-500); cursor: pointer; transition: background .2s, color .2s, box-shadow .2s, transform .2s cubic-bezier(.22,1,.36,1); position: relative; }
.nav-item::before { content: ""; position: absolute; left: 3px; top: 50%; width: 3px; height: 0; border-radius: 3px; background: var(--brand); box-shadow: 0 0 8px var(--brand); transform: translateY(-50%); transition: height .22s cubic-bezier(.22,1,.36,1); }
.nav-item .ni-ic { width: 19px; height: 19px; flex: 0 0 19px; display: grid; place-items: center; transition: transform .2s cubic-bezier(.22,1,.36,1); }
.nav-item .ni-ic svg { width: 19px; height: 19px; stroke-width: 1.65; opacity: .85; transition: opacity .2s; }
.nav-item .ni-lab { transition: transform .2s cubic-bezier(.22,1,.36,1); }
.nav-item .ni-code { font-family: var(--mono); font-size: 10px; color: var(--ink-300); margin-left: auto; letter-spacing: .04em; transition: opacity .18s, transform .2s; }
.nav-item:hover { background: var(--brand-wash); color: var(--ink-900); transform: translateX(3px); }
.nav-item:hover .ni-ic { transform: scale(1.12); }
.nav-item:hover .ni-ic svg { opacity: 1; }
.nav-item:hover::before { height: 14px; }
.nav-item.on { background: var(--brand); color: #fff; font-weight: 700; box-shadow: var(--brand-glow); transform: none; }
.nav-item.on::before { height: 22px; background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.6); }
.nav-item.on .ni-ic { transform: scale(1.06); }
.nav-item.on .ni-ic svg { opacity: 1; }
.nav-item.on .ni-code { color: rgba(255,255,255,.7); }
.nav-item .badge { margin-left: auto; font-family: var(--mono); font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--alert); color: #fff; display: grid; place-items: center; }
.nav-item.on .badge { background: rgba(255,255,255,.25); }
.app.dark .nav-item.on::before { background: var(--on-accent); box-shadow: 0 0 10px rgba(10,14,22,.4); }
/* active item entrance */
@media (prefers-reduced-motion: no-preference) {
  .nav-item.on { animation: navOn .32s cubic-bezier(.22,1,.36,1); }
}
@keyframes navOn { from { box-shadow: 0 0 0 0 var(--brand); } to { box-shadow: var(--brand-glow); } }

.rail-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.rstat { display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--ink-500); padding: 0 8px; white-space: nowrap; }
.rstat .mono { margin-left: auto; font-size: 10.5px; color: var(--ink-400); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-wash); flex: 0 0 auto; }
@media (prefers-reduced-motion: no-preference) { .pulse { animation: pulse 3s ease-in-out infinite; } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px var(--ok-wash); } 50% { box-shadow: 0 0 0 5px transparent; } }

/* ---------------- MAIN ---------------- */
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.cmdbar { height: 62px; flex: 0 0 62px; display: flex; align-items: center; gap: 14px; padding: 0 30px; border-bottom: 1px solid var(--line); background: var(--bar-bg); backdrop-filter: blur(10px); z-index: 2; }
.cmdbar .cb-title { font-size: 15px; font-weight: 800; color: var(--ink-900); }
.cmdbar .cb-div { width: 1px; height: 18px; background: var(--line); }
.cmdbar .cb-date { font-family: var(--mono); font-size: 12px; color: var(--ink-400); letter-spacing: .05em; }
.cmdbar .cb-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.cb-read { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-500); white-space: nowrap; }
.cb-read .mono { color: var(--ink-700); font-size: 11.5px; }
.cb-k { font-family: var(--mono); font-size: 10.5px; color: var(--ink-400); border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; letter-spacing: .04em; white-space: nowrap; }

.content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 28px 30px 34px; position: relative; }
.content::-webkit-scrollbar { width: 9px; }
.content::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; border: 3px solid transparent; background-clip: padding-box; }
.live-loading-screen { min-height: calc(100vh - 124px); display: grid; place-items: center; padding: 28px; }
.live-loading-card { width: min(560px, 100%); min-height: 190px; display: flex; align-items: center; gap: 22px; padding: 34px 38px; border: 1px solid var(--line); border-radius: var(--rad); background: linear-gradient(180deg, var(--brand-wash), transparent 72%), var(--surface); box-shadow: var(--sh-2); }
.live-loading-mark { width: 58px; height: 58px; flex: 0 0 58px; border-radius: 18px; display: grid; place-items: center; color: var(--brand); background: var(--brand-wash-2); border: 1px solid var(--brand-line); }
.live-loading-mark span { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--brand-line); border-top-color: var(--brand); animation: liveSpin .85s linear infinite; }
.live-loading-kicker { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--brand); margin-bottom: 8px; }
.live-loading-title { font-size: 30px; font-weight: 800; color: var(--ink-900); letter-spacing: -.02em; line-height: 1.1; }
.live-loading-sub { margin-top: 10px; font-size: 14px; line-height: 1.65; color: var(--ink-500); }
.live-error-card { background: linear-gradient(180deg, var(--alert-wash), transparent 70%), var(--surface); }
.live-error-mark { color: var(--alert); background: var(--alert-wash); border-color: color-mix(in srgb, var(--alert) 28%, transparent); }
.live-error-mark svg { width: 28px; height: 28px; }
.live-retry-btn { margin-top: 16px; }
@keyframes liveSpin { to { transform: rotate(360deg); } }
.page { max-width: 1320px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-h1 { font-size: 24px; font-weight: 800; color: var(--ink-900); letter-spacing: -.018em; }
.page-sub { font-size: 13px; color: var(--ink-500); margin-top: 7px; }
.page-eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-400); margin-bottom: 9px; }

/* ---------------- rhythm / 律动 ---------------- */
@keyframes rise { from { transform: translateY(12px); } to { transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  [data-rise] { animation: rise .5s cubic-bezier(.2,.7,.3,1); }
  .ring-arc { will-change: transform; }
}

/* ---------------- CARD ---------------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rad); box-shadow: var(--sh-1); padding: 22px 24px; display: flex; flex-direction: column; min-height: 0; }
.card.pad-lg { padding: 26px 28px; }
.card.flush { padding: 0; }
.card.accent { border-color: var(--brand-line); background: linear-gradient(180deg, var(--brand-wash), transparent 60%), var(--surface); }
.c-head { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.c-ic { width: 27px; height: 27px; flex: 0 0 27px; border-radius: 8px; background: var(--brand-wash-2); color: var(--brand); display: grid; place-items: center; }
.c-ic svg { width: 15px; height: 15px; stroke-width: 1.7; }
.c-title { font-size: 14px; font-weight: 800; color: var(--ink-900); white-space: nowrap; }
.c-meta { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--ink-400); letter-spacing: .04em; white-space: nowrap; }
.c-link { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--brand); display: flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.c-link svg { width: 13px; height: 13px; }

/* ---------------- TAG / STATUS ---------------- */
.tag { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .03em; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink-500); background: var(--surface-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.tag .tdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag--brand { color: var(--brand); border-color: var(--brand-line); background: var(--brand-wash); }
.tag--ok { color: var(--ok); border-color: rgba(31,157,107,.3); background: var(--ok-wash); }
.tag--warn { color: var(--warn); border-color: rgba(217,138,43,.32); background: var(--warn-wash); }
.tag--alert { color: var(--alert); border-color: rgba(223,90,61,.3); background: var(--alert-wash); }
.tag--mute { color: var(--ink-400); }

/* ---------------- TIMELINE / FEED ---------------- */
.feed { display: flex; flex-direction: column; }
.feed-row { display: grid; grid-template-columns: 15px 50px 1fr; gap: 0 13px; padding: 11px 0; border-top: 1px solid var(--line-2); }
.feed-row:first-child { border-top: none; padding-top: 2px; }
.fr-rail { display: flex; flex-direction: column; align-items: center; }
.fr-node { width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); flex: 0 0 auto; }
.fr-node.mute { background: var(--ink-300); box-shadow: none; }
.fr-line { width: 1px; flex: 1; background: var(--line); margin-top: 4px; }
.feed-row:last-child .fr-line { display: none; }
.fr-time { font-family: var(--mono); font-size: 11px; color: var(--ink-400); padding-top: 3px; }
.fr-meta { display: flex; align-items: center; gap: 8px; }
.fr-src { font-size: 12px; font-weight: 700; color: var(--ink-700); white-space: nowrap; }
.fr-text { font-size: 13px; line-height: 1.55; color: var(--ink-500); margin-top: 5px; text-wrap: pretty; }

/* ---------------- TODO ---------------- */
.todo { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.todo + .todo { border-top: 1px solid var(--line-2); }
.ck { width: 17px; height: 17px; flex: 0 0 17px; border-radius: 6px; border: 1.5px solid var(--ink-300); display: grid; place-items: center; }
.ck.on { background: var(--brand); border-color: var(--brand); }
.ck svg { width: 11px; height: 11px; color: #fff; stroke-width: 2.6; }
.todo-tx { font-size: 13.5px; color: var(--ink-700); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.todo.done .todo-tx { color: var(--ink-400); text-decoration: line-through; }
.todo-due { font-family: var(--mono); font-size: 11px; color: var(--ink-400); white-space: nowrap; flex: 0 0 auto; }
.todo.soon .todo-due { color: var(--brand); }

/* ---------------- CONFIRM CARD ---------------- */
.confirm { padding: 13px 0; border-top: 1px dashed var(--line); }
.confirm:first-of-type { border-top: none; padding-top: 2px; }
.confirm-tx { font-size: 13px; line-height: 1.5; color: var(--ink-700); }
.confirm-foot { display: flex; align-items: center; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.btn { font-family: var(--sans); font-size: 12px; font-weight: 700; padding: 7px 15px; border-radius: var(--rad-xs); border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: filter .15s; }
.btn.p { background: var(--brand); color: #fff; box-shadow: var(--brand-glow); }
.btn.p:hover { filter: brightness(1.05); }
.btn.g { background: transparent; border-color: var(--line); color: var(--ink-500); }
.btn.g:hover { border-color: var(--ink-300); color: var(--ink-700); }
.by { margin-left: auto; font-size: 11px; color: var(--ink-400); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.by .bm { width: 16px; height: 16px; border-radius: 5px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 8.5px; font-weight: 800; }

/* ---------------- GAUGE / RING ---------------- */
.ring-arc { transition: stroke-dashoffset 1.1s cubic-bezier(.2,.7,.3,1); }
.gauge-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-v { font-family: var(--mono); font-size: 42px; font-weight: 700; color: var(--ink-900); letter-spacing: -.04em; line-height: 1; }
.gauge-l { font-family: var(--mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-400); margin-top: 6px; }
.gauge-d { font-family: var(--mono); font-size: 11px; color: var(--ok); margin-top: 4px; font-weight: 600; }

/* ---------------- PROGRESS BAR ---------------- */
.bar { height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line-2); }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--brand); box-shadow: var(--brand-glow); transform-origin: left; }
.bar.ok > i { background: var(--ok); }
.bar.warn > i { background: var(--warn); }

/* ---------------- METRIC (health) ---------------- */
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rad); box-shadow: var(--sh-1); padding: 18px 20px; display: flex; flex-direction: column; gap: 9px; }
.m-top { display: flex; align-items: center; gap: 8px; }
.m-label { font-size: 12px; font-weight: 600; color: var(--ink-500); white-space: nowrap; }
.m-val { font-family: var(--mono); font-size: 28px; font-weight: 700; color: var(--ink-900); letter-spacing: -.03em; line-height: 1; }
.m-val .u { font-size: 12px; color: var(--ink-400); margin-left: 3px; }
.m-note { font-size: 11.5px; color: var(--ink-400); }
.m-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.m-dot.ok { background: var(--ok); } .m-dot.soft { background: var(--brand-soft); } .m-dot.warn { background: var(--warn); } .m-dot.brand { background: var(--brand); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 26px; margin-top: 2px; }
.spark i { flex: 1; background: var(--brand-wash-2); border-radius: 2px; min-height: 3px; }
.spark i.hi { background: var(--brand); }

/* ---------------- GRID HELPERS ---------------- */
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.row { display: flex; gap: 18px; }
.subhead { font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-400); margin-bottom: 12px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* status legend chips */
.legend { display: flex; flex-wrap: wrap; gap: 8px; }
.lchip { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-500); padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.lchip i { width: 7px; height: 7px; border-radius: 50%; }

/* state chip (page head) */
.state-chip { display: inline-flex; align-items: center; gap: 9px; padding: 9px 15px; border: 1px solid var(--brand-line); border-radius: 999px; background: var(--brand-wash); font-size: 13px; font-weight: 700; color: var(--ink-900); white-space: nowrap; flex: 0 0 auto; }

/* book spine month item */
.book-m { font-size: 13px; color: var(--ink-500); padding: 7px 12px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s; }
.book-m:hover { background: var(--brand-wash); color: var(--ink-700); }
.book-m.on { background: var(--brand-wash-2); color: var(--brand); font-weight: 700; }
.book-prose { display: flex; flex-direction: column; gap: 14px; }
.book-prose-section { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); padding: 18px 20px; box-shadow: 0 1px 0 rgba(15,23,38,.02); }
.book-prose-section.lead { background: linear-gradient(180deg, var(--brand-wash), transparent 70%), var(--surface-2); border-color: var(--brand-line); }
.book-prose-title { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--ink-400); text-transform: uppercase; margin-bottom: 12px; }
.book-prose-title span { display: inline-grid; place-items: center; width: 23px; height: 18px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); color: var(--brand); letter-spacing: 0; }
.book-lead { font-family: var(--serif); font-size: 18px; line-height: 1.9; color: var(--ink-900); margin: 0; padding-left: 16px; border-left: 2px solid var(--brand); text-wrap: pretty; white-space: pre-wrap; }
.book-p { font-family: var(--serif); font-size: 15.5px; line-height: 1.95; color: var(--ink-700); margin: 0; text-wrap: pretty; white-space: pre-wrap; }
.book-p + .book-p { margin-top: 11px; }

/* intake hub */
.intake-flow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.intake-flow-step { display: inline-flex; align-items: center; gap: 10px; min-height: 38px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; color: var(--ink-700); }
.intake-flow-step .mono { color: var(--brand); font-size: 10.5px; }
.intake-health-list { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.intake-health-row { display: grid; grid-template-columns: 160px 190px 170px minmax(0, 1fr); align-items: center; gap: 14px; min-height: 50px; padding: 12px 14px; border-top: 1px solid var(--line-2); color: var(--ink-600); font-size: 12px; }
.intake-health-row:first-child { border-top: 0; }
.intake-health-row > span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-500); }
.intake-health-row strong { color: var(--ink-850); font-size: 12.5px; }
.intake-health-row em { color: var(--ink-400); font-style: normal; }
.intake-health-row small { color: var(--ink-500); font-size: 11.5px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intake-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.intake-row { display: grid; grid-template-columns: 1.05fr 1.45fr .7fr .85fr 1fr .82fr; gap: 14px; align-items: center; padding: 13px 15px; border-top: 1px solid var(--line-2); background: var(--surface); }
.intake-row:first-child { border-top: none; }
.intake-row.head { background: var(--surface-2); color: var(--ink-400); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.intake-row > span { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-600, var(--ink-500)); line-height: 1.45; }
.intake-row > span:nth-child(3) { flex-direction: row; align-items: center; gap: 8px; }
.intake-row strong, .intake-row b { color: var(--ink-900); font-size: 13px; font-weight: 800; font-style: normal; }
.intake-row em { color: var(--ink-400); font-size: 10.5px; font-style: normal; line-height: 1.35; }
.phone-hero { margin-bottom: 18px; background: linear-gradient(180deg, var(--brand-wash), transparent 48%), var(--surface); }
.phone-hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); gap: 22px; align-items: start; }
.phone-hero h3 { margin: 4px 0 9px; color: var(--ink-900); font-size: 20px; line-height: 1.35; }
.phone-hero p { margin: 0; max-width: 760px; color: var(--ink-600, var(--ink-500)); font-size: 13px; line-height: 1.8; }
.phone-health-note { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.phone-health-note span { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-500); font-size: 11.5px; font-family: var(--mono); }
.phone-type-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.phone-type-pills span { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); }
.phone-type-pills b { color: var(--ink-700); font-size: 12px; font-weight: 750; }
.phone-type-pills em { font-family: var(--mono); font-style: normal; color: var(--brand); font-size: 11px; font-weight: 800; }
.phone-summary { margin-top: 18px; }
.phone-ops, .phone-decision-grid { margin-bottom: 18px; }
.phone-status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.phone-status-grid div { min-height: 70px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 13px 14px; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.phone-status-grid b { color: var(--ink-900); font-family: var(--mono); font-size: 20px; font-weight: 800; line-height: 1.1; }
.phone-status-grid em { color: var(--ink-400); font-size: 11px; font-style: normal; }
.phone-ops-note { margin: 14px 0 0; color: var(--ink-500); font-size: 12.3px; line-height: 1.75; }
.phone-interface-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.phone-interface-row { display: grid; grid-template-columns: 58px 1fr; gap: 13px; padding: 13px 14px; border-top: 1px solid var(--line-2); background: var(--surface); align-items: start; }
.phone-interface-row:first-child { border-top: none; }
.phone-interface-row strong { display: block; color: var(--ink-900); font-size: 13px; margin-bottom: 5px; }
.phone-interface-row code { display: inline-block; max-width: 100%; color: var(--brand); font-family: var(--mono); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-interface-row p { margin: 6px 0 0; color: var(--ink-500); font-size: 11.8px; line-height: 1.55; }
.phone-decision-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: 18px; align-items: start; }
.phone-clean-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.phone-clean-card { border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); padding: 15px 16px; min-height: 178px; }
.phone-clean-card h3 { margin: 12px 0 8px; color: var(--ink-900); font-size: 14px; line-height: 1.42; }
.phone-clean-card p { margin: 0 0 12px; color: var(--ink-500); font-size: 12px; line-height: 1.65; }
.phone-clean-card div { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.phone-clean-card b { color: var(--ink-700); font-size: 11.5px; white-space: nowrap; }
.phone-clean-card span { color: var(--brand); font-family: var(--mono); font-size: 10.5px; line-height: 1.45; }
.phone-clean-card em { color: var(--ink-400); font-size: 11px; font-style: normal; }
.phone-s1-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.phone-s1-row { display: grid; grid-template-columns: 88px 1fr; gap: 14px; padding: 13px 14px; border-top: 1px solid var(--line-2); background: var(--surface); }
.phone-s1-row:first-child { border-top: none; }
.phone-s1-row > span { color: var(--brand); font-weight: 800; font-size: 12.5px; }
.phone-s1-row strong { display: block; color: var(--ink-900); font-size: 12.5px; line-height: 1.45; }
.phone-s1-row p { margin: 5px 0 0; color: var(--ink-500); font-size: 12px; line-height: 1.6; }
.phone-handoff { margin-top: 18px; border-top: 1px solid var(--line-2); padding-top: 14px; }
.phone-handoff p { margin: 8px 0; color: var(--ink-500); font-size: 12px; line-height: 1.65; }
.phone-groups { display: grid; grid-template-columns: 1fr; gap: 18px; }
.phone-group-desc { margin: -4px 0 14px; color: var(--ink-400); font-size: 12.5px; line-height: 1.65; }
.phone-metric-table { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.phone-metric-row { display: grid; grid-template-columns: .9fr 1.05fr .75fr 1.2fr; gap: 14px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line-2); background: var(--surface); }
.phone-metric-row:first-child { border-top: none; }
.phone-metric-row.head { background: var(--surface-2); color: var(--ink-400); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.phone-metric-row > span { min-width: 0; display: flex; flex-direction: column; gap: 4px; color: var(--ink-500); font-size: 12.2px; line-height: 1.45; }
.phone-metric-row .phone-no { color: var(--brand); font-size: 10.5px; font-family: var(--mono); font-weight: 800; }
.phone-metric-row strong { color: var(--ink-900); font-size: 13px; font-weight: 800; }
.phone-metric-row b { color: var(--ink-900); font-family: var(--mono); font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-metric-row em { color: var(--ink-400); font-size: 10.5px; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-row { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: start; padding: 12px 0; }
.api-sample { margin: 0; padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); color: var(--ink-700); font-family: var(--mono); font-size: 11px; line-height: 1.65; white-space: pre-wrap; overflow: auto; }
.write-row { display: grid; grid-template-columns: 34px 1fr; gap: 13px; padding: 14px 0; align-items: start; }
.write-row strong { font-size: 14px; color: var(--ink-900); }
.write-row p { margin: 7px 0 4px; font-size: 12.5px; color: var(--ink-600, var(--ink-500)); line-height: 1.55; }
.write-row em { font-size: 11.5px; color: var(--ink-400); font-style: normal; }
.llm-lane { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); padding: 17px 18px; }
.llm-lane h3 { margin: 12px 0 8px; font-size: 14.5px; color: var(--ink-900); line-height: 1.45; }
.llm-lane p { margin: 0 0 6px; font-size: 12.5px; color: var(--ink-500); }
.llm-lane em { font-size: 11.5px; color: var(--ink-400); font-style: normal; }
.llm-status-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.llm-status-strip > div { padding: 14px 16px; border-left: 1px solid var(--line-2); min-width: 0; }
.llm-status-strip > div:first-child { border-left: 0; }
.llm-status-strip span { display: block; font-size: 11px; color: var(--ink-400); margin-bottom: 7px; }
.llm-status-strip strong { display: block; font-size: 16px; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.llm-abc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.llm-clean-table { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.llm-clean-head,
.llm-clean-row { display: grid; grid-template-columns: 64px minmax(150px, .8fr) 150px minmax(360px, 1.9fr) 190px; align-items: stretch; }
.llm-clean-head { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.llm-clean-head span { padding: 12px 14px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-400); font-weight: 800; border-left: 1px solid var(--line-2); }
.llm-clean-head span:first-child { border-left: 0; }
.llm-clean-row { min-height: 94px; border-top: 1px solid var(--line-2); }
.llm-clean-row:first-of-type { border-top: 0; }
.llm-clean-row > div { padding: 15px 14px; border-left: 1px solid var(--line-2); min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.llm-clean-row > div:first-child { border-left: 0; }
.llm-no { font-family: var(--mono); color: var(--brand); font-weight: 900; font-size: 15px; align-items: center; }
.llm-clean-row strong { color: var(--ink-900); font-size: 13.5px; line-height: 1.45; }
.llm-clean-row > div > span { color: var(--ink-400); font-size: 11.5px; margin-top: 6px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.llm-frequency { color: var(--ink-700); font-size: 12.5px; line-height: 1.55; }
.llm-summary { color: var(--ink-700); font-size: 13px; line-height: 1.7; }
.llm-summary p { margin: 0; }
.llm-mini-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.llm-mini-facts span { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2); color: var(--ink-400); font-size: 11px; line-height: 1; }
.llm-summary ul { margin: 8px 0 0; padding-left: 16px; color: var(--ink-500); font-size: 12px; line-height: 1.55; }
.llm-summary li { margin: 2px 0; }
.llm-time strong { font-size: 12.5px; color: var(--ink-800); word-break: break-all; }
.llm-time > span { color: var(--ink-400); font-size: 11.5px; margin-top: 8px; }
.llm-clean-empty { padding: 22px; display: flex; gap: 12px; align-items: center; color: var(--ink-500); }
.llm-clean-empty strong { color: var(--ink-900); }
.chengmo-tabs { margin-top: -6px; margin-bottom: 18px; }
.route-page { display: grid; gap: 18px; }
.route-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.route-title { font-size: 24px; font-weight: 900; color: var(--ink-900); letter-spacing: 0; line-height: 1.18; }
.route-sub { margin-top: 8px; max-width: 760px; color: var(--ink-500); font-size: 13px; line-height: 1.7; }
.route-updated { flex: 0 0 auto; min-width: 210px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); padding: 15px 16px; }
.route-updated span { display: block; color: var(--ink-400); font-size: 11.5px; margin-bottom: 7px; }
.route-updated strong { display: block; color: var(--ink-900); font-size: 13px; font-family: var(--mono); font-weight: 800; }
.route-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.route-rule-card { border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); padding: 15px; min-width: 0; }
.route-rule-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.route-rule-head strong { color: var(--ink-900); font-size: 14px; font-weight: 900; }
.route-rule-head > span:last-child { margin-left: auto; color: var(--ink-400); font-size: 11.5px; font-family: var(--mono); }
.route-rule-card p { margin: 0 0 12px; color: var(--ink-500); font-size: 12px; line-height: 1.55; }
.route-chip-wrap { display: flex; flex-wrap: wrap; gap: 7px; max-height: 132px; overflow: auto; padding-right: 2px; scrollbar-color: var(--line) transparent; }
.route-chip { display: inline-flex; align-items: center; max-width: 100%; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink-700); padding: 5px 8px; font-size: 11.5px; line-height: 1.2; word-break: break-all; }
.route-empty { color: var(--ink-400); font-size: 12px; }
.route-dist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.route-dist-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); padding: 14px; min-width: 0; }
.route-dist-card > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.route-dist-card strong { display: block; margin: 12px 0 9px; color: var(--ink-900); font-size: 28px; line-height: 1; font-family: var(--mono); }
.route-dist-bar { height: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); overflow: hidden; }
.route-dist-bar i { display: block; height: 100%; min-width: 3px; border-radius: 999px; background: var(--brand); box-shadow: var(--brand-glow); }
.route-log-table { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: var(--surface); }
.route-log-row { display: grid; grid-template-columns: 158px minmax(280px, 1fr) 108px 150px 170px; gap: 12px; align-items: center; padding: 13px 15px; border-top: 1px solid var(--line-2); color: var(--ink-500); font-size: 12px; min-width: 0; }
.route-log-row:first-child { border-top: none; }
.route-log-head { background: var(--surface-2); color: var(--ink-400); font-weight: 850; }
.route-log-row strong { color: var(--ink-800); font-size: 12.5px; line-height: 1.5; font-weight: 750; min-width: 0; overflow-wrap: anywhere; }
.route-log-row span { min-width: 0; overflow-wrap: anywhere; }
.route-empty-row { padding: 24px; text-align: center; color: var(--ink-400); font-size: 12.5px; }
@media (max-width: 720px) {
  .route-hero { flex-direction: column; align-items: stretch; }
  .route-title { font-size: 22px; }
  .route-sub { max-width: none; }
  .route-updated { min-width: 0; width: auto; }
  .route-rule-grid,
  .route-dist { grid-template-columns: 1fr; }
  .route-chip-wrap { max-height: 160px; }
  .route-log-table { overflow-x: auto; }
  .route-log-row { grid-template-columns: 120px minmax(220px, 1fr) 90px 120px 130px; min-width: 720px; }
}
.llm-s3-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 18px; }
.llm-s3-grid h3 { margin: 0 0 12px; color: var(--ink-900); font-size: 14px; }
.llm-aggregate-line,
.llm-api-line { border-top: 1px solid var(--line-2); padding: 12px 0; display: flex; gap: 12px; align-items: flex-start; }
.llm-aggregate-line:first-of-type,
.llm-api-line:first-of-type { border-top: 0; padding-top: 0; }
.llm-aggregate-line span,
.llm-api-line span { display: block; color: var(--ink-500); font-size: 12px; line-height: 1.55; margin-top: 4px; }
.llm-api-line strong { display: block; color: var(--ink-900); font-size: 12.5px; line-height: 1.45; word-break: break-all; }
.llm-history-list { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.llm-history-row { display: grid; grid-template-columns: 78px minmax(150px, .8fr) 110px minmax(360px, 1.8fr) 190px; gap: 0; border-top: 1px solid var(--line-2); min-height: 82px; }
.llm-history-row:first-child { border-top: 0; }
.llm-history-row > div,
.llm-history-row > p { margin: 0; padding: 14px 15px; border-left: 1px solid var(--line-2); min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.llm-history-row > div:first-child { border-left: 0; }
.llm-history-no { font-family: var(--mono); color: var(--brand); font-weight: 900; font-size: 13px; letter-spacing: .08em; }
.llm-history-row strong { color: var(--ink-900); font-size: 13px; line-height: 1.45; }
.llm-history-row span { color: var(--ink-400); font-size: 11.5px; margin-top: 5px; }
.llm-history-row p { color: var(--ink-600); font-size: 12.5px; line-height: 1.65; }
.llm-history-time strong { color: var(--ink-800); font-size: 12px; word-break: break-all; }
.llm-history-time span { color: var(--ink-400); font-size: 11.5px; margin-top: 7px; }

/* goals · four-block practical board */
:root { --goal-todo-grid: 32px minmax(260px, 1fr) 78px 126px 86px 70px; }
.goal-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.goal-task-row { display: grid; grid-template-columns: var(--goal-todo-grid); gap: 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line-2); min-width: 0; }
.goal-task-row:first-child { border-top: 0; }
.goal-task-row.done strong { color: var(--ink-400); text-decoration: line-through; }
.goal-task-row strong { display: block; color: var(--ink-900); font-size: 13.5px; line-height: 1.45; }
.goal-task-row p { margin: 5px 0 0; color: var(--ink-400); font-size: 11.5px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-task-row .tag { white-space: nowrap; }
.ck-action { appearance: none; border: 1px solid var(--line); background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ck-action:disabled { cursor: not-allowed; opacity: .55; }
.goal-row-actions { display: inline-flex; align-items: center; gap: 7px; justify-self: end; }
.mini-icon-btn { appearance: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-400); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: .16s ease; }
.mini-icon-btn svg { width: 13px; height: 13px; }
.mini-icon-btn:hover { color: var(--ink-800); border-color: var(--brand-soft); background: var(--brand-wash); }
.mini-icon-btn.danger:hover { color: var(--danger); border-color: rgba(239,68,68,.42); background: rgba(239,68,68,.09); }
.mini-icon-btn:disabled { cursor: not-allowed; opacity: .45; }
.goal-write-btn { margin-left: auto; appearance: none; border: 1px solid var(--brand-soft); color: var(--brand); background: var(--brand-wash); border-radius: 10px; padding: 7px 11px; font-size: 12px; font-weight: 800; cursor: pointer; }
.goal-write-btn:disabled { cursor: not-allowed; opacity: .55; }
.goal-due { color: var(--ink-500); font-size: 11.5px; text-align: right; }
.goal-c-head { flex-wrap: wrap; }
.goal-tabs { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin-left: 10px; }
.goal-tabs button { appearance: none; border: 0; border-radius: 9px; background: transparent; color: var(--ink-500); padding: 7px 11px; font-size: 12px; font-weight: 850; cursor: pointer; transition: .16s ease; }
.goal-tabs button:hover { color: var(--ink-900); background: var(--surface); }
.goal-tabs button.on { color: var(--brand); background: var(--brand-wash); box-shadow: inset 0 0 0 1px var(--brand-soft); }
.goal-master-strip { display: grid; grid-template-columns: 1.15fr 1.2fr 1.35fr .75fr; gap: 12px; align-items: center; margin: 12px 0 8px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 13px; background: color-mix(in srgb, var(--surface-2) 82%, transparent); color: var(--ink-500); font-size: 11.5px; }
.goal-master-strip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-master-strip b { margin-right: 7px; color: var(--brand); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.goal-inline-add { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) 110px auto; gap: 9px; align-items: start; margin: 16px 0 14px; }
.goal-inline-add .goal-textarea { grid-column: 1 / 4; min-height: 42px; }
.goal-inline-add .goal-write-btn { height: 42px; align-self: stretch; }
.goal-input,
.goal-textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--ink-800); padding: 10px 12px; font: inherit; font-size: 12.5px; line-height: 1.45; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.goal-textarea { resize: vertical; }
.goal-input::placeholder,
.goal-textarea::placeholder { color: var(--ink-300); }
.goal-input:focus,
.goal-textarea:focus { outline: none; border-color: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-wash); background: var(--surface); }
.goal-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: var(--ink-700); font-size: 12px; }
.goal-list-head strong { color: var(--ink-800); font-size: 12.5px; }
.goal-list-head span { color: var(--ink-400); font-size: 11.5px; font-weight: 750; }
.goal-list-head.goal-list-columns { display: grid; grid-template-columns: var(--goal-todo-grid); gap: 12px; align-items: center; padding: 0 16px; margin: 12px 0 8px; }
.goal-list-head.goal-list-columns span,
.goal-list-head.goal-list-columns strong { font-family: var(--mono); font-size: 11px; font-weight: 850; letter-spacing: .12em; color: var(--ink-400); text-transform: uppercase; }
.goal-list-head.goal-list-columns span:last-child { justify-self: end; }

.chengmo-source-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.chengmo-source-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 12px; align-items: start; padding: 13px 14px; border-top: 1px solid var(--line-2); }
.chengmo-source-row:first-child { border-top: 0; }
.chengmo-source-row strong { display: block; color: var(--ink-900); font-size: 13px; margin-bottom: 5px; }
.chengmo-source-row code { display: inline-block; max-width: 100%; color: var(--brand); font-family: var(--mono); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chengmo-source-row p { margin: 7px 0 0; color: var(--ink-500); font-size: 11.5px; line-height: 1.55; }
.goal-task-main { min-width: 0; }
.goal-task-row.editing { grid-template-columns: 32px minmax(0, 1fr); align-items: start; }
.goal-edit-fields { display: grid; gap: 9px; min-width: 0; }
.goal-edit-meta { display: grid; grid-template-columns: minmax(140px, 1fr) 110px auto auto; gap: 8px; align-items: center; }
.goal-small-btn { appearance: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-600); border-radius: 10px; padding: 9px 12px; font-size: 12px; font-weight: 850; cursor: pointer; }
.goal-small-btn.primary { border-color: var(--brand-soft); background: var(--brand-wash); color: var(--brand); }
.goal-small-btn.danger { border-color: rgba(239,68,68,.42); background: rgba(239,68,68,.09); color: var(--danger); }
.goal-small-btn.compact { padding: 7px 10px; min-height: 30px; white-space: nowrap; }
.goal-small-btn:disabled { opacity: .55; cursor: not-allowed; }
.goal-todo-board { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .9fr); gap: 14px; align-items: start; }
.goal-todo-panel { min-width: 0; display: grid; gap: 9px; }
.goal-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; color: var(--ink-700); font-size: 12px; font-weight: 850; }
.goal-panel-title span { color: var(--ink-400); font-size: 11.5px; font-weight: 750; }
.completed-list { background: color-mix(in srgb, var(--surface) 82%, var(--ok) 8%); }
.completed-list .goal-task-row { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
.completed-list .goal-task-row .tag,
.completed-list .goal-task-row .goal-status-select,
.completed-list .goal-task-row .goal-due,
.completed-list .goal-task-row .goal-row-actions { grid-column: 2; justify-self: start; text-align: left; }
.completed-list .goal-task-row p { white-space: normal; }
.goal-status-select { appearance: none; border: 1px solid var(--line); background-color: var(--surface-2); color: var(--ink-700); border-radius: 10px; padding: 7px 26px 7px 10px; font-size: 12px; font-weight: 800; cursor: pointer; min-width: 92px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-400) 50%), linear-gradient(135deg, var(--ink-400) 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.goal-status-select:disabled { cursor: not-allowed; opacity: .5; }
.goal-status-select:focus { outline: none; border-color: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-wash); }
.goal-horizontal-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; align-items: stretch; }
.goal-horizontal-list .habit-line,
.goal-horizontal-list .goal-progress-row { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); padding: 14px; min-width: 0; }
.cm-note { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink-500); font-size: 12.5px; line-height: 1.65; }
.cm-note b { color: var(--ink-800); }
.habit-line { display: flex; flex-direction: column; gap: 12px; align-items: stretch; padding: 14px 0; }
.habit-line strong { display: block; color: var(--ink-900); font-size: 13.5px; margin-bottom: 4px; }
.habit-line span { color: var(--ink-500); font-size: 12px; line-height: 1.45; }
.habit-line .habit-trigger { display: block; margin-top: 6px; color: var(--ink-400); font-size: 11.5px; }
.habit-line .habit-trigger b { color: var(--brand); font-weight: 800; }
.habit-line .bar { width: 100%; }
.habit-actions { display: flex; align-items: center; justify-content: flex-start; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.habit-actions .tag { flex: 0 0 auto; }
.goal-progress-row { padding: 14px 0; }
.goal-progress-row strong { color: var(--ink-900); font-size: 13.5px; line-height: 1.45; }
.goal-progress-row p { margin: 8px 0 0; color: var(--ink-500); font-size: 12px; line-height: 1.55; }
.goal-calendar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.goal-calendar-card { min-height: 112px; display: flex; flex-direction: column; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.goal-calendar-card .mono { color: var(--brand); font-size: 12px; font-weight: 800; }
.goal-calendar-card strong { color: var(--ink-900); font-size: 13px; line-height: 1.45; flex: 1; }
.goal-calendar-card p { margin: -4px 0 0; color: var(--ink-500); font-size: 12px; line-height: 1.45; }
.goal-calendar-card .tag { align-self: flex-start; }
.goal-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.calendar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.calendar-title-row { display: flex; align-items: center; gap: 11px; margin-top: 6px; }
.calendar-big-title { color: var(--ink-900); font-size: clamp(26px, 3vw, 42px); font-weight: 900; letter-spacing: 0; line-height: 1.05; }
.calendar-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.calendar-view-switch { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.calendar-view-switch button { width: 42px; height: 32px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-500); font-weight: 850; cursor: pointer; }
.calendar-view-switch button.on { background: var(--brand); color: #fff; box-shadow: 0 10px 24px rgba(88, 135, 255, .22); }
.calendar-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.calendar-shell { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.calendar-weekdays span { padding: 12px 10px; color: var(--ink-500); font-size: 12px; font-weight: 850; text-align: center; }
.calendar-month-grid,
.calendar-week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-day-cell { min-height: 126px; padding: 10px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; outline: none; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.calendar-week-grid .calendar-day-cell { min-height: 190px; }
.calendar-day-cell:nth-child(7n) { border-right: 0; }
.calendar-day-cell:nth-last-child(-n+7) { border-bottom: 0; }
.calendar-day-cell:hover,
.calendar-day-cell:focus { background: rgba(88, 135, 255, .08); }
.calendar-day-cell.muted { background: rgba(255,255,255,.02); opacity: .48; }
.calendar-day-cell.today .calendar-day-num { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 999px; background: var(--brand); color: #fff; }
.calendar-day-cell.selected { box-shadow: inset 0 0 0 2px var(--brand-soft); background: rgba(88, 135, 255, .09); }
.calendar-day-num { color: var(--ink-900); font-size: 18px; font-weight: 900; line-height: 1; }
.calendar-day-lunar { min-height: 14px; color: var(--ink-400); font-size: 10.5px; font-weight: 750; }
.calendar-day-items { display: grid; gap: 5px; min-width: 0; }
.calendar-pill { min-height: 24px; width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 5px; border: 1px solid transparent; border-radius: 999px; padding: 3px 7px; background: rgba(126, 87, 194, .18); color: var(--ink-800); cursor: pointer; text-align: left; min-width: 0; }
.calendar-pill span { font-size: 12px; line-height: 1; color: currentColor; opacity: .9; }
.calendar-pill b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 850; }
.calendar-pill em { color: var(--ink-500); font-size: 10.5px; font-style: normal; font-weight: 800; white-space: nowrap; }
.calendar-pill:hover { border-color: var(--brand-soft); transform: translateY(-1px); }
.calendar-pill.event { background: rgba(126, 87, 194, .18); color: #d8c8ff; }
.calendar-pill.holiday { background: rgba(202, 91, 226, .18); color: #e7c8f2; }
.calendar-pill.task { background: rgba(76, 174, 219, .18); color: #bce9fb; }
.calendar-pill.done { background: rgba(47, 203, 140, .14); color: #b9f2d9; text-decoration: line-through; text-decoration-thickness: 1px; }
.calendar-more { color: var(--ink-400); font-size: 11px; font-weight: 800; padding-left: 8px; }
.calendar-selected-strip { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-top: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.calendar-selected-strip b { display: block; color: var(--ink-900); font-size: 13px; margin-bottom: 3px; }
.calendar-selected-strip span { color: var(--ink-500); font-size: 12px; }
.calendar-selected-pills { width: min(680px, 70%); display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 6px; }
.calendar-day-panel { padding: 18px; min-height: 260px; }
.calendar-selected-title { color: var(--ink-900); font-size: 22px; font-weight: 900; margin-bottom: 14px; }
.calendar-selected-list { display: grid; gap: 8px; max-width: 760px; }
.calendar-year-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.calendar-year-grid button { min-height: 118px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 16px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; color: var(--ink-700); cursor: pointer; }
.calendar-year-grid button:nth-child(4n) { border-right: 0; }
.calendar-year-grid button:nth-last-child(-n+4) { border-bottom: 0; }
.calendar-year-grid button:hover,
.calendar-year-grid button.on { background: rgba(88, 135, 255, .1); }
.calendar-year-grid b { color: var(--ink-900); font-size: 18px; }
.calendar-year-grid span { color: var(--ink-500); font-size: 12px; font-weight: 800; }
.empty-line { padding: 18px; color: var(--ink-400); font-size: 12.5px; line-height: 1.6; }
.goal-modal-mask { align-items: start; overflow: auto; }
.goal-editor-modal { width: min(760px, 94vw); margin: 4vh auto; }
.goal-confirm-modal { width: min(520px, 92vw); margin: 10vh auto; }
.goal-confirm-text { margin: 0; color: var(--ink-700); font-size: 13.5px; line-height: 1.7; }
.goal-modal-body { display: grid; gap: 15px; }
.goal-modal-body label { display: grid; gap: 8px; min-width: 0; }
.goal-modal-body label > span { color: var(--ink-500); font-family: var(--mono); font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.goal-modal-grid { display: grid; gap: 12px; }
.goal-modal-grid.two { grid-template-columns: 1fr 1fr; }
.goal-modal-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.goal-status-select.wide { width: 100%; min-height: 42px; }
.goal-modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.goal-modal-actions .goal-small-btn { min-width: 96px; min-height: 40px; }

/* chengmo report trace */
.report-trace { padding: 14px 0; }
.report-trace-head { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 7px; }
.report-trace-head span { font-size: 13.5px; font-weight: 800; color: var(--ink-900); line-height: 1.35; }
.report-trace-head .tag { margin-left: auto; white-space: nowrap; }
.report-trace-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; color: var(--ink-400); font-family: var(--mono); font-size: 10.5px; }
.report-trace-summary { color: var(--ink-500); font-size: 12px; line-height: 1.6; }
.report-full { margin-top: 10px; padding: 12px 13px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); max-height: 220px; overflow: auto; scrollbar-color: var(--brand-line) var(--surface-2); scrollbar-width: thin; }
.report-full p { margin: 0 0 8px; color: var(--ink-700); font-size: 12.5px; line-height: 1.7; }
.report-full p:last-child { margin-bottom: 0; }
.report-full::-webkit-scrollbar { width: 8px; height: 8px; }
.report-full::-webkit-scrollbar-track { background: var(--surface-2); }
.report-full::-webkit-scrollbar-thumb { background: var(--brand-line); border-radius: 999px; }

/* sub-tabs (in-page section nav) */
.subtabs { display: flex; gap: 6px; margin-bottom: 22px; border-bottom: 1px solid var(--line); padding-bottom: 0; }
.subtab { font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--ink-500); background: none; border: none; padding: 0 4px 12px; margin-right: 14px; cursor: pointer; position: relative; transition: color .15s; }
.subtab:hover { color: var(--ink-700); }
.subtab.on { color: var(--brand); font-weight: 700; }
.subtab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; box-shadow: var(--brand-glow); }
.hgroup { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-400); margin: 4px 0 12px; display: flex; align-items: center; gap: 9px; }
.hgroup::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* 今日总览 · 数据看板 */
.today-status-line { margin-bottom: 18px; padding: 20px 24px; gap: 10px; }
.today-status-time { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; min-width: 0; color: var(--ink-400); font-size: 13px; }
.today-status-line .mono { color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.today-status-broadcast { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.today-status-broadcast b { color: var(--ink-900); font-size: 22px; line-height: 1.35; }
.today-status-broadcast span { color: var(--ink-700); font-size: 16px; line-height: 1.55; font-weight: 700; }
.today-status-line p { margin: 0; color: var(--ink-500); font-size: 13.5px; line-height: 1.65; max-width: 980px; text-wrap: pretty; }
.today-main-grid { display: grid; grid-template-columns: minmax(0, 1.34fr) minmax(390px, .66fr); gap: 18px; align-items: stretch; margin-bottom: 18px; }
.today-action-list, .today-review-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.today-action-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 13px; align-items: center; min-height: 72px; padding: 13px 16px; border-top: 1px solid var(--line-2); background: var(--surface); }
.today-action-row:first-child, .today-review-row:first-child { border-top: 0; }
.today-action-row b { display: block; color: var(--ink-900); font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-action-row p { margin: 4px 0 0; color: var(--ink-400); font-size: 12px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-review-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 13px; align-items: center; min-height: 61px; padding: 12px 14px; border-top: 1px solid var(--line-2); }
.today-review-row span:last-child { color: var(--ink-700); font-size: 13px; line-height: 1.55; min-width: 0; }
.today-empty { min-height: 96px; display: grid; place-items: center; color: var(--ink-400); font-size: 13px; border: 1px dashed var(--line); border-radius: 13px; background: var(--surface-2); }
.today-health-card { gap: 14px; }
.today-health-card { margin-bottom: 18px; }
.today-health-card .c-head { margin-bottom: 2px; }
.today-ecg-wrap { padding: 6px 0 0; }
.today-vitals-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.today-vital-mini { position: relative; min-height: 96px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.01)), var(--surface-2); padding: 14px 14px 13px; display: grid; grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 4px 10px; align-items: center; min-width: 0; overflow: hidden; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.today-vital-mini::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); opacity: .42; }
.today-vital-mini:hover { transform: translateY(-2px); border-color: var(--brand-line); background: linear-gradient(145deg, rgba(91,140,255,.09), rgba(255,255,255,.018)), var(--surface-2); }
.today-vital-icon { width: 32px; height: 32px; grid-row: 1 / span 3; border-radius: 11px; display: grid; place-items: center; color: var(--brand); background: var(--brand-wash); box-shadow: inset 0 0 0 1px var(--brand-line); }
.today-vital-icon svg { width: 17px; height: 17px; stroke-width: 2; }
.today-vital-mini b { color: var(--ink-900); font-family: var(--mono); font-size: 18px; font-weight: 850; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-vital-mini em { color: var(--ink-700); font-size: 12px; font-weight: 800; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-vital-mini small { color: var(--ink-400); font-size: 10.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-vital-mini.tone-ok::after { background: var(--ok); }
.today-vital-mini.tone-ok .today-vital-icon { color: var(--ok); background: var(--ok-wash); box-shadow: inset 0 0 0 1px rgba(67,217,163,.28); }
.today-vital-mini.tone-warn::after { background: var(--warn); }
.today-vital-mini.tone-warn .today-vital-icon { color: var(--warn); background: var(--warn-wash); box-shadow: inset 0 0 0 1px rgba(224,168,90,.3); }
.today-review-card { padding-top: 22px; }
.today-summary-card { gap: 16px; }
.today-summary-card .c-head { margin-bottom: 0; }
.today-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.today-summary-stat { min-height: 86px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); padding: 13px 14px; display: grid; grid-template-columns: 8px 1fr; gap: 4px 9px; align-items: center; min-width: 0; }
.today-summary-stat b { color: var(--ink-900); font-family: var(--mono); font-size: 20px; font-weight: 850; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-summary-stat em { grid-column: 2; color: var(--ink-700); font-style: normal; font-size: 12px; font-weight: 800; }
.today-summary-stat small { grid-column: 2; color: var(--ink-400); font-size: 11px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-summary-section { display: grid; gap: 10px; }
.today-summary-section .subhead { margin-bottom: 0; }
.today-summary-card .today-review-list { border-radius: 13px; }
.today-summary-card .today-review-row { min-height: 54px; grid-template-columns: 82px minmax(0, 1fr); padding: 10px 12px; }
.today-summary-card .today-review-row .tag { justify-content: center; }
.today-write-list { display: grid; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.today-write-row { display: grid; grid-template-columns: 48px 64px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 42px; padding: 9px 12px; border-top: 1px solid var(--line-2); }
.today-write-row:first-child { border-top: 0; }
.today-write-row span { color: var(--ink-400); font-size: 10.5px; }
.today-write-row b { color: var(--ink-700); font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-write-row em { color: var(--ink-400); font-size: 11px; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-book-preview { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 18px 22px; }
.today-book-preview h3 { margin: 2px 0 6px; color: var(--ink-900); font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1.25; }
.today-book-preview p { margin: 0; color: var(--ink-500); font-size: 13px; line-height: 1.65; text-wrap: pretty; }
.today-book-date { color: var(--ink-400); font-size: 10px; font-weight: 700; letter-spacing: .08em; }

/* ============================================================
   SKIN · 墨仪 DARK (deep graphite + glowing data) — token swap
   ============================================================ */
.app.dark {
  --brand: #5b8cff; --brand-press: #3f6ad6; --brand-soft: #9fb8ff;
  --brand-wash: rgba(91,140,255,.12); --brand-wash-2: rgba(91,140,255,.18);
  --brand-line: rgba(91,140,255,.36); --brand-glow: 0 6px 24px -6px rgba(91,140,255,.7);
  --bg: #0a0e16; --surface: #141c28; --surface-2: #0f1620; --rail: #0c121d;
  --mark-bg: rgba(91,140,255,.18); --mark-fg: #cfe0ff; --bar-bg: rgba(14,20,32,.62); --on-accent: #0a0e16;
  --ink-900: #eef2f8; --ink-700: #c7d0dc; --ink-500: #8e9bad; --ink-400: #5f6c7e; --ink-300: #3d4759;
  --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.05);
  --ok: #43d9a3; --ok-wash: rgba(67,217,163,.14);
  --warn: #e0a85a; --warn-wash: rgba(224,168,90,.15);
  --alert: #f06b50; --alert-wash: rgba(240,107,80,.14);
  --sh-1: 0 1px 2px rgba(0,0,0,.4), 0 12px 28px -20px rgba(0,0,0,.7);
  --sh-2: 0 2px 6px rgba(0,0,0,.5), 0 22px 46px -26px rgba(0,0,0,.85);
  background: radial-gradient(130% 80% at 88% -8%, rgba(91,140,255,.16), transparent 55%), var(--bg);
}
/* dark: dark text on filled-brand surfaces for contrast */
.app.dark .nav-item.on, .app.dark .nav-item.on .ni-ic svg { color: var(--on-accent); }
.app.dark .nav-item.on .ni-code { color: rgba(10,14,22,.55); }
.app.dark .btn.p, .app.dark .by .bm, .app.dark .me-av { color: var(--on-accent); }
.app.dark .brand-mark { box-shadow: 0 0 24px -3px rgba(91,140,255,.55); }
.app.dark .cmdbar { background: var(--bar-bg); }

/* ============ 今日总览 · 生气 / 律动 ============ */
/* 心电脉冲线 */
.ecg { width: 100%; height: 38px; display: block; overflow: visible; }
.ecg .ecg-base { fill: none; stroke: var(--line); stroke-width: 1.5; }
.ecg .ecg-sweep { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px var(--brand)); stroke-dasharray: 70 900; }
@media (prefers-reduced-motion: no-preference) { .ecg .ecg-sweep { animation: ecg-sweep 3.6s linear infinite; } }
@keyframes ecg-sweep { from { stroke-dashoffset: 70; } to { stroke-dashoffset: -900; } }

/* 今日节律 时间轴 */
.rhythm-wrap { position: relative; padding: 4px 6px 2px; }
.rhythm-track { position: relative; height: 4px; border-radius: 4px; background: var(--line); margin: 34px 4px 30px; }
.rhythm-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, var(--brand-soft), var(--brand)); box-shadow: var(--brand-glow); }
.rtick { position: absolute; top: 22px; transform: translateX(-50%); font-family: var(--mono); font-size: 10px; color: var(--ink-400); white-space: nowrap; }
.rtick::before { content: ""; position: absolute; top: -10px; left: 50%; width: 1px; height: 7px; background: var(--line); }
.rdot { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); cursor: pointer; transition: transform .16s, box-shadow .16s; z-index: 2; }
.rdot.upcoming { border-color: var(--ink-300); background: var(--surface-2); }
.rdot:hover { transform: translate(-50%, -50%) scale(1.4); box-shadow: 0 0 0 5px var(--brand-wash); z-index: 5; }
.rdot .rlab { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--mark-bg); color: var(--mark-fg); font-size: 11px; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .16s; box-shadow: 0 8px 24px -8px rgba(0,0,0,.5); max-width: 220px; }
.rdot .rlab .rt { font-family: var(--mono); font-size: 9.5px; opacity: .7; display: block; }
.rdot:hover .rlab { opacity: 1; }
.now-mark { position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 4; }
.now-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-wash); }
@media (prefers-reduced-motion: no-preference) { .now-dot { animation: now-breathe 2.6s ease-in-out infinite; } }
@keyframes now-breathe { 0%,100% { box-shadow: 0 0 0 4px var(--brand-wash); } 50% { box-shadow: 0 0 0 10px transparent; } }
.now-flag { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--brand); white-space: nowrap; }
/* 活数据 micro stat */
.tstat { display: flex; flex-direction: column; gap: 3px; }
.tstat .tv { font-family: var(--mono); font-size: 21px; font-weight: 700; color: var(--ink-900); letter-spacing: -.01em; line-height: 1; }
.tstat .tv .u { font-size: 12px; color: var(--ink-400); margin-left: 3px; font-weight: 500; }
.tstat .tl { font-size: 11px; color: var(--ink-400); }

/* 人格雷达 入场生长 */
@media (prefers-reduced-motion: no-preference) {
  .radar-poly { transform-origin: 80px 80px; animation: radar-grow .9s cubic-bezier(.22,1,.36,1) both; }
  .radar-dot { transform-origin: center; animation: radar-pop .4s ease-out both; }
}
@keyframes radar-grow { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes radar-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* 个人档案 dossier */
.dossier { padding: 0 !important; overflow: hidden; }
.dossier-band { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; padding: 12px 22px; border-bottom: 1px dashed var(--line); background: linear-gradient(100deg, var(--brand-wash), transparent 70%); }
.dossier-band .dt { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--brand); }
.dossier-band .dm { font-family: var(--mono); font-size: 10.5px; color: var(--ink-400); display: inline-flex; gap: 5px; }
.dossier-band .dm b { color: var(--ink-700); font-weight: 600; }
.dossier-body { display: flex; gap: 30px; padding: 26px; }
.dossier-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 34px; margin-top: 14px; }
.dfield { display: flex; align-items: baseline; gap: 8px; }
.dfield .k { font-size: 11.5px; color: var(--ink-400); white-space: nowrap; flex: 0 0 auto; }
.dfield .dots { flex: 1; border-bottom: 1px dotted var(--line); transform: translateY(-3px); min-width: 12px; }
.dfield .v { font-size: 13px; font-weight: 600; color: var(--ink-900); white-space: nowrap; flex: 0 0 auto; }
.stamp { position: absolute; top: 14px; right: 16px; font-family: var(--mono); font-size: 10px; font-weight: 800; letter-spacing: .12em; color: var(--ok); border: 1.5px solid var(--ok); border-radius: 7px; padding: 4px 9px; transform: rotate(-7deg); opacity: .82; }

/* 财务 facet */
.finance-page { display: grid; gap: 18px; }
.finance-hero { padding: 18px 20px 20px; }
.finance-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.finance-stat { border: 1px solid var(--line); border-radius: 14px; padding: 14px 15px; background: linear-gradient(145deg, var(--surface-2), rgba(88,133,255,.08)); min-width: 0; }
.finance-stat span { display: block; font-size: 11px; color: var(--ink-400); margin-bottom: 7px; }
.finance-stat strong { display: block; font-family: var(--mono); font-size: 19px; line-height: 1.1; color: var(--ink-900); overflow-wrap: anywhere; }
.finance-stat em { display: block; margin-top: 7px; font-style: normal; font-size: 11px; color: var(--ink-500); line-height: 1.45; }
.finance-table-card { padding: 0 !important; overflow: hidden; }
.finance-table-card .c-head { padding: 18px 20px 12px; }
.finance-table { border-top: 1px solid var(--line); }
.finance-head,
.finance-row { display: grid; grid-template-columns: minmax(220px, 1.45fr) 90px 76px 120px 130px minmax(140px, .9fr) minmax(150px, .95fr); gap: 12px; align-items: center; }
.finance-head { padding: 11px 20px; background: var(--surface-2); color: var(--ink-400); font-size: 10.5px; font-weight: 800; letter-spacing: .08em; }
.finance-row { padding: 15px 20px; border-top: 1px solid var(--line-2); color: var(--ink-700); font-size: 12.5px; }
.finance-row:first-of-type { border-top: 0; }
.finance-row strong { display: block; color: var(--ink-900); font-size: 13.5px; line-height: 1.35; }
.finance-row em { display: block; margin-top: 5px; font-style: normal; color: var(--ink-400); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-empty { padding: 22px 20px; display: flex; align-items: center; gap: 12px; color: var(--ink-500); }
.finance-empty strong { color: var(--ink-900); }

/* 资料馆 / 通用 弹窗 */
.bl-modal-mask { position: fixed; inset: 0; z-index: 9998; background: rgba(8,12,20,.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 40px; }
.app.dark .bl-modal-mask { background: rgba(2,5,10,.68); }
.bl-modal { width: min(930px, 94vw); max-height: 82vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.55); scrollbar-color: var(--brand-line) var(--surface-2); scrollbar-width: thin; }
.bl-modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--surface); }
.bl-modal-body { padding: 20px 24px 24px; }
.bl-modal-close { margin-left: auto; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-500); cursor: pointer; display: grid; place-items: center; font-size: 16px; transition: all .15s; }
.bl-modal-close:hover { color: var(--ink-900); border-color: var(--ink-400); }
.repo-doc-scroll { scrollbar-color: var(--brand-line) var(--surface-2); scrollbar-width: thin; }
.bl-modal::-webkit-scrollbar, .repo-doc-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.bl-modal::-webkit-scrollbar-track, .repo-doc-scroll::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 999px; }
.bl-modal::-webkit-scrollbar-thumb, .repo-doc-scroll::-webkit-scrollbar-thumb { background: var(--brand-line); border-radius: 999px; border: 2px solid var(--surface-2); }
.bl-modal::-webkit-scrollbar-thumb:hover, .repo-doc-scroll::-webkit-scrollbar-thumb:hover { background: var(--brand-soft); }
@media (prefers-reduced-motion: no-preference) {
  .bl-modal { animation: modal-in .24s cubic-bezier(.22,1,.36,1); }
}
@keyframes modal-in { from { transform: translateY(14px) scale(.98); } to { transform: none; } }

@media (max-width: 980px) {
  .today-main-grid { grid-template-columns: 1fr; }
  .today-vitals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-book-preview { grid-template-columns: 34px minmax(0, 1fr); }
  .today-book-preview .tag, .today-book-preview .btn { grid-column: 2; justify-self: start; }
  .phone-hero-grid { grid-template-columns: 1fr; }
  .phone-type-pills { justify-content: flex-start; }
  .phone-status-grid, .phone-clean-grid { grid-template-columns: 1fr 1fr; }
  .phone-decision-grid { grid-template-columns: 1fr; }
  .phone-metric-row { grid-template-columns: 1fr 1fr; align-items: start; }
  .phone-metric-row.head { display: none; }
  .phone-metric-row > span:nth-child(4) { grid-column: 1 / -1; }
  .llm-status-strip, .llm-abc-grid, .llm-s3-grid { grid-template-columns: 1fr; }
  .llm-status-strip > div { border-left: 0; border-top: 1px solid var(--line-2); }
  .llm-status-strip > div:first-child { border-top: 0; }
  .llm-clean-head { display: none; }
  .llm-clean-row, .llm-history-row { grid-template-columns: 1fr; }
  .llm-clean-row > div, .llm-history-row > div, .llm-history-row > p { border-left: 0; border-top: 1px solid var(--line-2); }
  .llm-clean-row > div:first-child, .llm-history-row > div:first-child { border-top: 0; }
  .goal-inline-add { grid-template-columns: 1fr; }
  .goal-inline-add .goal-textarea { grid-column: auto; }
  .goal-inline-add .goal-write-btn { width: 100%; }
  .goal-tabs { order: 5; width: 100%; margin-left: 0; }
  .goal-tabs button { flex: 1; }
  .goal-edit-meta { grid-template-columns: 1fr; }
  .goal-todo-board { grid-template-columns: 1fr; }
  .goal-modal-grid.two, .goal-modal-grid.three { grid-template-columns: 1fr; }
  .goal-editor-modal { margin: 0 auto; }
  .goal-calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-head { flex-direction: column; align-items: stretch; }
  .calendar-toolbar, .calendar-nav { justify-content: flex-start; }
  .calendar-shell { overflow-x: auto; scrollbar-color: var(--brand-line) var(--surface-2); scrollbar-width: thin; }
  .calendar-weekdays, .calendar-month-grid, .calendar-week-grid { min-width: 860px; }
  .calendar-selected-strip { flex-direction: column; }
  .calendar-selected-pills { width: 100%; grid-template-columns: 1fr; }
  .calendar-year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-year-grid button:nth-child(4n) { border-right: 1px solid var(--line); }
  .calendar-year-grid button:nth-child(2n) { border-right: 0; }
  .finance-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-table { overflow-x: auto; scrollbar-color: var(--brand-line) var(--surface-2); scrollbar-width: thin; }
  .finance-head, .finance-row { min-width: 980px; }
}

@media (max-width: 720px) {
  .today-status-line > div { flex-direction: column; gap: 5px; }
  .today-vitals-grid { grid-template-columns: 1fr; }
  .today-review-row { grid-template-columns: 1fr; align-items: start; }
  .today-book-preview { grid-template-columns: 1fr; }
  .today-book-preview .tag, .today-book-preview .btn { grid-column: auto; }
  .phone-summary.g-4 { grid-template-columns: 1fr 1fr; }
  .phone-status-grid, .phone-clean-grid { grid-template-columns: 1fr; }
  .phone-interface-row, .phone-s1-row { grid-template-columns: 1fr; }
  .phone-metric-row { grid-template-columns: 1fr; }
  .phone-metric-row > span:nth-child(4) { grid-column: auto; }
  .goal-task-row { grid-template-columns: 28px 1fr; align-items: start; }
  .goal-task-row .tag, .goal-status-select, .goal-due, .goal-row-actions { grid-column: 2; justify-self: start; text-align: left; }
  .goal-task-row p { white-space: normal; }
  .goal-calendar-grid { grid-template-columns: 1fr; }
  .calendar-view-switch { width: 100%; justify-content: space-between; }
  .calendar-view-switch button { flex: 1; }
  .calendar-nav .goal-write-btn { width: 100%; }
  .calendar-big-title { font-size: 28px; }
  .calendar-year-grid { grid-template-columns: 1fr; }
  .calendar-year-grid button { border-right: 0 !important; }
  .finance-summary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .rail { width: 100%; flex: 0 0 auto; padding: 12px 12px 10px; border-right: none; border-bottom: 1px solid var(--line); box-shadow: 0 10px 26px -22px rgba(15,23,38,.5); }
  .brand { padding: 0 2px 10px; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .brand-name { font-size: 15px; }
  .brand-tag, .me-chip, .nav-cap, .rail-foot { display: none; }
  .nav { flex-direction: row; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 auto; padding: 9px 11px; font-size: 13px; border: 1px solid var(--line); background: var(--surface); }
  .nav-item::before, .nav-item .ni-code { display: none; }
  .nav-item:hover { transform: none; }
  .nav-item .ni-ic, .nav-item .ni-ic svg { width: 16px; height: 16px; flex-basis: 16px; }
  .main { min-height: 0; }
  .cmdbar { height: 46px; flex-basis: 46px; padding: 0 14px; overflow-x: auto; scrollbar-width: none; }
  .cmdbar::-webkit-scrollbar { display: none; }
  .cmdbar .cb-date { display: none; }
  .cmdbar .cb-right { margin-left: 0; gap: 10px; }
  .content { padding: 18px 14px 24px; }
  .page { max-width: none; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-h1 { font-size: 23px; }
  .subtabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtab { flex: 0 0 auto; }
  .grid.g-2, .grid.g-3, .grid.g-4 { grid-template-columns: 1fr; }
  .card, .card.pad-lg { padding: 18px; }
  .c-head { align-items: flex-start; }
  .c-meta { margin-left: auto; text-align: right; }
  .intake-row { grid-template-columns: 1fr; align-items: start; }
  .intake-row.head { display: none; }
}

.memory-layer-card {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 10px;
  color: var(--ink-500);
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.memory-layer-card:hover,
.memory-layer-card.on {
  border-color: rgba(91, 132, 255, .72);
  background: linear-gradient(180deg, rgba(91,132,255,.12), var(--surface-2));
  transform: translateY(-1px);
}
.memory-layer-card strong {
  color: var(--ink-900);
  font-size: 24px;
  letter-spacing: 0;
}
.memory-layer-card span:last-child {
  font-size: 12.5px;
  line-height: 1.55;
}
.memory-form {
  display: grid;
  grid-template-columns: 120px 140px 110px minmax(180px, 1fr) minmax(160px, .8fr) minmax(160px, .8fr) auto;
  gap: 10px;
  align-items: stretch;
}
.memory-form select,
.memory-form input,
.memory-form textarea,
.memory-row select,
.memory-row textarea {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-800);
  border-radius: 11px;
  padding: 11px 12px;
  font: inherit;
  outline: none;
}
.memory-form textarea {
  min-height: 44px;
  resize: vertical;
}
.memory-list {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.memory-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 100px 100px 86px 110px 138px 112px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--line-2);
  position: relative;
}
.memory-row:first-child {
  border-top: 0;
}
.memory-head {
  min-height: 44px;
  color: var(--ink-400);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  background: rgba(255,255,255,.02);
}
.memory-row textarea {
  min-height: 48px;
  resize: vertical;
  line-height: 1.55;
}
.memory-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.memory-actions button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-600);
  border-radius: 9px;
  padding: 8px 10px;
  cursor: pointer;
}
.memory-actions button:hover {
  color: var(--ink-900);
  border-color: rgba(91,132,255,.55);
}
.memory-source {
  grid-column: 1 / -1;
  color: var(--ink-400);
  font-size: 12px;
  line-height: 1.55;
  padding-top: 2px;
}
.memory-op-content {
  min-width: 0;
  color: var(--ink-700);
  font-size: 12.5px;
  line-height: 1.6;
}
.memory-op-content > span,
.memory-op-diff span,
.memory-op-diff strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.memory-op-diff {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.memory-op-diff span {
  color: var(--ink-400);
}
.memory-op-diff b {
  color: var(--brand);
  font-family: var(--mono);
  font-size: 12px;
}
.memory-op-diff strong {
  color: var(--ink-900);
  font-weight: 700;
}
.memory-op-content em {
  display: block;
  margin-top: 5px;
  color: var(--ink-400);
  font-size: 11.5px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memory-images {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}
.memory-images a {
  display: block;
  width: 92px;
  height: 92px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}
.memory-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .18s ease, filter .18s ease;
}
.memory-images a:hover img {
  transform: scale(1.04);
  filter: brightness(1.06);
}
.memory-depth {
  display: block;
  margin-top: 4px;
  color: var(--brand);
  font-style: normal;
  font-size: 11px;
}
.memory-process-page {
  display: grid;
  gap: 18px;
}
.memory-process-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
}
.memory-process-hero p {
  margin: 0;
  max-width: 760px;
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.75;
}
.memory-process-stats {
  display: grid;
  grid-template-columns: repeat(3, 96px);
  gap: 10px;
}
.memory-process-stats div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 13px 12px;
  text-align: center;
}
.memory-process-stats span {
  display: block;
  color: var(--ink-400);
  font-size: 11.5px;
  margin-bottom: 7px;
}
.memory-process-stats strong {
  display: block;
  color: var(--ink-900);
  font-family: var(--mono);
  font-size: 26px;
  line-height: 1;
}
.memory-op-list {
  display: grid;
  gap: 12px;
}
.memory-op-row {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  padding: 15px;
  overflow: hidden;
}
.memory-op-merge {
  border-color: rgba(91,132,255,.34);
  background: linear-gradient(180deg, rgba(91,132,255,.08), var(--surface-2));
}
.memory-op-new {
  border-color: rgba(55,214,155,.28);
  background: linear-gradient(180deg, rgba(55,214,155,.07), var(--surface-2));
}
.memory-op-top {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  color: var(--ink-500);
  font-size: 12px;
  margin-bottom: 12px;
}
.memory-op-top .mono:nth-last-child(2) {
  margin-left: auto;
  color: var(--ink-400);
}
.memory-op-depth {
  border: 1px solid rgba(91,132,255,.35);
  background: rgba(91,132,255,.1);
  color: var(--brand);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 800;
}
.memory-diff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.memory-diff div,
.memory-new-content {
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
  padding: 12px 13px;
}
.memory-diff span,
.memory-new-content span {
  display: block;
  color: var(--ink-400);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.memory-diff p,
.memory-new-content p {
  margin: 0;
  color: var(--ink-800);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.memory-diff div:last-child p {
  color: var(--ink-900);
  font-weight: 650;
}

.enhance-page {
  display: grid;
  gap: 18px;
}
.enhance-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 24px;
  align-items: center;
}
.enhance-hero p {
  margin: 0;
  max-width: 760px;
  color: var(--ink-500);
  font-size: 13.5px;
  line-height: 1.75;
}
.enhance-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.enhance-stat-grid div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(91,132,255,.08), rgba(255,255,255,.02));
  padding: 14px 13px;
}
.enhance-stat-grid strong {
  display: block;
  color: var(--ink-900);
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0;
}
.enhance-stat-grid span {
  display: block;
  margin-top: 8px;
  color: var(--ink-400);
  font-size: 11.5px;
}
.enhance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr);
  gap: 18px;
}
.enhance-form {
  display: grid;
  gap: 12px;
}
.enhance-form label {
  display: grid;
  gap: 7px;
}
.enhance-form label span {
  color: var(--ink-400);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
}
.enhance-form textarea,
.enhance-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(4,10,20,.35);
  color: var(--ink-900);
  padding: 12px 13px;
  font: inherit;
  outline: none;
}
.enhance-form textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.55;
}
.enhance-form input {
  min-height: 42px;
}
.enhance-switch-row {
  display: grid;
  grid-template-columns: 150px 1fr 1fr;
  gap: 10px;
  align-items: end;
}
.pill-toggle {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-500);
  padding: 0 16px;
  font-weight: 850;
  cursor: pointer;
}
.pill-toggle.on {
  border-color: rgba(55,214,155,.42);
  background: rgba(55,214,155,.12);
  color: var(--ok);
}
.pill-toggle.wide {
  width: fit-content;
  border-radius: 13px;
}
.action-btn {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--ink-800);
  padding: 0 16px;
  font-weight: 850;
  cursor: pointer;
}
.action-btn:disabled,
.pill-toggle:disabled {
  opacity: .55;
  cursor: wait;
}
.action-btn.primary {
  border-color: rgba(91,132,255,.55);
  background: rgba(91,132,255,.14);
  color: var(--brand);
}
.enhance-preview {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
  padding: 15px;
}
.enhance-preview h3,
.enhance-push-row h3 {
  margin: 10px 0 8px;
  color: var(--ink-900);
  font-size: 16px;
  line-height: 1.35;
}
.enhance-preview p,
.enhance-push-row p {
  margin: 0;
  color: var(--ink-700);
  font-size: 13px;
  line-height: 1.75;
}
.enhance-preview small,
.enhance-reason {
  display: block;
  margin-top: 10px;
  color: var(--ink-500);
  font-size: 12.5px;
  line-height: 1.65;
}
.enhance-preview pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 12px 0 0;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(0,0,0,.16);
  color: var(--ink-700);
  padding: 12px;
  font-size: 12px;
  line-height: 1.65;
}
.enhance-feedback-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.enhance-feedback-bar span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-500);
  padding: 8px 12px;
  font-size: 12px;
}
.enhance-feedback-bar b {
  color: var(--ink-900);
}
.enhance-push-list {
  display: grid;
  gap: 12px;
}
.enhance-push-row {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
  padding: 15px;
}
.enhance-push-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.enhance-push-top .tag:last-child {
  margin-left: auto;
}

/* Travel footprint archive */
.travel-footprint {
  display: grid;
  gap: 18px;
}
.travel-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
  gap: 22px;
  align-items: stretch;
  background:
    radial-gradient(circle at 18% 0%, rgba(91,140,255,.20), transparent 34%),
    linear-gradient(135deg, rgba(91,140,255,.11), transparent 42%),
    var(--surface);
}
.travel-hero h2 {
  margin: 8px 0 10px;
  color: var(--ink-900);
  font-size: 28px;
  line-height: 1.16;
  letter-spacing: 0;
}
.travel-hero p {
  margin: 0;
  color: var(--ink-600);
  font-size: 14px;
  line-height: 1.8;
  max-width: 760px;
}
.travel-hero-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.travel-s1-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(6,11,18,.18);
  padding: 16px 18px;
}
.travel-s1-box > span {
  display: block;
  margin-bottom: 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}
.travel-s1-box p {
  margin: 8px 0 0;
  color: var(--ink-600);
  font-size: 12.5px;
  line-height: 1.65;
}
.travel-stats .metric {
  position: relative;
  overflow: hidden;
}
.travel-stats .metric::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), transparent);
  opacity: .65;
}
.travel-stat-note,
.travel-mini-note {
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.6;
}
.travel-light-map {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 70% 38%, rgba(91,140,255,.22), transparent 28%),
    radial-gradient(circle at 35% 62%, rgba(49,211,164,.14), transparent 24%),
    linear-gradient(135deg, rgba(91,140,255,.08), rgba(5,10,18,.18)),
    var(--surface-2);
}
.travel-map-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at center, #000 45%, transparent 78%);
}
.travel-map-shape {
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(91,140,255,.24);
  border-radius: 42% 58% 48% 52% / 52% 40% 60% 48%;
  background: linear-gradient(135deg, rgba(91,140,255,.10), rgba(49,211,164,.05));
  box-shadow: inset 0 0 45px rgba(91,140,255,.12);
}
.travel-light-map.china .travel-map-shape {
  inset: 26px 58px 30px 46px;
  border-radius: 48% 52% 45% 55% / 42% 36% 64% 58%;
  transform: rotate(-8deg);
}
.travel-map-label {
  position: absolute;
  left: 20px;
  top: 16px;
  color: var(--ink-400);
  font-size: 11px;
  letter-spacing: .12em;
  font-family: var(--mono);
}
.travel-map-dot {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-700);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.travel-map-dot i {
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 5px rgba(91,140,255,.16), 0 0 18px rgba(91,140,255,.68);
}
.travel-map-dot b {
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0,0,0,.55);
}
.travel-map-note {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--ink-400);
  font-size: 11px;
  font-family: var(--mono);
}
.travel-map-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(380px, .65fr);
  align-items: start;
}
.travel-rank-list {
  display: grid;
  gap: 1px;
  max-height: 520px;
  overflow: auto;
  padding-right: 3px;
}
.travel-rank-list::-webkit-scrollbar,
.travel-flight-table::-webkit-scrollbar {
  width: 8px;
}
.travel-rank-list::-webkit-scrollbar-thumb,
.travel-flight-table::-webkit-scrollbar-thumb {
  background: rgba(91,140,255,.36);
  border-radius: 999px;
}
.travel-rank-row {
  display: grid;
  grid-template-columns: minmax(84px, 1fr) auto minmax(150px, 1.1fr) 42px;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line-2);
}
.travel-rank-name {
  color: var(--ink-800);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.travel-x2-profile {
  margin-bottom: 16px;
}
.travel-x2-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.travel-x2-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(91, 140, 255, .12), rgba(35, 211, 165, .035)),
    var(--surface-2);
}
.travel-x2-item strong {
  display: block;
  color: var(--ink-900);
  font-size: 14px;
  margin-bottom: 8px;
}
.travel-x2-item span {
  display: block;
  color: var(--ink-500);
  font-size: 12.5px;
  line-height: 1.7;
}
.travel-country-timeline {
  margin-top: 18px;
}
.travel-country-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.travel-country-card {
  min-height: 154px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background:
    radial-gradient(circle at 15% 0%, rgba(91, 140, 255, .18), transparent 34%),
    var(--surface-2);
}
.travel-country-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.travel-country-top strong {
  color: var(--ink-900);
  font-size: 15px;
}
.travel-country-top span {
  color: var(--ink-400);
  font-family: var(--mono);
  font-size: 10.5px;
}
.travel-year-tags,
.travel-city-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.travel-year-tags {
  margin-bottom: 10px;
}
.travel-year-tags span {
  border: 1px solid var(--brand-line);
  color: var(--brand);
  background: var(--brand-wash);
  border-radius: 999px;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 10px;
}
.travel-city-line b {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--ink-700);
  font-size: 11.5px;
  font-weight: 650;
}
.travel-country-card p {
  margin: 11px 0 0;
  color: var(--ink-400);
  font-size: 12px;
  line-height: 1.65;
}
.travel-flight-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, .6fr);
  align-items: start;
}
.travel-year-strip {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.travel-year-strip button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-500);
  min-width: 86px;
  padding: 10px 12px;
  cursor: pointer;
}
.travel-year-strip button.active {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(91,140,255,.28);
}
.travel-year-strip strong,
.travel-year-strip span {
  display: block;
}
.travel-year-strip strong {
  font-size: 13px;
}
.travel-year-strip span {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
}
.travel-flight-table {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.travel-flight-head,
.travel-flight-row {
  display: grid;
  grid-template-columns: 118px 92px minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
}
.travel-flight-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--ink-400);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}
.travel-flight-row {
  border-top: 1px solid var(--line-2);
  color: var(--ink-700);
  font-size: 13px;
}
.travel-flight-row strong {
  color: var(--ink-900);
  font-family: var(--mono);
  font-size: 12.5px;
}
.travel-route-row,
.travel-visa-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line-2);
}
.travel-route-row strong {
  color: var(--ink-800);
  flex: 1;
}
.travel-route-row .tag {
  margin-left: auto;
}
.travel-pref-grid {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}
.travel-pref-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.travel-pref-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 14px;
}
.travel-pref-item strong,
.travel-visa-row strong,
.travel-phase-row strong {
  display: block;
  color: var(--ink-900);
  font-size: 14px;
  margin-bottom: 6px;
}
.travel-pref-item span,
.travel-visa-row span,
.travel-phase-row p {
  color: var(--ink-500);
  font-size: 12.5px;
  line-height: 1.65;
}
.travel-visa-row > div {
  min-width: 0;
  flex: 1;
}
.travel-phase-card {
  grid-column: 1 / -1;
}
.travel-phase-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line-2);
}
.travel-phase-row .mono {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .memory-form,
  .memory-row,
  .memory-head {
    grid-template-columns: 1fr;
  }
  .memory-actions {
    justify-content: flex-start;
  }
  .memory-process-hero,
  .memory-diff {
    grid-template-columns: 1fr;
  }
  .memory-process-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .enhance-hero,
  .enhance-grid,
  .enhance-switch-row {
    grid-template-columns: 1fr;
  }
  .enhance-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .travel-hero,
  .travel-map-grid,
  .travel-flight-grid,
  .travel-pref-grid,
  .travel-x2-grid,
  .travel-country-grid {
    grid-template-columns: 1fr;
  }
  .travel-pref-list {
    grid-template-columns: 1fr;
  }
  .travel-flight-head,
  .travel-flight-row {
    grid-template-columns: 92px 78px minmax(0, 1fr) minmax(0, 1fr);
  }
}
