/* One fixed navy for the app; orange (needs you), green (done) and red (problem) only for state. Same palette as the phone app. */
:root {
  --kb-sep: color-mix(in srgb, var(--muted) 28%, transparent);   /* lines between kanban columns */
  --scroll: color-mix(in srgb, var(--muted) 30%, transparent);        /* kanban scrollbars: faint */
  --scroll-hover: color-mix(in srgb, var(--muted) 60%, transparent);
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #e9edf3;
  --text: #16202b;
  --muted: #5d6978;
  --line: #d7dde6;
  --accent: #1e5aa8;
  --accent-ink: #ffffff;
  --accent-soft: #e1eaf7;
  --me: #dbe7f7;
  --question: #fcefdb;
  --danger: #c62828;
  --danger-soft: #fbe5e5;
  --ok: #2b7a30;
  --ok-soft: #e2f0e3;
  --warn: #b85a00;
  --warn-soft: #fcefdb;
  --evidence: #fff4c7;
  --shadow: 0 1px 2px rgba(20, 32, 48, .06), 0 2px 8px rgba(20, 32, 48, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1318;
    --surface: #181d24;
    --surface-2: #222934;
    --text: #e4e8ee;
    --muted: #98a4b3;
    --line: #2d3541;
    --accent: #8fb9ff;
    --accent-ink: #0b1d36;
    --accent-soft: #1c2a40;
    --me: #233a5c;
    --question: #3a2b16;
    --danger: #ff8a80;
    --danger-soft: #3a1e1e;
    --ok: #7cc47f;
    --ok-soft: #1b2e1d;
    --warn: #ffb35c;
    --warn-soft: #3a2b16;
    --evidence: #3a3520;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.boot { padding: 40px 16px; text-align: center; color: var(--muted); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }

/* buttons */
.btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 8px 14px; cursor: pointer; line-height: 1.3; min-height: 38px;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.link { border: none; background: none; color: var(--accent); padding: 4px 6px; min-height: 0; }
.btn.link:hover { text-decoration: underline; background: none; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* forms (pair / lock) */
.card-page { max-width: 440px; margin: 0 auto; padding: 48px 16px; }
.card-page h1 { font-size: 24px; margin: 12px 0 6px; }
.card-page .logo { width: 56px; height: 56px; display: block; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.field label { font-weight: 600; font-size: 14px; }
.field input, .field textarea, .field select {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); width: 100%;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field textarea:focus, .composer textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.form-actions .btn { flex: 1; }
.note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* shell */
.shell { display: grid; grid-template-columns: 232px 1fr; height: 100vh; height: 100dvh; }
.side {
  border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column;
  padding: 14px 10px; gap: 4px; min-height: 0;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; font-weight: 700; font-size: 17px; }
.brand img { width: 30px; height: 30px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: none;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 15px;
}
.nav-btn:hover { background: var(--surface-2); }
.nav-btn.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-btn svg { width: 20px; height: 20px; flex: none; }
.badge {
  margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: 12px;
  padding: 0 7px; min-width: 20px; text-align: center; line-height: 20px; font-weight: 600;
}
.side .spacer { flex: 1; }
.pill { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); padding: 8px 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 5px; background: #9aa3ad; }
.dot.green { background: var(--ok); }
.dot.red { background: var(--danger); }
.dot.orange { background: var(--warn); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  display: none; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.topbar img { width: 26px; height: 26px; }
.topbar .title { font-weight: 700; }
.topbar .pill { margin-left: auto; padding: 0; }
.view { flex: 1; overflow-y: auto; min-height: 0; }
.view.chat-view { overflow: hidden; display: flex; flex-direction: column; }
.bottom-nav { display: none; }
.banner { background: var(--question); padding: 10px 16px; font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

@media (max-width: 859px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .side { display: none; }
  .topbar { display: flex; }
  .main { grid-row: 1 / 3; }
  .bottom-nav {
    display: flex; border-top: 1px solid var(--line); background: var(--surface);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav .nav-btn { flex-direction: column; gap: 2px; font-size: 12px; text-align: center; border-radius: 0; padding: 8px 4px; position: relative; }
  .bottom-nav .nav-btn.on { background: none; }
  .bottom-nav .badge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }
  .fab { right: 16px; bottom: 16px; width: 54px; height: 54px; }
  .wrap .page-h .state { display: none; }   /* the top bar shows it */
  .seg-btn { font-size: 13.5px; }
}

/* content blocks */
.wrap { max-width: 860px; margin: 0 auto; padding: 16px; }
.status-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.status-card .head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.status-card .dot { margin-top: 0; }
.tabs { display: flex; gap: 4px; margin: 16px 0 12px; border-bottom: 1px solid var(--line); }
.tab { border: none; background: none; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.list { display: flex; flex-direction: column; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.task {
  --s: var(--line);
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--s); border-radius: 12px; padding: 12px 14px;
  box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 6px;
}
.task:hover { border-color: var(--accent); border-left-color: var(--s); }
.s-warn { --s: var(--warn); } .s-run { --s: var(--accent); } .s-ok { --s: var(--ok); } .s-muted { --s: var(--line); }
.task .head { display: flex; align-items: flex-start; gap: 10px; }
.chip { background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 600; }
.task .t-title { font-weight: 600; font-size: 15.5px; flex: 1; min-width: 0; padding-top: 2px; }
.task .meta { font-size: 13px; color: var(--muted); }
.task .sum { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task .actions { margin-top: 2px; }
.ic {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent);
}
.ic svg { width: 17px; height: 17px; }
.ic.ok { background: var(--ok-soft); color: var(--ok); }
.ic.warn { background: var(--warn-soft); color: var(--warn); }
.due {
  flex: none; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 6px; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; vertical-align: middle;
}
.due.warn { background: var(--warn-soft); color: var(--warn); }
.due.bad { background: var(--danger-soft); color: var(--danger); }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }

/* page header, segmented filter */
.page-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 2px 0 14px; }
.page-h h2 { font-size: 21px; margin: 0; }
.page-h .state { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.page-h .state .dot { margin-top: 0; }
.page-h .error { flex-basis: 100%; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 3px; margin-bottom: 14px; }
.seg-btn {
  border: none; background: none; border-radius: 9px; padding: 8px 4px; cursor: pointer; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px;
}
.seg-btn.on { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: var(--shadow); }
.seg-btn .n { font-size: 12px; font-weight: 700; color: var(--accent); }
.day-h { font-size: 13px; color: var(--muted); margin: 8px 2px 0; }
.files-list { gap: 8px; }
.file .name .sub { display: block; padding: 2px 0 0; font-size: 12.5px; text-align: left; color: var(--muted); }

/* today */
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 22px; }
@media (min-width: 1100px) { .wrap.today { max-width: 1180px; } .today-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.tsec { margin-bottom: 22px; }
.sec-h { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 8px; }
.sec-h h3 { font-size: 15px; margin: 0; flex: 1; }
.empty-s { color: var(--muted); font-size: 14px; margin: 0; padding: 12px 14px; background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; }
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.trow, .ev {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: none; background: none;
  text-align: left; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.trow { cursor: pointer; }
.trow:hover { background: var(--surface-2); }
.rows > :last-child { border-bottom: none; }
.trow .tt, .ev .tt { flex: 1; min-width: 0; }
.trow .ic { width: 26px; height: 26px; border-radius: 8px; }
.trow .ic svg { width: 15px; height: 15px; }
.ev .tm { flex: none; width: 44px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13.5px; }
.ev.past { color: var(--muted); }
.next { margin-top: 8px; }
.next .small { margin: 0 2px 4px; }
.next .ev { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.detail-h { display: flex; gap: 12px; align-items: flex-start; border-left: 4px solid var(--s); padding-left: 12px; }
.detail-h .ic { margin-top: 4px; }

/* voice instruction from any screen */
.main { position: relative; }
.fab {
  position: absolute; right: 22px; bottom: 22px; width: 56px; height: 56px; border-radius: 18px; border: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(20, 32, 48, .25);
  z-index: 5;
}
.fab svg { width: 26px; height: 26px; }
/* back to the list from a long page (shown once the top back link has scrolled away) */
.fab-back {
  position: absolute; left: 22px; bottom: 28px; z-index: 5; display: none; align-items: center; height: 44px; padding: 0 18px 0 14px;
  border-radius: 22px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px rgba(20, 32, 48, .18); max-width: calc(100% - 120px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fab-back.show { display: inline-flex; }
.fab-back:hover { background: var(--surface-2); }
.fab:hover { filter: brightness(1.08); }
.view { padding-bottom: 76px; }
.view.chat-view { padding-bottom: 0; }

/* quick instruction chips */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-btn {
  flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px;
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.chip-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.due-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.due-fields .field { flex: 1; min-width: 140px; margin: 8px 0; }
.due-fields .field span { font-weight: 600; font-size: 14px; }
.dialog textarea, .dialog input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); width: 100%; }
.dialog .field { margin: 10px 0 0; }
.pending-note { font-size: 13px; color: var(--accent); }
.detail h2 { font-size: 20px; margin: 4px 0; }
.detail h3 { font-size: 15px; margin: 22px 0 8px; }
.pre { white-space: pre-wrap; word-break: break-word; }
.utt { display: flex; gap: 10px; padding: 4px 8px; border-radius: 6px; }
.utt.ev { background: var(--evidence); font-weight: 600; }
.utt .t { color: var(--muted); font-size: 12px; width: 64px; flex: none; padding-top: 2px; font-weight: 400; }
.back { margin: 0 0 8px -6px; }
.section { margin: 22px 0; }
.section h3 { font-size: 15px; margin: 0 0 8px; }
.section .panel { display: flex; flex-direction: column; gap: 10px; }

/* chat */
.msgs { flex: 1; overflow-y: auto; min-height: 0; }
.msgs-inner { max-width: 780px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.day { text-align: center; font-size: 12px; color: var(--muted); margin: 8px 0 2px; }
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.bot { align-self: flex-start; }
.bubble { padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; }
.msg.me .bubble { background: var(--me); border-bottom-right-radius: 4px; }
.msg.bot .bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.q .bubble { background: var(--question); border-color: transparent; }
.bubble .lbl { display: block; font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.bubble .quote { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.notice .bubble { border-left: 3px solid var(--accent, var(--line)); }
.msg .meta { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; align-items: center; }
.msg .meta.bad { color: var(--danger); }
.sys { align-self: center; font-size: 13px; color: var(--muted); text-align: center; max-width: 90%; }
.sys.bad { color: var(--danger); }
.more { align-self: center; }
.chat-empty { color: var(--muted); text-align: center; margin: auto; padding: 40px 16px; line-height: 1.9; }
.composer-wrap { border-top: 1px solid var(--line); background: var(--surface); padding: 10px 16px; }
.composer { max-width: 780px; margin: 0 auto; }
.reply-bar, .voice-bar { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 2px 8px; }
.reply-bar { color: var(--text); }
.reply-bar span, .voice-bar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-bar { color: var(--accent); }
.voice-bar.rec { color: var(--danger); }
.input-row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; max-height: 200px;
  min-height: 44px; background: var(--bg); line-height: 1.45;
}
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); }
.icon-btn:disabled { opacity: .45; cursor: default; }
.icon-btn.send { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.icon-btn.rec { color: #fff; background: var(--danger); border-color: var(--danger); }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 6px; }

/* toasts */
#toasts { position: fixed; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(380px, calc(100vw - 28px)); }
.toast {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px;
  padding: 10px 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, .14); font-size: 14px;
}
.toast b { display: block; }
.toast .body { white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.toast.bad { border-left-color: var(--danger); }

/* dialog */
.dialog-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); display: grid; place-items: center; z-index: 60; padding: 16px; }
.dialog { background: var(--surface); border-radius: 14px; padding: 20px; max-width: 420px; width: 100%; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.dialog h3 { margin: 0 0 8px; }
.dialog .form-actions { justify-content: flex-end; }
.dialog .form-actions .btn { flex: none; }

/* light markdown (reports, results, chat) */
.md { white-space: normal; }
.md > * { margin: 0; }
.md > * + * { margin-top: 4px; }
.md > .gap { margin-top: 12px; }
.md-h { font-weight: 700; font-size: 15.5px; margin-top: 14px !important; }
.md > .md-h:first-child { margin-top: 0 !important; }
.md-h.sm { font-size: 14px; margin-top: 10px !important; }
.md-list { margin: 0; padding-left: 20px; }
.md-list li { margin: 2px 0; }
.md-list li.sub { margin-left: 18px; list-style-type: circle; font-size: 14px; }
ol.md-list li.sub { list-style-type: circle; }
.md-note { color: var(--muted); font-size: 13px; }
.md-table { overflow-x: auto; margin: 6px 0; }
.md-table table { border-collapse: collapse; font-size: 13.5px; }
.md-table th, .md-table td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.md-table th { background: var(--surface-2); font-weight: 600; }
.bubble .md-h { font-size: 15px; }

/* task detail sections */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 14px 0; box-shadow: var(--shadow); }
.card.result { border-left: 4px solid var(--ok); }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 700; margin-bottom: 8px; }
.files { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.file .ext { flex: none; font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 6px; padding: 3px 6px; }
.file .name { flex: 1; min-width: 0; word-break: break-all; font-size: 14px; }
.file .btn { flex: none; }
.callout { background: var(--question); border-radius: 12px; padding: 12px 16px; margin: 14px 0; }
.callout.bad { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.callout .md-list li { margin: 4px 0; }
.sources { margin: 8px 2px; }
details.plan { margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; background: var(--surface); }
details.plan summary { cursor: pointer; font-weight: 600; }
details.plan[open] summary { margin-bottom: 10px; }
.steps li { margin: 6px 0; }
.kv { display: flex; gap: 10px; margin-top: 8px; font-size: 14px; }
.kv > :first-child { flex: none; width: 64px; }
.kv > :last-child { min-width: 0; word-break: break-all; }

/* choose several and delete */
.sel-bar { display: flex; align-items: center; gap: 10px; padding: 2px 2px 4px; min-height: 40px; }
.sel-bar .muted { flex: 1; }
.sel-bar.on { background: var(--accent-soft); border-radius: 10px; padding: 6px 10px; position: sticky; top: 0; z-index: 2; }
.sel-bar .grow { flex: 1; }
.btn.danger:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.pick-row { display: flex; align-items: center; gap: 10px; cursor: pointer; border-radius: 12px; }
.pick-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick-row > .pick { flex: 1; min-width: 0; cursor: pointer; }
.pick-row > .pick.on { border-color: var(--accent); background: var(--accent-soft); }
.task.pick.on { border-left-color: var(--s); }
.check {
  flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--muted); display: grid; place-items: center;
  background: var(--surface);
}
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check svg { width: 16px; height: 16px; }
.file .name .sub.muted { display: block; font-size: 12.5px; padding-top: 2px; }

/* search button in page headers */
.btn.icon-l { display: inline-flex; align-items: center; gap: 5px; }
.btn.icon-l svg { width: 16px; height: 16px; }
.page-h .icon-l { margin-left: auto; align-self: center; }

/* 들은 내용: conversation segments of a day */
.day-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.day-nav b { font-size: 15px; min-width: 7.5em; text-align: center; }
.day-nav .grow { flex: 1; }
.heard { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.hseg {
  display: flex; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.hseg:hover { border-color: var(--accent); }
.hseg .tm { flex: none; width: 46px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; line-height: 1.35; }
.hseg .tm small { display: block; font-size: 12px; }
.hseg .hb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hseg .hs { font-size: 15px; }
.hseg.dim { background: transparent; box-shadow: none; padding: 7px 14px; }
.hseg.dim .hs { color: var(--muted); font-size: 14px; }
.hseg.pend { border-style: dashed; }
.trow .tm { flex: none; width: 44px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13.5px; }
.trow .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .tt.two { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.trow .tm + .tt { align-self: flex-start; }
.trow:has(.tt.two) { align-items: flex-start; }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip {
  display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; text-align: left; padding: 3px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 13px; cursor: pointer;
}
.tchip:hover { border-color: var(--accent); }
.tchip .k { flex: none; font-size: 11.5px; font-weight: 700; color: var(--accent); }
.tchip.plain { cursor: default; }
.tchip.plain:hover { border-color: var(--line); }
.tchip.plain .k { color: var(--muted); }

/* one segment's transcript */
.lines { display: flex; flex-direction: column; gap: 1px; }
.utt.o { color: var(--muted); }
.utt.ev { border-bottom: none; padding: 4px 8px; font-size: inherit; width: auto; }
.utt.focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); }
mark { background: var(--evidence); color: inherit; border-radius: 3px; padding: 0 1px; }

/* search */
.search-box {
  display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 12px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.search-box:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
.search-box > svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search-box input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: 16px; padding: 6px 0; }
.seg.small { max-width: 380px; }
.search-help { line-height: 1.8; }
.conv {
  display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; padding: 10px 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.conv:hover { border-color: var(--accent); }
.conv .cs { font-size: 14.5px; }
.conv .hit { display: flex; gap: 8px; font-size: 14px; }
.conv .hit .t { flex: none; width: 40px; color: var(--muted); font-size: 12px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.ask {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px;
  background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; margin: 6px 0 16px;
}

/* text pasted in the composer / shared from the phone, sent with the instruction */
.shared-bar { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.att-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; }
.att-h svg { width: 14px; height: 14px; flex: none; }
.att-p {
  font-size: 13px; color: var(--muted); white-space: pre-wrap; word-break: break-word; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.att-a { display: flex; gap: 4px; margin: 2px 0 -4px -6px; }
.warn-t { color: var(--warn); font-weight: 400; }
.bubble .att { margin-top: 6px; padding: 6px 9px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); text-align: left; }

/* mail draft card */
.card.mail { border-left: 4px solid var(--accent); }
.card.mail .kv { align-items: baseline; }
.card.mail .kv > :nth-child(2) { flex: 1; }
.btn.link.small-l { font-size: 13px; padding: 0 4px; }
.mail-body { margin: 10px 0; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: 14px; max-height: 260px; overflow: auto; }
.card.mail .row { margin: 4px 0 8px; }

/* kanban board */
.view.kb-view { padding-bottom: 90px; }
.wrap.kb-wrap { max-width: none; }
.kb-note { margin: -6px 0 10px; }
/* one panel, columns side by side and split by thin vertical lines (like KanbanFlow) */
.kb-board {
  display: flex; align-items: stretch; overflow-x: auto; scroll-snap-type: x proximity; min-height: calc(100dvh - 230px);
  background: var(--surface-2); border: 1px solid var(--kb-sep); border-radius: 12px; margin-bottom: 12px;
}
.kb-col {
  flex: 0 0 290px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100dvh - 230px);
  padding: 8px 6px 6px; scroll-snap-align: start; border-left: 1px solid var(--kb-sep); cursor: default;
}
.kb-col:first-child { border-left: none; }
.kb-col.done { opacity: .92; }
.kb-tail { flex: 1 0 80px; border-left: 1px solid var(--kb-sep); display: grid; place-items: center; cursor: default; }
.kb-tail span { font-size: 12.5px; color: var(--muted); opacity: 0; transition: opacity .15s; user-select: none; }
.kb-tail:hover span { opacity: .8; }
.kb-col-h { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.kb-col-h b { flex: 1; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-count { font-size: 12.5px; font-weight: 700; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 1px 8px; }
.kb-count.over { color: var(--warn); background: var(--warn-soft); }
.kb-more { font-size: 18px; line-height: 1; padding: 2px 6px; }
.kb-over { font-size: 12.5px; color: var(--warn); padding: 0 2px; }
.kb-cards { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 40px; border-radius: 8px; padding: 1px; }
/* thin, faint scrollbars in the kanban (a column's cards, the board sideways); a little clearer while the pointer is over it */
.kb-cards::-webkit-scrollbar, .kb-board::-webkit-scrollbar { width: 4px; height: 4px; }
.kb-cards::-webkit-scrollbar-track, .kb-board::-webkit-scrollbar-track { background: transparent; }
.kb-cards::-webkit-scrollbar-thumb, .kb-board::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 2px; }
.kb-cards:hover::-webkit-scrollbar-thumb, .kb-board:hover::-webkit-scrollbar-thumb { background: var(--scroll-hover); }
@supports not selector(::-webkit-scrollbar) {
  .kb-cards, .kb-board { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
}
.kb-cards.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.kb-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 14px 6px; }
.kb-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 10px; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px;
}
.kb-card:hover { border-color: var(--accent); }
.kb-card.dragging { opacity: .35; }
.kb-card.pending { opacity: .7; }
.kb-card .kb-t { font-size: 13.5px; line-height: 1.45; word-break: break-word; }
.kb-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); }
.kb-meta .due { font-size: 11px; }
.kb-chk.all { color: var(--ok); font-weight: 700; }
.kb-noteic { border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.kb-ph { height: 38px; border: 2px dashed var(--accent); border-radius: 10px; background: var(--accent-soft); }
.kb-add { border: none; background: none; color: var(--muted); text-align: left; padding: 5px 4px; cursor: pointer; border-radius: 8px; font-size: 14px; }
.kb-add:hover { background: var(--surface); color: var(--accent); }
.c-red { --kb: #d93025; } .c-orange { --kb: #e8710a; } .c-yellow { --kb: #e2b400; } .c-green { --kb: #188038; } .c-blue { --kb: #1a73e8; } .c-purple { --kb: #9334e6; }
/* a card's color tints its whole background (stronger on dark backgrounds) */
.kb-card[class*=" c-"] { background: color-mix(in srgb, var(--kb) var(--kb-tint, 15%), var(--surface)); border-color: color-mix(in srgb, var(--kb) 45%, var(--line)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --kb-tint: 26%; } }
:root[data-theme="dark"] { --kb-tint: 26%; }
.kb-form { display: flex; flex-direction: column; }
.kb-form .field { margin: 8px 0; }
.kb-form .field > span { font-weight: 600; font-size: 14px; }
.kb-form select, .kb-form input[type=text], .kb-form input[type=number], .kb-form input[type=date], .kb-form input[type=time], .kb-form textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); width: 100%;
}
.kb-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.kb-sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; background: var(--kb); cursor: pointer; padding: 0; }
.kb-sw.none { background: var(--surface-2); color: var(--muted); font-size: 12px; }
.kb-sw.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.kb-checks { display: flex; flex-direction: column; gap: 6px; }
.kb-check-row { display: flex; align-items: center; gap: 8px; }
.kb-check-row input[type=text] { flex: 1; }
.dialog:has(.kb-form) { max-width: 520px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.dialog:has(.kb-form) .form-actions { flex-wrap: wrap; }
.dialog:has(.kb-form) .form-actions .btn { flex: 1 1 auto; }
@media (max-width: 859px) { .kb-col { flex-basis: 82vw; max-height: none; } .kb-cards { overflow: visible; } }
.dialog .kb-check-row input[type=checkbox], .dialog .toggle input[type=checkbox] { width: auto; flex: none; padding: 0; }
.dialog .kb-check-row input[type=text] { flex: 1; min-width: 0; }

/* right-click menu of a kanban card */
.ctx-menu {
  position: fixed; z-index: 70; min-width: 210px; max-width: 280px; max-height: calc(100dvh - 16px); overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(20, 32, 48, .22);
}
.ctx-title { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 4px 10px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-menu .item { display: block; width: 100%; text-align: left; padding: 6px 10px; border: none; background: none; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.ctx-menu .item:hover:not(:disabled), .ctx-menu .item:focus-visible { background: var(--surface-2); outline: none; }
.ctx-menu .item:disabled { opacity: .4; cursor: default; }
.ctx-menu .item.danger { color: var(--danger); }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.ctx-h { font-size: 11.5px; color: var(--muted); padding: 4px 10px 2px; }
.ctx-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 10px 6px; }
.kb-sw.small { width: 22px; height: 22px; font-size: 10px; }

/* web login */
.toggle.keep { margin: 4px 0 8px; color: var(--text); font-size: 14px; }
.toggle.keep input { width: auto; }
.approve-wait { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 28px 18px; margin-top: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.approve-wait h3 { margin: 4px 0 0; font-size: 18px; }
.approve-wait p { margin: 0; }
.kb-col-name { cursor: pointer; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; }
.kb-col-name:hover, .kb-col-name:focus-visible { background: var(--surface); outline: none; }
.kb-col-h[draggable="true"] { cursor: grab; }
.kb-col.dragging { opacity: .4; }
.kb-col-ph { flex: 0 0 6px; align-self: stretch; min-height: 120px; background: var(--accent); border-radius: 3px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear { flex: none; color: var(--muted); padding: 4px; }
.search-clear svg { width: 18px; height: 18px; }

/* attached files: composer chips, links in bubbles and cards */
.files-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.file-chip {
  display: flex; align-items: center; gap: 6px; max-width: 100%; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 3px 4px 3px 9px; font-size: 12.5px;
}
.file-chip svg { width: 14px; height: 14px; flex: none; }
.file-chip .fc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.file-chip .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.file-chip.failed { border-color: var(--warn); }
.file-chip .spin { width: 13px; height: 13px; }
.composer.drop { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 12px; }
.att-files { display: flex; flex-direction: column; gap: 3px; }
.att-file { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.att-file svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.att-file a, .att-file > span:not(.muted):not(.spin):not(.warn-t) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.att-file a { color: var(--accent); }
.att-file .muted { font-size: 12px; flex: none; }
.att-file .btn.link { padding: 2px 6px; }
.kb-files { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; width: 100%; }
.kb-clip { display: inline-flex; align-items: center; gap: 2px; }
.kb-clip svg { width: 12px; height: 12px; }
@media (max-width: 520px) { .composer .icon-btn { width: 40px; height: 40px; } .file-chip .fc-name { max-width: 140px; } }
.chat-mail { margin-top: 6px; width: min(520px, 100%); }
.chat-mail .card.mail { margin: 0; }
