:root {
  color-scheme: light;
  --bg: #f1f5f4;
  --white: #fff;
  --ink: #142a29;
  --muted: #4d6461;
  --line: #dbe7e3;
  --teal: #14594f;
  --soft: #e9f6ef;
  --warning: #92521f;
  --radius: 18px;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 2px solid #277b6b; outline-offset: 3px; }
.topbar {
  height: 67px; background: #102b28; color: #f4fbf7; padding: 0 max(24px, calc((100% - 1120px) / 2));
  display: flex; align-items: center; gap: 17px;
}
.brand { display: flex; align-items: center; gap: 10px; font: 800 25px/1 system-ui, sans-serif; letter-spacing: -.05em; }
.brand-mark {
  display: grid; place-items: center; width: 31px; height: 31px;
  border-radius: 9px; color: #15372e; background: #a6edc8; font-size: 16px; font-weight: 900;
}
.brand-dot { color: #a6edc8; }
.top-divider { width: 1px; height: 20px; background: #516a63; }
.top-title { font-size: 13px; font-weight: 600; color: #d1e4dd; }
.top-tag { margin-left: auto; border: 1px solid #5a796c; border-radius: 99px; padding: 7px 10px; color: #e4f4eb; font-size: 11px; white-space: nowrap; }
.status-dot, .eyebrow span { display: inline-block; width: 7px; height: 7px; margin-right: 6px; background: #84d2aa; border-radius: 50%; }
.shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.hero { padding: 44px 0 25px; }
.eyebrow, .section-kicker { color: #2c6b58; font: 750 11px/1.3 system-ui, sans-serif; letter-spacing: .13em; margin: 0 0 10px; }
.eyebrow span { background: #398569; }
h1 { margin: 0 0 13px; font-size: clamp(30px, 5.4vw, 47px); line-height: 1.2; letter-spacing: -.065em; }
.hero > p:last-child { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid #cbdad5; margin: 0 0 18px; }
.tab { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 13px 2px 11px; color: var(--muted); font-size: 14px; font-weight: 700; }
.tab.current { color: var(--teal); border-bottom-color: var(--teal); }
.tab span { margin-left: 3px; }
.workspace { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 16px; align-items: start; }
.board, .sidebar { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.sidebar { padding: 19px 14px 15px; }
.sidebar h2 { margin: 0 0 14px 5px; font-size: 14px; letter-spacing: -.03em; }
.pets { display: grid; gap: 7px; }
.pet {
  width: 100%; text-align: left; display: flex; gap: 9px; align-items: center; padding: 9px; border-radius: 11px;
  background: #fafcfb; color: var(--ink); border: 1px solid var(--line);
}
.pet[aria-pressed="true"] { border-color: #6daf99; background: #eaf7ef; }
.pet:hover { background: #eaf7ef; }
.avatar { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 8px; background: #d3eee0; color: #23574a; font: 800 14px/1 system-ui, sans-serif; }
.pet:nth-child(2) .avatar { background: #e6e6f5; color: #514276; }
.pet-name { display: block; font-size: 13px; font-weight: 800; }
.pet-subtitle { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.side-note { margin: 14px 0 0; padding: 12px; background: #f3f7f6; border-radius: 10px; color: var(--muted); }
.side-note p { margin: 0; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.side-note .note-heading { color: var(--ink); font-weight: 800; margin-bottom: 3px; }
.board { padding: 22px; min-width: 0; }
.board-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.board h2, dialog h2 { font-size: 21px; line-height: 1.3; letter-spacing: -.05em; margin: 0; }
.section-kicker { margin-bottom: 6px; }
.scope-label { font-size: 11px; font-weight: 700; color: #2b6555; background: var(--soft); border-radius: 99px; padding: 7px 10px; white-space: nowrap; }
.scope-label:empty { display: none; }
.ask-form { margin-top: 17px; display: flex; gap: 7px; }
.ask-form input {
  width: 100%; min-width: 0; padding: 12px; background: #fcfefd; color: var(--ink);
  border: 1px solid #b8cbc4; border-radius: 9px; font-size: 14px;
}
.ask-form input::placeholder { color: #556c67; }
.primary { background: var(--teal); border: 1px solid var(--teal); border-radius: 9px; color: #fff; padding: 10px 13px; font-size: 13px; font-weight: 750; white-space: nowrap; }
.primary:hover { background: #0f4840; }
.primary span { margin-left: 4px; }
.examples { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.example, .source-open { border: 1px solid var(--line); background: #f7fbf9; border-radius: 99px; color: #235b4e; padding: 6px 10px; font-size: 11px; font-weight: 650; }
.example:hover, .source-open:hover { border-color: #7db2a2; background: var(--soft); }
#answer { margin-top: 19px; }
.response { border: 1px solid #d6e8df; border-left: 3px solid #52a284; background: #f4faf6; border-radius: 10px; padding: 13px 15px; }
.response.isolated, .response.guidance { border-color: #edd9b7; border-left-color: #ac7534; background: #fff9ef; }
.response.missing, .response.clarify, .response.waiting { border-color: var(--line); border-left-color: #8a9c96; background: #f7faf9; }
.response-label { color: var(--teal); font-size: 11px; font-weight: 800; margin: 0 0 5px; }
.response.isolated .response-label, .response.guidance .response-label { color: var(--warning); }
.response h3 { font-size: 17px; letter-spacing: -.035em; margin: 0; }
.response-text { margin: 7px 0 0; white-space: pre-line; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.filters { color: var(--muted); font-size: 11px; margin: 10px 0 0; overflow-wrap: anywhere; }
.sources { margin: 17px 0 0; display: grid; gap: 6px; }
.sources > h3 { margin: 0 0 2px; font-size: 13px; }
.source { padding: 10px 12px; display: flex; align-items: center; gap: 8px; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; }
.source-title { font-size: 13px; font-weight: 750; margin: 0; }
.source-meta { margin: 4px 0 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.source-open { white-space: nowrap; }
.muted { color: var(--muted); font-size: 13px; margin: 8px 0 0; line-height: 1.6; }
.checks-head { padding-bottom: 15px; }
.check-summary { padding: 13px; background: var(--soft); border-radius: 9px; color: var(--teal); font-size: 15px; font-weight: 800; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 11px; }
.check-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 7px; align-items: start; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line); }
.check-title { margin: 0; font-size: 13px; }
.check-card p { grid-column: 1 / -1; color: var(--muted); margin: 0; line-height: 1.6; font-size: 11px; overflow-wrap: anywhere; }
.badge { display: inline-block; color: #1b6449; background: var(--soft); padding: 3px 6px; border-radius: 7px; font-size: 10px; font-weight: 800; }
.badge.failed { color: #9c3f25; background: #fff0e6; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; padding: 18px 0 24px; }
.footer-divider { margin: 0 4px; color: #81928c; }
dialog { width: min(510px, calc(100% - 32px)); max-height: 88vh; color: var(--ink); padding: 21px; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 18px 75px #092e2644; }
dialog::backdrop { background: #112b2885; }
.modal-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.icon-button { color: var(--ink); background: #f2f6f4; border: 1px solid var(--line); border-radius: 8px; width: 34px; height: 34px; font-size: 20px; line-height: 1; }
#doc-meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 10px; padding: 11px 0; margin: 5px 0; font-size: 13px; }
#doc-meta dt { color: var(--muted); }
#doc-meta dd { margin: 0; font-weight: 700; }
#doc-body { margin: 0; padding: 13px; background: #f3f7f6; border-radius: 9px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 13px; line-height: 1.8; }
.modal-note { color: var(--muted); font-size: 11px; margin: 12px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 700px) {
  .shell { width: calc(100% - 28px); }
  .topbar { height: 56px; padding: 0 14px; gap: 9px; }
  .top-title { font-size: 11px; }
  .hero { padding: 26px 0 17px; }
  .hero > p:last-child { font-size: 13px; }
  .tabs { margin-bottom: 12px; }
  .workspace { grid-template-columns: 1fr; gap: 10px; }
  .pets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar, .board { padding: 14px; border-radius: 13px; }
  .sidebar h2 { margin-bottom: 8px; }
  .side-note { display: none; }
  .check-grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .top-divider, .top-title { display: none; }
  .board h2 { font-size: 18px; }
  .primary { padding-inline: 8px; }
  .primary span { display: none; }
}

.tabs { flex-wrap: wrap; gap: 5px 20px; }
.workspace-panels { min-width: 0; }
.secondary {
  border: 1px solid #b8cec5; border-radius: 9px; color: var(--teal); background: #f7fbf9;
  padding: 8px 11px; font-size: 12px; font-weight: 750; white-space: nowrap;
}
.secondary:hover { background: var(--soft); }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 15px 0 21px; }
.metric { background: #f5f9f7; border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
.metric h3 { font-size: 13px; margin: 0; }
.metric-value { margin: 6px 0 2px; color: var(--teal); font-size: 25px; font-weight: 800; letter-spacing: -.05em; }
.metric-baseline { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.inline-heading { display: flex; justify-content: space-between; align-items: center; gap: 7px; }
.inline-heading h3, .flow-section h3, .bench-box h3 { margin: 0; font-size: 15px; letter-spacing: -.03em; }
.insight-list, .record-list { display: grid; gap: 8px; margin-top: 10px; }
.insight { border: 1px solid #d5e8df; border-left: 3px solid #56a487; background: #f7fbf9; border-radius: 11px; padding: 13px 15px; }
.insight.watch { border-color: #e4dac1; border-left-color: #a67832; background: #fffbf3; }
.insight.urgent { border-color: #efcec4; border-left-color: #ae4b32; background: #fff7f3; }
.insight h3, .evidence-card h3 { font-size: 15px; letter-spacing: -.03em; margin: 0; }
.insight p { margin: 6px 0 0; font-size: 13px; line-height: 1.65; }
.insight .insight-label { margin: 0 0 3px; color: var(--teal); font-size: 11px; font-weight: 800; }
.insight.watch .insight-label { color: #845016; }
.insight.urgent .insight-label { color: #9a432c; }
.insight-action { font-weight: 700; }
.insight-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 7px 0 0; font-size: 11px; color: var(--muted); }
.insight-links .source-open, .recovery-card .source-open { white-space: normal; text-align: left; }
.insight-sources { margin-top: 8px; color: var(--teal); font-size: 12px; }
.insight-sources summary { cursor: pointer; font-weight: 700; }
.evidence-link { color: #255c50; text-underline-offset: 2px; font-weight: 700; font-size: 12px; }
.panel-note { font-size: 11px; color: var(--muted); margin: 13px 0 0; line-height: 1.65; }
.recovery-card { margin-top: 15px; }
.recovery-card .source-open { margin-top: 8px; }
.content-list { padding-left: 19px; margin: 7px 0; font-size: 13px; line-height: 1.7; color: var(--ink); }
.flow-section { margin-top: 18px; }
.flow-section h3 { margin-bottom: 8px; }
.flow-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; line-height: 1.55; }
.flow-row + .flow-row { margin-top: 5px; }
.record-list .flow-row { margin: 0; }
.record-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; }
.record-actions > .source-open { white-space: nowrap; }
.evidence-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.evidence-card .record-actions { margin-top: 10px; }
.evidence-card .badge { flex-shrink: 0; }
.badge.pending { background: #fff3dc; color: #805011; }
.bench-box { display: grid; align-items: start; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
#bench-results { grid-column: 1 / -1; }
#bench-results:empty { display: none; }
.bench-result { font-size: 14px; color: var(--teal); font-weight: 800; margin: 2px 0 0; }
.bench-case { margin: 6px 0; color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; }
.edit-dialog { width: min(535px, calc(100% - 28px)); }
.edit-form { display: grid; gap: 9px; margin-top: 12px; }
.edit-form label { font-size: 12px; font-weight: 750; min-width: 0; display: grid; gap: 4px; }
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.edit-form input, .edit-form select, .edit-form textarea { width: 100%; min-width: 0; border: 1px solid #b8cbc4; border-radius: 8px; background: #fcfefd; color: var(--ink); padding: 8px; font: inherit; font-weight: 500; }
.edit-form textarea { resize: vertical; }
.editor-actions { display: flex; gap: 6px; justify-content: flex-end; }
.danger, .edit-error { color: #9e3d2b; }
.edit-error { font-size: 12px; margin: 0; }
.edit-error:empty { display: none; }
@media (max-width: 700px) {
  .tabs { gap: 2px 12px; }
  .tab { padding: 9px 0 8px; font-size: 12px; }
  .metric-grid { gap: 5px; margin: 11px 0 15px; }
  .metric { padding: 8px; }
  .metric-value { font-size: 20px; }
  .metric h3, .metric-baseline { font-size: 10px; }
  .flow-row { align-items: flex-start; }
  .record-actions { flex-shrink: 0; }
  .today-scope { white-space: normal; }
  #today-scope { white-space: normal; text-align: right; }
}
.metric-grid { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.insight h3 { word-break: keep-all; overflow-wrap: anywhere; }
.flow-section .muted { margin-bottom: 8px; }
@media (max-width: 700px) {
  .tab { font-size: 11px; }
}
.document-import { background: #f4f8f6; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.document-import p { margin: 0 0 6px; font-size: 11px; color: var(--muted); }
.document-import p:last-child { margin: 5px 0 0; }
.document-import p strong { color: var(--teal); margin-right: 4px; }
.document-import .file-picker { min-width: 0; max-width: 100%; }
.document-import input[type=file] { padding: 4px; max-width: 208px; font-size: 11px; }
.document-import .review-check { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.document-import .review-check input { width: auto; }
.doc-attachment { display: inline-block; margin-top: 9px; }
