@import url('./tokens.css');
:root {
  --sidebar: #080808; --accent: #ededed; --accent-2: #dedede;
  --radius: 14px; --space: .5rem; --sidebar-width: 236px; --header-height: 96px;
  --text-small: .8rem; --text-body: .9rem; --text-title: clamp(1.3rem, 2vw, 1.8rem);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--text); font: var(--text-body)/1.6 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button { border: 0; background: transparent; }
a { color: inherit; text-underline-offset: 4px; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
input, select, textarea { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .6rem .75rem; min-width: 0; }
input[type=checkbox] { accent-color: var(--accent); width: 17px; height: 17px; padding: 0; flex-shrink: 0; cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--quiet); }
h1, h2, h3, h4 { line-height: 1.35; font-weight: 600; letter-spacing: -.025em; }
h2 { font-size: 1.2rem; } h3 { font-size: 1rem; } h4 { font-size: .95rem; }
svg { flex-shrink: 0; vertical-align: middle; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 400; background: var(--text); color: var(--bg); padding: .75rem; }
.skip-link:focus { top: 1rem; }
.app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; background: var(--sidebar); border-right: 1px solid #202020; padding: 1.5rem .85rem 1rem; display: flex; flex-direction: column; z-index: 50; }
.brand { display: flex; align-items: center; gap: .6rem; padding: 0 .6rem 2.5rem; font-size: 1.15rem; font-weight: 650; letter-spacing: -.04em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; color: var(--text); font-size: 1.9rem; line-height: 1; }
.brand .icon-button { margin-left: auto; }
.icon-button { min-width: 36px; min-height: 36px; border-radius: 8px; color: var(--muted); display: inline-grid; place-items: center; }
.icon-button:hover { color: var(--text); background: var(--hover); }
.nav { display: grid; gap: .35rem; }
.nav-divider { height: 1px; background: #242424; margin: .55rem .85rem; }
.nav-button { display: flex; align-items: center; gap: .8rem; width: 100%; border-radius: 8px; padding: .7rem .85rem; color: var(--muted); text-align: left; font-size: .86rem; white-space: nowrap; }
.nav-button svg { width: 19px; height: 19px; }
.nav-button:hover { background: var(--surface); color: var(--text); }
.nav-button.active { background: var(--surface-2); color: var(--text); }
.nav-caption { color: var(--quiet); text-transform: uppercase; letter-spacing: .12em; font-size: .65rem; padding: 0 .85rem 1rem; }
.connection { margin-top: auto; padding: 1rem .6rem 0; border-top: 1px solid #242424; font-size: .75rem; color: var(--muted); }
.connection strong { display: flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 500; color: var(--text); }
#lastSync, #accountIdentity { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: .35rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--quiet); flex-shrink: 0; }
.dot.connected { background: var(--green); }
.logout-button { display: flex; align-items: center; gap: .7rem; padding: .5rem 0; margin-top: .4rem; color: var(--muted); }
.logout-button:hover { color: var(--text); }
main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: var(--header-height); padding: 1.25rem clamp(1rem, 3vw, 3rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--bg); border-bottom: 1px solid #202020; }
.page-title { font-size: var(--text-title); font-weight: 550; }
.page-subtitle { color: var(--muted); font-size: var(--text-small); margin-top: .3rem; }
.top-actions { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.header-copy { min-width: 0; }
.sync-button, .action-button, .small-button, .danger-link, .primary-button, .connection-action { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .55rem .9rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: .8rem; font-weight: 500; line-height: 1.5; }
.sync-button:hover, .action-button:hover, .small-button:hover { background: var(--hover); }
.primary-button, .connection-action, .action-button.approve { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.primary-button:hover, .connection-action:hover, .action-button.approve:hover { background: #d3d3d3; }
.danger-link, .action-button.reject { color: var(--red); }
.avatar { border: 1px solid var(--border); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: .8rem; }
.content { max-width: 1540px; margin: auto; padding: 2rem clamp(1rem, 3vw, 3rem) 3rem; }
.view { display: none; } .view.active { display: block; }
.agent-brief { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.35rem 1.5rem; margin: 0 0 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.agent-brief h2, .processing-hero h2 { font-size: clamp(1.15rem, 2vw, 1.55rem); margin-top: .25rem; }
.agent-brief p, .processing-hero p { color: var(--muted); font-size: .8rem; margin-top: .4rem; max-width: 720px; }
.brief-kicker { color: var(--amber); font-size: .65rem; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
.brief-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.brief-chip, .signal { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: .2rem .55rem; color: var(--muted); font-size: .66rem; }
.brief-chip.danger, .signal.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: .25rem 0 2.5rem; }
.stat { display: flex; align-items: center; gap: 1rem; text-align: left; padding: .5rem 1.25rem .5rem 0; border-right: 1px solid var(--border); }
.stat:last-child { border: 0; }
.stat-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 50%; color: var(--muted); flex-shrink: 0; }
.stat-icon svg { width: 19px; height: 19px; }
.stat-value { display: block; font-size: 1.75rem; line-height: 1.2; letter-spacing: -.04em; font-weight: 550; }
.stat-label { display: block; font-size: .72rem; color: var(--muted); margin-top: .3rem; }
.stat:hover .stat-label { color: var(--text); }
.today-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 1.3rem; align-items: start; }
.stack { display: grid; gap: 1.3rem; min-width: 0; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 1.35rem; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.panel-title { font-size: .95rem; font-weight: 550; }
.link-button { font-size: .75rem; color: var(--muted); padding: .35rem 0; }
.link-button:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.list { display: grid; }
.row { display: grid; grid-template-columns: 85px minmax(0, 1fr) auto; gap: .75rem; align-items: center; text-align: left; width: 100%; padding: 1rem 0; border-bottom: 1px solid #292929; }
.row:last-child { border: 0; }
button.row:hover .row-title { text-decoration: underline; text-underline-offset: 3px; }
.row-time { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.row-title { font-size: .86rem; font-weight: 500; overflow-wrap: anywhere; }
.row-meta, .review-meta, .commitment-memory-meta, .todo-meta { font-size: .75rem; color: var(--muted); margin-top: .3rem; line-height: 1.6; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; font-size: .66rem; font-weight: 500; border: 1px solid var(--border); border-radius: 5px; padding: .15rem .4rem; color: var(--muted); white-space: nowrap; }
.pill.green { color: var(--green); } .pill.amber { color: var(--amber); } .pill.red, .overdue-label { color: var(--red); }
.timeline { position: relative; }
.timeline .row { grid-template-columns: 85px minmax(0,1fr) auto; min-height: 85px; }
.timeline .row-time { align-self: start; padding-top: .2rem; }
.timeline .row > :nth-child(2) { border-left: 2px solid #777; padding-left: 1rem; }
.timeline-empty { display: grid; grid-template-columns: 65px minmax(0,1fr); gap: 1rem; margin-top: 1.5rem; }
.time-markers { display: grid; gap: 1.5rem; color: var(--quiet); font-size: .7rem; font-variant-numeric: tabular-nums; }
.timeline-empty .empty { border-left: 1px solid var(--border); text-align: left; padding: .25rem 1rem; }
.attention { display: grid; }
.attention-card { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.attention-card:last-child { border: 0; }
.attention-label { font-size: .67rem; color: var(--amber); }
.attention-card.review .attention-label { color: var(--red); }
.attention-title { font-size: .9rem; font-weight: 500; margin: .35rem 0; }
.attention-text { font-size: .75rem; color: var(--muted); }
.attention-card .small-button { margin-top: .7rem; padding: .35rem .65rem; font-size: .72rem; }
.empty { padding: 1.8rem .7rem; text-align: center; color: var(--muted); font-size: .82rem; }
.section-intro { color: var(--muted); font-size: .82rem; margin: .25rem 0 1.5rem; }
.simple-page { min-height: 0; padding: 0; background: transparent; }
.toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.toolbar input[type=search] { flex: 1; min-width: min(100%, 180px); max-width: 350px; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: .3rem; }
.filter-tabs button { color: var(--muted); padding: .5rem .7rem; border-radius: 7px; font-size: .78rem; }
.filter-tabs button:hover { color: var(--text); background: var(--surface); }
.filter-tabs button[aria-pressed=true] { background: var(--surface-2); color: var(--text); }
.result-count { color: var(--quiet); font-size: .75rem; margin-bottom: .75rem; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(270px, 1fr); gap: 1.3rem; align-items: start; }
.calendar-controls { display: flex; align-items: center; gap: .5rem; }
.calendar-controls h2 { margin-right: auto; font-size: 1rem; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { color: var(--quiet); font-size: .7rem; text-align: center; margin-top: 1.4rem; }
.calendar-day { position: relative; aspect-ratio: 1.2; display: grid; place-items: center; border-radius: 9px; margin: .15rem; font-size: .8rem; }
.calendar-day:hover { background: var(--hover); }
.calendar-day.today { box-shadow: inset 0 0 0 1px #555; }
.calendar-day[aria-pressed=true] { background: var(--text); color: var(--bg); }
.calendar-day.has-events::before, .calendar-day.has-events::after { content: ''; display: none; position: absolute; bottom: 10%; width: 5px; height: 5px; border-radius: 50%; }
.calendar-day.has-nextcue::before { display: block; left: calc(50% - 6px); background: var(--amber); }
.calendar-day.has-google::after { display: block; left: calc(50% + 2px); background: #8ab4f8; }
.calendar-day.has-nextcue:not(.has-google)::before, .calendar-day.has-google:not(.has-nextcue)::after { left: 50%; transform: translateX(-50%); }
.calendar-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; margin-top: 1.3rem; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--quiet); font-size: .7rem; margin-top: 1rem; }
.calendar-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.legend-dot.google { background: #8ab4f8; }
.panel-copy { color: var(--quiet); font-size: .72rem; margin: .25rem 0 .65rem; }
.task-list { background: var(--surface); border-radius: var(--radius); padding: 0 1.2rem; }
.task-row { display: flex; align-items: center; gap: .85rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.task-row:last-child { border: 0; }
.task-open { text-align: left; flex: 1; min-width: 0; }
.task-open strong { display: block; font-weight: 500; font-size: .86rem; overflow-wrap: anywhere; }
.task-open:hover strong { text-decoration: underline; }
.task-completed strong { color: var(--muted); text-decoration: line-through; }
.task-board { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.2rem; }
.task-board .task-row { flex-wrap: wrap; }
.task-board h3 { display: flex; align-items: center; justify-content: space-between; }
.bulk-toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; border-block: 1px solid var(--border); padding: 1rem 0; margin: 1rem 0; }
.bulk-toolbar label, .review-select { display: inline-flex; gap: .5rem; align-items: center; font-size: .75rem; color: var(--muted); }
.bulk-toolbar label { margin-right: auto; }
.bulk-summary { flex-basis: 100%; color: var(--quiet); font-size: .7rem; }
.review-list { display: grid; margin-top: .75rem; }
.review-card { padding: 1rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.review-card.has-conflict { box-shadow: inset 3px 0 color-mix(in srgb, var(--red) 70%, transparent); }
.review-card.has-change:not(.has-conflict) { box-shadow: inset 3px 0 color-mix(in srgb, var(--amber) 70%, transparent); }
.review-card:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.review-card:last-child { border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.review-card:only-child { border-radius: var(--radius); }
.review-card.selected { box-shadow: inset 3px 0 var(--text); }
.review-card[aria-busy=true]::after { content: 'Applying your action…'; display: block; color: var(--muted); font-size: .75rem; padding-top: .5rem; }
.review-card { scroll-margin-top: calc(var(--header-height) + 1rem); }
.review-top { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.review-card h3 { font-size: .9rem; margin: .35rem 0; }
.review-meta { display: flex; gap: .75rem; flex-wrap: wrap; }
.review-expansion { margin-top: .6rem; }
.review-expansion > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--text); font-size: .75rem; padding: .7rem .8rem; margin-top: .75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); list-style: none; }
.review-expansion > summary::-webkit-details-marker { display: none; }
.review-expansion[open] > summary { border-color: #555; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; padding: 1.25rem 0 .5rem; }
.review-details, .source-panel { min-width: 0; }
.source-panel { padding-left: 1.2rem; border-left: 1px solid var(--border); }
.review-details h4, .source-panel h4, .memory-block h5 { color: var(--quiet); text-transform: uppercase; font-size: .65rem; letter-spacing: .08em; margin-bottom: .8rem; font-weight: 500; }
.field-list { display: grid; gap: .7rem; }
.field-line { display: grid; grid-template-columns: 90px minmax(0,1fr); gap: .7rem; font-size: .8rem; }
.field-line > :first-child { color: var(--muted); }
.field-line button { text-align: left; overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 4px; }
.field-line.field-missing > :last-child { color: var(--red); font-weight: 600; }
.review-signals { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 .5rem; }
.signal.change { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); }
.source-meta { font-size: .75rem; color: var(--muted); padding-bottom: .75rem; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.source-body { max-height: 520px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8rem; line-height: 1.75; padding: .85rem .75rem .85rem 0; scrollbar-gutter: stable; }
.source-body mark { background: #65542d; color: #fff5cf; border-radius: 3px; padding: .05em .15em; scroll-margin-block: 8rem; }
.source-visual { margin: 0 0 1rem; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #111; }
.source-visual img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.source-visual iframe { display: block; width: 100%; height: 420px; border: 0; background: white; }
.source-visual figcaption { padding: .55rem .7rem; color: var(--muted); font-size: .7rem; background: var(--surface-2); }
.source-evidence-heading { margin: .9rem 0 0; color: var(--quiet); text-transform: uppercase; font-size: .65rem; letter-spacing: .08em; font-weight: 500; }
.source-status-list { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .75rem; }
.source-status { padding: .22rem .5rem; border: 1px solid var(--border); border-radius: var(--radius-pill); color: var(--muted); background: var(--surface-2); font-size: .62rem; font-weight: 650; }
.source-status.success { color: var(--green); border-color: #426a56; background: var(--green-soft); }
.source-status.danger { color: var(--amber); border-color: #745b34; background: var(--amber-soft); }
.source-tabs { display: flex; gap: .35rem; max-width: 100%; margin-bottom: .8rem; padding-bottom: .25rem; overflow-x: auto; scrollbar-width: thin; }
.source-tabs button { flex: 0 0 auto; min-height: 34px; padding: .4rem .65rem; color: var(--muted); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: .7rem; }
.source-tabs button:hover { color: var(--primary); border-color: #526d96; background: var(--primary-soft); }
.source-tabs button:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.source-tabs button[aria-selected=true] { color: #091424; border-color: var(--primary); background: var(--primary); }
.source-tab-panel[hidden] { display: none; }
.source-visual-toolbar { display: flex; align-items: center; gap: .35rem; padding: .4rem .55rem; color: var(--muted); background: var(--surface-2); }
.source-visual-toolbar span { margin-right: auto; font-size: .67rem; font-weight: 700; }
.source-visual-toolbar button { min-width: 30px; min-height: 28px; padding: .2rem .45rem; color: var(--text); border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font-size: .7rem; }
.source-visual-toolbar button:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.source-visual-stage { max-height: 520px; overflow: auto; background: var(--surface-2); }
.source-visual-stage img { width: 100%; max-width: none; max-height: none; transition: width var(--motion-fast); }
.source-warning, .source-unavailable { margin: .65rem 0; padding: .7rem; color: var(--amber); border: 1px solid #745b34; border-radius: var(--radius-sm); background: var(--amber-soft); font-size: .72rem; line-height: 1.45; }
.source-support { margin: .4rem 0 0; color: var(--green); font-size: .68rem; font-weight: 650; }
.reminder-choice { margin-top: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.reminder-choice legend { padding: 0 .35rem; font-size: .76rem; font-weight: 600; }
.reminder-options { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: .45rem; }
.reminder-options label { position: relative; display: grid; min-height: 62px; cursor: pointer; }
.reminder-options input { position: absolute; opacity: 0; pointer-events: none; }
.reminder-options span { display: grid; place-items: center; text-align: center; padding: .55rem; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: .7rem; line-height: 1.35; }
.reminder-options input:checked + span { border-color: var(--text); background: var(--text); color: var(--bg); }
.reminder-options input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 3px; }
.reminder-options small { opacity: .75; }
.custom-reminder { display: grid; gap: .35rem; color: var(--muted); font-size: .72rem; margin-top: .7rem; max-width: 320px; }
.reminder-choice > p, .decision-notice { color: var(--quiet); font-size: .68rem; margin-top: .7rem; }
.decision-notice { padding-left: .7rem; border-left: 2px solid var(--border); }
.processing-hero { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(300px,1fr); gap: 1.5rem; align-items: end; padding: 1.4rem; margin-bottom: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(145deg, var(--surface-2), var(--surface)); }
.processing-flow { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem; }
.processing-flow span { padding: .55rem .65rem; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: .68rem; }
.processing-actions .section-intro { margin-bottom: 0; }
.processing-breakdown { display: grid; gap: .9rem; }
.issue-list, .conflict-list, .change-list { font-size: .78rem; margin-top: .9rem; border-left: 2px solid var(--red); padding: .5rem .8rem; color: var(--red); }
.missing-search, .web-evidence, .search-candidate { margin-top: .9rem; padding: .75rem; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.missing-search > strong, .web-evidence > strong, .search-candidate > strong { display: block; margin-bottom: .35rem; }
.web-evidence span { display: block; margin-bottom: .25rem; }
.missing-search a, .web-evidence a, .search-candidate a, .memory-line a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.conflict-list { color: var(--amber); border-color: var(--amber); }
.change-list { color: var(--text); border: 1px solid color-mix(in srgb, var(--amber) 38%, var(--border)); border-left: 3px solid var(--amber); border-radius: 9px; margin: 0 0 1rem; padding: .8rem; background: color-mix(in srgb, var(--amber) 5%, var(--surface-2)); }
.change-heading span, .change-heading strong { display: block; }
.change-heading span { color: var(--amber); font-size: .65rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.change-heading strong { font-size: .78rem; margin-top: .2rem; }
.change-comparison { display: grid; grid-template-columns: 82px minmax(0,1fr) auto minmax(0,1fr); gap: .55rem; align-items: center; margin-top: .65rem; }
.change-field { color: var(--muted); font-size: .7rem; }
.change-value { display: grid; gap: .15rem; padding: .55rem; border-radius: 7px; background: var(--surface); min-width: 0; }
.change-value small { color: var(--quiet); font-size: .58rem; letter-spacing: .08em; }
.change-value strong { overflow-wrap: anywhere; font-size: .75rem; }
.change-value.before strong { color: var(--muted); text-decoration: line-through; }
.change-value.after { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 45%, var(--border)); }
.change-arrow { color: var(--amber); }
.review-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.edit-form { display: none; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.edit-form.open { display: grid; }
.edit-form label { display: grid; gap: .25rem; font-size: .72rem; color: var(--muted); }
.edit-form input, .edit-form textarea, .edit-form select { width: 100%; }
.edit-form .wide { grid-column: 1 / -1; }
.edit-form .all-day-control { display: flex; align-items: center; gap: .5rem; }
.edit-form .all-day-control input { width: 17px; }
.edit-form .primary-button { justify-self: start; }
.inbox-heading { margin-top: 1.5rem; font-size: .75rem; font-weight: 500; color: var(--muted); }
.commitment-groups { display: grid; gap: 1.5rem; }
.commitment-group { background: var(--surface); padding: 1.2rem; border-radius: var(--radius); }
.commitment-group > h3 { color: var(--muted); font-size: .75rem; margin-bottom: .5rem; }
.commitment-memory { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.commitment-memory:last-child { border: 0; }
.commitment-memory-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.memory-details { margin-top: .8rem; }
.memory-details summary { font-size: .75rem; color: var(--muted); }
.memory-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; margin-top: 1rem; }
.memory-block { padding: .8rem; border-radius: 8px; background: var(--surface-2); min-width: 0; }
.memory-line { font-size: .75rem; color: var(--muted); overflow-wrap: anywhere; }
.chat-page { max-width: 820px; height: calc(100dvh - var(--header-height) - 4rem); min-height: 350px; margin: auto; display: flex; flex-direction: column; }
.chat-heading { padding: 1rem 0; }
.chat-heading h2 { font-size: 1.5rem; font-weight: 500; }
.chat-heading p { color: var(--muted); font-size: .8rem; margin-top: .4rem; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.chat-suggestion { border: 1px solid var(--border); border-radius: 8px; color: var(--muted); padding: .5rem .75rem; font-size: .75rem; }
.chat-suggestion:hover { background: var(--hover); color: var(--text); }
.chat-surface { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-log { flex: 1; min-height: 0; overflow: auto; padding: .5rem .5rem 1.5rem; scroll-behavior: smooth; }
.chat-empty { color: var(--quiet); text-align: center; padding: 2rem 1rem; font-size: .8rem; }
.message { max-width: 92%; width: fit-content; line-height: 1.8; font-size: .9rem; margin: 1.2rem 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.message.user { margin-left: auto; background: var(--surface-2); border-radius: 16px; padding: .65rem 1rem; }
.message.assistant { padding: .5rem 0; white-space: normal; }
.message.assistant p + p { margin-top: 1rem; }
.message.assistant ul { padding-left: 1.25rem; margin: .6rem 0; }
.message.assistant li + li { margin-top: .4rem; }
.message.error { color: var(--red); }
.chat-proposals { display: grid; gap: .65rem; margin-top: 1rem; min-width: min(520px, 78vw); }
.chat-proposal { display: grid; gap: .45rem; padding: .85rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.chat-proposal-title { display: block; margin: 0; font-size: .95rem; overflow-wrap: anywhere; }
.chat-proposal-meta { display: block; margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.chat-proposal-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .4rem; padding-top: .65rem; border-top: 1px solid var(--border); }
.chat-proposal-complete { color: var(--muted); font-size: .75rem; font-weight: 600; }
.chat-dock { padding-top: .5rem; }
body[data-view=chat] main { height: 100dvh; display: flex; flex-direction: column; }
body[data-view=chat] .topbar { flex-shrink: 0; }
body[data-view=chat] .content { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; margin: 0 auto; padding-bottom: 1rem; }
body[data-view=chat] #view-chat { flex: 1; min-height: 0; }
body[data-view=chat] .chat-page { height: 100%; min-height: 0; }
.chat-heading, .chat-dock, .sync-progress { flex-shrink: 0; }
body[data-view=chat] #toast { bottom: auto; top: calc(var(--header-height) + 1rem); }
.composer { padding: .6rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; }
.composer:focus-within { border-color: #666; }
.composer-row { display: flex; align-items: flex-end; gap: .6rem; }
.attach-button, .send-button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.attach-button { color: var(--muted); }
.attach-button:hover { background: var(--hover); }
.send-button { background: var(--text); color: var(--bg); }
.composer textarea { width: 100%; flex: 1; resize: none; border: 0; padding: .45rem .2rem; background: transparent; max-height: 120px; outline: none; line-height: 1.5; }
.composer-note { text-align: center; color: var(--quiet); font-size: .66rem; margin-top: .6rem; }
.attachment-chip { display: none; align-items: center; gap: .5rem; max-width: 100%; width: fit-content; font-size: .75rem; padding: .5rem; margin-bottom: .5rem; border: 1px solid var(--border); border-radius: 8px; }
.attachment-chip.show { display: flex; }
.attachment-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remove-attachment { min-width: 28px; min-height: 28px; }
.thinking { display: flex; gap: .3rem; align-items: center; }
.thinking-dot { background: var(--muted); width: 5px; height: 5px; border-radius: 50%; animation: pulse 1.2s infinite; }
.thinking-dot:nth-child(2) { animation-delay: .2s; } .thinking-dot:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 50% { opacity: .3; } }
.sync-progress { display: flex; gap: .8rem; align-items: center; border: 1px solid var(--border); border-radius: 9px; padding: .85rem 1rem; margin-bottom: 1.3rem; font-size: .8rem; background: var(--surface); }
.sync-progress-copy { flex: 1; min-width: 0; }
.sync-progress-copy strong, .sync-progress-copy span { display: block; }
.sync-progress-copy strong { font-weight: 500; }
.sync-progress-copy span, .sync-elapsed { color: var(--muted); font-size: .72rem; }
.sync-progress-spinner { width: 15px; height: 15px; border: 1px solid var(--border); border-top-color: var(--text); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.connection-pending { overflow: hidden; }
.connection-pending .app { visibility: hidden; }
.connection-gate { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; padding: 1.5rem; overflow: auto; }
.connection-card { width: min(100%, 470px); padding: 2rem 0; }
.connection-logo { display: flex; align-items: center; gap: .6rem; font-size: 1.2rem; font-weight: 600; margin-bottom: 2.5rem; }
.connection-card h1 { font-size: 1.8rem; font-weight: 500; }
.connection-card > p { color: var(--muted); font-size: .85rem; margin: .75rem 0 1.75rem; }
.service-checks { margin-bottom: 1.75rem; }
.service-check { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.service-check strong, .service-check span { display: block; }
.service-check strong { font-size: .85rem; font-weight: 500; }
.service-check span, .service-state { color: var(--muted); font-size: .73rem; }
.service-check.pass .service-state { color: var(--green); }
.service-check.fail .service-state { color: var(--red); }
.connection-error { display: none; color: var(--red); border-left: 2px solid var(--red); padding: .6rem .8rem; margin-bottom: 1rem; font-size: .8rem; }
.connection-error.show { display: block; }
.connection-privacy { margin-top: 1rem; font-size: .7rem; color: var(--quiet); }
.data-error { padding: .8rem 1rem; border: 1px solid var(--red); border-radius: 8px; margin-bottom: 1rem; color: var(--red); font-size: .8rem; }
.data-error button { text-decoration: underline; margin-left: .75rem; }
.settings-grid { max-width: 820px; display: grid; gap: 1.3rem; }
.settings-line { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.settings-line:last-child { border: 0; }
.settings-line p, .privacy-copy { color: var(--muted); font-size: .8rem; }
.privacy-copy p + p { margin-top: .8rem; }
dialog { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: auto; width: min(650px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 1.5rem; }
dialog::backdrop { background: #000a; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.dialog-head h2 { font-size: 1rem; }
#detailBody { margin-top: 1rem; }
#detailBody .memory-grid { grid-template-columns: 1fr; }
#toast { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 300; max-width: min(450px, calc(100vw - 3rem)); padding: .8rem 1rem; background: var(--surface-2); border: 1px solid #555; border-radius: 9px; opacity: 0; pointer-events: none; transform: translateY(5px); transition: opacity .15s, transform .15s; font-size: .8rem; }
#toast.show { opacity: 1; transform: none; } #toast.error { border-color: var(--red); }
.mobile-menu, .sidebar-backdrop { display: none; }
body.sidebar-collapsed { --sidebar-width: 76px; }
.sidebar-collapsed .brand { padding: 0 0 1.5rem; flex-direction: column; }
.sidebar-collapsed .brand .icon-button { margin: .5rem 0 0; }
.sidebar-collapsed .brand-name, .sidebar-collapsed .nav-button span, .sidebar-collapsed .nav-caption, .sidebar-collapsed #lastSync, .sidebar-collapsed #statusText { display: none; }
.sidebar-collapsed .nav-button { justify-content: center; padding: .8rem; }
.sidebar-collapsed .connection strong { justify-content: center; }
.sidebar-collapsed .logout-button { font-size: .65rem; }
.sidebar-collapsed #accountIdentity, .sidebar-collapsed .logout-button span:last-child { display: none; }
.sidebar-collapsed .logout-button { justify-content: center; width: 100%; font-size: 1rem; }
@media (max-width: 1120px) { .stats { gap: .75rem; } .stat { gap: .6rem; padding-right: .5rem; } .stat-icon { width: 34px; height: 34px; } .today-grid { grid-template-columns: minmax(0,1.2fr) minmax(260px,1fr); } .calendar-layout { grid-template-columns: 1fr; } }
@media (max-width: 850px) {
  :root { --header-height: 88px; }
  .app { grid-template-columns: 1fr; }
  .sidebar, .sidebar-collapsed .sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; transform: translateX(-100%); }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: #0009; }
  .sidebar-collapsed .brand { flex-direction: row; padding: 0 .6rem 2.5rem; }
  .sidebar-collapsed .brand .icon-button { margin: 0 0 0 auto; }
  .sidebar-collapsed .brand-name, .sidebar-collapsed .nav-button span, .sidebar-collapsed .nav-caption, .sidebar-collapsed #lastSync, .sidebar-collapsed #statusText { display: block; }
  .sidebar-collapsed .nav-button { justify-content: flex-start; }
  .sidebar-collapsed .connection strong { justify-content: flex-start; }
  .sidebar-collapsed #accountIdentity, .sidebar-collapsed .logout-button span:last-child { display: block; }
  .sidebar-collapsed .logout-button { width: auto; justify-content: flex-start; font-size: .75rem; }
  .mobile-menu { display: inline-grid; }
  .header-copy { margin-right: auto; }
  .topbar { gap: .6rem; }
  .top-actions { gap: .6rem; }
  .today-grid { grid-template-columns: 1fr; }
  .calendar-extra { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .source-panel { border-left: 0; border-top: 1px solid var(--border); padding: 1rem 0 0; }
  .processing-hero { grid-template-columns: 1fr; }
  .reminder-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .edit-form-grid { grid-template-columns: 1fr; }
  .agent-brief { align-items: flex-start; flex-direction: column; padding: 1.1rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.75rem; }
  .stat:nth-child(2) { border: 0; }
  .stat-value { font-size: 1.5rem; }
  .page-subtitle { font-size: .68rem; }
  .sync-button { padding: .55rem; }
  .sync-button:has(svg) span { display: none; }
  .top-actions { gap: .4rem; }
  .topbar { padding-inline: .75rem; }
  .panel { padding: 1rem; }
  .content { padding-top: 1.25rem; }
  .task-board, .memory-grid, .edit-form { grid-template-columns: 1fr; }
  .row, .timeline .row { grid-template-columns: 65px minmax(0,1fr); }
  .row > .pill { grid-column: 2; justify-self: start; }
  .chat-page { height: calc(100dvh - var(--header-height) - 2.5rem); }
  .chat-heading h2 { font-size: 1.2rem; }
  .chat-heading p { font-size: .75rem; }
  .chat-suggestions { gap: .35rem; }
  .chat-suggestion { font-size: .68rem; padding: .4rem .5rem; }
  .message { max-width: 96%; }
  .calendar-day { aspect-ratio: 1; }
  .task-row { gap: .6rem; } .task-row .pill { font-size: .6rem; }
  .processing-flow, .reminder-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .change-comparison { grid-template-columns: 1fr; }
  .change-field { font-weight: 600; }
  .change-arrow { transform: rotate(90deg); justify-self: center; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Pitch deck aligned dark interface ------------------------------------- */
:root {
  --sidebar: #101010;
  --accent: var(--primary);
  --accent-2: var(--primary-hover);
  --radius: var(--radius-lg);
  --sidebar-width: 248px;
  --header-height: 92px;
  --text-small: var(--text-sm);
  --text-body: var(--text-md);
  --text-title: var(--text-2xl);
}

html { background: var(--bg); }
body { min-width: 320px; background: var(--bg); color: var(--text); font-family: var(--font-ui); }
::selection { color: #091424; background: var(--primary); }
button, input, textarea, select { transition: border-color var(--motion-fast), background var(--motion-fast), color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast); }
button:not(:disabled):active { transform: translateY(1px); }
:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
input, select, textarea { background: var(--surface); border-color: var(--border-strong); }
input:hover, select:hover, textarea:hover { border-color: #777777; }

.skip-link { background: var(--text); color: var(--bg); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.app { background: var(--bg); }
.sidebar {
  background: linear-gradient(180deg, #101010 0%, #151515 100%);
  border-right-color: var(--border);
  padding: 1.25rem .85rem 1rem;
  box-shadow: 10px 0 32px rgba(0, 0, 0, .25);
}
.brand { color: var(--text); font-size: 1.18rem; padding-bottom: 2.1rem; }
.brand-mark { color: var(--primary); filter: drop-shadow(0 4px 8px rgba(23,105,255,.22)); }
.icon-button { color: var(--muted); border-radius: var(--radius-sm); }
.icon-button:hover { color: var(--primary); background: var(--primary-soft); }
.nav-caption { color: var(--quiet); font-weight: 700; }
.nav { gap: .3rem; }
.nav-divider { background: var(--border); }
.nav-button { min-height: 44px; color: var(--muted); font-weight: 560; border-radius: 10px; }
.nav-button:hover { color: var(--primary); background: var(--primary-soft); }
.nav-button.active { color: var(--text); background: linear-gradient(90deg, #1a3151, #18263c); box-shadow: inset 3px 0 var(--primary); }
.connection { border-top-color: var(--border); }
.connection strong { color: var(--text); }
.dot.connected { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }

.topbar {
  background: rgba(9,9,9,.9);
  border-bottom-color: var(--border);
  backdrop-filter: blur(14px);
  padding-block: 1rem;
}
.page-title { color: var(--text); font-weight: 720; letter-spacing: -.045em; }
.page-subtitle { color: var(--muted); }
.avatar { color: var(--primary); border-color: var(--border); background: var(--surface); font-weight: 700; }
.content { max-width: 1500px; padding-top: 1.75rem; }

.sync-button, .action-button, .small-button, .danger-link, .primary-button, .connection-action {
  min-height: 40px;
  border-color: var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  box-shadow: var(--shadow-sm);
}
.sync-button:hover, .action-button:hover, .small-button:hover { color: var(--primary); background: var(--primary-soft); border-color: #526d96; }
.primary-button, .connection-action, .action-button.approve { color: #091424; background: var(--primary); border-color: var(--primary); box-shadow: 0 8px 18px rgba(23,105,255,.18); }
.primary-button:hover, .connection-action:hover, .action-button.approve:hover { color: #091424; background: var(--primary-hover); border-color: var(--primary-hover); }
.danger-link, .action-button.reject { color: var(--red); }
.danger-link:hover, .action-button.reject:hover { background: var(--red-soft); border-color: #71424b; }

.agent-brief {
  position: relative;
  overflow: hidden;
  align-items: center;
  min-height: 178px;
  padding: clamp(1.5rem, 3vw, 2.3rem);
  border-color: #34465f;
  background: linear-gradient(115deg, #1b1b1b 5%, #16243a 66%, #1b2d48 100%);
  box-shadow: var(--shadow-md);
}
.agent-brief::after { content: ''; position: absolute; inset: auto -70px -105px auto; width: 260px; height: 260px; border: 36px solid rgba(23,105,255,.07); border-radius: 50%; pointer-events: none; }
.agent-brief > * { position: relative; z-index: 1; }
.agent-brief h2, .processing-hero h2 { color: var(--text); font-weight: 720; letter-spacing: -.035em; }
.agent-brief h2 { font-size: clamp(1.45rem, 2.5vw, 2rem); }
.agent-brief p, .processing-hero p { color: var(--muted); font-size: var(--text-sm); }
.brief-kicker { color: var(--primary); font-weight: 800; }
.brief-chip, .signal { color: var(--muted); background: rgba(255,255,255,.05); border-color: #3d5069; }
.brief-chip.danger, .signal.danger { color: var(--red); background: var(--red-soft); border-color: #75414b; }
.brief-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .65rem; }

.stats { grid-template-columns: repeat(4,minmax(0,1fr)); gap: .8rem; margin: 1.2rem 0 1.5rem; }
.stat { min-height: 92px; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.stat:last-child { border: 1px solid var(--border); }
.stat:hover { border-color: #52647d; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.stat-icon { color: var(--primary); border-color: #3d5577; background: var(--primary-soft); }
.stat-value { color: var(--text); font-weight: 720; }
.stat-label { color: var(--muted); }

.today-grid { grid-template-columns: minmax(0,1.45fr) minmax(310px,.8fr); gap: 1rem; }
.stack { gap: 1rem; }
.panel, .task-list, .commitment-group { border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel { padding: 1.35rem; }
.panel-title { color: var(--text); font-weight: 700; }
.panel-copy, .row-meta, .review-meta, .commitment-memory-meta, .todo-meta { color: var(--muted); }
.row, .task-row, .attention-card, .commitment-memory { border-color: var(--border); }
.row:hover, .task-row:hover { background: var(--hover); }
.timeline .row > :nth-child(2) { border-left-color: var(--primary); }
.attention-label { color: var(--amber); font-weight: 700; }
.attention-card.review .attention-label, .overdue-label { color: var(--red); }
.link-button { color: var(--primary); font-weight: 650; }
.link-button:hover { color: var(--primary-hover); }
.empty { color: var(--muted); }

.pill { border-radius: var(--radius-pill); color: var(--muted); background: var(--surface-2); border-color: var(--border); font-weight: 700; }
.pill.green { color: var(--green); background: var(--green-soft); border-color: #426a56; }
.pill.amber { color: var(--amber); background: var(--amber-soft); border-color: #765a32; }
.pill.red { color: var(--red); background: var(--red-soft); border-color: #75414b; }

.section-intro { color: var(--muted); font-size: var(--text-md); }
.toolbar input[type=search] { min-height: 42px; }
.filter-tabs { padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.filter-tabs button { min-height: 34px; color: var(--muted); }
.filter-tabs button:hover { color: var(--primary); background: var(--primary-soft); }
.filter-tabs button[aria-pressed=true] { color: #091424; background: var(--primary); box-shadow: 0 4px 10px rgba(23,105,255,.18); }
.result-count { color: var(--quiet); }

.calendar-controls h2 { color: var(--text); font-size: 1.15rem; }
.calendar-weekdays { color: var(--muted); font-weight: 700; }
.calendar-day { border: 1px solid transparent; }
.calendar-day:hover { color: var(--primary); background: var(--primary-soft); border-color: #3d5577; }
.calendar-day.today { color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); font-weight: 750; }
.calendar-day[aria-pressed=true] { color: #091424; background: var(--primary); box-shadow: 0 5px 14px rgba(23,105,255,.22); }
.calendar-day.has-google::after { background: var(--primary); }
.calendar-day.has-nextcue::before { background: var(--purple); }
.legend-dot { background: var(--purple); }
.legend-dot.google { background: var(--primary); }

.processing-hero { border-color: #34465f; background: linear-gradient(120deg,#1b1b1b,#182b45); box-shadow: var(--shadow-sm); }
.processing-flow span { position: relative; color: var(--muted); background: rgba(255,255,255,.04); border-color: #3d5069; font-weight: 650; }
.processing-flow span::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: .45rem; border-radius: 50%; background: var(--primary); }
.processing-overview { margin: 0 0 1.25rem; padding: 1.2rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); box-shadow: var(--shadow-sm); }
.processing-overview-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1rem; }
.processing-overview-head h2 { margin: .15rem 0 .25rem; color: var(--text); font-size: 1.25rem; letter-spacing: -.02em; }
.processing-overview-head p { max-width: 660px; margin: 0; color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }
.section-kicker { color: var(--primary); font-size: .65rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.processing-history-action { flex: 0 0 auto; min-height: 38px; padding: .55rem .75rem; border: 1px solid #71424b; border-radius: var(--radius-sm); background: var(--surface); }
.processing-history-action:hover { border-color: #98616c; background: var(--red-soft); }
.processing-breakdown { grid-template-columns: minmax(210px,.78fr) minmax(360px,1.45fr) minmax(260px,1fr); margin: 0; }
.metric-group { min-width: 0; padding: .9rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.metric-group-head { min-height: 49px; margin-bottom: .7rem; }
.metric-group-head h3 { margin: 0; color: var(--text); font-size: .82rem; font-weight: 750; }
.metric-group-head p { margin: .18rem 0 0; color: var(--quiet); font-size: .66rem; line-height: 1.35; }
.metric-grid { display: grid; grid-auto-rows: 1fr; gap: .55rem; }
.metric-group-overview .metric-grid { grid-template-columns: 1fr; }
.metric-group-outcomes .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.metric-group-extracted .metric-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.metric-card { position: relative; display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: .6rem; min-width: 0; min-height: 78px; margin: 0; padding: .7rem; color: var(--text); text-align: left; font: inherit; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); box-shadow: none; }
.metric-card.metric-zero { color: var(--muted); background: var(--surface-2); }
.metric-group-overview .metric-card { min-height: 78px; padding: .85rem; border-color: #3d5577; background: var(--surface-blue); }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; color: var(--muted); border-radius: 9px; background: #30343b; }
.metric-icon svg { width: 17px; height: 17px; }
.metric-group-overview .metric-icon { color: var(--primary); background: #253d60; }
.metric-copy { display: flex; min-width: 0; flex-direction: column; }
.metric-value { color: var(--text); font-size: 1.35rem; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.metric-group-overview .metric-value { color: #a5c7ff; font-size: 1.8rem; }
.metric-label { margin-top: .22rem; color: inherit; font-size: .72rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.metric-detail { margin-top: .16rem; color: var(--quiet); font-size: .62rem; line-height: 1.25; }
.metric-review { color: var(--amber); border-color: #745b34; background: var(--amber-soft); }
.metric-review .metric-icon { color: var(--amber); background: #513b1f; }
.metric-review .metric-value { color: var(--amber); }
.metric-muted .metric-icon { color: var(--muted); background: var(--surface-2); }
.metric-failure-active { color: var(--red); border-color: #75414b; background: var(--red-soft); }
.metric-failure-active .metric-icon { color: var(--red); background: #522830; }
.metric-failure-active .metric-value { color: var(--red); }
.metric-interactive { cursor: pointer; transition: border-color var(--motion-fast), background var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast); }
.metric-interactive:hover { border-color: #5c78a2; background: #253246; transform: translateY(-1px); }
.metric-interactive:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.metric-interactive.active, .metric-interactive[aria-pressed=true] { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.metric-review.metric-interactive:hover, .metric-review.metric-interactive.active { border-color: #b58c47; background: #46371f; box-shadow: inset 0 0 0 1px #b58c47; }
.metric-filter-cue { position: absolute; right: .45rem; top: .35rem; color: var(--primary); font-size: 1rem; font-weight: 750; line-height: 1; }
.bulk-toolbar { border-color: var(--border); background: var(--surface-2); border-radius: var(--radius-md); padding: 1rem; }
.review-list { gap: .8rem; }
.inbox-section { margin-top: 1.5rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); }
.inbox-section-head { margin-bottom: .8rem; }
.inbox-section-head .inbox-heading { margin: .2rem 0 .25rem; }
.inbox-section-head p { max-width: 720px; margin: 0; color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }
.recovery-section { border-color: #75414b; background: linear-gradient(135deg,var(--red-soft),var(--surface-2) 55%); }
.recovery-card { border-left: 3px solid var(--red); }
.recovery-message { margin: .8rem 0 0; padding: .75rem; color: var(--text); border-radius: var(--radius-sm); background: var(--surface-2); }
.attempt-count { flex: 0 0 auto; color: var(--quiet); font-size: var(--text-sm); font-weight: 650; }
.processed-card .quiet-action { color: var(--muted); }
.review-card { border: 1px solid var(--border); border-radius: var(--radius-md) !important; background: var(--surface); box-shadow: var(--shadow-sm); }
.review-card:hover { border-color: #52647d; }
.review-card.has-conflict { box-shadow: inset 3px 0 var(--red), var(--shadow-sm); }
.review-card.has-change:not(.has-conflict) { box-shadow: inset 3px 0 #d78b19, var(--shadow-sm); }
.review-card.selected { box-shadow: inset 3px 0 var(--primary), 0 0 0 2px rgba(23,105,255,.12); }
.review-expansion > summary { color: var(--text); background: var(--surface-2); border-color: var(--border); font-weight: 650; }
.review-expansion > summary { min-height: 44px; cursor: pointer; }
.review-expansion > summary:hover { color: var(--primary); background: var(--primary-soft); }
.review-expansion[open] > summary { color: var(--primary); border-color: #526d96; background: var(--primary-soft); }
.review-grid { grid-template-columns: minmax(340px,.9fr) minmax(420px,1.1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0; margin: 1rem 0; overflow: hidden; background: var(--surface-2); }
.review-details, .source-panel { padding: 1.25rem; }
.review-details { display: grid; align-content: start; gap: .45rem; }
.review-details .field-list { padding: .85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.review-details .issue-list, .review-details .conflict-list { border-radius: 0 8px 8px 0; background: var(--surface); }
.source-navigation { display: flex; align-items: start; gap: .45rem; }
.source-navigation .source-tabs { flex: 1; min-width: 0; }
.source-stepper { display: flex; gap: .2rem; flex: 0 0 auto; }
.source-stepper button { min-width: 34px; min-height: 34px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); background: var(--surface-2); }
.source-stepper button:focus-visible { outline: 2px solid var(--primary); }
.archive-pagination { display: flex; justify-content: center; align-items: center; gap: .8rem; margin-top: 1.25rem; color: var(--muted); font-size: .75rem; }
.archive-pagination button:disabled { opacity: .45; }
#view-rejected .panel-head { align-items: start; gap: 1rem; }
#view-rejected .review-list { display: grid; gap: .8rem; }
#view-rejected .review-actions { margin-top: .8rem; }
.brand-logo { width: 37px; height: 34px; object-fit: contain; flex: 0 0 auto; }
.topbar-logo { width: 31px; height: 30px; object-fit: contain; flex: 0 0 auto; }
.connection-logo .brand-logo { width: 46px; height: 42px; }
.chat-heading h2 { display: flex; align-items: center; gap: .55rem; }
.chat-brand-logo { width: 40px; height: 38px; object-fit: contain; flex: 0 0 auto; }
.source-panel { border-left-color: var(--border); background: var(--surface); }
.review-details h4, .source-panel h4, .memory-block h5 { color: var(--quiet); font-weight: 750; }
.commitment-edit-form { display: grid; gap: 1rem; }
.commitment-edit-form > label, .edit-form-grid > label { display: grid; gap: .4rem; color: var(--muted); font-size: var(--text-sm); font-weight: 650; }
.commitment-edit-form input, .commitment-edit-form textarea { width: 100%; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .7rem .8rem; font: inherit; }
.commitment-edit-form input:focus, .commitment-edit-form textarea:focus { outline: 0; border-color: var(--primary); box-shadow: var(--focus-ring); }
.edit-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.field-line { min-height: 36px; padding: .35rem 0; border-bottom: 1px solid var(--border); }
.field-line > :first-child { color: var(--muted); font-weight: 650; }
.field-line.field-missing > :last-child { color: var(--red); }
.source-meta { border-bottom-color: var(--border); }
.source-body { color: var(--text); background: var(--surface-2); }
.source-body mark { color: #d1e2ff; background: #294667; box-shadow: inset 0 -1px #6999dc; }
.source-visual { border-color: var(--border); background: var(--surface-2); }
.source-visual figcaption { color: var(--muted); background: var(--surface-2); }
.reminder-choice, .missing-search, .web-evidence, .search-candidate, .memory-block { background: var(--surface-2); border-color: var(--border); }
.reminder-options span { color: var(--muted); border-color: var(--border-strong); background: var(--surface); }
.reminder-options input:checked + span { color: #091424; background: var(--primary); border-color: var(--primary); }
.reminder-options input:focus-visible + span { outline-color: var(--primary); }
.decision-notice { color: var(--muted); border-left-color: #6a788b; }
.issue-list { color: var(--red); border-color: var(--red); background: var(--red-soft); border-radius: 0 8px 8px 0; }
.conflict-list { color: var(--amber); border-color: #a57935; background: var(--amber-soft); border-radius: 0 8px 8px 0; }
.change-list { color: var(--text); background: var(--amber-soft); border-color: #745b34; }
.change-value { background: var(--surface); }

.commitment-group > h3 { color: var(--muted); }
.memory-details summary { color: var(--primary); font-weight: 650; }

.chat-page { max-width: 920px; }
.chat-heading { padding-top: .75rem; }
.chat-heading h2 { color: var(--text); font-size: clamp(1.65rem,3vw,2.2rem); font-weight: 720; letter-spacing: -.04em; }
.chat-heading p { color: var(--muted); font-size: var(--text-md); }
.chat-suggestion { min-height: 38px; color: var(--muted); background: var(--surface); border-color: var(--border); border-radius: var(--radius-pill); }
.chat-suggestion:hover { color: var(--primary); background: var(--primary-soft); border-color: #526d96; }
.chat-empty { display: grid; place-items: center; align-content: center; gap: .4rem; min-height: 230px; color: var(--muted); padding: 3rem 1rem; }
.chat-empty::before { content: '✦'; display: grid; place-items: center; width: 48px; height: 48px; color: var(--primary); background: var(--primary-soft); border-radius: 14px; font-size: 1.5rem; }
.chat-empty strong { color: var(--text); font-size: 1rem; }
.chat-empty span { max-width: 430px; }
.message.user { color: #091424; background: var(--primary); border-radius: 16px 16px 4px 16px; box-shadow: 0 6px 14px rgba(23,105,255,.14); }
.message.assistant { color: var(--text); }
.message.error { color: var(--red); }
.chat-proposal { border-color: var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.composer { background: var(--surface); border-color: var(--border-strong); box-shadow: 0 12px 35px rgba(0,0,0,.35); }
.composer:focus-within { border-color: var(--primary); box-shadow: var(--focus-ring), 0 12px 35px rgba(0,0,0,.35); }
.send-button { color: #091424; background: var(--primary); }
.send-button:hover { background: var(--primary-hover); }
.attachment-chip { color: var(--text); background: var(--primary-soft); border-color: #3d5577; }

.sync-progress { background: var(--surface); border-color: #3d5577; box-shadow: var(--shadow-sm); }
.sync-progress-spinner { border-color: var(--border); border-top-color: var(--primary); }
.connection-gate { background: radial-gradient(circle at 50% 15%,#16243a,var(--bg) 48%); }
.connection-card { padding: 2rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); }
.connection-logo { color: var(--text); }
.service-check { border-bottom-color: var(--border); }
.connection-error, .data-error { color: var(--red); background: var(--red-soft); border-color: #75414b; }
.data-error { box-shadow: var(--shadow-sm); }
.settings-grid { max-width: 900px; }
.settings-line { border-bottom-color: var(--border); }
dialog { color: var(--text); background: var(--surface); border-color: var(--border); box-shadow: 0 30px 80px rgba(0,0,0,.55); }
dialog::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(3px); }
#toast { color: #fff; background: #263957; border-color: #263957; box-shadow: var(--shadow-md); }
#toast.error { background: #622832; border-color: #622832; }

@media (max-width: 1120px) {
  .review-grid { grid-template-columns: 1fr 1fr; }
  .processing-breakdown { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-group-overview { grid-column: 1 / -1; }
  .metric-group-overview .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-group-overview .metric-card { min-height: 98px; }
}
@media (max-width: 850px) {
  .sidebar, .sidebar-collapsed .sidebar { box-shadow: 24px 0 50px rgba(0,0,0,.55); }
  .sidebar-open .sidebar-backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(2px); }
  .today-grid, .calendar-layout { grid-template-columns: 1fr; }
  .calendar-extra { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .source-panel { border-left: 0; border-top: 1px solid var(--border); }
  .processing-hero { grid-template-columns: 1fr; }
  .processing-breakdown { grid-template-columns: 1fr; }
  .metric-group-overview { grid-column: auto; }
}
@media (max-width: 560px) {
  .source-navigation { align-items: stretch; }
  .source-stepper { align-items: start; }
  .review-grid, .review-details, .source-panel { min-width: 0; }
  :root { --header-height: 82px; }
  .content { padding-inline: .8rem; }
  .page-title { font-size: 1.38rem; }
  .agent-brief { min-height: 0; }
  .brief-actions { width: 100%; justify-content: stretch; }
  .brief-actions > * { flex: 1; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
  .stat { min-height: 82px; padding: .8rem; }
  .stat-icon { display: none; }
  .processing-overview { padding: .9rem; }
  .processing-overview-head { align-items: flex-start; flex-direction: column; gap: .8rem; }
  .processing-history-action { align-self: flex-start; }
  .metric-group { padding: .75rem; }
  .metric-group-head { min-height: 0; }
  .metric-group-extracted .metric-grid, .metric-group-outcomes .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-card, .metric-group-overview .metric-card { min-height: 82px; padding: .65rem; }
  .metric-group-overview .metric-value { font-size: 1.55rem; }
  .filter-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
  .filter-tabs button { white-space: nowrap; }
  .review-card { padding: .9rem; }
  .review-top { flex-direction: column; }
  .review-select { align-self: flex-end; }
  .review-details, .source-panel { padding: 1rem; }
  .chat-heading { padding-inline: .25rem; }
  .chat-suggestions { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .35rem; }
  .chat-suggestion { white-space: nowrap; }
  .chat-empty { min-height: 160px; }
  body[data-view=chat] .content { overflow: hidden; padding-top: .45rem; padding-bottom: .4rem; }
  body[data-view=chat] .chat-heading { padding-top: .25rem; }
}
@media (max-width: 560px) and (max-height: 700px) {
  body[data-view=chat] .topbar { min-height: 70px; }
  body[data-view=chat] .page-subtitle { display: none; }
  body[data-view=chat] .chat-heading h2 { font-size: 1.2rem; }
  body[data-view=chat] .chat-heading > p { display: none; }
  body[data-view=chat] .chat-suggestions { margin-top: .5rem; }
}
