/* Sound Communities brand (from the Sound Communities design system).
   Layout: charcoal left rail with the logo, off-white working area; the calendar is the centrepiece.
   Teal is the corporate colour for fills (always with charcoal text); yellow is the highlight; navy for links and secondary text. */
@font-face { font-family: "Kapra Neue"; src: url(fonts/KapraNeue-SemiBold.otf) format("opentype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Relative"; src: url(fonts/Relative-Medium.ttf) format("truetype"); font-weight: 100 900; font-display: swap; }
:root {
  --charcoal: #262626; --off-white: #f0f0eb; --teal: #00a29d; --yellow: #ffe500; --sage: #b5d5a4; --navy: #283f4b; --slate: #528891; --green: #00942a;
  --bg: var(--off-white); --surface: #ffffff; --surface-2: #e7e7e0; --line: #d4d6cf; --control: var(--slate);
  --fg: var(--charcoal); --muted: var(--navy); --accent: var(--teal); --accent-fg: var(--charcoal); --accent-soft: #d2ecea; --accent-ink: var(--navy);
  --highlight: var(--yellow); --on-highlight: var(--charcoal); --focus: var(--navy);
  --good: #1d6d33; --good-soft: var(--sage); --warn: #6b5200; --warn-soft: #fff3a3; --bad: #b3261e; --bad-soft: #f8e0dd;
  --rail-bg: var(--charcoal); --rail-fg: var(--off-white); --rail-muted: var(--sage);
  --shadow: 0 10px 30px rgba(38,38,38,.16);
  --f-display: "Kapra Neue", "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-body: "Relative", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Relative", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: var(--charcoal); --surface: var(--navy); --surface-2: #31505e; --line: #3f5b69; --control: #7aa3aa;
  --fg: var(--off-white); --muted: var(--sage); --accent: var(--teal); --accent-fg: var(--charcoal); --accent-soft: #1d4f52; --accent-ink: #5fd6ce;
  --focus: var(--yellow); --good: #9ad7a6; --good-soft: #2d4a3a; --warn: var(--yellow); --warn-soft: #4a4420; --bad: #ff9d93; --bad-soft: #4b2b2b;
  --rail-bg: #1b1b1b; --rail-fg: var(--off-white); --rail-muted: var(--sage);
  --shadow: 0 10px 30px rgba(0,0,0,.5); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: var(--charcoal); --surface: var(--navy); --surface-2: #31505e; --line: #3f5b69; --control: #7aa3aa;
  --fg: var(--off-white); --muted: var(--sage); --accent: var(--teal); --accent-fg: var(--charcoal); --accent-soft: #1d4f52; --accent-ink: #5fd6ce;
  --focus: var(--yellow); --good: #9ad7a6; --good-soft: #2d4a3a; --warn: var(--yellow); --warn-soft: #4a4420; --bad: #ff9d93; --bad-soft: #4b2b2b;
  --rail-bg: #1b1b1b; --rail-fg: var(--off-white); --rail-muted: var(--sage);
  --shadow: 0 10px 30px rgba(0,0,0,.5); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 500 15px/1.5 var(--f-body); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--f-body); font-weight: 500; text-wrap: balance; margin: 0; }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.num { font-size: .95em; }
a { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.app { display: grid; grid-template-columns: 216px minmax(0,1fr); min-height: 100vh; }
.rail { border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: env(safe-area-inset-top, 0px); height: 100vh; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-inline: 8px; }
/* The logo is drawn as a mask filled with the text colour, so it follows light and dark mode. */
.logo { display: block; width: 150px; aspect-ratio: 3000 / 955; max-width: 100%; background: var(--fg);
  -webkit-mask: url(logo.png) center / contain no-repeat; mask: url(logo.png) center / contain no-repeat; }
.logo-lg { width: 220px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font: 650 15px var(--f-display); }
.brand h1 { font: 500 12px var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; color: var(--muted); cursor: pointer; font-weight: 500; }
.nav button:hover { background: var(--surface-2); color: var(--fg); }
.nav button[aria-current="page"] { background: var(--accent-soft); color: var(--fg); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; font: 500 12px var(--f-mono); background: var(--warn-soft); color: var(--warn); border-radius: 99px; padding: 0 7px; }
.rail-foot { margin-top: auto; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; padding-inline: 8px; }

main { padding-block: 22px 60px; padding-inline: clamp(16px, 3vw, 36px); min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 18px; }
.page-head h2 { font-size: 26px; margin-right: auto; }
.sub { color: var(--muted); font-size: 14px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: var(--surface); border-color: var(--bad); }
.btn.sm { padding: 3px 9px; font-size: 13px; border-radius: 6px; }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn[disabled] { opacity: .5; cursor: default; }
.icon-btn { width: 34px; justify-content: center; padding-inline: 0; }

select, input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=month], input[type=search], textarea {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; width: 100%; min-width: 0; }
textarea { resize: vertical; min-height: 70px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar select, .toolbar input { width: auto; }
.week-label { font: 650 17px var(--f-display); min-width: 12ch; }

.chip { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); vertical-align: 1px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.pill.scheduled { background: var(--surface-2); color: var(--muted); }
.pill.attended, .pill.paid { background: var(--good-soft); color: var(--good); }
.pill.no_show, .pill.issued, .pill.changed { background: var(--warn-soft); color: var(--warn); }
.pill.cancelled, .pill.overdue { background: var(--bad-soft); color: var(--bad); }
.pill.none { background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* Week grid */
.cal-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cal { --hour: 56px; min-width: 820px; display: grid; grid-template-columns: 54px repeat(7, minmax(0,1fr)); }
.cal-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 8px 7px; font-size: 13px; color: var(--muted); }
.cal-head b { display: block; font: 650 20px/1.1 var(--f-display); color: var(--fg); }
.cal-head.today b { color: var(--accent); }
.cal-head.today { box-shadow: inset 0 -3px 0 var(--accent); }
.gutter { position: relative; border-right: 1px solid var(--line); }
.gutter span { position: absolute; right: 6px; transform: translateY(-50%); font: 11px var(--f-mono); color: var(--muted); }
.day { position: relative; border-left: 1px solid var(--line); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--line) calc(var(--hour) - 1px), var(--line) var(--hour)); }
.day.is-today { background-color: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.lesson { position: absolute; border-radius: 6px; padding: 3px 6px; overflow: hidden; cursor: pointer; font-size: 12px; line-height: 1.3; text-align: left; border: 0;
  background: color-mix(in srgb, var(--c) 20%, var(--surface)); border-left: 3px solid var(--c); color: var(--fg); }
.lesson:hover { background: color-mix(in srgb, var(--c) 30%, var(--surface)); z-index: 2; }
.lesson .t { font: 500 11px var(--f-mono); color: var(--muted); }
.lesson .n { font-weight: 600; display: block; }
.lesson .s { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson.cancelled { opacity: .5; }
.lesson.cancelled .n { text-decoration: line-through; }
.lesson .mark { position: absolute; top: 3px; right: 5px; font-size: 11px; font-weight: 700; }
.lesson.attended .mark { color: var(--good); }
.lesson.no_show .mark { color: var(--warn); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Tables and panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child > td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
td.r, th.r { text-align: right; }
.detail-row > td { background: var(--surface-2); padding: 6px 14px 14px; }
.detail-row table { font-size: 13px; background: var(--surface); border-radius: 8px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty h3 { color: var(--fg); font-size: 18px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.stat .k { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.stat .v { font: 650 26px/1.2 var(--f-display); font-variant-numeric: tabular-nums; }
.stat.warn .v { color: var(--warn); }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 20px; align-items: start; }
.section-title { font-size: 17px; padding: 14px 16px 10px; display: flex; align-items: baseline; gap: 10px; }
.section-title .sub { font-family: var(--f-body); font-weight: 400; }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: grid; grid-template-columns: 62px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.agenda .time { font: 500 13px var(--f-mono); }
.agenda .who { min-width: 0; }
.agenda .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda .who span { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.agenda .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.note { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 9px 12px; font-size: 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.note.info { background: var(--accent-soft); color: var(--fg); }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(8,16,12,.45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); width: min(600px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { font-size: 19px; margin-right: auto; }
.modal-body { padding: 16px 20px; display: grid; gap: 14px; }
.modal-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px 18px; border-top: 1px solid var(--line); }
.modal-foot .spacer { margin-right: auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.checklist { border: 1px solid var(--line); border-radius: 8px; max-height: 168px; overflow: auto; padding: 4px; }
.checklist label { display: flex; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.checklist label:hover { background: var(--surface-2); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 12px; cursor: pointer; font-size: 13px; font-weight: 600; }
.seg button[aria-pressed="true"].scheduled { background: var(--surface-2); border-color: var(--muted); }
.seg button[aria-pressed="true"].attended { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.seg button[aria-pressed="true"].no_show { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.seg button[aria-pressed="true"].cancelled { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { cursor: pointer; }
.swatches input { position: absolute; opacity: 0; pointer-events: none; }
.swatches .dot { width: 26px; height: 26px; border: 3px solid transparent; outline: 1px solid var(--line); }
.swatches input:checked + .dot { border-color: var(--surface); outline: 2px solid var(--fg); }
.swatches input:focus-visible + .dot { outline: 2px solid var(--accent); }
.warnbox { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.errbox { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.history { font-size: 14px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 6px; }
.history h4 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.history .row { display: flex; justify-content: space-between; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 9px 16px; border-radius: 10px; font-size: 14px; z-index: 80; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

/* Phone layout: top bar with logo and account button, tab bar along the bottom. */
.topbar, .tabbar { display: none; }
.theme-seg button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--fg); }
.rail-foot .theme-seg button { padding: 3px 10px; font-size: 12px; }

/* Calendar list for phones */
.day-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 14px; }
.day-chip { display: grid; justify-items: center; gap: 2px; padding: 6px 0 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; min-width: 0; }
.day-chip b { font: 650 18px/1.1 var(--f-display); color: var(--fg); }
.day-chip.today b { color: var(--accent); }
.day-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.day-chip[aria-pressed="true"] b { color: var(--accent-fg); }
.day-chip .pips { display: flex; gap: 2px; height: 5px; }
.day-chip .pips i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .55; }
.m-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m-item { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--surface); color: var(--fg);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 12px 0; overflow: hidden; cursor: pointer; }
.m-item .bar { align-self: stretch; background: var(--c); border-radius: 0 3px 3px 0; }
.m-item .tm { font: 500 13px var(--f-mono); color: var(--muted); display: block; }
.m-item b { display: block; overflow-wrap: anywhere; }
.m-item .meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; }
.m-item.cancelled b { text-decoration: line-through; color: var(--muted); }
.filters { margin-bottom: 12px; }
.filters summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 6px 0; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary::before { content: "▸ "; }
.filters[open] summary::before { content: "▾ "; }
.filters .toolbar { padding-top: 8px; }

@media (max-width: 760px) {
  .app { display: block; min-height: 100vh; }
  .rail { display: none; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .topbar .logo { width: 96px; }
  .topbar-title { font: 500 11px var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .avatar { margin-left: auto; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--accent-soft); color: var(--fg); font-weight: 600; cursor: pointer; flex: none; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tabbar:empty { display: none; }
  .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; color: var(--muted);
    font-size: 10.5px; font-weight: 600; padding: 4px 0; border-radius: 8px; position: relative; min-width: 0; cursor: pointer; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar button[aria-current="page"] { color: var(--accent); }
  .tabbar .count { position: absolute; top: -2px; left: calc(50% + 6px); font: 600 10px/16px var(--f-mono); min-width: 16px; padding: 0 4px; border-radius: 99px; background: var(--warn); color: var(--surface); }
  main { padding-block: 16px calc(90px + env(safe-area-inset-bottom, 0px)); padding-inline: 16px; }
  .app.no-tabs main { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
  .page-head { gap: 10px; margin-bottom: 14px; }
  .page-head h2 { font-size: 22px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
  .stat { padding: 10px 12px; }
  .stat .v { font-size: 20px; }
  .hide-sm { display: none; }
  input, select, textarea { font-size: 16px; }            /* stops iPhone zooming in on focus */
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; padding-inline: 11px; }
  .toolbar select, .toolbar input[type=search] { flex: 1 1 100%; width: 100%; max-width: none !important; }
  .week-label { min-width: 0; font-size: 15px; }
  th, td { padding: 10px; }
  .overlay { align-items: end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
  .modal-foot { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }
  .modal-foot .spacer { flex-basis: 100%; }
  .seg button { padding: 8px 14px; }
  .agenda li { grid-template-columns: 52px minmax(0,1fr); padding: 12px 14px; }
  .agenda .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: no-preference) { .modal { animation: rise .16s ease-out; } @keyframes rise { from { transform: translateY(8px); opacity: .6; } } }

/* Sign-in and access screens */
.gate { min-height: 100vh; display: grid; place-items: center; padding-inline: 16px; padding-block: calc(40px + env(safe-area-inset-top, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)); }
.gate-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: grid; gap: 14px; text-align: center; justify-items: center; }
.gate-card h2 { font-size: 24px; }
.gate-card p { margin: 0; color: var(--muted); }
.ms-btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; font-size: 15px; }
.ms-logo { display: grid; grid-template-columns: 8px 8px; gap: 2px; }
.ms-logo i { width: 8px; height: 8px; display: block; }

[hidden] { display: none !important; }
.check-row { display: flex; gap: 8px; align-items: center; font-size: 14px; }
#repeat-preview:empty { display: none; }

/* Calendar: Day / Week / Month */
.mode-seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.cal-day-link { all: unset; cursor: pointer; display: block; border-radius: 6px; }
.cal-day-link:hover b { text-decoration: underline; }
.cal-day-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-head small { display: block; font-size: 11px; color: var(--muted); }
.cal-head small.hol { color: var(--warn); font-weight: 600; }
.cal-teacher { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day.is-holiday { background-color: color-mix(in srgb, var(--warn-soft) 55%, transparent); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.month .dow { padding: 8px 8px 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.m-cell { min-height: 116px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.month .dow + .m-cell, .m-cell:nth-child(7n + 1) { border-left: 0; }
.month .dow:nth-child(n+2) { border-left: 1px solid var(--line); }
.m-cell:nth-child(-n + 14) { border-top: 0; }
.m-cell:hover { background: var(--surface-2); }
.m-cell.out { background: var(--surface-2); }
.m-cell.out .m-date { color: var(--muted); font-weight: 400; }
.m-cell.holiday { background: color-mix(in srgb, var(--warn-soft) 60%, var(--surface)); }
.m-date { font: 600 13px var(--f-mono); align-self: flex-start; padding: 0 6px; border-radius: 99px; }
.m-cell.today .m-date { background: var(--accent); color: var(--accent-fg); }
.m-hol { font-size: 11px; font-weight: 600; color: var(--warn); }
.m-chip { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 16%, var(--surface));
  color: var(--fg); border-radius: 4px; padding: 1px 5px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.m-chip:hover { background: color-mix(in srgb, var(--c) 28%, var(--surface)); }
.m-chip .mono { font-size: 11px; color: var(--muted); }
.m-chip.cancelled { text-decoration: line-through; opacity: .55; }
.m-more { background: none; border: 0; color: var(--accent); font-size: 12px; font-weight: 600; text-align: left; padding: 0 2px; cursor: pointer; }
.m-count { display: none; }
.m-cell.sel { box-shadow: inset 0 0 0 2px var(--accent); }
@media (max-width: 760px) {
  .m-cell { min-height: 54px; padding: 4px 2px; align-items: center; }
  .m-chip, .m-more, .m-hol { display: none; }
  .m-count { display: flex; gap: 2px; height: 5px; }
  .m-count i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
  .month .dow { padding: 6px 2px; text-align: center; font-size: 11px; }
  .page-head .mode-seg { order: 3; }
}
.lesson .one { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 14px; line-height: 18px; }
.lesson .s-inline { color: var(--muted); }

/* ---- Drafts, cover, time off ---- */
.pill.draft { background: transparent; color: var(--muted); border: 1px dashed var(--muted); }
.pill.cover { background: var(--accent-soft); color: var(--accent); }
.lesson.draft { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 12%, var(--surface)) 0 6px, var(--surface) 6px 12px);
  border: 1px dashed var(--c); border-left: 3px dashed var(--c); }
.lesson.draft .mark, .m-chip.draft .mono::after { color: var(--muted); }
.m-chip.draft { background: transparent; border: 1px dashed var(--c); border-left: 3px dashed var(--c); }
.m-item.draft { border-style: dashed; }
.draft-key { display: inline-block; width: 14px; height: 10px; border: 1px dashed var(--muted); border-radius: 2px; vertical-align: -1px; margin-right: 4px; }
.away-row { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.away-chip { font: 600 10.5px/1.6 var(--f-body); border: 0; border-radius: 4px; padding: 0 5px; cursor: pointer; background: var(--bad-soft); color: var(--bad); white-space: nowrap; }
.away-chip.wfh { background: var(--surface-2); color: var(--muted); }
.away-chip.cpd, .away-chip.keep_free { background: var(--warn-soft); color: var(--warn); }
.note .away-chip { font-size: 12.5px; padding: 1px 7px; }
.warn-text { color: var(--warn) !important; font-size: 13px; }
.series-box { display: grid; gap: 8px; justify-items: start; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.cover-now { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; margin-bottom: 6px; }
#cover-field .toolbar select { max-width: 220px; }
.pattern { display: grid; grid-template-columns: auto 1fr 1fr; gap: 6px 10px; align-items: center; max-width: 380px; }
.pattern input[type=time] { padding: 4px 8px; }
.checklist.tall { max-height: 260px; }
.checklist label.busy { color: var(--muted); }
.checklist label .sub { font-size: 12px; text-align: right; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }
.m-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.m-away { font-size: 10.5px; font-weight: 600; color: var(--bad); }

/* ---- Hours ---- */
.hbar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 3px; }
.hbar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.hbar.over i { background: var(--bad); }

/* ---- Auto-save state and undo toast ---- */
.save-state { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.save-state.ok { color: var(--good); }
.save-state.busy { color: var(--muted); }
.save-state.bad { color: var(--bad); }
.modal-head .save-state + .btn { margin-left: 8px; }
.toast { display: flex; align-items: center; gap: 14px; }
.toast-btn { background: none; border: 1px solid currentColor; color: inherit; border-radius: 6px; padding: 2px 10px; font: 600 13px var(--f-body); cursor: pointer; }

/* ---- Drag to move ---- */
.lesson, .m-chip { touch-action: none; }
.lesson.dragging, .m-chip.dragging { opacity: .85; z-index: 30; pointer-events: none; box-shadow: var(--shadow); cursor: grabbing; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }
.day.drop-target { background-color: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.m-cell.drop-target { box-shadow: inset 0 0 0 2px var(--accent); }
.drag-tip { position: fixed; z-index: 90; pointer-events: none; background: var(--fg); color: var(--bg); font: 600 12px var(--f-body); padding: 4px 8px; border-radius: 6px; box-shadow: var(--shadow); }

.lesson.needs-cover, .m-chip.needs-cover { outline: 2px solid var(--bad); outline-offset: -2px; }
.lesson.needs-cover .mark { color: var(--bad); }

/* ---- Drop-in sessions ---- */
.pill.dropin { background: var(--warn-soft); color: var(--warn); }
.kind-seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.headcount { display: grid; gap: 10px; background: var(--surface-2); border-radius: 10px; padding: 12px; }
.hc-total input { max-width: 140px; font-size: 18px; font-weight: 600; }
.hc-group { display: grid; gap: 4px; }
.hc-label { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.hc-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.hc-row input { max-width: 120px; }
.ok-text { color: var(--good); font-size: 14px; font-weight: 600; }
.hc-check .warn-text { font-weight: 600; }

/* ---- Square tabs (Staff page) ---- */
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 168px)); gap: 10px; margin: -4px 0 22px; }
.tab { display: grid; justify-items: start; align-content: start; gap: 2px; text-align: left; aspect-ratio: 1.25; padding: 12px 14px;
  background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; min-width: 0; }
.tab svg { width: 22px; height: 22px; color: var(--muted); margin-bottom: auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab .tab-label { font: 650 16px var(--f-display); margin-top: 14px; }
.tab .tab-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.tab:hover { border-color: var(--muted); }
.tab[aria-selected="true"] { background: var(--accent-soft); border: 2px solid var(--accent); padding: 11px 13px; }
.tab[aria-selected="true"] svg { color: var(--accent); }
.tab-body > p.sub:first-child { margin-top: 0 !important; }
.tab-body > .toolbar:first-child { margin-top: 0 !important; }
@media (max-width: 760px) {
  .tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
  .tab { aspect-ratio: auto; padding: 10px; }
  .tab[aria-selected="true"] { padding: 9px; }
  .tab .tab-label { margin-top: 8px; font-size: 14px; }
  .tab .tab-sub { display: none; }
}

/* ================= Brand layer ================= */
/* Display type: Kapra Neue in capitals for titles and big numbers, as in the logo. */
.page-head h2, .gate-card h2 { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; letter-spacing: .01em; font-size: 42px; line-height: 1; }
.stat .v { font-family: var(--f-display); font-weight: 600; font-size: 38px; line-height: 1.05; letter-spacing: .01em; }
.cal-head b, .day-chip b { font-family: var(--f-display); font-weight: 600; font-size: 26px; letter-spacing: .01em; }
.week-label { font: 500 17px var(--f-body); }
.section-title { font-size: 18px; }
.tab .tab-label { font-family: var(--f-display); font-weight: 600; font-size: 22px; text-transform: uppercase; letter-spacing: .02em; }
.stat .k, th, .hc-label, .history h4 { color: var(--muted); letter-spacing: .06em; }

/* Charcoal rail with the white logo; teal marks where you are. */
.rail { background: var(--rail-bg); color: var(--rail-fg); border-right: 0; }
.rail .logo { background: var(--rail-fg); }
.brand h1 { color: var(--rail-muted); }
.nav button { color: var(--rail-fg); opacity: .82; }
.nav button:hover { background: rgba(240,240,235,.1); color: var(--rail-fg); opacity: 1; }
.nav button[aria-current="page"] { background: var(--accent); color: var(--accent-fg); opacity: 1; }
.nav .count, .tabbar .count { background: var(--highlight); color: var(--on-highlight); }
.rail-foot { color: var(--rail-muted); }
.rail-foot b { color: var(--rail-fg); }
.rail-foot .btn, .rail-foot .seg button { background: transparent; color: var(--rail-fg); border-color: rgba(240,240,235,.35); }
.rail-foot .theme-seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

/* Shape: radius-md for cards and buttons, radius-sm for inputs, pills for tags. */
.panel, .stat, .cal-wrap, .month, .gate-card, .m-item, .day-chip, .tab, .headcount, .series-box { border-radius: 8px; }
.modal { border-radius: 8px; }
.btn { border-radius: 8px; border-color: var(--control); }
.btn.sm { border-radius: 6px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { filter: brightness(.93); }
.btn.ghost { border-color: transparent; }
select, input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=month], input[type=search], textarea {
  border-radius: 4px; border-color: var(--control); background: var(--surface); }
.seg button { border-color: var(--control); background: var(--surface); }
.mode-seg button[aria-pressed="true"], .kind-seg button[aria-pressed="true"], .day-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.day-chip[aria-pressed="true"] b { color: var(--accent-fg); }
.tab[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent); }
.tab[aria-selected="true"] svg, .tabbar button[aria-current="page"] { color: var(--accent-ink); }

/* Today markers use the yellow highlight. */
.cal-head.today b, .day-chip.today b { color: var(--fg); }
.cal-head.today b { background: var(--highlight); color: var(--on-highlight); border-radius: 6px; padding: 1px 6px 0; display: block; width: fit-content; margin-left: -6px; }
.cal-head.today { box-shadow: inset 0 -3px 0 var(--accent); }
.day.is-today { background-color: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.m-cell.today .m-date { background: var(--highlight); color: var(--on-highlight); }
.day-chip.today:not([aria-pressed="true"]) b { box-shadow: inset 0 -3px 0 var(--highlight); }

/* Status pills: charcoal text on brand tints; always with a word. */
.pill.attended, .pill.paid { background: var(--good-soft); color: var(--fg); }
.pill.no_show, .pill.issued, .pill.changed { background: var(--warn-soft); color: var(--fg); }
.pill.dropin { background: var(--highlight); color: var(--on-highlight); }
.pill.cover { background: var(--accent-soft); color: var(--fg); }
.away-chip.cpd, .away-chip.keep_free { background: var(--warn-soft); color: var(--fg); }
.ok-text { color: var(--good); }
.linklike { color: var(--accent-ink); }
.chip { background: var(--surface-2); color: var(--muted); }

/* Phone header in charcoal, like the rail. */
@media (max-width: 760px) {
  .topbar { background: var(--rail-bg); border-bottom: 0; }
  .topbar .logo { background: var(--rail-fg); }
  .topbar-title { color: var(--rail-muted); }
  .avatar { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
  .page-head h2 { font-size: 34px; }
  .stat .v { font-size: 30px; }
}

/* Sign-in: the wave pattern behind the card, never behind body text. */
.gate { background: var(--charcoal) url(wave-pattern.png) center / cover no-repeat; }
.gate-card { background: var(--bg); border: 0; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.gate-card .logo { background: var(--fg); }
.stat.warn { box-shadow: inset 0 4px 0 var(--highlight); }
.stat.warn .v { color: var(--fg); }
.gate.plain { background: var(--bg); }
.gate.plain .gate-card { box-shadow: none; }
.day.is-holiday { background-color: color-mix(in srgb, var(--warn-soft) 40%, transparent); }
.m-cell.holiday { background: color-mix(in srgb, var(--warn-soft) 45%, var(--surface)); }

/* ---- Teachworks ---- */
.tw-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.tw-line .btn { margin-left: auto; }
.tw-badge { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tw-line.ok { background: var(--good-soft); }
.tw-line.warn { background: var(--warn-soft); }
.tw-line.bad { background: var(--bad-soft); color: var(--bad); }
.tw-table { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.tw-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); }
.tw-ours { overflow-wrap: anywhere; }
#tw-save-state { margin-left: 0; }

/* ---- Long week: wide days, scrolling sideways, time column pinned ---- */
.cal-wrap.long { overflow-x: auto; overscroll-behavior-x: contain; }
.cal-wrap.long .gutter, .cal-wrap.long .cal > .cal-head:first-child { position: sticky; left: 0; z-index: 4; background: var(--surface); }
.cal-wrap.long .gutter { box-shadow: 1px 0 0 var(--line); }
.cal-wrap.long .cal-head { position: sticky; top: 0; }
.cal-wrap.long .cal > .cal-head:first-child { z-index: 5; }
.cal-wrap.long .lesson { font-size: 12.5px; }
.cal-wrap.long .lesson .s { white-space: normal; }

/* Searchable multi-pick dropdown (teachers and young people on a session) */
.combo { position: relative; }
.combo-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 42px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: text; }
.combo-box:focus-within { border-color: var(--accent, #00a29d); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #00a29d) 30%, transparent); }
.combo-chips { display: contents; }
.combo-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 9px; border: 0; border-radius: 999px; background: var(--surface-2); color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.combo-chip span { font-size: 15px; line-height: 1; opacity: .6; }
.combo-chip:hover span, .combo-chip:focus-visible span { opacity: 1; }
.combo-box .combo-input { flex: 1 1 140px; min-width: 120px; border: 0; padding: 4px 2px; background: transparent; box-shadow: none; outline: none; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--surface); box-shadow: var(--shadow); max-height: 240px; }
.combo-list label[hidden], .combo-list [hidden] { display: none; }
.combo-list .combo-none { padding: 6px 8px; margin: 0; }

/* Session blocks: each line looks different. Name is the headline, the teacher is solid text with a person icon,
   the place is quieter with a pin, and the service is a small capitals tag at the bottom. */
.lesson .n { font-size: 1.1em; line-height: 1.25; margin: 1px 0 2px; }
.lesson .s.who { color: var(--fg); font-weight: 500; }
.lesson .s.where { color: var(--muted); font-style: italic; }
.lesson .s.svc { margin-top: 3px; font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); opacity: .85; }
.lesson .ic { width: 11px; height: 11px; margin-right: 4px; vertical-align: -1px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; opacity: .75; }
.cal-wrap.long .lesson .s.who, .cal-wrap.long .lesson .s.where { padding-left: 15px; text-indent: -15px; }

/* Teachworks: sessions changed since they were sent */
.note.tw-changed { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--warn-soft); border-left: 4px solid var(--warn); }
.note.tw-changed > span { flex: 1 1 320px; }
.tw-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; max-height: 220px; overflow: auto; }
.tw-list .num { font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin-right: 6px; }
.tw-list .sub { font-size: 12px; margin-left: 4px; }
.combo-opt { display: block; width: 100%; text-align: left; border: 0; background: none; color: inherit; font: inherit; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.combo-opt:hover, .combo-opt:focus-visible { background: var(--surface-2); outline: none; }
.combo-opt[aria-selected="true"] { font-weight: 600; }
.combo-opt[aria-selected="true"]::after { content: "✓"; float: right; color: var(--accent-ink); }
.combo-opt.blank { color: var(--muted); }
.combo-opt[hidden] { display: none; }
.combo.single .combo-box { cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }

/* Sites */
.combo-group { padding: 8px 8px 2px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.combo-group[hidden] { display: none; }
.site-tag { font-weight: 600; }
#undo-edit { margin-left: 8px; }
.grid2.time-row { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }

/* Drop-in: known young people */
.hc-people .combo { margin-top: 4px; }
.combo-add { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; color: var(--accent-ink); font: inherit; font-weight: 600; padding: 8px; cursor: pointer; }
.combo-add:hover, .combo-add:focus-visible { background: var(--accent-soft); outline: none; }
.combo-add[hidden] { display: none; }

/* Practitioner calendar */
.lesson.mine.due { outline: 2px dashed var(--warn); outline-offset: -2px; }
.lesson.mine.due .mark { color: var(--warn); }
.page-head .mode-seg { margin-left: auto; }

/* Attendance outcomes */
.status-pick-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.status-pick-row .btn.on { background: var(--good-soft); border-color: var(--good); }
select.status-pick { width: auto; padding: 4px 8px; font-size: 13px; min-height: 0; }
.pill.left_early, .pill.wfh { background: var(--good-soft); color: var(--fg); }
.pill.sick { background: var(--warn-soft); color: var(--fg); }
.pill.cancelled_advance { background: var(--bad-soft); color: var(--bad); }
.lesson.cancelled_advance { opacity: .5; }
.lesson.cancelled_advance .n { text-decoration: line-through; }
.lesson.left_early .mark, .lesson.wfh .mark { color: var(--good); }
.lesson.sick .mark, .lesson.no_show .mark { color: var(--warn); }
.lesson.cancelled .mark, .lesson.cancelled_advance .mark { color: var(--bad); }
.m-chip.cancelled_advance { text-decoration: line-through; opacity: .55; }
.m-item.cancelled_advance b { text-decoration: line-through; color: var(--muted); }
.seg button[aria-pressed="true"].left_early, .seg button[aria-pressed="true"].wfh { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.seg button[aria-pressed="true"].sick { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.seg button[aria-pressed="true"].cancelled_advance { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }

/* Attendance outcomes */
.status-pick-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.status-pick-row .btn.on { background: var(--good-soft); border-color: var(--good); }
select.status-pick { width: auto; padding: 4px 8px; font-size: 13px; min-height: 0; }
.pill.left_early, .pill.wfh { background: var(--good-soft); color: var(--fg); }
.pill.sick { background: var(--warn-soft); color: var(--fg); }
.pill.cancelled_advance { background: var(--bad-soft); color: var(--bad); }
.lesson.cancelled_advance { opacity: .5; }
.lesson.cancelled_advance .n { text-decoration: line-through; }
.lesson.left_early .mark, .lesson.wfh .mark { color: var(--good); }
.lesson.sick .mark, .lesson.no_show .mark { color: var(--warn); }
.lesson.cancelled .mark, .lesson.cancelled_advance .mark { color: var(--bad); }
.m-chip.cancelled_advance { text-decoration: line-through; opacity: .55; }
.m-item.cancelled_advance b { text-decoration: line-through; color: var(--muted); }
.seg button[aria-pressed="true"].left_early, .seg button[aria-pressed="true"].wfh { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.seg button[aria-pressed="true"].sick { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.seg button[aria-pressed="true"].cancelled_advance { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }

/* ---- Phone polish ---- */
.agenda .who .pill { display: inline-flex; width: auto; vertical-align: 1px; }
.m-cell.sel { box-shadow: inset 0 0 0 2px var(--accent); }
@media (max-width: 760px) {
  .section-title { flex-wrap: wrap; row-gap: 2px; padding: 12px 14px 8px; }
  .section-title .sub { flex-basis: 100%; font-size: 13px; }
  .agenda .acts { grid-column: 2; }
  .agenda .time { font-size: 12px; }
  .modal { max-height: calc(100dvh - 20px); }
  .modal-head { flex-wrap: wrap; row-gap: 2px; padding: 14px 16px 10px; }
  .modal-head h3 { order: 1; font-size: 18px; flex: 1 1 calc(100% - 56px); min-width: 0; margin-right: 0; }
  .modal-head [data-close] { order: 2; }
  .modal-head .save-state { order: 3; flex: 1 1 calc(100% - 100px); margin-left: 0; white-space: normal; }
  .modal-head #undo-edit { order: 4; margin-left: 0; }
  .modal-body { padding: 14px 16px; gap: 12px; }
  .modal-foot { padding-inline: 16px; }
  .modal-body .grid2 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .status-pick-row { width: 100%; }
  .status-pick-row select.status-pick { flex: 1 1 140px; min-height: 34px; }
  .page-head .toolbar { flex-wrap: wrap; }
  .stat .k { font-size: 11px; }
}

/* Outlook */
.feed-row { display: flex; gap: 8px; }
.feed-row input { flex: 1 1 auto; min-width: 0; font: 13px var(--f-mono); }
.feed-steps { display: grid; gap: 10px; font-size: 14px; }
.feed-steps ol { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 2px; }
.note.ol-note { background: var(--warn-soft); margin: 0; }
.section-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rail-foot .btn[data-act="feed-open"] { margin-bottom: 6px; }
