/* Shared dark theme. Category colors belong to the digest, not navigation. */
:root{
  --bg:#101114;--panel:#1b1d22;--surface:#272a31;--ink:#f2f3f5;
  --muted:#adb1bc;--border:#343841;--accent:#246fcb;--accent-bg:#213249;
  --nav:#15161a;--on-nav:#f2f3f5;--blue:#8bbcff;--error:#ff8d87;
  --radius:18px;--tabbar-height:72px;--page-gutter:20px;
  --composer-bg:#202227;--control-border:#41454e;--control-ink:#c5cbd5;
}
body{background:var(--bg);letter-spacing:.005em}
button{line-height:1.35;transition:background-color .16s,color .16s,opacity .16s}
button:active{opacity:.78}
button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid var(--blue);outline-offset:3px}
h1{font-size:1.75rem;letter-spacing:-.03em;font-weight:650;line-height:1.3}
h2{font-size:1.05rem;line-height:1.5}
.page{width:100%;max-width:920px;padding:24px 36px 56px}
.hero{margin-bottom:24px;gap:16px;align-items:center}
.hero p{font-size:.82rem;line-height:1.6;color:var(--muted);margin-top:7px}
.primary,.secondary,.ghost,.danger{min-height:44px;font-weight:550}
.primary{background:var(--accent);color:#fff}
.secondary{background:var(--surface)}
.ghost{color:var(--blue)}
.icon{stroke-width:1.65}
.topbar{height:72px;background:transparent;padding:14px 36px}
.topbar-actions{display:flex;align-items:center;gap:12px;margin-left:auto}
.topbar-actions .square{color:var(--muted);background:var(--panel);border-radius:14px}
.connection{font-size:.72rem;white-space:nowrap}
.connection::before{content:'';display:inline-block;width:5px;height:5px;border-radius:50%;margin-right:6px;background:#8d919b;vertical-align:middle}
.connection.online::before{background:#7acda5}
.connection.offline::before{background:#f0b179}
.brand strong{letter-spacing:.01em;font-size:1rem;font-weight:650}
.brand small{font-size:.7rem;letter-spacing:0;color:var(--muted)}
.sidebar{padding:28px 18px;border-color:#292c32}
.desktop-nav .nav-link{border-radius:13px;min-height:48px}
.desktop-nav .nav-link.active{background:var(--accent-bg);color:#dcecff}
.desktop-nav .nav-link:hover{background:var(--surface)}
.desktop-nav .nav-link[data-page=settings]{margin-top:20px}
.sidebar-footer{font-size:.72rem;line-height:1.6}
.search-wrap{margin:0}
.search{border:1px solid #2d3038;border-radius:14px;min-height:46px;background:var(--panel);font-size:1rem}
.search::placeholder{color:#a0a5b1}
.compose-new{background:var(--surface);border-radius:14px;color:var(--blue);width:46px;height:46px}
.daily-card{background:linear-gradient(115deg,#23262d,#1b1d22);border-color:#373a43;border-radius:18px;padding:18px;margin:18px 0 25px}
.daily-card .daily-symbol{width:44px;height:44px;border:0;background:#332e24;color:#d9bf92;border-radius:13px}
.daily-card .row-title strong{font-size:.92rem;line-height:1.5}
.daily-card .badge{color:#d9bf92;background:#302b23;font-size:.7rem}
.daily-copy>.muted{font-size:.76rem;line-height:1.6}
.section-head{margin:24px 2px 12px}
.section-head h2{font-size:.82rem;font-weight:550}
.grouped,.notification-list{border:1px solid #292d35;border-radius:18px;overflow:hidden;background:var(--panel)}
.thread-row{min-height:84px;padding:16px;gap:12px;background:var(--panel)}
.thread-row:not(:last-child):after{left:66px;right:16px;background:#30343b}
.thread-icon{width:38px;height:38px;background:#292d34;border-radius:12px;color:#c0c7d3}
.row-title strong{font-size:.9rem;font-weight:550;line-height:1.45}
.row-title time{font-size:.72rem}
.row-meta{font-size:.73rem;line-height:1.5;margin-top:5px}
.project-card{background:var(--panel);border:1px solid #30343b;border-radius:18px;min-height:144px;padding:20px}
.project-card h2{font-size:1rem}.project-card p{font-size:.78rem}
.badge{font-size:.7rem;line-height:1.4;background:var(--surface);color:#c4c9d3}
.chat-header{background:var(--nav)!important;border-color:#2d3038;padding:10px 24px}
.chat-header small{font-size:.72rem;line-height:1.5}
.chat-title h1{font-size:1rem;line-height:1.4}
.messages{padding:24px}
.message{max-width:740px;margin-bottom:24px}
.message-label{font-size:.7rem;line-height:1.5;color:#a8adba;margin-bottom:7px;letter-spacing:0}
.message.user .message-label{display:none}
.message.user .bubble,.life-user-text{background:#263c57;color:#f2f5fa;border:1px solid #344961;border-radius:19px 19px 6px 19px;padding:12px 16px;line-height:1.65}
.message.assistant .bubble{line-height:1.78}
.message.assistant .bubble>p:first-child{margin-top:0}
.message.assistant .bubble>p:last-child{margin-bottom:0}
.message.commentary{padding:1px 0 1px 13px;border-left:2px solid #3a4658;color:#b1b8c4;font-size:.84rem}
.message.commentary .message-label{font-size:.68rem;color:#97a5ba}
.message-actions{display:flex;gap:6px;margin-top:5px}
.message-actions .square{width:44px;height:44px;min-height:44px;color:#a2aab8;padding:12px}
.message-actions .icon{width:18px;height:18px}
.message-actions .square:hover{background:var(--surface)}
.composer-wrap,.life-composer-wrap{background:var(--nav)!important;border-color:#2d3038}
.composer,.life-composer-wrap .life-composer{background:#22252b;border:1px solid #3b404a;border-radius:22px;padding:9px 10px}
.composer:focus-within,.life-composer:focus-within{border-color:#769dcc;box-shadow:none}
.composer textarea,.life-composer textarea{font-size:1rem;color:var(--ink)}
.composer textarea::placeholder,.life-composer textarea::placeholder{color:#a0a6b3}
.composer-tools .square,.life-composer .square{background:#2f343d;color:#cbd2dd;border-radius:50%}
.composer-actions #send:disabled,.life-composer #life-send:disabled{background:#30353e;color:#929aa8}
.chat-model-button{min-height:44px;font-size:.73rem;color:#b1b9c8;padding:7px 8px}
.composer-meta{min-height:44px}
.jump-bottom{background:#2b3039;border-color:#49515f;box-shadow:0 4px 15px #0004;color:#e7ecf4}
.life-page-header .life-tabs{background:#1d2026;border:1px solid #313640;padding:4px;border-radius:13px}
.life-tabs button{font-size:.8rem;min-height:44px}
.life-tabs button.active{background:#343b47;color:#f1f4f9;box-shadow:0 1px 3px #0003}
.life-entry-time{font-size:.7rem;color:#a0a6b2;margin:18px 0 12px}
.life-reply{font-size:.96rem;line-height:1.8}
.life-tags button{min-height:44px;border-radius:10px;background:#24312b;color:#b7d9c4;font-size:.72rem}
.entry-actions{margin-top:4px;justify-content:flex-start}
.entry-actions .square{color:#a0a7b5;width:44px;height:44px;padding:12px}
.entry-menu{display:grid;gap:10px;margin-top:20px}
.sync-hint{font-size:.71rem;line-height:1.6}
.manager-summary>div,.decision-card,.record-card,.report-card{border:1px solid #30343b}
.topic-chips button{min-height:44px;font-size:.76rem}
.read-all{font-size:.78rem;white-space:nowrap;padding:10px 4px}
.notification-row{padding:18px 20px!important;background:var(--panel)}
.notification-row.is-unread{background:#222831}
.notification-row strong{font-size:.9rem;line-height:1.5;font-weight:550}
.notification-row p{font-size:.8rem;line-height:1.7;margin:8px 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.notification-row small{font-size:.7rem;color:#a1a9b6}
.notification-row:last-child{border-bottom:0}
.setting-card{padding:22px;border-radius:18px;background:var(--panel);border:1px solid #30343b}
.setting-card p{font-size:.8rem;line-height:1.7}
.setting-row{font-size:.87rem;min-height:52px}
.daily-page{max-width:820px}
.daily-hero{margin-bottom:20px;padding-bottom:22px}
.daily-eyebrow{font-size:.68rem;letter-spacing:.17em;color:#b2a995}
.daily-title-row h1{font-size:1.65rem;line-height:1.35;letter-spacing:-.02em}
.daily-asof{font-size:.73rem;line-height:1.6}
.daily-lead{background:#20242b;border-color:#3a404b;padding:22px}
.daily-lead>p{font-size:1rem;line-height:1.8}
.daily-lead ol{font-size:.83rem;line-height:1.8}
.digest-categories{position:sticky;top:0;z-index:4;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;padding:12px 0;margin:10px 0 0;background:var(--bg)}
.digest-chip{min-width:0;padding:8px 5px;font-size:.78rem;border-radius:12px;border:1px solid #ffffff0a;min-height:44px}
.digest-section{scroll-margin-top:82px;margin-top:28px}
.digest-section>h2{font-size:1rem;line-height:1.6}
.digest-card{padding:21px;background:var(--panel);border-color:#303640}
.digest-card h3{font-size:1rem;line-height:1.6;font-weight:600}
.digest-card>p,.digest-relevance,.digest-action{font-size:.87rem;line-height:1.85}
.digest-card>p{color:#c1c7d1}
.digest-meta{font-size:.71rem;flex-wrap:wrap;line-height:1.5}
.digest-relevance>span,.digest-action>span{font-size:.73rem;color:#aab2c0}
.digest-sources a{min-height:44px;font-size:.73rem;display:inline-flex;align-items:center;line-height:1.6}
.daily-footer .secondary{min-height:48px}
.choice-card{border-color:#374454}
.choice-copy>span{font-size:.78rem;line-height:1.65}
.choice-caption{font-size:.71rem}
.attachment-note{font-size:.72rem;line-height:1.6}
.attachment-progress button{min-height:44px}
.gallery-toolbar button,.gallery-controls button,.gallery-controls a{min-height:44px}
#toast{bottom:calc(var(--tabbar-height) + 18px + env(safe-area-inset-bottom));background:#353b46;color:#f6f7fa;font-size:.82rem;box-shadow:0 5px 25px #0005;max-width:min(88vw,480px);line-height:1.6}
@media(max-width:800px){
  .page{padding:20px var(--page-gutter) calc(var(--tabbar-height) + 28px + env(safe-area-inset-bottom))}
  .topbar{height:calc(64px + env(safe-area-inset-top));padding:calc(10px + env(safe-area-inset-top)) var(--page-gutter) 10px}
  .topbar .brand-mark{width:32px;height:32px;border-radius:10px}
  .topbar .brand strong{font-size:.9rem}
  .topbar-actions{gap:10px}.topbar .connection{font-size:.7rem;max-width:105px;overflow:hidden;text-overflow:ellipsis}
  .topbar-actions .square{background:transparent;padding:10px}
  .hero h1{font-size:1.75rem}.hero p{font-size:.8rem}
  .daily-card{padding:17px 15px;gap:12px}
  .daily-copy>.muted{font-size:.74rem}
  .thread-row{padding:16px 14px;min-height:84px}
  .row-title strong{font-size:.89rem}.row-meta{font-size:.72rem}
  .mobile-nav{height:calc(var(--tabbar-height) + env(safe-area-inset-bottom));padding:6px 8px calc(6px + env(safe-area-inset-bottom));background:rgba(22,24,29,.96);border-color:#303640;align-items:stretch}
  .mobile-nav .nav-link{font-size:.65rem;gap:2px;color:#abb2bf;min-height:56px;padding:2px}
  .mobile-nav .nav-icon-wrap{width:44px;height:30px;border-radius:11px;display:grid;place-items:center}
  .mobile-nav .nav-link.active{background:transparent;color:#b8d7ff}
  .mobile-nav .nav-link.active .nav-icon-wrap{background:#253b57}
  .mobile-nav .icon{width:22px;height:22px}
  .nav-icon-wrap>.unread-dot{top:1px;right:5px}
  .chat-header{padding:10px 10px}.messages{padding:20px 18px}
  body.chat-screen .composer-wrap{padding:9px 12px max(4px,env(safe-area-inset-bottom))}
  .message{margin-bottom:23px}.message.user .bubble{max-width:92%}
  .life-screen .life-message-list{padding:10px 18px}
  .life-screen .life-page-header{padding-left:20px;padding-right:20px}
  .life-screen .life-composer-wrap{margin-bottom:calc(var(--tabbar-height) + env(safe-area-inset-bottom));padding:9px 12px 10px}
  .life-screen .life-page-header .hero h1{font-size:1.5rem}
  .daily-page{padding-top:20px}.daily-title-row h1{font-size:1.55rem}
  .digest-categories{top:env(safe-area-inset-top);margin-right:0;padding-right:0;gap:6px}
  .digest-card,.daily-lead{padding:18px}
  .digest-section{scroll-margin-top:calc(80px + env(safe-area-inset-top))}
  .project-grid{gap:12px}.project-card{padding:18px}
  dialog:not(.image-gallery){max-width:100%;width:100%;max-height:88dvh;margin:auto 0 0;border-radius:24px 24px 0 0;padding:22px 20px calc(20px + env(safe-area-inset-bottom));background:#202329;border-top:1px solid #454d5b}
}
@media(max-width:360px){:root{--page-gutter:16px}.topbar .connection{max-width:74px}.digest-chip{font-size:.73rem}.row-title time{display:block}.project-grid{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){button{transition:none}}

.settings-details{padding-top:12px;padding-bottom:12px}.settings-details>summary{min-height:44px;padding:12px 0;cursor:pointer;font-size:.93rem;font-weight:550}.settings-details[open]>summary{margin-bottom:6px}.settings-details>summary::marker{color:var(--muted)}
.connection-extra{border-top:1px solid var(--border);margin-top:18px;padding-top:18px;padding-bottom:10px}.connection-extra h3{font-size:.85rem}.connection-extra a{font-size:.76rem}

/* Shared message rhythm and quiet, reachable secondary actions. */
:root{color-scheme:dark}
.message.user .bubble,.life-user-text{background:#29323f;border-color:#364252;border-radius:20px 20px 6px 20px}
.message-actions{align-items:center;gap:8px;margin-top:4px;min-height:44px}
.message-actions.user-actions{justify-content:flex-end;margin-left:auto;margin-bottom:6px}
.message-actions .square{width:44px;min-width:44px;height:44px;min-height:44px;padding:12px;border-radius:12px;color:var(--muted)}
.message-actions .square[aria-pressed=true]{background:var(--accent-bg);color:var(--blue)}
.message.user{margin-bottom:16px}
.life-entry .life-reply{margin:14px 0 4px}
.life-user-text,.life-reply{font-size:1rem}
.life-reply pre{max-width:100%;overflow:auto;padding:16px;background:var(--panel);border:1px solid var(--border);border-radius:12px;font-size:.84rem}
.life-reply table{display:block;max-width:100%;overflow:auto;border-collapse:collapse;font-size:.85rem}
.life-reply td,.life-reply th{padding:8px;border:1px solid var(--border)}
.life-entry .life-reply>p:first-child{margin-top:0}
.life-entry .life-reply>p:last-child{margin-bottom:0}
.life-entry .life-tags:empty{display:none}
.life-message-list>*,.life-message-list #life-feed>.life-entry{max-width:740px;margin-left:auto;margin-right:auto}
.life-page:not(.life-talk-page) .life-page-header .hero>.square{display:none}
.chat-title h1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-header>.square{color:var(--control-ink)}
.choice-card{border-color:var(--border);padding:18px;border-radius:20px}
.choice-heading{margin-bottom:10px}
.choice-kicker{font-size:.73rem;font-weight:500;color:var(--muted)}
.choice-card legend{font-size:1rem;font-weight:550;line-height:1.65;margin-bottom:8px}
.choice-option{border-color:transparent;background:var(--surface);padding:14px;border-radius:14px}
.choice-option:has(:checked){background:var(--accent-bg);border-color:var(--blue)}
.choice-option:has(:checked) .choice-check:after{color:#15202d}
.choice-copy strong{font-weight:550}
.choice-error:empty{display:none}
.choice-card fieldset{margin-bottom:16px}
.choice-detail{margin-top:14px}
.life-page-header .hero h1{font-weight:600;letter-spacing:-.02em}
.messages,.life-message-list,.model-list{scrollbar-width:thin;scrollbar-color:var(--control-border) transparent}
.messages:focus-visible,.life-message-list:focus-visible{outline-offset:-3px}
@media(max-width:800px){
 body.chat-screen .chat-header{padding-top:calc(8px + env(safe-area-inset-top))!important}
 .life-screen .life-page-header{padding-top:calc(8px + env(safe-area-inset-top))}
 .life-screen .life-page-header .hero{margin-bottom:6px}
 .life-page-header .life-tabs{margin-bottom:8px}
 .message-label{font-size:.72rem}
 .life-entry-time{font-size:.72rem;margin:16px 0}
 .mobile-nav .nav-link{font-size:12px;font-weight:500}
 .mobile-nav .nav-link.active{color:var(--blue)}
 .mobile-nav .nav-link.active .nav-icon-wrap{background:transparent}
 .mobile-nav .nav-link.active .icon{stroke-width:2.1}
 .message-actions.user-actions{margin-top:2px}
 .choice-card{padding:16px}
}
