/* SitStay — ported from the "SitStay CRM" Claude Design canvas.
   Newsreader (display serif) + Public Sans (UI). */

:root {
  --paper: #F4F1EA;
  --paper-deep: #E9E4D8;
  --paper-hover: #FAF8F3;
  --surface: #FFFFFF;
  --ink: #1F2A24;
  --ink-soft: #4F4E45;
  --muted: #6B6A5E;
  --line: #E2DCCF;
  --line-soft: #EEE9DE;
  --field-line: #D6CFBF;

  --forest: #2F5D46;
  --forest-hover: #244A37;
  --forest-ink: #1F4231;
  --forest-soft: #9DBAA8;
  --forest-tint: #F1F6F2;
  --forest-line: #D9E4DC;

  /* Needs attention */
  --ochre: #8A4710;
  --ochre-bg: #F7E6D2;

  /* Private-to-trainer surfaces */
  --private-bg: #FBF3E6;
  --private-line: #EBD6B8;
  --private-field: #FFFDF8;

  --chip-green-bg: #E3EDE6; --chip-green: #24513A;
  --chip-gray-bg: #ECE8DF;  --chip-gray: #4F4E45;
  --chip-blue-bg: #E1E8F2;  --chip-blue: #2B4A73;
  --custom-tint: #F1F5FA;

  --sidebar-bg: #1F2A24;
  --sidebar-fg: #C9C3B4;
  --sidebar-active: #34503F;
  --sidebar-muted: #B9B3A4;
  --sidebar-line: #34423A;
  --sidebar-badge: #3A4A40;
  --sidebar-outline: #3F4E45;
  --sidebar-label: #9C9686;

  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Public Sans', system-ui, sans-serif;

  --radius: 10px;
  --radius-card: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a { color: var(--forest); }
a:hover { color: var(--forest-ink); }

h1, h2, h3 { margin: 0; }

.serif { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
.card--private { background: var(--private-bg); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius);
  font: 600 14px var(--sans); text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary, .btn-primary:hover { background: var(--forest); color: #FFFFFF; }
.btn-primary:hover { background: var(--forest-hover); }
.btn-ghost, .btn-ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--field-line); }
.btn-ghost:hover { background: #F6F3EC; }
.btn-sm { height: 36px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.c-green { background: var(--chip-green-bg); color: var(--chip-green); }
.c-ochre { background: var(--ochre-bg); color: var(--ochre); }
.c-gray  { background: var(--chip-gray-bg); color: var(--chip-gray); }
.c-blue  { background: var(--chip-blue-bg); color: var(--chip-blue); }

.input {
  height: 40px; width: 100%; padding: 0 12px;
  border: 1px solid var(--field-line); border-radius: var(--radius);
  font: 400 14px var(--sans); color: var(--ink); background: var(--surface);
}
textarea.input { height: auto; padding: 10px 12px; line-height: 1.5; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: 999px; font-family: var(--serif); font-weight: 600;
}

.row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line-soft); }
.row:first-child { border-top: 0; }

/* ---------- Trainer app shell (desktop) ---------- */

.trainer-shell { display: flex; min-height: 100vh; min-height: 100dvh; background: var(--paper); }
.trainer-main {
  flex-grow: 1; min-width: 0; padding: 36px 48px;
  display: flex; flex-direction: column; gap: 28px;
}
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.page-header__text { display: flex; flex-direction: column; gap: 6px; }
.page-header__title { font-size: 40px; line-height: 1.1; }
.page-header__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.header-search { display: block; width: 300px; }
.header-search--sm { width: 280px; }
.breadcrumb { font-size: 13px; color: var(--muted); }
.trainer-main--tight { padding: 28px 48px 36px; gap: 20px; }
.page-header__title--sm { font-size: 36px; }
.page-header__meta { margin: 0; font-size: 14px; }

.sidebar {
  width: 248px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: var(--sidebar-bg); color: var(--paper-deep);
  display: flex; flex-direction: column; gap: 32px; padding: 28px 16px 24px;
}
.sidebar__panel { display: contents; }
.sidebar__toggle {
  display: none; margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--paper-deep); align-items: center; justify-content: center; cursor: pointer;
}
.sidebar__toggle[aria-expanded="true"] { background: var(--sidebar-active); color: #FFFFFF; }
.sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; text-decoration: none; color: var(--paper); }
.sidebar__brand:hover { color: var(--paper); }
.sidebar__logo {
  width: 36px; height: 36px; border-radius: 10px; background: var(--paper); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 22px; font-weight: 600;
}
.sidebar__name { font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1; }
.sidebar__org { font-size: 12px; color: var(--sidebar-muted); }
.sidebar__nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar__link {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px;
  border-radius: var(--radius); text-decoration: none; font-size: 14px; font-weight: 600;
  color: var(--sidebar-fg);
}
.sidebar__link:hover { color: #FFFFFF; }
.sidebar__link[aria-current="page"] { background: var(--sidebar-active); color: #FFFFFF; }
.sidebar__badge { margin-left: auto; font-size: 12px; background: var(--sidebar-badge); color: var(--paper-deep); border-radius: 999px; padding: 2px 8px; }
.sidebar__quick { display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
.sidebar__quick-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sidebar-label); padding: 0 8px; }
.sidebar__action {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px;
  border-radius: var(--radius); text-decoration: none; font-size: 14px; font-weight: 600;
}
.sidebar__action--solid, .sidebar__action--solid:hover { color: var(--ink); background: var(--paper-deep); }
.sidebar__action--outline, .sidebar__action--outline:hover { color: var(--paper-deep); border: 1px solid var(--sidebar-outline); }
.sidebar__user { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 12px 8px 0; border-top: 1px solid var(--sidebar-line); }
.sidebar__user-name { font-size: 14px; font-weight: 600; color: var(--paper); }
.sidebar__user-role { font-size: 12px; color: var(--sidebar-muted); }
.sidebar__icon-btn {
  margin-left: auto; width: 36px; height: 36px; border-radius: var(--radius); border: 0;
  background: transparent; color: var(--sidebar-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}

/* ---------- Client portal shell (mobile-first) ---------- */

.portal-shell { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: 24px 24px 32px; display: flex; flex-direction: column; gap: 28px; }
.portal-shell .btn { height: 52px; border-radius: 12px; font-size: 16px; padding: 0 18px; }
.portal-shell .input { height: 52px; border-radius: 12px; font-size: 16px; padding: 0 14px; }
.portal-brand { display: flex; align-items: center; gap: 12px; }
.portal-brand__logo {
  width: 44px; height: 44px; border-radius: 12px; background: var(--sidebar-bg); color: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 26px; font-weight: 600;
}
/* An org's uploaded logo, in place of the "T" tile. White behind it, since most logos are drawn for light
   backgrounds; wordmarks up to 4:1 (branding.LOGO_MAX_RATIO). */
.brand-logo { display: block; flex-shrink: 0; height: 36px; width: auto; max-width: 144px; object-fit: contain; border-radius: 10px; background: #FFFFFF; padding: 3px; }
.brand-logo--lg { height: 44px; max-width: 176px; border-radius: 12px; }
.portal-header .brand-logo { max-width: 112px; }
.portal-brand__name { font-family: var(--serif); font-size: 24px; font-weight: 500; line-height: 1; }
.portal-brand__org { font-size: 13px; color: var(--muted); }
.portal-title { font-family: var(--serif); font-weight: 500; font-size: 36px; line-height: 1.1; }

/* ---------- Sign-in pages (portal login, trainer login, magic link) ---------- */

.portal-shell--auth { padding-top: 72px; gap: 36px; }
.portal-intro { display: flex; flex-direction: column; gap: 10px; }
.portal-lede { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-soft); }
.portal-form { display: flex; flex-direction: column; gap: 14px; }
.portal-form .btn { width: 100%; }
.portal-label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; }
.portal-footnote { margin: auto 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.form-error { margin: 0; font-size: 14px; color: var(--ochre); }
.callout { border-radius: 12px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.callout > svg { flex-shrink: 0; margin-top: 1px; }
.callout--green { background: var(--chip-green-bg); color: var(--chip-green); }
.callout--ochre { background: var(--ochre-bg); color: var(--ochre); }

/* ---------- Client portal pages (dashboard, dog, homework, account picker, details) ---------- */

.portal-shell--app { padding: 0; gap: 0; }
.portal-shell--welcome { padding-top: 48px; gap: 22px; }
.portal-shell--picker { padding-top: 64px; gap: 24px; }
.portal-page { padding: 24px 16px 32px; display: flex; flex-direction: column; gap: 28px; flex-grow: 1; }
.portal-page--sub { padding-top: 0; gap: 22px; }
.portal-page--task { padding: 0 20px 24px; }
.portal-intro--tight { gap: 8px; }
/* Two columns from 900px (see the end of the file); stacked in reading order below that. */
.portal-cols, .portal-col { display: flex; flex-direction: column; gap: inherit; }
.portal-cols { flex-grow: 1; }
.portal-cols--flat .portal-col { display: contents; }
.portal-col--aside { margin-top: auto; }
.portal-title--sm { font-size: 32px; }
.portal-h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; }
.portal-h2--sm { font-size: 22px; }
.portal-section { display: flex; flex-direction: column; gap: 14px; }
.portal-section--tight { gap: 12px; }
.portal-footnote__btn { font-size: 14px; }
.eyebrow--forest { color: var(--forest); }
.chip--lg { height: 26px; font-size: 13px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.section-head__meta { font-size: 14px; color: var(--muted); }
.bar.bar--wide { display: block; width: 100%; }
.bar.bar--thick { height: 8px; margin: 6px 0 8px; }
.av-trainer { background: #C9A27A; color: var(--ink); }

.portal-back { padding: 16px; display: flex; align-items: center; }
.portal-back a { display: flex; align-items: center; gap: 6px; height: 44px; font-size: 15px; font-weight: 600; text-decoration: none; }
.portal-shell--welcome .portal-back { padding: 0; margin: -32px 0 -8px; }

.portal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: var(--sidebar-bg); }
.portal-header .sidebar__logo { text-decoration: none; flex-shrink: 0; }
.client-switch {
  display: flex; align-items: center; gap: 6px; min-width: 0; height: 44px; padding: 0 14px; border-radius: 999px;
  background: var(--sidebar-line); color: var(--paper); text-decoration: none; font-size: 15px; font-weight: 600;
}
.client-switch:hover { color: #FFFFFF; }
.client-switch > svg { flex-shrink: 0; }
.client-switch__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: relative; flex-shrink: 0; }
.account-menu > summary { list-style: none; width: 44px; height: 44px; font-size: 16px; cursor: pointer; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu[open] > summary { outline: 2px solid var(--paper); outline-offset: 2px; }
.account-menu__panel {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px; z-index: 10;
  display: flex; flex-direction: column; gap: 4px; padding: 8px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(31, 42, 36, 0.18);
}
.account-menu__email { font-size: 13px; color: var(--muted); padding: 4px 10px; overflow-wrap: anywhere; }
.account-menu__item {
  display: flex; align-items: center; height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent;
  text-align: left; text-decoration: none; font: 600 15px var(--sans); color: var(--ink); cursor: pointer;
}
.account-menu__item:hover { background: var(--paper); color: var(--ink); }

/* Full-width tap targets: a styled file picker or submit button. */
.cta {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 46px;
  border: 0; border-radius: 12px; font: 600 15px var(--sans); text-decoration: none; cursor: pointer;
}
.cta-primary, .cta-primary:hover { background: var(--forest); color: #FFFFFF; }
.cta-ochre, .cta-ochre:hover { background: var(--ochre); color: #FFFFFF; }
.cta:focus-within, .upload-drop:focus-within { outline: 2px solid var(--forest); outline-offset: 2px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
form[aria-busy="true"] .cta, form[aria-busy="true"] .upload-drop { opacity: 0.7; cursor: progress; }

.todo { background: var(--forest); border-radius: 20px; padding: 18px 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.todo__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 4px; color: #FFFFFF; }
.todo__title { font-family: var(--serif); font-weight: 500; font-size: 24px; }
.todo__by { font-size: 14px; color: #D5E3D9; white-space: nowrap; }
.todo__bar { display: flex; gap: 4px; padding: 0 4px; }
.todo__seg { flex-grow: 1; height: 6px; border-radius: 999px; background: #52786A; }
.todo__seg--done { background: #FFFFFF; }
.todo__done { display: flex; align-items: center; gap: 10px; padding: 6px 6px 2px; color: #D5E3D9; font-size: 14px; text-decoration: none; }
.todo__done:hover { color: #FFFFFF; }
.todo__done > svg { flex-shrink: 0; }

.task-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--ink); }
a.task-card:hover { color: var(--ink); }
.task-card--late { border: 2px solid #E8C9A6; }
.task-card__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.task-card__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.task-card__title { font-size: 17px; font-weight: 700; color: var(--ink); text-decoration: none; }
a.task-card__title:hover { color: var(--forest-ink); text-decoration: underline; }
.task-card__sub { font-size: 14px; color: var(--muted); }

.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-week__day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; border-radius: 12px; font-size: 12px; color: var(--muted); }
.cal-week__day b { font-size: 16px; color: var(--ink); }
.cal-week__day--on { background: var(--forest); color: #D5E3D9; }
.cal-week__day--on b { color: #FFFFFF; }
.visit { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.visit--compact { padding: 16px 18px; gap: 2px; }
.visit__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; }
.visit__when { font-size: 17px; font-weight: 700; }
.visit__when--sm { font-size: 15px; }
.visit__meta { font-size: 13px; color: var(--muted); }
.visit__meta--lg { font-size: 14px; }
.visit__about { margin: 0; font-size: 15px; line-height: 1.55; color: #3A3F38; }

.dog-card { display: flex; gap: 14px; align-items: center; padding: 14px; text-decoration: none; color: var(--ink); }
.dog-card:hover { color: var(--ink); border-color: var(--forest); }
.dog-card > svg { flex-shrink: 0; color: var(--muted); }
.dog-card__photo { width: 64px; height: 64px; border-radius: 14px; font-size: 26px; overflow: hidden; }
.dog-card__photo img, .dog-hero img { width: 100%; height: 100%; object-fit: cover; }
.dog-card__body { display: flex; flex-direction: column; gap: 6px; flex-grow: 1; min-width: 0; }
.dog-card__name { font-size: 17px; font-weight: 700; }
.dog-card__line { font-size: 14px; color: var(--muted); }

.acct-list { display: flex; flex-direction: column; gap: 24px; }
.acct {
  display: flex; flex-direction: column; gap: 14px; width: 100%; padding: 20px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.acct:hover, .acct[aria-current="true"] { border-color: var(--forest); }
.acct__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.acct__text { display: flex; flex-direction: column; gap: 4px; }
.acct__name { font-size: 19px; font-weight: 700; }
.acct__role { font-size: 14px; color: var(--muted); }
.acct__dogs { display: flex; align-items: center; }
.acct__dogs .avatar { width: 40px; height: 40px; font-size: 17px; border: 2px solid var(--surface); }
.acct__dogs .avatar + .avatar { margin-left: -10px; }
.acct__names { font-size: 14px; color: var(--ink-soft); margin-left: 10px; }

.portal-form--details { gap: 14px; flex-grow: 1; }
.portal-form--details .field { font-size: 14px; }
.portal-form--details .input { height: 48px; }
.portal-form--details .input:disabled { background: var(--paper-hover); color: var(--ink-soft); }
.portal-form--details .form-grid--contact { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; }
.portal-form--details .form-grid--contact > :first-child { grid-column: auto; }
.portal-form--details .check { margin-top: 4px; gap: 10px; font-size: 15px; }
.portal-form--details .check input { width: 20px; height: 20px; margin: 0; accent-color: var(--forest); }
.portal-form__submit { margin-top: auto; }

.dog-hero { height: 220px; border-radius: 20px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.dog-hero__initial { font-family: var(--serif); font-size: 72px; line-height: 1; }
.dog-name { font-size: 36px; line-height: 1; }
.dog-facts { font-size: 15px; color: var(--ink-soft); }
.plan-card { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.plan-card__count { font-size: 15px; font-weight: 700; }
.plan-card__empty, .notes-text { margin: 0; font-size: 15px; line-height: 1.6; color: #3A3F38; }
.plan-les { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: 15px; }
.plan-les__dot {
  width: 28px; height: 28px; border-radius: 999px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; background: var(--chip-gray-bg); color: var(--chip-gray);
}
.plan-les__dot--done { background: var(--forest); color: #FFFFFF; }
.plan-les__dot--partial { background: var(--chip-green-bg); color: var(--chip-green); }
.plan-les__title { flex-grow: 1; min-width: 0; }
.plan-les__when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.past { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.past__title { font-size: 15px; font-weight: 700; }
.past__summary { margin: 2px 0; font-size: 14px; line-height: 1.5; color: #3A3F38; }
.past__meta { font-size: 14px; color: var(--muted); }

.note-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; gap: 12px; }
.note-card__avatar { width: 36px; height: 36px; font-size: 14px; }
.note-card__body { display: flex; flex-direction: column; gap: 4px; }
.note-card__from { font-size: 14px; font-weight: 700; }
.note-card__text { font-size: 15px; line-height: 1.5; color: #3A3F38; }
.upload-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 15px; text-decoration: none; color: var(--forest); }
.upload-row__name { flex-grow: 1; font-weight: 600; }
.task-send { margin-top: auto; }
.upload-drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 150px;
  border: 2px dashed var(--forest-soft); border-radius: 16px; background: var(--forest-tint); color: var(--chip-green);
  text-align: center; cursor: pointer;
}
.upload-drop__title { font-size: 17px; font-weight: 700; }
.upload-drop__hint { font-size: 14px; color: #3F6A52; }

.sidebar__menu { margin-left: auto; position: relative; }
.sidebar__menu > summary { list-style: none; }
.sidebar__menu > summary::-webkit-details-marker { display: none; }
.sidebar__menu[open] > summary { color: #FFFFFF; background: var(--sidebar-active); }
.sidebar__menu-panel {
  position: absolute; bottom: calc(100% + 8px); right: 0; min-width: 200px; z-index: 10;
  display: flex; flex-direction: column; gap: 4px; padding: 8px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(31, 42, 36, 0.18);
}
.sidebar__menu-email { font-size: 12px; color: var(--muted); padding: 4px 8px; overflow-wrap: anywhere; }
.sidebar__menu-item {
  height: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; text-align: left;
  font: 600 14px var(--sans); color: var(--ink); cursor: pointer;
}
a.sidebar__menu-item { display: flex; align-items: center; text-decoration: none; }
.sidebar__menu-item:hover { background: var(--paper); color: var(--ink); }

/* ---------- Shared trainer components ---------- */

.h3 { font-family: var(--serif); font-weight: 500; font-size: 20px; }
.panel { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.panel__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel--private { background: var(--private-bg); border: 1px solid var(--private-line); border-radius: var(--radius-card); }
.panel--private .input { background: var(--private-field); border-color: var(--private-line); }
.link-btn { border: 0; background: none; padding: 0; font: 600 13px var(--sans); color: var(--forest); cursor: pointer; text-decoration: none; }
.link-btn:hover { color: var(--forest-ink); }
.link-btn--muted { color: var(--muted); }
.empty { margin: 0; padding: 20px; font-size: 14px; color: var(--muted); }
.divided > * + * { border-top: 1px solid var(--line-soft); }
.flash { border-radius: 12px; padding: 12px 16px; font-size: 14px; background: var(--chip-green-bg); color: var(--chip-green); }
.flash--ochre { background: var(--ochre-bg); color: var(--ochre); }

.av-0 { background: #D9C3A0; color: #3B2A14; }
.av-1 { background: #E8DDB5; color: #473A0E; }
.av-2 { background: #D3DCE8; color: #243B5C; }
.av-3 { background: #CBD8C9; color: #22402F; }
.av-4 { background: #E4CFC0; color: #4A2A17; }
.av-5 { background: #C9B8A0; color: #33240F; }
.av-6 { background: #ECE8DF; color: #4F4E45; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { width: 32px; height: 32px; font-size: 14px; border: 2px solid var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -8px; }

.bar { height: 6px; width: 80px; border-radius: 999px; background: var(--chip-gray-bg); overflow: hidden; flex-shrink: 0; }
.bar__fill { display: block; height: 100%; background: var(--forest); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #3A3F38; }
.field--private { color: var(--ochre); }
.field--private .input { background: var(--private-field); border-color: var(--private-line); }
.field__hint { font-weight: 400; color: var(--muted); }
.field__label { display: block; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.form-grid--contact { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.3fr); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--forest); }
.radios { display: flex; gap: 16px; height: 40px; align-items: center; }
.radios label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.radios input { width: 16px; height: 16px; margin: 0; accent-color: var(--forest); }
.seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--field-line); border-radius: var(--radius); overflow: hidden; }
.seg label { display: flex; align-items: center; height: 38px; padding: 0 16px; background: var(--surface); font: 600 13px var(--sans); color: #3A3F38; cursor: pointer; }
.seg label + label { border-left: 1px solid var(--field-line); }
.seg label:has(input:checked) { background: var(--ink); color: #FFFFFF; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--forest); outline-offset: -2px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.errorlist { margin: 0; padding: 0; list-style: none; font-size: 13px; font-weight: 500; color: var(--ochre); }
.photo-drop {
  width: 104px; height: 104px; flex-shrink: 0; border-radius: 12px; border: 1.5px dashed #BFB6A2; background: var(--paper-hover);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--forest); cursor: pointer; text-align: center; overflow: hidden;
}
.photo-drop:focus-within { outline: 2px solid var(--forest); outline-offset: 2px; }
.form-page { max-width: 760px; display: flex; flex-direction: column; gap: 18px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* ---------- Clients list ---------- */

.pill-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill-tab { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--field-line); background: var(--surface); font: 600 13px var(--sans); color: #3A3F38; cursor: pointer; }
.pill-tab[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.ctable { overflow: hidden; }
.ctable__row {
  display: grid; grid-template-columns: 2.1fr 1.7fr 1.2fr 1.6fr 1.3fr 0.9fr; gap: 16px; align-items: center;
  padding: 0 24px; min-height: 72px; border-top: 1px solid var(--line-soft); text-decoration: none; color: var(--ink);
}
a.ctable__row:hover { background: var(--paper-hover); color: var(--ink); }
.ctable__head { min-height: 44px; border-top: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--paper-hover); }

/* ---------- Client detail ---------- */

.client-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.client-grid > div { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.contact { display: flex; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.panel__head + .contact { padding-top: 0; border-top: 0; }
.contact__body { display: flex; flex-direction: column; gap: 3px; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.contact__name { font-size: 15px; font-weight: 700; }
.contact__actions { display: flex; gap: 12px; margin-top: 2px; }
.contact-picker { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.results { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.results:empty { display: none; }
.results__item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: var(--paper-hover); font-size: 13px; }
.results__item + .results__item, .results__create { border-top: 1px solid var(--line-soft); }
.results__create { padding: 10px 12px; font-size: 13px; }
.student-link { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); padding: 10px; margin: 0 -10px; border-radius: var(--radius); }
.student-link:hover { background: var(--paper-hover); color: var(--ink); }
.sess-group { padding: 8px 20px; background: var(--paper-hover); border-top: 1px solid var(--line-soft); }

/* ---------- Student profile ---------- */

.student-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.student-grid > div { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.student-photo {
  height: 240px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; overflow: hidden;
}
.student-photo img { width: 100%; height: 100%; object-fit: cover; }
.dl { display: grid; grid-template-columns: 96px minmax(0, 1fr); row-gap: 8px; font-size: 13px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; }
textarea.input--notes { resize: vertical; line-height: 1.55; }
.save-status { font-size: 12px; color: var(--muted); min-height: 18px; }

/* ---------- Small shared pieces ---------- */

.btn-xs { height: 34px; padding: 0 12px; }
.icon-btn {
  width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.icon-btn:hover { background: var(--paper); color: var(--ink); }
.icon-btn:has(input:focus-visible) { outline: 2px solid var(--forest); }
.popover { position: relative; }
.popover > summary { list-style: none; }
.popover > summary::-webkit-details-marker { display: none; }
.popover__panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: min(340px, calc(100vw - 32px)); z-index: 10;
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: 0 8px 24px rgba(31, 42, 36, 0.18);
}
.progress-inline { display: flex; align-items: center; gap: 10px; min-width: 0; }
.progress-inline__label { display: flex; gap: 4px; min-width: 0; white-space: nowrap; }
.progress-inline__pack { overflow: hidden; text-overflow: ellipsis; }
.save-stamp { color: var(--chip-green); font-weight: 600; }
.n {
  width: 28px; height: 28px; border-radius: 999px; background: var(--chip-gray-bg); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.n--done { background: var(--forest); color: #FFFFFF; }

/* ---------- Curriculum editor ---------- */

.curr-nav {
  width: 300px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--line); padding: 28px 16px; background: #F8F6F0;
  display: flex; flex-direction: column; gap: 18px;
}
.curr-nav__head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; }
.curr-nav__group { display: flex; flex-direction: column; gap: 2px; }
.curr-nav__label { padding: 0 12px 6px; }
.curr-nav__foot { margin: auto 4px 0; font-size: 12px; line-height: 1.5; }
.pack {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid transparent; border-radius: var(--radius); font-size: 14px; text-decoration: none; color: var(--ink);
}
.pack .muted { font-size: 12px; font-weight: 500; }
.pack:hover { background: var(--paper-hover); color: var(--ink); }
.pack[aria-current="page"] { background: var(--surface); border-color: var(--line); font-weight: 700; }
.les {
  display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--radius);
  font-size: 14px; color: var(--ink); text-decoration: none;
}
.les:hover { background: var(--paper-hover); color: var(--ink); }
.les .n { width: 22px; height: 22px; font-size: 12px; }
.les[aria-current="page"] { background: var(--chip-green-bg); font-weight: 700; }
.les[aria-current="page"] .n { background: var(--forest); color: #FFFFFF; }
.is-dragging { opacity: 0.4; }
/* Long-press picks an item up on touch screens, so keep iOS's link preview and text selection out of the way. */
[data-sortable-handle] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

.curr-main { flex-grow: 1; min-width: 0; padding: 24px 40px 32px; display: flex; flex-direction: column; gap: 16px; }
.curr-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.curr-form { display: flex; flex-direction: column; gap: 16px; }
.lesson-title {
  border: 0; background: transparent; padding: 0; outline: none; width: 100%;
  font-family: var(--serif); font-size: 40px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink);
}
.lesson-title:focus-visible { box-shadow: 0 2px 0 var(--forest); }

.rte { display: flex; flex-direction: column; overflow: hidden; }
.rte__bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 8px 12px;
  border-bottom: 1px solid var(--line); background: var(--paper-hover);
}
.rte__status { margin-left: auto; font-size: 12px; }
.rte__link { display: flex; gap: 8px; align-items: center; width: 100%; padding: 6px 0 2px; }
.rte__link[hidden] { display: none; }
.rte__link .input { height: 34px; max-width: 420px; }
.rte__scroll { padding: 28px 40px; display: flex; flex-direction: column; gap: 20px; }
.rte__body { min-height: 280px; outline: none; }
.rte__body:empty::before { content: "Write the lesson: goals, steps, what to watch for."; color: var(--muted); }
.tool {
  width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #3A3F38;
  display: inline-flex; align-items: center; justify-content: center; font: 700 14px var(--sans); cursor: pointer;
}
.tool:hover { background: var(--chip-gray-bg); }
.tool--text { width: auto; padding: 0 8px; font-size: 13px; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.btn-hw, .btn-hw:hover { height: 32px; padding: 0 12px; font-size: 13px; color: var(--chip-green); border-color: #BFD3C5; background: var(--chip-green-bg); }

.doc { display: flex; flex-direction: column; gap: 16px; }
.doc > * { margin: 0; }
.doc h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.doc h3 { font-family: var(--serif); font-weight: 500; font-size: 18px; }
.doc p, .doc li { font-size: 15px; line-height: 1.65; }
.doc ul, .doc ol { padding-left: 20px; }
.doc img, .doc video { max-width: 100%; border-radius: 12px; display: block; }
.doc video { background: #2E3A33; }

.hw-block {
  background: var(--forest-tint); border: 1px solid var(--forest-line); border-radius: 12px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.hw-block__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hwi {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--forest-line); border-radius: var(--radius);
}
.hwi--edit { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto; padding: 6px 8px 6px 14px; }
.hwi--edit input { border: 0; background: transparent; font: 400 14px var(--sans); color: var(--ink); padding: 6px 0; min-width: 0; outline: none; }
.hwi--edit input:focus-visible { box-shadow: 0 1px 0 var(--forest); }
.hwi__title { font-weight: 700 !important; }
.hwi__detail { color: var(--muted) !important; }
.hwi__evidence select { border: 0; appearance: none; cursor: pointer; font-family: var(--sans); padding-right: 12px; }
.hwi:has(.hwi__delete input:checked) { opacity: 0.5; }
.hwi:has(.hwi__delete input:checked) input { text-decoration: line-through; }
.hwi__errors { grid-column: 1 / -1; }

/* ---------- Plans ---------- */

.plan-form { display: contents; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.plan-lessons { overflow: hidden; }
.plan-lessons__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; }
.plan-lessons__foot { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line-soft); }
.pl {
  display: grid; grid-template-columns: 24px 32px minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 14px 20px; border-top: 1px solid var(--line-soft); background: var(--surface);
}
.pl--locked { background: var(--paper-hover); }
.pl--custom { background: var(--custom-tint); }
.pl:has(.sw input:not(:checked)) > :not(.sw) { opacity: 0.6; }
.pl:has(.sw input:not(:checked)) .pl__title { text-decoration: line-through; }
.pl:has(.sw input:not(:checked)) .pl__reason { display: flex; }
.pl:has(.sw input:not(:checked)) .pl__sub { display: none; }
.pl__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pl__title { font-size: 15px; }
.pl__sub { font-size: 13px; }
.pl__reason { display: none; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.pl:has(.sw input:not(:checked)) .pl__tags .link-btn { visibility: hidden; }
.pl__reason .input { height: 32px; font-size: 13px; }
.pl__tags { display: flex; gap: 10px; align-items: center; }
.grip { color: #A39C8B; display: inline-flex; border: 0; background: none; padding: 4px; margin: -4px; border-radius: 6px; cursor: grab; }
span.grip { cursor: default; opacity: 0.5; }
.grip:focus-visible { outline: 2px solid var(--forest); }
.sw { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.sw input { width: 18px; height: 18px; margin: 0; accent-color: var(--forest); }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.stat { background: var(--paper); border-radius: var(--radius); padding: 12px 4px; }
.stat__n { font-size: 26px; }
.stat__label { font-size: 12px; }
.pack-choices { margin: 0; padding: 0; overflow: hidden; }
.pack-choice { display: flex; gap: 14px; align-items: center; padding: 16px 20px; cursor: pointer; }
.pack-choice + .pack-choice { border-top: 1px solid var(--line-soft); }
.pack-choice:has(input:checked) { background: var(--forest-tint); }
.pack-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--forest); }
.borrow-row, .change-row {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 20px; border-top: 1px solid var(--line-soft);
}
.change-row { grid-template-columns: minmax(0, 1fr) auto; border-top: 0; }

/* Plan card on the student profile */
.plan-progress { display: flex; align-items: center; gap: 12px; margin: 12px 0 8px; }
.plan-progress__bar { flex-grow: 1; height: 10px; border-radius: 999px; background: var(--chip-gray-bg); overflow: hidden; display: flex; }
.lesson { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.dot {
  width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; background: var(--chip-gray-bg); color: var(--chip-gray);
}
.dot--done { background: var(--forest); color: #FFFFFF; }
.dot--next { background: var(--forest-soft); color: var(--ink); }

/* Client preview of a lesson */
.preview-bar {
  display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px;
  background: var(--chip-blue-bg); color: var(--chip-blue); font-size: 13px; font-weight: 600;
}

/* ---------- Today ---------- */

.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.today-col { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.today-section { display: flex; flex-direction: column; gap: 14px; }
.next-up { padding: 24px; display: flex; flex-direction: column; gap: 18px; border: 2px solid var(--forest); }
.next-up__main { display: flex; gap: 20px; align-items: flex-start; }
.next-up__time, .row__time { width: 76px; flex-shrink: 0; }
.next-up__body { flex-grow: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row__body { flex-grow: 1; min-width: 0; }
.next-up__brief { background: var(--paper); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; text-align: center; }
.week__day { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-radius: var(--radius); }
.week__name { font-size: 12px; color: var(--muted); }
.week__n { font-size: 17px; font-weight: 700; }
.week__day[aria-current="date"] { background: var(--forest); color: #FFFFFF; }
.week__day[aria-current="date"] .week__name { color: inherit; }
.wait { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
a.wait:hover { color: var(--ink); }
a.wait:hover .wait__title { color: var(--forest); }
.wait__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wait__title { font-size: 14px; font-weight: 700; }
.wait__actions { display: flex; gap: 12px; margin-top: 2px; }

/* ---------- Sessions on the client page ---------- */

.sess { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px 20px; border-top: 1px solid var(--line-soft); }
.sess__title { font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: none; }
.sess__title:hover { color: var(--forest); }
.btn-attention, .btn-attention:hover { color: var(--ochre); border-color: #E8C9A6; }
.file-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.file-row a { overflow-wrap: anywhere; }
.file-row--ruled { padding-top: 8px; border-top: 1px solid var(--line-soft); }
.evidence-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.evidence-tile {
  height: 84px; border-radius: var(--radius); background: #2E3A33; color: var(--paper-deep); text-decoration: none;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 8px; font-size: 12px; overflow: hidden;
}
a.evidence-tile:hover { color: #FFFFFF; }
.evidence-tile--waiting { border: 1.5px dashed var(--field-line); background: none; color: var(--muted); align-items: center; justify-content: center; text-align: center; }

/* ---------- Schedule a session ---------- */

.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }

/* ---------- Prep brief ---------- */

.prep-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.brief-card { padding: 28px 32px; display: flex; flex-direction: column; gap: 22px; }
.brief { display: flex; flex-direction: column; gap: 20px; }
.brief h3 { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--forest); }
.brief p { margin: 0; font-size: 15px; line-height: 1.6; }
.brief ol { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.6; }
.cite {
  font-size: 11px; font-weight: 700; color: var(--chip-blue); background: var(--chip-blue-bg); border-radius: 6px;
  padding: 1px 6px; text-decoration: none; vertical-align: 1px; white-space: nowrap;
}
.cite:hover { color: var(--chip-blue); text-decoration: underline; }
.still-open { background: var(--ochre-bg); border-radius: var(--radius); padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.note-thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.note-thumb {
  height: 150px; border-radius: 8px; background: #FDFCF8; border: 1px solid var(--line); padding: 14px;
  display: flex; flex-direction: column; gap: 9px; overflow: hidden; text-decoration: none;
}
.note-thumb img { width: calc(100% + 28px); margin: -14px -14px 0; height: 110px; object-fit: cover; }
.note-thumb__lines { display: flex; flex-direction: column; gap: 9px; }
.note-thumb__lines span { display: block; height: 2px; background: #9A968A; }
.note-thumb__label { font-size: 11px; color: var(--muted); margin-top: auto; }

/* ---------- Wrap-up ---------- */

.wrap-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.wrap-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.step-card { padding: 20px 22px; display: flex; flex-direction: column; }
.step { display: flex; align-items: center; gap: 10px; }
.step__num {
  width: 26px; height: 26px; border-radius: 999px; background: var(--ink); color: #FFFFFF; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.covered { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--paper); border-radius: var(--radius); }
.seg--sm { flex-shrink: 0; }
.seg--sm label { height: 34px; padding: 0 12px; }
.seg--sm label:has(input:checked) { background: var(--forest); }
.add-lesson > summary { list-style: none; display: inline; }
.add-lesson > summary::-webkit-details-marker { display: none; }
.dropzone {
  position: relative; border: 1.5px dashed #BFB6A2; border-radius: 12px; padding: 18px; background: var(--paper-hover);
  display: flex; align-items: center; gap: 16px; cursor: pointer; color: var(--forest);
}
.dropzone > span { color: var(--ink); }
.dropzone:focus-within { outline: 2px solid var(--forest); outline-offset: 2px; }
.dropzone__input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.attachment { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.attachment__page { width: 36px; height: 46px; border-radius: 4px; background: #FDFCF8; border: 1px solid var(--field-line); flex-shrink: 0; }
.hw { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.hw input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--forest); }
.due-field { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #3A3F38; }
.due-field .input { height: 34px; width: auto; }
.one-off { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.one-off .input { height: 36px; }

/* ---------- Board & Train ---------- */
.attention { color: var(--ochre); font-weight: 600; }
.bar--lg { display: block; width: 100%; height: 8px; }
.bt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }
.day-strip-row { display: flex; align-items: center; gap: 14px; }
.day-strip { flex-grow: 1; display: grid; gap: 4px; }
.day-strip__seg { height: 10px; border-radius: 3px; background: var(--line); }
.day-strip__seg--logged { background: var(--forest); }
.day-strip__seg--missing { background: #D9A066; }
.stay-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: start; }
.sit-form { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.lrow { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.lrow > input { width: 18px; height: 18px; margin: 0; accent-color: var(--forest); }
.lrow > label:not(.toggle-chip) { cursor: pointer; }
.more-lessons > summary { list-style: none; padding: 10px 0 2px; border-top: 1px solid var(--line-soft); }
.more-lessons > summary::-webkit-details-marker { display: none; }
.more-lessons[open] > summary { display: none; }
.toggle-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; background: var(--chip-gray-bg); color: var(--chip-gray); }
.toggle-chip:hover { box-shadow: inset 0 0 0 1px var(--field-line); }
.toggle-chip:has(input:focus-visible) { outline: 2px solid var(--forest); outline-offset: 2px; }
.toggle-chip:has(input:checked) { background: var(--chip-green-bg); color: var(--chip-green); }
.toggle-chip__on, .toggle-chip:has(input:checked) .toggle-chip__off { display: none; }
.toggle-chip:has(input:checked) .toggle-chip__on { display: inline-flex; align-items: center; gap: 4px; }
.lrow:has(> input:not(:checked)) .toggle-chip { visibility: hidden; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.media { position: relative; height: 112px; border-radius: var(--radius); background: #2E3A33; color: var(--paper-deep); display: flex; flex-direction: column; justify-content: space-between; padding: 10px; font-size: 12px; overflow: hidden; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media--video { background: #5A6B55; }
.media__top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; }
.media__chip { background: rgba(0, 0, 0, 0.35); color: #FFFFFF; }
.media__delete { width: 24px; height: 24px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, 0.35); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.media__delete:hover { background: rgba(0, 0, 0, 0.6); }
.media__name { position: relative; color: #FFFFFF; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.media__name:hover { color: #FFFFFF; text-decoration: underline; }
.media--add { background: var(--paper-hover); color: var(--forest); border: 1.5px dashed #BFB6A2; align-items: center; justify-content: center; gap: 6px; font-weight: 600; cursor: pointer; text-align: center; }
.media--add:focus-within { outline: 2px solid var(--forest); outline-offset: 2px; }
.stay-log { padding: 8px 20px 12px; display: flex; flex-direction: column; }
.day { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.day[hidden] { display: none; }
.day__title { font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none; }
.day__title:hover { color: var(--forest); text-decoration: underline; }
.residence { display: flex; flex-direction: column; gap: 12px; }
.residence + .residence { padding-top: 12px; border-top: 1px solid var(--line-soft); }

/* ---------- Tablet and phone ----------
   The canvas artboards are desktop. Narrower screens keep the same pieces and fold the columns:
   ≤1280 the three-column profile pages drop to two, ≤1180 (iPads) the sidebar becomes a top bar with
   a menu, ≤900 the side columns stack under the main one, and ≤640 (phones) forms and tables go single-column. */

@media (max-width: 1280px) {
  .trainer-main { padding: 32px; }
  .trainer-main--tight { padding: 24px 32px 32px; }
  .client-grid { grid-template-columns: 300px minmax(0, 1fr); }
  .student-grid { grid-template-columns: 280px minmax(0, 1fr); }
  .client-grid > :nth-child(3), .student-grid > :nth-child(3) { grid-column: 1 / -1; }
  .stay-grid { grid-template-columns: minmax(0, 1fr) 380px; }
  .prep-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .today-grid, .plan-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}

@media (max-width: 1180px) {
  /* A grid, so the curriculum editor's pack list can still sit beside the lesson on a tablet. */
  .trainer-shell { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; }
  .trainer-shell > .sidebar, .trainer-shell > .trainer-main { grid-column: 1 / -1; }
  .sidebar {
    position: sticky; top: 0; z-index: 20; width: auto; height: 60px;
    flex-direction: row; align-items: center; gap: 12px; padding: 0 8px 0 8px;
  }
  .sidebar__toggle { display: inline-flex; }
  .sidebar__panel { display: none; }
  .sidebar__toggle[aria-expanded="true"] + .sidebar__panel {
    position: absolute; top: 100%; left: 0; right: 0;
    display: flex; flex-direction: column; gap: 24px; padding: 12px 16px 20px;
    max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px); overflow-y: auto;
    background: var(--sidebar-bg); box-shadow: 0 12px 24px rgba(31, 42, 36, 0.25);
  }
  .sidebar__user { margin-top: 0; }
  .curr-nav { top: 60px; height: calc(100vh - 60px); height: calc(100dvh - 60px); width: 260px; }
  .curr-main { padding: 24px 28px 32px; }
}

@media (max-width: 900px) {
  .client-grid, .student-grid, .today-grid, .plan-grid, .prep-grid, .wrap-grid, .stay-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid--contact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid--contact > :first-child { grid-column: 1 / -1; }

  .trainer-shell > .curr-nav, .trainer-shell > .curr-main { grid-column: 1 / -1; }
  .curr-nav { position: static; width: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 20px 16px; }
  .curr-nav__foot { display: none; }

  /* Client table: one card-like row per client, no column headings. */
  .ctable__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 14px 20px; min-height: 0; }
  .ctable__row:nth-child(2) { border-top: 0; }
  .ctable__row > :first-child { flex-basis: 100%; }
  .ctable__row > :last-child { display: none; }
  .ctable__head { display: none; }
}

@media (max-width: 640px) {
  .trainer-main, .trainer-main--tight { padding: 20px 16px 32px; gap: 20px; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header__title { font-size: 32px; }
  .page-header__title--sm { font-size: 28px; }
  .header-search, .header-search--sm { width: 100%; }
  .form-grid, .form-grid--3, .form-grid--2-1, .form-grid--contact { grid-template-columns: minmax(0, 1fr); }
  .bt-grid { grid-template-columns: minmax(0, 1fr); margin-top: 20px; }

  .row { flex-wrap: wrap; gap: 10px 12px; padding: 14px 16px; }
  .row__body { flex: 1 1 55%; }
  .row > .btn:last-child { margin-left: auto; }
  .next-up { padding: 18px; }
  .next-up__main { flex-wrap: wrap; gap: 14px; }
  .next-up__body { flex-basis: 100%; }
  .next-up__main > .btn { width: 100%; }

  .sess { grid-template-columns: 72px minmax(0, 1fr); padding: 14px 16px; }
  .sess > :nth-child(3) { grid-column: 2; justify-self: start; }
  .pl { grid-template-columns: 24px 28px minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 16px; }
  .pl__tags { grid-column: 3 / -1; grid-row: 2; flex-wrap: wrap; }
  .pl__tags:empty { display: none; }
  .pl__reason { flex-wrap: wrap; white-space: normal; }
  .plan-lessons__head, .plan-lessons__foot { padding: 14px 16px; flex-wrap: wrap; }
  .borrow-row, .change-row, .pack-choice { padding: 14px 16px; }

  .hwi--edit { grid-template-columns: minmax(0, 1fr) auto auto; }
  .hwi--edit .hwi__title { grid-column: 1 / -1; }
  .one-off { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .one-off > :first-child { grid-column: 1 / -1; }
  .covered, .still-open, .day-strip-row, .hw-block__head { flex-wrap: wrap; }
  .evidence-grid, .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .brief-card { padding: 20px 18px; }
  .step-card, .sit-form { padding: 18px 16px; }
  .curr-main { padding: 20px 16px 32px; }
  .lesson-title { font-size: 30px; }
  .rte__scroll { padding: 20px 16px; }
  .rte__link { flex-wrap: wrap; }
}

@media (pointer: coarse) {
  /* iOS zooms the page into any focused field under 16px. */
  .input, .hwi--edit input { font-size: 16px !important; }
  .icon-btn, .tool { width: 40px; height: 40px; }
}

/* ---------- Client portal on wider screens ----------
   The artboards are phone-sized. From 900px the header spans the window and pages use two columns. */
@media (min-width: 900px) {
  .portal-shell--app { max-width: none; }
  .portal-header, .portal-back { padding-left: max(16px, calc((100% - 1080px) / 2)); padding-right: max(16px, calc((100% - 1080px) / 2)); }
  .portal-header .client-switch { margin-right: auto; }
  .portal-page, .portal-page--task { width: 100%; max-width: 1112px; margin: 0 auto; padding: 32px 16px 48px; }
  .portal-page--sub { padding-top: 8px; }
  .portal-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px 48px; align-items: start; flex-grow: 0; }
  .portal-col--aside { margin-top: 0; position: sticky; top: 24px; }
  .portal-title--sm { font-size: 36px; }
}

/* ---------- Leads: forms, builder, inquiries ---------- */
.forms-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.form-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line-soft); }
.form-row:first-child { border-top: 0; }
.form-row > :first-child { flex-grow: 1; }
.form-row__name { font-size: 15px; font-weight: 700; color: inherit; text-decoration: none; }
a.form-row__name:hover { text-decoration: underline; }
.radio-list { display: flex; flex-direction: column; gap: 10px; }
.radio-list input { accent-color: var(--forest); }

.assign-form { display: flex; align-items: flex-end; gap: 10px; }
.assign-form .field { flex-grow: 1; }
.inquiry { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.inquiry__head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.inquiry__title { font-weight: 700; }
.inquiry__answers { display: flex; flex-direction: column; gap: 8px; margin: 0; font-size: 14px; }
.inquiry__answers dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.inquiry__answers dd { margin: 0; overflow-wrap: anywhere; }
.inquiry__files { display: flex; flex-direction: column; gap: 6px; }

/* The builder's <form> wraps the whole page, so it spaces its sections the way .trainer-main does. */
.fb { display: flex; flex-direction: column; gap: inherit; }
.fb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.fb-main, .fb-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.fb-fields { display: flex; flex-direction: column; gap: 10px; }
.fb-field { display: flex; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-hover); }
.fb-field.is-dragging { opacity: 0.5; }
.fb-field__body { display: flex; flex-direction: column; gap: 10px; flex-grow: 1; min-width: 0; }
.fb-field__row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.fb-field__row--more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fb-field__row [hidden] { display: none; }
.fb-field__foot { display: flex; gap: 20px; }
.fb-field__delete { color: var(--muted); }
.fb-field:has(.fb-field__delete input:checked) { opacity: 0.55; }
.fb-field:has(.fb-field__delete input:checked) .fb-field__row { display: none; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5; }
.fb-preview { width: 100%; height: 640px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--paper); }
.fb-details { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.fb-details summary { cursor: pointer; font-weight: 600; color: var(--forest); }
.fb-details[open] > :not(summary) { margin-top: 10px; }
.fb-hooks { display: flex; flex-direction: column; margin: 0; }
.fb-hooks dt { overflow-wrap: anywhere; }
.fb-hooks dd { margin: 2px 0 10px; color: var(--muted); }
.fb-hooks dd:last-child { margin-bottom: 0; }
.fb-example { margin: 0; padding: 12px; font-size: 12px; background: var(--paper); border-radius: 8px; overflow-x: auto; }

@media (max-width: 1100px) {
  .fb-grid, .forms-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .fb-field__row, .fb-field__row--more { grid-template-columns: minmax(0, 1fr); }
  .form-row { flex-wrap: wrap; }
}

/* ---------- Billing ---------- */

.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bill-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bill-stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.bill-stat__n { font-size: 30px; line-height: 1.1; }
.bill-stat--attention { background: var(--ochre-bg); color: var(--ochre); }
.bill-stat--attention .eyebrow { color: var(--ochre); }
.itable .ctable__row { grid-template-columns: 0.8fr 2fr 1.2fr 1.3fr 1fr 1fr; }

.inv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.inv-main, .inv-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.inv-form { gap: 18px; }
.inv-lines { display: flex; flex-direction: column; gap: 8px; }
.inv-lines [data-formset-list] { display: flex; flex-direction: column; gap: 8px; }
.inv-line { display: grid; grid-template-columns: 170px minmax(0, 1fr) 70px 100px 36px 90px 28px; gap: 8px; align-items: center; }
.inv-line .input { height: 38px; padding: 0 10px; }
.inv-line > label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.inv-line--head { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.inv-line--read { grid-template-columns: minmax(0, 1fr) 60px 100px 100px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 15px; }
.inv-line--read.inv-line--head { border-top: 0; padding: 0 0 4px; font-size: 11px; }
.inv-line--removed { opacity: 0.45; }
.inv-line--removed .input { text-decoration: line-through; }
.inv-line__tax { align-items: center; }
.inv-line__tax input { width: 16px; height: 16px; accent-color: var(--forest); }
.inv-line__delete { align-items: center; justify-content: center; color: var(--muted); cursor: pointer; }
.inv-line__delete:hover, .inv-line--removed .inv-line__delete { color: var(--ochre); }
.inv-line__delete input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.inv-line__delete:focus-within { outline: 2px solid var(--forest); border-radius: 6px; }
.inv-bottom { display: flex; gap: 24px; align-items: flex-start; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.inv-totals { margin: 0 0 0 auto; width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.inv-totals > div { display: flex; justify-content: space-between; gap: 12px; }
.inv-totals dt { color: var(--muted); }
.inv-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.inv-totals__total { font-weight: 700; font-size: 16px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.inv-totals__total dt { color: var(--ink); }
.pay-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.pay-row:first-of-type { border-top: 0; }
.pay-form > summary { list-style: none; align-self: flex-start; display: inline-flex; }
.pay-form > summary::-webkit-details-marker { display: none; }
.pay-form[open] > summary { display: none; }

/* The wrap-up's Charges step is half as wide: the item and description get their own rows. */
.inv-lines--compact [data-formset-list] > .inv-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px 80px 28px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.inv-lines--compact .inv-line > :nth-child(2), .inv-lines--compact .inv-line > :nth-child(3) { grid-column: 1 / -1; }
[data-invoice] > .inv-totals { margin-left: auto; }

/* Portal */
.inv-card { padding: 4px 16px; }
.inv-card__row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: 15px; }
.inv-card__row:first-child { border-top: 0; }
.inv-card__row--minor { color: var(--muted); font-size: 14px; padding: 8px 0; }
.inv-card__row--total { font-weight: 700; font-size: 17px; }
.inv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
a.inv-row:hover { color: var(--ink); background: var(--paper-hover); }

@media (max-width: 1100px) {
  .inv-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .bill-stats { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .itable .ctable__row > :last-child { display: inline; margin-left: auto; }
  /* The first child is the hidden id input: 2 is the item picker, 3 the description. */
  .inv-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px 28px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
  .inv-line > :nth-child(2), .inv-line > :nth-child(3) { grid-column: 1 / -1; }
  .inv-line [data-line-amount] { display: none; }
  .inv-line--head { display: none; }
  .inv-line--read { grid-template-columns: minmax(0, 1fr) auto; }
  .inv-line--read > :nth-child(2), .inv-line--read > :nth-child(3) { display: none; }
  .inv-bottom { flex-direction: column; }
  .inv-totals { width: 100%; }
}

/* ---------- Books ---------- */

.books-nav .pill-tab { display: inline-flex; align-items: center; text-decoration: none; }
.books-nav .pill-tab[aria-current="page"], .books-period .pill-tab[aria-current="page"] { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.books-period .pill-tab { display: inline-flex; align-items: center; text-decoration: none; }
.books-period { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.books-period__custom { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.books-period__custom .input { height: 36px; }
.books-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.books-filters .input { height: 36px; width: auto; max-width: 260px; }
.books-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.books-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.books-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.books-summary::-webkit-details-marker { display: none; }
.books-candidates { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.books-candidates .pay-row { align-items: center; font-weight: 500; font-size: 14px; }
.books-remove { padding-top: 10px; padding-bottom: 12px; flex-direction: column; align-items: flex-start; gap: 10px; }
.books-remove > summary { list-style: none; }
.books-remove > summary::-webkit-details-marker { display: none; }

.pnl { padding: 8px 0 0; }
.pnl__head { margin: 0; padding: 20px 24px 8px; font: 700 12px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pnl__row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 24px; border-top: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; font-size: 15px; }
a.pnl__row:hover { background: var(--paper-hover); color: var(--ink); }
.pnl__line { margin-left: 10px; font-size: 12px; color: var(--muted); }
.pnl__row--total { font-weight: 700; background: var(--paper-hover); }
.pnl__net { padding: 18px 24px; font-size: 24px; background: var(--forest-tint); color: var(--forest-ink); border-top: 1px solid var(--forest-line); }
.pnl__net--loss { background: var(--ochre-bg); color: var(--ochre); }

.ttable .ctable__row { grid-template-columns: 110px minmax(0, 2fr) minmax(0, 1.6fr) 120px; min-height: 64px; }
.ttable__desc { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ttable__desc a { font-weight: 600; color: var(--ink); text-decoration: none; }
.ttable__desc a:hover { text-decoration: underline; }
.ttable__desc .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttable__pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ttable__pick label { flex: 1 1 160px; min-width: 0; }
.ttable__pick .input { height: 36px; width: 100%; }
.ttable__pick .btn { padding: 0 10px; }
.ttable__hint { flex-basis: 100%; font-size: 12px; color: var(--muted); }

.rtable { margin-bottom: 4px; }
.rtable .ctable__row { grid-template-columns: minmax(0, 1.4fr) 1.2fr 1fr 1fr 1.3fr; }
.rtable .rtable__row--current { background: var(--paper-hover); box-shadow: inset 3px 0 0 var(--forest); }
.books-form { display: flex; flex-direction: column; gap: 12px; }
.stable .ctable__row { grid-template-columns: 0.8fr minmax(0, 2fr) 1.3fr 1fr 1fr 1fr; }

.split-line { display: grid; grid-template-columns: minmax(0, 1.3fr) 120px minmax(0, 1fr) 28px; gap: 8px; align-items: center; }
.split-line .input { height: 38px; padding: 0 10px; }
.split-line > label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.split-line:has(input[name$="-DELETE"]:checked) { opacity: 0.45; }

@media (max-width: 1100px) {
  .books-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .ttable .ctable__row > :last-child, .stable .ctable__row > :last-child, .rtable .ctable__row > :last-child { display: inline; margin-left: auto; }
  .ttable .ctable__row > :nth-child(3) { flex-basis: 100%; }
  .split-line { grid-template-columns: minmax(0, 1fr) 100px 28px; }
  .split-line > :nth-child(4) { grid-column: 1 / 3; }
  .books-filters > label { flex: 1 1 100%; min-width: 0; }
  .books-filters .input { width: 100%; max-width: none; }
}
@media print {
  .sidebar, .books-nav, .books-period, .page-header__actions, .trainer-main .callout { display: none !important; }
  .books-grid { grid-template-columns: minmax(0, 1fr); }
}

/* A lead's "Days to meet": their availability against the assigned trainer's calendar. */
.meet { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.meet__title { font-size: 13px; font-weight: 700; }
.meet__free, .meet__note { margin: 0; font-size: 13px; }
.meet__days { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.meet__days li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

/* ---------- Org settings ---------- */

.color-field { display: flex; gap: 8px; align-items: center; }
.color-field .input { width: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.color-field__swatch { width: 40px; height: 40px; padding: 2px; border: 1px solid var(--field-line); border-radius: var(--radius); background: var(--surface); cursor: pointer; flex-shrink: 0; }
.logo-field { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-field__preview { display: flex; align-items: center; justify-content: center; min-width: 96px; height: 72px; padding: 0 14px; border-radius: var(--radius); background: var(--sidebar-bg); }
.logo-field__preview .sidebar__logo { width: 44px; height: 44px; font-size: 26px; }
.logo-field__controls { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.logo-field input[type="file"] { font: 400 14px var(--sans); max-width: 100%; }

/* Org settings: custom domain */
.domain-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.domain-head__name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.domain-connect { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.domain-connect .field { flex: 1 1 280px; }
.dns-records { width: 100%; border-collapse: collapse; font-size: 13px; }
.dns-records th { text-align: left; font-weight: 600; color: var(--muted); padding: 0 12px 6px 0; }
.dns-records td { padding: 8px 12px 8px 0; border-top: 1px solid var(--line-soft); vertical-align: top; }
.dns-records code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; user-select: all; }
@media (max-width: 600px) {
  .dns-records thead { display: none; }
  .dns-records tr { display: grid; grid-template-columns: 56px minmax(0, 1fr); border-top: 1px solid var(--line-soft); padding: 6px 0; }
  .dns-records td { border: 0; padding: 2px 0; }
  .dns-records td:first-child { grid-row: span 2; font-weight: 600; }
}
