:root {
  color-scheme: light;
  --bg: #eef3f5;
  --panel: #ffffff;
  --panel-soft: #f7fafb;
  --text: #111827;
  --muted: #65748b;
  --line: #d6e0e7;
  --line-soft: #e6edf2;
  --brand: #0f5f67;
  --brand-strong: #0b3442;
  --brand-soft: #e2f4f2;
  --accent: #2e5bd6;
  --accent-soft: #eef2ff;
  --review: #fff8e7;
  --danger: #fff1f2;
  --ok: #e8f7ef;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
  --shadow-soft: 0 6px 20px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f9fbfc 0, var(--bg) 360px);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 20px;
  width: min(1320px, calc(100% - 32px));
  margin: 20px auto 0;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  color: var(--text);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-strong);
  border: 1px solid var(--brand-strong);
  color: #e4fbf5;
  font-size: 15px;
  font-weight: 900;
}

.topbar h1 {
  margin: 2px 0 4px;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0;
}

.topbar .eyebrow {
  color: var(--brand);
}

.date,
.panel-meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.topbar .date {
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
}

.tab-button {
  min-height: 38px;
  padding: 7px 14px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.tab-button.active {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
  box-shadow: none;
}

.tab-button:hover {
  border-color: var(--line);
  background: #fff;
  color: var(--brand-strong);
}

.tab-button.active:hover {
  color: #fff;
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

.tab-button.subtle {
  color: var(--muted);
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 13px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-soft);
}

input,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 95, 103, 0.12);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.assistant-question-list {
  display: grid;
  gap: 12px;
}

.assistant-question {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.assistant-question.is-processing {
  background: #f6f9ff;
  border-color: #bfd0ee;
}

.assistant-question label {
  display: grid;
  gap: 4px;
}

.assistant-question label span {
  color: var(--muted);
  font-size: 13px;
}

.assistant-question label .assistant-question-context {
  color: var(--text);
}

.assistant-question label .assistant-question-privacy {
  color: #9a3412;
  font-weight: 600;
}

.assistant-question-retention {
  color: #64748b;
  font-size: 0.82rem;
  margin: 3px 0 0;
}

.assistant-question-answer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.assistant-question-quick-answers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.assistant-question-quick-answers button {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #fdba74;
  border-radius: 999px;
  background: #fff;
  color: #9a3412;
  font: inherit;
  cursor: pointer;
}

.assistant-question-quick-answers button:hover {
  background: #ffedd5;
}

.assistant-question-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 560px) {
  .assistant-question-answer {
    grid-template-columns: 1fr;
  }
}

#process-button {
  background: var(--brand-strong);
  color: #fff;
  border-color: var(--brand-strong);
}

.top-actions button:not(#process-button) {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

main {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 44px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tab-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tab-page[hidden] {
  display: none;
}

.overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.overview[hidden] {
  display: none;
}

.assistant-status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.assistant-status-strip[hidden] {
  display: none;
}

.assistant-status-item {
  min-height: 74px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.assistant-status-item span,
.assistant-status-item small {
  color: var(--muted);
  font-size: 12px;
}

.assistant-status-item strong {
  font-size: 17px;
  line-height: 1.2;
}

.assistant-status-item.tone-ready {
  border-left: 4px solid #35a36b;
}

.assistant-status-item.tone-checking {
  border-left: 4px solid #7aa2e3;
  background: #f6f9ff;
}

.assistant-status-item.tone-attention {
  border-left: 4px solid #d99a25;
  background: #fff8e6;
}

.stat-card,
.panel,
.source-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.stat-card {
  padding: 12px 14px;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 4px solid var(--brand-soft);
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin: 4px 0;
  font-size: 26px;
  line-height: 1;
}

.stat-card.tone-high {
  border-left-color: #d99a25;
  background: #fff8e6;
}

.stat-card.tone-medium {
  border-left-color: var(--accent);
  background: #f6f9ff;
}

.stat-card.tone-quiet {
  border-left-color: #cbd5e1;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.85fr);
  gap: 16px;
}

.today-focus-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  padding: 18px 20px;
}

.primary-panel,
.review-panel {
  min-height: 280px;
}

.full-panel,
.detail-panel {
  width: 100%;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.panel h2 {
  margin: 2px 0 0;
  font-size: 20px;
  letter-spacing: 0;
}

.briefing-panel {
  display: grid;
  gap: 16px;
  background: #ffffff;
  border-color: #c7d8de;
  border-left: 6px solid var(--brand);
  box-shadow: var(--shadow-soft);
}

.briefing-headline {
  max-width: 980px;
  font-size: 26px;
  line-height: 1.22;
  font-weight: 900;
  letter-spacing: 0;
}

.briefing-body {
  display: grid;
  gap: 12px;
}

.briefing-body p {
  margin: 0;
  color: #344054;
}

.briefing-section {
  display: grid;
  gap: 8px;
}

.briefing-section h3 {
  margin: 0;
  font-size: 14px;
  color: var(--brand-strong);
}

.briefing-section > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.briefing-item,
.briefing-action {
  text-align: left;
}

.briefing-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  background: #fff;
  border-color: var(--line-soft);
}

.briefing-item:hover,
.focus-row:hover,
.recommendation-row:hover,
.event-row:hover,
.review-row:hover,
.task-row:hover,
.issue-row:hover,
.queue-row:hover {
  border-color: #b9c8d3;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.briefing-item.priority-high,
.briefing-action.priority-high {
  border-color: #e2a22d;
  background: #fff8e6;
}

.briefing-item.priority-medium,
.briefing-action.priority-medium {
  border-color: #8fb7ff;
  background: #f0f6ff;
}

.briefing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.briefing-action {
  display: inline-flex;
  align-items: center;
  min-width: 132px;
  justify-content: center;
  background: #fff;
}

.stale-task-panel {
  margin-top: 18px;
  background: #fffdf7;
  border-color: #ecd7a1;
}

.stale-task-panel .task-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.work-summary-panel {
  margin-bottom: 18px;
}

.work-classification-panel {
  margin-bottom: 18px;
}

.work-tree-panel {
  margin-bottom: 18px;
}

.work-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 18px;
  padding-top: 12px;
}

.work-section {
  display: grid;
  gap: 8px;
  align-content: start;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.work-section header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.work-section header strong {
  font-size: 15px;
}

.work-section-funnel {
  grid-column: 1 / -1;
}

.work-section-bundles {
  grid-column: 1 / -1;
}

.work-bundle-group {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.work-bundle-group header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.work-bundle-group header strong {
  font-size: 14px;
}

.work-bundle-more {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #64748b);
}

.work-tree {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.work-tree-list,
.work-tree-case-body,
.work-tree-branches,
.work-tree-branch-body,
.work-tree-node-children {
  display: grid;
  gap: 8px;
}

.work-tree-list {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.work-tree-case {
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: #fff;
  overflow: hidden;
}

.work-tree-case:last-child {
  border-bottom: 0;
}

.work-tree-case[open] {
  background: #fbfdff;
}

.work-tree-case:not([open]):hover {
  background: #fbfdff;
}

.work-tree-case-summary {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto 16px;
  gap: 9px;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.work-tree-root-dot {
  position: relative;
  width: 10px;
  height: 10px;
  justify-self: center;
  border-radius: 50%;
  background: var(--brand-strong);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.work-tree-root-dot::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  width: 2px;
  height: 42px;
  background: var(--line-soft);
}

.work-tree-case:not([open]) .work-tree-root-dot::after,
.work-tree-case:last-child .work-tree-root-dot::after {
  display: none;
}

.work-tree-case-summary::after {
  content: "";
  justify-self: center;
  width: 8px;
  height: 8px;
  border-right: 2px solid #718096;
  border-bottom: 2px solid #718096;
  transform: rotate(-45deg);
  transition: transform 0.16s ease;
}

.work-tree-case[open] .work-tree-case-summary::after {
  transform: rotate(45deg);
}

.work-tree-case-summary::-webkit-details-marker,
.work-tree-branch summary::-webkit-details-marker {
  display: none;
}

.work-case-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.work-case-kicker {
  width: fit-content;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.work-case-main strong {
  font-size: 15px;
  line-height: 1.3;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.work-case-main small,
.work-tree-node-main span,
.work-tree-action .main span,
.work-tree-more {
  color: var(--muted);
  line-height: 1.45;
}

.work-case-main small,
.work-tree-node-main span,
.work-tree-action .main span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work-case-main small {
  -webkit-line-clamp: 1;
}

.work-tree-node-main span,
.work-tree-action .main span {
  -webkit-line-clamp: 1;
}

.work-case-meta {
  align-self: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef5f8;
  color: #315366;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.work-tree-case-body {
  margin-left: 21px;
  padding: 0 12px 12px 16px;
  border-top: 1px solid var(--line-soft);
  border-left: 2px solid var(--line-soft);
  background: #fbfdff;
}

.work-tree-next {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.work-tree-next h4 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0;
}

.work-tree-next ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  list-style: none;
}

.work-tree-action {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
}

.work-tree-action:last-child {
  border-bottom: 0;
}

.work-tree-action.no-evidence {
  grid-template-columns: 16px minmax(0, 1fr);
}

.work-action-mark {
  width: 9px;
  height: 9px;
  justify-self: center;
  border: 2px solid #8aa3af;
  border-radius: 50%;
  background: #fff;
}

.work-tree-action .main strong,
.work-tree-node-main strong {
  word-break: keep-all;
  overflow-wrap: break-word;
}

.work-tree-action .classification-evidence {
  width: auto;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel-soft);
  white-space: nowrap;
}

.work-tree-action .classification-evidence span {
  display: none;
}

.work-tree-action .evidence-locator-meta,
.work-tree-evidence .evidence-locator-meta,
.work-tree-node > .work-node-evidence .evidence-locator-meta {
  display: none;
}

.work-tree-more {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.work-tree-branch {
  border-top: 1px solid var(--line-soft);
}

.work-tree-branch summary {
  min-height: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.work-tree-branch summary b {
  min-width: 26px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #273f9f;
  font-size: 12px;
}

.work-tree-branch-body {
  padding: 0 0 8px 10px;
  border-left: 2px solid var(--line-soft);
}

.work-tree-node {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 8px 0;
}

.work-tree-rail {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.work-tree-node-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.work-tree-node-kind {
  align-self: start;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef2ff;
  color: #273f9f;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.work-tree-node > .work-node-evidence,
.work-tree-node-children {
  grid-column: 2 / -1;
}

.work-node-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.work-node-evidence .classification-evidence {
  width: min(100%, 520px);
}

.classification-list {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.classification-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-left: 5px solid #cbd5e1;
  border-radius: 8px;
  background: var(--panel-soft);
}

.classification-row.classification-active_work {
  border-left-color: var(--brand);
  background: #f3fbf8;
}

.classification-row.classification-calendar_event {
  border-left-color: #2563eb;
  background: #eff6ff;
}

.classification-row.classification-personal_task {
  border-left-color: #7c3aed;
  background: #f5f3ff;
}

.classification-row.classification-needs_context {
  border-left-color: #d99a25;
  background: #fff8e6;
}

.classification-row.classification-reference_context {
  border-left-color: var(--accent);
  background: #f6f9ff;
}

.classification-row.classification-not_work {
  border-left-color: #94a3b8;
}

.classification-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.classification-path {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: stretch;
}

.classification-path.compact {
  color: var(--muted);
  font-size: 13px;
}

.classification-step {
  min-width: min(100%, 150px);
  max-width: 240px;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.classification-step b {
  color: var(--brand);
  font-size: 12px;
}

.classification-step span {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.classification-step small {
  color: var(--muted);
  font-size: 12px;
}

.classification-evidence {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  text-align: left;
  margin: 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--line-soft);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.classification-evidence:hover:not(:disabled) {
  color: var(--brand);
}

.classification-evidence b {
  color: var(--text);
}

.classification-evidence span {
  min-width: 0;
}

.classification-evidence .evidence-locator-meta {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.work-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 10px 0;
  border-top: 1px solid #edf0f5;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 12px;
}

.event-row,
.focus-row,
.review-row,
.task-row,
.issue-row,
.recommendation-row,
.queue-row {
  width: 100%;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  text-align: left;
  box-shadow: none;
}

.event-row strong,
.focus-row strong,
.review-row strong,
.task-row strong,
.issue-row strong,
.recommendation-row strong,
.queue-row strong {
  font-size: 15px;
}

.recommendation-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.focus-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.focus-row .time {
  display: block;
  margin-bottom: 2px;
}

.queue-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.recommendation-row.priority-high {
  background: #fff6df;
  border-color: #f4c96b;
  border-left: 5px solid #d99a25;
}

.recommendation-row.priority-medium {
  background: #eff6ff;
  border-color: #bfdbfe;
  border-left: 5px solid var(--accent);
}

.event-row.needs-review,
.review-row,
.proposal-row {
  background: var(--review);
}

.review-row.danger {
  background: var(--danger);
}

.queue-row.danger {
  background: var(--danger);
  border-color: #f3b5b5;
}

.queue-row.attention {
  background: var(--review);
  border-color: #f4c96b;
}

.review-row.muted {
  background: var(--panel-soft);
}

.queue-row.muted {
  background: var(--panel-soft);
}

.time {
  color: var(--brand);
  font-weight: 800;
  font-size: 13px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.main strong,
.review-row strong,
.source-card strong {
  overflow-wrap: anywhere;
}

.main span,
.review-row span {
  color: var(--muted);
  font-size: 13px;
}

.main span,
.review-row > span:not(.badges),
.source-card p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.badges em,
.source-head em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: #273f9f;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.task-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  cursor: pointer;
}

.task-row.completed {
  grid-template-columns: minmax(0, 1fr) auto;
  cursor: default;
  background: #f1f8f4;
  border-color: #c8e2d0;
}

.event-create-form,
.task-create-form {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 12px 0 2px;
  border-top: 1px solid var(--line-soft);
  margin-top: 8px;
}

.event-create-form {
  grid-template-columns: minmax(180px, 1.3fr) minmax(170px, 0.75fr) minmax(170px, 0.75fr) minmax(170px, 0.75fr) auto minmax(150px, 0.8fr) auto;
}

.task-create-form {
  grid-template-columns: minmax(170px, 1.2fr) minmax(130px, 0.55fr) minmax(92px, 0.4fr) minmax(92px, 0.4fr) minmax(130px, 0.55fr) minmax(160px, 0.7fr) minmax(120px, 0.55fr) minmax(150px, 0.8fr) auto;
}

.event-create-form button,
.task-create-form button {
  white-space: nowrap;
}

.inline-check {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.task-actions select {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.issue-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.issue-row .people-chips {
  margin-top: 6px;
}

.people-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #ecfdf5;
  color: #05603a;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.person-chip.strength-medium {
  background: #eff6ff;
  color: #1d4ed8;
}

.person-chip.strength-low {
  background: #f8fafc;
  color: #475569;
}

.person-chip small {
  color: #4b7665;
  font-size: 11px;
  font-weight: 700;
}

.person-chip.strength-medium small,
.person-chip.strength-low small {
  color: inherit;
  opacity: 0.75;
}

.detail-related {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
}

.detail-related > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.task-row input {
  width: 18px;
  height: 18px;
}

.task-actions {
  justify-content: flex-end;
}

.task-actions button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
}

.source-card {
  padding: 12px;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

button.source-card:hover {
  border-color: var(--brand);
  background: #f7fffd;
}

.source-head,
.source-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.source-card p {
  margin: 0;
  color: #344054;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.source-card footer {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
}

.source-text {
  margin: 12px 0 0;
  padding: 14px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0f172a;
  color: #edf7ff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.source-text mark {
  padding: 1px 2px;
  background: #fde68a;
  color: #111827;
}

.selected-evidence {
  border-color: #f4c96b;
  background: #fff8e6;
}

.collector-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
}

.status-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
}

.runtime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  padding-top: 12px;
}

.runtime-card {
  min-height: 104px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  border-left: 5px solid #16a34a;
}

.runtime-card.attention {
  border-left-color: #d99a25;
  background: #fff8e6;
}

.runtime-card strong,
.runtime-card span {
  display: block;
}

.runtime-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.runtime-card-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-end;
}

.runtime-card-actions button {
  min-height: 32px;
  padding: 5px 10px;
  white-space: nowrap;
}

.status-card.attention {
  background: #fffbeb;
  border-color: #f4c96b;
  border-left: 5px solid #d99a25;
}

.status-card p {
  margin: 0;
  color: var(--muted);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.status-grid span,
.feedback-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.status-grid b,
.feedback-row span {
  color: var(--muted);
}

.collector-card.attention {
  background: #fffbeb;
  border-color: #f4c96b;
}

.collector-head,
.collector-metrics,
.detail-actions,
.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.collector-head span,
.collector-metrics span,
.detail-note {
  color: var(--muted);
  font-size: 13px;
}

.collector-card p,
.detail-note {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-actions {
  justify-content: flex-start;
}

.correction-controls {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.correction-actions,
.correction-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.correction-form input,
.correction-form select {
  min-width: 160px;
  flex: 1 1 160px;
}

.detail-actions button:first-child,
.detail-actions .primary-action {
  background: var(--brand-strong);
  color: #fff;
  border-color: var(--brand-strong);
}

.proposal-editor + .detail-actions button:first-child {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.proposal-editor + .detail-actions .primary-action {
  background: var(--brand-strong);
  color: #fff;
  border-color: var(--brand-strong);
}

.proposal-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.proposal-editor label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.proposal-editor input,
.proposal-editor select,
.proposal-editor textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--panel-soft);
  color: var(--text);
}

.proposal-editor textarea {
  resize: vertical;
}

.proposal-editor .wide-field {
  grid-column: 1 / -1;
}

.proposal-editor .check-field {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding-top: 22px;
}

.proposal-editor .check-field input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
}

.detail-summary span,
.evidence-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px 12px;
}

.evidence-item p {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.evidence-full {
  margin-top: 8px;
}

.evidence-full summary {
  color: var(--brand);
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
}

.empty {
  margin: 0;
  padding: 18px 12px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #121826;
  color: #fff;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.22);
}

.toast[hidden] {
  display: none;
}

.toast button {
  min-height: 30px;
  padding: 4px 8px;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 14px;
  }

  .overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assistant-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workbench,
  .today-focus-grid {
    grid-template-columns: 1fr;
  }

  .source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-create-form,
  .task-create-form {
    grid-template-columns: minmax(0, 1fr) minmax(132px, 0.7fr);
  }
}

@media (max-width: 640px) {
  .topbar {
    width: calc(100% - 24px);
    margin-top: 12px;
    padding: 16px;
    align-items: stretch;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .topbar h1 {
    font-size: 28px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .top-actions button {
    min-width: 0;
    padding: 8px 10px;
  }

  .assistant-status-strip {
    gap: 6px;
  }

  .assistant-status-item {
    min-height: 66px;
    padding: 9px 10px;
  }

  .assistant-status-item strong {
    font-size: 15px;
  }

  body[data-active-tab="work_tree"] .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    width: calc(100% - 16px);
    margin-top: 8px;
    padding: 8px 10px;
    gap: 8px;
    align-items: center;
  }

  body[data-active-tab="work_tree"] .brand-block {
    gap: 8px;
    min-width: 0;
  }

  body[data-active-tab="work_tree"] .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 12px;
  }

  body[data-active-tab="work_tree"] .topbar h1 {
    margin: 0;
    font-size: 19px;
    line-height: 1.1;
    white-space: nowrap;
  }

  body[data-active-tab="work_tree"] .topbar .eyebrow,
  body[data-active-tab="work_tree"] .topbar .date {
    display: none;
  }

  body[data-active-tab="work_tree"] .top-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
  }

  body[data-active-tab="work_tree"] .top-actions button {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  main {
    width: calc(100% - 24px);
    padding-bottom: 136px;
  }

  .tabbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
  }

  .tab-button {
    min-width: 0;
    min-height: 40px;
    padding: 5px 3px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.15;
    white-space: normal;
    word-break: keep-all;
    overflow: hidden;
  }

  .tab-button.active,
  .tab-button.active:hover {
    background: var(--brand-strong);
    color: #fff;
    border-color: var(--brand-strong);
  }

  .tab-button:hover {
    background: var(--panel-soft);
    color: var(--brand-strong);
    border-color: var(--line-soft);
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 116px;
    max-width: none;
  }

  .source-grid {
    grid-template-columns: 1fr;
  }

  body[data-active-tab="work_tree"] main {
    width: calc(100% - 16px);
    padding-top: 8px;
  }

  body[data-active-tab="work_tree"] .work-tree-panel {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-active-tab="work_tree"] .work-tree-panel .panel-header {
    padding: 0 2px 8px;
    border-bottom: 0;
    align-items: center;
  }

  body[data-active-tab="work_tree"] .work-tree-panel .eyebrow {
    display: none;
  }

  body[data-active-tab="work_tree"] .work-tree-panel .panel-header h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.1;
  }

  body[data-active-tab="work_tree"] .work-tree-panel .panel-meta {
    max-width: 55%;
    text-align: right;
    font-size: 12px;
    line-height: 1.25;
  }

  body[data-active-tab="work_tree"] .work-tree {
    gap: 6px;
    padding-top: 0;
  }

  body[data-active-tab="work_tree"] .work-tree-list {
    border-color: #d7e3ea;
  }

  body[data-active-tab="work_tree"] .work-tree-case-summary {
    grid-template-columns: 13px minmax(0, 1fr) auto 12px;
    gap: 7px;
    min-height: 44px;
    padding: 8px 9px;
  }

  body[data-active-tab="work_tree"] .work-tree-root-dot {
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 3px var(--brand-soft);
  }

  body[data-active-tab="work_tree"] .work-tree-root-dot::after {
    left: 3px;
    top: 10px;
    height: 36px;
  }

  body[data-active-tab="work_tree"] .work-case-kicker {
    display: none;
  }

  body[data-active-tab="work_tree"] .work-case-main strong {
    font-size: 14px;
    line-height: 1.28;
  }

  body[data-active-tab="work_tree"] .work-case-main small {
    font-size: 12px;
    line-height: 1.32;
  }

  body[data-active-tab="work_tree"] .work-case-meta {
    padding: 2px 6px;
    font-size: 11px;
  }

  body[data-active-tab="work_tree"] .work-tree-case-summary::after {
    width: 7px;
    height: 7px;
  }

  body[data-active-tab="work_tree"] .work-tree-case-body {
    margin-left: 15px;
    padding: 0 8px 9px 10px;
  }

  body[data-active-tab="work_tree"] .work-tree-next {
    gap: 6px;
    padding-top: 9px;
  }

  body[data-active-tab="work_tree"] .work-tree-next h4 {
    font-size: 12px;
  }

  body[data-active-tab="work_tree"] .work-tree-action {
    grid-template-columns: 11px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 7px 8px;
  }

  body[data-active-tab="work_tree"] .work-tree-action.no-evidence {
    grid-template-columns: 11px minmax(0, 1fr);
  }

  body[data-active-tab="work_tree"] .work-action-mark {
    width: 7px;
    height: 7px;
    border-width: 2px;
  }

  body[data-active-tab="work_tree"] .work-tree-action .main strong {
    font-size: 13px;
    line-height: 1.3;
  }

  body[data-active-tab="work_tree"] .work-tree-action .main span {
    font-size: 12px;
  }

  body[data-active-tab="work_tree"] .work-tree-action .classification-evidence {
    min-height: 24px;
    padding: 2px 7px;
    font-size: 12px;
  }

  .event-row,
  .focus-row,
  .review-row,
  .task-row,
  .issue-row,
  .recommendation-row,
  .queue-row,
  .classification-head {
    grid-template-columns: 1fr;
  }

  .work-case-meta {
    justify-self: end;
    width: fit-content;
  }

  .work-tree-action .classification-evidence {
    justify-self: end;
    width: fit-content;
  }

  .work-tree-node {
    grid-template-columns: 14px minmax(0, 1fr);
  }

  .work-tree-node-kind {
    grid-column: 2;
    width: fit-content;
  }

  .proposal-editor {
    grid-template-columns: 1fr;
  }

  .event-create-form,
  .task-create-form {
    grid-template-columns: 1fr;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .badges {
    justify-content: flex-start;
  }

  .task-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .overview {
    grid-template-columns: 1fr;
  }

  .assistant-status-strip {
    grid-template-columns: 1fr;
  }
}
