:root {
  --bg: #f1f4f2;
  --surface: #fff;
  --ink: #202e29;
  --text: #364840;
  --muted: #5c6e63;
  --line: #d5dfd8;
  --control-line: #82988a;
  --accent: #28634f;
  --accent-strong: #194c3b;
  --accent-soft: #e6f1e9;
  --blue-soft: #eaf1f8;
  --blue: #385f7b;
  --warm: #fff3dc;
  --warn: #80520c;
  --danger: #a33b30;
  --danger-soft: #fff0ed;
  --shadow: 0 2px 8px rgb(32 55 40 / 3%);
  --radius: 10px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); }
button, input, select, textarea { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 650; }
h1 { font-size: 28px; letter-spacing: -.5px; line-height: 1.3; }
h2 { font-size: 21px; line-height: 1.4; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
svg { width: 18px; height: 18px; display: block; flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; letter-spacing: 1.2px; color: var(--accent); font-weight: 650; }
.app-header {
  height: 56px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-symbol { display: grid; grid-template: repeat(2, 8px) / repeat(2, 8px); gap: 3px; transform: rotate(-7deg); margin-right: 2px; }
.brand-symbol i { background: var(--accent); border-radius: 2px; }
.brand-symbol i:nth-child(2) { background: #9bbcac; }
.brand-symbol i:nth-child(3) { grid-column: 2; background: #64947d; }
.brand-word { font-size: 20px; font-weight: 700; letter-spacing: -.5px; color: var(--ink); }
.brand-divider { height: 19px; width: 1px; background: var(--line); margin: 0 4px; }
.brand-caption, .connection { font-size: 13px; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 22px; }
.connection { display: flex; align-items: center; gap: 7px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.identity-button { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 5px 0; color: var(--text); font-size: 14px; }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 50%; font-size: 13px; font-weight: 650; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px;
  border: 1px solid var(--control-line); border-radius: 7px; background: #fff; color: var(--text);
  padding: 6px 12px; font-size: 14px; font-weight: 550; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.button:hover:not(:disabled) { background: #edf3ee; border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.button.subtle { border-color: transparent; background: transparent; color: var(--muted); }
.button.subtle:hover:not(:disabled) { background: var(--accent-soft); }
.button.small-button { min-height: 32px; padding: 4px 9px; font-size: 13px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border: 1px solid var(--control-line); border-radius: 6px; background: #fff; color: var(--text); font-size: 21px; }
.icon-button:hover { background: var(--accent-soft); color: var(--accent); }
.text-input, .select-input, .text-area {
  width: 100%; background: #fff; border: 1px solid var(--control-line); border-radius: 7px;
  color: var(--ink); padding: 8px 10px; font-size: 15px; transition: border-color .15s;
}
.text-input::placeholder, .text-area::placeholder { color: #64766a; opacity: 1; }
.text-input:focus, .text-area:focus, .select-input:focus { border-color: var(--accent); }
.text-area { resize: vertical; min-height: 84px; line-height: 1.6; }
.text-area.code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; min-height: 130px; }
.select-input { padding-right: 24px; }
.search-box { position: relative; min-width: 0; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search-box input { padding-left: 32px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 4px; padding: 3px 7px; font-size: 12px; font-weight: 550; line-height: 1.4; white-space: nowrap; background: #edf1ec; color: #52654f; }
.badge.green { background: var(--accent-soft); color: var(--accent); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.warning { background: var(--warm); color: var(--warn); }
.badge.error { background: var(--danger-soft); color: var(--danger); }
.badge.outline { background: transparent; border: 1px solid var(--line); padding: 2px 7px; }
.initial-loading, .page-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 80px 20px; color: var(--muted); }
.spinner { width: 20px; height: 20px; border: 2px solid #ccdcd0; border-right-color: var(--accent); border-radius: 50%; animation: spin .75s linear infinite; }
.spinner.small-spinner { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Overview: readable summaries with less space between sections. */
.home { max-width: 1480px; margin: 0 auto; padding: 26px 28px 36px; }
.home-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 20px; }
.hero-title .eyebrow { display: block; margin-bottom: 5px; }
.hero-title p { margin-top: 6px; color: var(--muted); font-size: 15px; }
.hero-aside { border-left: 1px solid var(--line); padding-left: 16px; max-width: 300px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 13px 18px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow); }
.stat-label { font-size: 14px; color: var(--muted); display: block; margin-bottom: 3px; }
.stat-value { font-size: 28px; line-height: 1.2; color: var(--ink); font-weight: 650; letter-spacing: -.5px; }
.stat-value small { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 7px; }
.stat-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: #edf1ec; color: var(--muted); }
.stat-card:nth-child(2) .stat-icon { background: var(--accent-soft); color: var(--accent); }
.stat-card:nth-child(3) .stat-icon { background: var(--blue-soft); color: var(--blue); }
.stat-card:nth-child(4) .stat-icon { background: var(--warm); color: var(--warn); }
.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-title { display: flex; align-items: center; gap: 9px; }
.section-title h2 { font-size: 18px; }
.section-title .count { font-size: 13px; color: var(--muted); border-radius: 4px; background: #e3eae3; padding: 1px 7px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.toolbar-actions .search-box { width: 260px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.project-card { display: flex; flex-direction: column; min-height: 230px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .15s, border-color .15s; overflow: hidden; cursor: pointer; }
.project-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgb(40 75 50 / 8%); }
.project-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.project-glyph { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.project-glyph.image { background: var(--blue-soft); color: var(--blue); }
.project-glyph.dialogue { background: var(--warm); color: var(--warn); }
.project-card h3 { font-size: 19px; line-height: 1.4; margin-bottom: 5px; }
.project-description { font-size: 14px; line-height: 1.65; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 24px; margin-bottom: 14px; }
.project-progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin: auto 0 6px; }
.project-progress-label strong { color: var(--accent); font-weight: 600; }
.progress-track { height: 5px; border-radius: 3px; background: #e1e9e2; overflow: hidden; }
.progress-fill { height: 100%; background: #467e60; border-radius: 3px; transition: width .25s; }
.project-card-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; color: var(--muted); font-size: 13px; gap: 10px; }
.project-card-footer .arrow { color: var(--accent); }
.project-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.page-footer { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); gap: 20px; }
.identity-hint { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid #c5d8c8; border-radius: 7px; background: var(--accent-soft); color: var(--text); font-size: 14px; margin-bottom: 16px; }
.identity-hint .link-button { margin-left: auto; }
.link-button { border: 0; background: transparent; padding: 0; color: var(--accent); font-size: 14px; text-decoration: none; }
.link-button:hover { text-decoration: underline; }
.empty-state { text-align: center; padding: 40px 24px; color: var(--muted); background: #fff; border: 1px dashed var(--control-line); border-radius: var(--radius); grid-column: 1 / -1; }
.empty-state .empty-icon { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--accent-soft); border-radius: 10px; color: var(--accent); }
.empty-state h3 { margin-bottom: 6px; font-size: 18px; }
.empty-state p { font-size: 14px; max-width: 470px; margin: 0 auto 14px; }
.error-state { color: var(--danger); }

/* Shared workbench structure. Desktop panes scroll independently below. */
.workspace { padding: 14px 20px 16px; max-width: 1920px; margin: auto; }
.project-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 10px; }
.project-heading-left { min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb svg { width: 13px; height: 13px; }
.project-title-row { display: flex; align-items: center; gap: 10px; }
.project-title-row h1 { font-size: 23px; letter-spacing: -.3px; }
.project-heading .toolbar-actions { flex-shrink: 0; }
.project-description-inline { font-size: 14px; color: var(--muted); margin-top: 3px; max-width: 850px; }
.workspace-toolbar { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid var(--line); margin-bottom: 12px; gap: 16px; }
.tabs { display: flex; gap: 24px; }
.tab { border: 0; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 7px; padding: 5px 1px 9px; border-bottom: 2px solid transparent; font-size: 15px; }
.tab.active { color: var(--accent); border-color: var(--accent); font-weight: 650; }
.tab svg { width: 17px; height: 17px; }
.progress-summary { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); padding-bottom: 9px; }
.progress-summary .progress-track { width: 90px; }
.progress-summary strong { font-weight: 650; color: var(--accent); }
.annotation-grid { display: grid; grid-template-columns: 232px minmax(0, 1fr) 360px; align-items: start; gap: 12px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); min-height: 45px; gap: 8px; flex-shrink: 0; }
.panel-heading h2, .panel-heading h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.panel-heading h3 svg { width: 16px; height: 16px; color: var(--accent); }
.task-filters { padding: 10px; display: grid; gap: 7px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.task-filters .text-input { font-size: 14px; padding-top: 6px; padding-bottom: 6px; }
.filter-row { display: flex; gap: 6px; }
.filter-row .select-input { font-size: 13px; padding: 6px 21px 6px 7px; min-width: 0; }
.task-list { max-height: calc(100dvh - 365px); min-height: 0; overflow-y: auto; padding: 5px; }
.task-row { width: 100%; border: 0; border-left: 3px solid transparent; background: #fff; border-radius: 6px; text-align: left; padding: 9px 9px; display: block; margin: 2px 0; color: var(--text); transition: background .15s; }
.task-row:hover { background: #f0f5f0; }
.task-row.selected { background: var(--accent-soft); border-left-color: var(--accent); }
.task-row-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 4px; gap: 5px; }
.task-number { color: var(--accent); font-weight: 650; }
.task-row-preview { font-size: 14px; line-height: 1.6; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.task-status { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.task-status svg { width: 13px; height: 13px; }
.task-status.submitted { color: var(--accent); }
.task-status.draft { color: var(--warn); }
.task-list-empty { font-size: 13px; text-align: center; padding: 24px 8px; color: var(--muted); }
.task-panel-footer { border-top: 1px solid var(--line); padding: 8px 10px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.task-panel-footer svg { width: 14px; height: 14px; }
.task-center { display: grid; gap: 12px; min-width: 0; }
.task-card { padding: 14px 16px; }
.task-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.task-card-head .eyebrow { font-size: 12px; letter-spacing: .5px; color: var(--muted); }
.task-content-field + .task-content-field { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.content-field-label { font-size: 13px; color: var(--muted); margin-bottom: 3px; font-weight: 550; }
.task-content-field > p { font-size: 20px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.task-meta { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.evidence-body { padding: 12px; }
.asset-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 0 0 10px; }
.asset-tab { border: 1px solid var(--control-line); background: #fff; padding: 5px 9px; font-size: 13px; border-radius: 5px; white-space: nowrap; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.asset-tab.active { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.image-frame { background: #f4f6f2; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.image-viewport { height: clamp(220px, calc(100dvh - 540px), 480px); overflow: auto; display: flex; align-items: center; justify-content: center; position: relative; }
.image-viewport.zoomed { display: block; }
.asset-image { display: block; width: 100%; height: auto; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.image-viewport.zoomed .asset-image { max-height: none; }
.image-controls { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; background: #fff; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); gap: 8px; }
.image-tools { display: flex; align-items: center; gap: 5px; }
.image-tools .icon-button { width: 28px; height: 28px; font-size: 16px; }
.image-tools .icon-button svg { width: 15px; height: 15px; }
.zoom-value { width: 42px; text-align: center; color: var(--text); }
.image-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-text { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #f7f9f6; font-size: 15px; color: var(--text); max-height: 500px; overflow: auto; line-height: 1.8; }
.evidence-note { padding: 12px 14px; background: #f7f9f6; border: 1px solid var(--line); border-radius: 7px; margin-top: 10px; }
.evidence-note:first-child { margin-top: 0; }
.evidence-note-header { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.evidence-note-header svg { width: 14px; height: 14px; }
.evidence-note p { font-size: 16px; line-height: 1.8; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.resource-placeholder { padding: 18px; text-align: center; font-size: 14px; color: var(--muted); }
.task-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.task-nav .button { min-height: 36px; font-size: 14px; }
.form-content { padding: 12px 14px; }
.instructions { font-size: 14px; line-height: 1.65; color: var(--text); background: #f0f5ef; border-radius: 6px; padding: 9px 10px; margin-bottom: 13px; }
.field { margin-bottom: 12px; }
.field-label { font-size: 15px; font-weight: 650; color: var(--ink); display: flex; align-items: center; gap: 4px; margin-bottom: 5px; }
.field-label .required { color: var(--danger); }
.field-description { font-size: 13px; line-height: 1.6; color: var(--muted); margin-bottom: 6px; }
.choice-list { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-chip { border: 1px solid var(--control-line); border-radius: 6px; padding: 6px 12px; min-width: 65px; min-height: 38px; background: #fff; color: var(--text); display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 15px; position: relative; }
.choice-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-chip:has(input:checked) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.choice-chip:has(input:disabled) { cursor: default; }
.choice-dot { border: 1px solid var(--control-line); border-radius: 50%; width: 13px; height: 13px; display: inline-block; flex-shrink: 0; }
.choice-chip:has(input:checked) .choice-dot { border: 4px solid var(--accent); background: #fff; }
.field .text-input, .field .text-area { font-size: 16px; color: var(--ink); }
.field .text-area.code { font-size: 14px; }
.field .text-input:disabled, .field .text-area:disabled { background: #f1f4ef; color: var(--text); opacity: 1; }
.field-error { font-size: 13px; line-height: 1.6; color: var(--danger); margin-top: 5px; white-space: pre-line; }
.field-error:empty { display: none; }
.field-invalid input, .field-invalid textarea { border-color: var(--danger); }
.field-topline { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.field-topline .link-button { font-size: 13px; margin-bottom: 5px; }
.decision-section { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 1px; }
.decision-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.decision-button { border: 1px solid var(--control-line); border-radius: 6px; background: #fff; color: var(--text); font-size: 14px; display: flex; align-items: center; gap: 7px; justify-content: flex-start; padding: 6px 9px; min-height: 38px; }
.decision-button svg { width: 15px; height: 15px; }
.decision-button.selected { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.decision-button[data-decision="reject"].selected { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.decision-button[data-decision="uncertain"].selected { color: var(--warn); border-color: var(--warn); background: var(--warm); }
.decision-description { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.notes-field { margin-top: 11px; margin-bottom: 0; }
.notes-field textarea { min-height: 64px; }
.form-footer { border-top: 1px solid var(--line); padding: 10px 14px; background: #f7faf6; flex-shrink: 0; }
.save-status { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; min-height: 20px; margin-bottom: 6px; flex-wrap: wrap; }
.save-status svg { width: 14px; height: 14px; }
.save-status.error { color: var(--danger); }
.save-status .link-button { font-size: 13px; margin-left: auto; }
.submit-button { width: 100%; justify-content: space-between; font-size: 15px; min-height: 40px; padding: 7px 12px; }
.shortcut { font-size: 12px; font-weight: 400; display: flex; gap: 3px; }
.submit-hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 5px; }
.submitted-notice { padding: 10px 12px; background: var(--accent-soft); border: 1px solid #bbd1bf; border-radius: 7px; margin-bottom: 12px; color: var(--text); font-size: 13px; display: flex; align-items: flex-start; gap: 8px; }
.submitted-notice svg { margin-top: 3px; width: 16px; height: 16px; }
.submitted-notice strong { display: block; color: var(--accent); font-size: 14px; font-weight: 650; margin-bottom: 2px; }
.form-errors { padding: 10px; margin-bottom: 12px; border-radius: 6px; background: var(--danger-soft); font-size: 14px; color: var(--danger); white-space: pre-wrap; overflow-wrap: anywhere; }
.identity-required { padding: 12px; background: var(--accent-soft); border: 1px dashed var(--control-line); border-radius: 7px; color: var(--text); font-size: 14px; line-height: 1.65; margin-bottom: 12px; }
.identity-required .button { margin-top: 8px; }
.suggestion { background: var(--warm); border: 1px solid #ddc69e; border-radius: 7px; padding: 11px; color: var(--warn); margin-bottom: 13px; font-size: 14px; }
.suggestion h4 { color: var(--warn); font-size: 14px; margin-bottom: 6px; }
.suggestion p { font-size: 13px; margin-top: 6px; }
.structured-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.structured-list > li { padding: 9px 11px; background: #f2f6ef; border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.list-item-number { font-size: 12px; color: var(--muted); display: block; margin-bottom: 3px; }
.structured-object { margin: 0; display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 5px 12px; font-size: 14px; overflow-wrap: anywhere; }
.structured-object dt { color: var(--muted); }
.structured-object dd { margin: 0; min-width: 0; }
.mobile-task-toggle { display: none; }
.workspace-error { margin-top: 16px; }
.no-project-message { max-width: 700px; margin: 45px auto; padding: 0 24px; }

/* Checks and pending decisions use the same text and control scale. */
.checks-page { max-width: 1360px; margin: auto; }
.checks-topbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 14px; }
.checks-topbar p { font-size: 14px; color: var(--muted); max-width: 760px; margin-top: 4px; }
.check-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.check-summary .stat-card { padding: 11px 16px; }
.check-summary .stat-value { font-size: 25px; }
.checks-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.check-row { padding: 11px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.check-row:last-child { border-bottom: 0; }
.check-symbol { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.check-symbol svg { width: 15px; height: 15px; }
.check-symbol.warning { background: var(--warm); color: var(--warn); }
.check-symbol.error { background: var(--danger-soft); color: var(--danger); }
.check-row h4 { font-size: 15px; color: var(--ink); margin-bottom: 2px; }
.check-row p { color: var(--muted); font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.check-row .badge { margin-left: auto; }
.issue-list { padding: 3px 14px; }
.issue { padding: 10px 0; border-bottom: 1px solid var(--line); }
.issue:last-child { border-bottom: 0; }
.issue-message { font-size: 14px; color: var(--text); line-height: 1.65; margin-top: 5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.issue .link-button { font-size: 13px; margin-top: 5px; }
.distribution { padding: 12px 14px; }
.distribution-row { margin-bottom: 11px; }
.distribution-row:last-child { margin-bottom: 0; }
.distribution-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.check-footer { margin-top: 12px; color: var(--muted); font-size: 13px; }
.decisions-area { max-width: 1000px; margin: 12px auto; }
.decision-card { padding: 18px; margin-bottom: 13px; }
.decision-card h3 { font-size: 18px; margin: 8px 0; }
.decision-card p { font-size: 15px; color: var(--muted); margin-bottom: 12px; }
.decision-card .select-input { margin-bottom: 10px; }
.decision-card .text-area { margin-bottom: 12px; }
.decision-saved { font-size: 14px; color: var(--accent); padding: 10px; background: var(--accent-soft); border-radius: 7px; }

/* Dialogs and feedback. */
.auth-page { max-width: 480px; margin: 8vh auto; padding: 0 16px; }
.auth-card { padding: 26px; }
.auth-form > .muted { margin: 10px 0 22px; font-size: 14px; }
.auth-form > .button { width: 100%; margin-top: 14px; }
.auth-form h2 { font-size: 24px; }
.auth-form .text-input { font-size: 16px; }
dialog { border: 1px solid var(--line); padding: 0; color: var(--text); background: #fff; border-radius: 12px; box-shadow: 0 20px 80px #203a3038; }
dialog::backdrop { background: #233a2d66; backdrop-filter: blur(3px); }
.identity-dialog { width: 440px; max-width: calc(100vw - 32px); padding: 24px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.identity-dialog h2 { font-size: 24px; }
.identity-dialog p.muted { font-size: 15px; line-height: 1.7; margin: 10px 0 18px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.image-dialog { max-width: 94vw; max-height: 92vh; background: var(--bg); border-radius: 10px; padding: 20px; overflow: auto; }
.image-dialog img { max-width: 85vw; max-height: 83vh; display: block; object-fit: contain; }
.image-close { position: fixed; right: 4vw; top: 3vh; color: #fff; border: 1px solid #fff; background: #314d40; border-radius: 50%; font-size: 23px; width: 38px; height: 38px; z-index: 2; }
.toast-region { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 9px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { background: #294e3d; color: #fff; border-radius: 8px; padding: 11px 16px; box-shadow: 0 6px 24px #344e3c30; font-size: 14px; display: flex; align-items: center; gap: 9px; animation: toast-in .18s ease-out; max-width: 620px; }
.toast.error { background: #8a352c; }
.toast svg { width: 17px; height: 17px; }
.noscript { padding: 30px; text-align: center; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* PC: reserve a stable action footer; long forms/materials scroll in their own pane. */
@media (min-width: 1101px) and (min-height: 600px) {
  .workspace { height: calc(100dvh - 56px); display: flex; flex-direction: column; }
  .project-heading-left { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); align-items: center; column-gap: 14px; }
  .breadcrumb { grid-column: 1 / -1; }
  .project-title-row { min-width: 0; }
  .project-title-row h1 { overflow-wrap: anywhere; }
  .project-description-inline { margin-top: 0; }
  .project-heading, .workspace-toolbar { flex-shrink: 0; }
  #workspace-content { flex: 1; min-height: 0; overflow: auto; }
  .annotation-grid { height: 100%; min-height: 0; }
  .task-panel, .form-panel { display: flex; flex-direction: column; max-height: 100%; min-height: 0; }
  .task-list { max-height: none; min-height: 0; }
  .task-center { display: flex; flex-direction: column; height: 100%; max-height: 100%; overflow-y: auto; scrollbar-gutter: stable; padding-bottom: 2px; }
  .task-center > * { flex-shrink: 0; }
  .task-center:has(.image-viewport) .evidence-panel { flex: 1; min-height: 190px; display: flex; flex-direction: column; }
  .task-center:has(.image-viewport) .evidence-body { flex: 1; min-height: 0; overflow-y: auto; }
  .evidence-body:has(.image-viewport):not(:has(.evidence-note)) { display: flex; flex-direction: column; }
  .evidence-body:has(.image-viewport):not(:has(.evidence-note)) .asset-tabs { flex-shrink: 0; }
  .evidence-body:has(.image-viewport):not(:has(.evidence-note)) .media-content { flex: 1; min-height: 0; }
  .evidence-body:has(.image-viewport):not(:has(.evidence-note)) .image-frame { height: 100%; display: flex; flex-direction: column; }
  .evidence-body:has(.image-viewport):not(:has(.evidence-note)) .image-viewport { height: auto; flex: 1; min-height: 0; }
  .image-controls { flex-shrink: 0; }
  .form-content { overflow-y: auto; min-height: 0; scrollbar-gutter: stable; }
}
@media (min-width: 1600px) {
  .annotation-grid { grid-template-columns: 260px minmax(0, 1fr) 400px; gap: 16px; }
  .workspace { padding-left: 24px; padding-right: 24px; }
  .home { padding-left: 32px; padding-right: 32px; }
}
@media (max-width: 1220px) and (min-width: 1101px) {
  .annotation-grid { grid-template-columns: 212px minmax(0, 1fr) 336px; gap: 10px; }
  .workspace { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 1100px) {
  .annotation-grid { grid-template-columns: 210px minmax(0, 1fr); }
  .task-center { grid-column: 2; }
  .form-panel { grid-column: 2; }
  .task-panel { grid-column: 1; grid-row: 1 / 3; position: sticky; top: 68px; }
  .task-list { max-height: calc(100dvh - 340px); }
  .form-content { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; padding: 16px; }
  .form-content > .instructions, .form-content > .identity-required, .form-content > .submitted-notice,
  .form-content > .form-errors, .form-content > .suggestion, .form-content > .decision-section,
  .form-content > .notes-field { grid-column: 1 / -1; }
  .form-footer { display: grid; grid-template-columns: 1fr auto; gap: 0 16px; align-items: center; }
  .form-footer .save-status { margin: 0; }
  .form-footer .submit-hint { grid-column: 1 / -1; text-align: right; }
  .submit-button { min-width: 210px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-row { gap: 10px; }
  .stat-card { padding: 12px 14px; }
  .stat-icon { display: none; }
  .checks-grid { grid-template-columns: 1fr; }
  .project-description-inline { display: none; }
  .hero-aside { max-width: 230px; }
  .image-viewport { height: 320px; }
  .connection { display: none; }
}
@media (max-width: 720px) {
  .app-header { height: 56px; padding: 0 14px; }
  .brand-word { font-size: 19px; }
  .brand-caption, .brand-divider { display: none; }
  .identity-button { font-size: 13px; gap: 7px; max-width: 150px; }
  .identity-button > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .home { padding: 20px 14px 28px; }
  .home-hero { margin-bottom: 16px; }
  .hero-aside { display: none; }
  h1 { font-size: 25px; }
  .hero-title p { font-size: 14px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
  .stat-card { padding: 12px 14px; }
  .stat-icon { display: grid; width: 30px; height: 30px; }
  .stat-value { font-size: 26px; }
  .stat-label { font-size: 13px; }
  .project-grid { grid-template-columns: 1fr; gap: 12px; }
  .project-card { min-height: 210px; padding: 16px; }
  .section-toolbar { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .section-toolbar > .toolbar-actions { width: 100%; }
  .section-toolbar .search-box { width: auto; flex: 1; }
  .identity-hint { font-size: 13px; align-items: flex-start; flex-wrap: wrap; }
  .identity-hint .link-button { white-space: nowrap; font-size: 13px; }
  .page-footer { font-size: 12px; display: block; }
  .page-footer > span + span { display: block; margin-top: 5px; }
  .workspace { padding: 12px; }
  .project-heading { align-items: flex-start; margin-bottom: 10px; gap: 10px; }
  .project-title-row { flex-wrap: wrap; gap: 6px; }
  .project-title-row h1 { font-size: 21px; }
  .project-heading .toolbar-actions { gap: 6px; }
  .project-heading .toolbar-actions .button { padding: 6px 9px; min-height: 36px; }
  .project-heading .toolbar-actions .button span { display: none; }
  .breadcrumb { font-size: 12px; margin-bottom: 4px; }
  .workspace-toolbar { gap: 8px; margin-bottom: 10px; }
  .tabs { gap: 18px; }
  .tab { font-size: 14px; padding-bottom: 8px; }
  .progress-summary { font-size: 12px; padding-bottom: 8px; gap: 6px; }
  .progress-summary .progress-track { display: none; }
  .annotation-grid { display: block; }
  .mobile-task-toggle { display: flex; margin-bottom: 10px; justify-content: space-between; align-items: center; width: 100%; padding: 8px 10px; background: var(--accent-soft); border: 1px solid var(--control-line); font-size: 14px; color: var(--accent); border-radius: 7px; }
  .mobile-task-toggle svg { width: 16px; height: 16px; }
  .task-panel { display: none; position: static; margin-bottom: 12px; }
  .task-panel.mobile-open { display: block; }
  .task-list { max-height: 300px; }
  .task-panel-footer { display: none; }
  .task-filters { grid-template-columns: 1fr; }
  .task-center { margin-bottom: 12px; }
  .task-card { padding: 13px 14px; }
  .task-content-field > p { font-size: 18px; }
  .image-viewport { height: 260px; }
  .image-controls { flex-wrap: wrap; }
  .image-tools { margin-left: auto; }
  .evidence-body { padding: 10px; }
  .form-panel { margin-bottom: 12px; }
  .form-content { display: block; padding: 14px; }
  .form-footer { display: block; }
  .form-footer .save-status { margin-bottom: 6px; }
  .form-footer .submit-hint { text-align: center; }
  .submit-button { min-width: 0; }
  .task-nav { font-size: 12px; flex-wrap: wrap; }
  .task-nav > span { order: 3; flex-basis: 100%; text-align: center; }
  .checks-topbar { align-items: flex-start; }
  .checks-topbar h2 { font-size: 19px; }
  .checks-topbar p { font-size: 13px; }
  .checks-topbar .button { font-size: 13px; padding: 7px 9px; }
  .check-summary { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .check-summary .stat-card { padding: 12px; }
  .check-row { padding: 11px; }
  .check-row .badge { font-size: 12px; }
  .decision-card { padding: 15px; }
  .toast-region { bottom: 14px; }
  input.text-input, select.select-input, textarea.text-area, .field .text-area.code, .task-filters .text-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
