/* Tutoring — "Ocean & Pearl": deep ocean bar, teal buttons and links, pearl page, mist-blue borders,
   navy ink, coral for money owed. Round white tiles, Plus Jakarta Sans, roomy 4/8 spacing. */
/* Yiddish letters (Hebrew letters only; English stays Plus Jakarta Sans): Fb Spacer for text, Fb Philosof for titles. */
@font-face { font-family: "Yiddish"; src: url(../fonts/fb-spacer-regular.ttf) format("truetype"); font-weight: 100 500; font-display: swap; size-adjust: 115%; unicode-range: U+0590-05FF, U+FB1D-FB4F; }
@font-face { font-family: "Yiddish"; src: url(../fonts/fb-spacer-bold.ttf) format("truetype"); font-weight: 600 700; font-display: swap; size-adjust: 115%; unicode-range: U+0590-05FF, U+FB1D-FB4F; }
@font-face { font-family: "Yiddish"; src: url(../fonts/fb-spacer-black.ttf) format("truetype"); font-weight: 800 900; font-display: swap; size-adjust: 115%; unicode-range: U+0590-05FF, U+FB1D-FB4F; }
@font-face { font-family: "Yiddish Title"; src: url(../fonts/fb-philosof-bold.ttf) format("truetype"); font-weight: 100 700; font-display: swap; size-adjust: 115%; unicode-range: U+0590-05FF, U+FB1D-FB4F; }
@font-face { font-family: "Yiddish Title"; src: url(../fonts/fb-philosof-black.ttf) format("truetype"); font-weight: 800 900; font-display: swap; size-adjust: 115%; unicode-range: U+0590-05FF, U+FB1D-FB4F; }
:root {
  --page: #f6f8f9;          /* pearl behind the white tiles */
  --bg: #ffffff;
  --bg-2: #f1f5f7;
  --bg-3: #e6eef2;
  --text: #0f1e2a;          /* navy ink */
  --text-2: #5b6b78;        /* blue-gray */
  --text-3: #5b6b78;        /* footer */
  --menu: #24394a;          /* menu text and icons that are not selected */
  --sep: #dde7ec;          /* mist-blue borders */
  --sep-2: #ebf1f4;
  --accent: #0e7490;        /* teal: links, the selected menu item */
  --accent-press: #0b5f77;
  --accent-tint: #e6f4f7;
  --accent-text: #0b5f77;
  --brand: #0b3b55;         /* deep ocean: top bar, sidebar top, avatars, selected menu item */
  --red: #c2402c;           /* coral: owes, warnings */
  --red-tint: #fdf0ed;
  --green: #0f766e;          /* sea green: Attended, paid */
  --dot: #0f766e;
  --blue-bg: #e3f2f5; --blue: #0e7490;
  --amber-bg: #f8eee2; --amber: #a8641f;
  --sel-bg: rgba(230, 244, 247, .6); --sel-text: #0b5f77; --sel-text-2: #0b3b55;
  --sel-border: #bfdfe0; --stat-hover: #b7cdd6;
  --fill: #0e7490;          /* filled buttons and selected dots */
  --fill-press: #0b5f77;
  --on-fill: #ffffff;
  --bar: var(--brand);
  --tabbar: rgba(255, 255, 255, .96);
  --surface: #ffffff;       /* sheets and menus */
  --seg-on: #ffffff;
  --ev-text: #0b3b55;
  --ev-unlogged-text: #9a2f1f;
  --toast-bg: #0f1e2a;
  --toast-link: #7dd3c8;
  --closed-bg: #e3f2f2; --closed-line: #bfdfe0; /* soft aqua */
  --shadow: rgba(15, 30, 42, .14);
  --card-shadow: 0 1px 2px rgba(15, 30, 42, .04), 0 6px 16px rgba(14, 74, 107, .07);
  --side-bg: #ffffff;
  --side-shadow: none;

  --t-title: 26px;
  --t-section: 14px;
  --t-body: 15px;
  --t-small: 14px;
  --t-caption: 12px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-s: 12px; --r: 20px;    /* buttons and inputs; tiles and cards */
  --tap: 40px;
  --side: 250px;
  --ease: cubic-bezier(.25, .1, .25, 1);
  --font: "Plus Jakarta Sans", "Yiddish", "Noto Sans Hebrew", "Segoe UI", system-ui, sans-serif; /* Yiddish letters: Fb Spacer (Noto as backup) */
  color-scheme: light;
}
@media (pointer: coarse) { :root { --tap: 44px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--t-body)/1.45 var(--font); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--t-title); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
h2 { font-size: var(--t-section); font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
h3 { font-size: var(--t-body); font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a.btn:hover { text-decoration: none; } /* a link that looks like a button stays a button */
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--text-2); }
.small { font-size: var(--t-small); }
.caption { font-size: var(--t-caption); color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; }
.icon.sm { width: 16px; height: 16px; }

/* ---------- Shell ---------- */
.app { min-height: 100vh; display: flex; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--side); flex: none;
  background: var(--bg-2); border-right: 1px solid var(--sep-2);
  padding: var(--s4) var(--s3); display: flex; flex-direction: column; gap: var(--s1);
}
.brand { display: block; font-weight: 700; font-size: var(--t-body); padding: var(--s2) var(--s3) var(--s4); color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); text-decoration: none; }
.nav a {
  display: flex; align-items: center; gap: var(--s3); height: 36px; padding: 0 var(--s3);
  border-radius: var(--r-s); color: var(--text); font-size: var(--t-small); font-weight: 500;
}
.nav a:hover { background: var(--bg-3); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-tint); color: var(--accent); }
.nav a .icon { color: var(--accent); }
.nav-gap { height: var(--s4); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s6); background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--sep-2);
}
.topbar .spacer { flex: 1; }
#page { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: var(--s6) var(--s6) var(--s7); }
.foot {
  max-width: 1120px; width: 100%; margin: 0 auto; padding: var(--s4) var(--s6) var(--s6);
  font-size: var(--t-caption); color: var(--text-2); display: flex; gap: var(--s4); flex-wrap: wrap;
  border-top: 1px solid var(--sep-2);
}
.foot a { color: var(--text-2); }
.tabbar { display: none; }
.menu-btn { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: var(--r-s); background: transparent; color: inherit; font-size: 20px; cursor: pointer; }
.side-scrim { display: none; position: fixed; inset: 0; z-index: 140; background: rgba(0, 0, 0, .35); }

/* Quick find */
.find { position: relative; width: min(360px, 100%); }
.find input {
  width: 100%; height: 36px; padding: 0 var(--s3) 0 36px; border-radius: var(--r-s);
  border: 0; background: var(--bg-2); font-size: var(--t-small);
}
.find input::placeholder { color: var(--text-2); }
.find > .icon { position: absolute; left: 10px; top: 8px; color: var(--text-2); pointer-events: none; }
.find-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; margin: 0; padding: var(--s1);
  list-style: none; background: var(--surface); color: var(--text); border: 1px solid var(--sep); border-radius: var(--r);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .1); max-height: 60vh; overflow: auto;
}
.find-list li { display: flex; justify-content: space-between; gap: var(--s3); align-items: center; min-height: var(--tap); padding: 0 var(--s3); border-radius: var(--r-s); cursor: pointer; font-size: var(--t-small); }
.find-list li[aria-selected="true"] { background: var(--fill); color: var(--on-fill); }
.find-list li[aria-selected="true"] .caption { color: rgba(255, 255, 255, .85); }

/* ---------- Page structure ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-head .sub { margin-top: var(--s1); color: var(--text-2); }
.page-head .actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
/* The main "add" button of a page (New client, Add session, Record payment): on a computer it is a
   normal button at the top right next to the page title; on phones it floats at the bottom (see below). */
.section { margin-top: var(--s6); }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding-bottom: var(--s2); border-bottom: 1px solid var(--sep); }
.section-head .count { color: var(--text-2); font-weight: 400; margin-left: var(--s2); }
.cols { display: grid; gap: var(--s6) var(--s7); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1040px) { .cols { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } .cols > div > .section:first-child { margin-top: 0; } }

/* Lists: plain rows with hairlines, not boxes */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--sep-2); }
.row {
  display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: var(--s2) var(--s2);
  margin: 0 calc(-1 * var(--s2)); width: calc(100% + var(--s4)); border-radius: var(--r-s);
  color: var(--text); background: none; border: 0; text-align: left; transition: background-color .15s var(--ease);
}
a.row:hover, button.row:hover { background: var(--bg-2); text-decoration: none; }
a.row:active, button.row:active { background: var(--bg-3); }
.row:hover .btn:not(.primary) { background: var(--bg-3); }
.row .main-text { flex: 1; min-width: 0; }
.row .main-text:has(.closed-why) { display: flex; align-items: baseline; gap: 6px; }
.row .main-text:has(.closed-why) .title { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .closed-why { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .title { font-weight: 500; display: block; }
.row .line2 { display: block; font-size: var(--t-small); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .time { width: 76px; flex: none; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: var(--t-small); }
.row .end { flex: none; display: flex; align-items: center; gap: var(--s2); font-size: var(--t-small); color: var(--text-2); }
.row .chev { color: var(--sep); }
.row.total { font-weight: 600; min-height: 48px; }
.empty { padding: var(--s4) 0; color: var(--text-2); font-size: var(--t-small); }
.status { display: inline-flex; align-items: center; gap: var(--s1); font-size: var(--t-small); color: var(--text-2); white-space: nowrap; }
.status.done { color: var(--green); }
.status.warn { color: var(--red); }
.tag { font-size: var(--t-caption); color: var(--text-2); border: 1px solid var(--sep); border-radius: 999px; padding: 1px var(--s2); white-space: nowrap; }
.wrap-text { white-space: pre-wrap; }

.many { columns: 2 300px; column-gap: var(--s7); }
.many > li { break-inside: avoid; }

/* Key facts in a quiet row */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s4) var(--s5); padding: var(--s4) 0; }
.fact .label { font-size: var(--t-caption); color: var(--text-2); }
.fact .value { font-size: var(--t-section); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 var(--s4); border-radius: var(--r-s); border: 0;
  background: var(--bg-2); color: var(--accent); font-size: var(--t-small); font-weight: 500; white-space: nowrap;
  transition: background-color .15s var(--ease), opacity .15s var(--ease);
}
.btn:hover { background: var(--bg-3); text-decoration: none; }
.btn.primary { background: var(--fill); color: var(--on-fill); }
.btn.primary:hover { background: var(--fill-press); }
.btn.plain { background: none; padding: 0 var(--s2); }
.btn.plain:hover { background: var(--bg-2); }
/* A clear bordered button, for actions that should stand out without being the main one. */
.btn.outline { background: none; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.outline:hover { background: var(--accent-tint); }
.btn.small { min-height: 32px; padding: 0 var(--s3); }
@media (pointer: coarse) { .btn.small { min-height: 40px; } }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: default; }
.btn .icon { width: 18px; height: 18px; }
.btn-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
/* Client page actions: same-width buttons in even rows. */
.client-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s2); }
/* Computer: buttons only as wide as their words, not stretched across the page. */
@media (min-width: 900px) { .client-actions { display: flex; flex-wrap: wrap; } .client-actions .btn { padding-inline: var(--s5); } }
.client-links { font-size: var(--t-small); color: var(--text-2); margin: var(--s3) 0 var(--s6); }
/* Close / Reopen client: text on the left, button on the right; stacked on narrow screens. */
.close-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.close-row > div { flex: 1 1 280px; min-width: 0; }
.close-row h2 { font-size: var(--t-body); margin-bottom: 4px; }
.close-row .btn { flex: none; }
.phone-link { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); font-variant-numeric: tabular-nums; }
/* Phone numbers always read left to right, also in Yiddish. */
.phone-link .num { direction: ltr; unicode-bidi: isolate; white-space: nowrap; }

/* Segmented control */
.seg { display: inline-flex; background: var(--bg-3); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button {
  border: 0; background: none; border-radius: 7px; min-height: 32px; padding: 0 var(--s4);
  font-size: var(--t-small); font-weight: 500; color: var(--text);
}
@media (pointer: coarse) { .seg button { min-height: 38px; } }
.seg button[aria-checked="true"] { background: var(--seg-on); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.field > label, .field > .label { font-size: var(--t-small); font-weight: 500; }
.field .hint { font-size: var(--t-caption); color: var(--text-2); }
.clash-line { font-size: var(--t-caption); color: var(--red); margin-top: calc(-1 * var(--s2)); margin-bottom: var(--s3); }
/* Dashboard, Who owes: clients who owe for more than 30 days, in a light red box on top. */
.late-box { margin: var(--s3) 0 var(--s2); padding: var(--s3) var(--s4) var(--s1); background: var(--red-tint); border-radius: var(--r); }
.late-label { font-size: var(--t-caption); font-weight: 600; color: var(--red); }
.late-box .list > li:last-child { border-bottom: 0; }
.input, .field input:not([type="checkbox"]), .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: 0 var(--s3); border: 1px solid var(--sep); border-radius: var(--r-s);
  background-color: var(--bg); font-size: var(--t-body); transition: border-color .15s var(--ease);
}
.field textarea { padding: 10px var(--s3); min-height: 96px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.field input[aria-invalid="true"], .input[aria-invalid="true"] { border-color: var(--red); background-color: var(--red-tint); }
.field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--red-tint); }
.error-text { font-size: var(--t-caption); color: var(--red); font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s3); align-items: start; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 var(--s3); }
.with-btn { display: flex; gap: var(--s2); align-items: center; }
.with-btn > :first-child { flex: 1; }
.form-block { padding-top: var(--s4); margin-top: var(--s2); border-top: 1px solid var(--sep-2); }
.form-block > h3 { margin-bottom: var(--s3); }
.money { position: relative; }
.money::before { content: "$"; position: absolute; left: var(--s3); top: 50%; transform: translateY(-50%); color: var(--text-2); }
.money input { padding-left: 26px !important; }
.check { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--sep); background: var(--bg);
  font-size: var(--t-small); font-weight: 500;
}
.days button[aria-pressed="true"] { background: var(--fill); border-color: var(--fill); color: var(--on-fill); }
.chips { display: flex; gap: var(--s2); flex-wrap: wrap; }
.chip {
  min-height: 36px; padding: 0 var(--s3); border-radius: 999px; border: 1px solid var(--sep);
  background: var(--bg); font-size: var(--t-small);
}
@media (pointer: coarse) { .chip { min-height: 40px; } }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); font-weight: 500; }
.switch { position: relative; width: 34px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--bg-3); border-radius: 999px; transition: background-color .2s var(--ease); pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--fill); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Task check circle, like Reminders */
.tick {
  width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1.5px solid var(--sep);
  background: var(--bg); display: grid; place-items: center; padding: 0; color: var(--on-fill);
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.tick-hit { width: 44px; height: 44px; margin: -10px; display: grid; place-items: center; border: 0; background: none; padding: 0; }
.tick .icon { width: 14px; height: 14px; opacity: 0; }
[aria-checked="true"] > .tick { background: var(--fill); border-color: var(--fill); }
[aria-checked="true"] > .tick .icon { opacity: 1; }
.task-row { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: var(--s2) 0; }
.task-row .main-text { flex: 1; min-width: 0; }

/* ---------- Sheet (dialog) ---------- */
.scrim { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .32); display: grid; place-items: center; padding: var(--s5); animation: fade .2s var(--ease); }
.sheet {
  width: min(560px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 20px; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); animation: rise .25s var(--ease);
}
.sheet.wide { width: min(720px, 100%); }
.sheet-head { padding: var(--s4) var(--s5); border-bottom: 1px solid var(--sep-2); }
.sheet-head h2 { font-size: var(--t-body); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Save and Cancel sit at the bottom, always visible, big enough to tap. */
.sheet-foot { display: flex; justify-content: flex-end; gap: var(--s3); padding: var(--s3) var(--s5); border-top: 1px solid var(--sep-2); }
.sheet-foot .btn { min-width: 112px; min-height: 44px; font-weight: 600; }
/* Page forms: Save stays at the bottom of the screen while scrolling. */
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: var(--s3); margin-top: var(--s5); padding: var(--s3) 0; background: var(--bg); border-top: 1px solid var(--sep-2); }
.save-bar .btn { min-width: 112px; min-height: 44px; font-weight: 600; }
.sheet-saved { margin-right: auto; align-self: center; color: var(--text-2); }
.btn.primary.danger { background: var(--red); color: #fff; }
.btn.primary.danger:hover { background: var(--red); filter: brightness(.92); }
.sheet-body { padding: var(--s5); overflow: auto; overscroll-behavior: contain; }
.sheet-sub { color: var(--text-2); font-size: var(--t-small); margin-bottom: var(--s4); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }

/* ---------- Toast ---------- */
#toasts { position: fixed; left: 50%; bottom: var(--s5); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: var(--s2); align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--s4); min-height: 48px; padding: 0 var(--s2) 0 var(--s4);
  background: var(--toast-bg); color: #fff; border-radius: var(--r); font-size: var(--t-small); box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
  animation: rise .2s var(--ease); max-width: calc(100vw - 32px);
}
.toast.only { padding-right: var(--s4); }
.toast button { border: 0; background: none; color: var(--toast-link); font-weight: 600; min-height: 40px; padding: 0 var(--s3); border-radius: var(--r-s); }
.toast button:hover { background: rgba(255, 255, 255, .1); }

/* ---------- Calendar ---------- */
.cal-bar { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.cal-bar h1 { font-size: var(--t-section); margin-right: auto; }
.cal-nav { display: flex; gap: 2px; }
.icon-btn { width: var(--tap); height: var(--tap); display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-s); color: var(--accent); }
.icon-btn:hover { background: var(--bg-2); }
.dayoff-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0; margin-bottom: var(--s3); border-bottom: 1px solid var(--sep-2); font-size: var(--t-small); }

.week { border-top: 1px solid var(--sep); user-select: none; -webkit-user-select: none; }
.week-head { display: grid; position: sticky; top: 56px; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--sep); }
.week-head .dh { padding: var(--s2) 0; text-align: center; font-size: var(--t-caption); color: var(--text-2); cursor: pointer; border: 0; background: none; }
.week-head .dh b { display: inline-grid; place-items: center; min-width: 28px; height: 28px; margin-left: var(--s1); border-radius: 999px; font-size: var(--t-body); color: var(--text); font-weight: 500; }
.week-head .dh.today b { background: var(--fill); color: var(--on-fill); }
.week-head .dh .off { display: block; font-size: 11px; color: var(--text-2); }
.week-head .dh .heb { display: block; font-size: 11px; color: var(--text-2); line-height: 1.3; text-align: center; }
.mcell .heb.parsha { font-size: 11px; color: var(--text-2); text-align: center; }
.mcell { position: relative; }
.mcell .hday { position: absolute; top: var(--s1); left: var(--s2); line-height: 26px; font-size: 11px; color: var(--text-2); }
.date-heb { font-size: var(--t-caption); color: var(--text-2); text-align: left; }
.date-heb[hidden] { display: none; }
.week-body { display: grid; position: relative; }
.hours { position: relative; }
.hours span { position: absolute; right: var(--s2); transform: translateY(-50%); font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.daycol { position: relative; border-left: 1px solid var(--sep-2); }
.daycol.offday { background-color: var(--bg-2); }
.hline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--sep-2); pointer-events: none; }
.now-line { position: absolute; left: 0; right: 0; border-top: 2px solid var(--red); z-index: 3; pointer-events: none; }
.ev {
  position: absolute; left: 3px; right: 3px; z-index: 2; overflow: hidden; border-radius: 8px; border: 0;
  padding: 3px 6px; text-align: left; font-size: 12px; line-height: 1.3; background: var(--accent-tint); color: var(--ev-text);
  touch-action: pan-y; cursor: grab; display: flex; flex-direction: column;
}
.ev b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
.ev.short { flex-direction: row; align-items: center; gap: 6px; padding-top: 0; padding-bottom: 0; }
.ev.short span { flex: none; }
.ev.short b { flex: 0 1 auto; min-width: 0; }
.ev.done { background: var(--bg-3); color: var(--text); }
.ev.missed, .ev.off { background: var(--bg-2); color: var(--text-2); text-decoration: none; border: 1px dashed var(--sep); }
.ev.unlogged { background: var(--red-tint); color: var(--ev-unlogged-text); }
.ev.locked { cursor: pointer; }
.ev.dragging { opacity: .35; }
.ev.ghost { position: fixed; z-index: 300; pointer-events: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); opacity: .95; }
.ev:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--sep); border-left: 1px solid var(--sep-2); user-select: none; }
.month .mh { padding: var(--s2); font-size: var(--t-caption); color: var(--text-2); border-right: 1px solid var(--sep-2); border-bottom: 1px solid var(--sep-2); }
.mcell { min-height: 112px; padding: var(--s1); border-right: 1px solid var(--sep-2); border-bottom: 1px solid var(--sep-2); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mcell.other, .mcell.noday { background: var(--bg-2); }
.mcell.drop { background: var(--accent-tint); }
.mcell .dn { align-self: flex-end; min-width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; font-size: var(--t-caption); border: 0; background: none; }
.mcell.today .dn { background: var(--fill); color: var(--on-fill); font-weight: 600; }
.mcell .off { font-size: 11px; color: var(--text-2); }
.mev { display: flex; gap: 4px; align-items: center; font-size: 12px; border: 0; background: none; padding: 2px 4px; border-radius: 4px; text-align: left; min-width: 0; touch-action: pan-y; cursor: grab; }
.mev:hover { background: var(--bg-2); }
.mev i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.mev.done i { background: var(--text-2); }
.mev.unlogged i { background: var(--red); }
.mev.missed i, .mev.off i { background: var(--sep); }
.mev span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mev .t { color: var(--text-2); flex: none; font-variant-numeric: tabular-nums; }
.more-link { font-size: 12px; color: var(--text-2); border: 0; background: none; text-align: left; padding: 2px 4px; }

/* ---------- Goals chart ---------- */
.goal { padding: var(--s4) 0; border-bottom: 1px solid var(--sep-2); }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.chart { width: 100%; max-width: 480px; height: auto; margin-top: var(--s3); display: block; }
.chart .axis { stroke: var(--sep-2); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.chart text { font-size: 11px; fill: var(--text-2); font-family: var(--font); }
.dir { display: inline-flex; align-items: center; gap: 2px; }

/* ---------- Tables (reports, print) ---------- */
.table { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.table th { text-align: start; font-weight: 500; color: var(--text-2); font-size: var(--t-caption); padding-block: var(--s2); padding-inline: 0 var(--s3); border-bottom: 1px solid var(--sep); }
.table td { padding-block: var(--s3); padding-inline: 0 var(--s3); border-bottom: 1px solid var(--sep-2); vertical-align: top; }
.table .r { text-align: end; font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 600; border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* Document pages */
.doc { max-width: 680px; }
.doc .draft { display: inline-block; margin-bottom: var(--s3); font-size: var(--t-caption); font-weight: 600; color: var(--red); }
.doc .updated { color: var(--text-2); font-size: var(--t-small); margin: var(--s2) 0 var(--s5); }
.doc .body p { margin: 0 0 var(--s3); }
.doc .body h2 { font-size: var(--t-body); margin: var(--s5) 0 var(--s2); }
.doc .body ul { margin: 0 0 var(--s3); padding-left: var(--s5); }
.doc textarea { font-family: var(--font); min-height: 60vh; }

/* Settings rows */
.set-row { display: flex; align-items: center; gap: var(--s4); min-height: 60px; padding: var(--s3) 0; }
.set-row .main-text { flex: 1; min-width: 0; }
.set-row .line2 { font-size: var(--t-small); color: var(--text-2); }
.soon { font-size: var(--t-caption); color: var(--text-2); }

/* ---------- Print history ---------- */
.print-page h1 { font-size: 24px; }
.print-meta { color: var(--text-2); margin: var(--s1) 0 var(--s5); font-size: var(--t-small); }

/* ---------- Invoice & receipt ---------- */
.invoice { max-width: 720px; }
.invoice h1 { margin-bottom: var(--s4); }
.invoice h2 { font-size: 17px; margin: var(--s5) 0 var(--s2); }
.inv-heb { display: block; color: var(--text-2); font-size: var(--t-small); font-weight: 400; }
.invoice .inv-amt { text-align: end !important; white-space: nowrap; }
.inv-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s3) var(--s5); margin: 0; }
.inv-head dt, .inv-total dt { color: var(--text-2); font-size: var(--t-small); }
.inv-head dd { margin: 2px 0 0; font-weight: 500; }
.inv-head .inv-wide { grid-column: span 2; }
@media (max-width: 480px) { .inv-head .inv-wide { grid-column: auto; } }
.inv-total { margin: var(--s5) 0 0 auto; max-width: 340px; }
.inv-total div { display: flex; justify-content: space-between; gap: var(--s4); padding: 6px 0; }
.inv-total dd { margin: 0; }
.inv-total .inv-due { border-top: 1px solid var(--sep); margin-top: 4px; padding-top: 10px; font-weight: 600; font-size: 19px; }
.inv-total .inv-due dt { color: var(--text); font-size: inherit; }
.inv-thanks { margin-top: var(--s6); color: var(--text-2); }
.inv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); flex-wrap: wrap; padding-bottom: var(--s4); margin-bottom: var(--s4); border-bottom: 1px solid var(--sep); }
.invoice .inv-top h1 { margin-bottom: var(--s2); }
.inv-from b { display: block; font-weight: 600; }
.inv-from span { color: var(--text-2); font-size: var(--t-small); }
.inv-meta { margin: 0; display: grid; gap: var(--s2); }
.inv-meta div { display: flex; gap: var(--s4); justify-content: space-between; }
.inv-meta dt { color: var(--text-2); font-size: var(--t-small); }
.inv-meta dd { margin: 0; font-weight: 500; text-align: end; }
.inv-last { margin: var(--s2) 0 0 auto; max-width: 340px; text-align: end; color: var(--text-2); font-size: var(--t-small); }
.inv-check { max-width: 720px; margin: 0 0 var(--s4); padding: 10px var(--s3); border-radius: 10px; background: var(--bg-2); font-size: var(--t-small); }
.inv-typing { max-width: 720px; margin: 0 0 var(--s3); color: var(--accent); }
.invoice.typing { outline: 2px dashed var(--accent); outline-offset: 8px; border-radius: 4px; }

/* ---------- Small screens ---------- */
@media (max-width: 899px) {
  :root { --t-title: 24px; }
  /* Phones and tablets: the same side menu as the computer, opened with the menu button (three lines). */
  .menu-btn { display: inline-flex; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 150; width: min(280px, 84vw); height: 100%;
    overflow-y: auto; padding-top: max(var(--s4), env(safe-area-inset-top)); padding-bottom: max(var(--s4), env(safe-area-inset-bottom));
    transform: translateX(-105%); visibility: hidden; transition: transform .22s ease, visibility .22s;
    box-shadow: 0 0 32px rgba(0, 0, 0, .18);
  }
  [dir=rtl] .sidebar { transform: translateX(105%); }
  body.menu-open .sidebar { transform: none; visibility: visible; }
  body.menu-open .side-scrim { display: block; }
  .nav a { height: 44px; }
  .topbar { padding: var(--s2) var(--s4); padding-top: max(var(--s2), env(safe-area-inset-top)); }
  .find { width: auto; flex: 1; }
  .topbar .spacer { display: none; }
  #page { padding: var(--s5) var(--s4) var(--s7); }
  .foot { padding: var(--s4) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom)); }
  .tabbar {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--tabbar); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--sep); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; min-height: 52px; font-size: 11px; font-weight: 500; color: var(--text-2); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a .icon { width: 24px; height: 24px; }
  .tabbar a[aria-current="page"] { color: var(--accent); }
  .week-head { top: 53px; }
  #toasts { bottom: calc(var(--s5) + env(safe-area-inset-bottom)); }
  /* Phones and the app: the main "add" button floats above the bottom menu, easy to reach with a thumb. */
  .btn.float-btn {
    position: fixed; inset-inline-end: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 25;
    height: 56px; padding: 0 22px; border-radius: 999px; font-size: 15px; gap: 8px;
    box-shadow: 0 8px 20px rgba(14, 116, 144, .32), 0 2px 6px rgba(11, 59, 85, .14);
  }
  .btn.float-btn .icon { width: 20px; height: 20px; }
  #page:has(.float-btn) { padding-bottom: calc(var(--s7) + 72px); }
  body:has(.float-btn) #toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .scrim { padding: 0; place-items: end stretch; }
  .sheet, .sheet.wide { width: 100%; max-height: 94vh; max-height: 94dvh; border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .sheet-body { padding: var(--s4); }
  .sheet-head { padding: var(--s4); }
  .sheet-foot { padding: var(--s3) var(--s4); }
  .save-bar { bottom: 0; padding-bottom: calc(var(--s3) + env(safe-area-inset-bottom)); }
  .save-bar .btn { flex: 1; }
  .save-bar .btn.plain { flex: none; }
  .sheet-foot .btn { flex: 1; }
  .mcell { min-height: 64px; flex-direction: row; flex-wrap: wrap; align-content: flex-start; gap: 0; }
  .mcell .dn { flex-basis: 100%; justify-content: center; display: flex; align-items: center; }
  .mcell .off { flex-basis: 100%; text-align: center; font-size: 10px; }
  .week-head .dh .heb:not(.parsha), .mcell .hday { display: none; }
  .week-head .dh .heb.parsha { font-size: 10px; overflow-wrap: anywhere; padding: 0 2px; }
  .mcell .heb.parsha { flex-basis: 100%; font-size: 10px; }
  .mev { padding: 4px 3px; }
  .mev span { display: none; }
  .more-link { font-size: 10px; }
}
@media (max-width: 480px) {
  .grid3 { grid-template-columns: 1fr 1fr; }
  .page-head .actions { width: 100%; }
  .mev span { font-size: 11px; }
  .row .time { width: 68px; }
}
@media (min-width: 900px) and (max-width: 1100px) { :root { --side: 200px; } #page, .foot { padding-left: var(--s5); padding-right: var(--s5); } .topbar { padding: var(--s3) var(--s5); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .sidebar, .topbar, .tabbar, .foot, .no-print, #toasts, .float-btn { display: none !important; }
  #page { padding: 0; max-width: none; }
  body { font-size: 12pt; }
  .table td, .table th { padding-block: 6pt; padding-inline: 0 8pt; }
  tr { break-inside: avoid; }
}

/* ---------- Sign in ---------- */
body.signed-out .app, body.signed-out .tabbar { display: none; }
#auth { min-height: 100vh; display: flex; justify-content: center; padding: 12vh var(--s4) var(--s6); background: var(--bg); }
.auth { width: 100%; max-width: 380px; }
.auth-brand { font-weight: 700; color: var(--accent); margin-bottom: var(--s5); }
.auth h1 { font-size: var(--t-title); }
.auth-or { display: flex; align-items: center; gap: var(--s3); margin: var(--s4) 0; color: var(--text-2); font-size: var(--t-small); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--sep); }
.btn.google { width: 100%; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.btn.google:hover { background: #f8f9fa; }
#auth[hidden] { display: none; }

/* Important flag */
.flag-btn { width: 44px; height: 44px; margin: -6px -10px -6px 0; flex: none; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-s); color: var(--sep); }
.flag-btn:hover { background: var(--bg-2); color: var(--text-2); }
.flag-btn .icon { width: 18px; height: 18px; }
.flag-btn[aria-pressed="true"], .flag-btn[aria-pressed="true"]:hover { color: var(--red); }
.flag-chip { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); }
.flag-chip[aria-pressed="true"] { border-color: var(--red); background: var(--red-tint); color: var(--red); }
/* Task colors, like Todoist: important = red circle, done = green check and grey text (no line through it).
   Uses :has() so the colors change the moment the flag or the circle is tapped. */
.task-row:has(.flag-btn[aria-pressed="true"]) .tick { border-color: var(--red); border-width: 2px; background: var(--red-tint); }
.task-row:has(.flag-btn[aria-pressed="true"]) .title { font-weight: 500; }
.task-row [aria-checked="true"] > .tick { background: var(--green); border-color: var(--green); }
.task-row:has([aria-checked="true"]) .title { color: var(--text-2); font-weight: 400; }
.task-row:has([aria-checked="true"]) .flag-btn[aria-pressed="true"] { color: var(--text-2); }
.task-row { transition: opacity .3s var(--ease); }
.task-row.leaving { opacity: 0; }

/* ---------- Dark mode (Settings > Appearance) ---------- */
:root[data-theme="dark"] {
  --page: #0a151c;
  --bg: #11202a;
  --bg-2: #172b37;
  --bg-3: #1f3644;
  --text: #eef5f8;
  --text-2: #9fb3bf;
  --text-3: #9fb3bf;
  --menu: #cfdde4;
  --sep: #24404f;
  --sep-2: #1b3240;
  --accent: #5ec4d6;
  --accent-press: #8ad6e3;
  --accent-tint: #12313b;
  --accent-text: #8ad6e3;
  --red: #f28b78;
  --red-tint: #3a1f1a;
  --green: #5eead4;
  --blue-bg: #12313b; --blue: #5ec4d6;
  --amber-bg: #3a2a1a; --amber: #e6b07a;
  --sel-bg: rgba(94, 196, 214, .12); --sel-text: #8ad6e3; --sel-text-2: #b9e8f0;
  --sel-border: #1f4a55; --stat-hover: #3b5a6b;
  --fill: #0e7490;
  --fill-press: #0b5f77;
  --on-fill: #ffffff;
  --tabbar: rgba(17, 32, 42, .96);
  --surface: #11202a;
  --seg-on: #2a4656;
  --ev-text: #d4f1f6;
  --ev-unlogged-text: #ffc9c9;
  --toast-bg: #1f3644;
  --toast-link: #7dd3c8;
  --closed-bg: #12303a; --closed-line: #1f4a55;
  --shadow: rgba(0, 0, 0, .5);
  --card-shadow: none;
  --side-bg: #11202a;
  --side-shadow: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
  --page: #0a151c;
  --bg: #11202a;
  --bg-2: #172b37;
  --bg-3: #1f3644;
  --text: #eef5f8;
  --text-2: #9fb3bf;
  --text-3: #9fb3bf;
  --menu: #cfdde4;
  --sep: #24404f;
  --sep-2: #1b3240;
  --accent: #5ec4d6;
  --accent-press: #8ad6e3;
  --accent-tint: #12313b;
  --accent-text: #8ad6e3;
  --red: #f28b78;
  --red-tint: #3a1f1a;
  --green: #5eead4;
  --blue-bg: #12313b; --blue: #5ec4d6;
  --amber-bg: #3a2a1a; --amber: #e6b07a;
  --sel-bg: rgba(94, 196, 214, .12); --sel-text: #8ad6e3; --sel-text-2: #b9e8f0;
  --sel-border: #1f4a55; --stat-hover: #3b5a6b;
  --fill: #0e7490;
  --fill-press: #0b5f77;
  --on-fill: #ffffff;
  --tabbar: rgba(17, 32, 42, .96);
  --surface: #11202a;
  --seg-on: #2a4656;
  --ev-text: #d4f1f6;
  --ev-unlogged-text: #ffc9c9;
  --toast-bg: #1f3644;
  --toast-link: #7dd3c8;
  --closed-bg: #12303a; --closed-line: #1f4a55;
  --shadow: rgba(0, 0, 0, .5);
  --card-shadow: none;
  --side-bg: #11202a;
  --side-shadow: none;
  color-scheme: dark;
  }
}
/* Dark-mode touches: sheets and inputs sit on a lighter surface */
:root[data-theme="dark"] .sheet .field input:not([type="checkbox"]), :root[data-theme="dark"] .sheet .field select, :root[data-theme="dark"] .sheet .field textarea, :root[data-theme="dark"] .sheet .input { background-color: var(--bg); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .sheet .field input:not([type="checkbox"]), :root[data-theme="auto"] .sheet .field select, :root[data-theme="auto"] .sheet .field textarea, :root[data-theme="auto"] .sheet .input { background-color: var(--bg); }
}
/* Printing is always light */
@media print {
  :root, :root[data-theme] { --bg: #fff; --bg-2: #f5f5f7; --text: #000; --text-2: #444; --sep: #ccc; --sep-2: #ddd; color-scheme: light; }
}

/* Reminder while the online version is open without a login */
.test-banner { padding: 6px var(--s4); text-align: center; font-size: var(--t-caption); font-weight: 500; background: var(--red-tint); color: var(--red); border-bottom: 1px solid var(--sep-2); }

/* ---------- Sessions page ---------- */
.sess-filters { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-bottom: var(--s5); }
.sess-list { border-top: 1px solid var(--sep); }
.sess-row { display: grid; grid-template-columns: minmax(130px, 1.3fr) minmax(130px, 1.1fr) minmax(104px, 1fr) 64px 96px; gap: var(--s3); align-items: center; min-height: 52px; padding: var(--s2) 0; border-bottom: 1px solid var(--sep-2); font-size: var(--t-small); }
.sess-head { min-height: 36px; font-size: var(--t-caption); color: var(--text-2); font-weight: 500; }
.sess-row .c { text-align: center; justify-self: center; }
.sess-row .r { justify-self: end; }
.sess-client { font-weight: 500; color: var(--text); }
.sess-row.is-cancelled .sess-client, .sess-row.is-cancelled .sess-time { color: var(--text-2); }
.sess-day { display: flex; align-items: center; gap: var(--s3); padding: var(--s5) 0 var(--s2); border-bottom: 1px solid var(--sep); }
.sess-day h2 { font-size: var(--t-body); }
.sess-actions { display: flex; gap: 2px; }
.act { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-s); color: var(--text-2); }
.act:hover { background: var(--bg-2); color: var(--accent); }
.act.danger:hover { color: var(--red); }
.act:disabled { opacity: .3; cursor: default; background: none; }
@media (pointer: coarse) { .act { width: 44px; height: 44px; } }
.paid-yes { color: var(--green); display: inline-grid; place-items: center; }
.btn.danger, .btn.plain.danger { color: var(--red); }
.btn.outline.danger { border-color: var(--red); }
.btn.outline.danger:hover { background: color-mix(in srgb, var(--red) 8%, transparent); }
/* A button that looks like a link (for example "Remove something entered by mistake"). */
.link-btn { display: inline; padding: 0; border: 0; background: none; font: inherit; font-size: var(--t-small); color: var(--accent); cursor: pointer; text-align: start; }
.link-btn:hover { text-decoration: underline; }
.ev.cancelled { background: var(--bg-2); color: var(--text-2); border: 1px dashed var(--sep); }
.mev.cancelled i { background: var(--sep); }
@media (max-width: 899px) {
  .sess-head { display: none; }
  .sess-row { grid-template-columns: 1fr auto; grid-template-areas: "client paid" "time actions" "status actions"; row-gap: 2px; }
  .sess-client { grid-area: client; }
  .sess-time { grid-area: time; color: var(--text-2); }
  .sess-row > span:nth-child(3) { grid-area: status; }
  .sess-paid { grid-area: paid; justify-self: end; }
  .sess-actions { grid-area: actions; align-self: center; }
}
@media (max-width: 899px) {
  .sess-filters > .with-btn { width: 100%; }
  .sess-filters > .with-btn input { flex: 1; min-width: 0; }
  .sess-filters select { width: 100% !important; }
}

/* "Not logged" on the Sessions page opens the log form */
.status-btn { border: 1px solid var(--sep); background: var(--bg); color: var(--accent); font-size: var(--t-small); font-weight: 500; min-height: 32px; padding: 0 var(--s3); border-radius: 999px; white-space: nowrap; }
.status-btn.warn { color: var(--red); border-color: var(--red); background: var(--red-tint); }
.status-btn.done { color: var(--green); }
.status-btn:hover { background: var(--bg-2); }
/* In progress: started in the check-in form, Save not pressed yet. */
.status-btn.progress, .btn.progress { color: var(--accent); border: 1px solid var(--accent); background: var(--accent-tint); }
.status-btn.progress:hover { background: var(--accent-tint); filter: brightness(.97); }
.status-btn.warn:hover { background: var(--red-tint); filter: brightness(.97); }
@media (pointer: coarse) { .status-btn { min-height: 40px; } }
/* Yiddish page titles: the Hebrew letters look heavier than English at 700, so one step lighter. */
:root[lang="yi"] h1 { font-weight: 600; letter-spacing: 0; }
h1 { font-family: "Plus Jakarta Sans", "Yiddish Title", "Yiddish", "Noto Sans Hebrew", "Segoe UI", system-ui, sans-serif; } /* Yiddish titles: Fb Philosof */

/* ---------- Yiddish: right to left ---------- */
[dir=rtl] .sidebar { border-right: 0; border-left: 1px solid var(--sep-2); }
[dir=rtl] .find > .icon { left: auto; right: 10px; }
[dir=rtl] .find input { padding-left: var(--s3); padding-right: 36px; }
[dir=rtl] .section-head .count { margin-left: 0; margin-right: var(--s2); }
[dir=rtl] .row, [dir=rtl] .mev, [dir=rtl] .more-link, [dir=rtl] .ev, [dir=rtl] .date-heb { text-align: right; }
[dir=rtl] .money::before { left: auto; right: var(--s3); }
[dir=rtl] .money input { padding-left: var(--s3) !important; padding-right: 26px !important; }
[dir=rtl] .switch span::after { left: auto; right: 2px; }
[dir=rtl] .switch input:checked + span::after { transform: translateX(-14px); }
[dir=rtl] .sheet-saved { margin-right: 0; margin-left: auto; }
[dir=rtl] .toast { padding: 0 var(--s4) 0 var(--s2); }
[dir=rtl] .toast.only { padding-left: var(--s4); }
[dir=rtl] .flag-btn { margin: -6px 0 -6px -10px; }
[dir=rtl] .cal-bar h1 { margin-right: 0; margin-left: auto; }
[dir=rtl] .week-head .dh b { margin-left: 0; margin-right: var(--s1); }
[dir=rtl] .mcell .hday { left: auto; right: var(--s2); }
[dir=rtl] .hours span { right: auto; left: var(--s2); }
[dir=rtl] .daycol { border-left: 0; border-right: 1px solid var(--sep-2); }
[dir=rtl] .month { border-left: 0; border-right: 1px solid var(--sep-2); }
[dir=rtl] .month .mh, [dir=rtl] .mcell { border-right: 0; border-left: 1px solid var(--sep-2); }
[dir=rtl] .doc .body:not([dir=ltr]) ul { padding-left: 0; padding-right: var(--s5); } /* the policy text is English, so it stays left to right */
[dir=rtl] [style*="margin-right:auto"] { margin-right: 0 !important; margin-left: auto; }
[dir=rtl] [style*="padding-left:0"] { padding-left: revert !important; padding-right: 0 !important; }
/* Anything marked hidden stays hidden, even when a class sets display. */
[hidden] { display: none !important; }

/* Weekly schedule: a box for each picked day, side by side. Day name on top, then From, then Until. */
.sched-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.sched-day { border: 1px solid var(--sep); border-radius: var(--r); padding: 14px 14px 12px; }
.sched-same { margin: -4px 0 12px; }
.sched-day .day-name { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.sched-stack .field { margin-bottom: 10px; }
.sched-len { margin: 0; }
@media (max-width: 520px) { .sched-days { grid-template-columns: 1fr 1fr; gap: 8px; } }
/* Date boxes open our own calendar (with Hebrew dates), so the browser's icon is swapped for ours. */
/* Only background-color is set on the other boxes (never the background shorthand), so this icon always shows. */
input[type=date] { cursor: pointer; padding-right: 36px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") no-repeat right 10px center / 18px; }
input[type=date]::-webkit-calendar-picker-indicator { display: none; }
[dir=rtl] input[type=date] { padding-right: 12px; padding-left: 36px; background-position: left 10px center; }
.dp { position: fixed; z-index: 250; width: 364px; max-width: calc(100vw - 16px); background: var(--bg); border: 1px solid var(--sep); border-radius: var(--r); box-shadow: 0 10px 30px var(--shadow); padding: 12px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { text-align: center; }
.dp-en { font-weight: 600; font-size: 16px; }
.dp-he { font-size: 15px; font-weight: 600; color: var(--accent); }
.dp-nav { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--accent); font-size: 26px; line-height: 1; cursor: pointer; }
.dp-nav:hover { background: var(--bg-2); }
[dir=rtl] .dp-nav { transform: scaleX(-1); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-week span { text-align: center; font-size: 12px; font-weight: 500; color: var(--text-2); padding: 4px 0; }
.dp-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 58px; border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; padding: 0; font: inherit; }
.dp-day:hover { background: var(--bg-2); }
.dp-day:disabled { opacity: .3; cursor: default; }
.dp-n { font-size: 15px; font-weight: 500; line-height: 1.1; }
.dp-h { font-size: 13px; line-height: 1.1; color: var(--text-2); white-space: nowrap; }
.dp-day.rc .dp-h { color: var(--accent); font-weight: 600; font-size: 10.5px; }
.dp-day.yt .dp-h { color: var(--red); font-weight: 600; }
.dp-day.shabbos { background: var(--bg-2); }
.dp-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.dp-day.sel, .dp-day.sel:hover { background: var(--accent); }
.dp-day.sel .dp-n, .dp-day.sel .dp-h { color: #fff; }
.dp-sel { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--sep-2); text-align: center; font-size: 14px; font-weight: 500; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 6px; }
.dp-link { border: 0; background: none; color: var(--accent); font: inherit; font-size: 14px; padding: 6px 4px; cursor: pointer; }
/* More breathing room: taller rows, space between the two lines of a row, between sections and between the two columns. */
.row { min-height: 62px; padding-top: 10px; padding-bottom: 10px; }
.row .line2 { margin-top: 3px; }
.section { margin-top: var(--s7); }
.section-head { padding-bottom: var(--s3); margin-bottom: var(--s1); }
.page-head { margin-bottom: var(--s6); }
@media (min-width: 1040px) {
  .cols { column-gap: 72px; }
  .cols > div + div { border-left: 1px solid var(--sep-2); padding-left: 40px; margin-left: -32px; }
  [dir=rtl] .cols > div + div { border-left: 0; border-right: 1px solid var(--sep-2); padding-left: 0; padding-right: 40px; margin-left: 0; margin-right: -32px; }
}
/* Paid column: just a small green check when paid, a black X when not. No circles. */
.paid-no { color: var(--text); display: inline-grid; place-items: center; }
.paid-no .icon { width: 18px; height: 18px; }
.paid-yes .icon { width: 18px; height: 18px; }
/* Reports: controls on one line, the range with arrows on both sides, a big total, then plain lists. */
.rp-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s5); }
.rp-controls select { width: auto; min-width: 200px; }
.rp-range { display: flex; align-items: center; justify-content: center; gap: var(--s4); padding: var(--s3) 0; border-top: 1px solid var(--sep-2); border-bottom: 1px solid var(--sep-2); }
.rp-range-text { text-align: center; min-width: 0; }
.rp-range-text h2 { margin: 0; }
.rp-total { text-align: center; margin: var(--s5) 0 var(--s2); }
.rp-big { font-size: 40px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.rp-table td { vertical-align: middle; }
.rp-name { font-weight: 500; }
.rp-heb { display: block; font-size: var(--t-caption); color: var(--text-2); text-align: left; }
.rp-hours { font-weight: 600; }
.rp-zero td, .rp-zero .rp-name { color: var(--text-2); font-weight: 400; }
[dir=rtl] .rp-heb { text-align: right; }
.rp-dates { font-size: var(--t-small); color: var(--text-2); margin-top: 2px; }
/* Reports tables: narrower and centered, plain rows, and very light lines between the columns. */
.rp-table { max-width: 680px; margin: 0 auto; table-layout: fixed; }
.rp-table th:first-child { width: 50%; }
.rp-table th, .rp-table td { padding: 12px 14px; }
.rp-table th + th, .rp-table td + td { border-left: 1px solid var(--sep-2); }
[dir=rtl] .rp-table th + th, [dir=rtl] .rp-table td + td { border-left: 0; border-right: 1px solid var(--sep-2); }
[dir=rtl] .rp-table th, [dir=rtl] .rp-table td { text-align: right; }
.rp-table th.r, .rp-table td.r { text-align: center !important; }
.rp-table tfoot td { font-weight: 600; border-top: 1px solid var(--sep); border-bottom: 0; }
.rp-section .section-head, .rp-section .empty { max-width: 680px; margin-left: auto; margin-right: auto; }
.dp-link:disabled { opacity: .35; cursor: default; }
/* The week's parsha on the Shabbos square of each calendar row. */
.dp-p { display: block; max-width: 100%; padding: 0 2px; font-size: 10.5px; font-weight: 600; line-height: 1.15; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-ponly { display: flex; align-items: flex-end; justify-content: center; height: 58px; padding-bottom: 6px; }
.dp-day.sel .dp-p { color: #fff; }
.sheet [data-owes] { margin: -6px 0 var(--s4); font-weight: 500; }
/* Client page, Money: label on the left, amount on the right, one line each. */
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 44px; padding: var(--s2) 0; border-bottom: 1px solid var(--sep-2); }
.kv li > :first-child { color: var(--text-2); min-width: 0; }
.kv li > :last-child { text-align: end; white-space: nowrap; min-width: 0; }
/* On a phone a long value (an organization's name) wraps instead of running off the screen. */
@media (max-width: 520px) { .kv li > :last-child { white-space: normal; overflow-wrap: anywhere; } }
.kv b { font-size: 17px; font-weight: 600; }
.more > summary { list-style: none; cursor: pointer; padding: var(--s3) 0 0; color: var(--accent); font-size: var(--t-small); font-weight: 500; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover { text-decoration: underline; }
.more[open] > summary { padding-bottom: var(--s2); }
.more .if-open, .more[open] .if-closed { display: none; }
.more[open] .if-open { display: inline; }

/* ---------- Payments page ----------
   Phone: name with "Mark as paid" under it, amount on the right.
   Computer (wider than 768px): Client | Note | Amount | Mark as paid, and Paid up starts folded. */
.pp { max-width: 640px; margin: 0 auto; }
.pp-head { margin-bottom: var(--s6); }
.pp-btns { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.btn.pp-outline { background: none; border: 1px solid var(--sep); }
.btn.pp-outline:hover { background: var(--bg-2); }
.pp-sec + .pp-sec { margin-top: var(--s6); }
.pp-label { font-size: var(--t-small); font-weight: 500; color: var(--text-2); padding-bottom: var(--s2); border-bottom: 1px solid var(--sep-2); }
.pp-list { list-style: none; margin: 0; padding: 0; }
.pp-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name amt" "note amt" "mark amt";
  align-items: center; column-gap: var(--s3); min-height: 56px; padding: var(--s2) 0; border-bottom: 1px solid var(--sep-2);
  cursor: pointer; /* the whole row opens the client's money pop-up */
}
.pp-row.quiet { grid-template-areas: "name amt"; }
.pp-name { grid-area: name; background: none; border: 0; padding: 0; font: inherit; text-align: start; cursor: pointer; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-note { grid-area: note; color: var(--text-2); font-size: var(--t-small); }
.pp-note:empty { display: none; }
.pp-part { white-space: nowrap; }
.pp-amt { grid-area: amt; font-weight: 600; text-align: end; white-space: nowrap; }
.pp-credit { font-size: var(--t-caption); font-weight: 500; }
.pp-mark { grid-area: mark; justify-self: start; padding: 2px 0; border: 0; background: none; color: var(--accent); font-size: var(--t-small); font-weight: 500; cursor: pointer; }
.pp-mark:hover { text-decoration: underline; }
.pp-mark-gap, .pp-toggle { display: none; }
.pp-row.quiet .pp-name, .pp-row.quiet .pp-amt { color: var(--text-2); font-weight: 400; }
.pp-empty { padding: var(--s4) 0; color: var(--text-2); }
@media (min-width: 769px) {
  .pp { max-width: 960px; }
  .pp-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
  .pp-btns { margin-top: 0; flex-direction: row-reverse; }
  .pp-row, .pp-row.quiet {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) 120px 160px; grid-template-areas: "name note amt mark";
    padding: 0 var(--s3); margin: 0 calc(-1 * var(--s3)); transition: background-color .15s var(--ease);
  }
  .pp-row:hover { background: var(--bg-2); }
  .pp-note, .pp-note:empty { display: block; padding: var(--s2) 0; line-height: 1.4; }
  .pp-mark { justify-self: end; min-height: 32px; padding: 0 var(--s3); border: 1px solid var(--sep); border-radius: var(--r-s); white-space: nowrap; }
  .pp-mark:hover { text-decoration: none; background: var(--bg); }
  .pp-mark-gap { display: block; }
  [data-paid] .pp-label { display: none; }
  .pp-toggle { display: inline-block; padding: var(--s2) 0; border: 0; background: none; color: var(--accent); font-size: var(--t-small); font-weight: 500; cursor: pointer; }
  .pp-toggle:hover { text-decoration: underline; }
  [data-paid]:not(.open) .pp-list { display: none; }
  [data-paid] .pp-list { border-top: 1px solid var(--sep-2); }
}
/* Payments sheets: "Mark as paid" is one sentence with one button and a Cancel link;
   Add bill has a big amount and one wide button. 420px wide on a computer. */
@media (min-width: 900px) { .sheet.pp-confirm, .sheet.pp-one-btn { width: min(420px, 100%); } }
.pp-confirm .sheet-body { display: none; }
.pp-confirm .sheet-head { border-bottom: 0; padding-top: var(--s5); }
.pp-confirm .sheet-head h2 { white-space: normal; font-size: 17px; line-height: 1.35; }
.pp-confirm .sheet-foot { border-top: 0; }
.pp-confirm .sheet-foot [data-cancel] { flex: none; min-width: 0; background: none; color: var(--accent); font-weight: 500; }
.pp-confirm .sheet-foot [data-cancel]:hover { text-decoration: underline; }
.pp-one-btn [data-cancel] { display: none; }
.pp-one-btn .sheet-foot .btn { flex: 1; }
.pp-big::before { font-size: 28px; font-weight: 600; }
.pp-big input { min-height: 60px; font-size: 28px; font-weight: 600; padding-left: 36px !important; }
[dir=rtl] .pp-big input { padding-left: var(--s3) !important; padding-right: 36px !important; }

/* =====================================================================
   Teal admin look: grey page, white cards, teal sidebar top, top bar and active menu item.
   ===================================================================== */
body { background: var(--page); letter-spacing: 0; line-height: 1.5; }
h1 { font-size: var(--t-title); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: var(--t-section); font-weight: 600; letter-spacing: 0; }
.caption, .fact .label { font-size: var(--t-caption); font-weight: 500; }
.page-head .sub { font-size: var(--t-small); }
@media print { :root, :root[data-theme] { --page: #fff; } }

/* Icons (Font Awesome) */
.icon { width: 20px; height: auto; font-size: 16px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.icon.sm { width: 16px; font-size: 13px; }
.btn .icon { width: 16px; font-size: 14px; }
.tick .icon { width: 14px; font-size: 11px; }
.flag-btn .icon, .paid-no .icon, .paid-yes .icon { width: 18px; font-size: 15px; }
.flag-btn:not([aria-pressed="true"]) .icon::before { font-family: "Font Awesome 5 Free"; font-weight: 400; } /* outline flag until marked */
[dir=rtl] .fa-chevron-left, [dir=rtl] .fa-chevron-right { transform: scaleX(-1); }

/* Sidebar */
.sidebar {
  width: var(--side); padding: 0 0 var(--s4); gap: 0; z-index: 30;
  background: var(--side-bg); border-right: 1px solid rgba(0, 0, 0, .05); box-shadow: var(--side-shadow);
}
.brand {
  display: flex; align-items: center; gap: var(--s3); height: 61px; padding: 0 var(--s4);
  background: var(--brand); color: #fff; font-size: 21.6px; font-weight: 600;
}
.brand:hover { color: #fff; }
.brand-tile { width: 36px; height: 36px; border-radius: 12px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 17px; color: #fff; }
.profile {
  display: flex; align-items: center; gap: var(--s3); padding: 15px 10px; margin-bottom: var(--s2);
  background: var(--accent-tint);
  color: var(--accent-text);
}
.profile:hover { text-decoration: none; }
.profile-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.profile-text b { font-weight: 700; font-size: var(--t-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-text span { font-size: var(--t-caption); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 14px; font-weight: 700; letter-spacing: .02em;
}
.avatar .icon { font-size: 15px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  height: 48px; padding: 12px 15px; margin: 0 var(--s2); border-radius: 12px; gap: 12px;
  color: var(--menu); font-size: 15px; font-weight: 500;
}
.nav a .icon { color: var(--menu); width: 20px; font-size: 16px; }
.nav a:hover { background: var(--bg-2); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"], .nav a[aria-current="page"]:hover { background: var(--brand); color: #fff; }
.nav a[aria-current="page"] .icon { color: #fff; }
.nav-gap { height: var(--s3); }
[dir=rtl] .sidebar { border-left: 1px solid rgba(0, 0, 0, .05); }

/* Top bar */
.topbar {
  height: 56px; padding: 0 var(--s4); border-bottom: 0; color: rgba(255, 255, 255, .95);
  background: var(--brand);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.topbar #today-btn { background: rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .95); font-weight: 600; border: 0; }
.topbar #today-btn:hover { background: rgba(255, 255, 255, .28); }
.top-avatar { width: 36px; height: 36px; background: rgba(255, 255, 255, .2); color: #fff; border: 2px solid rgba(255, 255, 255, .55); }
.top-avatar:hover { text-decoration: none; background: rgba(255, 255, 255, .3); }

/* Inputs: 40px, white, thin border, icon inside on the right */
.input, .field input:not([type="checkbox"]), .field select, .field textarea {
  min-height: 40px; padding: 8px 16px; border: 1px solid var(--sep); border-radius: 6px; background-color: var(--bg); font-size: 14px;
}
.field > label, .field > .label { font-size: var(--t-small); font-weight: 600; }
@media (pointer: coarse) { .input, .field input:not([type="checkbox"]), .field select, .field textarea { font-size: 16px; } }
.find { width: min(380px, 100%); }
.find input { height: 40px; padding: 8px 36px 8px 16px; border: 1px solid var(--sep); border-radius: 12px; background: #fff; color: #0f1e2a; font-size: 14px; }
.find input::placeholder { color: #5b6b78; }
.find > .icon { left: auto; right: 12px; top: 12px; color: #5b6b78; }
[dir=rtl] .find > .icon { right: auto; left: 12px; }
[dir=rtl] .find input { padding: 8px 16px 8px 36px; }
/* Room for the calendar icon: stronger than the ".field input" rule above, left to right and right to left. */
input[type=date], .field input[type=date]:not([type="checkbox"]) { padding-right: 36px; padding-left: 16px; }
[dir=rtl] input[type=date], [dir=rtl] .field input[type=date]:not([type="checkbox"]) { padding-right: 16px; padding-left: 36px; }

/* Page area */
#page { max-width: 1180px; padding: var(--s4) var(--s4) var(--s7); }
.page-head { margin: var(--s2) 0 var(--s4); }
.foot {
  max-width: none; margin: 0; padding: var(--s3) var(--s4); background: var(--bg); border-top: 1px solid var(--sep);
  color: var(--text-3); font-size: var(--t-small); align-items: center;
}
.foot .spacer { flex: 1; }
.foot-brand { font-weight: 700; }
.foot a { color: var(--text-3); }

/* Cards: every section is a white panel */
.section {
  margin-top: 20px; padding: 28px; background: var(--bg);
  border: 1px solid var(--sep); border-radius: var(--r); box-shadow: var(--card-shadow);
}
.section:first-child { margin-top: 0; }
.section-head { padding-bottom: var(--s3); margin-bottom: var(--s1); border-bottom-color: var(--sep); align-items: center; }
.cols { gap: 20px; }
@media (min-width: 1040px) {
  .cols { column-gap: 20px; }
  .cols > div + div, [dir=rtl] .cols > div + div { border: 0; padding: 0; margin: 0; }
  .cols > div > .section:first-child { margin-top: 0; }
}
.list > li:last-child { border-bottom: 0; }
.empty { text-align: center; padding: var(--s5) 0; }
.late-box { border-radius: var(--r); }

/* Stat cards on the Dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 20px; }
.stat {
  display: flex; flex-direction: column; justify-content: space-between; min-height: 117px; padding: 20px;
  background: var(--bg); border: 1px solid var(--sep); border-radius: var(--r); box-shadow: var(--card-shadow); color: var(--text);
}
a.stat:hover { text-decoration: none; border-color: var(--stat-hover); }
.stat-top, .stat-bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.stat-label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); flex: none; }
.stat-dot.off { background: var(--amber); }
.stat-num { font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.badge-icon { width: 48px; height: 48px; flex: none; border-radius: 50%; display: grid; place-items: center; }
.badge-icon .icon { font-size: 18px; width: auto; }
.badge-icon.blue { background: var(--blue-bg); color: var(--blue); }
.badge-icon.amber { background: var(--amber-bg); color: var(--amber); }
.badge-icon.coral { background: color-mix(in srgb, var(--red) 12%, var(--bg)); color: var(--red); } /* money owed: coral, like the amounts */
.stat.selected { background: var(--sel-bg); border-color: var(--sel-border); }
.stat.selected .stat-label { color: var(--sel-text); }
.stat.selected .stat-num { color: var(--sel-text-2); }
.stat.selected .badge-icon { box-shadow: 0 0 0 4px rgba(14, 116, 144, .15); }

/* Pills */
.tag { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: var(--text-3); border: 0; border-radius: 999px; padding: 3px 10px; line-height: 1.2; }
.pill-ok { background: var(--green); }

/* Buttons */
.btn { border-radius: 12px; font-weight: 600; }
.btn:not(.primary):not(.plain):not(.outline) { background: var(--bg); border: 1px solid var(--sep); }
.btn:not(.primary):not(.plain):not(.outline):hover { background: var(--bg-2); }
.seg { border-radius: 12px; }
.seg button { border-radius: 9px; }
.sheet { border-radius: 20px; }

/* Tables: no outer border, no lines between rows, one thin line under the header */
.table td { border-bottom: 0; }
.table th { font-size: 14px; font-weight: 500; color: var(--text-2); border-bottom: 1px solid var(--sep); }
.rp-table th + th, .rp-table td + td, [dir=rtl] .rp-table th + th, [dir=rtl] .rp-table td + td { border-left: 0; border-right: 0; }
.rp-table th, .rp-table th.r { text-align: center !important; }
.rp-table th:first-child { width: auto; }
.rp-table tfoot td { border-top: 1px solid var(--sep); }

/* Phone: no sidebar; the teal top bar and the bottom tabs */
@media (max-width: 899px) {
  :root { --t-title: 24px; }
  .topbar { height: auto; min-height: 56px; padding: var(--s2) var(--s4); padding-top: max(var(--s2), env(safe-area-inset-top)); }
  .top-avatar { width: 34px; height: 34px; }
  #page { padding: var(--s4) var(--s3) var(--s7); }
  .section { padding: 20px; }
  .foot { padding: var(--s3) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom)); }
  .tabbar a[aria-current="page"] { color: var(--accent); }
  .tabbar a .icon { width: 24px; height: 24px; font-size: 19px; }
  .stats { grid-template-columns: 1fr 1fr; gap: var(--s3); }
  .stat { min-height: 104px; padding: var(--s3); }
  .stat-num { font-size: 26px; }
  .badge-icon { width: 40px; height: 40px; }
}
@media (min-width: 900px) and (max-width: 1100px) { :root { --side: 220px; } #page, .foot { padding-left: var(--s4); padding-right: var(--s4); } .topbar { padding: 0 var(--s4); } }

/* Pages without sections: their main list or form sits on a white card too. */
#page > .list, #page > form, .sess-list, .pp-sec, .week, .month, .doc, #page > .invoice, #page > .print-page {
  background: var(--bg); border: 1px solid var(--sep); border-radius: var(--r); box-shadow: var(--card-shadow);
}
#page > .list, .pp-sec { padding: var(--s2) var(--s5); }
#page > form, .doc, #page > .invoice, #page > .print-page { padding: var(--s5); }
#page > .list.many { max-width: none; }
.sess-list { padding: 0 var(--s4); }
.sess-day { padding-top: var(--s4); }
.pp-sec + .pp-sec { margin-top: var(--s4); }
.pp-label { padding-top: var(--s3); }
.week, .month { overflow: clip; }
.week-head { border-radius: var(--r) var(--r) 0 0; }
@media (max-width: 899px) {
  #page > .list, .pp-sec { padding: var(--s1) var(--s3); }
  #page > form, .doc, #page > .invoice, #page > .print-page { padding: var(--s4); }
  .sess-list { padding: 0 var(--s3); }
}
@media print {
  #page > .invoice, #page > .print-page, .doc { border: 0; box-shadow: none; padding: 0; }
  .invoice.typing { outline: 0; }
}

/* Payments: the two totals (owed, paid in all) side by side on top. */
.pp-totals { grid-template-columns: 1fr 1fr; }

/* More page: rows that are already in the computer menu show only on a phone. */
@media (min-width: 900px) { .phone-only { display: none; } }

/* Task rows: the trash can sits after the flag, medium grey (between the line color and the grey text); red when you point at it. */
.del-btn { margin-left: 0; color: color-mix(in srgb, var(--text-2) 55%, var(--sep)); }
.del-btn:hover { color: var(--red); }
[dir=rtl] .del-btn { margin-right: 0; }

/* Client page: the last call is one line under Contacts. */
.last-call { padding-top: var(--s3); border-top: 1px solid var(--sep-2); }
.last-call > span:first-child { font-weight: 600; color: var(--text); }

/* Two buttons per row (phones): an odd last button fills its row. Wider screens leave it its normal size. */
@media (max-width: 540px) { .client-actions > .btn:last-child:nth-child(odd) { grid-column: 1 / -1; } }
/* A long name (like the Yiddish) goes onto two lines instead of touching the edges. */
.client-actions .btn { height: auto; min-height: 40px; padding-block: 6px; white-space: normal; text-align: center; line-height: 1.25; }

/* Fixes after review */
/* Payments "Mark as paid": Cancel stays a plain link, not a boxed button. */
.pp-confirm .sheet-foot .btn[data-cancel] { border: 0; background: none; }
/* Calendar: the date range keeps its 20px title size. */
.cal-bar h1 { font-size: 20px; }
/* Printed papers (invoice, receipt, print history) keep a light line between rows. */
.invoice .table td, .print-page .table td { border-bottom: 1px solid var(--sep-2); }
/* Phone calendar: the day header sticks right under the teal top bar (40px search + padding + notch). */
@media (max-width: 899px) { .week-head { top: calc(48px + max(var(--s2), env(safe-area-inset-top))); } }

/* Clients list: names only, each client on its own small rounded line with space between. */
#page .client-list, .section .client-list {
  max-width: 560px; padding: 0; background: none; border: 0; box-shadow: none;
  display: flex; flex-direction: column; gap: 8px;
}
.client-list > li, .client-list > li:last-child { border: 1px solid var(--sep); border-radius: var(--r-s); background: var(--bg); }
.client-list .row { min-height: 46px; margin: 0; width: 100%; padding: 6px 16px; border-radius: var(--r-s); }
.client-list .row .title { font-weight: 500; }
/* Closed clients: the same width as the list above, in a soft lavender box. */
.closed-box.wide { max-width: none; }
.closed-box { max-width: 560px; padding: 16px 20px; background: var(--closed-bg); border-color: var(--closed-line); box-shadow: none; }
.closed-box .section-head { padding-bottom: 8px; margin-bottom: 8px; border-color: var(--closed-line); }
.closed-box .client-list { max-width: none; }
.closed-box .client-list > li { background: var(--bg); border-color: var(--closed-line); }
.closed-box .empty { padding: 8px 0; text-align: start; }
#page .client-list.many { max-width: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); columns: auto; }

/* ---------- Organizations (shown only to tutors who work with one, organizations, and the site owner) ---------- */
.tile { background: var(--bg); border: 1px solid var(--sep); border-radius: var(--r); box-shadow: var(--card-shadow); padding: var(--s4); margin-bottom: var(--s4); }
.notice { background: var(--amber-bg); color: var(--text); border-radius: var(--r-s); padding: var(--s3) var(--s4); margin-bottom: var(--s4); font-size: var(--t-small); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; vertical-align: middle; }
.nav a { position: relative; }
.nav-badge { margin-inline-start: auto; }
.tabbar a { position: relative; }
.tabbar .nav-badge { position: absolute; top: 2px; inset-inline-start: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; }
.warn { color: var(--amber); }
.ok { color: var(--green); }
.danger-text { color: var(--red); }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: var(--s2); }
.save-bar.inline { position: static; border-top: 0; padding: 0; margin-top: var(--s3); background: none; }
.save-bar.inline .btn { min-width: 0; }
.chip-note { font-size: var(--t-caption); font-weight: 600; border-radius: 999px; padding: 2px 10px; background: var(--bg-2); color: var(--text-2); white-space: nowrap; }
.chip-note.ok { background: color-mix(in srgb, var(--green) 12%, var(--bg)); color: var(--green); }
.chip-note.warn { background: var(--amber-bg); color: var(--amber); }
.small-head { font-size: var(--t-small); color: var(--text-2); font-weight: 600; margin: var(--s4) 0 var(--s1); }

/* Sign-in tabs */
.auth-tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border-radius: var(--r-s); margin-bottom: var(--s5); }
.auth-tabs button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: none; font: inherit; font-weight: 600; color: var(--text-2); cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: var(--seg-on); color: var(--text); box-shadow: 0 1px 3px var(--shadow); }
.auth-switch { margin-top: var(--s4); text-align: center; font-size: var(--t-small); color: var(--text-2); }

/* The sheet */
.compose textarea, .reply-form textarea { width: 100%; }
.sheet-filter { display: flex; align-items: center; gap: var(--s3); margin: var(--s4) 0; }
.sheet-filter label { color: var(--text-2); font-size: var(--t-small); }
.sheet-filter select { max-width: 260px; }
.posts { display: flex; flex-direction: column; gap: var(--s3); }
.post { background: var(--bg); border: 1px solid var(--sep); border-radius: var(--r); padding: var(--s3) var(--s4); box-shadow: var(--card-shadow); }
.post.callme { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 35%, var(--bg)); }
.post-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s1); }
.post-head b.them { color: var(--accent-text); }
.post-head .caption { margin-inline-start: auto; color: var(--text-2); }
.tag.plain { background: var(--bg-2); color: var(--text-2); }
a.tag { color: #fff; text-decoration: none; }
.callme-line { color: var(--amber); font-weight: 600; margin: var(--s1) 0; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: var(--s1) 0; }
.post-foot { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); }
.post-foot .spacer { flex: 1; }
.seen { color: var(--green); }
.replies { margin-top: var(--s3); padding-inline-start: var(--s4); border-inline-start: 3px solid var(--sep); display: flex; flex-direction: column; gap: var(--s2); }
.post.reply { box-shadow: none; background: var(--bg-2); border: 0; }
.reply-form { margin-top: var(--s3); }
.copy { background: var(--bg-2); border-radius: var(--r-s); padding: var(--s2) var(--s3); margin: var(--s2) 0; font-size: var(--t-small); }
.copy p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-head { font-weight: 600; }
.copy-preview { margin-bottom: var(--s4); }
.callme-row .title { color: var(--amber); }

/* Tutor's client page and invites */
.org-box p { margin: 0 0 var(--s1); }
.org-box p:last-child { margin-bottom: 0; }
.org-note { white-space: pre-wrap; }
.invite p { margin: 0 0 var(--s2); }
.send-btn { color: var(--accent); flex: none; }
[data-recent] > li { display: flex; align-items: center; gap: var(--s2); }
[data-recent] > li > .row { flex: 1; min-width: 0; }
.goal-top { gap: var(--s2); }
.client-group .section-head h2 { display: flex; align-items: baseline; }

/* Owner page */
.org-req-head { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; margin-bottom: var(--s3); }
.org-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s4); margin: 0; }
.org-info div.wide { grid-column: 1 / -1; }
.org-info dt { font-size: var(--t-caption); color: var(--text-2); }
.org-info dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.test-mail summary { display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: var(--t-small); background: var(--bg-2); border-radius: var(--r-s); padding: var(--s3); margin: var(--s3) 0 0; direction: ltr; text-align: left; }

/* The organization's own pages: the same layout as the tutor's, without Find a client and Today */
body.org-mode #find, body.org-mode #today-btn { display: none; }
.org-brand { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; color: inherit; text-decoration: none; }
.org-tutor-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.sheet-btn { margin-top: var(--s3); }
.org-tutor-foot { margin-top: var(--s3); text-align: end; }
.contact-block { border-top: 1px solid var(--sep-2); padding-top: var(--s3); margin-top: var(--s2); }
@media (max-width: 600px) {
  .org-info { grid-template-columns: 1fr; }
  .page-head .actions { flex-wrap: wrap; }
}

/* Profile menu: opens from the round picture at the top */
.profile-menu { position: fixed; top: 56px; inset-inline-end: 12px; z-index: 60; width: min(300px, calc(100vw - 24px)); background: var(--surface); color: var(--text); border: 1px solid var(--sep); border-radius: var(--r); box-shadow: 0 12px 32px var(--shadow); padding: var(--s2); }
.profile-menu .profile-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-bottom: 1px solid var(--sep-2); margin-bottom: var(--s1); }
.profile-menu .avatar.big { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand); color: #fff; font-weight: 700; }
.profile-menu .profile-text { display: flex; flex-direction: column; min-width: 0; }
.profile-menu .profile-text span { color: var(--text-2); font-size: var(--t-small); overflow-wrap: anywhere; }
.profile-menu a, .profile-menu button { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 44px; padding: 0 var(--s3); border: 0; border-radius: var(--r-s); background: none; color: var(--text); font: inherit; text-align: start; text-decoration: none; cursor: pointer; }
.profile-menu a:hover, .profile-menu button:hover { background: var(--bg-2); }
.profile-menu [data-signout] { color: var(--red); }

/* The brand קבוע: Hebrew letters in Fb Philosof (the "Yiddish Title" font). */
.brand-name { font-family: "Yiddish Title", "Yiddish", "Noto Sans Hebrew", serif; font-weight: 800; font-size: 1.35em; letter-spacing: 0; line-height: 1; }
.auth-help { margin-top: var(--s5); text-align: center; color: var(--text-2); }

/* Phones and tablets: the side menu slides in over the page (after the sidebar look above, so it wins). */
@media (max-width: 899px) {
  .sidebar { width: min(280px, 84vw); z-index: 150; padding: 0 0 max(var(--s4), env(safe-area-inset-bottom)); box-shadow: 0 0 32px rgba(0, 0, 0, .22); }
  .brand { padding-top: env(safe-area-inset-top); height: calc(61px + env(safe-area-inset-top)); }
}

/* ---------- Fixes from the full review (2026-11-27) ---------- */
/* Sign in with Google and the "In progress" pill keep their own look (the plain-button rule above was stronger). */
.btn.google:not(.primary):not(.plain):not(.outline) { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.btn.google:not(.primary):not(.plain):not(.outline):hover { background: #f8f9fa; }
.btn.progress:not(.primary):not(.plain):not(.outline) { color: var(--accent); border: 1px solid var(--accent); background: var(--accent-tint); }
/* Dark look: text on bright colours is dark, so it can be read. */
:root { --on-bright: #fff; }
:root[data-theme="dark"] { --on-bright: #0a151c; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --on-bright: #0a151c; } }
.dp-day.sel .dp-n, .dp-day.sel .dp-h, .tag, .badge, .btn.primary.danger { color: var(--on-bright); }
/* Times read left to right in Yiddish too ("4:35 PM", not "PM 4:35"). */
[dir="rtl"] input[data-time], [dir="rtl"] input[type="tel"], [dir="rtl"] input[type="email"] { direction: ltr; text-align: right; }
/* Messages stay above Save and Cancel on phones. */
@media (max-width: 899px) { body:has(.scrim) #toasts, body:has(.save-bar) #toasts { bottom: 88px; } }
.toast { padding-block: 8px; }
/* Organization accounts on phones: the profile picture stays at the far end. */
body.org-mode .top-avatar { margin-inline-start: auto; }

/* ---------- Pick your plan (after a new login is approved) ---------- */
.auth.plans { max-width: 680px; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
@media (max-width: 599px) { .plan-cards { grid-template-columns: 1fr; } }
.plan-card { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); }
.plan-card h2 { font-size: 20px; }
.plan-price b { font-size: 28px; }
.plan-list { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 6px; }
.plan-card .btn { margin-top: auto; width: 100%; }
