/* HMC Resource Booking Portal: styles. The look is the other HMC portals' (the CRM's app.css), as Harry asked on
   6 Nov 2026 ("house style same as prior portals"): Montserrat, HMC teal, the charcoal top bar, rounded buttons, white
   cards on light grey, and each business's colour as in the CRM (HMC teal, INSPEKTA red, RITE4SITE lilac). Light only,
   like the live portals. Began as the Gate 2 prototype's (prototype/index.html).
   Layout: sticky charcoal bar, one centred column of cards; the board is a 3-week grid that scrolls sideways in its own box. */
:root {
  --teal: #02a0b0; --teal-d: #017f8c; --teal-l: #e5f6f7;
  --header: #333333; --header-2: #474747; --ink: #111111; --muted: #5a5f63; --line: #dcdfe1; --bg: #f2f3f4; --card: #ffffff;
  --red: #b3261e; --red-l: #fdeceb; --amber: #8a5300; --amber-l: #fff3df; --green: #1f6b36; --green-l: #e6f4ea;
  --hmc: #02a0b0; --inspekta: #b31800; --rite4site: #c7a0f0; --r4s-ink: #2b1a40; --block: #8a9196;
  --weekend: #f6f7f8; --hatch-a: #e4e7e9; --hatch-b: #f5f6f7; --focus: #0a66b0;
  --r: 10px; --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px -8px rgba(40, 60, 80, .35);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --lab: 172px; --col: 42px; --bar-h: 28px;
  color-scheme: light;
  font-family: var(--font);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--header); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; font-weight: 700; text-wrap: balance; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.12rem; } h3 { font-size: 1rem; }
h1:focus { outline: none; }
p { margin: 0 0 .6em; }
a { color: var(--teal-d); }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
button { font: inherit; cursor: pointer; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons (as the CRM) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  background: var(--teal); color: #fff; border: 1px solid transparent; border-radius: 50px;
  padding: .5em 1.3em; min-height: 42px; font-size: 15px; text-decoration: none; box-shadow: 0 3px 11px rgba(0, 0, 0, .18); white-space: nowrap;
}
.btn:hover { background: var(--header); color: #fff; }
.btn:disabled { background: #c5ccd1; color: #fff; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: var(--card); color: var(--teal-d); border-color: var(--teal); box-shadow: none; }
.btn.ghost:hover { background: var(--teal-l); }
.btn.danger { background: var(--card); color: var(--red); border-color: var(--red); box-shadow: none; }
.btn.danger:hover { background: var(--red-l); }
.btn.solid-danger { background: var(--red); color: #fff; }
.btn.small { min-height: 32px; padding: .25em .9em; font-size: .8rem; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--teal-d); text-decoration: underline; font-weight: 600; }

/* ---------- top bar */
.topbar { background: var(--header); color: #fff; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
.topbar .bar { max-width: 1240px; margin: 0 auto; padding-block: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; flex: none; }
.brand-logo { display: block; height: 28px; width: auto; }
.brand-name { border-left: 1px solid #6b6b6b; padding-left: 12px; font-weight: 600; letter-spacing: .02em; }
.topbar nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.topbar nav a { color: #e9eaeb; text-decoration: none; padding: 7px 11px; border-radius: 50px; font-size: .9rem; white-space: nowrap; }
.topbar nav a:hover { background: var(--header-2); color: #fff; }
.topbar nav a[aria-current=page] { background: var(--teal); color: #fff; }
.topbar nav .n { display: inline-block; min-width: 1.5em; margin-left: 4px; padding: 0 .45em; border-radius: 50px; background: var(--amber-l); color: #5f3a00; font-size: .72rem; font-weight: 700; text-align: center; }
.topbar .me { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: .8rem; color: #d6d8da; flex: none; }
.topbar .me select { font: inherit; font-size: .82rem; color: #fff; background: #4a4a4a; border: 0; border-radius: 50px; padding: 7px 12px; max-width: 230px; }
.menu-btn { display: none; background: none; border: 1px solid #6b6b6b; color: #fff; border-radius: 8px; padding: 5px 10px; }
@media (max-width: 1060px) {
  .topbar .bar { flex-wrap: wrap; }
  .menu-btn { display: block; margin-left: auto; }
  .topbar nav { display: none; width: 100%; flex-direction: column; align-items: stretch; }
  .topbar.open nav { display: flex; }
  .topbar .me { order: 5; margin-left: 0; width: 100%; padding-bottom: 4px; }
  .topbar .me select { flex: 1; max-width: none; }
}
@media (max-width: 420px) { .brand-name { font-size: .82rem; padding-left: 10px; } .brand { gap: 10px; } .brand-logo { height: 24px; } }


/* ---------- the page */
.wrap { max-width: 1240px; margin: 0 auto; padding-block: 20px 110px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-bottom: 16px; }
.pagehead h1 { margin: 0; }
.pagehead .spacer { flex: 1; }
.pagehead .sub { margin: 4px 0 0; color: var(--muted); }
.eyebrow { margin: 0 0 6px; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card > h2:first-child { margin-top: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.card-head .muted { font-size: .85rem; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.alert { border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; background: var(--amber-l); color: #5f3a00; }
.alert.err { background: var(--red-l); color: var(--red); }
.alert.ok { background: var(--green-l); color: var(--green); }
.alert .linkbtn { color: inherit; }
.pill { display: inline-block; border-radius: 50px; padding: .1em .65em; font-size: .74rem; font-weight: 600; background: #eceff1; color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--green-l); color: var(--green); }
.pill.warn { background: var(--amber-l); color: var(--amber); }
.pill.bad { background: var(--red-l); color: var(--red); }
.pill.lead { background: #e8f0fe; color: #1a4fa0; }
.pill.tent { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.pill.conf { background: var(--ink); color: #fff; }
.pill.cancel { background: #eceff1; color: var(--muted); text-decoration: line-through; }
.tbd { display: inline-block; border: 1px dashed #b98a3a; color: var(--amber); background: var(--amber-l); border-radius: 50px; padding: 0 .6em; font-size: .7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; vertical-align: 1px; white-space: nowrap; }
.biz { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; text-transform: none; color: var(--ink); }
.biz::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--block)); flex: none; }
.biz-hmc { --dot: var(--hmc); } .biz-inspekta { --dot: var(--inspekta); } .biz-rite4site { --dot: var(--rite4site); } .biz-masked { --dot: var(--block); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--header); color: #fff; padding: 10px 18px; border-radius: 16px; z-index: 100; box-shadow: var(--shadow); width: max-content; max-width: min(560px, calc(100vw - 32px)); font-size: .9rem; }

/* ---------- forms (as the CRM) */
.field { display: block; margin-bottom: 12px; min-width: 0; }
.field > span, .field > legend { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 4px; padding: 0; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card); padding: .5em .7em; min-height: 42px; border: 1px solid #aeb8bf; border-radius: 8px;
}
.field textarea { min-height: 80px; resize: vertical; }
.field.has-err input, .field.has-err select, .field.has-err textarea { border-color: var(--red); background: var(--red-l); }
fieldset.field { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.req { color: var(--red); font-weight: 700; }
.err { display: block; color: var(--red); font-size: .82rem; margin-top: 3px; font-weight: 600; }
.hint { display: block; color: var(--muted); font-size: .8rem; margin-top: 3px; font-weight: 400; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.dt { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; font-size: .92rem; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--teal); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 0; }
.choices label { position: relative; display: inline-flex; align-items: center; gap: 8px; border: 1px solid #c6cdd2; background: var(--card); border-radius: 50px; padding: .4em .95em; min-height: 40px; cursor: pointer; font-size: .92rem; }
.choices label:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.choices input, .field .choices input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }
.choices label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.has-err .choices label { border-color: var(--red); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.note-r4s { background: #f4ecfd; color: var(--r4s-ink); border-radius: 8px; padding: 9px 12px; font-size: .86rem; margin-bottom: 12px; }

/* ---------- pickers: what is free for the dates entered */
.picks { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pick { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 9px 12px; border-top: 1px solid var(--line); }
.pick:first-child { border-top: 0; }
.pick.on { background: var(--teal-l); }
.pick input[type=checkbox] { width: 20px; height: 20px; margin: 0; accent-color: var(--teal); }
.pick-body { display: grid; gap: 1px; cursor: pointer; min-width: 0; }
.pick-name { font-weight: 600; }
.pick-sub { font-size: .8rem; color: var(--muted); }
.pick-sub .nl { color: var(--amber); font-style: normal; font-weight: 600; }
.pick select { grid-column: 2 / 4; justify-self: start; font: inherit; font-size: .85rem; padding: 4px 8px; border-radius: 6px; border: 1px solid #aeb8bf; background: var(--card); color: var(--ink); }
.pick .pill { justify-self: end; white-space: normal; text-align: right; }
.pick-empty { padding: 12px; color: var(--muted); font-size: .9rem; }
.cons-row { display: grid; grid-template-columns: minmax(0, 1fr) 88px auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.cons-row input { font: inherit; padding: .45em .65em; min-height: 40px; border: 1px solid #aeb8bf; border-radius: 8px; width: 100%; background: var(--card); color: var(--ink); }
.files { list-style: none; padding: 0; margin: 6px 0 0; font-size: .85rem; color: var(--muted); }
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px -12px rgba(0, 0, 0, .35); padding-bottom: env(safe-area-inset-bottom, 0px); }
.actionbar .inner { max-width: 1240px; margin: 0 auto; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.actionbar .inner .spacer { flex: 1; }
.actionbar .muted { font-size: .85rem; }

/* ---------- hub */
.ask { font-size: 1.05rem; font-weight: 700; margin: 0 0 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.tile { --c: var(--hmc); display: flex; flex-direction: column; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0; overflow: hidden; box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
.tile:hover { border-color: var(--c); transform: translateY(-2px); }
.tile .plate { height: 96px; display: flex; align-items: center; justify-content: center; padding: 14px 20px; background: var(--card); border-bottom: 4px solid var(--c); }
.tile.hmc .plate { background: var(--header); }
.tile .plate img { max-height: 52px; max-width: 100%; height: auto; width: auto; }
.tile.inspekta { --c: var(--inspekta); } .tile.rite4site { --c: var(--rite4site); }
.tile-body { padding: 12px 16px 16px; display: grid; gap: 4px; }
.tile-body b { font-size: 1.05rem; }
.tile-body .muted { font-size: .86rem; }
.tile-go { color: var(--teal-d); font-weight: 600; font-size: .9rem; margin-top: 4px; }
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.linkcard { display: grid; gap: 2px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.linkcard:hover { border-color: var(--teal); }
.linkcard b { font-size: 1rem; }
.linkcard .muted { font-size: .85rem; }
.linkcard .big { font-size: 1.6rem; font-weight: 700; color: var(--teal-d); line-height: 1.1; font-variant-numeric: tabular-nums; }

/* ---------- lists */
.rows { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.rows > li { border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 11px 14px; text-align: left; width: 100%; background: none; border: 0; color: inherit; }
button.row:hover { background: #f7fafa; }
.row .main { flex: 1 1 260px; min-width: 0; display: grid; gap: 2px; }
.row .main .muted { font-size: .84rem; }
.row .side { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: flex-end; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px; }
.empty { background: var(--card); border: 1px dashed #c6cdd2; border-radius: var(--r); padding: 18px; text-align: center; color: var(--muted); }

/* ---------- review */
.issues { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.issue { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: var(--r); }
.issue.bad { background: var(--red-l); }
.issue.warn { background: var(--amber-l); }
.issue p { margin: 0 0 4px; }
.issue .ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .9rem; }
.issue.bad .ico { background: var(--red); }
.issue.warn .ico { background: var(--amber); }
.issue .field { margin: 8px 0 0; }
.alts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: .85rem; }
.allclear { background: var(--green-l); color: var(--green); border-radius: var(--r); padding: 12px 14px; font-weight: 600; }
.checks-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.checks-head h2 { margin: 0 6px 0 0; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: .9rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.goes { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }

/* ---------- done: what the live portal would send */
.preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.trello { background: #f1f2f4; border-radius: 12px; padding: 12px; }
.trello-board { font-size: .78rem; font-weight: 700; color: var(--muted); margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; letter-spacing: .03em; text-transform: uppercase; }
.tcard { background: var(--card); border-radius: 8px; box-shadow: 0 1px 1px rgba(9, 30, 66, .25); padding: 10px 12px; }
.tlabels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tlabel { border-radius: 4px; padding: 1px 8px; font-size: .72rem; font-weight: 700; color: #fff; background: var(--block); }
.tlabel.tentative { background: #b07a00; } .tlabel.cancelled { background: var(--red); } .tlabel.harry { background: var(--teal-d); }
.ttitle { font-weight: 600; margin: 0 0 6px; overflow-wrap: anywhere; }
.tmeta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .78rem; color: var(--muted); margin-bottom: 8px; }
.tmembers { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--header); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.tdesc { white-space: pre-wrap; font-size: .8rem; line-height: 1.5; background: #f7f8f9; border-radius: 6px; padding: 8px 10px; margin: 0; overflow-wrap: anywhere; max-height: 340px; overflow: auto; }
.tnote { font-size: .8rem; color: var(--muted); margin: 8px 0 0; }
.mail { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.mail-head { background: #f7f8f9; padding: 8px 12px; font-size: .8rem; color: var(--muted); display: grid; gap: 2px; }
.mail-head b { color: var(--ink); }
.mail-body { padding: 10px 12px; font-size: .86rem; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- availability board */
.boardbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.boardbar .range { font-weight: 700; }
.seg { display: inline-flex; border: 1px solid var(--teal); border-radius: 50px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 6px 14px; min-height: 36px; color: var(--teal-d); font-size: .86rem; font-weight: 600; }
.seg button + button { border-left: 1px solid var(--teal); }
.seg button[aria-pressed=true] { background: var(--teal); color: #fff; }
.seg button:hover:not([aria-pressed=true]) { background: var(--teal-l); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; box-shadow: var(--shadow); }
.stat .k { font-size: .76rem; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 1.5rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.stat .s { font-size: .76rem; color: var(--muted); }
.stat.alertish .v { color: var(--amber); }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr 1fr; } .stat:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--muted); margin-bottom: 10px; align-items: center; }
.legend .sw { display: inline-block; width: 26px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
.sw.conf { background: var(--hmc); } .sw.tent { background: var(--card); box-shadow: inset 0 0 0 2px var(--hmc); }
.sw.bo { background: repeating-linear-gradient(135deg, var(--hatch-a) 0 4px, var(--hatch-b) 4px 8px); box-shadow: inset 0 0 0 1px #c5ccd1; }
.sw.mask { background: #d9dcdf; }
.tl { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.tl-in { min-width: calc(var(--lab) + 21 * var(--col)); }
.tl-row { display: grid; grid-template-columns: var(--lab) minmax(0, 1fr); border-top: 1px solid var(--line); }
.tl-lab { position: sticky; left: 0; z-index: 3; background: var(--card); border-right: 1px solid var(--line); padding: 6px 10px; display: grid; align-content: center; gap: 1px; min-width: 0; }
.tl-lab b { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-lab span { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-lab .pill { justify-self: start; font-size: .66rem; padding: 0 .5em; }
.tl-days, .tl-track { display: grid; grid-template-columns: repeat(21, minmax(var(--col), 1fr)); }
.tl-track { row-gap: 4px; padding-block: 5px; position: relative; }
.tl-head { position: sticky; top: 0; z-index: 4; border-top: 0; }
.tl-head .tl-lab { font-size: .78rem; color: var(--muted); font-weight: 600; }
.tl-dh { text-align: center; font-size: .7rem; color: var(--muted); padding: 6px 0 5px; border-left: 1px solid #eef0f1; line-height: 1.2; }
.tl-dh b { display: block; font-size: .86rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.tl-dh.we { background: var(--weekend); }
.tl-dh.today { background: var(--teal); color: #fff; }
.tl-dh.today b { color: #fff; }
.tl-dh .mo { display: block; font-weight: 700; color: var(--teal-d); }
.tl-dh.today .mo { color: #fff; }
.tl-day { grid-row: 1 / -1; border-left: 1px solid #eef0f1; margin-block: -5px; }
.tl-day.we { background: var(--weekend); }
.tl-day.today { background: var(--teal-l); }
.tl-group { border-top: 1px solid var(--line); background: #f7f8f9; }
.tl-group .tl-lab { background: #f7f8f9; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-block: 6px; }
.tbar { --c: var(--hmc); position: relative; z-index: 1; margin: 0 2px; min-width: 0; height: var(--bar-h); border-radius: 6px; border: 2px solid var(--c); background: var(--c); color: #fff; font-size: .74rem; font-weight: 600; text-align: left; padding: 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: calc(var(--bar-h) - 4px); }
.tbar.inspekta { --c: var(--inspekta); }
.tbar.rite4site { --c: var(--rite4site); color: var(--r4s-ink); }
.tbar.tent { background: var(--card); color: var(--ink); }
.tbar.masked { --c: #c3c8cc; background: #d9dcdf; color: #3d4246; }
.tbar.masked.tent { background: var(--card); }
.tbar.bo { --c: #c5ccd1; border-width: 1px; background: repeating-linear-gradient(135deg, var(--hatch-a) 0 6px, var(--hatch-b) 6px 12px); color: #3d4246; }
.tbar .hold { font-weight: 500; opacity: .85; }
.tbar .flag { color: var(--red); margin-right: 3px; }
.tbar:not(.tent):not(.bo):not(.masked):not(.rite4site) .flag { color: #fff; }
.tbar:hover { filter: brightness(.95); }
@media (max-width: 640px) { :root { --lab: 120px; --col: 38px; } .tl-lab b { font-size: .78rem; } }

/* ---------- calendar */
.days { display: grid; gap: 12px; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.day > h3 { margin: 0; padding: 8px 14px; font-size: .92rem; background: #f7f8f9; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; }
.day.today > h3 { background: var(--teal-l); color: var(--teal-d); }
.day ul { list-style: none; margin: 0; padding: 0; }
.ev { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 4px 12px; padding: 9px 14px; border-top: 1px solid #eef0f1; text-align: left; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: inherit; }
.day li:first-child .ev { border-top: 0; }
button.ev:hover { background: #f7fafa; }
.ev .when { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev .what { display: grid; gap: 1px; min-width: 0; }
.ev .what .muted { font-size: .82rem; }
.ev.mine { box-shadow: inset 4px 0 0 var(--teal); }
.ev.masked .what b { color: var(--muted); }
.day .none { padding: 9px 14px; color: var(--muted); font-size: .85rem; }
@media (max-width: 520px) { .ev { grid-template-columns: minmax(0, 1fr); } }
.sms { background: #e9f7ee; border-radius: 16px 16px 16px 4px; padding: 10px 14px; white-space: pre-wrap; font-size: .88rem; max-width: 420px; overflow-wrap: anywhere; }

/* ---------- audit log */
.log { width: 100%; border-collapse: collapse; font-size: .86rem; }
.log th, .log td { text-align: left; padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.log th { font-size: .76rem; color: var(--muted); font-weight: 600; border-top: 0; background: #f7f8f9; }
.log td.when { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.tablebox { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }

/* ---------- dialogs */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); color: var(--ink); background: var(--card); }
dialog::backdrop { background: rgba(20, 24, 28, .45); }
.dlg { padding: 18px 20px 20px; }
.dlg h2 { margin-bottom: 10px; padding-right: 40px; }
.dlg .x { position: absolute; right: 10px; top: 10px; background: none; border: 0; font-size: 1.4rem; line-height: 1; padding: 6px 10px; border-radius: 8px; color: var(--muted); }
.dlg .x:hover { background: #eef0f1; color: var(--ink); }
.dlg section { margin-top: 14px; }
.dlg h3 { font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- signed in as, sign out */
.topbar .me .who { color: #fff; font-weight: 600; }
.topbar .me .linkbtn { color: #fff; font-weight: 500; }

/* ---------- sign-in page (as the CRM) */
.signin { max-width: 460px; margin: 6vh auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.signin .card { padding: 24px 26px; }
.ms-btn { display: inline-flex; align-items: center; gap: 12px; background: #fff; color: #3a3a3a; border: 1px solid #8c8c8c; border-radius: 4px; padding: 0 16px; min-height: 44px; font-family: "Segoe UI", system-ui, sans-serif; font-weight: 600; font-size: 15px; text-decoration: none; }
.ms-btn:hover { background: #f3f3f3; }

/* ---------- booking page, done page */
.sent { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sent li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.files li { display: flex; gap: 10px; align-items: center; padding: 3px 0; }
.history { list-style: none; margin: 0; padding: 0; font-size: .84rem; display: grid; gap: 6px; }
.history .muted { font-size: .78rem; }
.loading { color: var(--muted); padding: 30px 0; text-align: center; }

/* ---------- admin */
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.subnav a { text-decoration: none; padding: 6px 14px; border-radius: 50px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: .88rem; }
.subnav a[aria-current=page] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tablebox table.list { width: 100%; border-collapse: collapse; font-size: .88rem; }
.list th, .list td { text-align: left; padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.list th { font-size: .76rem; color: var(--muted); font-weight: 600; border-top: 0; background: #f7f8f9; white-space: nowrap; }
.list tr.off td { color: var(--muted); }
.list td .pill { margin: 0 4px 2px 0; }
.ticks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 14px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.setting { border-top: 1px solid var(--line); padding: 14px 0; }
.setting:first-of-type { border-top: 0; padding-top: 0; }
.setting h3 { margin-bottom: 4px; }
a.row, a.ev, a.linkcard, a.tile { text-decoration: none; color: inherit; }
a.row:hover, a.ev:hover { background: #f7fafa; }
code { font-size: .82em; background: #f1f2f4; padding: 0 .3em; border-radius: 4px; }
