:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-soft: #edf3f1;
  --surface-warm: #f5f0ea;
  --surface-strong: #17201d;
  --ink: #17201d;
  --muted: #5d6a66;
  --line: #d8e1dd;
  --line-strong: #b9c7c2;
  --green: #247357;
  --green-soft: #dff0e8;
  --blue: #315f96;
  --blue-soft: #dfeaf6;
  --clay: #9a533f;
  --clay-soft: #f1e0da;
  --teal: #176c78;
  --teal-soft: #ddedf0;
  --gold: #8d6c13;
  --gold-soft: #f2e8c7;
  --danger: #a13f38;
  --danger-soft: #f5ddda;
  --shadow: 0 8px 18px rgba(23, 32, 29, 0.055);
  --shadow-strong: 0 16px 34px rgba(23, 32, 29, 0.11);
  --focus-ring: 0 0 0 3px rgba(49, 95, 150, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px 28px 32px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 112px;
  margin: 0 -28px;
  padding: 20px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 247, 246, 0.94);
  backdrop-filter: blur(16px);
}

.brand-block {
  min-width: 260px;
}

.eyebrow,
.section-kicker,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 6px 0 0;
  font-size: 2.35rem;
  line-height: 1.04;
  letter-spacing: 0;
}

.topbar-subtitle {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.35;
}

h2 {
  margin: 5px 0 0;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.today-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  max-width: 700px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.topbar-actions {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
  max-width: 820px;
}

.today-strip span,
.status-pill,
.count-badge,
.item-tag,
.icon-action {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.icon-action {
  cursor: pointer;
  border-color: var(--surface-strong);
  color: #fff;
  background: var(--surface-strong);
  text-decoration: none;
}

.refresh-action {
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: var(--radius);
  padding: 0 16px;
}

.refresh-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.refresh-action.is-loading .refresh-dot {
  animation: pulse-dot 850ms ease-in-out infinite;
}

.icon-action:hover {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.icon-action:active,
.view-chip:active,
.panel-action:active,
.item-action:active {
  transform: translateY(1px);
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.75);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

#refresh-event {
  color: var(--teal);
}

.icon-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  padding-top: 18px;
}

.view-switcher {
  position: sticky;
  top: 112px;
  z-index: 9;
  display: flex;
  gap: 6px;
  margin: 0 -28px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 247, 246, 0.92);
  backdrop-filter: blur(14px);
  overflow-x: auto;
}

.view-label {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.view-chip {
  min-width: 88px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.view-chip strong {
  min-width: 22px;
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.7rem;
}

.view-chip:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.view-chip.active {
  border-color: var(--blue);
  color: #ffffff;
  background: var(--blue);
}

.view-chip.active strong {
  color: var(--blue);
  background: #fff;
}

.panel {
  grid-column: span 4;
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-strong);
}

.today-panel {
  border-color: var(--line-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 1)),
    var(--surface);
}

.panel.is-hidden {
  display: none;
}

.panel.is-collapsed {
  min-height: 0;
}

.panel.is-collapsed > :not(.panel-heading) {
  display: none;
}

.panel-wide {
  grid-column: span 8;
}

.review-panel,
.chat-panel {
  grid-column: span 6;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.panel-heading .panel-actions {
  max-width: 100%;
}

.panel-heading > div:first-child {
  min-width: 0;
}

.panel-collapse {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.panel-collapse:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.status-pill.calm {
  border-color: #bad0c3;
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.suggestion {
  border-color: #e0cdbd;
  color: var(--clay);
  background: var(--clay-soft);
}

.status-pill.neutral {
  background: var(--surface-soft);
}

.status-pill.ok,
.item-tag.ok {
  border-color: #bad0c3;
  color: var(--green);
  background: var(--green-soft);
}

.count-badge {
  min-width: 34px;
  justify-content: center;
}

.count-badge.attention {
  border-color: #dcc3b8;
  color: var(--danger);
  background: var(--danger-soft);
}

.today-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(230px, 0.5fr);
  gap: 16px;
  align-items: stretch;
}

.lead-copy {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1.45;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.metric {
  min-height: 86px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.35rem;
  line-height: 1;
}

.command-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.command-signal {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 800;
}

.command-signal.ok {
  border-color: #bad0c3;
  color: var(--green);
  background: var(--green-soft);
}

.command-signal.review {
  border-color: #dcc3b8;
  color: var(--danger);
  background: var(--danger-soft);
}

.focus-box,
.summary-card {
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-warm);
}

.focus-box p:last-child,
.summary-card p {
  margin: 10px 0 0;
  color: var(--ink);
  line-height: 1.5;
}

.summary-card {
  display: grid;
  align-content: space-between;
  gap: 16px;
}

.summary-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.summary-stat strong {
  color: var(--ink);
}

.health-card {
  display: grid;
  gap: 14px;
}

.health-card > p {
  margin: 0;
  line-height: 1.5;
}

.health-metrics,
.health-dashboard-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

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

.health-snapshot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(230px, 0.75fr);
  gap: 10px;
}

.health-spark-card,
.memory-policy,
.brief-context {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.memory-policy {
  margin-bottom: 10px;
  background: var(--surface-warm);
}

.memory-policy strong {
  display: block;
  font-size: 0.92rem;
}

.memory-policy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.brief-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.brief-context span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.76rem;
  font-weight: 800;
}

.mini-bar-chart {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.mini-bar-chart > span,
.mini-chart-empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.mini-bar-chart > div {
  display: grid;
  grid-template-columns: repeat(7, minmax(8px, 1fr));
  align-items: end;
  gap: 5px;
  height: 50px;
}

.mini-bar-chart i {
  display: block;
  min-height: 4px;
  border-radius: 999px 999px 3px 3px;
  background: var(--teal);
}

.mini-bar-chart + .mini-bar-chart i {
  background: var(--gold);
}

.health-period-card {
  min-height: 178px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.health-period-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.health-period-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.health-period-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.health-period-metrics div {
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: var(--surface);
}

.health-period-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.health-period-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
  line-height: 1.05;
}

.health-metric {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-soft);
}

.health-metric span,
.health-metric small,
.health-nutrition dt,
.health-sources span,
.ai-context {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.health-metric strong {
  display: block;
  margin: 7px 0 4px;
  font-size: 1.35rem;
  line-height: 1;
}

.health-coverage,
.health-mini-grid {
  display: grid;
  gap: 10px;
}

.coverage-item,
.health-mini-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-soft);
}

.coverage-item span,
.health-mini-stat span,
.detail-date,
.health-note-list {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.coverage-item strong,
.health-mini-stat strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 1rem;
}

.coverage-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  margin-top: 10px;
  background: var(--line);
}

.coverage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.health-detail-card {
  display: grid;
  gap: 12px;
}

.health-detail-card p {
  margin: 0;
  line-height: 1.45;
}

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

.health-note-list {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding-left: 18px;
  line-height: 1.42;
}

.health-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.health-chart-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.chart-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.chart-heading span,
.chart-legend,
.chart-x-labels,
.empty-chart {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.chart-heading strong {
  font-size: 0.9rem;
  text-align: right;
}

.health-chart {
  display: block;
  width: 100%;
  height: 180px;
}

.chart-axis {
  stroke: var(--line);
  stroke-width: 2;
}

.chart-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  stroke: var(--surface);
  stroke-width: 2;
}

.chart-line.teal,
.chart-dot.teal,
.chart-legend i.teal {
  stroke: var(--teal);
  background: var(--teal);
}

.chart-line.gold,
.chart-dot.gold,
.chart-legend i.gold {
  stroke: var(--gold);
  background: var(--gold);
}

.chart-line.green,
.chart-dot.green,
.chart-legend i.green {
  stroke: var(--green);
  background: var(--green);
}

.chart-line.clay,
.chart-dot.clay,
.chart-legend i.clay {
  stroke: var(--clay);
  background: var(--clay);
}

.chart-legend {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.finance-bars {
  display: grid;
  gap: 10px;
}

.finance-bar-row {
  display: grid;
  gap: 8px;
}

.finance-bar-row div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.finance-bar-row strong {
  color: var(--ink);
  white-space: nowrap;
}

.chart-x-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.empty-chart {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.health-split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
}

.health-split h3 {
  margin: 0 0 8px;
  font-size: 0.86rem;
}

.health-nutrition {
  display: grid;
  gap: 7px;
  margin: 0;
}

.health-nutrition div,
.health-sources li,
.health-trend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.health-nutrition dd {
  margin: 0;
  font-weight: 800;
}

.food-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.food-chips span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.health-trend,
.health-sources {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.health-trend span {
  width: 78px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.health-trend strong {
  width: 54px;
  text-align: right;
  font-size: 0.82rem;
}

.health-bar {
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.health-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.health-sources li {
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
}

.health-sources li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.health-page .dashboard-grid {
  align-items: start;
}

.health-filter {
  top: 109px;
}

.health-table-wrap {
  overflow-x: auto;
}

.health-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.finance-table {
  min-width: 760px;
}

.health-table th,
.health-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
}

.health-table th {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.health-table tbody tr:hover {
  background: var(--surface-soft);
}

.stack-list,
.timeline,
.service-grid {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack-list.compact {
  gap: 8px;
}

.stack-item {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.stack-list.compact .stack-item {
  min-height: 62px;
}

.stack-item:hover,
.service-item:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 20px rgba(23, 32, 29, 0.06);
  transform: translateY(-1px);
}

.empty-state {
  border-style: dashed;
  color: var(--muted);
  background: linear-gradient(180deg, var(--surface-soft), #f8faf9);
}

.stack-item p,
.timeline p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.42;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.item-action {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.item-action:first-child {
  border-color: var(--teal);
}

.panel-action {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.item-action,
.panel-action,
.icon-action,
.view-chip,
.chat-form button,
.quick-task-form button,
.quick-review-form button,
.document-search-form button,
.calendar-event-form button,
.bookmark-import-form button,
.document-import-form button,
.service-restart-form button {
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, opacity 140ms ease;
}

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

.panel-action:hover {
  border-color: var(--blue);
}

.panel-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.item-action:hover {
  border-color: var(--teal);
}

.item-action.secondary {
  color: var(--muted);
  background: var(--surface-soft);
}

.item-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.item-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.item-title > span:first-child {
  min-width: 0;
}

.knowledge-tools {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.document-search-form {
  margin-bottom: 8px;
}

.document-import-form,
.bookmark-import-form {
  margin-bottom: 0;
}

.item-tag {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 0.68rem;
}

.item-tag.assistant {
  border-color: #d7c99a;
  color: var(--gold);
  background: var(--gold-soft);
}

.item-tag.review {
  border-color: #dcc3b8;
  color: var(--danger);
  background: var(--danger-soft);
}

.item-tag.ok {
  border-color: #bad0c3;
  color: var(--green);
  background: var(--green-soft);
}

.item-tag.pending {
  border-color: #d7c99a;
  color: var(--gold);
  background: var(--gold-soft);
}

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

.timeline li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  min-height: 72px;
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 12px;
  background: var(--blue-soft);
}

.timeline li.timeline-summary {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.timeline li.timeline-summary strong {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.timeline time {
  color: var(--blue);
  font-weight: 800;
}

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

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

.readiness-item {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
}

.readiness-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.42;
}

.readiness-action {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--ink) !important;
  font-weight: 700;
}

.service-item {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.service-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
}

.dot.ok {
  background: var(--green);
}

.dot.pending {
  background: var(--gold);
}

.dot.warning {
  background: var(--danger);
}

.chat-window {
  display: grid;
  gap: 12px;
  min-height: 200px;
  align-content: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
}

.chat-message {
  max-width: 84%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--surface);
}

.chat-message.user {
  justify-self: end;
  background: var(--green-soft);
}

.chat-message p:last-child {
  margin: 6px 0 0;
  line-height: 1.42;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 72px;
  gap: 10px;
  margin-top: 12px;
}

.quick-task-form,
.quick-review-form,
.document-search-form,
.calendar-event-form,
.bookmark-import-form,
.document-import-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-event-form {
  grid-template-columns: minmax(150px, 0.75fr) minmax(0, 1fr) 68px;
}

.document-import-form,
.service-restart-form {
  grid-template-columns: minmax(0, 1fr) auto 72px;
}

.service-restart-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.bookmark-import-form {
  grid-template-columns: auto minmax(150px, 1fr);
}

.chat-form input,
.chat-form button,
.quick-task-form input,
.quick-task-form button,
.quick-review-form input,
.quick-review-form button,
.document-search-form input,
.document-search-form button,
.calendar-event-form input,
.calendar-event-form button,
.bookmark-import-form button,
.document-import-form input,
.document-import-form button,
.service-restart-form select,
.service-restart-form button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
}

.chat-form input,
.quick-task-form input,
.quick-review-form input,
.document-search-form input,
.calendar-event-form input,
.document-import-form input,
.service-restart-form select {
  width: 100%;
  color: var(--muted);
  background: var(--surface);
}

.chat-form button,
.quick-task-form button,
.quick-review-form button,
.document-search-form button,
.calendar-event-form button,
.bookmark-import-form button,
.document-import-form button,
.service-restart-form button {
  color: rgba(37, 35, 31, 0.55);
  background: var(--surface-soft);
  font-weight: 800;
}

.quick-task-form button,
.quick-review-form button,
.document-search-form button,
.calendar-event-form button,
.bookmark-import-form button,
.document-import-form button,
.service-restart-form button {
  color: var(--teal);
  background: var(--teal-soft);
  cursor: pointer;
}

.quick-task-form button:disabled,
.quick-review-form button:disabled,
.document-search-form button:disabled,
.calendar-event-form button:disabled,
.bookmark-import-form button:disabled,
.document-import-form button:disabled,
.service-restart-form button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.checkbox-row input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

@media (max-width: 1120px) {
  .panel,
  .panel-wide,
  .review-panel,
  .chat-panel {
    grid-column: span 6;
  }

  .today-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
    margin: 0 -18px;
    padding: 18px;
  }

  h1 {
    font-size: 1.9rem;
  }

  .today-strip {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-actions {
    width: 100%;
    flex-direction: column;
  }

  .refresh-action {
    width: 100%;
  }

  .view-switcher {
    top: 0;
    margin: 0 -18px;
    padding: 10px 18px;
  }

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

  .panel,
  .panel-wide,
  .review-panel,
  .chat-panel,
  .today-panel {
    grid-column: 1;
    min-height: auto;
  }

  .today-layout,
  .metric-row,
  .health-metrics,
  .health-dashboard-summary,
  .health-periods,
  .health-snapshot-grid,
  .health-period-metrics,
  .health-split,
  .health-chart-grid,
  .service-grid,
  .readiness-grid,
  .two-column-list,
  .calendar-event-form,
  .bookmark-import-form,
  .document-import-form,
  .service-restart-form {
    grid-template-columns: 1fr;
  }

  .lead-copy {
    font-size: 1.08rem;
  }

  .panel-heading {
    align-items: flex-start;
    min-height: auto;
  }

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

  .chat-message {
    max-width: 100%;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }
}
