/* Palette: slate ink on a cool sage-grey ground, with a deep sea-green for action.
   Amber and brick are reserved for attention and concern so they always mean something. */
:root {
  color-scheme: light;
  --ground: #eef2f2;
  --panel: #ffffff;
  --ink: #14283a;
  --ink-soft: #51606c;
  --line: #d2dadc;
  --action: #1e5a73;
  --brass: #b08a3e;
  --navy: #102536;
  --action-ink: #ffffff;
  --attention: #8a5a00;
  --attention-bg: #fbf0d9;
  --concern: #a3332b;
  --concern-bg: #f8e2df;
  --ok: #2f6f5e;
  --focus: #1f6fb5;
  --font: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #151c21;
    --panel: #1d262c;
    --ink: #e6ebe7;
    --ink-soft: #a3b0ab;
    --line: #34413f;
    --action: #7fb8cf;
    --brass: #d1ad62;
    --navy: #0b1a26;
    --action-ink: #0f1a17;
    --attention: #f0c36a;
    --attention-bg: #3a2f17;
    --concern: #f19a91;
    --concern-bg: #3d2220;
    --ok: #7fcab4;
    --focus: #8cc0f0;
  }
}

* { box-sizing: border-box; }
html { font-size: 106.25%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); line-height: 1.55; }
a { color: var(--action); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2 { line-height: 1.2; font-weight: 700; }
h1 { font-size: 1.9rem; margin: 0 0 0.35rem; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; margin: 2rem 0 0.75rem; }
.panel h2, .approval h2 { margin-top: 0; }
code, .mono-block { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Shell */
.shell { display: grid; grid-template-columns: 17rem minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #dfe7e3; padding: 1.5rem 1.25rem; display: flex; flex-direction: column; gap: 1.5rem; }
@media (prefers-color-scheme: dark) { .side { background: #0e1418; } }
.brand-name { color: #fff; font-weight: 700; font-size: 1.1rem; text-decoration: none; display: block; }
.brand-loc { color: #a9bab3; font-size: 0.9rem; }
.side nav { display: flex; flex-direction: column; }
.side nav a { color: #dfe7e3; text-decoration: none; padding: 0.45rem 0.6rem; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; }
.side nav a:hover { background: rgba(255, 255, 255, 0.07); }
.side nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: inset 3px 0 0 #7fcab4; }
.agent-nav a { font-size: 0.92rem; }
.nav-head { color: #a9bab3; font-size: 0.85rem; margin: 0 0 0.3rem 0.6rem; }
.count { background: #f0c36a; color: #1d2b36; border-radius: 999px; font-size: 0.8rem; font-weight: 700; padding: 0 0.5rem; }
.who { margin-top: auto; font-size: 0.92rem; }
.who p { margin: 0 0 0.25rem; }
.who span { display: block; color: #a9bab3; }
.side .text-btn { color: #dfe7e3; }

.main { padding: 2rem clamp(1rem, 4vw, 3rem) 4rem; max-width: 72rem; width: 100%; }
.page-head { margin-bottom: 1.5rem; max-width: 46rem; }
.lede { color: var(--ink-soft); margin: 0; }
.crumb { margin: 0 0 0.4rem; font-size: 0.92rem; }
.muted { color: var(--ink-soft); }
.hint { color: var(--ink-soft); font-size: 0.92rem; max-width: 46rem; }
.ok-text { color: var(--ok); font-weight: 700; }
.err-text { color: var(--concern); font-weight: 700; }

.banner { background: var(--attention-bg); color: var(--attention); border-radius: 8px; padding: 0.6rem 0.9rem; margin: 0 0 1.25rem; font-size: 0.95rem; }
.flash { border-radius: 8px; padding: 0.7rem 0.9rem; margin: 0 0 1.25rem; background: var(--panel); border-left: 4px solid var(--ok); }
.flash.error { border-left-color: var(--concern); background: var(--concern-bg); }

/* The day timeline: the one distinctive element */
.day { background: var(--panel); border-radius: 12px; padding: 1.25rem 1.5rem 1rem; margin-bottom: 1.5rem; border: 1px solid var(--line); }
.day-hours { position: relative; height: 1.4rem; font-size: 0.82rem; color: var(--ink-soft); }
.day-hours span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.day-hours span:first-child { transform: none; }
.day-hours span:last-child { transform: translateX(-100%); }
.day-track { position: relative; height: 2.6rem; border-radius: 999px;
  background: repeating-linear-gradient(90deg, var(--ground) 0 calc(25% - 1px), var(--line) calc(25% - 1px) 25%); }
.day-now { position: absolute; top: -0.3rem; bottom: -0.3rem; width: 2px; background: var(--ink); }
.day-mark { position: absolute; top: 50%; width: 1.1rem; height: 1.1rem; border-radius: 50%; transform: translate(-50%, -50%); border: 3px solid var(--panel); }
.day-mark.done, .k.done { background: var(--action); }
.day-mark.upcoming, .k.upcoming { background: var(--panel); box-shadow: inset 0 0 0 3px var(--action); }
.day-mark.failed, .k.failed { background: var(--concern); }
.day-mark:hover { transform: translate(-50%, -50%) scale(1.25); }
.day-key { font-size: 0.85rem; color: var(--ink-soft); margin: 0.75rem 0 0; display: flex; gap: 0.4rem 1rem; flex-wrap: wrap; align-items: center; }
.k { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; margin-right: 0.3rem; vertical-align: -0.05rem; }
@media (prefers-reduced-motion: no-preference) { .day-mark { transition: transform 120ms ease; } }

.callout { display: block; background: var(--attention-bg); color: var(--ink); border-left: 4px solid var(--attention); border-radius: 8px; padding: 0.8rem 1rem; text-decoration: none; margin: 0 0 1.5rem; }
.callout strong { color: var(--attention); }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; color: var(--ink-soft); font-size: 0.88rem; background: var(--ground); }
tbody tr:last-child td { border-bottom: 0; }
tr.attention td:first-child { box-shadow: inset 4px 0 0 var(--attention); }
tr.concern td { background: var(--concern-bg); }
tr.concern td:first-child { box-shadow: inset 4px 0 0 var(--concern); }
table.report td:last-child { min-width: 16rem; }
table.report td:first-child { white-space: nowrap; }

.tag { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 0.05rem 0.55rem; border-radius: 999px; background: var(--ground); color: var(--ink-soft); border: 1px solid var(--line); }
.tag.active { color: var(--ok); border-color: currentColor; }
.tag.pilot { color: var(--attention); border-color: currentColor; }
.tag.failed { color: var(--concern); border-color: currentColor; background: var(--concern-bg); }

/* Panels and forms */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }
.cols .panel { margin-bottom: 0; }
.cols + .panel, .cols + section { margin-top: 1.25rem; }
.plain { list-style: none; padding: 0; margin: 0; }
.mono-block { background: var(--ground); padding: 0.6rem 0.8rem; border-radius: 6px; overflow-wrap: anywhere; }
label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 700; font-size: 0.95rem; }
label.check { flex-direction: row; align-items: center; gap: 0.55rem; }
input[type="text"], input[type="email"], input[type="password"], input:not([type]) {
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0.55rem 0.7rem; font-weight: 400; }
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: var(--action); }
.settings { display: flex; flex-direction: column; gap: 0.9rem; max-width: 32rem; margin-bottom: 0.75rem; }
.settings .btn { align-self: flex-start; }
.inline-form { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.btn { font: inherit; font-weight: 700; background: var(--action); color: var(--action-ink); border: 0; border-radius: 8px; padding: 0.55rem 1.1rem; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.text-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--action); cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }

/* Run summary */
.summary { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 1.5rem; }
.summary div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.9rem; min-width: 9rem; }
.summary dt { font-size: 0.85rem; color: var(--ink-soft); }
.summary dd { margin: 0; font-size: 1.35rem; font-weight: 700; }

/* Approvals */
.approval { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--action); border-radius: 12px; padding: 1.25rem 1.5rem; margin-bottom: 1rem; max-width: 52rem; }
.approval h2 { margin-bottom: 0.1rem; }
.approval > .muted { margin: 0 0 0.9rem; font-size: 0.92rem; }
.approval dl { display: grid; grid-template-columns: 9rem 1fr; gap: 0.5rem 1rem; margin: 0 0 1rem; }
.approval dt { color: var(--ink-soft); font-size: 0.92rem; }
.approval dd { margin: 0; }
.approval pre { margin: 0; white-space: pre-wrap; font-family: var(--font); background: var(--ground); padding: 0.75rem 0.9rem; border-radius: 8px; }
.actions { display: flex; gap: 0.6rem; }

/* Sign in */
.solo { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 2rem; width: min(26rem, 100%); display: flex; flex-direction: column; gap: 1rem; }
.login h1 { font-size: 1.5rem; }

@media (max-width: 52rem) {
  .shell { grid-template-columns: 1fr; }
  .side { padding: 1rem; gap: 0.75rem; }
  .side nav { flex-direction: row; flex-wrap: wrap; gap: 0.25rem; }
  .side .agent-nav { display: none; }
  .who { margin-top: 0; display: flex; justify-content: space-between; align-items: center; }
  .cols { grid-template-columns: 1fr; }
  .approval dl { grid-template-columns: 1fr; }
}

/* Hosted edition additions */
.count.alert { background: #f19a91; }
.banner.trial { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.callout.concern-callout { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--concern-bg); border-left-color: var(--concern); }
.callout.concern-callout strong { color: var(--concern); }
select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0.55rem 0.7rem; font-weight: 400; }
textarea { width: 100%; line-height: 1.45; }
.settings.full { max-width: none; }
.login.wide { width: min(34rem, 100%); }
.legal p { max-width: 60ch; }
.prewrap { white-space: pre-wrap; }
.row-actions { display: flex; gap: 1rem; white-space: nowrap; }
.mini-form { display: flex; gap: 0.5rem; align-items: center; }
.mini-form select { padding: 0.25rem 0.4rem; font-size: 0.9rem; }
.panel.notice { border-left: 4px solid var(--attention); }
.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.tabs a { padding: 0.35rem 0.8rem; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); background: var(--panel); font-size: 0.92rem; }
.tabs a[aria-current="page"] { background: var(--action); color: var(--action-ink); border-color: var(--action); }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.25rem; }
.chart { margin: 0; }
.chart figcaption { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 0.35rem; }
.chart figcaption strong { color: var(--ink); font-size: 1.25rem; }
.bars { width: 100%; height: 4.5rem; display: block; background: var(--ground); border-radius: 6px; }
.bars rect { fill: var(--action); }
.who a { color: inherit; }

/* Claude in Chrome agents */
.steps { padding-left: 1.2rem; margin: 0 0 0.75rem; }
.steps li { margin-bottom: 0.6rem; }
.copy-row { display: flex; gap: 0.6rem; align-items: flex-start; margin-top: 0.4rem; }
.copy-row .mono-block { flex: 1; margin: 0; }
.copy-row.end { justify-content: flex-end; margin: 0 0 0.75rem; }
pre.brief { white-space: pre-wrap; font-family: var(--font); background: var(--ground); padding: 1rem 1.1rem; border-radius: 8px; margin: 0; line-height: 1.55; }
.qr { width: 11rem; margin: 0.6rem 0; background: #fff; padding: 0.5rem; border-radius: 8px; border: 1px solid var(--line); }
.qr svg { width: 100%; height: auto; display: block; }


/* CareHelm brand */
.mark { width: 1.6rem; height: 1.6rem; color: var(--brass); flex: none; }
.brand-name { display: flex; align-items: center; gap: 0.55rem; }
.brand-name sup, .login-brand sup, .site-brand sup, .foot-brand sup { font-size: 0.55em; font-weight: 400; }
.login-brand { display: flex; align-items: center; gap: 0.55rem; font-size: 1.5rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.login-brand .mark { width: 2rem; height: 2rem; }
.login-brand.standalone { justify-content: center; margin-bottom: 1rem; }
.side nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--brass); }

/* Public site */
.site { width: min(68rem, 100%); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); align-self: stretch; }
.site-head { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 0; gap: 1rem; flex-wrap: wrap; }
.site-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.site-brand .mark { width: 2.1rem; height: 2.1rem; }
.site-nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; }
.site-nav a:not(.btn):hover { text-decoration: underline; }
.hero { padding: clamp(2.5rem, 8vw, 5.5rem) 0 clamp(2rem, 6vw, 4rem); max-width: 46rem; }
.hero-kicker { color: var(--brass); font-weight: 700; margin: 0 0 0.75rem; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 1.25rem; }
.hero-lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 40rem; margin: 0 0 1.75rem; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.band { padding: clamp(2rem, 6vw, 3.5rem) 0; border-top: 1px solid var(--line); }
.band h2 { font-size: 1.6rem; margin: 0 0 1.25rem; }
.band h3 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.band p { max-width: 38rem; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.cols2 { display: grid; grid-template-columns: 3fr 2fr; gap: 2rem; align-items: start; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 0.45rem 0 0.45rem 1.6rem; position: relative; border-bottom: 1px solid var(--line); }
.checks li::before { content: ""; position: absolute; left: 0.2rem; top: 0.95rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--brass); }
.price-card { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--brass); border-radius: 12px; padding: 1.5rem 1.75rem; max-width: 30rem; }
.price { font-size: 1.05rem; color: var(--ink-soft); margin: 0 0 0.5rem; }
.price span { font-size: 2.4rem; font-weight: 700; color: var(--ink); margin-right: 0.25rem; }
.site-foot { border-top: 1px solid var(--line); padding: 2rem 0 3rem; color: var(--ink-soft); font-size: 0.95rem; }
.foot-brand { display: flex; align-items: center; gap: 0.5rem; color: var(--ink); font-weight: 700; margin: 0 0 0.25rem; }
.foot-links { display: flex; gap: 1.25rem; }
@media (max-width: 52rem) { .cols3, .cols2 { grid-template-columns: 1fr; } }
a.btn { text-decoration: none; display: inline-block; }
