/* The booking page's styles (PAGE lane; DESIGN.md sections 1, 2, 17; pages.md section 4). The clinic's patient-page
   look: navy #0f2140, gold #d4b373 buttons with navy text (8.0:1), gold-700 #7f6128 for gold text on light, ivory
   surfaces, slate-600 secondary text; FORCED LIGHT (color-scheme: light - a dark-mode phone drew dark text on dark,
   5 Oct); system-ui; a 16 px side gutter; buttons at least 48 px high; one column for the screens; the picture menu
   2 across on a phone, 3 or 4 on a computer; no horizontal scroll at 375 px. Not the website's 3D look. */
:root {
  color-scheme: light;
  --navy: #0f2140;
  --navy-2: #1b3158;
  --gold: #d4b373;
  --gold-300: #e2c992;
  --gold-700: #7f6128;
  --ivory: #fbf8f1;
  --sand: #f3eee2;
  --line: #e4dccb;
  --slate: #475569;
  --white: #ffffff;
  --red: #9f1d14;
  --red-bg: #fdecea;
}
* { box-sizing: border-box; }
html, body { background: var(--ivory); }
body {
  margin: 0; color: var(--navy); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  overflow-wrap: anywhere; -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }
a { color: var(--navy); }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: normal; line-height: 1.2; }
h1 { font-size: 26px; margin: 18px 0 6px; }
h2 { font-size: 20px; margin: 18px 0 8px; }
:focus-visible { outline: 3px solid var(--gold-700); outline-offset: 2px; }
[hidden] { display: none !important; }

/* -- the top bar --------------------------------------------------------------------------------------------------- */
.top { background: var(--white); border-bottom: 3px solid var(--gold); }
.bar { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center;
       justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: Georgia, serif; font-size: 19px;
         letter-spacing: .02em; }
.brand img { width: 34px; height: 24px; }
.langs { font-size: 15px; white-space: nowrap; }
.langs a { display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; text-align: center;
           text-decoration: none; color: var(--slate); font-weight: 600; }
.langs a[aria-current="true"] { color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold);
                                 text-decoration-thickness: 3px; text-underline-offset: 6px; }
/* The owner's look-only link (owner, 1 Dec 2026): one small clear line over every screen - nothing is held or booked. */
.lookonly { position: sticky; top: 0; z-index: 15; margin: 0; padding: 8px 16px; background: var(--navy);
            color: var(--white); text-align: center; font-size: 15px; font-weight: 600;
            border-bottom: 2px solid var(--gold); }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px 24px; }
#screen { max-width: 640px; margin: 0 auto; }
.lead { margin: 0 0 14px; color: var(--slate); font-size: 17px; }
.sub { color: var(--slate); font-size: 15px; margin: 2px 0 10px; }
.foot { max-width: 640px; margin: 0 auto; padding: 8px 16px 32px; text-align: center; color: var(--slate);
        font-size: 13px; }
.foot p { margin: 4px 0; }

/* -- buttons ------------------------------------------------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
       padding: 12px 20px; border-radius: 10px; border: 2px solid transparent; font: inherit; font-size: 17px;
       font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.25; }
.btn.gold { background: var(--gold); color: var(--navy); }
.btn.navy { background: var(--navy); color: var(--white); }
.btn.line { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn.big { width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; }
.stack { display: grid; gap: 10px; margin: 16px 0; }
.back { display: inline-flex; align-items: center; min-height: 48px; padding: 0 12px 0 0; border: 0;
        background: none; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; }
.back::before { content: "\2039"; font-size: 26px; margin-right: 6px; line-height: 1; }

/* -- notes -------------------------------------------------------------------------------------------------------- */
.note { background: #fff8e6; border-left: 4px solid var(--gold); padding: 10px 12px; border-radius: 8px;
        margin: 12px 0; }
.alert { background: var(--red-bg); border-left: 4px solid var(--red); color: #5c1010; padding: 12px;
         border-radius: 8px; font-weight: 600; margin: 12px 0; }
.box { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 14px 0; }
.toast { position: fixed; left: 16px; right: 16px; top: 12px; z-index: 40; max-width: 608px; margin: 0 auto;
         background: var(--navy); color: var(--white); padding: 12px 14px; border-radius: 10px;
         box-shadow: 0 6px 24px rgba(15, 33, 64, .25); }

/* -- screen 1: the picture menu (DESIGN.md section 17) ----------------------------------------------------------- */
/* An opened card stays in its own place, under the thumb that tapped it (preview, 1 Dec 2026: it used to jump to a
   full-width row of its own): it only grows downwards; its neighbour keeps its own height (align-items: start). */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start;
         margin: 8px 0 18px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
        box-shadow: 0 1px 2px rgba(15, 33, 64, .06); }
.card-face { display: flex; flex-direction: column; align-items: stretch; width: 100%; min-height: 48px; margin: 0;
             padding: 0 0 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left;
             cursor: pointer; }
.pic { display: block; aspect-ratio: 16 / 9; background: var(--sand); }
.pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.card-name { display: block; padding: 8px 12px 0; font-size: 17px; font-weight: 600; line-height: 1.25; }
.card-line { display: block; padding: 3px 12px 0; font-size: 14px; color: var(--slate); line-height: 1.35; }
.card-more { padding: 0 12px 14px; animation: open .18s ease-out; }
.card-more p { margin: 4px 0 10px; font-size: 15px; line-height: 1.45; }
.card-more .mins { color: var(--gold-700); font-weight: 600; }
.card-more .btn { padding: 10px 12px; }
.card.open { box-shadow: 0 4px 18px rgba(15, 33, 64, .14); border-color: var(--gold); }
.card.pain { background: var(--navy); color: var(--white); border-color: var(--navy); }
.card.pain .pic { background: var(--navy-2); }
.card.pain .card-line, .card.pain .card-more .mins { color: var(--gold-300); }
.card.pain :focus-visible { outline-color: var(--gold); }
.card.chat { background: #f7f3ea; }
.in-treatment { border-top: 1px solid var(--line); padding-top: 12px; }
.in-treatment p { margin: 0 0 10px; color: var(--slate); }
@keyframes open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* -- screen 2: who ----------------------------------------------------------------------------------------------- */
.who { display: grid; gap: 10px; margin: 12px 0; }
.who button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 56px;
              padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--white);
              font: inherit; color: var(--navy); text-align: left; cursor: pointer; }
.who button.any { border: 2px solid var(--gold); }
.who b { font-size: 17px; }
.who small { color: var(--slate); font-size: 14px; }
.tag { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--gold);
       color: var(--navy); font-size: 12px; font-weight: 700; vertical-align: 2px; }

/* -- screen 3: the week of dots ----------------------------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chips button { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--navy);
                background: var(--white); color: var(--navy); font: inherit; font-size: 15px; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.weeknav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; }
.weeknav b { font-size: 16px; text-align: center; }
.weeknav button { width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--navy);
                  background: var(--white); color: var(--navy); font-size: 24px; cursor: pointer; }
.weeknav button[disabled] { opacity: .3; cursor: default; }
.grid { display: grid; grid-template-columns: 26px repeat(7, minmax(0, 1fr)); gap: 2px; margin: 6px 0 10px; }
.dh { text-align: center; font-size: 12px; color: var(--slate); line-height: 1.2; padding: 4px 0; }
.dh b { display: block; font-size: 16px; color: var(--navy); }
.dh small { display: block; font-size: 10px; color: var(--gold-700); font-weight: 700; text-transform: uppercase; }
.grp { grid-column: 1 / -1; font-size: 13px; font-weight: 700; color: var(--gold-700); margin-top: 8px; }
.hl { display: flex; align-items: center; justify-content: flex-start; font-size: 12px; color: var(--slate); }
.cell { min-height: 48px; display: flex; align-items: stretch; justify-content: center; border-radius: 8px; }
.cell.off { background: repeating-linear-gradient(135deg, #efe9db 0 6px, transparent 6px 12px); }
.dot { width: 100%; min-height: 48px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
       display: flex; align-items: center; justify-content: center; padding: 0; }
.dot::before { content: ""; width: 20px; height: 20px; border-radius: 50%; background: var(--gold);
               box-shadow: 0 0 0 2px var(--navy) inset; }
.dot:active { background: var(--sand); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--slate); margin: 8px 0; }
/* The key draws exactly what the grid draws (preview, 1 Dec 2026): the dot, the striped day, and nothing at all for an
   empty space - never a ring the grid does not show. */
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px;
                       vertical-align: -1px; }
.legend span.dotkey::before { border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--navy) inset; }
.legend span.offkey::before { width: 16px; height: 14px; border-radius: 3px;
                              background: repeating-linear-gradient(135deg, #e2d9c4 0 3px, transparent 3px 6px); }
.legend span.plain::before { content: none; }
.loading { color: var(--slate); padding: 24px 0; text-align: center; }

/* -- screen 4: the times in that hour (a sheet from the bottom) ------------------------------------------------------ */
.scrim { position: fixed; inset: 0; background: rgba(15, 33, 64, .35); z-index: 20; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: 640px; margin: 0 auto;
         background: var(--white); border-radius: 16px 16px 0 0; padding: 16px 16px 24px; max-height: 75vh;
         overflow: auto; box-shadow: 0 -8px 30px rgba(15, 33, 64, .2); animation: rise .2s ease-out; }
.sheet h2 { margin-top: 0; }
.times { display: grid; gap: 10px; margin: 10px 0 14px; }
.times button { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 52px;
                padding: 10px 16px; border: 1px solid var(--navy); border-radius: 10px; background: var(--white);
                color: var(--navy); font: inherit; font-size: 18px; cursor: pointer; }
.times button b { font-variant-numeric: tabular-nums; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* -- screen 5: the time, held ------------------------------------------------------------------------------------- */
.when { font-family: Georgia, serif; font-size: 24px; margin: 10px 0 4px; }
.count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.count b { font-size: 28px; font-variant-numeric: tabular-nums; }
/* the hold's reference, small: what a patient quotes when they phone reception */
.ref { color: var(--slate); font-size: 13px; letter-spacing: .04em; margin: 0 0 8px; }
/* words for a screen reader only (the week's day headings) */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dh { position: relative; }

/* -- screen 6 and the pain cards ----------------------------------------------------------------------------------- */
.state { display: flex; gap: 10px; align-items: flex-start; font-size: 17px; }
.state::before { content: ""; flex: 0 0 14px; height: 14px; margin-top: 5px; border-radius: 50%;
                 background: var(--gold); animation: pulse 1.4s ease-in-out infinite; }
.state.done::before { background: #2f7d4f; animation: none; }
.state.stop::before { background: var(--red); animation: none; }
@keyframes pulse { 50% { opacity: .35; } }
.paincards { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 10px; }
.paincards li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px;
                background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.paincards li span { font-size: 16px; }
.paincards li .btn { flex: 0 0 auto; padding: 10px 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
