/* Kruh pece mockup CSS version: 20260503-01 */

:root {
  color-scheme: light;
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-soft: #f7f6f2;
  --sidebar: rgba(255, 255, 255, 0.84);
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #e7e3da;
  --line-strong: #d9d3c7;
  --accent: #3e7c78;
  --accent-strong: #2f625f;
  --green: #78a083;
  --green-soft: #edf5ef;
  --blue: #5b7cfa;
  --blue-soft: #eef2ff;
  --amber: #d99a2b;
  --amber-soft: #fff6e4;
  --red: #c75146;
  --red-soft: #fff0ee;
  --shadow: 0 14px 42px rgba(31, 41, 51, 0.06);
  --radius: 18px;
  --pattern: linear-gradient(180deg, #fbfbf8 0%, #f7f6f2 100%);
  --heading-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="ops"] {
  color-scheme: light;
  --bg: #f3f6f7;
  --surface: #ffffff;
  --surface-soft: #f0f4f4;
  --sidebar: #172321;
  --ink: #111827;
  --muted: #5b6670;
  --line: #d7e0e1;
  --line-strong: #b8c7c9;
  --accent: #246b70;
  --accent-strong: #174f54;
  --green: #3f8f6b;
  --green-soft: #e7f4ed;
  --blue: #3468d9;
  --blue-soft: #e9f0ff;
  --amber: #bb7a16;
  --amber-soft: #fff2d6;
  --red: #bd4038;
  --red-soft: #ffebe9;
  --shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
  --radius: 12px;
  --pattern: linear-gradient(180deg, #f7fafb 0%, #edf2f3 100%);
}

body[data-theme="notebook"] {
  --bg: #fbfaf5;
  --surface: #fffefa;
  --surface-soft: #f4f1e9;
  --sidebar: rgba(255, 254, 250, 0.9);
  --ink: #26312d;
  --muted: #74766f;
  --line: #e5dfd0;
  --line-strong: #d5cbb7;
  --accent: #6d8064;
  --accent-strong: #52624b;
  --green: #77976d;
  --green-soft: #edf5ea;
  --blue: #5879c7;
  --blue-soft: #eef3ff;
  --amber: #c18a2e;
  --amber-soft: #fff4df;
  --red: #b95b50;
  --red-soft: #fff0ee;
  --shadow: 0 18px 48px rgba(64, 56, 42, 0.07);
  --radius: 24px;
  --heading-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pattern: linear-gradient(180deg, #fffdfa 0%, #f6f1e7 100%);
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--pattern), var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  max-width: 100%;
  overflow-x: clip;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
  width: 1.12em;
  height: 1.12em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

img,
canvas,
video {
  max-width: 100%;
}

.fill-icon,
svg.fill-icon {
  fill: currentColor;
  stroke: none;
}

[data-icon],
.card-title h2,
.card-title h3,
.eyebrow,
.primary-button,
.ghost-button,
.small-button {
  align-items: center;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 88px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  backdrop-filter: blur(22px);
  transition: padding 180ms ease;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body[data-theme="ops"] .sidebar {
  color: var(--ink);
}

body[data-theme="ops"] .sidebar .brand span,
body[data-theme="ops"] .sidebar .style-switcher p {
  color: var(--muted);
}

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

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 750;
}

.logo-mark {
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body[data-theme="notebook"] .brand-mark {
  border-radius: 50%;
  background: #f7d27b;
  color: #563719;
  box-shadow: inset 0 0 0 2px rgba(86, 55, 25, 0.12);
}

.brand strong,
.brand span {
  display: block;
}

.sidebar-label,
.nav-text,
.style-switcher,
.style-switcher p,
.style-option {
  transition: opacity 140ms ease, transform 140ms ease;
}

.sidebar-toggle {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}

body.sidebar-collapsed .sidebar {
  padding-inline: 18px;
  align-items: center;
}

body.sidebar-collapsed .sidebar-head,
body.sidebar-collapsed .nav-list {
  width: 52px;
}

body.sidebar-collapsed .sidebar-head {
  display: grid;
  justify-items: center;
}

body.sidebar-collapsed .brand {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-label,
body.sidebar-collapsed .nav-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed .style-switcher {
  width: 52px;
  padding: 6px;
}

body.sidebar-collapsed .style-switcher p {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

body.sidebar-collapsed .style-options {
  grid-template-columns: 1fr;
}

body.sidebar-collapsed .style-option {
  min-height: 32px;
  padding: 0;
  font-size: 0;
}

body.sidebar-collapsed .style-option::after {
  content: attr(data-short);
  font-size: 0.78rem;
}

body.sidebar-collapsed .sidebar-toggle {
  transform: rotate(180deg);
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .sidebar > .emergency-button {
  width: 52px;
  padding-inline: 0;
}

.brand span,
.eyebrow,
.meta,
.muted {
  color: var(--muted);
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 560;
}

.nav-icon {
  display: inline-grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  place-items: center;
  font-weight: 900;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--ink);
}

body[data-theme="ops"] .nav-item {
  color: var(--muted);
}

body[data-theme="ops"] .nav-item:hover,
body[data-theme="ops"] .nav-item.is-active {
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--ink);
}

.style-switcher {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: none;
}

body[data-theme="ops"] .style-switcher {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
}

.style-switcher p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.style-option {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.style-option.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

body[data-theme="ops"] .style-option {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(238, 245, 242, 0.72);
}

body[data-theme="ops"] .style-option.is-active {
  background: #dbead5;
  color: #172321;
}

.emergency-button,
.primary-button,
.ghost-button,
.icon-button,
.small-button {
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 0 14px;
}

.emergency-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--red);
  color: #fff;
  font-weight: 650;
  box-shadow: none;
}

.sidebar > .emergency-button {
  width: 100%;
  min-height: 44px;
  margin-top: auto;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  font-weight: 650;
}

.ghost-button,
.small-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.primary-button,
.ghost-button,
.small-button,
.emergency-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  min-width: 0;
}

.product-info-button {
  color: var(--accent-strong);
}

.workspace {
  min-width: 0;
  padding: 32px 38px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  min-width: 0;
}

.topbar h1,
.dialog-head h2 {
  margin: 0;
  font-family: var(--heading-font);
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.75rem, 2vw, 2.125rem);
  font-weight: 720;
}

.eyebrow {
  display: inline-flex;
  gap: 6px;
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.view {
  display: grid;
  gap: 24px;
}

.reveal-card {
  animation: card-reveal 520ms cubic-bezier(0.2, 0.72, 0.2, 1) both;
  animation-delay: calc(min(var(--reveal-index, 0), 10) * 58ms);
  transform-origin: center top;
  will-change: opacity, transform, filter;
}

@keyframes card-reveal {
  from {
    opacity: 0;
    filter: blur(7px);
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-card {
    animation: none;
  }
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
  gap: 18px;
  align-items: center;
  min-height: 184px;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 22px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 58%),
    rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.page-hero p {
  margin: 0 0 12px;
  color: var(--muted);
  max-width: 58ch;
}

.page-hero strong {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent);
}

.page-hero-dashboard {
  border-left: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
}

.page-hero-plan {
  border-left: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
}

.page-hero-journal {
  border-left: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
}

.page-hero-medicine {
  border-left: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
}

.page-hero-services {
  border-left: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
}

.page-hero-agreement {
  border-left: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
}

.hero-visual {
  display: grid;
  min-height: 150px;
  align-items: center;
  padding: 10px;
  border: 0;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
}

.viz-line {
  width: 100%;
  height: 150px;
  fill: none;
  stroke: none;
}

.viz-grid {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.viz-area {
  fill: color-mix(in srgb, var(--accent) 14%, transparent);
  stroke: none;
}

.viz-stroke {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.viz-dot {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2.5;
}

.week-timeline {
  display: grid;
  gap: 12px;
}

.week-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.week-track {
  position: relative;
  height: 34px;
  overflow: visible;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 50%, transparent);
}

.week-track span {
  position: absolute;
  top: 14px;
  height: 10px;
  border-radius: inherit;
}

.week-track span.need,
.week-track span.need-gap {
  top: 10px;
  height: 16px;
  background: color-mix(in srgb, var(--red) 72%, white);
  z-index: 1;
}

.week-track span.care {
  background: var(--green);
  z-index: 2;
}

.week-track span.gap {
  background: var(--red);
  z-index: 3;
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-left: 44px;
  color: var(--muted);
  font-size: 0.78rem;
}

.timeline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.timeline-legend i {
  width: 18px;
  height: 8px;
  border-radius: 999px;
}

.timeline-legend i.need,
.timeline-legend i.need-gap {
  background: color-mix(in srgb, var(--red) 72%, white);
}

.timeline-legend i.care {
  background: var(--green);
}

.timeline-legend i.gap {
  background: var(--red);
}

.timeline-legend i.free {
  background: color-mix(in srgb, var(--line) 50%, transparent);
}

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

.mini-gauge {
  --angle: calc(var(--value) * 3.6deg);
  display: grid;
  min-height: 128px;
  place-items: center;
  text-align: center;
  border-radius: var(--radius);
  background:
    radial-gradient(circle closest-side, var(--surface) 68%, transparent 70%),
    conic-gradient(var(--accent) var(--angle), color-mix(in srgb, var(--line) 78%, transparent) 0);
}

.mini-gauge span {
  font-size: 1.35rem;
  font-weight: 900;
}

.mini-gauge small {
  max-width: 86px;
  color: var(--muted);
  font-weight: 800;
}

.funnel {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.service-map {
  display: grid;
  gap: 18px;
}

.funnel-step {
  display: grid;
  width: var(--w);
  min-height: 68px;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--ink);
}

.funnel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.funnel-head strong {
  font-weight: 650;
}

.funnel-head b {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
  font-size: 0.9rem;
}

.funnel-pins {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.funnel-pin {
  display: inline-flex;
  max-width: 150px;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 650;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform 160ms ease, background 160ms ease;
}

.funnel-pin:hover {
  transform: translateY(-1px);
  background: var(--surface);
}

.funnel-pin span {
  display: grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, white);
}

.funnel-pin svg {
  width: 12px;
  height: 12px;
}

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

.integration-status div {
  min-height: 70px;
  padding: 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.integration-status span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.integration-status strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 1rem;
}

.document-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.document-grid.lower {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.benefit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
}

.benefit-grid.lower {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

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

.benefit-score div,
.next-step-box,
.benefit-amounts {
  padding: 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.benefit-score span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
}

.benefit-score strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.94rem;
}

.screening-list {
  display: grid;
  gap: 10px;
}

.screening-list label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.55fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.screening-list label span {
  color: var(--ink);
  font-weight: 650;
}

.screening-list select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 9px 10px;
}

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

.recommendation-card > strong {
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.25;
}

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

.next-step-box {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  background: var(--amber-soft);
}

.next-step-box > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--amber);
}

.legal-note {
  font-size: 0.78rem;
}

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

.needs-matrix div {
  min-height: 86px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.needs-matrix div.warning {
  background: var(--amber-soft);
}

.needs-matrix div.danger {
  background: var(--red-soft);
}

.needs-matrix div.ok {
  background: var(--green-soft);
}

.needs-matrix strong,
.needs-matrix span {
  display: block;
}

.needs-matrix strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.needs-matrix span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.document-checklist {
  display: grid;
  gap: 10px;
}

.document-checklist div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.document-checklist span {
  color: var(--accent);
}

.needs-radar-panel {
  margin-bottom: 18px;
}

.needs-radar-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: center;
}

.needs-radar {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.needs-radar svg {
  width: min(100%, 500px);
  height: auto;
  overflow: visible;
}

.radar-ring-fill {
  fill: none;
  stroke: color-mix(in srgb, var(--line) 86%, transparent);
  stroke-width: 1;
}

.radar-ring-fill.level-2 {
  stroke-dasharray: 5 5;
}

.radar-ring-fill.level-3 {
  stroke: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.radar-axis {
  stroke: color-mix(in srgb, var(--line) 78%, transparent);
  stroke-width: 1;
}

.radar-label {
  fill: var(--muted);
  stroke: none;
  font-size: 10px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: normal;
}

.radar-label.warning {
  fill: var(--amber);
}

.radar-label.danger {
  fill: var(--red);
}

.radar-label.ok {
  fill: var(--green);
}

.radar-previous {
  fill: none;
  stroke: var(--blue);
  stroke-dasharray: 6 5;
  stroke-width: 2;
}

.radar-current {
  fill: color-mix(in srgb, var(--red) 18%, transparent);
  stroke: none;
}

.radar-current-line {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.5;
}

.radar-dot {
  fill: var(--amber);
  stroke: var(--surface);
  stroke-width: 2;
}

.radar-dot.danger {
  fill: var(--red);
}

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

.radar-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.radar-scale span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.radar-scale i {
  width: 18px;
  height: 8px;
  border-radius: 999px;
}

.radar-scale .current {
  background: var(--red);
}

.radar-scale .previous {
  border: 1px dashed var(--blue);
}

.radar-scale .borderline {
  border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--line));
}

.needs-radar-insight {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-soft);
}

.needs-radar-insight > strong {
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.25;
}

.needs-radar-insight p {
  margin: 0;
  color: var(--muted);
}

.capacity-panel {
  margin-bottom: 18px;
}

.capacity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: stretch;
}

.capacity-map,
.capacity-insight {
  min-width: 0;
}

.capacity-map {
  display: grid;
  gap: 11px;
  align-content: center;
}

.capacity-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.capacity-row > strong {
  color: var(--accent-strong);
}

.capacity-track {
  position: relative;
  min-height: 42px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 48%, transparent);
}

.capacity-slot {
  position: absolute;
  top: 6px;
  display: flex;
  min-width: 42px;
  height: 30px;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding: 0 8px 0 2px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.capacity-slot.ok {
  background: color-mix(in srgb, var(--green) 46%, white);
}

.capacity-slot.warning {
  background: color-mix(in srgb, var(--amber) 48%, white);
}

.capacity-slot.danger {
  background: color-mix(in srgb, var(--red) 52%, white);
}

.capacity-slot small {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
}

.capacity-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-width: 2px;
  box-shadow: none;
}

.capacity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: 44px;
  color: var(--muted);
  font-size: 0.78rem;
}

.capacity-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.capacity-legend i {
  width: 18px;
  height: 8px;
  border-radius: 999px;
}

.capacity-legend .ok {
  background: color-mix(in srgb, var(--green) 46%, white);
}

.capacity-legend .warning {
  background: color-mix(in srgb, var(--amber) 48%, white);
}

.capacity-legend .danger {
  background: color-mix(in srgb, var(--red) 52%, white);
}

.capacity-insight {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-soft);
}

.capacity-insight > strong {
  color: var(--ink);
  font-size: 1.16rem;
  line-height: 1.28;
}

.capacity-insight p {
  margin: 0;
  color: var(--muted);
}

.capacity-people {
  display: grid;
  gap: 8px;
}

.capacity-person {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
}

.capacity-person.danger {
  border-color: color-mix(in srgb, var(--red) 18%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 68%, var(--surface));
}

.capacity-person.warning {
  border-color: color-mix(in srgb, var(--amber) 22%, var(--line));
  background: color-mix(in srgb, var(--amber-soft) 68%, var(--surface));
}

.capacity-person.ok,
.capacity-person.calm {
  border-color: color-mix(in srgb, var(--green) 16%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 70%, var(--surface));
}

.capacity-person-avatar {
  width: 34px;
  height: 34px;
  border-width: 2px;
  box-shadow: none;
}

.capacity-person strong,
.capacity-person span {
  display: block;
}

.capacity-person span {
  color: var(--muted);
  font-size: 0.78rem;
}

.benefit-amounts {
  margin-top: 14px;
}

.benefit-amounts p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.life-card .card-title {
  align-items: flex-start;
}

.life-card-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.life-photo {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 240px;
  border-radius: 18px;
  background: var(--surface-soft);
  text-align: center;
}

.life-photo img {
  width: 104px;
  height: 104px;
  border: 5px solid var(--surface);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.life-photo strong {
  color: var(--ink);
  font-size: 1rem;
}

.life-photo span {
  color: var(--muted);
  font-size: 0.82rem;
}

.life-facts {
  display: grid;
  gap: 10px;
}

.life-facts div {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.life-facts span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.76rem;
}

.life-facts strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 610;
  line-height: 1.35;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.device-stack,
.external-feed,
.access-list {
  display: grid;
  gap: 10px;
}

.device-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.device-card > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent-strong);
}

.device-card.warning > span {
  background: color-mix(in srgb, var(--amber) 18%, white);
  color: var(--amber);
}

.device-card svg {
  width: 18px;
  height: 18px;
}

.device-card strong,
.access-item strong,
.external-event strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.device-card p,
.access-item p,
.external-event p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.external-event {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.external-event > span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
}

.external-event.warning > span {
  background: var(--amber);
}

.external-event small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.74rem;
}

.access-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.forecast-card {
  display: grid;
  gap: 8px;
}

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

.actor-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  font-weight: 800;
}

.actor-badge svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.actor-badge img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line);
}

.plain-actor {
  color: var(--ink);
  font-weight: 720;
}

.care-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent);
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.1);
  cursor: pointer;
}

.care-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.care-avatar svg {
  width: 18px;
  height: 18px;
}

.care-avatar:hover,
.care-avatar:focus-visible {
  outline: 0;
  box-shadow:
    0 10px 22px rgba(31, 41, 51, 0.14),
    0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.care-avatar.is-empty {
  background: var(--red-soft);
  color: var(--red);
  cursor: default;
}

.care-avatar:disabled {
  cursor: default;
}

.week-avatar {
  position: absolute;
  top: 50%;
  z-index: 8;
  width: 30px;
  height: 30px;
  border-width: 2px;
  transform: translate(-50%, -50%);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.status-strip {
  display: grid;
  grid-template-columns: minmax(270px, 0.9fr) minmax(0, 1.55fr) auto;
  gap: 20px;
  align-items: stretch;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.command-state {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 24px;
  align-items: stretch;
  min-height: 218px;
  padding: 30px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 28px;
  background:
    radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72));
  box-shadow: var(--shadow);
}

.command-copy h2 {
  max-width: 880px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.6rem, 2.1vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 720;
}

.command-copy > p:not(.eyebrow) {
  max-width: 720px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.recommendation-strip {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
  max-width: 780px;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--amber) 32%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--amber-soft) 78%, var(--surface));
}

.recommendation-strip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--amber);
  font-size: 0.84rem;
  font-weight: 720;
}

.recommendation-strip strong {
  font-weight: 650;
}

.command-actions {
  display: grid;
  align-content: center;
  gap: 10px;
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(320px, 0.85fr) minmax(330px, 0.9fr);
  gap: 24px;
  align-items: stretch;
}

.connected-strip {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.8fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
}

.connected-strip > div:first-child strong {
  display: block;
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.35;
}

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

.connected-signal {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 86px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--surface-soft);
}

.connected-signal.ok {
  border-color: color-mix(in srgb, var(--green) 18%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 72%, var(--surface));
}

.connected-signal.warning {
  border-color: color-mix(in srgb, var(--red) 18%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 70%, var(--surface));
}

.connected-signal > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent-strong);
}

.connected-signal.warning > span {
  background: color-mix(in srgb, var(--red) 13%, white);
  color: var(--red);
}

.connected-signal svg {
  width: 17px;
  height: 17px;
}

.connected-signal small {
  color: var(--muted);
  font-size: 0.72rem;
}

.connected-signal strong {
  display: block;
  margin: 2px 0;
  color: var(--ink);
  font-size: 0.92rem;
}

.connected-signal p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.radar-panel,
.timeline-panel,
.risk-panel,
.insight-panel {
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

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

.panel-heading h2 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 690;
  letter-spacing: 0;
}

.care-radar {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 50%, rgba(62, 124, 120, 0.1), transparent 22%),
    linear-gradient(180deg, rgba(250, 250, 247, 0.4), rgba(247, 246, 242, 0.8));
}

.radar-ring,
.radar-cross,
.radar-senior,
.radar-node,
.radar-source,
.radar-warning {
  position: absolute;
}

.radar-ring {
  left: 50%;
  top: 50%;
  border: 1px dashed color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.ring-outer {
  width: 76%;
  aspect-ratio: 1;
}

.ring-inner {
  width: 42%;
  aspect-ratio: 1;
}

.radar-cross {
  left: 50%;
  top: 50%;
  background: color-mix(in srgb, var(--line) 72%, transparent);
  transform: translate(-50%, -50%);
}

.radar-cross.x {
  width: 76%;
  height: 1px;
}

.radar-cross.y {
  width: 1px;
  height: 76%;
}

.radar-senior {
  left: 50%;
  top: 50%;
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  padding: 0;
  border: 8px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--green-soft), #fff);
  color: var(--accent);
  box-shadow: 0 18px 42px rgba(31, 41, 51, 0.12);
  transform: translate(-50%, -50%);
  text-align: center;
  cursor: pointer;
  font: inherit;
}

.radar-senior span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 720;
  overflow: hidden;
}

.radar-senior img,
.radar-node img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.radar-senior strong {
  margin-top: -16px;
  color: var(--ink);
  font-size: 0.82rem;
}

.radar-node {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 88px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  transform: translate(-50%, -50%);
  cursor: pointer;
  font: inherit;
}

.radar-senior:hover,
.radar-node:hover {
  z-index: 4;
}

.radar-senior:hover {
  box-shadow: 0 20px 50px rgba(31, 41, 51, 0.18);
}

.radar-node:hover > span,
.radar-node:focus-visible > span,
.radar-senior:focus-visible {
  outline: 0;
  box-shadow:
    0 12px 28px rgba(31, 41, 51, 0.1),
    0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: translateY(-2px);
}

.radar-node > span {
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.radar-node > span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  box-shadow: 0 12px 28px rgba(31, 41, 51, 0.08);
  overflow: hidden;
}

.radar-node.large > span {
  width: 58px;
  height: 58px;
}

.radar-node.small > span {
  width: 40px;
  height: 40px;
}

.radar-node.good > span {
  background: var(--green-soft);
  color: var(--green);
}

.radar-node.watch > span {
  background: var(--amber-soft);
  color: var(--amber);
}

.radar-node.calm > span {
  background: var(--blue-soft);
  color: var(--blue);
}

.radar-node strong {
  font-size: 0.88rem;
  font-weight: 680;
}

.radar-node small {
  color: var(--muted);
  font-size: 0.75rem;
}

.radar-source {
  display: grid;
  justify-items: center;
  gap: 1px;
  width: 76px;
  color: var(--muted);
  text-align: center;
  transform: translate(-50%, -50%);
}

.radar-source > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent);
  box-shadow: 0 8px 20px rgba(31, 41, 51, 0.06);
}

.radar-source.ok > span {
  background: var(--green-soft);
  color: var(--green);
}

.radar-source.warning > span {
  background: var(--amber-soft);
  color: var(--amber);
}

.radar-source.danger > span {
  background: var(--red-soft);
  color: var(--red);
}

.radar-source strong {
  color: var(--ink);
  font-size: 0.7rem;
}

.radar-source small {
  font-size: 0.66rem;
}

.radar-warning {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--red) 30%, var(--line));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 650;
}

.radar-warning span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
}

.warning-a {
  right: 11%;
  top: 31%;
}

.warning-b {
  left: 10%;
  bottom: 18%;
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 34%, var(--line));
}

.warning-b span {
  background: var(--amber);
}

.command-timeline {
  display: grid;
  gap: 0;
}

.command-timeline-item {
  display: grid;
  grid-template-columns: 64px 20px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  min-height: 78px;
  padding: 4px 0;
}

.command-timeline-item time {
  color: var(--muted);
  font-weight: 650;
}

.timeline-line {
  position: relative;
  width: 20px;
  height: 100%;
}

.timeline-line::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 0;
  bottom: -8px;
  width: 1px;
  background: var(--line);
}

.timeline-line::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 11px;
  height: 11px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1px var(--line);
}

.command-timeline-item.has-risk .timeline-line::after {
  background: var(--red);
}

.risk-queue {
  display: grid;
  gap: 12px;
}

.risk-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

.risk-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
}

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

.risk-card.danger {
  border-color: color-mix(in srgb, var(--red) 32%, var(--line));
  background: var(--red-soft);
}

.risk-card.warning {
  border-color: color-mix(in srgb, var(--amber) 36%, var(--line));
  background: var(--amber-soft);
}

.risk-card.info {
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  background: var(--blue-soft);
}

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

.community-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.insight-panel {
  min-height: 220px;
}

.help-now-list,
.small-wins {
  display: grid;
  gap: 10px;
}

.help-now-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.help-now-item > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
}

.help-now-item.ok > span { background: var(--green-soft); color: var(--green); }
.help-now-item.warning > span { background: var(--amber-soft); color: var(--amber); }
.help-now-item.danger > span { background: var(--red-soft); color: var(--red); }

.help-now-item strong,
.guide-card strong {
  color: var(--ink);
}

.help-now-item p,
.guide-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.guide-card ol {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
}

.small-wins div {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: var(--ink);
  font-size: 0.9rem;
}

.small-wins svg {
  color: var(--green);
}

.imbalance-visual {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 16px;
  align-items: end;
}

.imbalance-main strong {
  display: block;
  color: var(--accent);
  font-size: 3rem;
  line-height: 1;
  letter-spacing: 0;
}

.imbalance-main span,
.interpretation,
.change-brief p,
.autonomy-trend p {
  color: var(--muted);
}

.imbalance-bars {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 120px;
}

.imbalance-bars span {
  position: relative;
  display: block;
  flex: 1;
  min-width: 30px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, var(--accent), var(--green));
  opacity: 0.9;
}

.imbalance-bars span:nth-child(2),
.imbalance-bars span:nth-child(3) {
  opacity: 0.42;
}

.imbalance-bars small {
  position: absolute;
  left: 50%;
  bottom: -22px;
  color: var(--muted);
  font-size: 0.7rem;
  transform: translateX(-50%);
}

.change-brief strong,
.autonomy-trend strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.12rem;
}

.autonomy-trend .viz-line {
  height: 94px;
  margin-top: 8px;
}

.status-actions {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 142px;
}

.call-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.call-button.danger {
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
  background: var(--red);
  color: #fff;
}

.senior-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.senior-status h2 {
  margin: 0;
  font-size: clamp(1.65rem, 2.4vw, 2.15rem);
  font-weight: 720;
}

.senior-status p:last-child {
  margin: 3px 0 0;
  color: var(--muted);
}

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

.metric-card {
  min-height: 104px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-soft);
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.metric-card strong {
  display: block;
  margin: 7px 0 2px;
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 720;
}

.metric-good {
  background: var(--green-soft);
}

.metric-warn {
  background: var(--amber-soft);
}

.care-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.care-main,
.care-side,
.dashboard-bottom {
  display: grid;
  gap: 18px;
}

.dashboard-bottom {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.surface-panel {
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.today-panel {
  padding-block: 24px;
}

.care-timeline {
  position: relative;
  display: grid;
  gap: 2px;
}

.care-timeline::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 92px;
  width: 1px;
  background: var(--line);
}

.care-timeline .timeline-item {
  position: relative;
  grid-template-columns: 70px 1fr auto;
  padding: 14px 0 14px 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.care-timeline .timeline-item::before {
  content: "";
  position: absolute;
  left: 88px;
  top: 21px;
  width: 9px;
  height: 9px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--line);
}

.care-timeline .time {
  color: var(--muted);
  font-weight: 650;
}

.next-list,
.risk-list,
.signal-list,
.autonomy-list,
.action-list {
  display: grid;
  gap: 10px;
}

.next-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.next-item:last-child {
  border-bottom: 0;
}

.next-item > div:first-child span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.next-item > div:first-child strong {
  font-size: 1.05rem;
}

.compact-contact,
.risk-item,
.priority-action {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.compact-contact:last-child,
.risk-item:last-child,
.priority-action:last-child {
  border-bottom: 0;
}

.risk-item {
  justify-content: flex-start;
}

.risk-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--blue);
}

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

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

.risk-dot.info {
  background: var(--blue);
}

.signal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, 0.55fr) 44px;
  gap: 12px;
  align-items: center;
  min-height: 34px;
}

.signal-row span {
  color: var(--ink);
}

.signal-row strong {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}

.bar.slim {
  height: 6px;
}

.bar span.warning {
  background: var(--amber);
}

.bar span.info {
  background: var(--blue);
}

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

.autonomy-item {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--ink);
  font-size: 0.92rem;
}

.autonomy-item svg {
  width: 16px;
  height: 16px;
}

.autonomy-item.positive svg {
  color: var(--green);
}

.autonomy-item.watch svg {
  color: var(--amber);
}

.priority-action {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  position: relative;
}

.priority-action .pill {
  grid-column: 2;
  justify-self: start;
}

.priority-index {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 720;
}

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

.card {
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

body[data-theme="ops"] .card {
  border-top: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
}

body[data-theme="notebook"] .card {
  position: relative;
}

body[data-theme="notebook"] .card::before {
  content: none;
}

.card-pad {
  padding: 20px;
}

.person-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.avatar {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--green-soft), #ffffff);
  display: grid;
  place-items: center;
  color: var(--green);
  font-size: 1.55rem;
  font-weight: 720;
}

body[data-theme="ops"] .avatar {
  border-radius: var(--radius);
}

body[data-theme="notebook"] .avatar {
  border: 0;
  box-shadow: none;
}

.stat-row,
.inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat {
  min-width: 128px;
  padding: 14px;
  border: 0;
  border-radius: 16px;
  background: var(--surface-soft);
}

.stat strong,
.stat span {
  display: block;
}

.stat strong {
  font-size: 1.35rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 650;
}

.pill.warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.danger {
  background: var(--red-soft);
  color: var(--red);
}

.pill.ok {
  background: var(--green-soft);
  color: var(--green);
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title h2,
.card-title h3 {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  font-size: 1rem;
}

.timeline,
.log-list,
.task-list,
.medicine-list,
.service-list,
.agreement-list {
  display: grid;
  gap: 10px;
}

.service-workspace .card-title {
  align-items: flex-start;
}

.service-board {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.service-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.service-tabs button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 650;
}

.service-tabs button.is-active {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: 0 4px 12px rgba(31, 41, 51, 0.06);
}

.informal-help {
  margin-top: 18px;
}

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

.informal-item {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 180px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.informal-item > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
}

.informal-item strong {
  color: var(--ink);
}

.informal-item p,
.informal-item small {
  display: block;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.service-record {
  border-radius: 18px;
  background: var(--surface-soft);
  scroll-margin-top: 84px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.service-record:target {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-soft));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}

.service-record summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 76px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.service-record summary::-webkit-details-marker {
  display: none;
}

.service-record summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 1.8px solid var(--muted);
  border-bottom: 1.8px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.service-record[open] summary::after {
  transform: rotate(225deg);
}

.service-record summary > .pill {
  justify-self: end;
}

.service-record summary strong,
.service-record summary small {
  display: block;
}

.service-record summary small {
  margin-top: 4px;
  color: var(--muted);
}

.service-stage {
  min-width: 86px;
  padding: 7px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 650;
  text-align: center;
}

.service-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 16px 16px;
}

.service-detail > div,
.service-history {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  padding: 14px;
}

.meta-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
  text-transform: uppercase;
}

.service-history {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 34px;
}

.service-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.small-button.ghost {
  background: transparent;
}

.timeline-item,
.log-item,
.task-item,
.medicine-item,
.service-item,
.agreement-item,
.scenario {
  padding: 14px;
  border: 0;
  border-radius: 16px;
  background: var(--surface-soft);
}

body[data-theme="ops"] .timeline-item,
body[data-theme="ops"] .log-item,
body[data-theme="ops"] .task-item,
body[data-theme="ops"] .medicine-item,
body[data-theme="ops"] .service-item,
body[data-theme="ops"] .agreement-item,
body[data-theme="ops"] .scenario {
  border-left: 0;
}

body[data-theme="notebook"] .timeline-item,
body[data-theme="notebook"] .log-item,
body[data-theme="notebook"] .task-item,
body[data-theme="notebook"] .medicine-item,
body[data-theme="notebook"] .service-item,
body[data-theme="notebook"] .agreement-item,
body[data-theme="notebook"] .scenario {
  box-shadow: inset 0 -1px 0 rgba(116, 79, 42, 0.05);
}

.timeline-item {
  display: grid;
  grid-template-columns: 64px 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

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

.item-title {
  margin: 0 0 3px;
  font-weight: 800;
}

.meta {
  margin: 0;
  font-size: 0.9rem;
}

.coverage {
  display: grid;
  gap: 8px;
}

.day-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 54px;
  gap: 12px;
  align-items: center;
}

.bar {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 72%, transparent);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.form-preview {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.medicine-item,
.service-item,
.task-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.stock {
  min-width: 118px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #ece7df;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.emergency-dialog,
.profile-dialog,
.product-info-dialog {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 32px 100px rgba(20, 20, 20, 0.22);
}

.product-info-dialog {
  width: min(860px, calc(100vw - 28px));
}

.entry-dialog {
  width: min(980px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 32px 100px rgba(20, 20, 20, 0.22);
}

.entry-dialog::backdrop {
  background: rgba(24, 25, 28, 0.44);
}

.entry-form {
  margin: 0;
  background: var(--surface);
}

.entry-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  padding: 20px;
}

.entry-main,
.entry-side,
.entry-pin-groups {
  display: grid;
  gap: 14px;
}

.entry-side {
  align-content: start;
  align-self: start;
}

.entry-side .field,
.entry-preview {
  align-self: start;
}

.select-with-icon {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.select-leading-icon {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--accent);
  background: var(--surface-soft);
  border-right: 1px solid var(--line);
}

.select-leading-icon svg {
  width: 20px;
  height: 20px;
}

.select-with-icon select {
  min-height: 44px;
  border: 0;
  background: transparent;
}

.pin-group {
  display: grid;
  gap: 8px;
}

.pin-group h3 {
  margin: 0;
  font-size: 0.92rem;
}

.pin-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pin-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 12px;
  font-weight: 750;
}

.pin-button.is-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.dictation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 8px;
}

.dictate-button {
  display: grid;
  place-items: center;
  min-height: 46px;
  align-self: stretch;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 1.1rem;
}

.dictate-button svg {
  width: 22px;
  height: 22px;
}

.dictate-button.stt-recording {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 16%, transparent);
}

.stt-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.stt-status[data-type="ok"] {
  color: var(--green);
}

.stt-status[data-type="error"] {
  color: var(--red);
}

.stt-status[data-type="info"] {
  color: var(--blue);
}

.entry-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
}

.emergency-dialog::backdrop,
.profile-dialog::backdrop,
.product-info-dialog::backdrop {
  background: rgba(24, 25, 28, 0.42);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface);
  font-size: 1.4rem;
}

#emergency-content {
  display: grid;
  gap: 14px;
  padding: 20px;
}

#product-info-content {
  max-height: min(64vh, 720px);
  overflow: auto;
  padding: 22px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 36%),
    var(--surface);
}

.investor-copy {
  display: grid;
  gap: 14px;
}

.investor-copy h3,
.investor-copy h4,
.investor-copy p {
  margin: 0;
}

.investor-copy h3 {
  max-width: 680px;
  font-family: var(--heading-font);
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.investor-copy h4 {
  margin-top: 6px;
  font-size: 1rem;
}

.investor-copy p {
  color: var(--muted);
}

.investor-copy strong,
.investor-lead {
  color: var(--ink);
}

.investor-lead {
  max-width: 720px;
  font-size: 1.05rem;
  line-height: 1.55;
}

.investor-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-block: 4px;
}

.investor-points div {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 86%, var(--accent) 14%);
}

.investor-points strong {
  line-height: 1.25;
}

.emergency-now {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: var(--red-soft);
}

.emergency-now h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.12rem;
}

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

.emergency-call {
  display: grid;
  gap: 5px;
  min-height: 132px;
  align-content: start;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-decoration: none;
}

.emergency-call > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
}

.emergency-call.danger {
  border-color: color-mix(in srgb, var(--red) 32%, transparent);
  background: var(--red);
  color: #fff;
}

.emergency-call.danger > span {
  color: var(--red);
}

.emergency-call strong,
.emergency-call b,
.emergency-call small {
  display: block;
}

.emergency-call b {
  font-size: 1.05rem;
}

.emergency-call small {
  color: inherit;
  opacity: 0.78;
  font-size: 0.76rem;
  line-height: 1.35;
}

.emergency-actions,
.scenario-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.emergency-actions {
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.action-scenario {
  display: grid;
  gap: 12px;
}

.relief-flow {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--red) 24%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--red-soft) 58%, var(--surface));
}

.relief-flow .card-title {
  margin-bottom: 0;
}

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

.relief-steps div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.relief-steps span {
  color: var(--red);
}

.relief-steps small {
  color: var(--muted);
  font-size: 0.74rem;
}

.relief-steps strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.relief-coverage {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.relief-coverage span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 650;
}

.relief-coverage svg {
  color: var(--green);
}

#profile-content {
  padding: 20px;
}

.profile-card {
  display: grid;
  gap: 16px;
}

.profile-head {
  display: flex;
  gap: 14px;
  align-items: center;
}

.profile-avatar {
  display: grid;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
}

.profile-head p {
  margin: 2px 0 0;
  color: var(--muted);
}

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

.profile-grid div,
.profile-section,
.profile-next {
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.profile-grid span,
.profile-section > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
  text-transform: uppercase;
}

.profile-grid strong,
.profile-next strong {
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 650;
}

.profile-section ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.profile-load {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.profile-load-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.profile-load-head span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
  text-transform: uppercase;
}

.profile-load-head strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.profile-activity {
  display: grid;
  gap: 7px;
}

.profile-activity-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.profile-activity-row > strong {
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-activity-row > div {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 62%, transparent);
}

.profile-activity-row span {
  position: absolute;
  top: 2px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
}

.profile-load.warning .profile-activity-row span {
  background: var(--amber);
}

.profile-load.calm .profile-activity-row span {
  background: var(--blue);
}

.profile-next {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--amber-soft);
  color: var(--amber);
}

.profile-next svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

.scenario ol {
  margin: 10px 0 0;
  padding-left: 20px;
}

.loading-state {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

body[data-theme="ops"] .sidebar {
  border-right: 0;
  background: var(--sidebar);
  color: #edf7f4;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

body[data-theme="ops"] .brand strong,
body[data-theme="ops"] .nav-item.is-active,
body[data-theme="ops"] .sidebar-toggle {
  color: #f8fffc;
}

body[data-theme="ops"] .brand span,
body[data-theme="ops"] .style-switcher p,
body[data-theme="ops"] .nav-item {
  color: rgba(237, 247, 244, 0.68);
}

body[data-theme="ops"] .nav-item:hover,
body[data-theme="ops"] .nav-item.is-active {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

body[data-theme="ops"] .sidebar-toggle,
body[data-theme="ops"] .style-switcher,
body[data-theme="ops"] .style-option {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="ops"] .style-option.is-active {
  background: #d9f0e7;
  color: #172321;
}

body[data-theme="ops"] .command-state,
body[data-theme="ops"] .page-hero,
body[data-theme="ops"] .card,
body[data-theme="ops"] .radar-panel,
body[data-theme="ops"] .timeline-panel,
body[data-theme="ops"] .risk-panel,
body[data-theme="ops"] .insight-panel,
body[data-theme="ops"] .connected-strip {
  border-color: color-mix(in srgb, var(--line-strong) 64%, transparent);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

body[data-theme="ops"] .command-state {
  border-left: 5px solid var(--accent);
}

body[data-theme="ops"] .command-copy h2 {
  font-weight: 780;
}

body[data-theme="ops"] .pill,
body[data-theme="ops"] .service-stage,
body[data-theme="ops"] .funnel-pin,
body[data-theme="ops"] .small-button,
body[data-theme="ops"] .ghost-button {
  border-radius: 10px;
}

body[data-theme="ops"] .funnel-step,
body[data-theme="ops"] .metric-card,
body[data-theme="ops"] .service-record,
body[data-theme="ops"] .connected-signal,
body[data-theme="ops"] .life-facts div,
body[data-theme="ops"] .device-card,
body[data-theme="ops"] .external-event,
body[data-theme="ops"] .access-item {
  border-radius: 12px;
}

body[data-theme="notebook"] .workspace {
  background:
    linear-gradient(90deg, rgba(109, 128, 100, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(109, 128, 100, 0.028) 1px, transparent 1px);
  background-size: 28px 28px;
}

body[data-theme="notebook"] .sidebar {
  border-right: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: var(--sidebar);
}

body[data-theme="notebook"] .command-state,
body[data-theme="notebook"] .page-hero,
body[data-theme="notebook"] .card,
body[data-theme="notebook"] .radar-panel,
body[data-theme="notebook"] .timeline-panel,
body[data-theme="notebook"] .risk-panel,
body[data-theme="notebook"] .insight-panel,
body[data-theme="notebook"] .connected-strip {
  border-color: rgba(213, 203, 183, 0.72);
  border-radius: 28px;
  background: rgba(255, 254, 250, 0.84);
  box-shadow: 0 18px 52px rgba(64, 56, 42, 0.055);
}

body[data-theme="notebook"] .command-state {
  background:
    linear-gradient(135deg, rgba(109, 128, 100, 0.11), transparent 42%),
    rgba(255, 254, 250, 0.86);
}

body[data-theme="notebook"] .primary-button,
body[data-theme="notebook"] .sidebar > .emergency-button {
  border-radius: 999px;
}

body[data-theme="notebook"] .nav-item.is-active {
  background: rgba(109, 128, 100, 0.12);
}

body[data-theme="notebook"] .funnel-step,
body[data-theme="notebook"] .metric-card,
body[data-theme="notebook"] .service-record,
body[data-theme="notebook"] .connected-signal,
body[data-theme="notebook"] .life-facts div,
body[data-theme="notebook"] .device-card,
body[data-theme="notebook"] .external-event,
body[data-theme="notebook"] .access-item {
  border-radius: 22px;
}

body[data-theme="notebook"] .pill,
body[data-theme="notebook"] .service-stage,
body[data-theme="notebook"] .funnel-pin {
  border-radius: 999px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    max-width: 100vw;
    overflow-x: clip;
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
    max-width: 100vw;
    overflow-x: clip;
    padding: 16px;
    gap: 14px;
  }

  .sidebar-toggle {
    display: none;
  }

  body.sidebar-collapsed .sidebar {
    align-items: stretch;
  }

  body.sidebar-collapsed .sidebar-label,
  body.sidebar-collapsed .style-switcher,
  body.sidebar-collapsed .nav-text {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    opacity: 1;
    pointer-events: auto;
  }

  body.sidebar-collapsed .style-switcher p {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    opacity: 1;
  }

  body.sidebar-collapsed .style-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.sidebar-collapsed .style-option {
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.84rem;
  }

  body.sidebar-collapsed .style-option::after {
    content: none;
  }

  .nav-list {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
  }

  .style-switcher {
    order: 3;
    margin-top: 0;
  }

  .sidebar > .emergency-button {
    order: 4;
    width: auto;
    margin-top: 0;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    white-space: nowrap;
  }

  .dashboard-grid,
  .section-grid,
  .care-dashboard,
  .dashboard-bottom,
  .command-state,
  .command-grid,
  .connected-strip,
  .connected-signals,
  .community-grid,
  .insight-grid,
  .informal-grid,
  .relief-steps,
  .document-grid,
  .document-grid.lower,
  .benefit-grid,
  .benefit-grid.lower,
  .capacity-layout,
  .needs-matrix,
  .needs-radar-layout,
  .status-strip,
  .status-metrics,
  .emergency-call-grid,
  .split,
  .page-hero,
  .investor-points,
  .entry-body {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 24px;
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
  }

  .care-radar {
    min-height: 520px;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 14px;
  }

  .topbar,
  .person-card,
  .timeline-item,
  .medicine-item,
  .service-item,
  .task-item {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .topbar-actions button {
    width: 100%;
    min-width: 0;
    padding-inline: 10px;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }

  .product-info-dialog .dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar-actions button span,
  .primary-button span,
  .ghost-button span,
  .small-button span,
  .emergency-button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .service-record summary,
  .service-detail,
  .life-card-layout,
  .device-card,
  .profile-grid,
  .investor-points,
  .screening-list label,
  .document-checklist div {
    grid-template-columns: 1fr;
  }

  .service-record summary > .pill {
    justify-self: start;
  }

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

  .style-options {
    grid-template-columns: 1fr;
  }

  .gauge-row {
    grid-template-columns: 1fr;
  }

  .status-strip,
  .surface-panel,
  .page-hero {
    border-radius: 18px;
  }

  .card,
  .surface-panel,
  .page-hero,
  .command-state,
  .risk-panel,
  .insight-panel,
  .timeline-panel,
  .radar-panel,
  .service-board,
  .service-workspace,
  .needs-radar-panel,
  .needs-radar-layout,
  .care-radar {
    min-width: 0;
    max-width: 100%;
  }

  .service-tabs {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .service-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .funnel-step {
    width: 100% !important;
  }

  .capacity-track {
    min-height: 46px;
  }

  .capacity-slot small {
    display: none;
  }

  .capacity-slot {
    min-width: 32px;
    padding-right: 2px;
  }

  .capacity-legend {
    margin-left: 0;
  }

  .next-item,
  .signal-row,
  .command-timeline-item,
  .imbalance-visual {
    grid-template-columns: 1fr;
  }

  .command-copy h2 {
    font-size: 1.75rem;
  }

  .command-actions {
    grid-template-columns: 1fr;
  }

  .care-radar {
    min-height: 500px;
  }

  .radar-node {
    width: 78px;
  }

  .radar-node small {
    display: none;
  }

  .radar-senior {
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 480px) {
  .topbar-actions {
    grid-template-columns: 1fr;
  }
}
