:root {
  color-scheme: light;
  --brand-teal: #155f67;
  --brand-teal-deep: #0f4d55;
  --brand-coral: #ff6b4f;
  --brand-coral-soft: #ffe2da;
  --brand-sky: #cfe3f8;
  --brand-sky-soft: #edf6ff;
  --brand-lavender: #8e96cf;
  --brand-sand: #e6dfd6;
  --bg: #155f67;
  --page-ink: #f7fbfb;
  --page-muted: #d5e6e8;
  --ink: #14282d;
  --muted: #657378;
  --line: #d8e1e3;
  --panel: #fffaf3;
  --panel-soft: #f1f5f3;
  --panel-warm: #fff7ec;
  --accent: var(--brand-teal);
  --accent-strong: var(--brand-teal-deep);
  --client-blue: #155cc4;
  --client-blue-soft: #eaf3ff;
  --therapist-red: #b8332f;
  --therapist-red-soft: #fff0ed;
  --warn: #b44b2d;
  --shadow: 0 22px 60px rgba(5, 12, 10, 0.34);
  --shadow-soft: 0 10px 28px rgba(5, 12, 10, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--page-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.portal-client {
  background:
    linear-gradient(135deg, rgba(207, 227, 248, 0.18) 0 22%, transparent 22%),
    linear-gradient(315deg, rgba(255, 107, 79, 0.16) 0 16%, transparent 16%),
    var(--brand-teal);
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(251, 250, 245, 0.96);
  color: var(--ink);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 38px rgba(5, 12, 10, 0.22);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--brand-coral) 0 50%, var(--accent) 50% 100%),
    var(--accent);
  color: #fffaf3;
  font-weight: 800;
}

.brand small,
.panel-heading span,
.list-item small,
.timeline-row small,
.profile-table span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.95rem;
}

.nav-links a {
  text-decoration: none;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

main {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 440px);
  gap: clamp(32px, 8vw, 96px);
  align-items: center;
  min-height: calc(100vh - 160px);
}

.login-copy h1,
.dashboard-hero h1,
.page-section h1 {
  margin: 0;
  font-size: 3.6rem;
  line-height: 1;
  max-width: 720px;
}

.login-copy h1 {
  font-size: 3.1rem;
}

.login-copy p,
.dashboard-hero p,
.page-section > p {
  max-width: 620px;
  color: var(--page-muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.brand-subline {
  margin: 10px 0 18px;
  color: var(--page-ink);
  font-size: 1.35rem;
  font-weight: 850;
}

.eyebrow {
  color: var(--brand-sky);
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 12px;
  text-transform: uppercase;
  font-size: 0.78rem;
}

body.portal-client .site-header {
  border-bottom: 4px solid var(--brand-coral);
}

body.portal-client .brand strong {
  color: var(--brand-teal-deep);
}

body.portal-client .brand-mark {
  box-shadow: inset 0 0 0 2px rgba(20, 40, 45, 0.12);
}

body.portal-client .login-copy h1,
body.portal-client .dashboard-hero h1,
body.portal-client .page-section h1 {
  text-shadow: 0 2px 0 rgba(15, 77, 85, 0.28);
}

body.portal-client .auth-panel,
body.portal-client .entry-form,
body.portal-client .panel,
body.portal-client .profile-table {
  border-color: rgba(207, 227, 248, 0.92);
  box-shadow: 0 22px 54px rgba(15, 77, 85, 0.24);
}

body.portal-client .auth-panel,
body.portal-client .entry-form {
  border-top: 5px solid var(--brand-coral);
}

body.portal-client .auth-panel .eyebrow,
body.portal-client .entry-form .eyebrow,
body.portal-client .panel .eyebrow {
  color: var(--brand-teal-deep);
}

.auth-panel,
.entry-form,
.panel,
.profile-table {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.auth-panel {
  display: grid;
  gap: 17px;
  padding: 30px;
  background: var(--panel-warm);
  border-color: rgba(255, 255, 255, 0.34);
  border-radius: 12px;
  box-shadow: 0 28px 80px rgba(5, 12, 10, 0.38);
}

.auth-stack {
  display: grid;
  gap: 13px;
}

.therapist-login-link {
  justify-self: center;
  color: var(--page-muted);
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
}

.therapist-login-link:hover {
  color: var(--page-ink);
  text-decoration: underline;
}

.auth-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
}

.auth-heading h2 {
  margin: 0;
  font-size: 1.45rem;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 15px;
  font: inherit;
  color: var(--ink);
  background: #fffdf9;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  overflow: hidden;
}

.password-field input {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.password-field input:focus {
  outline: 0;
}

.password-field:focus-within {
  outline: 3px solid rgba(255, 107, 79, 0.22);
  border-color: var(--accent);
}

.reveal-button {
  align-self: stretch;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  padding: 0 14px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 750;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(255, 107, 79, 0.22);
  border-color: var(--accent);
}

.primary-button {
  min-height: 52px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

body.portal-client .primary-button {
  background: linear-gradient(135deg, var(--accent), var(--brand-teal-deep));
  box-shadow: inset 0 -3px 0 rgba(5, 12, 10, 0.16);
}

body.portal-client .primary-button:hover {
  background: linear-gradient(135deg, var(--brand-teal-deep), #0b3f47);
}

body.portal-client .primary-button:disabled {
  background: var(--line);
  color: var(--muted);
  box-shadow: none;
}

.secondary-button {
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0 16px;
}

.secondary-button:hover {
  background: var(--brand-sky-soft);
}

.auth-secondary {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.auth-secondary a {
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}

.dashboard-hero {
  padding: 38px 0 46px;
}

.changeloop-hero {
  padding-bottom: 26px;
}

.today-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: start;
}

.today-card,
.today-form,
.today-target,
.today-action,
.reset-card,
.goal-builder-preview,
.session-prep-card,
.therapist-summary-card {
  display: grid;
  gap: 16px;
}

.loop-strip {
  display: grid;
  grid-template-columns:
    minmax(72px, 1fr) auto minmax(128px, 1fr) auto minmax(72px, 1fr) auto
    minmax(72px, 1fr) auto minmax(72px, 1fr);
  gap: 8px;
  align-items: center;
}

.loop-step {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-sky-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.loop-arrow {
  color: var(--accent-strong);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.today-target h2,
.today-action p,
.cue-card strong,
.goal-builder-preview h2,
.reset-card h2,
.session-prep-card h2,
.therapist-summary-card h2 {
  margin: 0;
  color: var(--ink);
}

.today-target h2 {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.12;
}

.today-action p,
.reset-card p,
.goal-builder-preview p,
.session-prep-card p,
.crisis-card p {
  color: var(--muted);
  line-height: 1.58;
  margin: 0;
}

.cue-card,
.progress-meter,
.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.cue-card {
  align-items: flex-start;
  flex-direction: column;
}

.cue-card span,
.progress-meter span,
.metric-row span,
.metric-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.progress-meter {
  flex-wrap: wrap;
}

.practice-blocks {
  display: flex;
  gap: 5px;
}

.practice-blocks span {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fffdf9;
}

.practice-blocks span.filled {
  background: var(--brand-coral);
  border-color: var(--brand-coral);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 8px;
}

legend {
  color: var(--muted);
  font-weight: 800;
  padding: 0;
}

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

.compact-options {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.segmented-options label {
  display: block;
}

.segmented-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-options span {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  text-align: center;
}

.segmented-options input:checked + span {
  border-color: var(--accent);
  background: var(--brand-sky-soft);
  color: var(--accent-strong);
  box-shadow: inset 0 -3px 0 rgba(21, 95, 103, 0.14);
}

.button-link {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  text-decoration: none;
}

.empty-change-state {
  max-width: 720px;
}

.empty-change-state h2 {
  margin: 0 0 8px;
}

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

.span-2 {
  grid-column: span 2;
}

.panel {
  padding: 20px;
  min-width: 0;
}

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

.panel-heading h2 {
  margin: 0;
  font-size: 1.08rem;
}

.panel-link {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.item-list,
.timeline {
  display: grid;
  gap: 12px;
}

.list-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  box-shadow: var(--shadow-soft);
}

.list-item p,
.timeline-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.compact {
  gap: 6px;
}

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

.timeline-row > span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 99px;
  background: var(--accent);
}

body.portal-client .timeline-row > span {
  background: var(--brand-coral);
}

.empty-state {
  color: var(--muted);
  margin: 0;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.flash.error {
  border-color: rgba(168, 79, 24, 0.35);
  color: var(--warn);
}

.page-section {
  padding: 38px 0;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  gap: 42px;
  align-items: start;
}

.entry-form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.session-list {
  display: grid;
  gap: 18px;
  max-width: 880px;
}

.admin-list {
  display: grid;
  gap: 14px;
}

.client-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  text-decoration: none;
}

.client-row strong,
.client-row small {
  display: block;
}

.client-row small {
  color: var(--muted);
  margin-top: 4px;
}

.client-row-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.client-row-stats span {
  border-radius: 999px;
  background: var(--brand-sky-soft);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 7px 11px;
  white-space: nowrap;
}

.client-row-stats .flag-chip,
.flag-chip {
  background: var(--brand-coral-soft);
  color: var(--warn);
}

.admin-profile {
  box-shadow: var(--shadow-soft);
}

.admin-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

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

.change-grid h2,
.support-grid h2 {
  margin: 0;
  line-height: 1.28;
}

.track-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.75fr);
  gap: 18px;
}

.tracker-card {
  grid-row: span 3;
}

.track-feedback-form {
  display: grid;
  gap: 18px;
}

.week-tracker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-tile {
  min-height: 92px;
  display: grid;
  gap: 8px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}

.day-tile span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.day-tile strong {
  color: var(--accent-strong);
  font-size: 1.55rem;
}

.day-tile.yes {
  background: var(--brand-sky-soft);
  border-color: rgba(21, 95, 103, 0.28);
}

.day-tile.skipped {
  background: var(--brand-coral-soft);
}

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

.metric-card strong {
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.metric-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

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

.checkbox-grid .checkbox-row {
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.plain-list {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.65;
}

.chip-link {
  text-decoration: none;
}

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

.skill-card h2 {
  margin: 0;
  font-size: 1.25rem;
}

.skill-card .eyebrow {
  color: var(--accent-strong);
}

.skill-card small {
  color: var(--muted);
}

.client-text,
.client-text .eyebrow,
.client-text h2,
.client-text small {
  color: var(--client-blue);
}

.therapist-text,
.therapist-text .eyebrow,
.therapist-text h2,
.therapist-text small {
  color: var(--therapist-red);
}

.skill-card p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.session-material-form {
  max-width: 880px;
  margin-bottom: 18px;
}

.session-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.session-meta {
  display: grid;
  gap: 6px;
}

.session-meta span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.session-meta h2 {
  margin: 0;
  font-size: 1.35rem;
}

.session-meta small {
  color: var(--muted);
  font-weight: 800;
}

.session-prose {
  white-space: pre-wrap;
  line-height: 1.68;
  padding: 16px;
  border-radius: 8px;
}

.attachment-list {
  display: grid;
  gap: 8px;
}

.attachment-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}

.attachment-link:hover {
  background: var(--brand-sky-soft);
}

.attachment-link span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.attachment-link small {
  flex: 0 0 auto;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: var(--brand-sky-soft);
  color: var(--accent-strong);
  padding: 6px 11px;
  font-size: 0.88rem;
  font-weight: 800;
}

.feedback-chip {
  position: relative;
  display: inline-flex;
}

.feedback-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.feedback-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--brand-sky-soft);
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 850;
  padding: 8px 13px;
}

.feedback-chip input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(5, 12, 10, 0.14);
}

.feedback-chip input:focus-visible + span {
  outline: 3px solid rgba(255, 107, 79, 0.22);
  outline-offset: 2px;
}

.feedback-save-button {
  width: 100%;
}

body.portal-client .chip:nth-child(2n) {
  background: var(--brand-coral-soft);
}

body.portal-client .chip:nth-child(3n) {
  background: #efeffb;
  color: #414a8d;
}

.next-steps {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  border-left: 4px solid var(--brand-lavender);
  background: linear-gradient(90deg, #f0f1fb, var(--panel-soft));
}

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

.entry-note {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
}

.entry-note strong {
  font-size: 0.86rem;
  font-weight: 850;
}

.entry-note p,
.skill-card .entry-note p,
.session-card .entry-note p {
  margin: 0;
  line-height: 1.6;
}

.client-entry {
  border-left: 4px solid var(--client-blue);
  background: var(--client-blue-soft);
  color: var(--client-blue);
}

.client-entry strong,
.client-entry p,
.skill-card .client-entry p,
.session-card .client-entry p {
  color: var(--client-blue);
}

.therapist-entry {
  border-left: 4px solid var(--therapist-red);
  background: var(--therapist-red-soft);
  color: var(--therapist-red);
}

.therapist-entry strong,
.therapist-entry p,
.skill-card .therapist-entry p,
.session-card .therapist-entry p {
  color: var(--therapist-red);
}

.client-entry-form textarea,
.client-entry-form input[name="title"],
.client-entry-form input[name="category"],
.client-entry-form input[name="notes"],
.client-entry-form input[name="summary"],
.client-entry-form textarea[name="summary"] {
  color: var(--client-blue);
}

.therapist-entry-form textarea,
.therapist-entry-form input[name="title"],
.therapist-entry-form input[name="category"],
.therapist-entry-form input[name="therapist_plan"],
.therapist-entry-form textarea[name="summary"],
.therapist-entry-form textarea[name="next_steps"] {
  color: var(--therapist-red);
}

.client-reflection {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--brand-sky-soft);
}

.client-reflection span {
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 850;
}

.reflection-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.elevated-form {
  box-shadow: 0 24px 70px rgba(5, 12, 10, 0.42);
}

.profile-table {
  display: grid;
  gap: 0;
  max-width: 720px;
  margin-top: 24px;
  overflow: hidden;
}

.profile-table > div {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.profile-table > div:last-child {
  border-bottom: 0;
}

@media (max-width: 820px) {
  .site-header,
  .nav-links {
    align-items: flex-start;
  }

  .site-header {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
  }

  .nav-links a,
  .nav-links form {
    flex: 0 0 auto;
  }

  main {
    width: min(100% - 24px, 1160px);
    padding: 22px 0 44px;
  }

  .login-copy h1,
  .dashboard-hero h1,
  .page-section h1 {
    font-size: 2.25rem;
    line-height: 1.06;
  }

  .login-copy h1 {
    font-size: 2.1rem;
  }

  .login-copy p,
  .dashboard-hero p,
  .page-section > p {
    font-size: 1rem;
  }

  .login-shell,
  .admin-two-column,
  .dashboard-grid,
  .today-shell,
  .change-grid,
  .insight-grid,
  .support-grid,
  .track-layout,
  .skill-list,
  .split-section {
    grid-template-columns: 1fr;
  }

  .client-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-row-stats {
    justify-content: flex-start;
  }

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

  .span-2 {
    grid-column: auto;
  }

  .loop-strip {
    display: flex;
    flex-wrap: wrap;
  }

  .loop-step {
    flex: 1 1 120px;
  }

  .loop-arrow {
    align-self: center;
  }

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

  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .login-shell {
    align-items: start;
    min-height: auto;
  }

  .dashboard-hero,
  .page-section {
    padding: 26px 0;
  }

  .auth-panel,
  .entry-form,
  .panel,
  .profile-table {
    box-shadow: 0 16px 40px rgba(5, 12, 10, 0.28);
  }
}

@media (max-width: 430px) {
  .brand strong {
    font-size: 0.98rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .nav-links {
    font-size: 0.94rem;
  }

  .panel,
  .entry-form,
  .auth-panel {
    padding: 16px;
  }

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

  .compact-options {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .week-tracker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-panel {
    border-radius: 10px;
  }
}
