:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --paper: #fff;
  --ink: #172a23;
  --muted: #53675c;
  --soft: #e5ece3;
  --line: #dee7de;
  --green: #19553f;
  --green-dark: #133f30;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sidebar-width: 232px;
}
* { box-sizing: border-box; }
html { min-width: 280px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.55 var(--sans); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; cursor: pointer; }
button, fieldset { margin: 0; }
button:disabled { cursor: default; opacity: .65; }
h1, h2, h3, p, ul, ol, dl { margin: 0; }
h1 { font: 400 clamp(2.1rem, 4vw, 3.5rem)/1.04 var(--serif); letter-spacing: -.045em; }
h2 { font-size: 1.25rem; line-height: 1.28; letter-spacing: -.035em; }
h3 { line-height: 1.27; letter-spacing: -.025em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #418a69; outline-offset: 3px; }
#main-content:focus { outline: none; }
.skip-link { position: fixed; z-index: 99; left: 1rem; top: 1rem; background: var(--paper); padding: .75rem; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.icon { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; vertical-align: middle; }
.small { font-size: .875rem; }
.muted { color: var(--muted); }

.sidebar {
  position: fixed; z-index: 1; inset: 0 auto 0 0; width: var(--sidebar-width);
  display: flex; flex-direction: column; padding: 30px 18px 22px;
  background: #fff; border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; width: fit-content; font-weight: 740; letter-spacing: -.025em; }
.sidebar .brand { margin: 0 0 46px 9px; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 12px; background: var(--green); color: #eff5de;
}
.brand-mark .icon { width: 23px; height: 23px; }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-nav a, .side-settings {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 48px;
  border: 0; border-radius: 11px; color: var(--muted); background: transparent; font-weight: 620; font-size: .9375rem;
}
.side-nav a:hover, .side-settings:hover { background: #f2f6f0; color: var(--green); }
.side-nav [aria-current="page"] { background: #e8f1e9; color: #174b36; }
.side-footer { margin-top: auto; }
.side-settings { width: 100%; }
.local-status {
  display: flex; align-items: center; gap: 7px; margin: 12px 8px 0; padding: 16px 2px 0;
  border-top: 1px solid var(--line); font-size: .8125rem; color: var(--muted);
}
.local-status .icon { width: 17px; height: 17px; }
.workspace { margin-left: var(--sidebar-width); }
.topbar, main { width: min(100%, 1120px); margin: 0 auto; padding-inline: clamp(25px, 5vw, 72px); }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; min-height: 82px; }
.date-chip {
  display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .875rem;
  border: 1px solid var(--line); padding: 7px 12px; border-radius: 20px; background: #ffffffa3;
}
.date-chip:first-letter { text-transform: uppercase; }
.date-chip .icon { width: 17px; height: 17px; color: var(--green); }
.mobile-brand, .mobile-settings, .bottom-nav { display: none; }
main { padding-bottom: 50px; }
.warning { border-radius: 12px; padding: .8rem 1rem; background: #fff3d8; margin-bottom: 16px; }

.hero {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 24px; min-height: 286px;
  background: radial-gradient(ellipse at 94% 26%, #42684b 0%, transparent 56%), linear-gradient(119deg, #123b2f 8%, #1f5340 100%);
  color: #fff;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero-copy { position: relative; padding: 32px 36px; }
.hero h1 { font-size: clamp(2.75rem, 4.65vw, 4.25rem); line-height: .98; }
.hero p { max-width: 24rem; margin-top: 15px; margin-bottom: 22px; color: #e0ece0; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 15px; min-height: 44px;
  border-radius: 10px; border: 1px solid transparent; font-weight: 680; font-size: .875rem; line-height: 1.3; text-align: center;
}
.button .icon { width: 17px; height: 17px; }
.primary { color: #fff; background: var(--green); }
.primary:hover { background: var(--green-dark); }
.hero-button { color: #193f32; background: #eef2e3; }
.hero-button:hover { background: #fff; }
.quiet { background: #fff; border-color: #d7e3d9; color: var(--green-dark); }
.quiet:hover { background: #f3f7f2; border-color: #b6cbbb; }
.destructive { background: #9d3836; color: white; }
.destructive:hover { background: #7c2928; }

.today-grid { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: 22px; margin-top: 28px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 9px 16px; min-height: 30px; margin-bottom: 12px; }
.section-heading h2 { min-width: 0; }
.text-link, .text-button {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 6px 0;
  background: transparent; border: 0; color: var(--green); font-size: .875rem; font-weight: 680;
}
.text-button .icon { width: 17px; height: 17px; }
.text-link:hover, .text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-button.danger { color: #873e38; }
.card { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 2px 5px #163c2910; }
.practice-list { padding: 0 14px; }
.practice-row, .entry {
  display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; min-height: 73px; padding: 11px 3px;
  background: none; border: 0; text-align: left;
}
.practice-row + .practice-row, .entries li + li { border-top: 1px solid var(--line); }
.practice-row:hover .practice-row-text strong, .entry:hover .practice-row-text strong { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.practice-icon {
  display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
  color: #286149; background: #e9f2e9;
}
.practice-icon.defusion { background: #eef0f8; color: #4e567f; }
.practice-icon.space { background: #f1eee2; color: #756545; }
.practice-icon.moon { background: #deebe7; color: #326458; }
.practice-icon .icon { width: 22px; height: 22px; }
.practice-row-text { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.practice-row-text strong { line-height: 1.26; font-weight: 680; }
.practice-row-text small { color: var(--muted); font-size: .875rem; line-height: 1.32; }
.duration { flex: 0 0 auto; font-size: .875rem; color: var(--muted); white-space: nowrap; }

.reminder { padding: 16px 17px; background: #edf4ef; border-color: #dbe9df; overflow-wrap: anywhere; min-width: 0; }
.today-grid .reminder { min-height: 221px; }
.reminder.is-due { background: #e7f2e7; border-color: #97b8a0; }
.reminder-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.reminder-time {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 7px; background: #fff9;
  color: #325b4d; font-weight: 660; font-size: .8125rem; line-height: 1.35;
}
.reminder-time .icon { width: 15px; height: 15px; }
.reminder h3 { font-size: 1.15rem; margin-bottom: 3px; }
.value-label { font-size: .875rem; font-weight: 600; color: #466658; }
.cue { margin-top: 11px; max-width: 48ch; color: #395b4e; }
.reminder-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }
.reminder > .button { margin-top: 14px; }
.recent { margin-top: 25px; }
.empty-line { display: flex; align-items: center; gap: 11px; min-height: 73px; padding: 14px 17px; color: var(--muted); overflow-wrap: anywhere; }
.empty-line .icon { color: var(--green); }
.entries { list-style: none; padding: 0 15px; }
.entry { min-height: 64px; }
.entry-date { flex: 0 0 auto; color: var(--muted); font-size: .875rem; white-space: nowrap; }

.page-heading { display: flex; justify-content: space-between; gap: 12px 16px; align-items: flex-end; margin: 12px 0 24px; }
.page-heading p { color: var(--muted); margin-top: 9px; }
.page-heading .button { flex: 0 0 auto; }
.practice-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.practice-detail-card { display: flex; flex-direction: column; align-items: flex-start; padding: 18px; }
.practice-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; margin-bottom: 16px; }
.practice-detail-card h2 { margin: 6px 0 8px; }
.practice-detail-card p:not(.value-label) { color: var(--muted); margin-bottom: 18px; }
.practice-detail-card .button { margin-top: auto; }
.page-footer { margin-top: 14px; }
.action-plan { max-width: 620px; }
.after-card { margin: 10px 0 2px; }

.segmented { display: flex; flex: 0 0 auto; border-radius: 11px; background: #e9eee7; padding: 4px; }
.segment {
  background: transparent; color: var(--muted); font-size: .875rem; font-weight: 670;
  border: 0; border-radius: 8px; padding: 6px 11px; min-height: 38px;
}
.segment[aria-pressed="true"] { background: var(--paper); color: var(--green-dark); box-shadow: 0 1px 3px #17412e1a; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat { display: grid; justify-items: start; gap: 5px; padding: 15px; color: var(--muted); font-size: .875rem; line-height: 1.3; }
.stat strong { color: var(--ink); font: 400 2rem/1 var(--serif); }
.stat .practice-icon { width: 34px; height: 34px; border-radius: 9px; margin-bottom: 3px; }
.stat .icon { width: 18px; height: 18px; }
.metric-card { margin-top: 18px; padding: 18px; }
.chart-heading p { color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }
.chart-empty {
  display: grid; gap: 5px; justify-items: center; align-content: center; min-height: 155px;
  padding: 18px 12px; text-align: center; color: var(--muted); background: #f5f8f4; border-radius: 12px;
}
.chart-empty .icon { width: 28px; height: 28px; color: var(--green); }
.chart-empty strong { color: var(--ink); }
.chart-empty p { font-size: .875rem; }
.chart-wrap { display: grid; grid-template-columns: 28px minmax(0, 1fr); margin-top: 18px; }
.chart-scale { display: flex; flex-direction: column; justify-content: space-between; font-size: .8125rem; color: var(--muted); }
.metric-chart { width: 100%; height: 154px; }
.chart-dates { display: flex; justify-content: space-between; padding: 0 5px 0 32px; margin-top: 5px; font-size: .8125rem; color: var(--muted); }
.chart-note { margin-top: 12px; overflow-wrap: anywhere; }
.series-select { display: grid; gap: 3px; font-size: .875rem; min-width: 0; width: min(42%, 265px); color: var(--muted); }
.chart-values { margin-top: 10px; font-size: .875rem; }
.chart-values summary { cursor: pointer; color: var(--green); font-weight: 640; }
.chart-values ul { list-style: none; padding: 5px 0 0; max-width: 18rem; }
.chart-values li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--line); }

dialog {
  position: fixed; width: min(calc(100% - 32px), 540px); max-width: none; max-height: calc(100dvh - 40px);
  overflow: auto; overscroll-behavior: contain; padding: 22px; border: 1px solid var(--line);
  border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: 0 16px 65px #0c2b2345;
}
dialog::backdrop { background: #122b257d; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.dialog-head h2 { font: 400 clamp(1.55rem, 5vw, 2rem)/1.12 var(--serif); letter-spacing: -.04em; overflow-wrap: anywhere; padding-top: 3px; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; background: #f2f6f1; border: 0; border-radius: 12px; color: var(--green); }
.mobile-settings { display: none; }
.icon-button:hover { background: #e5eee4; }
.dialog-head .icon-button { margin: -4px -4px 0 0; }
.dialog-intro, .detail-meta { color: var(--muted); margin-bottom: 12px; }
.detail-meta { font-size: .875rem; font-weight: 650; }
.steps { padding-left: 23px; display: grid; gap: 10px; }
.steps li::marker { color: var(--green); font-weight: 700; }
form { display: grid; gap: 14px; }
.field { display: grid; min-width: 0; gap: 6px; padding: 0; border: 0; }
.field > span, .field legend { font-size: .875rem; font-weight: 690; overflow-wrap: anywhere; }
.field legend { padding: 0; margin-bottom: 6px; }
.field input:not([type="radio"], [type="checkbox"]), .field textarea, select {
  width: 100%; min-width: 0; min-height: 44px; border: 1px solid #cfdcd2; border-radius: 8px;
  background: #fcfdfb; color: var(--ink); padding: 8px 10px; font-size: 1rem;
}
select {
  appearance: none; padding-right: 31px;
  background-image: linear-gradient(45deg, transparent 50%, #315748 50%), linear-gradient(135deg, #315748 50%, transparent 50%);
  background-position: right 15px center, right 10px center; background-size: 5px 5px; background-repeat: no-repeat;
}
textarea { resize: vertical; }
.field input[type="date"], .field input[type="time"] { min-height: 44px; }
.field input[name="score"] { width: 90px; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { position: relative; display: flex; align-items: center; cursor: pointer; min-height: 44px; }
.choice input { position: absolute; top: 10px; left: 10px; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: flex; align-items: center; padding: 7px 10px; font-size: .875rem; min-height: 42px; line-height: 1.2;
  border: 1px solid #d7e3d8; border-radius: 9px; background: #fff;
}
.choice :checked + span { border-color: #69967e; background: #dfede2; color: var(--green-dark); font-weight: 650; }
.choice :focus-visible + span { outline: 3px solid #418a69; outline-offset: 2px; }
.checklist { display: grid; gap: 2px; }
.checklist label, .check-line { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: .9375rem; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); flex: 0 0 auto; }
.metric-input { background: #f3f7f1; border-radius: 10px; padding: 11px; }
.metric-input p { display: flex; justify-content: space-between; gap: 6px 12px; margin-top: 6px; overflow-wrap: anywhere; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; margin-top: 2px; }
.steps + .form-actions, .detail-list + .form-actions, .preview-box + .form-actions { margin-top: 18px; }
.form-actions-split { justify-content: space-between; }
.dialog-footer { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.local-note { display: flex; align-items: start; gap: 8px; border-radius: 10px; padding: 11px; background: #f2f6f1; color: var(--muted); font-size: .875rem; }
.local-note .icon { width: 17px; height: 17px; }
.detail-list { display: grid; gap: 10px; }
.detail-list div { border-top: 1px solid var(--line); padding-top: 9px; overflow-wrap: anywhere; }
.detail-list dt { color: var(--muted); font-size: .875rem; }
.detail-list dd { margin: 3px 0 0; white-space: pre-wrap; }
.toast {
  position: fixed; z-index: 4; right: 22px; bottom: 22px; margin: 0; max-width: min(400px, calc(100% - 44px));
  background: #173e31; color: #fff; padding: 11px 15px; border-radius: 10px; font-size: .875rem;
  box-shadow: 0 4px 20px #163c292b;
}
.toast-error { background: #873e38; }

@media (max-width: 1130px) {
  :root { --sidebar-width: 206px; }
  .topbar, main { padding-inline: 28px; }
  .today-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
  .today-grid .section-heading { flex-wrap: wrap; gap: 1px 9px; }
}
@media (max-width: 925px) {
  :root { --sidebar-width: 172px; }
  .sidebar { padding-inline: 11px; }
  .sidebar .brand { margin-left: 5px; }
  .local-status { margin-inline: 5px; }
  .topbar, main { padding-inline: 21px; }
  .today-grid { grid-template-columns: 1fr; }
  .today-grid .reminder { min-height: 0; }
  .practice-cards { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .sidebar { display: none; }
  .workspace { margin-left: 0; }
  .topbar, main { padding-inline: max(16px, env(safe-area-inset-left)); }
  .topbar { justify-content: space-between; min-height: 66px; }
  .mobile-brand { display: flex; gap: 8px; font-size: .9375rem; }
  .mobile-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .mobile-settings { display: grid; }
  .date-chip { padding: 0; border: 0; background: transparent; margin-left: auto; text-align: right; font-size: .8125rem; }
  .date-chip .icon { display: none; }
  main { padding-bottom: calc(89px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    position: fixed; z-index: 2; inset: auto 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px; padding: 6px max(7px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line);
  }
  .bottom-nav a {
    display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 50px; color: var(--muted);
    border-radius: 9px; font-size: .8125rem; font-weight: 640;
  }
  .bottom-nav [aria-current="page"] { background: #e8f1e9; color: var(--green-dark); }
  .hero { min-height: 254px; border-radius: 19px; }
  .hero-copy { padding: 24px 19px; }
  .hero h1 { font-size: clamp(2.65rem, 9.2vw, 4rem); }
  .hero p { max-width: 25ch; margin: 13px 0 16px; font-size: .9375rem; }
  .today-grid { margin-top: 20px; gap: 18px; }
  .section-heading { margin-bottom: 8px; }
  .section-heading h2 { font-size: 1.15rem; }
  .practice-list { padding: 0 10px; }
  .practice-row, .entry { gap: 8px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin: 9px 0 17px; }
  .page-heading p { font-size: .9375rem; }
  .recent { margin-top: 20px; }
  .stats { gap: 6px; }
  .stat { padding: 9px; border-radius: 11px; }
  .stat strong { font-size: 1.7rem; }
  .metric-card { padding: 13px; }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom)); right: 12px; max-width: calc(100% - 24px); }
  dialog {
    position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-height: calc(100dvh - 18px);
    padding: 17px 15px calc(16px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0;
  }
}
@media (max-width: 360px) {
  .date-chip { max-width: 8ch; line-height: 1.1; }
  .practice-row-text strong { font-size: .9375rem; }
  .practice-icon { width: 36px; height: 36px; }
  .practice-icon .icon { width: 19px; height: 19px; }
}

.cab-link {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px;
  border-radius: 11px; color: var(--green); font-weight: 680; font-size: .9375rem;
}
.cab-link:hover { background: #e8f1e9; }
.mobile-cab-link { display: none; }
.session-message { display: grid; gap: 16px; max-width: 610px; padding-top: 12vh; }
.session-message .button { justify-self: start; }
.assignment-cue { padding: 12px; margin: 12px 0; background: #edf4ef; border-radius: 9px; }
.assignment-cue p, .practice-instructions { white-space: pre-wrap; overflow-wrap: anywhere; }
.practice-instructions { margin: 12px 0; }
audio { display: block; width: min(100%, 340px); margin: 10px 0; }
.dialog-footer a { min-height: 40px; }
#cabinet-body, .cab-column { display: grid; gap: 14px; }
.cab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.cab-panel { min-width: 0; padding: 18px; overflow-wrap: anywhere; }
.cab-panel h2 { margin-bottom: 14px; }
.cab-panel form .button { justify-self: start; }
.cab-status { margin-bottom: 12px; padding: 10px 13px; border-radius: 9px; background: #e8f1e9; }
.cab-status.warning { background: #fff3d8; }
.cab-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.cab-list li { display: flex; justify-content: space-between; gap: 8px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.cab-list .client-record { display: grid; align-items: start; justify-content: stretch; }
.assigned-list { margin-left: 12px; }
.cab-controls { display: flex; gap: 7px 12px; flex-wrap: wrap; }
@media (max-width: 830px) {
  .cab-grid { grid-template-columns: 1fr; }
  .cab-list li { align-items: stretch; flex-direction: column; }
}
@media (max-width: 700px) {
  .mobile-cab-link { display: inline-flex; margin-left: auto; }
  .topbar:has(.mobile-cab-link) .date-chip { display: none; }
}

.auth-form { display: grid; gap: .8rem; width: min(100%, 24rem); margin: 0 auto; text-align: left; }
.auth-form [hidden], [data-cab-link][hidden] { display: none; }
.auth-form [role="status"]:empty { display: none; }
.topbar button.text-link { border: 0; background: transparent; cursor: pointer; }
@media (max-width: 420px) {
  .topbar { flex-wrap: wrap; }
}
