/* Team Hub - Kingfisher Row Dental.
   Tokens carried from the website (site/assets/css/main.css): flat purples, teal for state,
   gold only for the one primary action per screen, radius 10/14/6, near-flat shadows. */

:root {
  --purple: #12343f;
  --purple-deep: #0c2630;
  --purple-soft: #f2f7f8;
  --teal: #2a9d8f;
  --teal-deep: #1f7a6f;
  --teal-soft: #e6f4f2;
  --gold: #e8893f;
  --gold-deep: #a4521c;
  --ink: #243236;
  --muted: #627276;
  --line: #e8eef0;
  --white: #fff;
  --cream: #f6f8f8;
  --blush: #eef4f5;
  --lilac: #d8e9ed;
  --red: #b8434f;
  --red-soft: #fbecee;
  --amber: #a8741a;
  --amber-soft: #fbf3e2;

  --font-sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(18, 52, 63, 0.08);
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--purple);
  line-height: 1.15;
  margin: 0 0 .5rem;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 40;
}
h1 { font-size: 1.65rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 .75rem; }
a { color: var(--purple); text-decoration-color: var(--teal); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 2px; }
.num, td, .stat b { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

.boot { min-height: 100vh; display: grid; place-items: center; }

/* --- Layout -------------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  display: flex; align-items: center; gap: 12px;
}
.top .logo { height: 34px; width: auto; display: block; }
.top .app-name { font-size: .78rem; color: var(--muted); border-left: 1px solid var(--line); padding-left: 12px; line-height: 1.2; }
.top .spacer { flex: 1; }
.top .who { font-size: .85rem; color: var(--muted); }
.bell { position: relative; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--purple); }
.bell .dot { position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; padding: 0 4px; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--white); border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.nav a {
  flex: 1; text-align: center; text-decoration: none; color: var(--muted);
  font-size: .72rem; padding: 8px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: var(--purple); font-weight: 600; }
.nav a.on svg { color: var(--teal-deep); }

main { max-width: 1180px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 28px); }

@media (min-width: 900px) {
  .nav { position: sticky; top: 55px; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); justify-content: center; gap: 4px; padding: 0 16px; }
  .nav a { flex: 0 0 auto; flex-direction: row; gap: 8px; font-size: .9rem; padding: 12px 16px; border-bottom: 2px solid transparent; }
  .nav a.on { border-bottom-color: var(--teal); }
  .nav a svg { width: 18px; height: 18px; }
  main { padding-bottom: 48px; }
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.grid { display: grid; gap: 14px; }
@media (min-width: 900px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.home { grid-template-columns: 1.1fr 1fr; align-items: start; }
}

.card {
  background: var(--white); border: 1px solid #e0e8ea; border-radius: var(--radius);
  padding: 16px 18px;
}
.card > h2:first-child { margin-bottom: 10px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.card h2 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; color: var(--purple); letter-spacing: 0; }

/* --- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--purple); background: var(--purple); color: #fff;
  border-radius: var(--radius); padding: 10px 16px; font-weight: 500; cursor: pointer;
  text-decoration: none; line-height: 1.2; min-height: 42px;
}
.btn:hover { background: var(--purple-deep); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--purple-deep); font-weight: 600; }
.btn.gold:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff; }
.btn.line { background: var(--white); color: var(--purple); border-color: var(--line); }
.btn.line:hover { border-color: var(--purple); background: var(--white); }
.btn.teal { background: var(--teal-deep); border-color: var(--teal-deep); }
.btn.danger { background: var(--white); color: var(--red); border-color: #efcdd1; }
.btn.small { min-height: 32px; padding: 5px 10px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 0; color: var(--purple); text-decoration: underline; text-decoration-color: var(--teal); cursor: pointer; }

/* --- Clock card ----------------------------------------------------------- */
.clock { text-align: center; padding: 22px 16px; }
.clock .now { font-family: var(--font-serif); font-size: 2.6rem; color: var(--purple); line-height: 1; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.clock .date { color: var(--muted); margin-bottom: 14px; }
.clock .state { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--purple-soft); font-size: .9rem; margin-bottom: 16px; }
.clock .state.in { background: var(--teal-soft); color: var(--teal-deep); }
.clock .state i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.clock .btn { min-height: 56px; font-size: 1.1rem; width: 100%; max-width: 360px; }
.clock .shift-line { margin-top: 12px; font-size: .88rem; color: var(--muted); }
.clock .where { margin-top: 10px; font-size: .82rem; color: var(--muted); }

/* --- Stats ----------------------------------------------------------------- */
.stats { display: flex; flex-wrap: wrap; gap: 10px 0; margin: 2px 0 4px; }
.stat { padding: 0 18px 0 0; margin-right: 18px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.stat b { display: block; font-size: 1.35rem; color: var(--purple); line-height: 1.15; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat:first-child b { font-size: 1.9rem; }
.stat span { font-size: .78rem; color: var(--muted); }
.stat.warn b { color: var(--red); }
.stat.warn b { color: var(--red); }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; display: flex; margin: 10px 0 4px; }
.bar i { display: block; height: 100%; }

/* --- Lists ------------------------------------------------------------------ */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 500; }
.list .sub { font-size: .82rem; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 600; color: #fff; background: var(--purple); flex: none; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 500; padding: 2px 7px; border-radius: 4px; background: var(--purple-soft); color: var(--purple); white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.chip.in { background: var(--teal-soft); color: var(--teal-deep); }
.chip.due { background: var(--amber-soft); color: var(--amber); }
.chip.away { background: var(--blush); color: var(--muted); }
.chip.pending { background: var(--amber-soft); color: var(--amber); }
.chip.approved { background: var(--teal-soft); color: var(--teal-deep); }
.chip.declined, .chip.cancelled { background: var(--red-soft); color: var(--red); }
.chip.flag { background: var(--red-soft); color: var(--red); }
.chip.ok { background: var(--teal-soft); color: var(--teal-deep); }

.whos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.whos .p { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.whos .p .n { font-weight: 500; font-size: .9rem; line-height: 1.2; }
.whos .p .t { font-size: .75rem; color: var(--muted); }
.team-label { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 12px 0 6px; }

/* --- Tables ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 600; font-size: .78rem; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--white); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--purple-soft); }
td.r, th.r { text-align: right; }
.neg { color: var(--red); font-weight: 500; }
.pos { color: var(--teal-deep); font-weight: 500; }
tr.weekend td { background: #fbfdfd; }
tr.bh td { background: var(--blush); }
tr.flagged td:first-child { box-shadow: inset 3px 0 0 var(--red); }

/* --- Rota ------------------------------------------------------------------------ */
.rota-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rota-nav .label { font-weight: 600; color: var(--purple); min-width: 170px; text-align: center; }
.day-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.day-tabs button { flex: none; border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); padding: 6px 12px; cursor: pointer; text-align: center; line-height: 1.2; }
.day-tabs button b { display: block; font-size: .95rem; color: var(--purple); }
.day-tabs button span { font-size: .72rem; color: var(--muted); }
.day-tabs button.on { background: var(--purple); border-color: var(--purple); }
.day-tabs button.on b, .day-tabs button.on span { color: #fff; }
.day-tabs button.today:not(.on) { border-color: var(--teal); }

.rota-day { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.room { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px 12px; }
.room-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.room-h b { font-family: var(--font-serif); color: var(--purple); font-size: 1.02rem; }
.room-h span { font-size: .72rem; color: var(--muted); }
.slot { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--purple-soft); margin-top: 5px; min-height: 40px; }
.slot .role { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); width: 44px; flex: none; }
.slot .nm { font-weight: 500; flex: 1; min-width: 0; line-height: 1.25; }
.slot .nm small { display: block; font-weight: 400; font-size: .74rem; color: var(--muted); }
.slot.empty { background: var(--white); border: 1px dashed var(--line); }
.slot.empty .nm { color: var(--muted); font-weight: 400; }
.slot.away { background: var(--red-soft); }
.slot.away .nm { text-decoration: line-through; text-decoration-color: rgba(184, 67, 79, .5); }
.slot.me { box-shadow: inset 0 0 0 2px var(--teal); }
.slot.editable { cursor: pointer; }
.slot.editable:hover { box-shadow: inset 0 0 0 1px var(--purple); }
.slot .ovr { font-size: .65rem; color: var(--gold-deep); font-weight: 600; }
.gap-warn { font-size: .74rem; color: var(--red); margin-top: 4px; }
.unplaced { margin-top: 14px; }

/* week table on wide screens */
.rota-week { display: none; }
@media (min-width: 1100px) {
  .rota-week { display: block; }
  .rota-mobile { display: none; }
}
.rota-week table { table-layout: fixed; }
.rota-week th:first-child, .rota-week td:first-child { width: 96px; }
.rota-week td { padding: 6px; }
.rota-week .slot { margin-top: 3px; min-height: 34px; padding: 4px 6px; font-size: .84rem; }
.rota-week .slot .role { display: none; }
.rota-week td.loc b { font-family: var(--font-serif); color: var(--purple); display: block; }
.rota-week td.loc span { font-size: .72rem; color: var(--muted); }
.rota-week th.today { color: var(--teal-deep); }

/* --- Forms ----------------------------------------------------------------------- */
.field { margin-bottom: 14px; }
.field > label, .field > .lbl { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 5px; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=month], select, textarea {
  width: 100%; border: 1px solid #d5e1e4; border-radius: var(--radius); padding: 10px 12px; background: var(--white); min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(88, 182, 175, .2); }
input.bad { border-color: var(--red); }
textarea { min-height: 80px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline .to { color: var(--muted); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.switch label { font-weight: 600; font-size: .9rem; }
.toggle { position: relative; width: 46px; height: 26px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle span { position: absolute; inset: 0; background: #d2dde0; border-radius: 13px; cursor: pointer; transition: background .15s; }
.toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--teal-deep); }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; margin: 6px 0; }
.total-band { background: var(--purple-soft); border-radius: var(--radius); padding: 12px 14px; display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 14px; }
.total-band .v { color: var(--purple); }
.msg { border-radius: var(--radius); padding: 10px 12px; font-size: .88rem; margin-bottom: 12px; }
.msg.err { background: var(--red-soft); color: var(--red); }
.msg.info { background: var(--teal-soft); color: var(--teal-deep); }
.msg.warn { background: var(--amber-soft); color: var(--amber); }

/* pattern editor */
.pattern-row { display: grid; grid-template-columns: 56px 1fr 1fr 80px 100px; gap: 6px; align-items: center; margin-bottom: 6px; }
.pattern-row .d { font-weight: 600; color: var(--purple); }
.pattern-row input, .pattern-row select { min-height: 38px; padding: 6px 8px; }

/* --- Sheet (slide-over panel, like the "Add time off" drawer) --------------------------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(36, 50, 54, .4); z-index: 50; display: flex; justify-content: flex-end; }
.sheet {
  background: var(--white); width: 100%; max-width: 440px; height: 100%; overflow-y: auto;
  padding: 0 18px 24px; box-shadow: -4px 0 24px rgba(36, 50, 54, .15);
  animation: slidein .18s ease-out;
}
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-h { position: sticky; top: 0; background: var(--white); display: flex; align-items: center; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; z-index: 1; }
.sheet-h h2 { margin: 0; flex: 1; font-size: 1.1rem; }
.x { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
@media (max-width: 600px) {
  .sheet-bg { align-items: flex-end; }
  .sheet { max-width: none; height: auto; max-height: 92vh; border-radius: 16px 16px 0 0; animation: slideup .18s ease-out; }
  @keyframes slideup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* --- Login ------------------------------------------------------------------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login .card { width: 100%; max-width: 400px; padding: 28px 24px; }
.login .logo { width: 230px; max-width: 80%; display: block; margin: 0 auto 6px; }
.login .app-title { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 22px; }
.login .rule { width: 40px; height: 2px; background: var(--gold); margin: 0 auto 22px; }
.code-input { letter-spacing: .5em; text-align: center; font-size: 1.4rem !important; font-variant-numeric: tabular-nums; }

/* --- Toast ----------------------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px); transform: translateX(-50%); background: var(--purple-deep); color: #fff; padding: 10px 16px; border-radius: var(--radius); z-index: 60; font-size: .9rem; max-width: calc(100% - 32px); box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.toast.err { background: var(--red); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

.empty-state { text-align: center; color: var(--muted); padding: 24px 8px; font-size: .9rem; }
.tabs { display: inline-flex; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; gap: 2px; }
.tabs button { border: 0; background: none; padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: .88rem; color: var(--muted); }
.tabs button.on { background: var(--purple); color: #fff; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

@media print {
  .top, .nav, .no-print, .btn { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
}

/* --- Nav badges, More menu ----------------------------------------------------------------- */
.nav a { position: relative; }
.nav .badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; line-height: 17px; padding: 0 4px; font-weight: 600; }
.nav .mob-only { display: flex; }
.nav .desk-only { display: none; }
@media (min-width: 900px) {
  .nav .mob-only { display: none; }
  .nav .desk-only { display: flex; }
  .nav .badge { position: static; margin-left: 2px; }
}
.more-list a { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 500; }
.more-list a svg { color: var(--teal-deep); }
.more-list a .badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 9px; font-size: 11px; padding: 1px 7px; }

/* --- Events ------------------------------------------------------------------------------------ */
.event { display: flex; gap: 14px; align-items: flex-start; }
.event .when { flex: none; width: 58px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 0; background: var(--white); }
.event .when b { display: block; font-family: var(--font-serif); font-size: 1.5rem; color: var(--purple); line-height: 1.05; }
.event .when span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.event .body { flex: 1; min-width: 0; }
.event h3 { margin: 0 0 2px; font-size: 1.02rem; }
.event.cancelled h3 { text-decoration: line-through; color: var(--muted); }
.rsvp { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.rsvp button { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: .88rem; }
.rsvp button.on.going { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.rsvp button.on.maybe { background: var(--gold); border-color: var(--gold); color: var(--purple-deep); }
.rsvp button.on.no { background: var(--muted); border-color: var(--muted); color: #fff; }

/* --- Chat -------------------------------------------------------------------------------------- */
.chat-list li { cursor: pointer; }
.chat-list .unread { background: var(--teal-deep); color: #fff; border-radius: 999px; font-size: .74rem; padding: 1px 8px; font-weight: 600; }
.chat-list .preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 360px; }
@media (min-width: 900px) { .thread { height: calc(100vh - 230px); } }
.thread-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.thread-h h2 { margin: 0; flex: 1; font-size: 1.05rem; }
.msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: #fcfefe; }
.msg-b { max-width: 80%; padding: 8px 12px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); align-self: flex-start; white-space: pre-wrap; word-wrap: break-word; }
.msg-b.mine { align-self: flex-end; background: var(--purple); color: #fff; border-color: var(--purple); }
.msg-b .meta { font-size: .7rem; color: var(--muted); margin-top: 3px; }
.msg-b.mine .meta { color: rgba(255,255,255,.7); text-align: right; }
.msg-b .from { font-size: .74rem; font-weight: 600; color: var(--teal-deep); margin-bottom: 2px; }
.msg-b a.file { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 6px 8px; border-radius: 8px; background: rgba(18,52,63,.06); color: inherit; text-decoration: none; font-size: .86rem; }
.msg-b.mine a.file { background: rgba(255,255,255,.14); }
.day-sep { align-self: center; font-size: .72rem; color: var(--muted); margin: 8px 0 2px; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--line); background: var(--white); }
.composer textarea { min-height: 42px; max-height: 140px; resize: none; padding: 9px 12px; }
.composer .attach { flex: none; width: 42px; height: 42px; border-radius: var(--radius); border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; color: var(--purple); background: var(--white); }
.composer .attach input { display: none; }
.pending-files { font-size: .8rem; color: var(--muted); padding: 0 12px 6px; }
.member-picks { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 0; background: var(--white); }
.member-picks .pick { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.member-picks .pick:last-child { border-bottom: 0; }
.member-picks .pick:hover { background: var(--purple-soft); }
.member-picks .pick .grow { display: flex; flex-direction: column; line-height: 1.25; }
.member-picks .pick input { width: 20px; height: 20px; accent-color: var(--purple); }
.member-picks .pick[hidden] { display: none; }
.team-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .85rem; cursor: pointer; color: var(--purple); }
.chip-btn.on { background: var(--purple); color: #fff; border-color: var(--purple); }
.lbl-row { display: flex; justify-content: space-between; align-items: baseline; }

/* --- Shift-based rota ------------------------------------------------------------------- */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; margin-right: 6px; vertical-align: 1px; }
.room-h { justify-content: flex-start; gap: 0; align-items: center; }
.room-h span:not(.dot) { margin-left: auto; }
.shift { display: block; padding: 5px 8px; border-radius: var(--radius-sm); background: var(--purple-soft); margin-top: 5px; line-height: 1.25; font-size: .86rem; }
.shift b { font-weight: 600; font-size: .78rem; color: var(--purple); }
.shift span { display: block; }
.shift small { display: block; font-size: .72rem; color: var(--muted); }
.shift.me { box-shadow: inset 0 0 0 2px var(--teal); }
.shift.free { background: var(--white); border: 1px dashed #cfdce0; }
.shift.away { background: var(--red-soft); }
.shift.away span { text-decoration: line-through; text-decoration-color: rgba(184, 67, 79, .5); }
.shift.off { background: var(--white); border: 1px solid var(--line); }
.shift.editable { cursor: pointer; }
.shift.editable:hover { box-shadow: inset 0 0 0 1px var(--purple); }
.shift .chip { display: inline-flex; font-size: .65rem; padding: 0 6px; }
.add-shift { display: block; width: 100%; margin-top: 5px; border: 1px dashed #cfdce0; background: none; border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; line-height: 1.6; font-size: .9rem; }
.add-shift:hover { border-color: var(--purple); color: var(--purple); }
.rota-week td.loc { white-space: nowrap; }
.rota-week td.loc b { display: inline; }
.rota-week td.loc span:not(.dot) { display: block; padding-left: 16px; }
table.master td { min-width: 130px; vertical-align: top; padding: 6px; }
table.master td.loc { white-space: nowrap; }
table.master td.loc span:not(.dot) { display: block; font-size: .72rem; color: var(--muted); padding-left: 16px; }
.viewas-bar { background: var(--gold); color: var(--purple-deep); text-align: center; padding: 6px 12px; font-size: .88rem; font-weight: 500; }
.viewas-bar button { margin-left: 8px; }
@media print { .add-shift, .viewas-bar { display: none !important; } .rota-week { display: block !important; } .rota-mobile { display: none !important; } }
.shift[draggable="true"] { cursor: grab; }
.shift.dragging { opacity: .45; }
.drop-on { outline: 2px dashed var(--teal); outline-offset: -2px; background: var(--teal-soft) !important; }

.avatar.photo { object-fit: cover; padding: 0; background: var(--lilac); }

/* rota week grid: room/row labels wrap inside a wider first column (were spilling into Monday) */
.rota-week th:first-child, .rota-week td:first-child { width: 150px; }
.rota-week td.loc { white-space: normal; line-height: 1.25; padding-left: 12px; }
.rota-week td.loc b { display: inline; font-size: .95rem; }
.rota-week td.loc .dot { margin-right: 5px; }
/* "+" add-shift buttons only show when you point at a cell (computers); always there on touch screens */
@media (hover: hover) {
  .rota-week .add-shift { opacity: 0; transition: opacity .12s; }
  .rota-week td:hover .add-shift, .rota-week .add-shift:focus { opacity: 1; }
}
/* policies */
.doc-list li { gap: 12px; }
.doc-ic { width: 38px; height: 38px; border-radius: var(--radius); background: var(--purple-soft); color: var(--purple); display: grid; place-items: center; flex: none; }
.click-row { cursor: pointer; }
.click-row:hover { background: var(--purple-soft); }

/* --- Phones: nothing may be wider than the screen ------------------------------------------ */
html, body { max-width: 100%; overflow-x: hidden; }
.whos .p { min-width: 0; }
.whos .p > div { min-width: 0; }
.whos .chip, .list .chip, .sub .chip { white-space: normal; text-align: left; }
.grid > * { min-width: 0; }
img, table { max-width: 100%; }

/* Home order on phones: clock, things to do, then my info, then the team */
@media (max-width: 899px) {
  .grid.home { display: flex; flex-direction: column; gap: 14px; }
  .grid.home > .grid { display: contents; }
  .o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; }
  .o5 { order: 5; } .o6 { order: 6; } .o7 { order: 7; } .o8 { order: 8; }
  main { padding-left: 12px; padding-right: 12px; }
  .page-head h1 { font-size: 1.45rem; }
  .card { padding: 14px; }
  .top { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .top .logo { height: 28px; }
  .top .who { display: none; }
  /* holiday numbers: one compact row of four */
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .stat { padding: 8px 6px; text-align: center; }
  .stat b { font-size: 1.2rem; }
  .stat span { font-size: .68rem; line-height: 1.2; display: block; }
  .card-head { flex-wrap: wrap; }
  .card-head h2 { font-size: 1.1rem; }
  .clock { padding: 18px 12px; }
  .clock .now { font-size: 2.2rem; }
}
.whos .p { align-items: flex-start; }
.whos .p .t { font-size: .72rem; color: var(--muted); line-height: 1.3; margin: 1px 0 3px; }
.whos .p.is-away .n { color: var(--muted); }
.whos .chip { font-size: .7rem; }

/* ---------------------------------------------------------------- polish: headings, clock ring, nav, toasts, skeletons */
.h-ic { display: flex; align-items: center; gap: 8px; }
.h-ic svg { color: var(--teal-deep); flex: none; }
.card > .h-ic { margin-top: 0; }
.btn svg { vertical-align: -3px; }
.btn.small svg { width: 15px; height: 15px; }

.ring-wrap { position: relative; width: 168px; height: 168px; margin: 2px auto 10px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--teal); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-in .now { margin: 0 0 4px; }
.ring-sub { font-size: .78rem; color: var(--muted); }
.clock .btn svg { margin-right: 4px; }

@media (max-width: 899px) {
  .nav a svg { padding: 3px 14px; width: 50px; height: 28px; border-radius: 999px; box-sizing: border-box; transition: background .15s; }
  .nav a.on svg { background: var(--teal-soft); }
}

.toast { display: flex; align-items: center; gap: 10px; }
.toast .t-ic { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: rgba(255,255,255,.18); }

.skel { display: grid; gap: 14px; }
.sk { border-radius: var(--radius-lg); background: linear-gradient(90deg, var(--line) 25%, var(--purple-soft) 50%, var(--line) 75%); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; }
.sk-h { height: 30px; width: 40%; }
.sk-card { height: 120px; }
.sk-card.short { height: 70px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } .ring-fg { transition: none; } }

/* ---------------------------------------------------------------- team profiles */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tm { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); font: inherit; color: inherit; cursor: pointer; text-align: center; min-width: 0; }
.tm:hover { border-color: var(--teal); }
.tm:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.tm .avatar { width: 72px; height: 72px; font-size: 1.3rem; margin-bottom: 6px; }
.tm-n { font-weight: 600; color: var(--purple); }
.tm-j { font-size: .78rem; color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }
.tm-f { font-size: .72rem; color: var(--teal-deep); margin-top: 2px; }
.tm-big { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.tm-big .avatar { width: 84px; height: 84px; font-size: 1.5rem; }
.favs { margin: 0 0 16px; display: grid; gap: 2px; }
.favs dt { font-size: .75rem; color: var(--muted); margin-top: 10px; }
.favs dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.photo-edit { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.photo-edit label.btn { cursor: pointer; }
.row2 > * { min-width: 0; }
.row2 input[type=date], .row2 input[type=time] { min-width: 0; width: 100%; }
.pattern-row { grid-template-columns: 74px 1fr 1fr 80px 100px 62px; }
.pattern-row .hrs { font-size: .82rem; color: var(--teal-deep); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.pattern-row.small .hrs { color: var(--muted); font-weight: 400; }
.pattern-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; margin: 4px 0 8px; border-radius: var(--radius); background: var(--teal-soft); }
.pattern-total b { color: var(--teal-deep); }
.pattern-total .pt-days { font-size: .82rem; }

/* pattern rows: lay out by the width of the panel they're in (the Add person panel is narrow even on a PC) */
.sheet { container-type: inline-size; }
@container (max-width: 620px) {
  .pattern-row { grid-template-columns: 66px 1fr 1fr 56px; grid-template-areas: "d st fi hrs" ". lu fq fq"; row-gap: 4px; margin-bottom: 10px; }
  .pattern-row > .d { grid-area: d; }
  .pattern-row > .st { grid-area: st; }
  .pattern-row > .fi { grid-area: fi; }
  .pattern-row > .lu-w { grid-area: lu; }
  .pattern-row .lu-w span { display: inline; }
  .pattern-row > .fq { grid-area: fq; }
  .pattern-row > .hrs { grid-area: hrs; text-align: right; }
  .pattern-row.small { grid-template-areas: "d st fi hrs"; margin-bottom: 2px; }
  .pattern-row.small .lunch, .pattern-row.small .freq { display: none; }
  .pattern-row.small .hrs { display: block; }
  .pattern-row .lu::placeholder { color: var(--muted); }
}
.pattern-row .lu { min-width: 0; }
.extra-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; max-width: 320px; }
.allow-out { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 12px; border-radius: var(--radius); background: var(--purple-soft); margin: 4px 0 6px; }
.allow-out b { color: var(--purple); font-size: 1.1rem; }
.allow-out .small { flex-basis: 100%; }
.lu-w { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0; font-weight: 400; }
.lu-w input { min-width: 0; width: 100%; }
.lu-w span { display: none; font-size: .78rem; color: var(--muted); white-space: nowrap; }
/* shifts take their room's colour: a soft tint with a solid edge, so each room reads at a glance */
.shift.tinted { background: color-mix(in srgb, var(--c) 14%, var(--white)); border-left: 3px solid var(--c); }
.shift.tinted.away { background: var(--red-soft); border-left-color: var(--red); }
.shift.tinted.free { background: var(--white); border: 1px dashed color-mix(in srgb, var(--c) 45%, var(--white)); border-left: 3px solid color-mix(in srgb, var(--c) 45%, var(--white)); }

.note-line { font-size: .8rem; color: var(--ink); margin-top: 3px; overflow-wrap: anywhere; }
.note-line span { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-right: 4px; }
.note-line.mgr span { color: var(--teal-deep); }

.clock-opts { text-align: left; max-width: 360px; margin: 0 auto 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.clock-opts .check { font-size: .9rem; }
.clock-opts .field { margin: 8px 0 2px; }
.chip.swap { background: var(--lilac); color: var(--purple); }

.ts-table { font-size: .85rem; }
.ts-table th, .ts-table td { padding: 8px 6px; }
.ts-table th:first-child, .ts-table td:first-child { padding-left: 12px; }
.ts-table th { white-space: normal; }
.ts-table td:first-child b { white-space: nowrap; }
.ts-table td:first-child { min-width: 86px; }
.ts-table td:nth-child(2) { min-width: 84px; }
.ts-table .chip { white-space: normal; text-align: left; margin: 1px 0; }
.ts-table .chip { border-radius: 8px; }
.ts-table td:nth-child(9) { min-width: 112px; }
.ts-table td:nth-child(10) { min-width: 120px; }
.ts-table tfoot td { border-top: 2px solid var(--purple); background: var(--purple-soft); vertical-align: top; }
.ts-hint { margin: 0 0 8px; }
/* phones: each day becomes a block of label / value lines, so nothing scrolls sideways */
@media (max-width: 760px) {
  .ts-table thead { display: none; }
  .ts-table, .ts-table tbody, .ts-table tfoot, .ts-table tr, .ts-table td { display: block; width: auto; }
  .ts-table tr { border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .ts-table tfoot tr { background: var(--purple-soft); border-top: 2px solid var(--purple); }
  .ts-table td, .ts-table td:first-child, .ts-table tfoot td { border: 0; background: none; min-width: 0; position: relative; padding: 3px 0 3px 104px; text-align: right; }
  .ts-table td::before { content: attr(data-label); position: absolute; left: 0; top: 3px; font-size: .78rem; color: var(--muted); text-align: left; }
  .ts-table td:first-child, .ts-table td.nolabel { padding-left: 0; text-align: left; }
  .ts-table td:first-child::before, .ts-table td.nolabel::before { content: none; }
  .ts-table td.nil { display: none; }
  .ts-table td .chip { text-align: right; }
  .ts-table tr.flagged { box-shadow: inset 3px 0 0 var(--red); }
  .ts-table tr.flagged td:first-child { box-shadow: none; }
}
.ts-table .claim + .claim, .ts-table .small + .claim { margin-top: 8px; }

details.archived { margin-top: 18px; }
details.archived > summary { cursor: pointer; font-weight: 600; color: var(--purple); padding: 6px 0; }

.btn.purple { background: var(--purple); border-color: var(--purple); color: #fff; font-weight: 600; }
.btn.purple:hover { background: var(--purple-deep); border-color: var(--purple-deep); color: #fff; }
.btn.purple svg { color: var(--teal); }
.rota-nav .master-btn { margin-left: 10px; }

/* People: the same column widths in every team table, so they line up down the page */
.people-table { table-layout: fixed; min-width: 640px; }
.people-table th:nth-child(1) { width: 27%; } .people-table th:nth-child(2) { width: 15%; } .people-table th:nth-child(3) { width: 27%; }
.people-table th:nth-child(4) { width: 11%; } .people-table th:nth-child(5) { width: 8%; } .people-table th:nth-child(6) { width: 12%; }
.people-table td { overflow-wrap: anywhere; }
.people-table td:last-child .btn { white-space: nowrap; }
.wa-btn .wa-ic { color: #25d366; vertical-align: -4px; margin-right: 2px; }

/* Team WhatsApp: the mark in white on WhatsApp green, so it's recognisable at a glance */
.wa-btn { padding-left: 6px; gap: 8px; border-color: #c9efd7; font-weight: 600; }
.wa-btn:hover { border-color: #25d366; }
.wa-badge { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #25d366; flex: none; }
.wa-badge .wa-ic { color: #fff; width: 18px; height: 18px; vertical-align: 0; margin: 0; }

/* footer: copyright + design credit; sits above the phone's bottom tab bar */
main { padding-bottom: 12px; }
.app-foot { max-width: 1180px; margin: 0 auto; padding: 14px 16px calc(var(--nav-h) + 22px); text-align: center; font-size: .75rem; color: var(--muted); border-top: 1px solid var(--line); }
.app-foot a { color: var(--purple); font-weight: 600; text-decoration: none; }
.app-foot a:hover { text-decoration: underline; }
@media (min-width: 900px) { .app-foot { padding-bottom: 24px; } }
.login .app-foot { border-top: 0; padding: 18px 0 0; max-width: none; }
@media print { .app-foot { display: none; } }

/* My requests: a three-step tracker under each request */
.req-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.req-steps { list-style: none; margin: 10px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.req-steps li { position: relative; padding: 8px 0 0; border-top: 3px solid var(--line); font-size: .78rem; line-height: 1.3; }
.req-steps li b { display: block; font-weight: 600; color: var(--muted); }
.req-steps li span { color: var(--muted); }
.req-steps li.done { border-top-color: var(--teal); } .req-steps li.done b { color: var(--teal-deep); }
.req-steps li.now { border-top-color: var(--amber); } .req-steps li.now b { color: var(--amber); }
.req-steps li.ok { border-top-color: var(--teal-deep); } .req-steps li.ok b { color: var(--teal-deep); }
.req-steps li.no { border-top-color: var(--red); } .req-steps li.no b { color: var(--red); }
.req-steps li.off { border-top-color: var(--muted); } .req-steps li.off b { color: var(--ink); }
.small-tabs { margin: 0 0 6px; flex-wrap: wrap; }
.small-tabs button { font-size: .8rem; padding: 5px 10px; }
.req-list > li { align-items: flex-start; }
.chip.withdrawn { background: var(--blush); color: var(--muted); }
.list .req-steps li { display: block; border-bottom: 0; }
.req-steps li span { display: block; margin-top: 1px; }

.push-nudge { border-color: var(--teal); }

/* bank holidays: the practice is closed */
.rota-week th.closed { color: var(--muted); }
.rota-week td.closed-col { vertical-align: top; background: repeating-linear-gradient(135deg, var(--purple-soft) 0 10px, #ecf4f6 10px 20px); text-align: center; padding-top: 18px; }
.rota-week td.closed-col div { position: sticky; top: 120px; }
.rota-week td.closed-col b { display: block; font-family: var(--font-serif); color: var(--purple); font-size: 1.05rem; }
.rota-week td.closed-col span { font-size: .75rem; color: var(--muted); }
.day-tabs button.closed span { color: var(--muted); font-style: italic; }
.closed-day { border-radius: var(--radius-lg); padding: 28px 16px; text-align: center; background: repeating-linear-gradient(135deg, var(--purple-soft) 0 10px, #ecf4f6 10px 20px); border: 1px solid var(--line); }
.closed-day b { display: block; font-family: var(--font-serif); color: var(--purple); font-size: 1.4rem; }
.closed-day span { color: var(--muted); font-size: .9rem; }
.day-tabs button.on.closed span { color: #fff; opacity: .85; }

/* week grid: each day reads as its own column */
.rota-week td.day, .rota-week thead th:not(:first-child), .rota-week td.closed-col { border-left: 1px solid #dce7ea; }
.rota-week td.day.alt, .rota-week thead th.alt { background: #f8fbfc; }
.rota-week td.day.is-today, .rota-week thead th.is-today { background: #eef7f6; }
.rota-week thead th:not(:first-child) { text-align: left; padding: 10px 8px 8px; border-bottom: 2px solid #dce7ea; vertical-align: bottom; }
.rota-week thead th b { display: block; font-family: var(--font-serif); color: var(--purple); font-size: 1rem; font-weight: 600; }
.rota-week thead th span { display: block; font-size: .75rem; color: var(--muted); font-weight: 500; }
.rota-week thead th.is-today { border-bottom-color: var(--teal); }
.rota-week thead th.is-today b, .rota-week thead th.is-today span { color: var(--teal-deep); }
.rota-week tbody tr { border-bottom: 1px solid var(--line); }

/* master rota: the same day separation as the week rota */
table.master td.day, table.master thead th:not(:first-child) { border-left: 1px solid #dce7ea; }
table.master td.day.alt, table.master thead th.alt { background: #f8fbfc; }
table.master thead th:not(:first-child) { text-align: left; padding: 10px 8px 8px; border-bottom: 2px solid #dce7ea; }
table.master thead th b { font-family: var(--font-serif); color: var(--purple); font-size: 1rem; font-weight: 600; }
table.master tbody tr { border-bottom: 1px solid var(--line); }

/* locums / temps on the rota */
.chip.locum { display: inline-flex; margin-top: 3px; background: var(--amber-soft); color: var(--amber); font-size: .66rem; padding: 1px 7px; white-space: normal; }
.shift .chip.locum { display: inline-flex; }
.locum-box { border-left: 3px solid var(--gold); padding: 2px 0 2px 12px; margin-bottom: 6px; }

/* first sign-in: accept the Team Hub Privacy Notice */
.privacy-gate { min-height: 100vh; padding: 24px 16px; display: flex; flex-direction: column; align-items: center; }
.privacy-gate > .card { max-width: 680px; width: 100%; }
.privacy-gate .logo { width: 170px; display: block; margin-bottom: 6px; }
.privacy-gate h1 { margin: 6px 0 8px; }
.pg-text { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px; background: var(--white); font-size: .9rem; }
.pg-text h1 { font-size: 1.2rem; } .pg-text h2 { font-size: 1rem; margin: 18px 0 4px; }
.pg-text table { font-size: .82rem; } .pg-text th, .pg-text td { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.pg-text blockquote { margin: 8px 0; padding: 8px 12px; background: var(--purple-soft); border-left: 3px solid var(--teal); }
.pg-check { margin: 10px 0 14px; font-weight: 500; }
.privacy-gate .app-foot { border-top: 0; padding-bottom: 8px; }

.privacy-gate { justify-content: center; }
.privacy-gate > .card { max-width: 440px; text-align: left; }
.pg-check { align-items: flex-start; gap: 10px; }
.pg-check input { margin-top: 4px; }
.privacy-gate .logo { margin: 0 auto 6px; }
.privacy-gate h1 { text-align: center; font-size: 1.45rem; }

/* superuser People list has an extra Privacy notice column */
.people-table.super { min-width: 760px; }
.people-table.super th:nth-child(1) { width: 24%; } .people-table.super th:nth-child(2) { width: 13%; } .people-table.super th:nth-child(3) { width: 22%; }
.people-table.super th:nth-child(4) { width: 13%; } .people-table.super th:nth-child(5) { width: 10%; } .people-table.super th:nth-child(6) { width: 7%; } .people-table.super th:nth-child(7) { width: 11%; }

/* time off list: a table on wide screens, one small card per entry on phones */
.abs-table .at-days-m { display: none; }
@media (max-width: 640px) {
  .abs-table { min-width: 0; }
  .abs-table thead { display: none; }
  .abs-table tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name name" "type status" "dates dates" "act act";
                  gap: 6px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .abs-table td { display: block; padding: 0; border: 0; text-align: left; overflow-wrap: normal; word-break: normal; }
  .abs-table .at-name { grid-area: name; } .abs-table .at-type { grid-area: type; } .abs-table .at-status { grid-area: status; }
  .abs-table .at-dates { grid-area: dates; } .abs-table .at-act { grid-area: act; } .abs-table .at-act:empty { display: none; }
  .abs-table .at-days { display: none; } .abs-table .at-days-m { display: inline; }
}

/* part-day practice closures on the rota */
.part-closed { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.part-closed-th { display: block; font-style: normal; font-size: .7rem; font-weight: 600; color: var(--purple); background: var(--purple-soft); border-radius: 6px; padding: 1px 6px; margin-top: 3px; }

/* Bradford factor explainer */
.bf-explain summary { cursor: pointer; list-style: none; }
.bf-explain summary::-webkit-details-marker { display: none; }
.bf-explain summary::before { content: '▸'; display: inline-block; margin-right: 6px; color: var(--purple); transition: transform .15s; }
.bf-explain[open] summary::before { transform: rotate(90deg); }
.bf-explain p { font-size: .9rem; }
.bf-formula { background: var(--purple-soft); border-radius: 8px; padding: 8px 12px; color: var(--purple); }
.bf-eg { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 4px 0 10px; }
.bf-eg div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: .85rem; }
.bf-eg span { display: block; color: var(--muted); margin-top: 2px; }

/* team news */
.news-card .news-item { display: block; padding: 12px 0; }
.news-card .news-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.news-card .news-top .title { font-weight: 600; color: var(--purple); }
.news-card .news-body { margin: 4px 0; font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.news-card .news-act { flex-shrink: 0; font-size: .8rem; }
.member-picks .pick .grow { flex: 1; min-width: 0; }
#g-q { width: 100%; }
.lbl-row .lbl { font-weight: 600; font-size: .85rem; }

/* team news: pictures, documents, links */
.news-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin: 8px 0; }
.news-imgs.one { grid-template-columns: 1fr; }
.news-imgs img { width: 100%; height: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; display: block; aspect-ratio: 4 / 3; background: var(--purple-soft); }
.news-imgs.one img { aspect-ratio: auto; max-height: 360px; }
.news-docs { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.news-docs a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.news-docs a:hover { background: var(--purple-soft); }
.news-docs span { display: flex; flex-direction: column; min-width: 0; }
.news-docs b { font-weight: 600; font-size: .88rem; overflow-wrap: anywhere; }
.news-docs small { color: var(--muted); font-size: .75rem; }
.news-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.news-att { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; }
.news-att li { display: flex; align-items: center; gap: 8px; font-size: .88rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.news-att li .grow { min-width: 0; overflow-wrap: anywhere; }
.news-link-row { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 6px; margin-bottom: 6px; align-items: center; }
@media (max-width: 520px) { .news-link-row { grid-template-columns: 1fr auto; } .news-link-row .nl-url { grid-column: 1; } }
.news-att li .grow { flex: 1; }

.news-event { display: flex; align-items: center; gap: 12px; margin: 8px 0; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--purple); border-radius: 10px; text-decoration: none; color: var(--ink); }
.news-event:hover { background: var(--purple-soft); }
.news-event > svg { color: var(--purple); flex-shrink: 0; }
.news-event .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.news-event small { color: var(--muted); font-size: .8rem; }

/* birthday card in Chat */
.bday-card { align-self: center; max-width: 360px; width: 100%; margin: 14px auto; padding: 22px 20px 14px; text-align: center; border-radius: var(--radius-lg); color: #fff;
  background: var(--purple); border-top: 3px solid var(--gold); }
.bday-card .bday-art { font-size: 52px; line-height: 1; margin-bottom: 8px; }
.bday-card h3 { font-family: var(--font-serif); font-size: 1.45rem; margin: 0 0 8px; color: #fff; }
.bday-card p { margin: 0 0 8px; font-size: .92rem; line-height: 1.5; color: rgba(255,255,255,.92); }
.bday-card .bday-from { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; font-size: .8rem; color: rgba(255,255,255,.85); }
.bday-card .bday-from img { height: 22px; background: #fff; border-radius: 6px; padding: 2px 6px; }
.bday-card .meta { font-size: .7rem; color: rgba(255,255,255,.7); margin-top: 6px; }
.composer-note { padding: 12px; text-align: center; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); }

/* one-tap duplicate on each rota shift */
.shift { position: relative; }
.shift .dup-btn { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0;
  border-radius: 6px; background: rgba(255,255,255,.85); color: var(--purple); cursor: pointer; opacity: 0; transition: opacity .15s; }
.shift:hover .dup-btn, .shift:focus-within .dup-btn { opacity: 1; }
.shift .dup-btn:hover { background: var(--purple); color: #fff; }
@media (hover: none) { .shift .dup-btn { opacity: .9; } }

/* Help: the guides */
.help-doc { line-height: 1.55; }
.help-doc .help-title { font-family: var(--font-serif); color: var(--purple); margin: 0 0 6px; font-size: 1.25rem; }
.help-doc h2 { font-family: var(--font-serif); color: var(--purple); font-size: 1.1rem; margin: 20px 0 6px; }
.help-doc p, .help-doc li { font-size: .93rem; margin: 4px 0; }
.help-doc ul, .help-doc ol { padding-left: 20px; margin: 4px 0 10px; }
.help-doc strong { color: var(--purple); }
.help-doc .tw { overflow-x: auto; }
.help-doc table { border-collapse: collapse; width: 100%; font-size: .88rem; margin: 6px 0 12px; }
.help-doc th, .help-doc td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.help-doc th { color: var(--muted); font-weight: 600; }

/* "Not on the rota": self-employed (from the master rota) stand out */
.se-name { color: var(--teal-deep); font-weight: 600; }
.chip.se { background: #e6f3f1; color: var(--teal-deep); }

/* policy groups as folders */
.doc-group { margin-bottom: 12px; }
.doc-group > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; cursor: pointer; list-style: none; border-bottom: 1px solid var(--line); }
.doc-group > summary::-webkit-details-marker { display: none; }
.doc-group > summary::before { content: '▸'; color: var(--purple); transition: transform .15s; }
.doc-group[open] > summary::before { transform: rotate(90deg); }
.doc-group:not([open]) > summary { border-bottom: 0; }
.doc-group .dg-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--purple); }
.doc-group .dg-act { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }

/* role icons on rota shifts */
.shift .who { display: inline-flex; align-items: flex-start; gap: 4px; }
.kind-ic { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; color: var(--purple); }
.kind-key { display: inline-flex; align-items: center; gap: 4px; }
.kind-key .kind-ic { margin-top: 0; color: var(--purple); }

/* Help button in the top bar, beside the bell */
.help-btn { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; padding: 6px 12px 6px 9px; border-radius: 999px;
  border: 1px solid var(--lilac); background: var(--purple-soft); color: var(--purple); font-size: .85rem; font-weight: 600; line-height: 1; white-space: nowrap; }
.help-btn:hover { background: var(--lilac); }

/* Ask Kit (AI help assistant) */
.william { margin-bottom: 14px; }
.william .w-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.william .w-head img { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; }
.william .w-name { font-family: var(--font-serif); color: var(--purple); font-size: 1.1rem; font-weight: 600; }
.william .w-sub { font-size: .78rem; color: var(--muted); }
.william .w-msgs { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; padding: 2px 0 10px; overscroll-behavior: contain; }
.william .w-msg { align-self: flex-start; max-width: 88%; background: #eef5f6; border-radius: 14px 14px 14px 4px; padding: 9px 12px; font-size: .93rem; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.william .w-msg.me { align-self: flex-end; background: var(--purple); color: #fff; border-radius: 14px 14px 4px 14px; }
.william .w-msg.typing { color: var(--muted); font-style: italic; }
.william .w-msg.err { background: #fbecee; color: var(--red); }
.william .w-form { display: flex; gap: 8px; }
.william .w-form input { flex: 1; min-width: 0; font-size: 16px; }
.william .w-form .btn { flex: none; }
.william .w-note { font-size: .75rem; color: var(--muted); margin-top: 8px; }

/* Phones: finger-sized tap targets for the small controls */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }   /* below 16px iPhones zoom in on focus */
  .small-tabs button { min-height: 38px; padding: 6px 12px; }
  .add-shift { min-height: 36px; }
  .shift .dup-btn { width: 32px; height: 32px; top: 1px; right: 1px; }
  .shift .dup-btn::after { content: ''; position: absolute; inset: -4px; }
}

/* a button that looks like a text link (People: send welcome email) */
.linkish { background: none; border: 0; padding: 0; color: var(--teal-deep, #2e6f6a); font: inherit; text-decoration: underline; cursor: pointer; min-height: 0; }
@media (pointer: coarse) { .linkish { padding: 6px 0; } }

/* People list on phones: one card per person instead of a wide table */
@media (max-width: 640px) {
  .people-table, .people-table.super { min-width: 0; table-layout: auto; }
  .people-table thead { display: none; }
  .people-table tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .people-table td { display: block; padding: 0; border: 0; text-align: left; }
  .people-table .pt-name { grid-column: 1; } .people-table .pt-role { grid-column: 2; align-self: center; font-size: .82rem; color: var(--muted); text-align: right; }
  .people-table td[data-l] { grid-column: 1 / -1; display: flex; gap: 10px; align-items: baseline; font-size: .88rem; }
  .people-table td[data-l]::before { content: attr(data-l); flex: none; width: 104px; color: var(--muted); font-size: .8rem; }
  .people-table td[data-l] > * { min-width: 0; }
  .people-table .pt-hub { flex-wrap: wrap; } .people-table .pt-hub > div { flex-basis: 100%; padding-left: 114px; margin-top: 0 !important; }
  .people-table .pt-act { grid-column: 1 / -1; } .people-table .pt-act:empty { display: none; }
  .people-table td[data-l]:empty { display: none; }
}

/* My next shifts: one line a day, like a diary page */
.day-list li { padding-top: 9px; padding-bottom: 9px; }
.day-list .grow { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.day-list .title { font-weight: 500; }
.day-list .times { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }

/* Tabs on phones: one row that scrolls sideways, never squashed */
@media (max-width: 640px) {
  .tabs { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; flex: none; }
}

/* Home: the day at the practice. The one dark, confident panel in the app; everything else stays quiet. */
.today { position: relative; overflow: hidden; color: #fff; border-radius: var(--radius-lg); padding: 22px 24px 18px; margin-bottom: 16px;
  background: radial-gradient(120% 140% at 100% 0%, #376875 0%, rgba(55, 104, 117,0) 55%), var(--purple-deep); }
.today::after { content: ''; position: absolute; left: 24px; right: 24px; bottom: 0; height: 1px; background: linear-gradient(90deg, var(--gold), rgba(194,168,120,0)); }
.today .t-date { font-size: .8rem; letter-spacing: .04em; color: var(--gold); margin-bottom: 6px; }
.today h1 { color: #fff; font-size: clamp(1.7rem, 4.5vw, 2.3rem); line-height: 1.12; margin: 0 0 8px; font-weight: 500; letter-spacing: -.01em; }
.today .t-line { color: rgba(255,255,255,.86); font-size: 1rem; margin: 0 0 18px; }
.today .t-line b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.today .t-note { display: inline-block; margin-left: 4px; color: var(--gold); }
.today .t-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.today .t-team { display: inline-flex; align-items: center; gap: 10px; color: rgba(255,255,255,.86); text-decoration: none; font-size: .88rem; }
.today a.t-team:hover span:last-child { color: #fff; text-decoration: underline; }
.today .faces { display: inline-flex; }
.today .faces .avatar { width: 30px; height: 30px; font-size: .7rem; border: 2px solid var(--purple-deep); margin-left: -8px; }
.today .faces .avatar:first-child { margin-left: 0; }
.today .faces .avatar.more { background: #376875; color: #fff; width: auto; min-width: 30px; padding: 0 7px; border-radius: 15px; font-variant-numeric: tabular-nums; }
.today .t-wa { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: .85rem; font-weight: 500;
  border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 4px 12px 4px 4px; }
.today .t-wa:hover { border-color: rgba(255,255,255,.6); }
.today .t-wa .wa-ic { color: #fff; }
@media (max-width: 480px) {
  .today { padding: 18px 18px 16px; margin-left: -4px; margin-right: -4px; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  .stat, .stat:last-child { border: 0; margin: 0; padding: 0; }
}


/* Clock in / out: one big round button inside the shift ring (the ring fills as the shift goes on) */
.clock .ring-wrap { width: 214px; height: 214px; margin: 6px auto 4px; }
.clock .ring-wrap.no-ring { height: 172px; }
.clock .ring circle { stroke-width: 5; }
.clock-btn { position: absolute; inset: 0; margin: auto; width: 170px; height: 170px; border-radius: 50%; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 14px; text-align: center;
  font: inherit; background: var(--gold); color: var(--purple-deep); box-shadow: 0 8px 22px rgba(169, 138, 82, .35);
  transition: transform .12s ease, box-shadow .12s ease; -webkit-tap-highlight-color: transparent; }
.clock-btn .cb-label { font-size: 1.3rem; font-weight: 600; letter-spacing: -.01em; }
.clock-btn .ring-sub { font-size: .8rem; color: inherit; opacity: .8; font-variant-numeric: tabular-nums; }
.clock-btn:active { transform: scale(.97); box-shadow: 0 4px 12px rgba(169, 138, 82, .3); }
.clock-btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
.clock-btn.out { background: var(--purple); color: #fff; box-shadow: 0 8px 22px rgba(18, 52, 63, .3); }
.clock-btn:disabled { cursor: wait; opacity: .85; }
/* a slow halo while waiting to clock in: the one moving thing on the screen */
.clock-btn.in::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--gold); opacity: 0; animation: clockHalo 2.6s ease-out infinite; pointer-events: none; }
@keyframes clockHalo { 0% { transform: scale(.94); opacity: .55; } 100% { transform: scale(1.12); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .clock-btn.in::before { animation: none; } }
.clock .clock-opts { margin-bottom: 4px; }
.today .t-date { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.today .t-now { font-family: var(--font-serif); font-size: 1.35rem; color: #fff; letter-spacing: .01em; font-variant-numeric: tabular-nums; line-height: 1; }


/* Management calendar (managers) */
.mg-q { margin-bottom: 18px; }
.mg-qh { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 1.15rem; margin: 6px 0 10px; }
.mg-qh span { font-family: var(--font-sans); font-size: .82rem; font-weight: 500; color: var(--gold-deep); }
.mg-months { display: grid; gap: 12px; }
@media (min-width: 900px) { .mg-months { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.mg-month h3 { margin: 0; font-family: var(--font-serif); font-size: 1.05rem; color: var(--purple); }
.mg-month.now { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.mg-list li { padding: 0; }
.mg-check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; cursor: pointer; width: 100%; }
.mg-check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--teal-deep); flex: none; }
.mg-check .title { display: block; font-weight: 500; }
.mg-check .sub { display: block; font-size: .8rem; color: var(--muted); }
.mg-item.done .title { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(98, 114, 118, .5); }
.mg-ongoing summary { cursor: pointer; }
.mg-ongoing-cols { display: grid; gap: 14px; margin-top: 10px; }
@media (min-width: 700px) { .mg-ongoing-cols { grid-template-columns: 1fr 1fr; } }
.mg-ongoing h3 { margin: 0 0 6px; }
.mg-ongoing ul { margin: 0; padding-left: 18px; font-size: .9rem; }


/* Help: how-to videos (animated, silent) */
.hv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.hv { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  overflow: hidden; cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.hv img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; display: block; background: var(--cream); }
.hv span { padding: 0 10px 10px; font-size: .88rem; font-weight: 500; }
.hv:hover { border-color: var(--purple); }
.hv-play { display: flex; justify-content: center; }
.hv-play img { max-width: 100%; max-height: 72vh; height: auto; border-radius: 16px; border: 1px solid var(--line); }


/* Timesheets list on phones: one card per person, the deduction up top, only the lines that apply */
@media (max-width: 640px) {
  .ts-list { min-width: 0; }
  .ts-list thead { display: none; }
  .ts-list tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .ts-list td { display: block; padding: 0; border: 0; text-align: left; }
  .ts-list .tl-name { grid-column: 1; }
  .ts-list .tl-deduct { grid-column: 2; grid-row: 1; text-align: right; font-size: 1.05rem; }
  .ts-list .tl-deduct:empty::before { content: 'Nothing to deduct'; font-size: .8rem; color: var(--muted); font-weight: 400; }
  .ts-list td[data-l] { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; }
  .ts-list td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: .82rem; }
  .ts-list td[data-l]:empty { display: none; }
  .ts-list td[data-l] > div { display: inline; margin-left: 6px; }
  .ts-list .tl-flags { grid-column: 1 / -1; margin-top: 4px; }
}
@media (max-width: 640px) {
  .ts-list tr.flagged { box-shadow: inset 3px 0 0 var(--red); }
  .ts-list tr.flagged td, .ts-list tr.flagged td:first-child { border: 0 !important; box-shadow: none !important; }
  .ts-list td { border-bottom: 0 !important; }
  /* date range: preset on its own line, then from - to side by side */
  .btn-row:has(> #rp) { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
  .btn-row:has(> #rp) > #rp { grid-column: 1 / -1; width: 100% !important; }
  .btn-row:has(> #rp) > input[type=date] { width: 100% !important; min-width: 0; }
  .btn-row:has(> #rp) > *:not(#rp):not(input):not(span) { grid-column: 1 / -1; justify-self: start; }
}

/* Working pattern: a tick box per day (unticked = day off) */
.pattern-row label.d { display: flex; align-items: center; gap: 6px; cursor: pointer; margin: 0; }
.pattern-row label.d .on { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--teal-deep); flex: none; }
.pattern-row.off label.d { color: var(--muted); font-weight: 500; }
.pattern-row.off .st, .pattern-row.off .fi, .pattern-row.off .lu-w, .pattern-row.off .fq { opacity: .45; }

/* Master rota: the room name opens "Move this room's schedule" */
.room-move { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.room-move svg { color: var(--muted); flex: none; }
.room-move:hover b { text-decoration: underline; }
.room-move:hover svg { color: var(--purple); }
.undo-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

/* Managers' Home: their own updates under one heading */
.mg-zone { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.zone-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 12px; }
.zone-head h2 { margin: 0; font-size: 1.35rem; color: var(--purple); }
.zone-head h2::before { content: ""; display: inline-block; width: 22px; height: 2px; background: var(--gold); vertical-align: middle; margin: -3px 10px 0 0; }
@media (max-width: 899px) { .mg-zone { margin-top: 22px; } }

/* Wi-Fi tip at the top of the clock card */
.wifi-tip { display: flex; align-items: center; gap: 10px; margin: -2px 0 14px; padding: 11px 14px; border-radius: var(--radius);
  background: var(--teal-soft); border: 1px solid #bfe3df; color: #26635e; font-weight: 600; font-size: .95rem; line-height: 1.35; text-align: left; }
.wifi-tip svg { flex: none; }

/* Demo copy: the ribbon and the "try it as" sign-in */
.demo-bar { display: flex; align-items: center; justify-content: center; gap: 6px 14px; flex-wrap: wrap; padding: 7px 12px;
  background: var(--purple-deep); color: #fff; font-size: .85rem; text-align: center; }
.demo-bar .btn.line { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.demo-bar .btn.line:hover { background: rgba(255,255,255,.12); }
.demo-login .card { max-width: 460px; }
.persona-list { display: grid; gap: 10px; }
.persona { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; cursor: pointer;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font: inherit; }
.persona:hover, .persona:focus-visible { border-color: var(--gold); background: var(--purple-soft); }
.persona b { display: block; color: var(--purple); font-size: 1rem; }
.persona .pn { display: block; font-size: .85rem; color: var(--ink); }
.persona .pb { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.persona svg { flex: none; color: var(--muted); }
@media print { .demo-bar { display: none !important; } }

/* Master rota: pick several shifts, then move or copy them */
.sel-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.sel-row .legend { margin: 0; }
.sel-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap;
  margin-bottom: 10px; padding: 10px 14px; border-radius: var(--radius); background: var(--purple-deep); color: #fff; }
.sel-bar .muted { color: rgba(255,255,255,.75); }
.sel-bar .btn.line { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
table.master.picking .shift { cursor: pointer; }
table.master.picking .shift .dup-btn, table.master.picking .add-shift { visibility: hidden; }
table.master .shift.picked { outline: 3px solid var(--gold); outline-offset: 1px; box-shadow: 0 0 0 5px rgba(194,168,120,.25); }
table.master .shift.picked::after { content: "✓"; position: absolute; top: 4px; right: 6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold); color: var(--purple-deep); font-size: 12px; line-height: 18px; text-align: center; font-weight: 700; }

/* Master rota: a surgery with nobody in it that day stands out */
table.master td.day.empty-day { background: repeating-linear-gradient(135deg, var(--amber-soft) 0 8px, #fdf8ee 8px 16px); box-shadow: inset 0 0 0 1px #ecd9b0; }
table.master .empty-tag { display: block; margin: 2px 0 4px; font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #7a5410; }

/* ---------------------------------------------------------------- compliance hub: audits */
.au-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.au-stat { background: var(--white); border: 1px solid var(--line, #e0e9ec); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; }
.au-stat b { font-size: 26px; line-height: 1.1; }
.au-stat span { font-size: 13px; color: var(--muted, #6b6475); }
.au-stat.au-overdue b { color: #c2414f; } .au-stat.au-soon b { color: #b07d1f; } .au-stat.au-ok b { color: #2f7a74; }
@media (max-width: 640px) { .au-stats { grid-template-columns: repeat(2, 1fr); } }
.au-howto p { margin: 8px 0 0; font-size: 14px; line-height: 1.5; }
.au-fields { gap: 0 16px; }
.au-progress { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; position: sticky; top: 0; z-index: 3; background: var(--cream); padding: 8px 0; }
.au-progress .bar { flex: 1 1 200px; height: 8px; border-radius: 4px; background: #e3ecef; overflow: hidden; }
.au-progress .bar i { display: block; height: 100%; background: #1f7a6f; transition: width .2s; }
.au-sec h2 { margin-bottom: 4px; }
.au-item { padding: 14px 0; border-top: 1px solid var(--line, #e8f0f2); }
.au-item:first-of-type { border-top: 0; }
.au-q { font-weight: 600; line-height: 1.4; }
.au-ref { display: inline-block; min-width: 34px; color: var(--muted, #6b6475); font-weight: 500; font-size: 13px; }
.au-ev { font-size: 13px; color: var(--muted, #6b6475); margin: 4px 0 0; display: flex; gap: 6px; align-items: flex-start; }
.au-ev svg { flex: none; margin-top: 2px; }
.au-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.au-opt { min-height: 44px; min-width: 64px; padding: 8px 14px; border-radius: 10px; border: 1.5px solid var(--line, #d2dee1); background: #fff; font: inherit; font-size: 15px; cursor: pointer; color: inherit; }
.au-opt:hover { border-color: var(--c); }
.au-opt.on { background: var(--c); border-color: var(--c); color: #fff; font-weight: 600; }
.au-more { margin-top: 8px; display: grid; gap: 8px; }
.au-more[hidden], .au-act[hidden] { display: none; }
.au-note { width: 100%; }
.au-act { display: grid; grid-template-columns: 1fr 170px; gap: 8px; }
.au-item > .au-note { margin-top: 8px; }
.au-cols { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.au-col { padding: 7px 12px; border-radius: 20px; border: 1.5px solid var(--line, #d2dee1); background: #fff; font: inherit; font-size: 14px; cursor: pointer; color: inherit; }
.au-col.part { border-color: #d9a441; } .au-col.full { border-color: #1f7a6f; background: #e8f4f3; }
.au-col.on { background: var(--purple-deep, #12343f); border-color: var(--purple-deep, #12343f); color: #fff; }
.au-colhead { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.au-colhead b { font-size: 17px; margin-right: auto; }
.au-reg { padding: 0 14px; }
.au-reg li { flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.au-reg li.hidden { display: none; }
.au-reg details { margin: 4px 0 6px; }
.au-reg .au-opts { margin-top: 4px; }
.au-foot { display: flex; gap: 10px; justify-content: flex-end; margin: 18px 0 30px; flex-wrap: wrap; }
.au-donut { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.au-d-score { font-size: 30px; font-weight: 700; fill: currentColor; }
.au-d-lbl { font-size: 13px; fill: #6b6475; }
.au-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.au-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.au-bars { display: grid; gap: 10px; }
.au-bar { display: grid; grid-template-columns: minmax(120px, 2fr) 3fr 90px; gap: 12px; align-items: center; font-size: 14px; }
.au-bar-t { position: relative; height: 12px; border-radius: 6px; background: #e8f0f2; }
.au-bar-t i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.au-target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #222f33; }
.au-bar-v { text-align: right; font-weight: 600; }
@media (max-width: 640px) { .au-bar { grid-template-columns: 1fr 70px; } .au-bar-t { grid-column: 1 / -1; grid-row: 2; } .au-act { grid-template-columns: 1fr; } }
.au-info { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.au-info dt { color: var(--muted, #6b6475); } .au-info dd { margin: 0; }

/* photo cropper */
.crop-view { position: relative; margin: 0 auto; border-radius: 12px; overflow: hidden; background: #222; touch-action: none; max-width: 100%; }
.crop-view canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.crop-view canvas:active { cursor: grabbing; }
.crop-ring { position: absolute; inset: 0; pointer-events: none; border-radius: 50%; box-shadow: 0 0 0 999px rgba(12, 24, 28, .55); outline: 2px solid rgba(255, 255, 255, .9); outline-offset: -2px; }
.crop-tools { display: flex; align-items: center; gap: 10px; margin: 14px auto 0; max-width: 280px; }
.crop-tools input[type=range] { flex: 1; accent-color: var(--purple); }
.crop-pm { font-size: 20px; color: var(--muted); width: 14px; text-align: center; }
.au-rep { color: var(--teal-deep); display: flex; align-items: center; gap: 4px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--purple-soft); cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--purple); }
.au-missing { outline: 3px solid var(--red); outline-offset: 4px; border-radius: 6px; transition: outline-color .3s; }
.au-foot { align-items: center; } .au-foot-pos { margin-right: auto; }
.au-per { margin-top: 6px; }
.au-per > summary { cursor: pointer; font-size: 13px; color: var(--purple); font-weight: 600; }
.au-per .list { margin-top: 6px; border-left: 3px solid var(--lilac); padding-left: 12px; }
.au-per .list li { padding: 8px 0; }

/* chat emoji picker */
.composer { position: relative; }
.composer .emoji-btn { font-size: 20px; line-height: 1; padding: 0; }
.emoji-pop { position: absolute; left: 10px; bottom: calc(100% + 6px); width: min(340px, calc(100vw - 40px)); max-height: 300px; overflow-y: auto;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 10px 30px rgba(26, 56, 64, .16); padding: 8px 10px; z-index: 20; }
.emoji-pop[hidden] { display: none; }
.emoji-h { font-size: 12px; font-weight: 600; color: var(--muted); margin: 6px 2px 4px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-grid button { font-size: 22px; line-height: 1; padding: 6px 0; border: 0; background: none; border-radius: 8px; cursor: pointer;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.emoji-grid button:hover, .emoji-grid button:focus-visible { background: var(--blush); }

/* bulk welcome emails */
.bi-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.bi-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.bi-row:first-child { border-top: 0; }
.bi-row input { width: 18px; height: 18px; accent-color: var(--purple); flex: none; }
.help-doc h3 { margin: 18px 0 6px; color: var(--purple); }

.leave-warn { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; padding: 6px 8px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); font-size: .82rem; }
.leave-warn svg { flex: none; margin-top: 2px; }

tr.se-over td { background: var(--red-soft); }

.dg-name .grp-ic { color: var(--teal-deep); flex: none; }

.grp-badge { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; flex: none; margin-right: 4px; }
.dg-name:has(.grp-badge) { display: inline-flex; align-items: center; gap: 10px; }

.grp-badge.sm { width: 30px; height: 30px; border-radius: 9px; margin: 0; }
.mg-check { align-items: center; }
.mg-links { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 8px 68px; }
.mg-links a { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; padding: 3px 9px; border-radius: 20px; background: var(--purple-soft); color: var(--purple); text-decoration: none; border: 1px solid var(--line); }
.mg-links a:hover { background: var(--lilac); }
.flash { box-shadow: 0 0 0 3px var(--gold); transition: box-shadow .4s; border-radius: var(--radius); }
.mg-item:has(.mg-links) { flex-wrap: wrap; }
.mg-item .mg-links { flex-basis: 100%; margin: -4px 0 10px 68px; }

.tasks-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }

/* menu: where the managers-only part starts */
.nav-sep { align-self: center; flex: none; margin: 0 4px 0 10px; padding: 3px 0 3px 12px; border-left: 2px solid var(--gold); font-size: .68rem; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase; color: var(--gold-deep); line-height: 1.2; width: min-content; white-space: normal; overflow-wrap: normal; margin-right: 8px !important; }
.nav a.mgr-tab { background: var(--purple-soft); }
.nav a.mgr-tab.on { background: var(--lilac); }
.more-sep { padding: 12px 16px 4px; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-deep); border-top: 1px solid var(--line); }
.more-sep:empty { padding: 0; }
.more-list a.mgr-item { background: var(--purple-soft); }
@media (min-width: 900px) {
  .nav { justify-content: safe center; overflow-x: auto; scrollbar-width: none; }
}
@media (min-width: 900px) and (max-width: 1480px) {
  .nav { gap: 0; padding: 0 8px; }
  .nav a { padding: 12px 9px; gap: 6px; }
  .nav-sep { margin: 0 2px 0 6px; padding-left: 8px; }
}
@media (min-width: 900px) and (max-width: 1400px) {
  .nav a svg { display: none; }
}

/* return to work */
.rtw { display: grid; gap: 14px; max-width: 860px; }
.rtw-card { border-left: 3px solid var(--gold); }
.rtw-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 16px; margin: 0 0 14px; padding: 12px 14px; background: var(--purple-soft); border-radius: var(--radius); }
.rtw-facts dt, .rtw-ans dt { font-size: .76rem; color: var(--muted); font-weight: 500; }
.rtw-facts dd { margin: 2px 0 0; font-weight: 600; }
.rtw-ans { margin: 0 0 12px; }
.rtw-ans > div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.rtw-ans dd { margin: 3px 0 0; white-space: pre-wrap; }
.rtw-h3 { font-size: 1rem; margin: 18px 0 8px; }
.rtw-hist { margin: 0; padding-left: 18px; font-size: .9rem; }
.rtw-actions { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.rtw-actions summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.rtw .grid.two { grid-template-columns: 1fr 1fr; gap: 0 14px; }
.rtw .grid.three { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 14px; }
@media (max-width: 600px) { .rtw .grid.two, .rtw .grid.three { grid-template-columns: 1fr; } }

.se-limit { display: flex; gap: 8px; align-items: flex-start; }
.se-limit svg { flex: none; margin-top: 2px; }

/* leaver pack on an archived person's page */
.leaver-card .lv-list { margin: 0 0 14px; padding-left: 18px; font-size: .9rem; }
.leaver-card .lv-list li { margin: 2px 0; }

/* showcase sign-up: the spam trap stays out of sight */
.demo-login .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
