/* CrystalView Planner */
:root {
  --blue: #1d5a99;
  --blue-dark: #143f6c;
  --blue-light: #e8f0f9;
  --ink: #1a2330;
  --muted: #637083;
  --line: #dde4ec;
  --bg: #f3f6f9;
  --card: #ffffff;
  --red: #c0392b;
  --red-light: #fdecea;
  --green: #1e8449;
  --green-light: #e8f6ee;
  --amber: #b9770e;
  --amber-light: #fef5e7;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 40, 70, .08), 0 4px 16px rgba(20, 40, 70, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
h1 { font-size: 1.6rem; margin: 0; color: var(--blue-dark); font-weight: 700; }
h2 { font-size: 1.15rem; margin: 0 0 12px; color: var(--blue-dark); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.red { color: var(--red); }
.green { color: var(--green); }
.amber { color: var(--amber); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }

/* Top navigation */
.topnav { background: var(--blue-dark); color: #fff; position: sticky; top: 0; z-index: 30; }
.topnav .inner { display: flex; align-items: center; gap: 4px; padding: 0 16px; height: 54px; overflow-x: auto; scrollbar-width: none; }
.topnav .inner::-webkit-scrollbar { display: none; }
.brand { font-weight: 800; letter-spacing: .02em; margin-right: 14px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.brand img { width: 26px; height: 26px; border-radius: 6px; background: #fff; padding: 2px; }
.topnav a { color: #c9d9ec; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: .93rem; white-space: nowrap; }
.topnav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topnav a.active { background: rgba(255, 255, 255, .16); color: #fff; }
.topnav .spacer { flex: 1; }
.topnav .soon { opacity: .55; }

/* Page */
.page { max-width: 1400px; margin: 0 auto; padding: 22px 20px 60px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 18px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { min-width: 240px; }
.stats { display: flex; flex-wrap: wrap; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.stats > div { padding: 10px 18px; border-right: 1px solid var(--line); }
.stats > div:last-child { border-right: 0; }
.stats b { display: block; font-size: 1.1rem; }
.stats span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 18px; }

/* Buttons & inputs */
button, .btn {
  font: inherit; font-weight: 600; font-size: .9rem; border-radius: 8px; padding: 8px 14px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink); display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { border-color: #b8c6d6; background: #f8fafc; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover { background: var(--blue-dark); }
button.danger { color: var(--red); }
button.link { border: 0; background: none; color: var(--blue); padding: 4px 6px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.sm, .btn.sm { padding: 4px 10px; font-size: .82rem; cursor: pointer; }
input, select, textarea {
  font: inherit; font-size: .93rem; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); width: 100%;
}
.toolbar input, .toolbar select { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(29, 90, 153, .25); border-color: var(--blue); }
textarea { min-height: 80px; resize: vertical; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.check input { width: auto; }
.money-input { position: relative; }
.money-input::before { content: "£"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.money-input input { padding-left: 22px; }

/* Tables */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--blue); color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { background: var(--blue-dark); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f5f9fd; }
tbody tr.selected { background: var(--blue-light); }
tbody tr:last-child td { border-bottom: 0; }
td.check-col, th.check-col { width: 36px; padding-right: 0; }
td.check-col input, th.check-col input { width: 16px; height: 16px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* Tags */
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.tag.due { background: #eef2f6; color: var(--ink); }
.tag.overdue { background: var(--red-light); color: var(--red); }
.tag.today { background: var(--amber-light); color: var(--amber); }
.tag.green { background: var(--green-light); color: var(--green); }
.tag.grey { background: #eef2f6; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(15, 30, 50, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 760px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { max-width: 980px; }
.modal-head { display: flex; align-items: center; padding: 18px 22px 0; gap: 12px; }
.modal-head h2 { margin: 0; flex: 1; }
.modal-body { padding: 16px 22px; }
.modal-foot { display: flex; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); align-items: center; }
.modal-foot .grow { flex: 1; }
.close-x { border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--muted); padding: 4px 8px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 14px 22px 0; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; color: var(--muted); padding: 8px 12px; }
.tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }
.error-box { background: var(--red-light); color: var(--red); padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-weight: 600; }

/* Customer picker */
.picker { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 5; max-height: 280px; overflow-y: auto; }
.picker-list div { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.picker-list div:hover { background: var(--blue-light); }

/* Mini transaction list */
.tx-list td { padding: 7px 10px; font-size: .9rem; }
.tx-list tr { cursor: default; }
.tx-form { background: var(--bg); border-radius: 10px; padding: 14px; margin-bottom: 14px; }

/* Customer page */
.two-col { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }
.balance-big { font-size: 1.8rem; font-weight: 800; }

/* Toast */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast.error { background: var(--red); }
.toast { display: flex; align-items: center; gap: 14px; }
.toast-btn { background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; padding: 3px 10px; font-size: .85rem; }
.toast-btn:hover { background: rgba(255,255,255,.12); border-color: #fff; }

.placeholder { text-align: center; padding: 80px 20px; }
.placeholder h1 { margin-bottom: 10px; }
.more-row { text-align: center; padding: 14px; }

@media (max-width: 700px) {
  .page { padding: 16px 12px 60px; }
  .hide-sm { display: none; }
  .toolbar input[type=search] { min-width: 0; flex: 1; }
}

/* ===== Planner ===== */
.planner-head .weeknav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.planner-head .weeknav input { width: auto; }
.planner-head .actions select { width: auto; }
.selbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--blue-light); }
.planner { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(235px, 1fr); gap: 10px; overflow: auto; align-items: stretch; padding-bottom: 12px; max-height: calc(100vh - 200px); min-height: 420px; overscroll-behavior: contain; }
.planner.busy { opacity: .6; pointer-events: none; }
.day { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 8px 10px; min-height: 260px; transition: background .1s; }
.day.past { background: #fafbfc; }
.day.is-today { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.day.over { background: var(--blue-light); outline: 2px dashed var(--blue); outline-offset: -2px; }
.day.overdue-col { background: #fff8f7; border-color: #f2c4bf; }
.dhead { position: sticky; top: 0; background: inherit; z-index: 2; padding: 10px 2px 8px; margin: 0 -2px 6px; border-bottom: 1px solid var(--line); }
.dname { font-weight: 800; color: var(--blue-dark); }
.dstats { display: flex; gap: 10px; font-size: .85rem; font-weight: 600; margin-top: 2px; }
.dtools { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin-top: 4px; }
.dtools input[type=checkbox] { width: 15px; height: 15px; margin-right: 4px; }
.dnote { background: var(--amber-light); color: #7d5208; border-radius: 6px; padding: 5px 8px; font-size: .85rem; margin-top: 6px; cursor: pointer; white-space: pre-wrap; }
.rgroup { margin-bottom: 8px; }
.rhead { display: flex; align-items: center; gap: 6px; background: #eef3f8; border-left: 5px solid; border-radius: 6px; padding: 5px 8px; cursor: grab; font-size: .88rem; }
.rhead input { width: 15px; height: 15px; flex: none; }
.rname { font-weight: 700; flex: 1; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmeta { font-size: .8rem; color: var(--muted); white-space: nowrap; font-weight: 600; }
.jcard { display: flex; gap: 6px; align-items: flex-start; padding: 6px 6px; margin: 4px 0 0 4px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: grab; font-size: .86rem; }
.jcard:hover { border-color: #b8c6d6; background: #f8fafc; }
.jcard.late { background: #fdf0ee; border-color: #f2c4bf; }
.jcard.sel { background: var(--blue-light); border-color: var(--blue); }
.jcard input { width: 15px; height: 15px; margin-top: 2px; flex: none; }
.jbody { flex: 1; min-width: 0; }
.jtop { display: flex; justify-content: space-between; gap: 6px; }
.jtop b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jsub { color: var(--muted); font-size: .78rem; }
.projected { margin-top: 8px; border-top: 1px dashed var(--line); }
.pgroup { display: flex; justify-content: space-between; gap: 6px; font-size: .8rem; color: var(--muted); border-left: 4px solid; padding: 3px 8px; margin: 3px 0 0; background: #f7f9fb; border-radius: 4px; opacity: .85; }
.drag-ghost { display: none; position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; background: var(--blue-dark); color: #fff; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: .85rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); white-space: nowrap; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }

/* ===== Worksheets ===== */
.ws-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ws-tabs a { text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; display: flex; flex-direction: column; }
.ws-tabs a span { font-size: .8rem; color: var(--muted); }
.ws-tabs a.on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); background: var(--blue-light); }
.ws-card { padding: 18px; }
.ws-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.ws-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.ws-table tbody tr { cursor: default; }
.ws-row.done { background: #f1faf4; }
.ws-row.skipped { background: #fdf8ee; }
.seg-out { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-out button { border: 0; border-radius: 0; padding: 6px 12px; }
.seg-out button + button { border-left: 1px solid var(--line); }
.seg-out button.on.done { background: var(--green); color: #fff; }
.seg-out button.on.skipped { background: var(--amber); color: #fff; }
.sm-select { width: auto; padding: 4px 6px; font-size: .85rem; margin-left: 6px; }

@media print {
  .topnav, .page-head, .ws-tabs, .ws-head .actions, .hide-print, .toasts, h2 + .table-wrap, label.field, .stats { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .card, .table-wrap { box-shadow: none; border: 0; }
  th { background: #eee !important; color: #000; position: static; }
  input, select { border: 0; padding: 0; }
  .seg-out button:not(.on) { display: none; }
}

/* ===== Texts ===== */
.test-banner { background: var(--amber-light); color: #7d5208; border: 1px solid #f0d6a6; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: .92rem; }
.who-list { max-height: 160px; overflow-y: auto; background: var(--bg); border-radius: 8px; padding: 8px 12px; font-size: .88rem; margin-bottom: 10px; }
.sms-edit { display: grid; grid-template-columns: 1fr 130px; gap: 12px; }
@media (max-width: 600px) { .sms-edit { grid-template-columns: 1fr; } }
.placeholders { display: flex; flex-direction: column; align-items: flex-start; max-height: 220px; overflow-y: auto; }
.placeholders button { padding: 2px 4px; }
.sms-bubble { background: #e9f3ff; border-radius: 14px 14px 14px 4px; padding: 10px 14px; white-space: pre-wrap; font-size: .92rem; max-width: 420px; }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
@media (max-width: 600px) { .mode-pick { grid-template-columns: 1fr; } }
.mode-pick label { border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; }
.mode-pick label input { width: auto; grid-row: span 2; margin-top: 3px; }
.mode-pick label span { font-size: .85rem; color: var(--muted); }
.mode-pick label.on { border-color: var(--blue); background: var(--blue-light); }
.mode-pick label.on.live { border-color: var(--green); background: var(--green-light); }

/* ===== Reports ===== */
.chart-card { margin-bottom: 16px; }
.chart-head { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--muted); }
.legend i, .tip i, .split-name i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-wrap .grid { stroke: #e7ecf1; stroke-width: 1; }
.chart-wrap .axis { fill: var(--muted); font-size: 11px; }
.chart-wrap .cross { stroke: #9aa3ad; stroke-width: 1; stroke-dasharray: 3 3; }
.tip { position: absolute; top: 4px; transform: translateX(8px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 12px; font-size: .85rem; min-width: 190px; pointer-events: none; }
.tip div { display: flex; align-items: center; gap: 4px; }
.tip div span { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.tip-total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; font-weight: 700; }
.report-splits { gap: 16px; }
.split-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr auto 40px; gap: 10px; align-items: center; margin: 6px 0; font-size: .9rem; }
.split-bar { background: #eef2f6; border-radius: 4px; height: 10px; overflow: hidden; }
.split-bar span { display: block; height: 100%; border-radius: 4px; }
.report-table td, .report-table th { font-size: .85rem; padding: 7px 10px; }
.total-row td { font-weight: 800; background: #f5f8fb; border-top: 2px solid var(--line); }

/* ===== Import ===== */
.imp-group { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 6px; }
.imp-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; }
.imp-map small { display: block; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-warn { background: var(--amber-light); border-radius: 8px; padding: 8px 12px; font-size: .85rem; max-height: 220px; overflow-y: auto; }
.imp-warn summary { cursor: pointer; font-weight: 700; color: #7d5208; }
.planner.compact { grid-auto-columns: minmax(205px, 1fr); }
.day.week-start { box-shadow: -6px 0 0 -2px var(--blue-light); }
.day.week-start .dname::before { content: "Week of "; font-weight: 600; color: var(--muted); font-size: .8rem; display: block; }
.planner-head .weeknav select { width: auto; }

/* ===== Planner: weeks as rows ===== */
.planner-rows { display: block; }
.planner-rows.with-overdue { display: grid; grid-template-columns: 215px minmax(0, 1fr); gap: 12px; align-items: start; }
.planner-rows.busy { opacity: .6; pointer-events: none; }
.overdue-panel { position: sticky; top: 64px; max-height: calc(100vh - 76px); overflow-y: auto; }
.overdue-panel .day { min-height: 0; }
@media (max-width: 900px) { .planner-rows.with-overdue { grid-template-columns: 1fr; } .overdue-panel { position: static; max-height: 320px; } }
.week { margin-bottom: 16px; }
.week-head { display: flex; gap: 14px; align-items: baseline; font-size: .9rem; margin: 0 2px 6px; font-weight: 600; }
.week-head b { color: var(--blue-dark); font-size: 1rem; }
.week-grid { display: grid; gap: 8px; overflow-x: auto; }
.planner-rows .day { min-height: 120px; padding: 0 6px 8px; }
.planner-rows .dhead { position: static; padding: 8px 2px 6px; margin-bottom: 4px; }
.planner-rows .dname { font-size: .92rem; }
.planner-rows .dstats { gap: 8px; font-size: .8rem; flex-wrap: wrap; }
.day.outside { background: transparent; border-style: dashed; opacity: .45; min-height: 60px; }
.day.outside .dname { padding: 8px 2px; color: var(--muted); font-weight: 600; }
.planner-rows .jcard { margin-left: 0; }
.planner-rows .rhead { padding: 4px 6px; font-size: .82rem; }
.plabel { margin: 4px 2px; }

/* Zoom */
.zoom { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.zoom button { border: 0; border-radius: 0; padding: 6px 11px; font-size: .85rem; }
.zoom button + button { border-left: 1px solid var(--line); }
.zoom button.on { background: var(--blue); color: #fff; }
.zoom-compact .jsub { display: none; }
.zoom-compact .jcard { padding: 3px 5px; margin-top: 2px; font-size: .8rem; }
.zoom-compact .jcard input { margin-top: 0; }
.zoom-compact .day { min-height: 90px; }
.zoom-overview .day { min-height: 70px; }
.zoom-overview .rgroup { margin-bottom: 4px; }
.zoom-overview .dtools { display: none; }
.zoom-overview .projected { display: none; }
/* Narrow day columns: wrap rather than cut off */
.planner-rows .jtop b { white-space: normal; overflow: visible; line-height: 1.25; }
.planner-rows .jtop { align-items: flex-start; }
.planner-rows .rhead { flex-wrap: wrap; row-gap: 0; }
.planner-rows .rname { flex: 1 1 70px; min-width: 0; white-space: normal; line-height: 1.2; }
.planner-rows .rmeta { flex: 1 0 100%; padding-left: 21px; font-size: .75rem; }
.zoom-compact .jtop b { white-space: nowrap; overflow: hidden; }
/* Days always share the width: no sideways scrolling */
.week-grid { overflow: visible; gap: 6px; }
.planner-rows .jtop { flex-wrap: wrap; column-gap: 4px; }
.planner-rows .jtop .mono { margin-left: auto; }
@media (max-width: 1180px) {
  .planner-rows.with-overdue { grid-template-columns: 1fr; }
  .overdue-panel { position: static; max-height: 260px; }
  .overdue-panel .day { column-width: 200px; column-gap: 10px; }
  .overdue-panel .dhead { column-span: all; }
  .overdue-panel .rgroup { break-inside: avoid; }
}

/* ===== Planner: denser, CleanerPlanner-style cards ===== */
.planner-rows .day { padding: 0 4px 6px; }
.planner-rows .dhead { padding: 6px 2px 4px; margin-bottom: 3px; }
.planner-rows .dname { font-size: .85rem; }
.planner-rows .dstats { font-size: .74rem; gap: 6px; }
.planner-rows .dtools { margin-top: 2px; }
.planner-rows .dtools .link { padding: 1px 4px; font-size: .74rem; }

/* Round header: solid bar in the round's colour, white text */
.planner-rows .rhead {
  background: var(--rc); border-left: 0; color: #fff; border-radius: 4px; padding: 3px 6px;
  font-size: .76rem; flex-wrap: nowrap; gap: 5px; margin-top: 4px;
}
.planner-rows .rhead input { width: 13px; height: 13px; accent-color: #fff; }
.planner-rows .rname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; line-height: 1.3; }
.planner-rows .rmeta { flex: none; padding-left: 0; color: #fff; opacity: .9; font-size: .72rem; }

/* Job: one tight block, tinted with its round colour */
.planner-rows .jcard {
  background: color-mix(in srgb, var(--rc) 13%, #fff); border: 0; border-radius: 3px;
  padding: 3px 5px; margin: 2px 0 0; gap: 4px; font-size: .74rem; line-height: 1.25;
}
.planner-rows .jcard:hover { background: color-mix(in srgb, var(--rc) 24%, #fff); }
.planner-rows .jcard.sel { background: var(--blue-light); outline: 2px solid var(--blue); outline-offset: -2px; }
.planner-rows .jcard.late { background: #fbe3df; }
.planner-rows .jcard input { width: 12px; height: 12px; margin-top: 1px; }
.planner-rows .jtop { flex-wrap: nowrap; }
.planner-rows .jtop b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; color: var(--ink); min-width: 0; }
.planner-rows .jtop .mono { flex: none; font-weight: 600; }
.planner-rows .jsub { font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #4d5a6a; }
.planner-rows .pgroup { font-size: .72rem; padding: 2px 6px; }
.overdue-panel .dname { font-size: .85rem; }
.zoom-compact .jcard { padding: 2px 5px; }
.zoom-overview .rhead { margin-top: 3px; }
.stat-btn { border: 0; border-right: 1px solid var(--line); border-radius: 0; background: none; padding: 10px 18px; display: block; text-align: left; font-weight: 400; }
.stat-btn:hover { background: var(--red-light); }
.stat-btn b { display: block; font-size: 1.1rem; }
.stat-btn span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.planner-rows.with-overdue { grid-template-columns: 200px minmax(0, 1fr); }
.week-grid { gap: 5px; }
.planner-rows .day { padding: 0 3px 5px; }

/* The planner uses the full screen width (like CleanerPlanner) */
.page.wide { max-width: none; padding-left: 14px; padding-right: 14px; }

/* ===== Slips (3 per A4) ===== */
.slips-overlay { position: fixed; inset: 0; z-index: 150; background: #6b7785; overflow-y: auto; }
.slips-bar { position: sticky; top: 0; z-index: 2; display: flex; gap: 10px; align-items: center; background: #fff; padding: 10px 16px; box-shadow: var(--shadow); flex-wrap: wrap; }
.slips-bar .grow { flex: 1; }
.slips-print { padding: 20px 0 40px; }
.slip-page { width: 210mm; height: 297mm; margin: 0 auto 20px; background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.3); overflow: hidden; color: #111; }
.slip { height: 99mm; box-sizing: border-box; padding: 9mm 11mm 6mm; display: grid; grid-template-columns: 44mm 1fr 52mm; gap: 7mm;
  font-family: Helvetica, Arial, sans-serif; font-size: 9.5pt; line-height: 1.3; border-bottom: 1px dashed #c8c8c8; overflow: hidden; }
.slip:last-child { border-bottom: 0; }
.slip .gap { height: 2.6mm; }
.slip-logo { max-width: 42mm; max-height: 24mm; width: auto; height: auto; display: block; margin-bottom: 4mm; }
.slip-contact { margin-bottom: 4mm; }
.slip-heading { font-size: 14pt; line-height: 1.15; margin-bottom: 3mm; }
.slip-right { font-size: 10pt; }

@media print {
  @page { size: A4 portrait; margin: 0; }
  body.printing-slips { background: #fff; }
  body.printing-slips > *:not(#slips-root) { display: none !important; }
  body.printing-slips .slips-overlay { position: static; overflow: visible; background: #fff; }
  body.printing-slips .slips-bar { display: none; }
  body.printing-slips .slips-print { padding: 0; }
  body.printing-slips .slip-page { margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
  body.printing-slips .slip-page:last-child { break-after: auto; page-break-after: auto; }
}

.dtime { font-weight: 800; color: var(--blue-dark); background: var(--blue-light); border-radius: 4px; padding: 0 5px; white-space: nowrap; }

/* ===== Round order window ===== */
.ro-list { max-height: 62vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; position: relative; overscroll-behavior: contain; }
.ro-row { display: grid; grid-template-columns: 22px 28px 54px 1fr auto 70px 56px; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); background: #fff; }
.ro-row:last-child { border-bottom: 0; }
.ro-row { position: relative; }
.ro-row.dragging { background: var(--blue-light); box-shadow: 0 8px 22px rgba(20,63,108,.28); z-index: 2; border-radius: 6px; }
.ro-row.just-moved { animation: ro-flash 0.9s ease; }
@keyframes ro-flash { from { background: #fff4c2; } to { background: #fff; } }
.ro-handle { cursor: grab; font-size: 1.3rem; color: var(--muted); text-align: center; touch-action: none; user-select: none; padding: 8px 0; margin: -8px 0; }
.ro-handle:hover { color: var(--blue); }
body.no-select, body.no-select * { user-select: none !important; -webkit-user-select: none !important; cursor: grabbing !important; }
.ro-row.dragging .ro-handle { cursor: grabbing; color: var(--blue); }
.ro-pos { width: 54px; padding: 4px 6px; text-align: center; }
.ro-addr { min-width: 0; }
.ro-addr b { white-space: nowrap; }
.ro-due { color: var(--muted); white-space: nowrap; }
.ro-price { text-align: right; }
.ro-btns { white-space: nowrap; }
@media (max-width: 640px) { .ro-row { grid-template-columns: 22px 28px 48px 1fr 56px; } .ro-due, .ro-price { display: none; } }
.ro-tick { width: 18px; height: 18px; margin: 0; }
.ro-row.picked { background: #f2f7fd; }
.ro-selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: #eef5fd; border: 1px solid #b9d3ef; border-radius: 8px; padding: 7px 10px; margin-bottom: 8px; }

/* ===== Day map ===== */
.map-overlay { position: fixed; inset: 0; z-index: 150; background: #fff; display: flex; flex-direction: column; }
.map-bar { display: flex; gap: 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.map-bar .grow { flex: 1; }
.map-legend { display: inline-flex; gap: 6px; align-items: center; font-size: .82rem; color: var(--muted); }
.map-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-left: 6px; }
.map-body { flex: 1; display: grid; grid-template-columns: 300px 1fr; min-height: 0; }
.map-list { overflow-y: auto; border-right: 1px solid var(--line); background: var(--bg); }
.map-canvas { min-height: 0; }
.map-item { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: #fff; padding: 7px 10px; font-weight: 600; font-size: .86rem; }
.map-item .grow { flex: 1; min-width: 0; }
.map-item.sel { background: var(--blue-light); }
.map-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #98a4b3; color: #fff; font-size: .75rem; font-weight: 800; display: grid; place-items: center; }
.map-unplaced { background: var(--amber-light); padding: 8px 0 0; border-bottom: 2px solid #f0d6a6; }
.map-unplaced > b, .map-unplaced > .small { padding: 0 10px; display: block; }
.map-hint { background: var(--blue); color: #fff; padding: 10px; font-size: .9rem; }
.map-hint .link { color: #fff; text-decoration: underline; }
.map-pin { width: 28px; height: 28px; border-radius: 50%; color: #fff; font: 800 12px/28px system-ui, sans-serif; text-align: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.map-pin.sel { transform: scale(1.3); box-shadow: 0 0 0 3px rgba(29,90,153,.5), 0 1px 4px rgba(0,0,0,.45); }
@media (max-width: 760px) { .map-body { grid-template-columns: 1fr; grid-template-rows: 40% 60%; } }

/* ===== Tracking & Day report ===== */
.track-status { padding: 10px 14px; border-radius: 10px; background: #eef2f6; color: var(--muted); }
.track-status.on { background: var(--green-light); color: var(--green); }
.track-url { display: flex; gap: 8px; }
.track-url input { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }
.steps-list { padding-left: 20px; line-height: 1.6; }
.steps-list ul { margin: 4px 0 8px; padding-left: 18px; }
tr.other-stop td { background: #f6f7f9; color: var(--muted); }

.weeknav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.weeknav input, .weeknav select { width: auto; }

/* ===== Live map ===== */
.live-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 14px; height: calc(100vh - 54px - 44px); min-height: 480px; }
.live-side { overflow-y: auto; }
.live-map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); min-height: 420px; }
.live-status { background: #eef2f6; border-radius: 10px; padding: 12px 14px; line-height: 1.6; }
.live-status.on { background: var(--green-light); }
.live-status.on > b { color: var(--green); }
.live-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.live-stats > div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.live-stats b { display: block; font-size: 1.1rem; }
.live-stats span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.live-legend { display: flex; gap: 12px; margin-top: 8px; }
.live-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.van { position: relative; width: 56px; height: 35px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.van.stale svg { opacity: .6; filter: grayscale(.6); }
.van svg { position: relative; z-index: 1; }
.van-pulse { position: absolute; left: 50%; top: 60%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: rgba(42,120,214,.45); animation: vanpulse 2s ease-out infinite; }
@keyframes vanpulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(4); opacity: 0; } }
@media (max-width: 860px) { .live-wrap { grid-template-columns: 1fr; height: auto; } .live-map { height: 60vh; } }

/* ===== Invoices ===== */
.inv-send { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.inv-send input { flex: 1; min-width: 200px; }
.inv-preview { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 8px; background: #f3f3f3; }

.repeat-toggle { display: flex; gap: 8px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 8px; margin-bottom: 10px; font-weight: 500; }
.repeat-toggle.on { border-color: var(--amber); background: var(--amber-light); }

.new-cust { border: 1px solid var(--blue); background: var(--blue-light); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.new-cust-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* ===== Dashboard ===== */
.dash-h { margin: 22px 0 10px; font-size: 1.05rem; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.dash-tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.dash-tile.accent { border-color: #b9d3ef; background: linear-gradient(180deg, #f5f9fe, #fff); }
.dash-tile > span { display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.dash-tile > b { display: block; font-size: 1.6rem; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.dash-sub { font-size: .85rem; color: var(--muted); }
.delta { font-weight: 700; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.delta.flat { color: var(--muted); }
.dash-bar { height: 8px; background: #eef2f6; border-radius: 4px; overflow: hidden; margin: 6px 0; }
.dash-bar div { height: 100%; background: var(--blue); border-radius: 4px; }

/* Expenses & vehicles */
.inline-add { display: flex; gap: 6px; align-items: center; }
.inline-add input { flex: 1; min-width: 0; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 2px; background: #eef2f6; border-radius: 999px; padding: 3px 4px 3px 11px; font-size: .88rem; }
.chip button { padding: 0 6px; font-size: 1rem; line-height: 1; }
details.card > summary { cursor: pointer; }
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.vehicle { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer; }
.vehicle:hover { border-color: #b9d3ef; }
.vehicle-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.vehicle-head .reg { font-family: ui-monospace, Menlo, monospace; background: #ffd500; color: #111; border-radius: 4px; padding: 1px 6px; font-weight: 700; font-size: .85rem; }
.vehicle-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-top: 1px dashed var(--line); font-size: .92rem; }
.vehicle.add { display: flex; align-items: center; justify-content: center; color: var(--muted); border-style: dashed; min-height: 96px; box-shadow: none; }
.exp-cats { margin-top: 6px; }
.exp-cats .split-row { font-size: .88rem; }

/* Menu: on bigger screens wrap onto a second line instead of hiding items off the right edge */
@media (min-width: 701px) {
  .topnav .inner { flex-wrap: wrap; height: auto; min-height: 54px; padding: 6px 16px; overflow: visible; }
}
.row-actions { white-space: nowrap; text-align: right; }
.row-actions button { padding: 4px 8px; }
.bulk-bar { display: flex; align-items: center; gap: 10px; background: #fff4e5; border: 1px solid #f3cf9a; border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; }

/* GoCardless payouts */
tr.gc-open > td { background: #f7f9fb; }
.gc-detail { border-left: 3px solid var(--blue); margin: 0 0 6px; }
.gc-detail table { width: 100%; }
.gc-detail th { background: #eef2f6; color: var(--ink, #222); }
tr.gc-done td { color: var(--muted); }
tr.gc-done td b { font-weight: 600; }
.gc-summary { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 8px 12px; }
.gc-summary .grow { flex: 1; }
.gc-links { display: flex; gap: 4px; margin-top: 2px; }
.gc-links button { padding: 0 4px; }
.gc-actions { white-space: nowrap; }
.gc-actions .small.amber { white-space: normal; }
tr.gc-other td { color: var(--muted); background: #fafbfc; }
.gc-picker { min-width: 260px; }
.gc-results { border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; background: #fff; max-height: 260px; overflow: auto; }
.gc-results:empty { display: none; }
.gc-result { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 6px 8px; border-radius: 0; font-weight: 400; }
.gc-result:hover { background: var(--blue-light); }

/* Xero page */
.tabs-row { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 12px; }
.tabs-row .tab { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; color: var(--muted); padding: 8px 14px; font-weight: 700; }
.tabs-row .tab.on { color: var(--blue); border-bottom-color: var(--blue); }
.tabs-row .count { font-weight: 500; font-size: .8rem; background: #eef2f6; border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.tabs-row .grow { flex: 1; }

/* Log in / sign up pages (the product) */
.auth-body { background: linear-gradient(180deg, #143f6c 0, #1d5a99 320px, var(--bg, #f3f6f9) 320px); min-height: 100vh; }
.auth-wrap { max-width: 440px; margin: 0 auto; padding: 40px 16px; }
.auth-wrap:has(.wide) { max-width: 640px; }
.auth-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.25rem; margin-bottom: 18px; }
.auth-brand img { width: 34px; height: 34px; border-radius: 8px; }
.beta { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: #ffd500; color: #3a3000; border-radius: 999px; padding: 2px 8px; }
.auth-card { background: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(10, 30, 60, .18); padding: 26px 24px; }
.auth-card h1 { margin-top: 0; font-size: 1.4rem; }
.auth-go { width: 100%; padding: 12px; font-size: 1rem; margin-top: 6px; }
.auth-ok { background: #e9f7ef; border: 1px solid #b5e0c4; color: #1e6b3a; border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Logo (Settings → Business details) and the name shown on slips without a logo */
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0; }
.logo-preview { max-height: 70px; max-width: 260px; background: repeating-conic-gradient(#eef1f4 0 25%, #fff 0 50%) 0 0 / 14px 14px; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.logo-none { color: var(--muted); font-size: .9rem; border: 1px dashed var(--line); border-radius: 6px; padding: 10px 14px; }
.slip-name { font-weight: 800; font-size: 15pt; line-height: 1.1; margin-bottom: 6px; }
.toolbar .grow { flex: 1; }

/* Admin: one card per business */
.biz { margin-bottom: 12px; }
.biz-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.biz-actions { text-align: right; }
.biz-nums { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 12px 0 8px; }
.biz-nums div { background: #f6f8fb; border-radius: 8px; padding: 6px 8px; }
.biz-nums b { display: block; font-size: 1.15rem; }
.biz-nums span { font-size: .75rem; color: var(--muted); }
.biz-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chk { font-size: .8rem; border-radius: 999px; padding: 2px 9px; background: #f1f3f6; color: var(--muted); }
.chk.on { background: #e9f7ef; color: #1e6b3a; }
.biz-foot { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 6px; display: flex; gap: 8px; }
@media (max-width: 700px) { .biz-nums { grid-template-columns: repeat(3, 1fr); } }
/* Support banners in the app */
.support-banner { background: #ffd500; color: #2a2400; padding: 8px 16px; font-weight: 600; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.support-banner.mine { background: #e8f0f9; color: var(--blue-dark, #143f6c); font-weight: 500; }
.support-banner button { margin-left: auto; }
.import-progress { height: 12px; background: #eef2f6; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.import-progress div { height: 100%; background: var(--blue); transition: width .3s; }
.cp-review { max-height: 460px; overflow-y: auto; }
.cp-review thead th { position: sticky; top: 0; z-index: 1; }

/* ===== Planner on tablets and phones ===== */
/* Our own small square tick-boxes: iPhone/iPad draw native ones large and round, whatever size is set. */
.planner-rows input[type=checkbox] {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin: 1px 0 0; flex: none;
  border: 1.5px solid #7d8b9c; border-radius: 3px; background: #fff; display: inline-grid; place-content: center; cursor: pointer;
}
.planner-rows input[type=checkbox]:checked { background: var(--blue); border-color: var(--blue); }
.planner-rows input[type=checkbox]:checked::after { content: ""; width: 7px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.planner-rows .rhead input[type=checkbox] { border-color: rgba(255, 255, 255, .85); background: transparent; }
.planner-rows .rhead input[type=checkbox]:checked { background: #fff; }
.planner-rows .rhead input[type=checkbox]:checked::after { border-color: var(--blue-dark, #143f6c); }
/* Overview: the round's count · value · time goes on its own line instead of overflowing. */
.zoom-overview .rhead { flex-wrap: wrap; row-gap: 1px; }
.zoom-overview .rmeta { flex: 1 0 100%; padding-left: 19px; white-space: normal; }

/* Below desktop width: each day keeps a readable width and the week swipes sideways (one row per week). */
@media (max-width: 1099px) {
  .week-grid {
    grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr);
    overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; padding-bottom: 8px; overscroll-behavior-x: contain;
  }
  .week-grid > .day { scroll-snap-align: start; }
  .planner-rows .jcard { font-size: .82rem; padding: 4px 6px; }
  .planner-rows .jtop b { white-space: normal; overflow: visible; }
  .planner-rows .jsub { font-size: .74rem; }
  .planner-rows .rhead { font-size: .8rem; padding: 4px 6px; }
  .planner-rows .rname { white-space: normal; }
  .planner-rows.with-overdue { grid-template-columns: 1fr; }
}
@media (max-width: 600px) { .week-grid { grid-auto-columns: minmax(78vw, 1fr); } }
/* Fingers: bigger tick-boxes and tap areas. */
@media (pointer: coarse) {
  .planner-rows input[type=checkbox] { width: 20px; height: 20px; border-radius: 4px; }
  .planner-rows input[type=checkbox]:checked::after { width: 10px; height: 5px; }
  .planner-rows .jcard { padding: 6px 7px; gap: 7px; }
  .planner-rows .dtools .link { padding: 6px 8px; font-size: .85rem; }
}

/* Menu on tablets and phones: one slim bar (business · this page · Menu); the pages open as a grid of big buttons. */
.nav-menu, .nav-here { display: none; }
@media (max-width: 1099px) {
  .topnav .inner { flex-wrap: wrap; height: auto; min-height: 52px; padding: 6px 12px; overflow: visible; gap: 6px; }
  .topnav .brand { margin-right: 4px; font-size: .95rem; max-width: 45vw; overflow: hidden; text-overflow: ellipsis; }
  .nav-here { display: block; color: #c9d9ec; font-weight: 600; font-size: .9rem; white-space: nowrap; }
  .nav-menu { display: block; margin-left: auto; background: rgba(255, 255, 255, .14); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 700; font-size: .95rem; }
  .topnav .inner > a, .topnav .inner > .spacer { display: none; }
  .topnav.open .inner > a { display: block; flex: 1 1 calc(33.33% - 6px); text-align: center; padding: 12px 6px; background: rgba(255, 255, 255, .07); font-size: 1rem; }
  .topnav.open .inner > a.active { background: rgba(255, 255, 255, .22); }
}
@media (max-width: 520px) { .topnav.open .inner > a { flex-basis: calc(50% - 6px); } .nav-here { display: none; } }
.newstar { color: #e0a100; margin-right: 3px; font-size: 1.05em; }
/* Press-and-hold dragging on touch screens: no text selection or iOS pop-up on a long press. */
.planner-rows .jcard, .planner-rows .rhead { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.planner-rows .jcard.lifted, .planner-rows .rhead.lifted { outline: 2px solid var(--blue); outline-offset: -1px; opacity: .55; }
body.dragging .week-grid { scroll-snap-type: none; }  /* let the week scroll sideways under a drag */
/* Pinch-to-zoom on the planner: the planner handles two-finger pinches itself (day width), the page doesn't zoom. */
.planner-rows { touch-action: pan-x pan-y; }
.planner-rows.custom-w .week-grid {
  grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: minmax(var(--colw, 230px), 1fr);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.planner-rows.custom-w .week-grid > .day { min-width: 0; }
.pay-tip { display: flex; gap: 6px; margin-top: 4px; } .pay-tip label { display: flex; flex-direction: column; gap: 1px; }
