/* === SECTION 1: SEMANTIC COLOUR TOKENS & BORDERLESS BASE (Lines 1-38) === */
:root {
  --canvas: #F6F4EE;
  --surface: #EAE6DC;
  --surface-pure: #FFFFFF;
  --ink: #172026;
  --ink-muted: #5A6570;
  --teal: #0D7A68;
  --cobalt: #1E5BB8;
  --coral: #D93829;
  --amber: #D47500;
  --sage: #3D6352;
  --slate: #1E2933;
  --stone: #D8D2C5;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; background: var(--canvas); color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
.hidden { display: none !important; }
.shell { min-height: 100dvh; display: flex; flex-direction: column; max-width: 680px; margin: 0 auto; background: var(--canvas); }
.coral-banner { background: var(--coral); color: #FFF; padding: 10px 16px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.portal-bar { color: #FFF; padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 14px; }
.bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-title { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; cursor: pointer; }
.header-tag { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 10px; background: rgba(255,255,255,0.16); }
.toast-banner { padding: 13px 18px; color: #FFF; font-size: 14px; font-weight: 700; }
.stage { flex: 1; padding: 16px 16px 96px; display: flex; flex-direction: column; gap: 12px; }

/* === SECTION 2: SOLID COLOUR BLOCKS, FLAT CARDS & INPUTS (Lines 39-78) === */
.bg-teal { background: var(--teal); color: #FFF; }
.bg-cobalt { background: var(--cobalt); color: #FFF; }
.bg-coral { background: var(--coral); color: #FFF; }
.bg-amber { background: var(--amber); color: #FFF; }
.bg-sage { background: var(--sage); color: #FFF; }
.bg-slate { background: var(--slate); color: #FFF; }
.bg-stone { background: var(--stone); color: var(--ink); }

.flat-card { background: var(--surface-pure); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.flat-card.tinted { background: var(--surface); }
.card-kicker { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.card-heading { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.card-copy { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-muted); }

.btn-block {
  appearance: none; border: none; border-radius: 0; width: 100%; padding: 16px 18px;
  font-family: inherit; font-size: 14px; font-weight: 800; letter-spacing: 0.05em;
  text-transform: uppercase; cursor: pointer; text-align: left; display: flex;
  align-items: center; justify-content: space-between; transition: filter 0.15s ease;
}
.btn-block:active { filter: brightness(0.9); }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: none; padding: 10px 12px; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; background: var(--surface); color: var(--ink); text-align: left; }
.chip-btn.active { background: var(--teal); color: #FFF; }

.field-label { font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-muted); margin-top: 4px; }
.solid-input, .solid-textarea, .solid-select {
  width: 100%; border: none; border-bottom: 3px solid transparent; border-radius: 0;
  background: var(--surface); color: var(--ink); padding: 14px; font-family: inherit;
  font-size: 15px; font-weight: 600; outline: none;
}
.solid-input:focus, .solid-textarea:focus, .solid-select:focus { border-bottom-color: var(--teal); background: #EFECE4; }
.solid-textarea { min-height: 104px; resize: vertical; line-height: 1.45; }

/* === SECTION 3: COLOUR-STRIP SWIPE RIBBONS, SLIDE TRACK & NAV (Lines 79-112) === */
.swipe-wrap { position: relative; overflow: hidden; background: var(--slate); touch-action: pan-y; user-select: none; }
.swipe-under {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #FFF;
}
.swipe-under.right-mode { background: var(--teal); justify-content: flex-start; }
.swipe-under.left-mode { background: var(--amber); justify-content: flex-end; }
.swipe-front {
  position: relative; background: var(--surface-pure); padding: 16px 18px;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); cursor: grab;
}
.swipe-front.dragging { transition: none; }
.patient-strip-coral { background: var(--coral); color: #FFF; padding: 6px 12px; font-size: 11px; font-weight: 800; letter-spacing: 0.05em; margin: -16px -18px 12px; }

.slide-track { position: relative; height: 60px; background: var(--slate); overflow: hidden; user-select: none; touch-action: none; }
.slide-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 64px; background: var(--teal); pointer-events: none; }
.slide-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #FFF; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; pointer-events: none; z-index: 2;
}
.slide-thumb {
  position: absolute; top: 0; bottom: 0; left: 0; width: 64px; background: #129B84;
  color: #FFF; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; cursor: ew-resize; z-index: 3;
}

.bottom-strip {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 680px;
  display: grid; grid-template-columns: repeat(4, 1fr); background: var(--slate);
  padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 20;
}
.tab-block {
  border: none; background: var(--slate); color: rgba(255,255,255,0.68); padding: 15px 6px;
  font-family: inherit; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
}
.tab-block.active { background: var(--teal); color: #FFF; }
