:root {
  color-scheme: light;
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-size: 100%;
  color: #1b302e;
  background: #f4f6f4;
  --ink: #1b302e;
  --muted: #51635e;
  --edge: #d7dfda;
  --accent: #086358;
  --accent-dark: #034d44;
  --focus: #0876b3;
  --paper: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; line-height: 1.5; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.18; text-wrap: balance; }
h1 { font-size: clamp(1.85rem, 4vw, 2.7rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.2rem, 2.2vw, 1.55rem); letter-spacing: -.025em; }
h3 { font-size: 1.1rem; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; }
button, summary, input[type="checkbox"], input[type="radio"] { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.app-header {
  background: #123c36; color: #fff; border-bottom: 3px solid #9dc9b5;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4.5rem;
}
.header-inner, .shell {
  width: min(72rem, calc(100% - 3rem)); margin-inline: auto;
}
.brand, .app-header a.brand {
  display: inline-flex; align-items: center; gap: .65rem; color: #fff;
  font-weight: 720; letter-spacing: .02em; font-size: 1.04rem; text-decoration: none;
}
.brand-mark {
  width: 2rem; height: 2rem; flex: 0 0 2rem; display: inline-grid; place-items: center;
  border: 1px solid #b2d5c4; border-radius: .45rem; color: #ecfaf3; font-size: .97rem;
}
.header-tools, .actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .85rem;
}
.header-tools { justify-content: flex-end; font-size: .95rem; }
.header-tools a, .app-header .quiet {
  color: #eff8f4; text-underline-offset: .2em;
}
.app-header :focus-visible { outline-color: #aad9ff; }
.header-tools form, .actions form { margin: 0; }
main.shell, .shell > main { padding-block: clamp(1.6rem, 4vw, 3.4rem) 4rem; }
.page-head, .section-head, .card-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .85rem 1.25rem;
}
.page-head { margin-bottom: 2.1rem; }
.page-head:has(> h1), .section-head:has(> h2):has(> p) { align-items: baseline; }
.eyebrow {
  display: block; margin-bottom: .45rem; color: var(--accent);
  font-weight: 700; font-size: .82rem; letter-spacing: .04em;
}
.muted, .subtitle, small, .field-hint { color: var(--muted); }
.subtitle { max-width: 64ch; margin-top: .55rem; }
.section + .section, section + section { margin-top: 2.25rem; }
.section-head { margin-bottom: 1rem; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: 1rem; align-items: stretch;
}
.card, .table-wrap, .stat {
  background: var(--paper); border: 1px solid var(--edge); border-radius: .7rem;
}
.card, .form-card, .auth-card { padding: clamp(1rem, 2.5vw, 1.75rem); }
.card, .stat, .field { min-width: 0; }
.card h2, .card h3, .data-table td, .profile-details dd, .header-tools {
  overflow-wrap: anywhere;
}
.card .actions { margin-top: 1.25rem; }
.badge {
  display: inline-flex; align-items: center; max-width: 100%; padding: .15rem .57rem;
  border-radius: 1rem; font-weight: 650; font-size: .82rem; background: #e8eeeb; color: #344a43;
}
.is-on { background: #e4f3eb; color: #15543c; }
.is-off { background: #f0efeb; color: #554f40; }
.profile-details {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem 1rem;
  align-items: baseline; margin: 1rem 0;
}
.profile-details > div { display: contents; }
.profile-details dt { color: var(--muted); }
.profile-details dd { font-weight: 600; }

.button, button {
  display: inline-flex; justify-content: center; align-items: center; vertical-align: middle;
  min-height: 2.65rem; max-width: 100%; gap: .4rem; padding: .48rem .9rem;
  border: 1px solid #b5c5bb; border-radius: .45rem; font-weight: 650;
  background: #fff; color: var(--accent-dark); text-decoration: none; line-height: 1.25;
}
.button:hover, button:hover { background: #edf4ef; color: var(--accent-dark); }
.button.primary, button.primary {
  color: #fff; background: var(--accent); border-color: var(--accent);
}
.primary:hover, button.primary:hover, a.button.primary:hover { background: var(--accent-dark); }
.quiet { background: transparent; border-color: transparent; }
.app-header .quiet:hover { background: #22524a; }
button:disabled { color: #526159; background: #e8ede9; cursor: default; border-color: #d0dad3; }
.notice, .error {
  margin-bottom: 1rem; border: 1px solid #b7d4c7; border-left: 4px solid #338665;
  border-radius: .4rem; padding: .8rem 1rem; color: #1c4939; background: #eef8f1;
  overflow-wrap: anywhere;
}
.error { border-color: #e2bdbc; border-left-color: #a73436; color: #812b2d; background: #fff3f0; }
.empty { padding: 1.5rem; border: 1px dashed #b9c9bf; border-radius: .6rem; color: var(--muted); }
.empty a { font-weight: 650; }

.auth { margin-inline: auto; }
main.auth { padding-block: clamp(2rem, 7vh, 5.5rem); }
.form-card { max-width: 46rem; }
.auth-card { width: min(100%, 29rem); margin-inline: auto; }
.form-card h1 + p, .auth-card h1 + p { margin-top: .55rem; }
.form-card form, .auth-card form { margin-top: 1.25rem; }
.form-card form:first-child, .auth-card form:first-child { margin-top: 0; }
.field { display: grid; gap: .35rem; margin: 0 0 1.05rem; }
.field > label, label.field, legend { font-weight: 650; }
.field small, .field .muted { font-weight: 400; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 0 1rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]), select, textarea {
  width: 100%; min-width: 0; min-height: 2.8rem; border: 1px solid #99afa3; border-radius: .4rem;
  padding: .57rem .7rem; font-weight: 400; background: #fff; color: var(--ink);
}
input[type="checkbox"], input[type="radio"] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
fieldset { min-width: 0; margin: 1rem 0; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: .45rem; }
.check-row {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 2.5rem;
}
.days { display: flex; flex-wrap: wrap; gap: .25rem .6rem; }
.days label {
  padding: .15rem .5rem; background: #f5f8f6; border: 1px solid var(--edge); border-radius: .4rem;
}
.form-card .actions, .auth-card .actions { margin-top: 1.25rem; }
.auth-card form + p, .fields, .days + .field, .form-card + .notice { margin-top: 1rem; }
input[type="time"] { max-width: 12rem; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: .72rem .95rem; text-align: left; border-bottom: 1px solid var(--edge); vertical-align: top; }
th { font-weight: 650; font-size: .88rem; background: #eaf0eb; color: #314b40; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:focus-within { background: #f4f8f4; }
caption { font-weight: 650; text-align: left; padding: .7rem .95rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .8rem; margin-block: 1rem 1.4rem; }
.stat { padding: .85rem 1rem; overflow-wrap: anywhere; }
.stat strong, .stat dd { display: block; color: var(--accent-dark); font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span, .stat dt { color: var(--muted); font-size: .9rem; }

@media (max-width: 42rem) {
  .header-inner, .shell { width: calc(100% - 2rem); }
  .header-inner { flex-wrap: wrap; padding-block: .7rem; gap: .5rem 1rem; }
  .header-tools { justify-content: flex-start; gap: .25rem .75rem; }
  .page-head { margin-bottom: 1.4rem; }
  .page-head .actions { width: 100%; }
  .profile-details { grid-template-columns: 1fr; gap: 0; }
  .profile-details dd + dt, .profile-details > div + div dt { margin-top: .4rem; }
  td, th { padding: .6rem .65rem; }
  .data-table { min-width: 34rem; }
}
@media print {
  .app-header, .actions { display: none; }
  body { background: white; }
  .shell { width: 100%; }
  .table-wrap { overflow: visible; }
  .data-table { min-width: 0; }
  tr, .card { break-inside: avoid; }
}
