/* Support, help centre and SOS. Neutral palette; tokens come from app.css (see docs/DESIGN.md). */
.sp { --s-brand: var(--brand); --s-brand-d: var(--brand-d); --s-brand-s: var(--surface-2); --s-on-brand: var(--on-brand);
  --s-ink: var(--ink); --s-ink2: var(--ink-2); --s-muted: var(--muted); --s-line: var(--line); --s-surface: var(--surface); --s-bg: var(--surface-2);
  --s-pine: var(--ok); --s-pine-s: var(--surface-2); --s-gold-s: var(--surface-2); --s-on-gold: var(--ink);
  --s-sky: var(--ink-2); --s-sky-s: var(--surface-2); --s-danger: var(--bad); --s-danger-s: var(--surface-2); }
.sp-staff { --s-ink: var(--pn-ink); --s-ink2: var(--pn-ink2); --s-muted: var(--pn-muted); --s-line: var(--pn-line); --s-surface: var(--pn-surface); --s-bg: var(--surface-2);
  --s-brand: var(--pn-brand); --s-brand-s: var(--surface-2); --s-gold-s: var(--surface-2); --s-sky-s: var(--surface-2); --s-danger-s: var(--surface-2); --s-danger: var(--pn-danger); }

.sp { --gutter: clamp(16px, 4vw, 64px); }
.sp .i { width: 20px; height: 20px; flex: none; } .sp .i.sm { width: 16px; height: 16px; }
.sp-page { padding: 8px var(--gutter) 72px; }
.sp-narrow { max-width: 760px; margin: 0; }
.sp-back { display: inline-flex; align-items: center; gap: 4px; color: var(--s-muted); font-size: 14px; font-weight: 600; min-height: 44px; margin-left: -4px; }
.sp-back:hover { color: var(--s-ink); }
.sp-h1 { font-size: 28px; letter-spacing: -.03em; line-height: 1.12; margin: 4px 0 4px; }
.sp-sub { color: var(--s-muted); font-size: 13px; }
.sp-card { background: var(--s-surface); border: 1px solid var(--s-line); border-radius: 14px; padding: 16px; box-shadow: none; }
.sp-card + .sp-card, .sp-stack > * + * { margin-top: 12px; }
.sp-row { display: flex; align-items: center; gap: 10px; } .sp-row.wrap { flex-wrap: wrap; } .sp-row.between { justify-content: space-between; } .sp-grow { flex: 1; min-width: 0; }
/* status shown as a small outlined tag; colour only on the text */
.sp-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: transparent; color: var(--s-ink2); border: 1px solid var(--s-line); white-space: nowrap; }
.sp-pill.info { color: var(--s-ink2); } .sp-pill.warn { color: var(--warn, var(--s-ink2)); }
.sp-pill.good { color: var(--s-pine); } .sp-pill.bad { color: var(--s-danger); }
.sp-link-card { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; min-height: 64px; }
.sp-link-card:hover { border-color: var(--s-ink2); }
.sp-form { display: grid; gap: 16px; } .sp-form .f { display: grid; gap: 6px; } .sp-form label { font-weight: 700; font-size: 13.5px; }
.sp-form input[type=text], .sp-form input[type=search], .sp-form input[type=number], .sp-form select, .sp-form textarea { width: 100%; min-height: 48px; border: 0; box-shadow: inset 0 0 0 1.5px var(--s-line); border-radius: 12px; padding: 11px 14px; background: var(--s-surface); color: var(--s-ink); font: inherit; outline: 0; }
.sp-form input:focus, .sp-form select:focus, .sp-form textarea:focus { box-shadow: inset 0 0 0 2px var(--s-brand); }
.sp-form textarea { min-height: 120px; resize: vertical; }
.sp-form input[type=file] { font-size: 14px; color: var(--s-ink2); }
.sp-err { color: var(--s-danger); font-size: 13px; font-weight: 600; }
.sp-note { padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; background: var(--s-bg); border: 1px solid var(--s-line); color: var(--s-ink); }
.sp-note.bad { color: var(--s-danger); } .sp-note.warn { color: var(--s-ink); }

/* customer pages: header row, flat list rows, help centre */
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.sp-head .sp-h1 { margin: 0; }
.sp-cols { display: grid; gap: 28px; }
@media (min-width: 960px) { .sp-cols { grid-template-columns: minmax(0, 1fr) clamp(300px, 28vw, 420px); gap: clamp(28px, 4vw, 72px); align-items: start; } .sp-cols > aside { position: sticky; top: calc(var(--top-h, 60px) + 16px); } }
.sp-rows { display: grid; border-top: 1px solid var(--s-line); }
.sp-rows > a, .sp-rows > div { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--s-line); color: inherit; min-height: 64px; min-width: 0; }
.sp-rows > a:hover b.t { text-decoration: underline; text-underline-offset: 3px; }
.sp-rows .i:first-child { color: var(--s-ink2); }
.sp-rows .end { color: var(--s-muted); }
.sp-section-title { font-size: 17px; letter-spacing: -.02em; margin: 28px 0 8px; }
.sp-empty { display: grid; gap: 8px; justify-items: start; padding: 28px 0; }
.sp-empty .illus { width: 120px; opacity: .85; }

/* conversation + tracker */
.sp-thread { display: grid; gap: 12px; }
.sp-msg { max-width: 86%; border-radius: 16px 16px 16px 4px; padding: 12px 14px; background: var(--s-bg); }
.sp-msg:not(.staff) { justify-self: end; border-radius: 16px 16px 4px 16px; background: var(--s-surface); box-shadow: inset 0 0 0 1px var(--s-line); }
.sp-msg.internal { box-shadow: inset 0 0 0 1px var(--s-line); }
.sp-msg .who { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--s-muted); }
.sp-msg .body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.sp-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; } .sp-thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--s-line); }
.sp-track { list-style: none; margin: 0; padding: 0; }
.sp-track li { position: relative; padding: 0 0 16px 24px; font-size: 14px; }
.sp-track li::before { content: ""; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--s-ink); }
.sp-track li::after { content: ""; position: absolute; left: 4px; top: 18px; bottom: -2px; width: 1px; background: var(--s-line); }
.sp-track li:last-child::after { display: none; } .sp-track li:last-child { padding-bottom: 0; }
.sp-track time { display: block; color: var(--s-muted); font-size: 12px; }
.sp-handler { display: flex; align-items: center; gap: 10px; }
.sp-stars { display: inline-flex; gap: 4px; } .sp-stars label { cursor: pointer; font-size: 30px; line-height: 1; color: var(--s-line); min-width: 40px; min-height: 44px; display: grid; place-items: center; }
.sp-stars input { position: absolute; opacity: 0; } .sp-stars input:checked + span, .sp-stars label:has(input:checked) { color: var(--star); }
.sp-stars input:focus-visible + span { outline: 2px solid var(--s-brand); }
.sp-suggest { margin-top: 8px; } .sp-suggest a { display: block; padding: 10px 12px; border: 1px solid var(--s-line); border-radius: 10px; margin-top: 6px; color: inherit; text-decoration: none; background: var(--s-surface); }
.sp-suggest a:hover { border-color: var(--s-ink2); }
.sp-reply { border-top: 1px solid var(--s-line); padding-top: 16px; margin-top: 8px; }

/* help centre: search first, then plain category blocks */
.sp-hero { display: grid; gap: 14px; padding: 18px 0 12px; max-width: 760px; }
.sp-hero h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.035em; line-height: 1.08; }
.sp-hero input[type=search] { min-height: 54px; font-size: 16px; }
.sp-cat-grid { display: grid; gap: 28px 40px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); margin-top: 20px; }
.sp-cat-grid > section { min-width: 0; }
.sp-cat-grid h2 { font-size: 17px; letter-spacing: -.02em; display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.sp-cat-grid h2 .i { color: var(--s-ink2); }
.sp-list a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0; border-top: 1px solid var(--s-line); color: inherit; text-decoration: none; min-height: 48px; font-size: 15px; }
.sp-list a:first-child { border-top: 0; } .sp-list a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.sp-list a .i { color: var(--s-muted); }
.sp-list b { font-weight: 600; }
.sp-article { max-width: 70ch; }
.sp-article p { margin: 0 0 16px; line-height: 1.7; font-size: 16px; }
.sp-cta { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid var(--s-line); margin-top: 28px; max-width: 70ch; }

/* staff layout */
.sp-two { display: grid; gap: 16px; } @media (min-width: 980px) { .sp-two { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; } }
.sp-side > * + * { margin-top: 12px; }
.sp-side h3 { font-size: 13px; text-transform: none; color: var(--s-muted); margin-bottom: 6px; }
.sp-macros { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; } .sp-tabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--s-line); background: var(--s-surface); color: var(--s-ink2); font-weight: 600; font-size: 13.5px; text-decoration: none; min-height: 36px; }
.sp-tabs a[aria-current="page"] { background: var(--s-surface); border-color: var(--s-brand); box-shadow: inset 0 0 0 1px var(--s-brand); color: var(--s-ink); }
.sp-kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); } @media (min-width: 900px) { .sp-kpis { grid-template-columns: repeat(5, 1fr); } }
.sp-kpi b { display: block; font-size: 26px; letter-spacing: -.02em; } .sp-kpi span { color: var(--s-muted); font-size: 12.5px; }
.sp-bar { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; } .sp-bar i { display: block; height: 10px; border-radius: 4px; background: var(--s-ink); min-width: 3px; }

/* SOS: an outlined row on the booking page, a bottom sheet to confirm. Emergency colour only on text, icon and the hold ring. */
.sos-btn { width: 100%; min-height: 52px; border: 0; border-radius: var(--r-btn); background: transparent; color: var(--s-danger); font-weight: 700; font-size: 15px; display: inline-flex; gap: 10px; align-items: center; justify-content: center; cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--s-danger); }
.sos-btn:hover { background: var(--s-bg); }
.sos-sheet { position: fixed; inset: 0; z-index: 120; background: var(--scrim); display: none; align-items: flex-end; justify-content: center; overscroll-behavior: contain; }
.sos-sheet[data-open] { display: flex; }
@media (min-width: 700px) { .sos-sheet { align-items: center; } .sos-panel { border-radius: 20px !important; } }
.sos-panel { width: 100%; max-width: 480px; background: var(--s-surface); color: var(--s-ink); border-radius: 20px 20px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); max-height: 100dvh; overflow: auto; }
.sos-panel h2 { font-size: 22px; letter-spacing: -.02em; }
.sos-hold { position: relative; width: 100%; min-height: 72px; border: 0; border-radius: 999px; background: var(--s-surface); color: var(--s-danger); box-shadow: inset 0 0 0 2px var(--s-danger); font-weight: 800; font-size: 18px; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: pointer; margin: 4px 0 8px; }
.sos-hold .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--s-danger); transition: none; }
.sos-hold.holding .fill { width: 100%; transition: width 2s linear; }
.sos-hold.holding { color: var(--on-status); }
.sos-hold span { position: relative; display: inline-flex; align-items: center; gap: 10px; }
.sos-state { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--s-bg); font-size: 14px; }
.sos-live { display: flex; align-items: center; gap: 8px; font-weight: 700; } .sos-live i { width: 10px; height: 10px; border-radius: 50%; background: var(--s-pine); }
@media (prefers-reduced-motion: no-preference) { .sos-live.on i { animation: sosp 1.4s ease-out infinite; } @keyframes sosp { 50% { opacity: .35; } } }
.sos-quiet { display: flex; gap: 8px; align-items: center; font-size: 14px; min-height: 44px; }

/* v3: status banner, unread dot, one-tap presets */
.sp-status { display: grid; gap: 2px; margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--s-line); border-left-width: 4px; font-size: 14px; }
.sp-status span { color: var(--s-ink2); font-size: 13px; }
.sp-status.warn { border-left-color: var(--warn, var(--s-ink2)); } .sp-status.info { border-left-color: var(--brand); } .sp-status.good { border-left-color: var(--s-pine); }
.sp-unread { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-right: 8px; vertical-align: middle; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--s-line); background: transparent; color: inherit; font: 600 14px/1 inherit; cursor: pointer; }
.sp-chip:hover, .sp-chip:focus-visible { border-color: var(--brand); }
