/* Client Schedule. Colours come from the theme picked in Settings (data-theme on <html>). */
:root {
  --bg: #F1F5FC; --surface: #FFFFFF; --ink: #0E1628; --muted: #56627A; --line: #D7E0F0;
  --acc: #1D4FC4; --acc-ink: #FFFFFF; --acc-soft: #E1EAFC; --hi: #0B72B9; --hi-soft: #DCEFFB;
  --ok-soft: #E1F0E6; --warn-soft: #F8E7D9;
  --f-display: "Cormorant Garamond", Georgia, serif;
  --f-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --f-data: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r: 12px; color-scheme: light;
}
:root[data-theme="maroon"]  { --bg:#FBF3F4; --line:#EBD7DA; --acc:#7A1730; --acc-soft:#F5E1E6; --hi:#B07A1E; --hi-soft:#F7ECD7; --ink:#24090F; --muted:#6E5258; }
:root[data-theme="emerald"] { --bg:#F0F8F4; --line:#D2E8DC; --acc:#0B6B4C; --acc-soft:#DDF1E7; --hi:#B07A1E; --hi-soft:#F6ECD6; --ink:#07231A; --muted:#4F6A5F; }
:root[data-theme="purple"]  { --bg:#F6F2FC; --line:#E1D6F2; --acc:#6A2BB8; --acc-soft:#ECE2FA; --hi:#B8329B; --hi-soft:#F8E2F2; --ink:#1A0B30; --muted:#62567A; }
:root[data-theme="rose"]    { --bg:#FCF2F6; --line:#F1D5E1; --acc:#C0396E; --acc-soft:#F9E0EA; --hi:#A8642A; --hi-soft:#F7E8DA; --ink:#2A0A17; --muted:#77566A; }
:root[data-theme="teal"]    { --bg:#EEF8F9; --line:#CFE6E9; --acc:#0E7381; --acc-soft:#D8EFF2; --hi:#C26A12; --hi-soft:#F8E8D6; --ink:#062126; --muted:#4D6A6F; }
:root[data-theme="orange"]  { --bg:#FDF5EE; --line:#F2DDCB; --acc:#C2560E; --acc-soft:#FBE6D6; --hi:#1D4FC4; --hi-soft:#E1EAFC; --ink:#2A1405; --muted:#76604F; }
:root[data-theme="gold"]    { --bg:#0D0C0A; --surface:#17150F; --line:#332C1C; --ink:#F5EEDC; --muted:#B3A68A; --acc:#E0B24F; --acc-ink:#15110A; --acc-soft:#2E2714; --hi:#F2CF7A; --hi-soft:#2A2312; --ok-soft:#18291D; --warn-soft:#33210F; color-scheme: dark; }
:root[data-theme="night"]   { --bg:#090E1B; --surface:#111A2C; --line:#22304B; --ink:#EAF0FB; --muted:#93A0B8; --acc:#6E9CFF; --acc-ink:#08101F; --acc-soft:#16264A; --hi:#5CC4FF; --hi-soft:#0F2F4A; --ok-soft:#173023; --warn-soft:#3A2414; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px max(14px, env(safe-area-inset-left, 0px)) 56px; display: grid; gap: 16px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--hi); outline-offset: 2px; }
a { color: var(--acc); }

.bar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 20px; }
.brand { display: grid; gap: 2px; min-width: 0; }
.brand small, .eyebrow { font: 600 11px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--acc); }
.brand h1, .login h1 { margin: 0; font: 700 clamp(32px, 7vw, 46px)/1 var(--f-display); letter-spacing: -.01em; }
.brand h1 em, .login h1 em { font-style: italic; color: var(--acc); }
.dates { font-size: 13px; color: var(--muted); }
.dates b { color: var(--ink); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 9px 13px; cursor: pointer; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--acc); }
.btn.primary { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.btn.wa { background: #1F7A4D; border-color: #1F7A4D; color: #FFFFFF; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.ghost { background: none; }
.btn.danger { color: var(--acc); }
.btn[disabled] { opacity: .5; cursor: default; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; }
.next { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px 20px; align-items: center; }
.next .clock { font: 700 40px/1 var(--f-data); font-variant-numeric: tabular-nums; color: var(--acc); letter-spacing: -.02em; }
.next .who { display: grid; gap: 2px; min-width: 0; }
.next .who small { font: 600 11px/1.3 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.next .who b { font: 700 24px/1.15 var(--f-display); overflow-wrap: anywhere; }
.next .who span { color: var(--muted); font-size: 14px; }
.next .go { display: flex; flex-wrap: wrap; gap: 8px; justify-content: end; }
@media (max-width: 700px) { .next { grid-template-columns: 1fr; } .next .go { justify-content: start; } }

.today { display: flex; flex-wrap: wrap; gap: 6px; }
.today .t { font: 500 12px/1 var(--f-data); padding: 6px 9px; border-radius: 99px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.today .t.b { background: var(--acc-soft); color: var(--acc); border-color: transparent; font-weight: 700; }
.today .t.past { opacity: .55; }

.weekhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.weekhead h2 { margin: 0; font: 700 26px/1.1 var(--f-display); }
.weekhead .sum { font-size: 13px; color: var(--muted); }
.weekhead .sum b { color: var(--ink); }
.nav { display: flex; gap: 6px; }

/* Phone: one day at a time with day tabs. Computer: the whole week. */
.daytabs { display: none; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.daytabs button { flex: 1 0 auto; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 7px 10px; cursor: pointer; display: grid; gap: 1px; text-align: center; min-width: 52px; }
.daytabs button b { font-size: 13px; }
.daytabs button span { font: 500 11px/1 var(--f-data); color: var(--muted); }
.daytabs button.on { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.daytabs button.on span { color: var(--acc-ink); opacity: .85; }
.daytabs button i { font-style: normal; font-size: 10px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }

.day { display: grid; gap: 6px; align-content: start; min-width: 0; }
.day h3 { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 4px 2px; font: 600 13px/1.2 var(--f-body); }
.day h3 span { font: 500 12px/1 var(--f-data); color: var(--muted); }
.day.is-today h3 { color: var(--acc); }

.slot { text-align: left; display: grid; gap: 3px; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; min-height: 74px; min-width: 0; align-content: start; color: var(--ink); }
.slot:hover { border-color: var(--acc); }
.slot .tm { font: 700 13px/1 var(--f-data); color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.slot .tmv { font: 700 13px/1 var(--f-data); color: var(--muted); }
.slot .nm { font-weight: 600; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.slot .ty { font-size: 12px; color: var(--muted); line-height: 1.25; }
.slot.free { border-style: dashed; background: none; }
.slot.free .nm { color: var(--muted); font-weight: 500; font-size: 13px; }
.slot.past.free { opacity: .45; }
.slot.opt.free { min-height: 52px; opacity: .7; }
.slot.opt.free.past { opacity: .35; }
.slot.booked, .slot.confirmed { background: var(--acc-soft); border-color: transparent; }
.slot.booked .tmv, .slot.confirmed .tmv { color: var(--acc); }
.slot.done { background: var(--ok-soft); border-color: transparent; }
.slot.noshow, .slot.cancelled { background: var(--warn-soft); border-color: transparent; }
.slot.cancelled .nm { text-decoration: line-through; }
.slot.blocked { background: repeating-linear-gradient(135deg, var(--bg) 0 6px, var(--surface) 6px 12px); }
.slot.is-next { outline: 2px solid var(--hi); outline-offset: 1px; }
.pill { font: 700 10px/1 var(--f-body); letter-spacing: .06em; text-transform: uppercase; padding: 3px 6px; border-radius: 99px; background: var(--surface); color: var(--muted); white-space: nowrap; }

.foot { font-size: 13px; color: var(--muted); display: grid; gap: 4px; max-width: 75ch; }
.msg { border-radius: 9px; padding: 10px 12px; font-size: 14px; background: var(--hi-soft); }
.msg.err { background: var(--acc-soft); }
.small { font-size: 13px; color: var(--muted); }
.muted { opacity: .8; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); z-index: 20; }

dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 0; width: min(460px, calc(100% - 24px)); }
dialog::backdrop { background: rgba(6, 12, 28, .5); }
.dlg { display: grid; gap: 12px; padding: 18px; }
.dlg h2 { margin: 0; font: 700 26px/1.1 var(--f-display); }
.dlg .when { font: 500 13px/1.3 var(--f-data); color: var(--muted); }
.field { display: grid; gap: 5px; }
.field > label { font: 600 11px/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea, .login input { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); font-size: 16px; }
.field textarea { min-height: 70px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .two { grid-template-columns: 1fr; } }
.row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.row div { display: flex; gap: 8px; flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--acc); }

.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sw { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); }
.sw i { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.sw.on { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px 22px; width: min(420px, 100%); display: grid; gap: 12px; }
.login p { margin: 0; color: var(--muted); }
.login form { display: grid; gap: 10px; }
.login input { font: 600 18px/1 var(--f-data); letter-spacing: .08em; text-align: center; }
.login .btn { justify-content: center; padding: 12px; }

/* Phone layout (kept last so it wins) */
@media (max-width: 760px) {
  .daytabs { display: flex; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid .day:not(.shown) { display: none; }
  .grid .day h3 { display: none; }
  .slot { grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; min-height: 58px; column-gap: 10px; }
  .slot.opt.free { min-height: 46px; }
  .slot .tm { display: contents; }
  .slot .tm .pill { grid-column: 3; grid-row: 1 / span 2; }
  .slot .nm { grid-column: 2; }
  .slot .ty { grid-column: 2; }
  .slot .tmv { grid-row: 1 / span 2; font-size: 16px !important; }
  .slot.free .nm { grid-row: 1 / span 2; }
  .slot { align-content: center; }
}
.daytabs { scrollbar-width: none; }
.daytabs::-webkit-scrollbar { display: none; }
