/* Owner admin and platform admin. Plain, phone-first. */
:root { --bg: #F5F6F8; --card: #FFFFFF; --ink: #12161C; --muted: #566070; --line: #D8DDE5; --ctl: #8490A2; --brand: #1456D8; --ok: #0B6B45; --warn: #8A5A00; --bad: #B42318; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; overflow-wrap: break-word; }
/* Names, addresses and notes can hold one very long word: wrap it instead of widening the page. */
.top b, h1, h2, h3, .job a, .job p, .card > p, .row > a, .row > span, .row > h3, .flash, code { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.row > *, .card > * { min-width: 0; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }

.top { background: #12161C; color: #FFFFFF; }
.top .in { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.top b { font-size: 17px; }
.top a { color: #FFFFFF; }
/* Links that get tapped on a phone (call, map, view page) are as tall as a button. */
.top .row > a, .card .row > a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }
.top .btn.link { color: #FFFFFF; text-decoration: underline; }
.top :focus-visible { outline-color: #FFFFFF; }
.banner { background: #FFF4D6; color: #5C3D00; border-bottom: 1px solid #E7C873; }
.banner .in { max-width: 1040px; margin: 0 auto; padding: 8px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; font-weight: 600; }
nav.tabs { background: #FFFFFF; border-bottom: 1px solid var(--line); overflow-x: auto; }
nav.tabs .in { max-width: 1040px; margin: 0 auto; padding: 0 8px; display: flex; gap: 4px; }
nav.tabs a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 12px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap; }
nav.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }

main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 64px; display: flex; flex-direction: column; gap: 20px; }
h1 { margin: 0; font-size: 24px; line-height: 1.2; }
h2 { margin: 0; font-size: 18px; line-height: 1.3; }
h3 { margin: 0; font-size: 17px; line-height: 1.3; }
p { margin: 0; }
.card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.strong { font-weight: 700; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--ctl); border-radius: 8px; background: #FFFFFF; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { border-color: var(--brand); background: var(--brand); color: #FFFFFF; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.link { min-height: 44px; padding: 0; border: 0; background: none; color: var(--brand); }
.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.f input, .f select, .f textarea { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--ctl); border-radius: 8px; background: #FFFFFF; color: var(--ink); font: inherit; font-weight: 400; }
.f textarea { min-height: 96px; }
.f .help { font-weight: 400; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.check input { width: 20px; height: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.actions .f { flex: 1 1 150px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 12px; }
.tile { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #FFFFFF; }
.tile .n { font-size: 26px; font-weight: 700; line-height: 1.15; }
.tile .l { font-size: 14px; color: var(--muted); }

.badge { display: inline-flex; align-items: center; padding: 2px 10px; border: 1px solid; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge.confirmed { border-color: #0B4FA8; background: #EAF2FD; color: #0B4FA8; }
.badge.done { border-color: var(--ok); background: #E7F6EE; color: var(--ok); }
.badge.pending { border-color: var(--warn); background: #FFF4D6; color: var(--warn); }
.badge.cancelled, .badge.no_show { border-color: var(--bad); background: #FDECEA; color: var(--bad); }
.badge.sent { border-color: var(--ok); background: #E7F6EE; color: var(--ok); }
.badge.failed { border-color: var(--bad); background: #FDECEA; color: var(--bad); }
.badge.skipped, .badge.tag { border-color: var(--ctl); background: #F1F3F6; color: #3D4654; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 13px; color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll { overflow-x: auto; }
tfoot td { font-weight: 700; border-bottom: 0; }

.flash { padding: 12px 14px; border: 1px solid; border-radius: 8px; font-weight: 600; }
.flash.ok { border-color: #9AD3B6; background: #E7F6EE; color: var(--ok); }
.flash.err { border-color: #F0A8A0; background: #FDECEA; color: var(--bad); }
.job { gap: 10px; }
.job .when { font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.job .money { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.days a { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #FFFFFF; color: var(--ink); font-size: 13px; text-decoration: none; }
.days a b { font-size: 17px; }
.days a[aria-current="date"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.login { max-width: 420px; margin: 40px auto; padding: 0 16px; }
code { padding: 1px 6px; border-radius: 6px; background: #EEF0F4; font-size: 14px; }
td code { white-space: nowrap; } /* inside a table the table scrolls sideways instead */

/* Settings: days of the week the shop is closed */
.days { border: 1px solid var(--line, #d9dce1); border-radius: 10px; padding: 8px 14px 4px; margin: 0 0 14px; min-width: 0; }
.days legend { font-weight: 700; padding: 0 6px; }
.days .check { display: inline-flex; margin-right: 18px; }

/* Reschedule: the fold-out is easy to tap, and its two boxes get the full width on a phone */
details > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--brand); }
details > summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
details .actions .f { flex: 1 1 200px; }

/* 1.5: customer pages for paying, cancelling, privacy and terms */
.nowrap { white-space: nowrap; }
.legal-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.legal h2 { margin-top: 1.4rem; font-size: 1.1rem; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin: .3rem 0; }
.tips { border: 1px solid var(--line, #d9dce1); border-radius: 10px; padding: 8px 14px; margin: 14px 0; min-width: 0; }
.tips legend { font-weight: 700; padding: 0 6px; }
.tips .check { display: flex; min-height: 44px; align-items: center; }
table.sums { width: 100%; margin: 10px 0; }
table.sums td { padding: 6px 0; }
details.cancel { margin-top: 14px; }

.rate-group { margin: 1.25rem 0; padding: .75rem 1rem; border: 1px solid #cbd5e1; border-radius: .5rem; min-width: 0; }
.rate-group legend { font-weight: 700; padding: 0 .35rem; }
.rate-row { display: grid; grid-template-columns: minmax(9rem, 1.5fr) repeat(2, minmax(0, 1fr)); gap: .75rem; align-items: center; padding: .6rem 0; }
.rate-row + .rate-row { border-top: 1px solid #dfe4eb; }
.rate-row .f { margin: 0; min-width: 0; }
@media (max-width: 540px) {
  .rate-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rate-row > strong { grid-column: 1 / -1; }
}

.settings-nav summary,.tabs a[aria-current="page"]{font-weight:750}.settings-nav .menu,.settings-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(160px,100%),1fr));gap:6px}
.settings-nav a,.settings-list a{display:flex;align-items:center;min-height:44px;padding:7px 10px}
.settings-nav [aria-current=page]{font-weight:750;color:var(--ink)}.settings-nav{margin-block:8px}
[data-example]{white-space:pre-wrap;overflow-wrap:anywhere}[data-warning]{color:#922717}
@media(max-width:600px){nav.tabs{overflow:visible}nav.tabs .in{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;padding:0}
nav.tabs a{justify-content:center;padding:2px;font-size:13px;min-width:0;min-height:44px;white-space:normal;text-align:center}
.f,.card,form,fieldset,main,.grid2>*{min-width:0}main{overflow-wrap:anywhere}input,select,textarea{max-width:100%}
main a,.top a,.banner a{min-height:44px;display:inline-flex;align-items:center}.check{min-height:44px}
.settings-nav summary{white-space:normal}.card details{margin-bottom:8px}code{overflow-wrap:anywhere}}
.manual-choices{margin:12px 0}.manual-choices label{display:inline-flex;align-items:center;gap:7px;min-height:44px;margin-right:12px;max-width:100%}.manual-choices label span{min-width:0;overflow-wrap:anywhere}

/* Table actions retain their physical touch area even when adjacent cells wrap. */
@media (max-width:600px) {
  .scroll { min-width:0; max-width:100%; }
  table td a, table td button { box-sizing:border-box; display:inline-flex; align-items:center; min-height:44px; }
  .scroll td:has(a), .scroll td:has(button) { padding-block:4px; }
  .scroll .btn { flex-shrink:0; }
}
