:root {
  --surface: #ffffff; --surface-2: #f6f8fb; --line: #e3e8ef;
  --ink: #0f172a; --ink-2: #475569; --ink-3: #94a3b8;
  --brand: #0d9488; --brand-soft: #ccfbf1;
  --warn: #b45309; --warn-soft: #fef3c7;
  --low: #1d4ed8; --low-soft: #dbeafe;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--surface-2); color: var(--ink); min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; line-height: 1.5; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: .875rem; font-weight: 600; }
.sub { margin-top: .25rem; font-size: .875rem; color: var(--ink-2); }
.hint { font-size: .75rem; color: var(--ink-3); margin-bottom: .75rem; }
.muted { color: var(--ink-3); }
.strong { font-weight: 500; }
.mb { margin-bottom: 1rem; }
.card { background: var(--surface); border-radius: 1rem; padding: 1.25rem; box-shadow: 0 0 0 1px var(--line); }

/* Sign-in */
.center { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 1.5rem; }
.login { width: 100%; max-width: 24rem; padding: 2rem; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0,0,0,.05); }
.login h1 { font-size: 1.25rem; }
.login .sub { margin-bottom: 1.5rem; }
.login label { display: block; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.login input[type=email], .login input[type=password], .login input[type=text] {
  display: block; width: 100%; margin: .375rem 0 1rem; padding: .5rem .75rem; font: inherit; font-size: .875rem;
  border: 1px solid var(--line); border-radius: .5rem; background: #fff; outline: none; }
.login input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,148,136,.2); }
.login input[type=password] { margin-bottom: 1.5rem; }
.alert { margin: -0.5rem 0 1rem; padding: .5rem .75rem; font-size: .875rem; color: #b91c1c; background: #fef2f2;
  border-radius: .5rem; box-shadow: 0 0 0 1px #fecaca; }
button { font: inherit; cursor: pointer; }
.primary { width: 100%; padding: .625rem 1rem; font-size: .875rem; font-weight: 600; color: #fff; background: var(--brand);
  border: 0; border-radius: .5rem; }
.primary:hover { opacity: .9; }
.links { margin-top: 1rem; font-size: .8125rem; color: var(--ink-3); text-align: center; }
.links a, .link { color: var(--ink-2); text-decoration: underline; background: none; border: 0; padding: 0; font-size: inherit; }

/* Dashboard */
.wrap { max-width: 64rem; margin: 0 auto; padding: 2.5rem 1.25rem; }
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 2rem; }
.ghost { padding: .375rem .75rem; font-size: .875rem; font-weight: 500; color: var(--ink-2); background: var(--surface);
  border: 0; border-radius: .5rem; box-shadow: 0 0 0 1px var(--line); }
.ghost:hover { color: var(--ink); }
.empty { padding: 2rem; text-align: center; }
.empty .sub { max-width: 28rem; margin: .25rem auto 0; }
.grid { display: grid; gap: 1rem; margin-bottom: 2rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.metric .label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.metric .value { margin-top: .5rem; }
.metric .num { font-size: 1.875rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.metric .unit { font-size: .875rem; color: var(--ink-3); }
.delta { margin-top: .25rem; font-size: .875rem; font-variant-numeric: tabular-nums; }
.delta.good { color: var(--brand); } .delta.warn { color: var(--warn); }
.range { margin-top: .75rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.pill { border-radius: 999px; padding: .125rem .5rem; font-size: .75rem; font-weight: 500; }
.pill.below { background: var(--low-soft); color: var(--low); }
.pill.within { background: var(--brand-soft); color: var(--brand); }
.pill.above { background: var(--warn-soft); color: var(--warn); }
.norm { font-size: .75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart { margin-bottom: 2rem; }
.chart .hint { margin-bottom: 1rem; }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: .75rem; font-size: .75rem; color: var(--ink-2); }
.legend span { display: flex; align-items: center; gap: .375rem; }
.dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; }
.c1 { background: #0d9488; } .c2 { background: #1d4ed8; } .c3 { background: #b45309; }
.chart-box { position: relative; height: 18rem; }
.others ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.others li { border-radius: 999px; padding: .25rem .75rem; font-size: .75rem; color: var(--ink-2); background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line); }

/* SuperUser profile picker */
.superbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 2rem; padding: .875rem 1.25rem; }
.superbar label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.superbar select { flex: 1; min-width: 14rem; padding: .4rem .6rem; font: inherit; font-size: .875rem; border: 1px solid var(--line);
  border-radius: .5rem; background: #fff; }
.badge { border-radius: 999px; padding: .125rem .5rem; font-size: .75rem; font-weight: 600; background: #ede9fe; color: #6d28d9; }

/* Tabs */
.tabs { display: flex; gap: .25rem; margin: -0.75rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .5rem .875rem; font-size: .875rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.btn { display: inline-block; text-decoration: none; line-height: 1.4; }
a.primary.btn { width: auto; padding: .4rem .875rem; }
.flash { margin-bottom: 1rem; padding: .5rem .75rem; font-size: .875rem; color: var(--brand); background: var(--brand-soft); border-radius: .5rem; }
.grow { flex: 1; }
.link-s { font-size: .8125rem; color: var(--ink-2); }

/* Calendar */
.cal { margin-bottom: 1.5rem; }
.cal-head { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.cal-head h2 { font-size: 1rem; min-width: 9rem; text-align: center; }
.cal-head .ghost.btn { padding: .25rem .625rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: .75rem; overflow: hidden; }
.dow { background: var(--surface-2); padding: .375rem; font-size: .6875rem; font-weight: 600; text-transform: uppercase; color: var(--ink-3); text-align: center; }
.day { background: #fff; min-height: 5.25rem; padding: .25rem .25rem .375rem; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.day.out { background: #fbfcfd; }
.day.out .dnum { color: #cbd5e1; }
.day.future .dnum { color: #cbd5e1; }
.dnum { align-self: flex-end; font-size: .75rem; color: var(--ink-2); text-decoration: none; width: 1.6rem; height: 1.6rem; line-height: 1.6rem;
  text-align: center; border-radius: 50%; }
a.dnum:hover { background: var(--brand-soft); color: var(--brand); }
.day.today .dnum { background: var(--brand); color: #fff; font-weight: 600; }
.ep { display: block; font-size: .6875rem; line-height: 1.25rem; height: 1.25rem; padding: 0 .375rem; border-radius: .25rem; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep.first { border-left: 3px solid currentColor; }
.d-self { background: #fef3c7; color: #92400e; }
.d-clinical { background: #dbeafe; color: #1e40af; }
.d-confirmed { background: #fee2e2; color: #b91c1c; }
.dot.d-self { background: #f59e0b; } .dot.d-clinical { background: #3b82f6; } .dot.d-confirmed { background: #ef4444; }
.cal .legend { margin: .75rem 0 0; }
@media (max-width: 640px) { .day { min-height: 3.5rem; } .ep { font-size: 0; height: .5rem; } .dow { font-size: .5625rem; } }

/* Episode list */
.ill-list { margin-bottom: 2rem; }
.ep-row { display: block; padding: .875rem 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.ep-row:hover .ep-name { color: var(--brand); }
.ep-main { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.ep-name { font-weight: 600; }
.pill.sev { background: var(--surface-2); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line); }
.pill.now { background: #ede9fe; color: #6d28d9; }
.ep-dates { margin-top: .25rem; font-size: .8125rem; color: var(--ink-2); }
.ep-det { margin-top: .25rem; font-size: .8125rem; color: var(--ink-2); }
.ep-det b { font-weight: 600; color: var(--ink); }
.ep-det.notes { color: var(--ink-3); }

/* Form */
.ill-form { margin-bottom: 1.5rem; padding: 1.5rem; }
.form-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.form-head h2 { font-size: 1.0625rem; }
.ill-form .alert { margin: 0 0 1rem; }
fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 1rem 0 1.25rem; }
legend { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: 0 .5rem 0 0; }
.ill-form .row { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; margin-top: .5rem; }
.ill-form label { font-size: .8125rem; color: var(--ink-2); display: flex; flex-direction: column; gap: .25rem; }
.ill-form label.block { margin-top: .75rem; }
.ill-form label.check { flex-direction: row; align-items: center; gap: .4rem; padding-bottom: .5rem; }
.ill-form input[type=date], .ill-form input[type=text], .ill-form select, .ill-form textarea {
  font: inherit; font-size: .875rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: .5rem; background: #fff; color: var(--ink); }
.ill-form textarea { width: 100%; resize: vertical; }
.ill-form input:focus, .ill-form select:focus, .ill-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,148,136,.2); }
.sym-groups { display: grid; gap: .875rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); margin-top: .5rem; }
.sym-title { font-size: .75rem; font-weight: 600; color: var(--ink); margin-bottom: .375rem; }
.sym-group { display: flex; flex-wrap: wrap; gap: .375rem; align-content: flex-start; }
.sym-title { flex-basis: 100%; }
.ill-form label.chip { display: inline-flex; flex-direction: row; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { padding: .25rem .625rem; font-size: .8125rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line); user-select: none; }
.chip input:checked + span { background: #fee2e2; color: #b91c1c; box-shadow: 0 0 0 1px #fca5a5; }
.chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.body-wrap { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; margin-top: .5rem; }
.body-fig { width: 100%; max-width: 21rem; flex: none; }
.body-fig g[data-r] { cursor: pointer; outline: none; }
.body-fig .sh { fill: #e2e8f0; stroke: #fff; stroke-width: 1.5; }
.body-fig .sh.dk { fill: #cbd5e1; }
.body-fig .lb { fill: none; stroke: #e2e8f0; stroke-linecap: round; stroke-linejoin: round; }
.body-fig g[data-r]:hover .sh, .body-fig g[data-r]:focus .sh { fill: #fecaca; }
.body-fig g[data-r]:hover .lb, .body-fig g[data-r]:focus .lb { stroke: #fecaca; }
.body-fig g.on .sh { fill: #f87171; } .body-fig g.on .sh.dk { fill: #dc2626; }
.body-fig g.on .lb { stroke: #f87171; }
.body-fig .cap { font-size: 13px; font-weight: 600; fill: var(--ink-3); text-anchor: middle; }
.body-fig .side { font-size: 11px; fill: var(--ink-3); text-anchor: middle; }
.region-list { flex: 1; min-width: 14rem; display: flex; flex-wrap: wrap; gap: .375rem; align-content: flex-start; }
.seg { display: inline-flex; border-radius: .5rem; box-shadow: 0 0 0 1px var(--line); overflow: hidden; align-self: flex-end; }
.ill-form .seg label { flex-direction: row; }
.seg input { position: absolute; opacity: 0; }
.seg span { padding: .45rem .875rem; font-size: .875rem; color: var(--ink-2); background: #fff; cursor: pointer; border-right: 1px solid var(--line); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--brand); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.form-foot { display: flex; gap: .75rem; justify-content: space-between; padding-top: 1rem; border-top: 1px solid var(--line); }
.primary.narrow { width: auto; padding: .55rem 1.5rem; }
.danger { padding: .5rem 1rem; font-size: .875rem; color: #b91c1c; background: #fff; border: 0; border-radius: .5rem; box-shadow: 0 0 0 1px #fecaca; }
.danger:hover { background: #fef2f2; }

/* Day by day */
.evo { margin-bottom: 1.5rem; }
.evo .form-head { align-items: flex-start; }
.evo-chart { position: relative; height: 13rem; margin-bottom: 1rem; }
.strip { display: flex; gap: .375rem; overflow-x: auto; padding: .25rem .125rem .5rem; scroll-snap-type: x proximity; }
.tile { flex: none; width: 4.5rem; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: .1rem;
  padding: .45rem .25rem; border-radius: .625rem; text-decoration: none; color: var(--ink); box-shadow: 0 0 0 1px var(--line); background: #fff; }
.tile:hover { box-shadow: 0 0 0 2px var(--brand); }
.tile.cur { box-shadow: 0 0 0 2px var(--ink); }
.tile.outside { opacity: .6; border: 1px dashed var(--ink-3); }
.t-dow { font-size: .625rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.t-date { font-size: .8125rem; font-weight: 600; }
.t-sev { font-size: .6875rem; font-weight: 500; }
.t-temp { font-size: .6875rem; color: #7c3aed; font-variant-numeric: tabular-nums; }
.tile.nolog { background: var(--surface-2); color: var(--ink-3); }
.tile.nolog .t-date { color: var(--ink-2); }
.tile.nolog .t-sev { color: var(--brand); }
.tile.s0, .dot.s0, .mini .s0 { background: #d1fae5; } .tile.s0 .t-sev { color: #047857; }
.tile.s1, .dot.s1, .mini .s1 { background: #fef3c7; } .tile.s1 .t-sev { color: #92400e; }
.tile.s2, .dot.s2, .mini .s2 { background: #fed7aa; } .tile.s2 .t-sev { color: #9a3412; }
.tile.s3, .dot.s3, .mini .s3 { background: #fecaca; } .tile.s3 .t-sev { color: #b91c1c; }
.tile.sx, .mini .sx { background: #e0e7ff; }
.dot.s0 { background: #34d399; } .dot.s1 { background: #fbbf24; } .dot.s2 { background: #f97316; } .dot.s3 { background: #dc2626; }
.dot.nolog { background: var(--surface-2); box-shadow: 0 0 0 1px var(--line); }
.evo .legend { margin: .5rem 0 0; }
.evo .sub a { color: var(--ink-2); }
.day-nav { display: flex; align-items: center; gap: .5rem; }
.day-nav .ghost.btn { padding: .25rem .625rem; }
.note { margin-bottom: 1rem; padding: .5rem .75rem; font-size: .8125rem; color: #1e40af; background: #eff6ff; border-radius: .5rem; }
.form-foot .btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.seg .sv0 { } .seg input:checked + .sv0 { background: #10b981; } .seg input:checked + .sv1 { background: #f59e0b; }
.seg input:checked + .sv2 { background: #f97316; } .seg input:checked + .sv3 { background: #dc2626; }
/* calendar bars: a logged day shows its severity as a stripe at the bottom */
.ep.logged { box-shadow: inset 0 -3px 0 #94a3b8; }
.ep.logged.s0 { box-shadow: inset 0 -3px 0 #34d399; } .ep.logged.s1 { box-shadow: inset 0 -3px 0 #fbbf24; }
.ep.logged.s2 { box-shadow: inset 0 -3px 0 #f97316; } .ep.logged.s3 { box-shadow: inset 0 -3px 0 #dc2626; }
.ep.cur { outline: 2px solid var(--ink); outline-offset: -1px; }
.ep:hover { filter: brightness(.95); }
/* tiny day-by-day bar in the episode list */
.mini { display: flex; gap: 2px; margin-top: .375rem; }
.mini i { width: .75rem; height: .375rem; border-radius: 2px; }
.mini .nolog { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }

/* Person switcher */
.people { display: flex; flex-wrap: wrap; gap: .375rem; margin: -1rem 0 1.25rem; }
.people a { padding: .3rem .8rem; font-size: .8125rem; font-weight: 500; color: var(--ink-2); text-decoration: none; background: var(--surface);
  border-radius: 999px; box-shadow: 0 0 0 1px var(--line); }
.people a:hover { color: var(--ink); }
.people a.on { background: var(--ink); color: #fff; box-shadow: none; }
.people a.fam { color: var(--brand); }
.people a.fam.on { background: var(--brand); color: #fff; }
.superbar + .people { margin-top: -1rem; }

/* Family page */
.fam-list { margin-bottom: 1.5rem; }
.fam-list h2 .badge { margin-right: .375rem; vertical-align: 1px; }
.fam-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .875rem 0; border-top: 1px solid var(--line); }
.fam-main { min-width: 12rem; }
.fam-main .pill { margin-left: .375rem; }
.fam-actions, .fam-link { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.fam-actions .ghost.btn { padding: .3rem .7rem; font-size: .8125rem; }
.fam-link select { font: inherit; font-size: .8125rem; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: .5rem; max-width: 16rem; }
.fam-link .ghost { padding: .3rem .7rem; font-size: .8125rem; }
.fam-form { max-width: 44rem; }
.flash a { color: inherit; font-weight: 600; }

/* Blood, stool and urine */
.kind { display: inline-block; border-radius: .375rem; padding: .05rem .45rem; font-size: .75rem; font-weight: 600; vertical-align: 1px; }
.k-blood { background: #fee2e2; color: #b91c1c; } .k-stool { background: #f5e6d3; color: #7c4a1e; } .k-urine { background: #fef9c3; color: #854d0e; }
.smp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.5rem; padding: .75rem 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .25rem; }
.filters a { padding: .3rem .75rem; font-size: .8125rem; font-weight: 500; color: var(--ink-2); text-decoration: none; border-radius: 999px; }
.filters a span { color: var(--ink-3); font-weight: 400; margin-left: .15rem; }
.filters a.on { background: var(--ink); color: #fff; } .filters a.on span { color: #cbd5e1; }
.btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.btns .ghost.btn { padding: .3rem .75rem; font-size: .8125rem; }
.smp-trend { margin-bottom: 1.5rem; }
.smp-trend select { font: inherit; font-size: .8125rem; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: .5rem; max-width: 60%; }
.smp-trend .hint { margin: .5rem 0 0; }
.ep-row.cur { background: linear-gradient(90deg, var(--brand-soft), transparent 40%); }
.ep-main .kind { margin-right: .125rem; }
.pill.fh-p { background: var(--warn-soft); color: var(--warn); }
.smp-view { margin-bottom: 1.5rem; }
.smp-view .form-head { align-items: flex-start; }
.smp-view h2 .kind { margin-right: .375rem; }
.ep-link { margin: -.5rem 0 1rem; } .ep-link a { color: var(--ink); }
.res-wrap { overflow-x: auto; }
table.res { width: 100%; border-collapse: collapse; font-size: .875rem; }
.res th { text-align: left; font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: .375rem .5rem; border-bottom: 1px solid var(--line); }
.res td { padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.res tr.panel th { padding-top: .875rem; color: var(--ink-2); text-transform: none; letter-spacing: 0; font-size: .8125rem; border-bottom: 0; }
.res td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.res .unit { font-size: .75rem; color: var(--ink-3); }
.res tr.off td:first-child { font-weight: 600; }
.res .pf { color: var(--warn); font-weight: 600; } .res .pd { font-size: .6875rem; }
.flag { display: inline-block; min-width: 4.25rem; font-size: .6875rem; font-weight: 600; text-align: center; border-radius: 999px; padding: .05rem .4rem; }
.flag.fn { background: var(--brand-soft); color: var(--brand); } .flag.fl { background: var(--low-soft); color: var(--low); }
.flag.fh { background: var(--warn-soft); color: var(--warn); } .flag.fa { background: #fee2e2; color: #b91c1c; }
.obs-view { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: 1rem; }
.pill.obs { background: var(--surface-2); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line); }
.pill.alertp { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.files { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.file { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; font-size: .8125rem; color: var(--ink); text-decoration: none; border-radius: .5rem; box-shadow: 0 0 0 1px var(--line); }
.file:hover { box-shadow: 0 0 0 1px var(--brand); }
.file .ext { font-size: .625rem; font-weight: 700; color: #fff; background: var(--ink-2); border-radius: .25rem; padding: .05rem .3rem; }
.smp-view .notes { margin-top: 1rem; }
/* form */
.smp-form [hidden] { display: none !important; }
.ill-form input[type=time], .ill-form input[type=number], .ill-form input[type=file] { font: inherit; font-size: .875rem; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: .5rem; background: #fff; color: var(--ink); }
.ill-form input.short { width: 6rem; }
.rows { display: flex; flex-direction: column; gap: .375rem; margin-top: .25rem; }
.res-row { display: grid; grid-template-columns: minmax(9rem, 1.4fr) 7rem 6.5rem 9.5rem 4.75rem 1.75rem; gap: .5rem; align-items: center; padding: .25rem 0; border-bottom: 1px dashed var(--line); }
.res-row .mk { font-size: .875rem; font-weight: 500; }
.res-row input, .res-row select { width: 100%; min-width: 0; font: inherit; font-size: .875rem; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: .4rem; background: #fff; }
.res-row .rg { display: flex; align-items: center; gap: .25rem; color: var(--ink-3); }
.res-row .qn { grid-column: span 2; font-size: .75rem; color: var(--ink-3); }
.res-row .x { border: 0; background: none; font-size: 1.125rem; color: var(--ink-3); line-height: 1; padding: .25rem; }
.res-row .x:hover { color: #b91c1c; }
@media (max-width: 720px) {
  .res-row { grid-template-columns: 1fr 1fr 1.75rem; }
  .res-row .rn { grid-column: 1 / 3; } .res-row .x { grid-column: 3; grid-row: 1; }
  .res-row .rg, .res-row .qn { grid-column: span 2; }
}
.add-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .75rem; }
.add-row select { font: inherit; font-size: .875rem; padding: .4rem .55rem; border: 1px solid var(--brand); color: var(--brand); border-radius: .5rem; background: #fff; }
.panels { display: flex; flex-wrap: wrap; gap: .375rem; }
.chip-btn { padding: .25rem .625rem; font-size: .75rem; border: 0; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.chip-btn:hover { filter: brightness(.96); }
.add-row .ghost { padding: .3rem .7rem; font-size: .8125rem; }
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; flex-basis: 100%; }
.swatches .lbl { font-size: .8125rem; color: var(--ink-2); margin-right: .375rem; }
.swatches .hint { margin: 0 0 0 .5rem; }
.ill-form label.sw { flex-direction: row; cursor: pointer; }
.sw input { position: absolute; opacity: 0; }
.sw span { display: inline-block; width: 2rem; height: 2rem; line-height: 2rem; text-align: center; font-size: .75rem; font-weight: 600; color: rgba(0,0,0,.55); border-radius: .4rem; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.sw input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.sw input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 3px; }
.uc1 { background: #fdfde3; } .uc2 { background: #fbf8b6; } .uc3 { background: #f8ef8c; } .uc4 { background: #f3e15f; }
.uc5 { background: #ebcd37; } .uc6 { background: #dab323; color: #fff !important; } .uc7 { background: #c29517; color: #fff !important; } .uc8 { background: #9c6f10; color: #fff !important; }
.pill.obs.uc1, .pill.obs.uc2, .pill.obs.uc3, .pill.obs.uc4, .pill.obs.uc5 { color: var(--ink); }
.file-keep { margin-bottom: .5rem; } .file-keep a { color: var(--ink); }
.ill-form fieldset.obs .row { align-items: flex-end; }
.ep-tests { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.ep-tests .lbl { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-right: .25rem; }
.ep-tests a.pill { text-decoration: none; }
/* keep long selects and file inputs inside the card on phones */
.ill-form label { min-width: 0; max-width: 100%; }
.ill-form select, .ill-form input[type=file], .ill-form input[type=text] { max-width: 100%; }
.smp-form label.grow select { width: 100%; }
@media (max-width: 640px) {
  .smp-form .row > label.grow { flex-basis: 100%; }
  .ill-form input[type=file] { width: 100%; }
}
