/*
 * Commons: the public pages.
 *
 * The request form, the calendar views, the portal, check-in, signage,
 * agreements, support, shift sign-up and the kiosk. Loaded after
 * commons-base.css on pages a visitor can reach, and never in the console.
 *
 * tools/css-check.php decides which file a class belongs in by which PHP
 * sources emit it; run it after moving anything.
 */

/* ─── Reports ───────────────────────────────────────────────────── */

/* The crew's job list. Built for a phone held in one hand at seven in the
   morning: one job per block, the action within thumb reach, no table. */
.cm-crew { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.cm-crew__job { border: 1px solid var(--cm-line, #d4d4d7); border-inline-start: 4px solid var(--cm-steel-deep); border-radius: 6px; padding: 10px 12px; background: #fff; }
.cm-crew__job--late { border-left-color: #a33; }
.cm-crew__where { font-size: 13px; color: #4a5560; margin-top: 2px; }
.cm-crew__detail { font-size: 13px; margin-top: 4px; }
.cm-crew__act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.cm-crew__act input[type="text"] { flex: 1 1 12em; min-width: 0; }
@media (max-width: 600px) {
	.cm-crew__act { flex-direction: column; align-items: stretch; }
	.cm-crew__act .cm-button { width: 100%; }
	/* The flex shorthand above was written for a ROW, where 12em is a width.
	   In a column it is a height, so the note box grew to 192px and every job
	   card to 416 — a crew member with six jobs scrolling a quarter of a
	   screen of empty box between each one, on the phone this list exists
	   for. Basis off; the width comes from stretch. */
	.cm-crew__act input[type="text"] { flex: 0 0 auto; width: 100%; }
}

/* ─── Front end ─────────────────────────────────────────────────── */
.cm-notice--good { border-left-color: var(--cm-good); }

/* The concierge: deep-linked "book this instead" cards under a clashed request. */
.cm-offers { margin: 0 0 18px; }
.cm-offers__lead { margin: 0 0 8px; font-weight: 600; }
.cm-offers__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 520px; }
.cm-offer__link { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 12px; padding: 10px 14px; border: 1px solid var(--cm-line); border-radius: 6px; background: var(--cm-soft); text-decoration: none; color: inherit; transition: border-color .12s, background .12s; }
.cm-offer__link:hover, .cm-offer__link:focus { border-color: var(--cm-accent, #4f7499); background: #fff; }
.cm-offer__what { grid-row: span 2; align-self: center; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cm-steel-deep, #416180); }
.cm-offer--space .cm-offer__what { color: #7a5b12; }
.cm-offer--note .cm-offer__what { color: #555; }
.cm-offer__label { font-weight: 600; }
.cm-offer__reason { grid-column: 2; font-size: 13px; color: #555; }
.cm-field-pair input { max-width: 235px; }

/* ─── The door ──────────────────────────────────────────────────── */

/*
 * Sized for a person holding a bag of basketballs in one hand. The button is
 * deliberately enormous; there is exactly one thing to do on this screen.
 */
.cm-kiosk { max-width: 460px; margin: 0 auto; text-align: center; padding: 24px 16px; }
.cm-kiosk h1 { font-size: 28px; margin-bottom: 4px; }
.cm-kiosk__what { font-size: 22px; font-weight: 600; margin: 20px 0 4px; }
.cm-kiosk__when { font-size: 17px; color: var(--cm-muted); margin-top: 0; }
.cm-kiosk__button { display: block; width: 100%; padding: 26px; font-size: 24px; font-weight: 600; border: 0; border-radius: 8px; background: var(--cm-good); color: #fff; cursor: pointer; margin-top: 20px; }
.cm-kiosk__button--out { background: var(--cm-blue); }
.cm-kiosk__who { display: block; margin: 14px 0; font-size: 16px; }
.cm-kiosk__who input { font-size: 20px; padding: 8px; width: 100%; max-width: 320px; }
.cm-kiosk__count { display: block; margin: 18px 0; font-size: 16px; }
.cm-kiosk__count input { font-size: 22px; padding: 8px; width: 100px; text-align: center; }
.cm-kiosk__notice { padding: 12px; border-radius: 4px; font-size: 16px; }
.cm-kiosk__notice--good { background: #e5f3e8; color: var(--cm-good); }
.cm-kiosk__notice--bad { background: #fbeaea; color: var(--cm-bad); }
.cm-kiosk__none { font-size: 18px; color: var(--cm-muted); margin: 24px 0; }
.cm-kiosk__later { list-style: none; padding: 0; text-align: start; display: inline-block; }

/* ─── Hall display ──────────────────────────────────────────────── */
.cm-board__date { font-size: 20px; color: var(--cm-muted); margin-top: 4px; }
.cm-board__list { list-style: none; padding: 0; margin-top: 24px; }
.cm-board__list li { display: grid; grid-template-columns: 130px 1fr 260px; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--cm-line); font-size: 24px; }
.cm-board__now { font-weight: 700; }
.cm-board__now .cm-board__time::after { content: " \25CF  now"; color: var(--cm-good); }
.cm-board__time { color: var(--cm-muted); }
.cm-board__where { color: var(--cm-muted); text-align: end; }
/* The board is built for a hallway TV, three fixed columns at 24px. On a
   phone the room column alone was wider than the screen; there, each
   booking stacks: time, then what, then where. */
@media (max-width: 600px) {
	.cm-board__list li { grid-template-columns: 1fr; gap: 2px; font-size: 19px; }
	.cm-board__where { text-align: start; }
}
.cm-board__empty { font-size: 24px; color: var(--cm-muted); margin-top: 40px; }

/* ─── Portal ────────────────────────────────────────────────────── */
.cm-portal__now { list-style: none; padding: 0; }
.cm-portal__now li { padding: 10px 0; display: flex; gap: 12px; align-items: center; }

/* ─── Portal prompts (coach side) ───────────────────────────────── */

.cm-portal__prompts { margin: 16px 0 28px; }
.cm-prompt { border: 1px solid var(--cm-line); border-radius: 4px; padding: 16px 18px; margin-bottom: 12px; background: var(--cm-bg); }
.cm-prompt--focus { border-color: var(--cm-blue); box-shadow: 0 0 0 3px rgba(14,107,168,.12); }
.cm-prompt h4 { margin: 0 0 6px; font-size: 16px; }
.cm-prompt__tweak label { margin-inline-end: 12px; font-weight: 400; }
.cm-prompt__form { margin-top: 10px; }

/* ── The Help Center (front end) ── */
.cm-helpcenter__hero { background: var(--cm-ground); border: 1px solid var(--cm-rule); border-radius: 0; padding: 22px 24px; margin-bottom: 20px; }
.cm-helpcenter__lead { margin: 0 0 12px; font-size: 22px; }
.cm-helpcenter__ask { display: flex; gap: 8px; }
.cm-helpcenter__ask input { flex: 1; min-height: 42px; border-radius: 2px; border: 1px solid var(--cm-rule); padding: 0 14px; font-size: 15px; }
.cm-helpcenter__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cm-helpcenter__chip { border: 1px solid var(--cm-rule); background: #fff; border-radius: 0; padding: 6px 12px; font-size: 12.5px; color: var(--cm-steel-deep); cursor: pointer; }
.cm-helpcenter__chip:hover { border-color: var(--cm-steel); color: var(--cm-steel-deep); }
.cm-helpcenter__doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 0 0 22px; }
.cm-helpcenter__door { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--cm-rule); border-top: 3px solid var(--cm-steel); border-radius: 0; background: #fff; text-decoration: none; transition: border-color .12s, box-shadow .12s; }
.cm-helpcenter__door:hover { border-color: var(--cm-steel); box-shadow: none; background: var(--cm-steel-soft); }
.cm-helpcenter__door-title { font-weight: 700; color: #10272c; }
.cm-helpcenter__door-sub { font-size: 12.5px; color: #5b7276; }
.cm-helpcenter__guide { border: 1px solid var(--cm-rule); border-radius: 0; padding: 4px 18px 14px; background: #fff; }
.cm-helpcenter__guide summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
.cm-helpcenter__guide-body h2 { font-size: 17px; margin: 18px 0 6px; }
.cm-helpcenter__guide-body h3 { font-size: 14.5px; margin: 14px 0 4px; }
.cm-helpcenter__guide-body p, .cm-helpcenter__guide-body li { font-size: 14px; line-height: 1.6; color: #33474b; }
.cm-helpcenter__guide-body blockquote { margin: 8px 0 12px; padding: 4px 0 4px 14px; border-inline-start: 3px solid var(--cm-brand, #4f7499); }
.cm-helpcenter__guide-body blockquote p { margin: 0; font-style: italic; }

/* ── Notices as toned cards ── */
.cm-root .cm-notice--good { border-left-color: var(--cmr-success); background: #ecfdf5; }

/* The waiver on the request form: set apart so it reads as something to
   sign, not another field to skim past. */
.cm-waiver { border: 1px solid var(--cmr-line, #d8dee4); border-radius: 8px; padding: 14px 16px; margin: 18px 0; background: var(--cmr-soft, #f8fafc); }
.cm-waiver__text { font-size: 14px; line-height: 1.5; max-height: 240px; overflow-y: auto; margin-bottom: 10px; }
.cm-waiver .cm-check { font-size: 14px; }

/* ── Survey fieldsets read as choices, not bare boxes ── */
.cm-root .cm-survey__ratings { display: flex; gap: 8px; flex-wrap: wrap; }
.cm-root .cm-survey__ratings label { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--cmr-line); border-radius: 0; padding: 9px 16px; cursor: pointer; margin: 0; font-weight: 600; background: var(--cmr-surface); }
.cm-root .cm-survey__ratings label:has(input:checked) { border-color: var(--cmp); background: var(--cmp-soft); }
.cm-root .cm-survey__problems { display: grid; gap: 6px; }
.cm-root .cm-survey__problems label { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 0; }

/* ── Phones ── */
@media (max-width: 620px) {
	.cm-root .cm-field-pair input { max-width: none; }
	
	.cm-root .cm-helpcenter__doors { grid-template-columns: 1fr; }
}

/* ── Account requests ── */
/* The honeypot: off-canvas, not display:none — some bots skip invisible
   fields but still fill absolutely-positioned ones. Real keyboards never
   land here (tabindex -1). */
.cm-root .cm-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
/* Two fields side by side, not a column of labels beside a column of inputs.
   The label and the input are siblings, so a plain two-column grid dealt them
   into separate columns — "From / Until" became a label list with the boxes
   stranded to the right of it. Filling column-first puts each label back on
   top of its own field; on a phone the flow goes back to rows and they
   stack, label, box, label, box. */
.cm-root .cm-field-pair {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: auto auto;
	grid-auto-flow: column;
	gap: 0 16px;
}
.cm-root .cm-field-pair input { max-width: none; width: 100%; box-sizing: border-box; }
/* Anything in the pair that is not one of the four fields — the live preview
   that appears beside the dates, the sentence a screen reader gets — was
   flowing into a third column of its own and stretching the two rows apart,
   so the labels sat a long way above the boxes they name. Off the flow and
   onto their own row. */
.cm-root .cm-field-pair > *:not(label):not(input) {
	grid-column: 1 / -1;
	grid-row: 3;
}
/* A pair whose fields come wrapped, label and box together in a <p> inside a
   <div> (the account request form), is two cells side by side, not four.
   The rule above once caught the wrappers too and dealt both into the same
   cell, so "Last name" printed over "First name" and covered its box. The
   request form's own pair is a <p> whose script adds a line inside it; that
   line still takes its own row, so this is scoped to the <div> form. */
.cm-root div.cm-field-pair { grid-template-rows: none; grid-auto-flow: row; }
.cm-root div.cm-field-pair > p { grid-column: auto; grid-row: auto; margin-top: 0; min-width: 0; }
@media (max-width: 560px) {
	.cm-root .cm-field-pair { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
	.cm-root .cm-field-pair > *:not(label):not(input) { grid-column: auto; grid-row: auto; }
}

/* ── Facility needs & work orders ── */
.cm-root .cm-needs .cm-need { display: inline-flex; align-items: center; gap: 7px; margin: 4px 12px 4px 0; padding: 8px 14px; border: 1px solid var(--cm-rule); border-radius: 0; font-size: 14px; cursor: pointer; background: #fff; }
.cm-root .cm-needs .cm-need:has(input:checked) { border-color: var(--cm-steel); background: var(--cm-steel-soft); }
.cm-root .cm-needs input[type=checkbox] { width: auto; min-height: 0; margin: 0; }

/* ── Guided tours ── */

/* The second-door offer on the portal: present, never pushy. */
.cm-root .cm-portal__signin { margin-top: 26px; padding: 16px 18px; border: 1px dashed var(--cm-rule); border-radius: 0; }
.cm-root .cm-portal__signin p { margin: 0 0 10px; font-size: 14px; color: #33484c; }

/* ── The public hub: the front door that shows the life of the place ── */
.cm-hub h2 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cm-hub__date { font-size: 14px; font-weight: 500; color: var(--cmr-muted, #5b7276); }
.cm-hub__list { list-style: none; margin: 10px 0 26px; padding: 0; }
.cm-hub__list li { display: grid; grid-template-columns: 150px 1fr auto; gap: 14px; padding: 9px 12px; border-bottom: 1px solid #e3edee; align-items: baseline; border-radius: 8px; }
.cm-hub__list--week li { grid-template-columns: 64px 90px 1fr auto; }
.cm-hub__list li.is-now { background: #ecf7f1; }
.cm-hub__time { color: #5b7276; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; }
.cm-hub__day { font-weight: 700; font-size: 13px; color: var(--cm-steel-deep); white-space: nowrap; }
.cm-hub__what { font-weight: 600; }
/* #127049, not #1a9e6a: the brighter green is 3.42:1 on white and this is
   12.5px — under the 4.5 that size needs. */
.cm-hub__now { color: #127049; font-size: 12.5px; font-weight: 700; }
.cm-hub__where { color: #5b7276; font-size: 13.5px; text-align: end; }
.cm-hub__quiet { color: #5b7276; margin: 8px 0 24px; }
.cm-hub__cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 10px 0 26px; }
.cm-hub__card { border: 1px solid var(--cm-rule); border-top: 3px solid var(--cm-steel); border-radius: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; background: #fff; }
.cm-hub__card span { color: #5b7276; font-size: 13px; }
.cm-hub__doors { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; padding-top: 18px; border-top: 1px solid #e3edee; }
@media (max-width: 640px) {
	.cm-hub__list li, .cm-hub__list--week li { grid-template-columns: 1fr; gap: 2px; }
	.cm-hub__where { text-align: start; }
}
.cm-hub__card { border-radius: 0; }
.cm-root .cm-need { border-radius: 0; }

/* A person's own name is not a label: the greeting keeps the condensed
   face but never shouts, because an uppercased email address is unreadable. */
.cm-root .cm-portal__hello { text-transform: none; letter-spacing: .01em; }

/* ─── What we email you, on the coach's own page ────────────────── */
.cm-portal__prefs { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--cmr-line, #dcdcdf); }
.cm-portal__prefs h3 { margin: 0 0 10px; }
.cm-portal__pref { margin: 0 0 10px; }
.cm-portal__pref label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.cm-portal__pref .cm-fineprint { display: block; margin-inline-start: 26px; }

/* ── QR labels (Resources → Print QR labels) ─────────────────────────
   A grid of stick-on labels on screen; a clean sheet when printed, with
   the admin chrome hidden. */
.cm-agreement__text, .cm-agreement-doc__text { max-height: 260px; overflow: auto; padding: 10px 12px; background: #fff; border: 1px solid var(--cm-line, #d4d4d7); font-size: 14px; line-height: 1.5; white-space: normal; }
.cm-agreement-doc__facts { border-collapse: collapse; margin: 0 0 14px; }
.cm-agreement-doc__facts th { text-align: start; padding: 3px 14px 3px 0; color: #646970; font-weight: 500; vertical-align: top; }
.cm-agreement-doc__facts td { padding: 3px 0; }
.cm-agreement-doc__signed { margin-top: 14px; font-weight: 600; }
.cm-agreement-doc__blank { margin-top: 28px; }
@media print {
	.cm-agreement-doc__text { max-height: none; overflow: visible; border: 0; padding: 0; }
}

/* ─── The conversation on a job ─────────────────────────────────── */

/* The thread is above the Done button on purpose, so a question the
   office asked is read before the job is closed. With ten photographs in
   it that purpose costs the person in the plant room eight screens of
   scrolling to reach the one button they came for. The link keeps the
   order and gives them the shortcut. */
.cm-thread__skip { margin: 0 0 10px; font-size: 14px; }

/* ─── Eight languages ─────────────────────────────────────────────────
 *
 * The rest of this stylesheet uses logical properties, so Arabic flips on
 * its own from the dir="rtl" CM_I18n puts on every page root. What is left
 * here is the handful of rules that cannot: four floats, whose logical form
 * (float: inline-start) is too recent to rely on in a school's older iPads,
 * and anything genuinely anchored to a side of the screen.
 */

.cm-portal__lang select { min-width: 12rem; }

/* ── The big days: real links, never clipped ── */
.cm-hub__cards { list-style: none; padding: 0; }
.cm-hub__cards li { margin: 0; padding: 0; min-width: 0; list-style: none; }
.cm-root a.cm-hub__card {
	height: 100%;
	color: var(--cmr-ink, #1d1f20);
	text-decoration: none;
	overflow-wrap: anywhere;
	cursor: pointer;
	transition: border-color .12s, box-shadow .12s;
}
.cm-root a.cm-hub__card strong { font-size: 16px; line-height: 1.25; }
.cm-root a.cm-hub__card:hover { border-color: var(--cmp, #4f7499); box-shadow: 0 1px 0 var(--cmp, #4f7499); }
.cm-root a.cm-hub__card:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.cm-root a.cm-hub__card:focus-visible { outline: 2px solid var(--cmp-dark, #416180); outline-offset: 2px; }

/* ── Files, and the View as button ─────────────────────────────────────── */

/* The door code beside a booking on the person's page: plain and copyable, nothing
   that looks like a button, because the only thing to do with it is read it. */
.cm-portal__door { display: block; margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--cm-ink, #1d2327); }
