:root {
  --blue: #002349;
  --blue-2: #0d3466;
  --blue-soft: #e8edf4;
  --gold: #957C3D;
  --gold-soft: #f4efe3;
  --red: #b00020;
  --red-soft: #fdecee;
  --green: #1b6e2e;
  --green-soft: #e6f3e9;
  --grey: #6b7280;
  --line: #d9dee6;
  --bg: #f6f7f9;
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1c2430;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100vh; font-size: 15px; line-height: 1.4; }
button, input, select, textarea { font: inherit; }
a { color: var(--blue); }
.boot { padding: 40px; text-align: center; color: var(--grey); }

/* ---------- Header & tabs ---------- */
.env-banner { background: var(--gold); color: #fff; text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .08em; padding: 3px; }
header.top { background: var(--blue); color: #fff; padding: calc(env(safe-area-inset-top) + 10px) 16px 0; border-bottom: 4px solid var(--gold); position: sticky; top: 0; z-index: 20; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.brand span { color: var(--gold); }
.who { font-size: 13px; opacity: .9; display: flex; gap: 10px; align-items: center; }
.who button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
nav.tabs { display: flex; gap: 2px; overflow-x: auto; margin-top: 10px; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button { background: transparent; border: 0; color: #cfd8e6; padding: 10px 14px; cursor: pointer; white-space: nowrap; border-radius: 6px 6px 0 0; font-weight: 600; display: flex; align-items: center; gap: 6px; }
nav.tabs button.active { background: var(--bg); color: var(--blue); }
.badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 12px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.badge.gold { background: var(--gold); }

main { max-width: 1320px; margin: 0 auto; padding: 16px; padding-bottom: calc(env(safe-area-inset-bottom) + 40px); }
h2 { color: var(--blue); margin: 4px 0 12px; font-size: 20px; }
h3 { color: var(--blue); margin: 18px 0 8px; font-size: 16px; }
.muted { color: var(--grey); }
.small { font-size: 13px; }

/* ---------- Buttons & forms ---------- */
.btn { background: var(--blue); color: #fff; border: 0; border-radius: 6px; padding: 9px 14px; cursor: pointer; font-weight: 600; min-height: 40px; }
.btn:hover { background: var(--blue-2); }
.btn.gold { background: var(--gold); }
.btn.ghost { background: #fff; color: var(--blue); border: 1px solid var(--line); }
.btn.danger { background: var(--red); }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; color: #344055; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; min-height: 40px; }
textarea { min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.check { display: inline-flex; align-items: center; gap: 6px; margin: 4px 14px 4px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.toolbar .left, .toolbar .right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar select { width: auto; min-width: 150px; }
.month-title { font-size: 20px; font-weight: 700; color: var(--blue); min-width: 170px; text-align: center; }

/* ---------- Auth screens ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--blue); }
.auth-card { background: #fff; border-radius: 10px; padding: 28px; width: 100%; max-width: 400px; border-top: 6px solid var(--gold); }
.auth-card h1 { color: var(--blue); margin: 0 0 4px; font-size: 22px; }
.auth-card .btn { width: 100%; margin-top: 6px; }
.linkbtn { background: none; border: 0; color: var(--blue); text-decoration: underline; cursor: pointer; padding: 6px 0; }
.pw-rules { font-size: 13px; color: var(--grey); margin: -4px 0 12px; padding-left: 18px; }
.pw-rules li.ok { color: var(--green); }

/* ---------- Calendar ---------- */
.cal { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { background: var(--blue-soft); color: var(--blue); font-weight: 700; font-size: 13px; padding: 6px 8px; text-align: center; }
.day { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 140px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.day:nth-child(7n) { border-right: 0; }
.day.out { background: #fafbfc; }
.day.out > * { opacity: .45; }
.day.today { box-shadow: inset 0 0 0 2px var(--gold); }
.day.bh { background: var(--gold-soft); }
.day-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.day-num { font-weight: 700; color: var(--blue); font-size: 14px; }
.day-num .dow { display: none; }
.wk { font-size: 11px; background: var(--blue); color: #fff; border-radius: 4px; padding: 0 5px; font-weight: 700; }
.bh-label { font-size: 11px; color: var(--gold); font-weight: 700; line-height: 1.1; }
.add-btn { border: 1px dashed var(--line); background: transparent; color: var(--grey); border-radius: 4px; cursor: pointer; font-size: 14px; line-height: 1; width: 24px; height: 22px; }
.add-btn:hover { border-color: var(--gold); color: var(--gold); }
.slot { display: flex; flex-direction: column; gap: 3px; }
.slot-label { font-size: 10px; font-weight: 700; color: var(--grey); letter-spacing: .05em; }
.chip { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--blue); background: #fff; border-radius: 4px; padding: 3px 5px; font-size: 12px; line-height: 1.25; cursor: pointer; overflow: hidden; color: inherit; }
.chip b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .sub { display: block; color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .who { display: block; font-weight: 600; color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.unassigned { border-left-color: var(--gold); background: var(--gold-soft); }
.chip.unassigned .who { color: var(--gold); }
.chip.conflict { border-left-color: var(--red); background: var(--red-soft); }
.chip.conflict .who { color: var(--red); }
.chip.moved b::after { content: " ↪"; color: var(--gold); }
.chip.nhs { border-left-color: #4b5563; background: #eef0f3; cursor: default; }
.chip.leave { border-left-color: var(--green); background: var(--green-soft); cursor: default; }
.chip.block { border-left-color: #7c3aed; background: #f1ebfd; cursor: default; }
.chip.pending { border-left-color: #7c3aed; background: #fff; border-style: dashed; cursor: default; }
.chip.surg { border-left-color: var(--blue); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 14px; height: 12px; border-radius: 2px; display: inline-block; border-left: 4px solid; }

/* Phone: calendar becomes a vertical day list */
@media (max-width: 760px) {
  main { padding: 10px; }
  .cal-head { display: none; }
  .cal-grid { display: block; }
  .day { border-right: 0; min-height: 0; padding: 8px 10px; }
  .day.out { display: none; }
  .day.empty-mobile { display: none; }
  .day-num .dow { display: inline; }
  .slot { flex-direction: row; flex-wrap: wrap; align-items: stretch; }
  .slot-label { width: 100%; }
  .chip { font-size: 13px; padding: 6px 8px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .left, .toolbar .right { justify-content: space-between; }
  .toolbar select { flex: 1; min-width: 0; }
  .month-title { font-size: 18px; min-width: 0; flex: 1; }
  .who .name { display: none; }
}

/* ---------- Tables & lists ---------- */
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { background: var(--blue-soft); color: var(--blue); font-size: 13px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.grey { background: #eef0f3; color: var(--grey); }
.item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.item.alert { border-left: 4px solid var(--red); }
.banner { border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.red { background: var(--red-soft); color: var(--red); border: 1px solid #f3c2c9; }
.banner.gold { background: var(--gold-soft); color: #6d5a29; border: 1px solid #e5d9b9; }
.empty { color: var(--grey); padding: 12px; text-align: center; }

/* NHS pattern grid */
.nhs-grid { border-collapse: collapse; width: 100%; font-size: 13px; }
.nhs-grid th, .nhs-grid td { border: 1px solid var(--line); padding: 4px; text-align: center; }
.nhs-grid th { background: var(--blue-soft); color: var(--blue); }
.nhs-grid td:first-child, .nhs-grid th:first-child { text-align: left; font-weight: 700; }
.nhs-grid input { width: 20px; height: 20px; accent-color: var(--blue); }
.privs { columns: 2; column-gap: 16px; }
.privs .check { display: flex; break-inside: avoid; margin-right: 0; }
@media (max-width: 600px) { .privs { columns: 1; } }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0, 20, 45, .55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 30px 12px; overflow-y: auto; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 620px; border-top: 6px solid var(--gold); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-close { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--grey); }
.modal-body { padding: 16px 18px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 600px) { .modal-back { padding: 0; } .modal { border-radius: 0; min-height: 100vh; } }

.pick-list { display: flex; flex-direction: column; gap: 6px; }
.pick { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; text-align: left; width: 100%; }
.pick:hover { border-color: var(--gold); background: var(--gold-soft); }
.pick.current { border-color: var(--blue); background: var(--blue-soft); }
details.why { margin-top: 12px; font-size: 13px; }
details.why summary { cursor: pointer; color: var(--grey); }
.detail-grid { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin-bottom: 14px; }
.detail-grid dt { color: var(--grey); font-size: 13px; }
.detail-grid dd { margin: 0; font-weight: 600; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: calc(env(safe-area-inset-bottom) + 16px); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 460px); }
.toast { background: var(--blue); color: #fff; padding: 12px 16px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25); border-left: 5px solid var(--gold); }
.toast.error { background: var(--red); border-left-color: #fff; }

/* ---------- Week / month switch ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: #fff; color: var(--blue); padding: 6px 12px; font-weight: 600; cursor: pointer; min-height: 32px; }
.seg button.on { background: var(--blue); color: #fff; }
.month-title .wk { vertical-align: middle; font-size: 12px; margin-left: 4px; }
.dow-full { display: inline; }
.cal.week .day { min-height: 320px; }
.cal.week .chip { font-size: 13px; padding: 5px 7px; }
@media (max-width: 760px) { .dow-full { display: none; } .cal.week .day { min-height: 0; } }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- Grid tab ---------- */
.g-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; max-height: calc(100vh - 230px); }
.g-table { border-collapse: separate; border-spacing: 0; font-size: 12px; table-layout: fixed; }
.g-table th, .g-table td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3px 4px; vertical-align: top; }
.g-table thead th { background: var(--blue); color: #fff; position: sticky; z-index: 2; text-align: center; }
.g-table thead tr:first-child th { top: 0; }
.g-table thead tr:nth-child(2) th { top: 26px; background: var(--blue-2); font-size: 11px; }
.g-table thead th.bh { background: var(--gold); }
.g-table .bh-label { color: #fff; font-weight: 400; }
.g-name { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; white-space: nowrap; min-width: 130px; font-weight: 600; color: var(--blue); }
.g-table thead .g-name { z-index: 3; background: var(--blue); color: #fff; }
.g-day { min-width: 0; }
.g-per { position: relative; }
.g-add { margin-left: 6px; border: 1px solid rgba(255,255,255,.5); background: transparent; color: #fff; border-radius: 3px; cursor: pointer; font-size: 11px; line-height: 1; padding: 1px 5px; }
td.g { width: 90px; min-width: 88px; max-width: 120px; height: 34px; cursor: pointer; overflow: hidden; }
td.g.free { background: #fff; }
td.g.free:hover { background: var(--gold-soft); }
td.g .g-plus { color: var(--gold); font-weight: 700; opacity: 0; }
td.g.free:hover .g-plus { opacity: 1; }
td.g.nhs { background: #eef0f3; color: #4b5563; }
td.g.leave { background: var(--green-soft); color: var(--green); font-weight: 700; }
td.g.blocked { background: #f1ebfd; color: #6d28d9; }
td.g.pending { background: #fff; color: #6d28d9; font-style: italic; }
td.g.pp { background: #eaf0f8; cursor: default; }
td.g.pp.clash { background: var(--red-soft); }
.g-pp { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 0; font: inherit; color: var(--blue); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-pp b { color: var(--gold); }
.g-pp.un { background: var(--gold-soft); border-left: 3px solid var(--gold); padding: 1px 3px; margin-bottom: 2px; color: #6d5a29; }
.g-note { display: block; font-size: 10px; font-style: italic; color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.g-num, .g-numh { text-align: center; min-width: 48px; font-size: 11px; }
td.g-num.under { color: var(--red); font-weight: 700; }
.g-foot th { position: sticky; left: 0; background: var(--blue-soft); color: var(--blue); text-align: left; white-space: nowrap; }
.g-foot td { text-align: center; background: var(--blue-soft); font-weight: 600; }
.g-foot td.neg { color: var(--red); }
.g-foot td.g-un { text-align: left; font-weight: 400; background: #fff; }
/* Unassigned lists: first row of the grid, under the headings (build v25) */
.g-unrow th.g-name, .g-unrow td { background: #fbf3ee; border-bottom: 2px solid #a8654a; }
.g-unrow th.g-name { color: #733E24; white-space: normal; }
.g-unrow td.g-un { text-align: left; font-weight: 400; }
.g-unrow .g-unnote { color: #6b7280; text-align: center; vertical-align: middle; }
.g-uncount { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #733E24; color: #fff; font-size: 11px; text-align: center; }
@media (max-width: 760px) { .g-wrap { max-height: none; } .g-name { min-width: 110px; } }
.g-pp { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.g-pp { display: block; -webkit-line-clamp: unset; }
.g-pp .g-l { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-pp .g-l { white-space: normal; overflow: visible; text-overflow: clip; word-break: break-word; }
.g-pp .g-l:first-child { font-size: 11px; color: #4b5563; }
.g-swap { display: inline-block; background: var(--gold); color: #fff; border-radius: 3px; padding: 0 4px; font-size: 10px; font-weight: 700; }
td.g.nhs[title="NHS (swap)"] { cursor: pointer; }

/* ---------- Leave & requests options ---------- */
.req-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 760px; }
.req-opt { display: flex; align-items: center; gap: 12px; text-align: left; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: var(--radius); padding: 18px 16px; cursor: pointer; font: inherit; color: var(--blue); min-height: 84px; }
.req-opt:hover { background: var(--gold-soft); }
.req-num { background: var(--blue); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.req-ico { font-size: 22px; }
@media (max-width: 600px) { .req-options { grid-template-columns: 1fr; } }
.chip.oncall { border-left-color: var(--gold); background: #fff8e6; }
.chip.oc-empty { border: 1px dashed var(--line); background: transparent; color: var(--grey); text-align: center; }
.chip.oc-empty:hover { border-color: var(--gold); color: var(--gold); }
td.g-oc { width: 34px; text-align: center; vertical-align: middle; cursor: pointer; font-weight: 700; font-size: 11px; background: #fffdf6; }
td.g-oc.on { background: var(--gold); color: #fff; }
td.g-oc.off { color: var(--grey); cursor: default; background: #f4f5f7; }
td.g-oc:hover .g-plus { opacity: 1; }
.g-table thead th.g-och { background: var(--gold); }
.g-table thead th.we { background: #1b3a63; }
.g-foot td.g-ocf { background: var(--blue-soft); }
.g-foot td.g-ocname { text-align: left; background: #fff8e6; }
td.g.busy { background: #fff8e6; color: #6d5a29; font-weight: 600; }
td.ro, .g-pp.ro, td.g-oc.ro { cursor: default; }
td.g.free.ro:hover { background: #fff; }
tr.g-me th.g-name { background: var(--gold-soft); }

/* Pre-op alongside a list (Clare Park) */
.chip.preop { border-left-color: #0e7490; background: #e6f4f7; border-left-style: dashed; }
div.chip.preop { cursor: default; }
.g-preop { color: #0e7490; font-weight: 700; font-size: 11px; }
.preop-box { display: block; margin: 8px 0 4px; padding: 8px 10px; background: #e6f4f7; border-radius: 8px; }
.chip.preop.unassigned { background: var(--gold-soft); border-left-color: var(--gold); }

/* My rota — one box per day (like My rota.xlsx) */
.dayboxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 14px; margin: 8px 0 14px; }
.daybox { width: 100%; max-width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 2px solid #1f2937; table-layout: fixed; }
.daybox th, .daybox td { border: 0; border-right: 1px solid #9ca3af; border-bottom: 1px solid #9ca3af; padding: 5px 6px; vertical-align: top; overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.daybox tr > :last-child { border-right: 0; }
.daybox tr:last-child > * { border-bottom: 0; }
.daybox td.db-cell { border-bottom: 0; }
.daybox .db-day { text-align: center; font-weight: 700; color: var(--blue); background: #f3f5f9; border-bottom: 1px solid #1f2937; }
.daybox .db-bh { display: block; font-size: 11px; font-weight: 600; color: var(--gold); }
.daybox .db-per { text-align: center; font-weight: 600; font-size: 13px; width: 50%; }
.daybox .db-cell { min-height: 46px; height: 46px; }
.daybox .db-cell .chip { margin: 0 0 4px; width: 100%; box-sizing: border-box; }
.daybox .db-empty { color: #c0c6cf; }
.daybox .db-oc { border-top: 1px solid #1f2937; font-size: 13px; }
.daybox .db-oc-l { font-weight: 600; margin-right: 4px; }
.daybox.today { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft, #f4ecd9); }
.daybox.oncall-me .db-oc { background: #fdf3df; }
.daybox .db-me { color: var(--blue); }
@media (max-width: 600px) { .dayboxes { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.daybox .chip b, .daybox .chip .sub, .daybox .chip .who { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; word-break: break-word; }

/* Finalise rota */
.fin-status { font-size: 13px; font-weight: 600; color: #6b7280; padding: 0 6px; align-self: center; white-space: nowrap; }
.fin-status.done { color: var(--green, #1f7a3a); }
.fin-row { display: flex; gap: 8px; align-items: baseline; padding: 7px 4px; border-bottom: 1px solid #eef0f3; }
.fin-row:last-child { border-bottom: 0; }

/* Draft (not finalised) weeks */
.banner.draft { background: repeating-linear-gradient(135deg, #fff7e6, #fff7e6 10px, #fdf0d5 10px, #fdf0d5 20px); border: 1px dashed #b7791f; color: #7a4b00; }
.draft-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #7a4b00; background: #fdf0d5; border: 1px dashed #b7791f; border-radius: 4px; padding: 1px 5px; vertical-align: middle; }
.day.draft { background-image: repeating-linear-gradient(135deg, rgba(183,121,31,.05), rgba(183,121,31,.05) 8px, transparent 8px, transparent 16px); }
.daybox.draft { border-style: dashed; border-color: #b7791f; }
.daybox.draft .db-day { background: #fdf6e7; }
.fin-status.draft { color: #b7791f; }
.draft-text { color: #b7791f; font-weight: 600; }

/* Phones and tablets: 16px form text stops iPhone/iPad Safari auto-zooming when a box is tapped (build v23.2) */
@media (max-width: 760px), (pointer: coarse) { input, select, textarea { font-size: 16px; } }
/* Never let the page itself be wider than the screen; wide tables scroll inside their own box */
main, main > * { max-width: 100%; min-width: 0; }
/* Name: full on computers, short on phones */
.brand .bn { color: inherit !important; }
.brand .bn-short { display: none; }
@media (max-width: 600px) { .brand .bn-full { display: none; } .brand .bn-short { display: inline; } }


/* Email this grid → individual surgeons (build v25) */
.surg-list { border: 1px solid var(--line); border-radius: 8px; max-height: 320px; overflow: auto; margin-bottom: 12px; }
.surg-row { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.surg-row:last-child { border-bottom: 0; }
.surg-to { margin: 4px 0 0 26px; display: flex; flex-wrap: wrap; gap: 4px 16px; }

.surg-no { background: #fbf3ee; }

.fin-who { border: 1px solid var(--line); border-radius: 8px; padding: 2px 10px; margin-bottom: 8px; }
.fin-who .fin-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.fin-who .fin-row:last-child { border-bottom: 0; }

/* Settings hub (build v29) */
.set-crumb { display: flex; align-items: center; gap: 10px; margin: -4px 0 10px; }
