/* Hype Labour Planner — planner-specific styles (the grid, legend, mini apps).
   The shared look (palette, Inter, buttons, cards, tables, pop-ups, toasts, phone layout) lives in hype_ui.css,
   imported first so every page that links this file gets the one template (UI_STANDARD.md, LAWS.md Law 4).
   The names below are the planner's old variable names, now pointing at the shared tokens. */
@import url("/static/hype_ui.css?v=20261130a");
:root{
  --navy:var(--hu-navy);   /* toast, old top bar */
  --navy-mid:var(--hu-heading);      /* old top bar gradient end (unused; items #2-#9 retire it) */
  --red:var(--hu-red-ink);           /* old top bar accent + clash ring; kept so the bar looks the same on every page until items #2-#9 */
  --red-dk:var(--hu-red-ink);
  --blue:var(--hu-action);          /* links / hover */
  --body:var(--hu-page);            /* page background */
  --card:var(--hu-white);           /* card background */
  --tint:var(--hu-tint);            /* section tint */
  --head:var(--hu-slate-fill-light);/* table head band */
  --line:var(--hu-border);          /* dividers */
  --line2:var(--hu-border);
  --ink:var(--hu-text);             /* body text */
  --ink-strong:var(--hu-navy);      /* strong headings */
  --muted:var(--hu-faint);          /* labels / muted */

  /* status dots (palette families; red = sick only, a problem) */
  --booked:var(--hu-blue-edge); --off:var(--hu-faint); --sick:var(--hu-red-edge); --holiday:var(--hu-violet-edge);
  --provisional:var(--hu-amber-edge); --unavailable:var(--hu-slate-edge);

  /* back-compat aliases for any inline styles in templates */
  --accent:var(--hu-action); --cell:var(--hu-tint);

  /* ===== Full-width dashboard — tweakables (planner page only) ===== */
  --page-max:100%;          /* fluid — pages stretch with the window (Build 3.4) */
  --logo-h:66px;            /* header logo size (original was 38px) */
  --person-col:218px;       /* person column width */
  --act-col:178px;          /* actions/notify column width */
  --row-h:100px;            /* person row height */
  --head-h:68px;            /* calendar header row height */
  --hero-navy:var(--hu-heading);      /* headings / strong text */
  --hero-blue:var(--hu-action);       /* primary buttons / accent */
  --hero-accent:var(--hu-blue-edge);  /* lighter accent */
  --page-bg:var(--hu-page);           /* page background */
  --head-grey:var(--hu-head);         /* calendar header band */
  --row-divider:var(--hu-divider);    /* divider between people */
  --light-border:var(--hu-border);    /* card borders */
  --muted2:var(--hu-muted);           /* muted text */
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:var(--hu-font);
  color:var(--ink); background:var(--body);
  -webkit-font-smoothing:antialiased;
}

/* ---------- Brand header (navy gradient + red base, like the emails) ---------- */
.brandbar{
  display:flex; align-items:center; gap:14px;
  background:#fff;
  border-bottom:1px solid var(--line);
  padding:15px 22px;
}
.brandbar .brand{display:flex; align-items:center; gap:13px; min-width:0}
.brandbar img.logo{height:38px; width:auto; display:block; flex:none}
.brandbar .titles{display:flex; flex-direction:column; line-height:1.15; min-width:0}
.brandbar .pretitle{font-size:14px; font-weight:700; letter-spacing:3px; text-transform:uppercase; color:var(--blue); margin-bottom:2px}
.brandbar h1{font-size:20px; margin:0; font-weight:700; color:var(--ink-strong); letter-spacing:-.01em}
.brandbar .spacer{flex:1}
/* header-right controls (mini apps put week nav here) */
.brandbar .hnav{display:flex; align-items:center; gap:8px; flex-wrap:wrap}

.wrap{padding:0 0 48px}
.pad{padding:16px 22px}

/* ---------- Toolbar (white strip under the header: week nav + actions) ---------- */
.toolbar{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:14px 22px; background:var(--card); border-bottom:1px solid var(--line);
}
.toolbar .right{margin-left:auto; display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.weekrange{font-weight:700; font-size:16px; min-width:150px; text-align:center; color:var(--ink-strong)}

/* ---------- Buttons: .btn / .primary / .danger / .quiet live in hype_ui.css ---------- */

/* ---------- Legends ---------- */
.legend{display:flex; gap:16px; flex-wrap:wrap; font-size:14px; color:var(--muted); padding:12px 22px 4px}
.legend .x{margin-left:auto}
.dot{display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:6px; vertical-align:middle}
.dot.Booked{background:var(--booked)} .dot.Off{background:var(--off)}
.dot.Sick{background:var(--sick)} .dot.Holiday{background:var(--holiday)}
.dot.Provisional{background:var(--provisional)} .dot.Unavailable{background:var(--unavailable)}
.sitelegend{display:flex; gap:8px 16px; flex-wrap:wrap; font-size:14px; color:var(--ink); padding:4px 22px 14px}
.sitelegend .item{display:inline-flex; align-items:center; gap:7px}
.sitelegend .sw{width:14px; height:14px; border-radius:4px; display:inline-block; border:1px solid rgba(0,0,0,.06)}

/* ---------- Grid ---------- */
.gridwrap{margin:0 22px; overflow-x:auto; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 2px 12px rgba(15,27,51,.06)}
table.grid{border-collapse:separate; border-spacing:0; width:100%; min-width:960px}
table.grid th,table.grid td{border-bottom:1px solid var(--line); border-right:1px solid var(--line); vertical-align:top}
table.grid thead th{background:var(--head); font-size:14px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; padding:11px 8px; text-align:center; color:var(--ink-strong)}
table.grid tr:last-child td{border-bottom:none}
table.grid th:last-child,table.grid td:last-child{border-right:none}
.dayhead small{display:block; color:var(--muted); font-weight:600; font-size:14px; letter-spacing:0; text-transform:none; margin-top:2px}
table.grid th.person,table.grid td.person{
  text-align:left; position:sticky; left:0; z-index:2; min-width:150px; background:#fff; padding:12px 12px;
}
table.grid thead th.person{background:var(--head)}
td.person .nm{font-weight:700; color:var(--ink-strong); font-size:14px}
td.person .nm a{color:var(--ink-strong); text-decoration:none; border-bottom:1px dotted var(--blue)}
td.person .tr{color:var(--muted); font-size:14px; margin-top:1px}

.halfwrap{display:flex; min-height:60px}
.half{
  flex:1; min-width:64px; padding:6px; cursor:pointer; font-size:14px; position:relative;
  border-right:1px dashed var(--line); transition:background .12s;
}
.half:last-child{border-right:none}
.half .ampm{position:absolute; top:4px; right:5px; font-size:14px; font-weight:700; color:var(--hu-slate-edge); letter-spacing:.05em}
.half:not(.filled):hover{background:var(--hu-tint)}
.half:not(.filled)::after{content:"+"; position:absolute; left:8px; top:50%; transform:translateY(-50%); color:var(--hu-faint); font-size:15px; opacity:0; transition:opacity .12s}
.half:not(.filled):hover::after{opacity:1}

/* filled cell = a solid site-coloured chip */
.chip{border-radius:7px; padding:6px 8px; min-height:46px; display:flex; flex-direction:column; gap:1px}
.chip .site{font-weight:700; line-height:1.2; padding-right:14px}
.chip .scope{font-size:14px; opacity:.92; line-height:1.25}
.chip .stat{margin-top:2px; font-size:14px; display:flex; align-items:center; opacity:.95}

/* 8 site colours - palette families (LAWS.md Law 4: colour = site). hype_ui.css (.site-c0 .. .site-c7) maps each class to a family and
   planner.js hashes the site id so a site keeps its colour. Confirmed = strong fill + solid edge + that family's ink. Tentative
   (status Provisional) = light fill + dashed edge + faint stripes, with the word "Provisional" still in the chip. Applies to the AM/PM
   chips, the legend swatches AND the custom-hours slot bubbles. */
.chip[class*="site-c"],.planner-shell .chip[class*="site-c"],.fullday .slot[class*="site-c"]{background:var(--hu-c-fill); color:var(--hu-c-ink); border:1px solid var(--hu-c-edge)}
.chip.is-tentative,.planner-shell .chip.is-tentative,.fullday .slot.is-tentative{background:var(--hu-c-fill-light) repeating-linear-gradient(135deg,transparent 0 6px,var(--hu-c-fill) 6px 8px);
  border-style:dashed; box-shadow:none}
.sw[class*="site-c"]{background:var(--hu-c-fill); border:1px solid var(--hu-c-edge)}
.chip .stat .dot{width:8px;height:8px}
.half.clash .chip{box-shadow:0 0 0 2px var(--red); }

/* ---- custom-hours merged day cell ---- */
.customtd{padding:0}
.fullday{position:relative; min-height:60px; padding:16px 5px 5px; display:flex; flex-direction:column; gap:4px;
  background:var(--hu-tint); border:1px solid var(--hu-blue-fill); border-radius:8px}
.fullday .ampm.fd{position:absolute; top:4px; right:6px; font-size:14px; font-weight:700;
  color:var(--hu-slate-edge); letter-spacing:.05em; text-transform:uppercase}
.fullday .slot{border-radius:7px; padding:5px 8px; background:#fff; border:1px solid var(--hu-blue-fill);
  display:flex; flex-direction:column; gap:1px; cursor:pointer; box-shadow:0 1px 2px rgba(15,27,51,.05)}
.fullday .slot .stime{font-size:14px; font-weight:800; color:var(--ink-strong); letter-spacing:.01em}
.fullday .slot .site{font-size:14px; font-weight:700; line-height:1.2}
.fullday .slot .stat{margin-top:1px; font-size:14px; display:flex; align-items:center; gap:4px; opacity:.95}
.fullday .slot .stat .dot{width:8px; height:8px}
.fullday .slot.clash{box-shadow:0 0 0 2px var(--red)}
.fullday .slot.addslot{align-items:center; justify-content:center; color:var(--blue); font-size:14px;
  font-weight:700; background:#eff6ff; border:1px dashed var(--hu-blue-edge); box-shadow:none}
.fullday .slot.addslot:hover{background:var(--hu-blue-fill)}

/* ---- modal custom-time controls ---- */
.field label.check{display:flex; align-items:center; gap:8px; text-transform:none; letter-spacing:0;
  font-size:14px; font-weight:600; color:var(--ink); margin:0; cursor:pointer}
.field label.check input{width:auto; margin:0}
.timerow .timecols{display:flex; gap:10px}
.timerow .timecols label{flex:1}
.timerow .hint{margin-top:7px; font-size:14px; color:var(--muted); text-transform:none; letter-spacing:0; font-weight:500}

/* Block-booking date range (editor modal) */
.rangebox{border:1px solid var(--line2); border-radius:10px; padding:12px; margin:-4px 0 12px; background:#f7f9fc}
.rangebox .rangecols{display:flex; gap:10px}
.rangebox .rangecols label{flex:1}
.rangebox .rangehalf{margin-top:10px}
.rangebox .rangelabel{display:block; font-size:14px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); margin-bottom:5px}
.rangebox label.check{margin-top:10px}
.rangebox .hint{margin-top:7px; font-size:14px; color:var(--muted); text-transform:none; letter-spacing:0; font-weight:500}

.no-tg{display:inline-block; color:var(--hu-amber-ink); background:var(--hu-amber-fill); border:1px solid var(--hu-amber-edge); border-radius:4px; padding:1px 6px; font-size:14px; font-weight:600; white-space:nowrap; margin-top:3px}

/* ---------- Modal + form fields: .modal-bg / .modal / .field / .modal-actions live in hype_ui.css ---------- */

/* AM/PM segmented control (schedule-a-job modal) */
.halfseg{display:flex; gap:8px}
.halfseg .btn{flex:1}

/* Schedule button on each Open-jobs row */
.jobsched{flex:0 0 auto}

/* Open-jobs rows are tappable (open the job-detail modal) */
.jobrow{cursor:pointer}
.jobrow:hover{background:rgba(59,130,246,.05)}

/* Awaiting-approval + Questions cards (coloured left edge so they stand out) */
.approvecard{border-left:5px solid var(--hu-amber-edge)}
.questioncard{border-left:5px solid var(--blue)}
/* small action buttons used inside the approval/question rows */
.jact{flex:0 0 auto}
/* a question row */
.qrow{padding:9px 0; border-top:1px solid var(--light-border)}
.qrow .qmeta{font-size:14px; color:var(--muted2); margin-bottom:2px}
.qrow .qtext{font-size:14px; color:var(--hero-navy); font-weight:600}
.qrow .qfoot{display:flex; align-items:center; gap:8px; margin-top:6px}

/* Job-detail modal */
.modal.jobdetail{width:min(480px,94vw)}
.jobphoto{margin:0 0 14px; border-radius:10px; overflow:hidden; background:var(--hu-navy); max-height:300px; display:flex; align-items:center; justify-content:center}
.jobphoto img{width:100%; height:auto; max-height:300px; object-fit:contain; display:block}
.jobrowdetail{display:flex; gap:10px; padding:9px 0; border-top:1px solid var(--line2); font-size:14px}
.jobrowdetail .k{flex:0 0 90px; color:var(--muted); font-weight:700; font-size:14px; letter-spacing:.04em; text-transform:uppercase; padding-top:2px}
.jobrowdetail .v{flex:1 1 auto; color:var(--ink); font-weight:600}
.jobrowdetail.sentback .v{color:#92400e}

/* ---------- Invite-new-starter modal (Build 3.3) ---------- */
/* bordered result sub-panel + navy section labels */
.invite-result{margin-top:6px; padding:16px; border:1px solid var(--light-border);
  border-radius:12px; background:#f7f9fc}
.invite-result .lbl{font-size:14px; font-weight:800; letter-spacing:.06em; text-transform:uppercase;
  color:var(--hero-navy); margin-bottom:6px}
.invite-link-row{display:flex; gap:8px; align-items:center}
.invite-link-row input{flex:1; min-width:0; padding:10px 11px; border:1px solid var(--line2);
  border-radius:9px; font-size:14px; color:var(--ink); background:#fff}
.invite-link-row .btn{flex:none}
.invite-instruction{margin-top:10px; font-size:14px; color:var(--ink); line-height:1.5}
.invite-actions{margin-top:12px}
.invite-actions .btn{width:100%}
.invite-note{margin-top:12px; font-size:14px; color:var(--muted2); line-height:1.5}

/* ---------- Toast: .toast / .ok / .err / .warn live in hype_ui.css ---------- */

/* ---------- Tables for manage-team ---------- */
.panel{margin:18px 22px; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:0 2px 12px rgba(15,27,51,.06); overflow:hidden}
.panel h2{margin:0; font-size:14px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--ink-strong); padding:14px 18px; border-bottom:1px solid var(--line); background:var(--head)}
.panel .inner{padding:16px 18px}
/* table.list lives in hype_ui.css (same rules as .hu-table) */
.badge{display:inline-block; font-size:14px; font-weight:700; padding:3px 9px; border-radius:20px}
.badge.telegram{background:var(--hu-blue-fill); color:#1e40af} .badge.manual{background:var(--hu-head); color:var(--hu-slate-ink)}
.tgmark.yes{color:var(--hu-green-ink); font-weight:700} .tgmark{color:var(--hu-faint)}
.addrow{display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end}
.addrow .field{margin:0; flex:1; min-width:130px}

/* ---------- Lad / mgmt mobile views ---------- */
.day{margin:0 16px 14px; background:#fff; border:1px solid var(--line); border-radius:14px; overflow:hidden; box-shadow:0 2px 10px rgba(15,27,51,.05)}
.day h2{margin:0; padding:13px 16px; background:var(--head); font-size:18px; color:var(--ink-strong); border-bottom:1px solid var(--line)}
.day .line{padding:13px 16px; font-size:17px; border-bottom:1px solid var(--line)}
.day .line:last-child{border-bottom:none}
.day .line .site{font-weight:700; color:var(--ink-strong)}
.day .line .scope{color:var(--muted); display:block; margin-top:2px; font-size:15px}
.day .line.am{border-left:4px solid var(--blue)} .day .line.pm{border-left:4px solid var(--holiday)}
.loading{padding:34px; text-align:center; color:var(--muted)}

/* ============================================================= *
 *  FULL-WIDTH DASHBOARD LAYOUT  (planner page only)             *
 *  Scoped to .planner-shell / .page so the Telegram Mini Apps   *
 *  (/myweek, /mgmt) + /manage-team are untouched.               *
 *  Tweak sizes/colours via the :root vars above.                *
 * ============================================================= */
body.planner-shell{background:var(--page-bg)}
.page{max-width:var(--page-max); margin:0 auto; padding:26px 32px 40px;
  display:flex; flex-direction:column; gap:18px}

/* The page banner and the buttons are NOT styled here: one banner and one button system live in hype_ui.css (Law 4, r2 #53). */

/* ---------- Legend card ---------- */
.legendcard{
  display:flex; flex-direction:column; align-items:stretch; gap:10px;
  background:#fff; border:1px solid var(--light-border); border-radius:14px;
  box-shadow:0 4px 16px rgba(15,27,51,.06); padding:14px 22px;
}
/* two rows: Projects on top (full width — they grow), Status below */
.legendcard .legendrow{display:flex; flex-wrap:wrap; align-items:center; gap:10px 26px}
.legendcard .legendrow.statusrow{border-top:1px solid var(--light-border); padding-top:10px}
.legendcard .group{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.legendcard .grouplabel{font-size:14px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color:var(--muted2)}
.legendcard .legend{display:flex; gap:8px; flex-wrap:wrap; padding:0}
.legendcard .sitelegend{display:flex; gap:8px; flex-wrap:wrap; padding:0}
.legendcard .tradelegend{display:flex; gap:8px; flex-wrap:wrap; padding:0}
.legendcard .legendrow.traderow{border-top:1px solid var(--light-border); padding-top:10px}
/* trade icons (#32): one set, drawn in currentColor = the ink of the family they sit in (site ink in a cell, slate ink in the key) */
.tradeicon{width:16px; height:16px; flex:none; vertical-align:-3px; margin-right:4px}
.chip .site .tradeicon,.fullday .slot .site .tradeicon{color:var(--hu-c-ink)}
td.person .tr .tradeicon{color:var(--hu-slate-ink)}
.legendcard .tradelegend .item .tradeicon{color:var(--hu-slate-ink); margin-right:0}
.legendcard .legend > span,
.legendcard .sitelegend .item,
.legendcard .tradelegend .item{
  display:inline-flex; align-items:center; gap:7px;
  background:#fff; border:1px solid var(--light-border); border-radius:999px;
  padding:7px 13px; font-size:14px; color:var(--ink);
  box-shadow:0 1px 2px rgba(15,27,51,.05);
}
.legendcard .helper{margin-left:auto; color:var(--muted2); font-size:14px}
/* 🔑 keysafe code shown on each Projects-legend pill (Keysafe feature) */
.legendcard .sitelegend .item .keycode{
  display:inline-flex; align-items:center; gap:3px; margin-left:7px; padding:1px 7px;
  background:var(--hu-page); border:1px solid var(--light-border); border-radius:999px;
  font-weight:700; font-size:14px; color:var(--hero-navy); letter-spacing:.02em;
}

/* ---------- Planner board (the hero) ---------- */
.boardcard{
  background:#fff; border:1px solid var(--light-border); border-radius:16px;
  box-shadow:0 12px 36px rgba(15,27,51,.10); padding:10px; overflow:hidden;
}
.boardcard .gridwrap{border:0; border-radius:12px; box-shadow:none; margin:0; overflow-x:auto}

/* full-width, equal-flex day columns */
.planner-shell table.grid{width:100%; min-width:1120px; table-layout:fixed}
.planner-shell table.grid th.person,
.planner-shell table.grid td.person{width:var(--person-col); min-width:var(--person-col)}

/* calendar header row — stands out */
.planner-shell table.grid thead th{
  height:var(--head-h); background:var(--head-grey); color:var(--hero-navy);
  font-size:14px; font-weight:800; letter-spacing:.03em;
  border-bottom:2px solid var(--row-divider); border-right-color:var(--row-divider);
}
.planner-shell table.grid thead th.person{background:var(--head-grey); color:var(--hero-navy)}
.planner-shell .dayhead small{font-size:14px; color:var(--muted2); font-weight:600; margin-top:3px}

/* person rows — clear separation + subtle alternating shade */
.planner-shell table.grid tbody td{
  border-bottom:1px solid var(--row-divider); border-right-color:var(--hu-slate-fill);
}
.planner-shell table.grid tbody tr:nth-child(even) td{background:#f7f9fc}
.planner-shell td.person{background:var(--hu-page); vertical-align:middle; padding:16px 18px}
.planner-shell td.person .nm{font-size:16px}
.planner-shell td.person .tr{font-size:14px; margin-top:2px}

/* taller rows + AM(white)/PM(pale) shading */
.planner-shell .halfwrap{min-height:var(--row-h)}
.planner-shell .half{padding:8px; border-right:1px dotted var(--hu-border)}
.planner-shell .half:last-child{border-right:none; background:var(--hu-tint)}
.planner-shell tbody tr:nth-child(even) .half:last-child{background:var(--hu-page)}
.planner-shell .half:not(.filled):hover{background:#eff6ff}
.planner-shell .half:last-child:not(.filled):hover{background:var(--hu-blue-fill)}
.planner-shell .half .ampm{font-size:14px; font-weight:800; color:#64748b}

/* booking cards — bigger + more polished */
.planner-shell .chip{
  border-radius:11px; padding:9px 11px; min-height:62px; gap:2px;
  border:1px solid var(--hu-border);
  box-shadow:0 2px 7px rgba(15,27,51,.16);
}
.planner-shell .chip .site{font-size:14px}
.planner-shell .chip .scope{font-size:14px}
.planner-shell .chip .stat{font-size:14px; margin-top:3px}

/* status-only chips (Off / Sick / Holiday — no site) */
.planner-shell .chip.statusonly{box-shadow:none}
.planner-shell .chip.statusonly .site{display:flex; align-items:center; gap:6px; font-weight:700}
.planner-shell .chip.stat-Off{background:var(--hu-slate-fill); color:var(--hu-slate-ink); border-color:var(--hu-border)}
.planner-shell .chip.stat-Sick{background:var(--hu-red-fill); color:var(--hu-red-ink); border-color:var(--hu-red-fill)}
.planner-shell .chip.stat-Holiday{background:var(--hu-violet-fill); color:var(--hu-violet-ink); border-color:var(--hu-violet-fill)}
.planner-shell .chip.stat-Unavailable{background:var(--hu-slate-fill); color:var(--hu-slate-ink); border-color:var(--hu-divider)}

/* ---------- Person name tablets (left column) ---------- */
.planner-shell td.person .nm{display:inline-block; padding:4px 10px; border-radius:8px; font-weight:700; font-size:15px; line-height:1.25; background:transparent; color:var(--hu-slate-ink)}
.planner-shell td.person .nm a{color:inherit; text-decoration:none; border-bottom:1px dotted currentColor}
/* r2 #13: no colour on a name - colour on the planner means the site only (Law 4) */

/* ---------- Actions / Notify column ---------- */
.planner-shell table.grid th.acthead,
.planner-shell table.grid td.actcell,
.planner-shell table.grid td.actfoot{width:var(--act-col); min-width:var(--act-col)}
.planner-shell table.grid thead th.acthead{text-align:left}
.planner-shell td.actcell{vertical-align:middle; padding:12px 14px; white-space:normal; text-align:left}

/* status chip */
.nchip{display:inline-block; margin-top:7px; font-size:14px; font-weight:600; line-height:1.3; border-radius:7px; padding:3px 8px; max-width:100%}
.nchip.none{background:var(--hu-slate-fill); color:var(--hu-slate-edge)}
.nchip.sent{background:var(--hu-blue-fill); color:var(--hu-blue-ink)}
.nchip.opened{background:var(--hu-green-fill); color:var(--hu-green-ink)}
.nchip.changed{background:var(--hu-orange-fill); color:var(--hu-orange-ink)}
.nchip.off{background:var(--hu-amber-fill); color:var(--hu-amber-ink)}
/* plain-English explainer line under the "Opened" chip (Build 3.2) */
.nchip .nchip-sub{display:block; font-weight:500; opacity:.85; margin-top:1px}
/* "Last sent: …" line under the notify chip (Build 4 tweak 2) */
.nchip-lastsent{display:block; margin-top:3px; font-size:14px; font-weight:500; color:var(--muted2); line-height:1.3}

/* footer row: manual note + send-all */
.planner-shell tfoot td{background:#f8fafc; border-top:2px solid var(--row-divider); padding:14px 16px}
.planner-shell tfoot .footnote{font-size:14px; color:var(--muted2); line-height:1.4}
.planner-shell tfoot .actfoot{vertical-align:middle}
.planner-shell tfoot .actfoot .btn{width:100%}

/* ---------- Month overview ---------- */
#monthView{padding:6px 4px}
.monthgrid{display:flex; flex-direction:column; gap:7px}
.monthgrid .mhead{display:grid; grid-template-columns:repeat(7,1fr); gap:7px; background:none; border:0; box-shadow:none; padding:0; margin:0}
.monthgrid .mhead>div{text-align:center; font-size:14px; font-weight:800; color:var(--hero-navy); text-transform:uppercase; letter-spacing:.03em; padding:4px 0}
.mrow{display:grid; grid-template-columns:repeat(7,1fr); gap:7px}
.mcell{min-height:116px; border:1px solid var(--light-border); border-radius:10px; background:#fff; padding:7px; cursor:pointer; overflow:hidden; transition:box-shadow .12s, border-color .12s}
.mcell:hover{box-shadow:0 5px 16px rgba(15,27,51,.12); border-color:var(--hero-accent)}
.mcell.out{background:var(--hu-tint)}
.mnum{font-size:14px; font-weight:800; color:var(--hero-navy); margin-bottom:5px}
.mcell.out .mnum{color:var(--hu-slate-edge)}
.mitem{font-size:14px; line-height:1.3; border-radius:5px; padding:2px 6px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--hu-slate-ink); background:var(--hu-page)}
.mitem .hd{opacity:.65; font-size:14px; font-weight:700}
.mitem.site-c0{background:var(--hu-blue-fill)} .mitem.site-c1{background:var(--hu-green-fill)} .mitem.site-c2{background:var(--hu-orange-fill)}
.mitem.site-c3{background:var(--hu-violet-fill)} .mitem.site-c4{background:var(--hu-teal-fill)} .mitem.site-c5{background:var(--hu-pink-fill)}
.mitem.site-c6{background:var(--hu-indigo-fill)} .mitem.site-c7{background:var(--hu-slate-fill)}
.mmore{font-size:14px; color:var(--muted2); font-weight:600}

/* ============================================================= *
 *  TELEGRAM MINI APP  (My Week / mgmt) — dashboard-styled,        *
 *  accessibility-first (big text + touch targets, high contrast). *
 *  Scoped to body.miniapp so it never affects the planner pages.  *
 * ============================================================= */
body.miniapp{background:var(--page-bg)}
.miniapp .mwrap{max-width:600px; margin:0 auto; padding:12px 12px 30px}
.miniapp .mhead{position:relative; overflow:hidden; background:#fff; border:1px solid var(--light-border);
  border-radius:16px; box-shadow:0 6px 20px rgba(15,27,51,.08); padding:15px 16px 15px 18px; margin-bottom:12px}
.miniapp .mhead::before{content:""; position:absolute; left:0; top:0; bottom:0; width:6px;
  background:linear-gradient(180deg,var(--hero-blue),var(--hero-accent))}
.miniapp .mhead .top{display:flex; align-items:center; gap:13px}
.miniapp .mhead img{height:42px; width:auto; display:block}
.miniapp .mhead .top{flex-wrap:nowrap}
.miniapp .mhead img{flex:none}
.miniapp .mhead .titles{min-width:0}
.miniapp .mhead .pretitle{font-size:14px; font-weight:700; letter-spacing:.2em; text-transform:uppercase; color:var(--hero-blue)}
.miniapp .mhead h1{margin:1px 0 0; font-size:23px; font-weight:800; color:var(--hero-navy); text-transform:none; white-space:nowrap}
.miniapp .wknav{display:flex; align-items:center; gap:8px; margin-top:13px}
.miniapp .wknav .weekrange{flex:1 1 auto; min-width:0; text-align:center; font-size:17px; font-weight:700; color:var(--hero-navy);
  background:var(--page-bg); border:1px solid var(--light-border); border-radius:12px; padding:13px 6px; text-transform:none; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.miniapp .wknav .btn.arrow{flex:none; font-size:18px; font-weight:700; padding:12px 16px; background:var(--hero-blue);
  border-color:var(--hero-blue); color:#fff; box-shadow:0 2px 8px rgba(59,130,246,.32)}

.miniapp .day{background:#fff; border:1px solid var(--light-border); border-radius:14px;
  box-shadow:0 3px 12px rgba(15,27,51,.06); overflow:hidden; margin-bottom:12px}
.miniapp .day h2{margin:0; padding:13px 16px; background:var(--head-grey); color:var(--hero-navy);
  font-size:17px; font-weight:800; border-bottom:1px solid var(--light-border)}
.miniapp .day .line{padding:14px 16px; border-bottom:1px solid var(--light-border); font-size:16px; color:var(--ink)}
.miniapp .day .line:last-child{border-bottom:none}
.miniapp .day .line .ampm{display:inline-block; min-width:44px; text-align:center; font-size:14px; font-weight:800;
  padding:4px 8px; border-radius:7px; margin-right:9px; vertical-align:middle; white-space:nowrap}
.miniapp .day .line.am .ampm{background:var(--hu-blue-fill); color:#1e40af}
.miniapp .day .line.pm .ampm{background:var(--hu-violet-fill); color:#5b21b6}
.miniapp .day .line .site{font-weight:700; color:var(--hero-navy)}
/* 🔑 keysafe code next to a booked site on My Week (big + tappable-readable) */
.miniapp .day .line .keycode{display:inline-block; margin-left:8px; padding:2px 10px; border-radius:999px;
  background:var(--hu-page); border:1px solid var(--light-border); font-weight:800; font-size:15px;
  color:var(--hero-navy); white-space:nowrap; letter-spacing:.02em}
.miniapp .day .line .scope{display:block; color:var(--muted2); margin-top:5px; font-size:15px; padding-left:53px; line-height:1.4}
.miniapp .day .line .spill{display:inline-block; font-size:14px; font-weight:700; padding:2px 9px; border-radius:999px; margin-left:8px}
.miniapp .day .line .spill.Off{background:var(--hu-page); color:var(--hu-slate-ink)}
.miniapp .day .line .spill.Sick{background:var(--hu-red-fill); color:var(--hu-red-ink)}
.miniapp .day .line .spill.Holiday{background:var(--hu-violet-fill); color:var(--hu-violet-ink)}
.miniapp .day .line .spill.Provisional{background:#fef3c7; color:#92400e}
.miniapp .day .line .spill.Unavailable{background:var(--hu-head); color:var(--hu-slate-ink)}
/* completed ad-hoc job line (its own invoice line) — green accent */
.miniapp .day .line.completed{border-left:4px solid var(--hu-green-ink)}
.miniapp .day .line.completed .ampm{background:var(--hu-green-fill); color:var(--hu-green-ink); min-width:54px}
.miniapp .day .line .spill.completedtag{background:var(--hu-green-fill); color:var(--hu-green-ink)}
.miniapp .day .empty{padding:14px 16px; color:var(--hu-slate-edge); font-size:15px}
.miniapp .loading{padding:34px; text-align:center; color:var(--muted2)}
/* invoice helper: per-day copy buttons (one line per day on the lad's invoice) */
.miniapp .day h2{display:flex; align-items:center; justify-content:space-between; gap:10px}
.miniapp .day-copy{flex:0 0 auto; border:1px solid var(--hero-blue); background:#fff; color:var(--hero-blue);
  font-size:14px; font-weight:800; padding:6px 13px; border-radius:999px; cursor:pointer; white-space:nowrap;
  line-height:1.2; -webkit-tap-highlight-color:transparent}
.miniapp .day-copy:active{background:var(--hu-blue-fill)}
.miniapp .day-copy.done{background:var(--hu-green-fill); border-color:var(--hu-green-ink); color:var(--hu-green-ink)}
/* "Copy all week" in the footer — full-width, filled, more prominent than per-day. */
.miniapp .day-copy.week{display:block; width:100%; margin:2px 2px 4px; padding:11px; background:var(--hero-blue);
  color:#fff; border-color:var(--hero-blue)}
.miniapp .day-copy.week:active{background:#1e40af}
.miniapp .day-copy.week.done{background:var(--hu-green-fill); border-color:var(--hu-green-ink); color:var(--hu-green-ink)}
.miniapp .invoice-foot{margin:16px 2px 10px}
.miniapp .inv-note{margin:0 2px 8px; font-size:14px; color:var(--ink); line-height:1.5; background:#f7f9fc;
  border:1px solid var(--light-border); border-radius:11px; padding:11px 13px}
.miniapp .inv-note strong{color:var(--hero-navy)}
.miniapp .inv-hint{margin:9px 4px 0; font-size:14px; color:var(--muted2); line-height:1.45}
.miniapp .inv-text{width:100%; min-height:96px; margin-top:11px; padding:12px; border:1px solid var(--line2);
  border-radius:11px; font-size:14px; font-family:ui-monospace,Menlo,Consolas,monospace; color:var(--ink);
  background:#fff; white-space:pre; line-height:1.5; -webkit-user-select:text; user-select:text}
.miniapp .crumb{font-size:16px; color:var(--hero-blue); cursor:pointer; margin:2px 4px 10px; display:none; font-weight:600}
.miniapp .crumb.show{display:inline-block}

/* mgmt overview: "who's where" grouped by site */
.miniapp .site-group{background:#fff; border:1px solid var(--light-border); border-radius:14px;
  box-shadow:0 3px 12px rgba(15,27,51,.06); overflow:hidden; margin-bottom:12px}
.miniapp .site-group h2{margin:0; padding:13px 16px; background:var(--head-grey); color:var(--hero-navy);
  font-size:17px; font-weight:800; border-bottom:1px solid var(--light-border)}
.miniapp .person-row{display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:14px 16px; border-bottom:1px solid var(--light-border); font-size:16px; cursor:pointer}
.miniapp .person-row:last-child{border-bottom:none}
.miniapp .person-row:hover{background:var(--hu-tint)}
.miniapp .person-row>span:first-child{font-weight:700; color:var(--hero-navy)}
.miniapp .person-row .ampm{background:var(--hu-page); color:var(--hu-slate-ink); font-size:14px; font-weight:700; padding:4px 11px; border-radius:999px; white-space:nowrap}

/* mgmt: manage site managers panel */
.miniapp .mgrhint{padding:0 16px 12px; color:var(--muted2); font-size:14px; line-height:1.45}
.miniapp .mgr-lock{color:var(--muted2); font-size:14px; font-weight:700; white-space:nowrap}
.miniapp .mgr-rm{flex:none; font-size:14px; font-weight:700; padding:8px 14px; border-radius:9px;
  background:#fff; border:1px solid var(--hu-red-edge); color:var(--sick)}
.miniapp .mgr-add{display:flex; gap:8px; padding:14px 16px; border-top:1px solid var(--light-border)}
.miniapp .mgr-add select{flex:1 1 auto; min-width:0; padding:13px 11px; border:1px solid var(--light-border);
  border-radius:12px; font-size:16px; color:var(--ink); background:var(--page-bg)}
.miniapp .mgr-add .btn{flex:none; font-size:16px; font-weight:700; padding:13px 18px; background:var(--hero-blue);
  border-color:var(--hero-blue); color:#fff}

/* ---------- Responsive ---------- */
@media (max-width:980px){
  .page{padding:16px 14px 30px; gap:14px}
  .legendcard .helper{margin-left:0; flex-basis:100%}
  .mcell{min-height:84px}
}

/* ---------- Planner basics (r2 #33): filters, Copy last week pop-up ---------- */
.filterbar{display:flex; flex-wrap:wrap; align-items:center; gap:10px 16px; background:var(--hu-white); border:1px solid var(--hu-divider);
  border-radius:var(--hu-radius-card); padding:10px 16px; margin-bottom:14px}
.filterbar .fb-field{display:flex; align-items:center; gap:8px; font-size:14px; color:var(--hu-text)}
.filterbar select{padding:7px 10px; border:1px solid var(--hu-border); border-radius:var(--hu-radius-input); font-size:14px; background:var(--hu-white); color:var(--hu-text)}
.filterbar .helper{margin-left:auto; color:var(--muted2); font-size:14px}
.filterbar.is-on{border-color:var(--hu-action)}
.copymodal{max-width:640px; width:100%}
.copylist{max-height:46vh; overflow:auto; margin:10px 0; border:1px solid var(--hu-border); border-radius:var(--hu-radius-input)}
.copylist table{border-collapse:collapse; width:100%}
.copylist th,.copylist td{padding:7px 10px; text-align:left; font-size:14px; border-bottom:1px solid var(--hu-border)}
.copylist th{background:var(--hu-head); color:var(--hu-blue-ink)}
.copylist tr.tent td{background:var(--hu-slate-fill-light)}
.copylist h4{margin:10px 10px 4px; font-size:14px; color:var(--hu-heading)}
.toast .btn{margin-left:12px}
@media (max-width:760px){ .filterbar .helper{margin-left:0; flex-basis:100%} }

/* Long names and notes never stretch a booking card (r2 #20 defect 7): the site name keeps whole words and stops at two lines,
   the note stops at three, and the full text is in the card's tooltip. */
.planner-shell .chip{min-width:0; overflow:hidden}
.planner-shell .chip .site,.planner-shell .chip .scope{min-width:0; overflow-wrap:break-word; word-break:normal; hyphens:none;
  display:-webkit-box; -webkit-box-orient:vertical; overflow:hidden}
.planner-shell .chip .site{-webkit-line-clamp:2; line-clamp:2}
.planner-shell .chip .scope{-webkit-line-clamp:3; line-clamp:3}

/* Planner booking cards wide enough to read (r2 #20 defect 7 + N4): each AM / PM half is at least 96px, the AM / PM word sits in its own strip
   above the card (no overlap with the card's corner), and a trade word is never broken in the middle (a long one is cut with the full text in the tooltip).
   The grid scrolls sideways inside its card when the week is wider than the screen; the Person column stays put. */
.planner-shell table.grid{min-width:1700px}
.planner-shell .half{min-width:96px; padding:22px 4px 4px}
.planner-shell .chip{padding:6px 6px}
.planner-shell .chip .site{padding-right:0}
.planner-shell .chip .site,.planner-shell .chip .scope{overflow-wrap:normal; word-break:normal; hyphens:none}
.planner-shell .chip .stat{white-space:normal; flex-wrap:wrap; overflow:visible}
/* r14 #7: a chip says its whole status ("Pencilled in", "Unavailable") and a longer site name or note gets more lines before any cut */
/* r17: each chip stays inside its own half-day. The r16 width forgot the Notify column, so a day cell (185px) was narrower than its
   two 108px halves and each chip slid over the next one. Now the grid is sized from the columns it really has (Person + 7 days +
   Notify), each half is exactly half its day (never wider), Mon-Fri sit whole in a 1440 card and the weekend scrolls inside the card. */
.planner-shell{--day-col:212px}
.planner-shell table.grid{min-width:calc(var(--person-col) + 7 * var(--day-col) + var(--act-col))}
.planner-shell .half{min-width:0; flex:1 1 0; padding:22px 3px 3px}
.planner-shell .chip{padding:6px 5px}
/* words wrap onto the next line whole; only a single word longer than the whole chip line is split, so nothing is cut off the side */
.planner-shell .chip .site,.planner-shell .chip .scope{overflow-wrap:break-word}
.planner-shell .chip .site{-webkit-line-clamp:3; line-clamp:3}
.planner-shell .chip .scope{-webkit-line-clamp:4; line-clamp:4}
.planner-shell .chip.statusonly .site{flex-wrap:wrap}

/* Phone: the filter bar stays inside its card (r2 #20 defect 23) */
@media (max-width:600px){
  .filterbar .fb-field{flex:1 1 100%; min-width:0; max-width:100%}
  .filterbar .fb-field select{flex:1 1 0; width:0; min-width:0; max-width:100%}
}
