@charset "UTF-8";
/* =====================================================================
   Dr. Suresh Adhikari — clinic site
   Design direction: "Morning in the valley"

   A calm, airy identity for a psychiatric clinic in Kathmandu. Patients
   arrive anxious and often worried about being seen seeking help, so the
   page is quiet: deep pine-teal ink on mist, generous air, one warm
   accent, and a single bold element — the arch-framed portrait.

   Loaded AFTER bootstrap.min.css so it can override.

   Everything here is fluid. Type and spacing use clamp(), and grids use
   auto-fit/minmax, so the layout reflows continuously as the window
   resizes instead of snapping at fixed breakpoints.
   ===================================================================== */

/* ---------------------------------------------------------------
   Self-hosted type
   Fraunces carries the personality. Its SOFT axis rounds the
   terminals, which reads warmer than a standard high-contrast
   serif — the reason for choosing it for a mental health clinic.
   Both files are variable, so every weight costs one download.
   --------------------------------------------------------------- */
@font-face {
  font-family: 'Fraunces';
  src: url('../vendor/fonts/fraunces-variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../vendor/fonts/jakarta-variable.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* =====================================================================
   Tokens
   ===================================================================== */
:root {
  /* --- Colour ------------------------------------------------------
     Pine-teal rather than navy: cooler, quieter, less institutional.
     Marigold is the only warm note and appears sparingly. */
  --ink:        #12303c;
  --ink-soft:   #56707c;
  --tide:       #1f6b7d;
  --tide-deep:  #14495a;
  --tide-quiet: #eaf2f3;
  --sage:       #cfe0dc;
  --line:       #dbe6e7;
  --paper:      #ffffff;
  --mist:       #f4f8f9;
  --marigold:   #d99a1c;
  --marigold-quiet: #fdf6e6;

  /* Aliases so the admin styles keep their original variable names */
  --blue:       var(--tide);
  --blue-deep:  var(--tide-deep);
  --blue-tint:  var(--tide-quiet);

  /* --- Type -------------------------------------------------------- */
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body:    'Plus Jakarta Sans', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --serif: var(--display);
  --sans:  var(--body);

  /* Fluid type scale: each step interpolates between a mobile and a
     desktop size, so text grows smoothly with the viewport. */
  --step--1: clamp(0.83rem, 0.81rem + 0.10vw, 0.88rem);
  --step--2: clamp(0.66rem, 0.63rem + 0.13vw, 0.73rem);
  --step-0:  clamp(1rem,    0.96rem + 0.20vw, 1.09rem);
  --step-1:  clamp(1.16rem, 1.08rem + 0.38vw, 1.38rem);
  --step-2:  clamp(1.35rem, 1.20rem + 0.72vw, 1.80rem);
  --step-3:  clamp(1.58rem, 1.32rem + 1.25vw, 2.36rem);
  --step-4:  clamp(1.84rem, 1.42rem + 2.02vw, 3.07rem);
  --step-5:  clamp(2.15rem, 1.48rem + 3.17vw, 4.00rem);

  /* Fluid space scale */
  --sp-2xs: clamp(0.25rem, 0.24rem + 0.05vw, 0.30rem);
  --sp-xs:  clamp(0.50rem, 0.48rem + 0.10vw, 0.60rem);
  --sp-s:   clamp(0.75rem, 0.71rem + 0.20vw, 0.90rem);
  --sp-m:   clamp(1.20rem, 1.10rem + 0.50vw, 1.60rem);
  --sp-l:   clamp(1.80rem, 1.55rem + 1.25vw, 2.80rem);
  --sp-xl:  clamp(2.60rem, 2.10rem + 2.50vw, 4.60rem);
  --sp-2xl: clamp(3.60rem, 2.60rem + 5.00vw, 7.20rem);

  /* --- Measure and container -------------------------------------- */
  --measure:       62ch;
  --measure-tight: 48ch;
  --shell:         76rem;
  --shell-narrow:  54rem;

  /* --- Shape ------------------------------------------------------- */
  --r-s: 6px;
  --r-m: 14px;
  --r-l: 24px;

  /* Shadows are barely there; a calm page does not need lift. */
  --shadow-soft: 0 1px 2px rgba(18, 48, 60, .04), 0 8px 24px -12px rgba(18, 48, 60, .10);
  --shadow-lift: 0 2px 4px rgba(18, 48, 60, .05), 0 18px 40px -18px rgba(18, 48, 60, .16);

  /* Bootstrap overrides */
  --bs-body-font-family: var(--body);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--mist);
  --bs-link-color-rgb: 31, 107, 125;
  --bs-link-hover-color-rgb: 20, 73, 90;
  --bs-border-color: var(--line);
  --bs-border-radius: var(--r-s);
}

/* =====================================================================
   Base
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;   /* sticky header clearance for #anchors */
}

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 40, 'WONK' 0, 'opsz' 48;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 var(--sp-s);
  text-wrap: balance;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: var(--step-1); font-weight: 600; }

p { margin: 0 0 var(--sp-m); max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

a { color: var(--tide); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--tide-deep); }

strong { font-weight: 600; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 2.5px solid var(--tide); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--sage); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 1100;
  background: var(--paper);
  color: var(--tide-deep);
  padding: var(--sp-s) var(--sp-m);
  border-radius: var(--r-s);
  font-weight: 600;
  box-shadow: var(--shadow-lift);
}
.skip-link:focus { left: var(--sp-m); top: var(--sp-m); }

/* =====================================================================
   Layout primitives — these do the fluid work
   ===================================================================== */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2.5rem);
}
.shell-narrow { max-width: var(--shell-narrow); }

.band { padding-block: var(--sp-2xl); }
.band-tight { padding-block: var(--sp-xl); }
.band-mist  { background: var(--mist); }
.band-wash  { background: var(--tide-quiet); }
.band-paper { background: var(--paper); }
.band-rule  { border-top: 1px solid var(--line); }

.band-ink { background: var(--tide-deep); color: #d3e4e7; }
.band-ink h2, .band-ink h3, .band-ink h4 { color: var(--paper); }
.band-ink .lede { color: #b8d2d7; }

/* Centred section heading. This is what fixes the lopsided feel of
   everything hugging the left edge. */
.lede-block {
  max-width: var(--measure);
  margin-inline: auto;
  margin-bottom: var(--sp-l);
  text-align: center;
}
.lede-block p { margin-inline: auto; }
.lede-block .lede { max-width: 54ch; }
.lede-block.is-left { text-align: left; margin-inline: 0; }
.lede-block.is-left p { margin-inline: 0; }

.eyebrow {
  display: block;
  font-family: var(--body);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--tide);
  margin-bottom: var(--sp-xs);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: var(--measure-tight);
}

/* Intrinsic grids: the column count changes with available room, with
   no media query, so resizing is smooth. */
.grid {
  display: grid;
  gap: var(--sp-m);
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(12.5rem, 100%), 1fr)); }
.grid-gap-l { gap: var(--sp-l); }

.split {
  display: grid;
  gap: var(--sp-l);
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
}
.split-wide { grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr)); }

.prose { max-width: var(--measure); margin-inline: auto; }
.stack > * + * { margin-top: var(--sp-m); }
.stack-s > * + * { margin-top: var(--sp-s); }

.center { text-align: center; }
.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-s); align-items: center; }
.cluster-center { justify-content: center; }

/* =====================================================================
   Header and navigation
   Light and translucent rather than a heavy dark bar: it keeps the page
   feeling open, and the CTA is the only filled element in it.
   ===================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(244, 248, 249, .86);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background-color .2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, .92);
}

.site-header .navbar { padding-block: var(--sp-s); }

.brand { display: flex; align-items: center; gap: var(--sp-s); text-decoration: none; }
.brand:hover { text-decoration: none; }

/* The logo mark: an arch holding the valley at first light. Inline SVG,
   so it takes its colour from the surrounding text and stays sharp at
   any size. */
.brand-mark {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  color: var(--tide-deep);
}
.brand-mark svg { width: 100%; height: 100%; display: block; }

/* The mark is now artwork rather than a shape that inherits the link
   colour, so hovering lifts it slightly instead of recolouring it. The
   image is served at 256px and shown at 48, which keeps it sharp on a
   high-density screen. */
.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transition: transform .25s ease;
}

.brand:hover .brand-mark img { transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  .brand-mark img { transition: none; }
  .brand:hover .brand-mark img { transform: none; }
}

.brand-name {
  display: block;
  font-family: var(--display);
  font-variation-settings: 'SOFT' 40, 'opsz' 24;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand-role {
  display: block;
  font-size: var(--step--1);
  color: var(--ink-soft);
  line-height: 1.3;
}

.navbar-nav { gap: var(--sp-2xs); align-items: center; }

.site-header .nav-link {
  position: relative;
  padding: .45rem .8rem;
  color: var(--ink);
  font-size: var(--step-0);
  font-weight: 500;
  border-radius: var(--r-s);
}
.site-header .nav-link:hover { color: var(--tide); background: rgba(31, 107, 125, .07); }

/* Active page marked with a small underline rather than a filled pill */
.site-header .nav-link.active { color: var(--tide-deep); font-weight: 600; }
.site-header .nav-link.active::after {
  content: '';
  position: absolute;
  left: .8rem; right: .8rem; bottom: .12rem;
  height: 2px;
  background: var(--marigold);
  border-radius: 2px;
}

.site-header .nav-link.nav-cta {
  margin-left: var(--sp-xs);
  padding: .6rem 1.15rem;
  background: var(--tide-deep);
  color: var(--paper);
  font-weight: 600;
  border-radius: 999px;
}
.site-header .nav-link.nav-cta:hover { background: var(--tide); color: var(--paper); }
.site-header .nav-link.nav-cta.active::after { display: none; }

.navbar-toggler {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: .5rem .65rem;
  border-radius: var(--r-s);
}
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(31, 107, 125, .25); }
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2312303c' stroke-linecap='round' stroke-width='2' d='M4 8h22M4 15h22M4 22h22'/%3e%3c/svg%3e");
}

/* Collapsed menu: a panel, not a squashed row */
@media (max-width: 991.98px) {
  .navbar-collapse {
    margin-top: var(--sp-s);
    padding: var(--sp-s);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-m);
    box-shadow: var(--shadow-lift);
  }
  .navbar-nav { align-items: stretch; gap: 2px; }
  .site-header .nav-link { padding: .7rem .85rem; }
  .site-header .nav-link.active::after { left: .85rem; right: auto; width: 1.2rem; }
  .site-header .nav-link.nav-cta { margin: var(--sp-xs) 0 0; text-align: center; }
}

/* =====================================================================
   Buttons
   ===================================================================== */
.btn-clinic,
.btn-clinic-quiet,
.btn-clinic-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .78rem 1.5rem;
  font-family: var(--body);
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.3;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.btn-clinic:active,
.btn-clinic-quiet:active,
.btn-clinic-light:active { transform: translateY(1px); }

.btn-clinic { background: var(--tide-deep); border-color: var(--tide-deep); color: var(--paper); }
.btn-clinic:hover, .btn-clinic:focus { background: var(--tide); border-color: var(--tide); color: var(--paper); }

.btn-clinic-quiet { background: transparent; border-color: var(--sage); color: var(--tide-deep); }
.btn-clinic-quiet:hover, .btn-clinic-quiet:focus { background: var(--tide-quiet); border-color: var(--tide); color: var(--tide-deep); }

.btn-clinic-light { background: var(--paper); border-color: var(--paper); color: var(--tide-deep); }
.btn-clinic-light:hover, .btn-clinic-light:focus { background: var(--tide-quiet); color: var(--tide-deep); }

.btn-sm.btn-clinic, .btn-sm.btn-clinic-quiet, .btn-sm.btn-danger-quiet {
  padding: .4rem .9rem;
  font-size: var(--step--1);
}

/* A quiet text link that still looks tappable */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--sage);
  padding-bottom: 2px;
}
.link-arrow:hover { border-bottom-color: var(--tide); }

/* =====================================================================
   Surfaces
   Not everything is a card. Panels carry forms and grouped facts; plain
   bands carry prose. Radii differ by role rather than being uniform.
   ===================================================================== */
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: var(--sp-l);
}
.panel > :last-child { margin-bottom: 0; }
.panel-flush { padding: 0; overflow: hidden; }

/* Feature tile: hairline card, no shadow, subtle hover */
.tile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  height: 100%;
  padding: var(--sp-m);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.tile:hover { border-color: var(--sage); box-shadow: var(--shadow-soft); }
.tile h3 { margin-bottom: 0; font-size: var(--step-1); }
.tile p { color: var(--ink-soft); font-size: var(--step-0); max-width: none; }

/* Small glyph holder for tiles. Kept geometric and quiet. */
.tile-mark {
  display: grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;
  margin-bottom: var(--sp-xs);
  border-radius: 50% 50% var(--r-s) var(--r-s) / 60% 60% var(--r-s) var(--r-s);
  background: var(--tide-quiet);
  color: var(--tide-deep);
}
.tile-mark svg { width: 1.4rem; height: 1.4rem; }

/* A quiet definition row, used for hours and credentials */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: grid;
  gap: var(--sp-2xs) var(--sp-m);
  grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), auto));
  padding: var(--sp-s) 0;
  border-bottom: 1px solid var(--line);
}
.rows li:first-child { border-top: 1px solid var(--line); }
.rows dt, .rows-key {
  color: var(--ink-soft);
  font-size: var(--step--1);
  font-weight: 600;
}
.rows-val { font-weight: 500; }

/* Messages */
.message {
  padding: var(--sp-s) var(--sp-m);
  background: var(--tide-quiet);
  border: 1px solid var(--sage);
  border-left: 3px solid var(--tide);
  border-radius: var(--r-s);
  margin-bottom: var(--sp-m);
  font-size: var(--step-0);
}
.message p { max-width: none; }
.message-error {
  background: #fdeeec;
  border-color: #f0cdc7;
  border-left-color: #b3372a;
}

/* =====================================================================
   Forms
   ===================================================================== */
.form-label { font-weight: 600; font-size: var(--step-0); margin-bottom: .3rem; }
legend.form-label { float: none; width: auto; font-size: var(--step-0); }

.form-control, .form-select {
  padding: .7rem .9rem;
  font-family: var(--body);
  font-size: var(--step-0);
  color: var(--ink);
  background-color: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
}
.form-control::placeholder { color: #9db3b9; }

/*
 * A select carries its chevron as a background image pinned .75rem from
 * the right edge, and Bootstrap leaves 2.25rem of padding there for it.
 * The symmetrical padding above overwrote that, so the last characters of
 * an option ran underneath the arrow — "15 minutes" and the chevron sat on
 * top of each other. This puts the room back.
 *
 * max-width matters as much: a select sized with .w-auto takes the width
 * of its longest option, which for a clinic named "Mental Hospital —
 * Government Hospital Psychiatry OPD" is wider than a phone. Capping it at
 * the container lets the browser truncate instead of overflowing the panel.
 */
.form-select {
  padding-right: 2.4rem;
  max-width: 100%;
  min-width: 0;
}
.form-select-sm { padding-right: 2rem; }

/*
 * A flex item defaults to min-width:auto, meaning it refuses to shrink
 * below its widest child. A filter bar holding a select full of long
 * clinic names therefore stayed 474px wide on a 412px phone and pushed
 * the whole page sideways. Letting the row shrink gives the max-width
 * above something smaller than the screen to resolve against.
 */
form.d-flex { min-width: 0; }
.form-control:focus, .form-select:focus {
  border-color: var(--tide);
  box-shadow: 0 0 0 3px rgba(31, 107, 125, .16);
}
.form-text { font-size: var(--step--1); color: var(--ink-soft); }
.invalid-feedback { font-size: var(--step--1); }
.form-control.is-invalid, .form-select.is-invalid { border-color: #b3372a; }

/* ---------------------------------------------------------------
   Fancy select — a custom dropdown for the time slot picker.

   Same look as the phone field's country dropdown, minus the search
   box: a bordered panel that opens under the field, with the list of
   options as rows. The native <select> stays in the DOM and is what
   submits; only its popup is replaced.

   With JS off, the native select shows and everything works as it
   did before. Nothing else on the page is affected — the class is
   only applied where a select is explicitly wrapped.
   --------------------------------------------------------------- */

.fancy-select { position: relative; }

/* The native select is hidden only once the script has taken over,
   so a page whose JS failed still shows a working dropdown. */
.fancy-select.js-on select { display: none; }

.fancy-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  padding: .7rem .9rem;
  font-family: var(--body);
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease;
}

.fancy-select-button:hover { border-color: var(--sage); }

.fancy-select-button:focus-visible {
  outline: 2px solid var(--tide);
  outline-offset: 2px;
}

.fancy-select.is-open .fancy-select-button { border-color: var(--tide); }

.fancy-select-value { flex: 1 1 auto; }
.fancy-select-value.is-placeholder { color: #9db3b9; }

.fancy-select-caret {
  flex: none;
  color: var(--ink-soft);
  font-size: .75rem;
  transition: transform .15s ease;
}
.fancy-select.is-open .fancy-select-caret { transform: rotate(180deg); }

.fancy-select-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(18, 48, 60, .16);
  overflow: hidden;
  display: none;
}
.fancy-select.is-open .fancy-select-panel { display: block; }

.fancy-select-options {
  max-height: 15rem;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  overscroll-behavior: contain;
}

.fancy-select-option {
  display: flex;
  align-items: center;
  padding: .55rem .9rem;
  font-size: var(--step-0);
  color: var(--ink);
  cursor: pointer;
}

.fancy-select-option:hover,
.fancy-select-option.is-active { background: var(--mist); }

.fancy-select-option.is-active {
  font-weight: 600;
  color: var(--tide-deep);
}

.fancy-select-option.is-placeholder {
  color: var(--ink-soft);
  cursor: default;
}
.fancy-select-option.is-placeholder:hover { background: none; }

/* The clinic booking page: form on the left, opening hours on the
   right on a wide screen. Stacks below 992px.

   Written as a plain CSS grid rather than Bootstrap's row/col, because
   the admin stylesheet does not ship the full Bootstrap grid and the
   row/col classes were being applied inconsistently on this page. The
   grid reflows the same way col-lg did, but with no dependency on
   classes that may not be loaded. */
.book-layout {
  display: grid;
  gap: var(--sp-l);
  margin-top: var(--sp-m);
  grid-template-columns: 1fr;
}

@media (min-width: 992px) {
  .book-layout {
    /* Form takes the larger share; hours is a side note. */
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* =====================================================================
   Hero
   The one bold moment: an oversized Fraunces headline beside a portrait
   framed in an arch. The arch is drawn with border-radius rather than an
   image mask so it scales cleanly and costs nothing.
   ===================================================================== */
.hero {
  position: relative;
  padding-block: var(--sp-2xl) var(--sp-xl);
  background:
    radial-gradient(120% 90% at 88% 8%, var(--tide-quiet) 0%, transparent 55%),
    linear-gradient(180deg, #eef5f6 0%, var(--mist) 62%);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: var(--sp-l);
  align-items: center;
  /* Text column gets the larger minimum, so the portrait is what drops
     below first as the window narrows. */
  grid-template-columns: repeat(auto-fit, minmax(min(23rem, 100%), 1fr));
}

.hero h1 {
  font-variation-settings: 'SOFT' 55, 'WONK' 1, 'opsz' 96;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.028em;
  margin-bottom: var(--sp-m);
}

.hero .lede { max-width: 42ch; font-size: var(--step-1); }

.hero-actions { margin-top: var(--sp-l); }

/* Portrait in an arch */
.hero-figure {
  position: relative;
  margin: 0 0 1.6rem;
  justify-self: center;
  width: 100%;
  max-width: 26rem;
}
.hero-portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 18%;
  border-radius: 46% 46% var(--r-l) var(--r-l) / 38% 38% var(--r-l) var(--r-l);
  background: var(--sage);
}
/* A soft sage panel behind the arch. It sits slightly down and left, so
   the portrait reads as mounted rather than floating, and it cools the
   warm wall in the photograph. */
.hero-figure::before {
  content: '';
  position: absolute;
  inset: 1.6rem -1.4rem -1.4rem 1.6rem;
  background: var(--sage);
  opacity: .5;
  border-radius: 46% 46% var(--r-l) var(--r-l) / 38% 38% var(--r-l) var(--r-l);
  pointer-events: none;
  z-index: 0;
}
.hero-portrait { position: relative; z-index: 1; }

/* Floating rating chip on the portrait */
.hero-chip {
  position: absolute;
  z-index: 2;              /* above the portrait and its backdrop panel */
  left: 50%;
  bottom: -1.1rem;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-lift);
  white-space: nowrap;
  font-size: var(--step--1);
}
.hero-chip-score { font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.hero-chip-label { color: var(--ink-soft); }

/* Trust strip under the hero: plain facts, hairline separated */
.trust {
  display: grid;
  gap: var(--sp-m);
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  padding-top: var(--sp-l);
  margin-top: var(--sp-xl);
  border-top: 1px solid var(--line);
}
.trust-item { text-align: center; }
.trust-figure {
  display: block;
  font-family: var(--display);
  font-variation-settings: 'SOFT' 40, 'opsz' 48;
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1.05;
  color: var(--tide-deep);
  letter-spacing: -0.02em;
}
.trust-label {
  display: block;
  margin-top: .3rem;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

/* =====================================================================
   Steps — a genuine sequence, so numbering is earned
   ===================================================================== */
.steps {
  display: grid;
  gap: var(--sp-l);
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  counter-reset: step;
}
.step { counter-increment: step; }
.step h3 {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  font-size: var(--step-1);
  margin-bottom: var(--sp-xs);
}
/* The number belongs to the heading, not floating above it */
.step h3::before {
  content: counter(step);
  flex: none;
  font-family: var(--body);
  font-size: .72rem;
  font-weight: 700;
  color: var(--tide);
  width: 1.5rem; height: 1.5rem;
  display: grid; place-items: center;
  background: var(--paper);
  border: 1px solid var(--sage);
  border-radius: 50%;
  transform: translateY(-.15em);
}
.step p { color: var(--ink-soft); max-width: 34ch; }

/* =====================================================================
   Feature row — image beside text, alternating
   ===================================================================== */
.feature-figure {
  position: relative;
  margin: 0;
  border-radius: var(--r-l);
  overflow: hidden;
  background: var(--tide-quiet);
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
}
.feature-figure figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--sp-s) var(--sp-m);
  background: linear-gradient(0deg, rgba(18,48,60,.62), transparent);
  color: #fff;
  font-size: var(--step--1);
}
.feature-figure img { width: 100%; height: 100%; object-fit: cover; }
.is-flipped { direction: rtl; }
.is-flipped > * { direction: ltr; }

/* Checked list for reassurance points */
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: var(--sp-s);
  color: var(--ink-soft);
}
.ticks li { padding-left: 2.3rem; margin-bottom: var(--sp-m); }
.ticks li::before {
  content: '';
  position: absolute;
  left: 0; top: .15em;
  width: 1.5rem; height: 1.5rem;
  border-radius: 50%;
  background: var(--tide-quiet);
  border: 1px solid var(--sage);
}
.ticks li::after {
  content: '';
  position: absolute;
  left: .48rem; top: .52em;
  width: .52rem; height: .26rem;
  border-left: 2px solid var(--tide);
  border-bottom: 2px solid var(--tide);
  transform: rotate(-45deg);
}
.ticks strong { display: block; color: var(--ink); font-weight: 600; }

/* =====================================================================
   Closing call to action
   ===================================================================== */
.cta-panel {
  padding: var(--sp-xl);
  background:
    radial-gradient(90% 120% at 85% 15%, rgba(31, 107, 125, .55) 0%, transparent 60%),
    var(--tide-deep);
  border-radius: var(--r-l);
  color: #d3e4e7;
  text-align: center;
}
.cta-panel h2 { color: var(--paper); margin-bottom: var(--sp-s); }
.cta-panel p { color: #b8d2d7; margin-inline: auto; max-width: 46ch; }
.cta-panel .cluster { margin-top: var(--sp-l); }

/* =====================================================================
   Stars and rating summary
   ===================================================================== */
.stars { display: inline-flex; gap: .1rem; line-height: 1; }
.star { font-size: 1.05rem; color: var(--sage); }
.star-on { color: var(--marigold); }

/* Part star: a filled glyph clipped over an empty one.
   The width is set inline per star, because it depends on the rating.
   Renamed from .star-half, which described a fill that was always 50%
   and is no longer what this does. */
.star-part { position: relative; display: inline-block; color: var(--sage); }
.star-part-fill {
  position: absolute; left: 0; top: 0;
  overflow: hidden;
  color: var(--marigold);
  pointer-events: none;
  white-space: nowrap;   /* the clipped glyph must not wrap as it narrows */
}
.stars-lg .star { font-size: 1.5rem; }
.stars-muted .star { color: var(--sage); }
.stars-muted .star-on { color: var(--sage); }

.rating-panel {
  display: grid;
  gap: var(--sp-l);
  /* The score needs only its own width; the bars should take the rest,
     otherwise an equal split leaves the distribution looking cramped. */
  grid-template-columns: minmax(9rem, auto) minmax(min(16rem, 100%), 1fr);
  align-items: center;
  padding: var(--sp-l) var(--sp-xl);
}
@media (max-width: 34rem) {
  .rating-panel { grid-template-columns: 1fr; padding: var(--sp-l); }
}
.rating-score { text-align: center; }
.rating-average {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 40, 'opsz' 144;
  font-size: clamp(3.4rem, 2.2rem + 5vw, 5rem);
  font-weight: 500;
  line-height: .95;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 var(--sp-xs);
}
.rating-count { font-size: var(--step--1); color: var(--ink-soft); margin-top: var(--sp-xs); }

.rating-row {
  display: grid;
  grid-template-columns: 1.4rem 1fr 2.4rem;
  align-items: center;
  gap: var(--sp-s);
  margin-bottom: .45rem;
}
.rating-row:last-child { margin-bottom: 0; }
.rating-row-label { font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); text-align: right; }
.rating-bar { min-width: 6rem; }
.rating-bar { height: .55rem; background: var(--tide-quiet); border-radius: 999px; overflow: hidden; }
.rating-bar .progress-bar { background: var(--marigold); border-radius: 999px; }
.rating-row-count {
  font-size: var(--step--1);
  color: var(--ink-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Review cards */
.review-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-s);
  height: 100%;
  padding: var(--sp-m);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
/* The reviews grid, specifically.

   Wider columns than the default .grid so a wide screen lands on three
   per row rather than four: at the site's shell width the generic
   17rem minimum fits four, and reviews are read, not scanned, so
   larger cards read better. Still reflows down to two on a tablet
   and one on a phone, with no media query.

   12 reviews in 3 columns is 4 neat rows; on a phone it is a single
   column of 12, which is why the batch is small. */
.review-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
}

/* The "Show more" strip below the grid. */
.review-more {
  text-align: center;
  margin-top: var(--sp-l);
}

.review-more-status {
  margin: var(--sp-xs) 0 0;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

/* Once every review is on screen the status line is redundant — the
   button already says "All reviews shown". */
.review-more.is-complete .review-more-status {
  display: none;
}
.review-head { display: flex; align-items: center; gap: var(--sp-s); }
.review-avatar {
  display: grid;
  place-items: center;
  width: 2.5rem; height: 2.5rem;
  flex: none;
  border-radius: 50%;
  background: var(--tide-quiet);
  color: var(--tide-deep);
  font-family: var(--display);
  font-variation-settings: 'SOFT' 60, 'opsz' 24;
  font-size: 1.05rem;
  font-weight: 600;
}
.review-name { font-weight: 600; }
.review-date { font-size: var(--step--1); color: var(--ink-soft); }
/* "From Nepal" under the name. Same size as the date beside it, a
   shade lighter, so it reads as context rather than as a second name. */
.review-from { font-size: var(--step--2); color: var(--ink-soft); opacity: .85; }
.review-body { color: var(--ink); max-width: none; }
.review-card .stars .star { font-size: 1.1rem; }

/* Star input on the review form */
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; }
.star-radio { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* The padding is the point, not decoration.
   A 2rem glyph is about a 32px target, and a finger needs 44px. The
   stars used to sit .15rem apart with nothing around them, which on a
   phone meant aiming at a character. The gap is now padding inside
   each label, so the space between stars is part of a target rather
   than a gap between two. */
.star-label {
  font-size: 2rem;
  line-height: 1;
  padding: .3rem .25rem;
  color: var(--sage);
  cursor: pointer;
  transition: color .12s ease;
  -webkit-tap-highlight-color: transparent;
}

/* The chosen rating. Stated on its own, for every device. */
.star-radio:checked ~ .star-label { color: var(--marigold); }

/* The hover preview, for pointers only.
   A touch screen reports :hover as true after a tap and keeps
   reporting it, so on a phone the old rule left the chosen stars
   looking unselected until the person tapped somewhere else. Inside
   this query it cannot happen: a device with no hover never matches. */
@media (hover: hover) and (pointer: fine) {
  .star-input:hover .star-radio:checked ~ .star-label { color: var(--sage); }
  .star-label:hover,
  .star-label:hover ~ .star-label { color: var(--marigold); }
}

.star-radio:focus-visible + .star-label { outline: 2.5px solid var(--tide); outline-offset: 2px; border-radius: 2px; }

/* Private contact block on the review form */
.private-fields {
  border: 1px dashed var(--sage);
  border-radius: var(--r-m);
  padding: var(--sp-m);
  background: var(--mist);
}
.private-fields-head { font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); }

/* =====================================================================
   Booking tabs — a segmented control.

   The two options are a choice between two paths through the booking
   flow, and the wrong one sends a patient into a form that does not
   fit their case. So the choice is the most important thing on this
   part of the page, and it should read that way: one control with two
   options and an unmistakable selected state.

   Bootstrap still owns the .active class and switches it on click;
   this only styles what Bootstrap has already decided.
   ===================================================================== */
.booking-tabs {
  display: inline-flex;         /* was: display: flex; width: fit-content; */
  flex-wrap: nowrap;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  background: var(--tide-quiet);
  border: 1px solid var(--sage);
  border-bottom: 0;
  border-radius: 999px;
  margin-inline: auto;
}

.booking-tabs .nav-item {
  display: flex;
  flex: 0 0 auto;               /* was: flex: 1 1 auto; */
}

.booking-tabs .nav-link {
  /* Reset everything .nav-tabs puts on a link */
  border: 0;
  border-radius: 999px;

  flex: 1 1 auto;
  min-height: 44px;             /* finger-sized target */
  padding: .65rem 1.4rem;

  font-family: var(--body);
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-soft);
  background: transparent;
  white-space: nowrap;
  text-align: center;

  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

/* The option that is not chosen recedes. Still legible, because a
   patient may need to read it before deciding — but it does not
   compete with the one they have chosen. */
.booking-tabs .nav-link:hover,
.booking-tabs .nav-link:focus-visible {
  color: var(--tide-deep);
  background: rgba(255, 255, 255, .6);
}

/* The chosen option. Solid tide-deep with paper text — the same fill
   as the primary booking button further down the page, so "this is the
   one" reads the same way in both places. It also has weight, not just
   colour, so it is distinguishable without colour vision. */
.booking-tabs .nav-link.active {
  color: var(--paper);
  background: var(--tide-deep);
  box-shadow: 0 2px 6px rgba(20, 73, 90, .18);
}

.booking-tabs .nav-link.active:hover,
.booking-tabs .nav-link.active:focus-visible {
  color: var(--paper);
  background: var(--tide);
}

.booking-tabs .nav-link:focus-visible {
  outline: 2.5px solid var(--tide);
  outline-offset: 3px;
}

/* Short label is off by default. Only the phone media query turns it on. */
.booking-tabs .tab-label-short { display: none; }

/* Phone: force a line break inside each label, so the two options sit
   side by side with the break in the place the label reads best:
   "In-person / clinic visit" and "Online / consultation". The <span>
   stays inline everywhere else, so the desktop labels remain on one
   line. */
@media (max-width: 560px) {
  .booking-tabs .tab-break {
    display: block;
  }

  .booking-tabs {
    display: flex;
    flex-direction: row;
    width: 100%;
    padding: 4px;
    gap: 4px;
    border-radius: 999px;
  }

  .booking-tabs .nav-item {
    flex: 1 1 0;
    display: flex;
    width: auto;
  }

  .booking-tabs .nav-link {
    width: 100%;
    min-height: 60px;
    padding: .55rem .5rem;
    font-size: var(--step-0);
    line-height: 1.2;
    text-align: center;
    border-radius: 999px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
}

/* Clinic choice cards */
.clinic-choice {
  padding: var(--sp-m) var(--sp-m) var(--sp-m) 2.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--paper);
  transition: border-color .15s ease, background-color .15s ease;
}
.clinic-choice .form-check-input { margin-left: -1.85rem; margin-top: .3rem; }
.clinic-choice .form-check-input:checked { background-color: var(--tide); border-color: var(--tide); }
.clinic-choice:has(.form-check-input:checked) { border-color: var(--tide); background: var(--tide-quiet); }
.clinic-choice .form-check-label { cursor: pointer; }

/* Arriving from "Book at this clinic": a short highlight on the card that
   was chosen for the patient, so the pre-selection is noticed rather than
   silently assumed. Motion is dropped for anyone who asks for less of it. */
.clinic-choice-flash {
  border-color: var(--marigold);
  box-shadow: 0 0 0 3px var(--marigold-quiet);
  animation: clinicFlash 2.4s ease-out;
}
@keyframes clinicFlash {
  0%, 55% { background: var(--marigold-quiet); }
  100%    { background: var(--tide-quiet); }
}
@media (prefers-reduced-motion: reduce) {
  .clinic-choice-flash { animation: none; }
}

/* The clinic the practice puts first. Warmer than the plain clinic badge
   so it reads as a distinction, not just another label. */
.badge-primary {
  background: var(--marigold-quiet);
  color: #8a5a00;
  border-color: #eccf94;
}
.clinic-choice .location-badge {
  vertical-align: middle;
  font-size: .68rem;
  padding: .15rem .55rem;
}

/* Location and payment imagery */
.location-badge {
  display: inline-block;
  padding: .25rem .75rem;
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 600;
  border: 1px solid transparent;
}
.badge-clinic   { background: var(--tide-quiet); color: var(--tide-deep); border-color: var(--sage); }
.badge-hospital { background: var(--marigold-quiet); color: #8a5a00; border-color: #eccf94; }

.map-frame {
  position: relative;
  padding-top: 56.25%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
.map-frame iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }

.clinic-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}

.payment-panel { border-left: 3px solid var(--marigold); }
.payment-qr {
  width: 100%;
  max-width: 15rem;
  padding: .6rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
.payment-qr-empty {
  display: grid;
  place-items: center;
  min-height: 12rem;
  background: var(--marigold-quiet);
  border-style: dashed;
  color: var(--ink-soft);
  text-align: center;
  font-size: var(--step--1);
  padding: var(--sp-m);
}
.payment-amount {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 40, 'opsz' 72;
  font-size: var(--step-3);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.05;
  margin-bottom: var(--sp-xs);
}

/* Doctor bio pull-quote on the about page */
.doctor-bio {
  border-left: 2px solid var(--marigold);
  padding-left: var(--sp-m);
  margin-bottom: var(--sp-m);
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink);
}

/* Credentials list */
.cred-list { list-style: none; margin: 0; padding: 0; }
.cred-list li { padding: var(--sp-s) 0; border-bottom: 1px solid var(--line); }
.cred-list li:first-child { border-top: 1px solid var(--line); }
.cred-year { font-weight: 600; color: var(--tide-deep); font-size: var(--step--1); }

/* Service list rows */
.service-row { border-top: 1px solid var(--line); padding-block: var(--sp-m); }
.service-row:last-child { border-bottom: 1px solid var(--line); }
.service-row h3 { margin-bottom: .3rem; font-size: var(--step-1); }
.service-row p { margin-bottom: 0; color: var(--ink-soft); }

/* =====================================================================
   Footer
   ===================================================================== */
.site-footer {
  background: var(--tide-deep);
  color: #b8d2d7;
  font-size: var(--step-0);
  margin-top: 0;
}
.footer-grid {
  display: grid;
  gap: var(--sp-l);
  grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
  padding-block: var(--sp-xl) var(--sp-l);
}
.site-footer p { max-width: 34ch; margin-bottom: var(--sp-xs); }
.footer-name {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 40, 'opsz' 32;
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--paper);
  margin-bottom: var(--sp-xs);
}
.footer-heading {
  font-family: var(--body);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--paper);
  margin-bottom: var(--sp-s);
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .4rem; }
.site-footer a { color: #b8d2d7; text-decoration: none; }
.site-footer a:hover { color: var(--paper); text-decoration: underline; }
.footer-bar {
  padding-block: var(--sp-m) var(--sp-l);
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: var(--step--1);
}
.footer-bar p { margin: 0; max-width: none; }

/* The emergency notice keeps its own line and a readable measure. */
.footer-urgent {
  max-width: 62ch;
  color: #9dbcc3;
  margin-bottom: var(--sp-m) !important;
}

/* The crisis helpline on the public footer and the error page.

   Bold, in the tide colour, no underline at rest — a phone number
   that looks like a link invites a click even from someone who only
   meant to read. The underline appears on hover, so it is still
   recognisable as a link for anyone who looks for one. */
.footer-helpline,
.error-helpline {
  font-weight: 700;
  color: var(--tide);
  text-decoration: none;
  white-space: nowrap;   /* never split the number across two lines */
}

.footer-helpline:hover,
.footer-helpline:focus-visible,
.error-helpline:hover,
.error-helpline:focus-visible {
  color: var(--tide-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* On the dark footer the tide colour is too dark to read. The footer
   link colour is lighter already, so override just the resting state. */
.site-footer .footer-helpline {
  color: var(--paper);
}

/* Copyright at one end, developer credit at the other. They stack on a
   narrow screen rather than crushing together. */
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs) var(--sp-l);
  align-items: baseline;
  justify-content: space-between;
}

.footer-credit { color: #9dbcc3; }
.footer-credit a {
  color: #9dbcc3;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .25);
  padding-bottom: 1px;
}
.footer-credit a:hover { color: var(--paper); border-bottom-color: var(--paper); }

/* =====================================================================
   ADMIN AREA
   Kept deliberately plain and dense: it is a working tool, not a
   showcase. It inherits the new tokens, so its colours follow the
   public site without borrowing the editorial layout.
   ===================================================================== */

/* ---------------------------------------------------------------
   Admin area — sidebar layout
   --------------------------------------------------------------- */
.admin-body { background: #f4f7fa; }

.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 15rem;
  flex: 0 0 15rem;
  background: var(--tide-deep);
  color: #cfe0ee;
  /* The sidebar is also a Bootstrap offcanvas, which sets its own colour
     variables. Without overriding them the panel inherits the light body
     colours and the navigation becomes dark text on a dark ground. */
  --bs-offcanvas-bg: var(--tide-deep);
  --bs-offcanvas-color: #cfe0ee;
  --bs-offcanvas-width: 15rem;
  --bs-offcanvas-border-width: 0;
}
.admin-sidebar .offcanvas-body,
.admin-sidebar .offcanvas-header { color: inherit; background: var(--tide-deep); }

@media (min-width: 992px) {
  /* Above its breakpoint Bootstrap sets background-color: transparent
     !important on a responsive offcanvas, which left light sidebar text
     sitting on the light page background. This wins it back. */
  .admin-sidebar.offcanvas-lg {
    background-color: var(--tide-deep) !important;
    visibility: visible !important;
  }
  .admin-sidebar { position: sticky; top: 0; height: 100vh; display: flex; }

  /* The sidebar is pinned to the viewport height, so on a short window
     the navigation is taller than the space it has. Without this it
     simply overflows and "View site" and "Sign out" become unreachable. */
  .admin-sidebar .offcanvas-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;   /* stop the page scrolling underneath */
  }
}

/* A slim scrollbar that reads on the dark ground, matching the modals */
.admin-sidebar .offcanvas-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .28) transparent;
}
.admin-sidebar .offcanvas-body::-webkit-scrollbar { width: 8px; }
.admin-sidebar .offcanvas-body::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar .offcanvas-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .28);
  border-radius: 999px;
}
.admin-sidebar .offcanvas-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .45);
}

.admin-sidebar-brand {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  padding: 1.25rem 1.25rem 1rem;
}

.admin-sidebar-nav { padding: .5rem 0; }

.admin-sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .65rem 1.25rem;
  color: #cfe0ee;
  text-decoration: none;
  font-size: .97rem;
}
.admin-sidebar-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-sidebar-link.is-active {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  box-shadow: inset 3px 0 0 #fff;
}

.admin-badge {
  background: #fff;
  color: var(--blue-deep);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  padding: .05rem .5rem;
}

.admin-sidebar-foot {
  padding: .75rem 0 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, .15);
}

.admin-content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-topbar-title { font-family: var(--serif); font-weight: 600; }

.admin-main { flex: 1 1 auto; }

/* The panel footer carries two lines now: what the panel is, and who
   built it. Side by side on a desktop, stacked on a phone. */
.admin-footer {
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .35rem 1rem;
}

.admin-footer-credit a { color: inherit; text-decoration: underline; }
.admin-footer-credit a:hover { color: var(--tide); }

/* Summary cards */
.stat-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 4px;
  padding: 1.25rem 1.4rem;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.stat-card-link:hover { border-color: var(--blue); background: var(--blue-tint); color: inherit; }

.stat-number {
  display: block;
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1;
  color: var(--blue-deep);
}
.stat-label { display: block; font-weight: 600; margin-top: .5rem; }
.stat-hint  { display: block; font-size: .88rem; color: var(--ink-soft); }

/* Table */
.admin-table thead th {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: none;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table td { border-color: #eef3f8; }
.admin-table tbody tr:hover { background: #f7fbfe; }

.status-pill {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.status-pending  { background: #fdf4e3; color: #8a5a00; border-color: #eccf94; }
.status-finished { background: var(--blue-tint); color: var(--blue-deep); border-color: #b6d0e4; }

/* Brief highlight after an inline update */
.row-updated { animation: rowFlash 1.6s ease; }
@keyframes rowFlash {
  from { background: #e6f4ea; }
  to   { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .row-updated { animation: none; background: #e6f4ea; }
}

/* Sign-in card, shown without the sidebar */
.login-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2rem;
  margin-top: 5rem;
}
.login-brand {
  font-family: var(--serif);
  color: var(--blue);
  font-size: .95rem;
  margin-bottom: .75rem;
}

/* Review moderation table */
.review-col { min-width: 22rem; max-width: 34rem; }

.review-text { font-size: .95rem; line-height: 1.5; white-space: normal; }

.review-text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.js-toggle-text { color: var(--blue); text-decoration: underline; }

.status-approved {
  background: #e6f2ea;
  color: #1c5c3a;
  border-color: #a9cdb8;
}

.btn-danger-quiet {
  background: transparent;
  border: 1px solid #d9b0ac;
  color: #a4342b;
  font-weight: 600;
}
.btn-danger-quiet:hover, .btn-danger-quiet:focus { background: #fdecea; color: #8a2b23; }

/* Password strength meter on the settings page */
.password-meter {
  height: 5px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.password-meter-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width .2s ease, background-color .2s ease;
}

.meter-1 { background: #c0392b; }
.meter-2 { background: #d98c1c; }
.meter-3 { background: #4a8f5b; }
.meter-4 { background: #1c5c3a; }

/* ---------------------------------------------------------------
   Online consultation
   --------------------------------------------------------------- */

/* Admin: QR preview and the patient-facing preview box */
.qr-preview {
  width: 100%;
  max-width: 12rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  padding: .5rem;
}

.qr-preview-empty {
  display: grid;
  place-items: center;
  min-height: 9rem;
  background: var(--blue-tint);
  color: var(--ink-soft);
  font-size: .9rem;
}

.preview-box {
  background: var(--blue-tint);
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 1rem;
}

/* Appointment type pill */
.type-pill {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.type-clinic { background: #eef4f9; color: var(--blue-deep); border-color: #c3d8e8; }
.type-online { background: #f0eefa; color: #443a7a; border-color: #cdc6ea; }

/* Third status, alongside pending and finished */
.status-verified { background: #e6f2ea; color: #1c5c3a; border-color: #a9cdb8; }

/* Clinic schedule table */
.admin-table td .type-pill { font-size: .75rem; }

/* ---------------------------------------------------------------
   Bookable clinic vs hospital
   --------------------------------------------------------------- */
.location-badge {
  display: inline-block;
  padding: .2rem .7rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-clinic   { background: var(--blue-tint); color: var(--blue-deep); border-color: #b6d0e4; }
.badge-hospital { background: #fdf4e3; color: #8a5a00; border-color: #eccf94; }

/* The hospital toggle reads as a decision, so it gets a boxed row */
.hospital-switch {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .9rem 1rem .9rem 3.2rem;
  background: #fff;
}
.hospital-switch .form-check-input { margin-left: -2.4rem; margin-top: .25rem; }
.hospital-switch .form-check-input:checked {
  background-color: #c8860d;
  border-color: #c8860d;
}
.hospital-switch:has(.form-check-input:checked) {
  background: #fdf4e3;
  border-color: #eccf94;
}
.hospital-switch .form-check-label { cursor: pointer; }

/* ---------------------------------------------------------------
   Reviews: rating summary and review cards
   --------------------------------------------------------------- */
.rating-panel { padding: 1.75rem 2rem; }

.rating-average {
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 4rem);
  font-weight: 600;
  line-height: 1;
  color: var(--blue-deep);
}

.stars-lg .star { font-size: 1.6rem; }
.stars-muted .star { color: var(--line); }

/* One row per star level: label, bar, count */
.rating-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr 3rem;
  align-items: center;
  gap: .75rem;
  margin-bottom: .5rem;
}
.rating-row:last-child { margin-bottom: 0; }

.rating-row-label {
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
.rating-row-label .star { font-size: .9rem; }

.rating-bar {
  height: .6rem;
  background: var(--blue-tint);
  border-radius: 999px;
}
.rating-bar .progress-bar {
  background: var(--blue);
  border-radius: 999px;
}

.rating-row-count {
  font-size: .9rem;
  color: var(--ink-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Individual review cards */
.review-head { display: flex; align-items: center; gap: .75rem; }

.review-avatar {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 2.5rem;
  border-radius: 50%;
  background: var(--blue-tint);
  color: var(--blue-deep);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
}

.review-name { font-weight: 600; }
.review-body { color: var(--ink); }

/* .review-date is defined once, further up with .review-from beside it.
   It was declared twice, and this later copy hardcoded .85rem where the
   first used var(--step--1), so the token was quietly overridden and
   the date stopped scaling with the rest of the type. */

@media (max-width: 575.98px) {
  .rating-row { grid-template-columns: 2.8rem 1fr 2.5rem; gap: .5rem; }
  .rating-panel { padding: 1.25rem; }
}

/* Status and type pills in the admin tables */
.status-pending  { background: var(--marigold-quiet); color: #8a5a00; border-color: #eccf94; }
.status-verified { background: #e8f2ec; color: #1d5a3c; border-color: #a9cdb8; }
.status-approved { background: #e8f2ec; color: #1d5a3c; border-color: #a9cdb8; }
.status-finished { background: var(--tide-quiet); color: var(--tide-deep); border-color: var(--sage); }

.type-clinic { background: var(--tide-quiet); color: var(--tide-deep); border-color: var(--sage); }
.type-online { background: #efedf9; color: #443a7a; border-color: #cdc6ea; }

/* Clinic thumbnails in the locations table */
.clinic-thumb {
  width: 5rem;
  height: 3.4rem;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--tide-quiet);
}
.clinic-thumb-empty {
  display: grid;
  place-items: center;
  font-size: .72rem;
  color: var(--ink-soft);
  text-align: center;
}

/* Reviewer contact column: private data, admin only */
.contact-cell { font-size: .88rem; white-space: nowrap; }

/* QR preview and patient-facing preview box in Online Settings */
.qr-preview {
  width: 100%;
  max-width: 12rem;
  padding: .5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
}
.qr-preview-empty {
  display: grid;
  place-items: center;
  min-height: 9rem;
  background: var(--tide-quiet);
  color: var(--ink-soft);
  font-size: .9rem;
}
.preview-box {
  background: var(--tide-quiet);
  border: 1px dashed var(--sage);
  border-radius: var(--r-s);
  padding: var(--sp-m);
}

/* Doctor profile preview */
.doctor-preview {
  width: 100%;
  max-width: 14rem;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  object-fit: cover;
}

/* Brief highlight after an inline update */
.row-updated { animation: rowFlash 1.6s ease; }
@keyframes rowFlash {
  from { background: #e6f4ea; }
  to   { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .row-updated { animation: none; background: #e6f4ea; }
}

/* Admin figures reused from the old sheet */
.figure-row { display: flex; flex-wrap: wrap; gap: var(--sp-l); }
.figure-item { border-left: 2px solid var(--tide); padding-left: var(--sp-s); }
.figure-number {
  display: block;
  font-family: var(--display);
  font-variation-settings: 'SOFT' 40, 'opsz' 48;
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1.05;
  color: var(--tide-deep);
}
.figure-label { font-size: var(--step--1); color: var(--ink-soft); }

/* Review text clamp in the moderation table */
.review-text { font-size: .95rem; line-height: 1.5; }
.review-text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.js-toggle-text { color: var(--tide); }

/* The admin area keeps the plain body background */
.admin-body { background: #f2f6f7; }

/* ---------------------------------------------------------------
   Modals whose <form> wraps the header, body and footer
   ---------------------------------------------------------------
   Bootstrap expects .modal-body to be a direct flex child of
   .modal-content so it can shrink and scroll. When a form sits between
   them the chain breaks: the body keeps its natural height and pushes
   the footer — and the save button with it — off the bottom of the
   screen. Passing the flex context through the form restores it.
   --------------------------------------------------------------- */
.modal-content > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  width: 100%;
}
.modal-content > form > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.modal-content > form > .modal-header,
.modal-content > form > .modal-footer { flex: 0 0 auto; }

/* Modal chrome, matched to the rest of the panel */
.modal-content { border: 1px solid var(--line); border-radius: var(--r-m); }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-title { font-family: var(--display); font-variation-settings: 'SOFT' 40, 'opsz' 32; }

/* ---------------------------------------------------------------
   Photo library
   --------------------------------------------------------------- */
.photo-grid {
  display: grid;
  gap: var(--sp-m);
  grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr));
}

.photo-item {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.photo-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--tide-quiet);
  display: block;
}
.photo-item figcaption {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .7rem .8rem;
  border-top: 1px solid var(--line);
}

.photo-tag {
  display: inline-block;
  align-self: flex-start;
  max-width: 100%;
  padding: .12rem .6rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
  background: var(--mist);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-tag-used { background: var(--tide-quiet); color: var(--tide-deep); border-color: var(--sage); }
.photo-tag-free { background: var(--marigold-quiet); color: #8a5a00; border-color: #eccf94; }

.photo-meta { font-size: .76rem; color: var(--ink-soft); }
.photo-actions { margin-top: .1rem; }

/* ---------------------------------------------------------------
   Weekday picker in the schedule form
   Chips rather than a list of checkboxes: a week is seven fixed things,
   and seeing them in a row makes a rota legible at a glance.
   --------------------------------------------------------------- */
.day-picker { display: flex; flex-wrap: wrap; gap: .4rem; }

.day-chip { position: relative; cursor: pointer; }
.day-chip input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.day-chip span {
  display: block;
  min-width: 3.1rem;
  padding: .45rem .6rem;
  text-align: center;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.day-chip:hover span { border-color: var(--sage); }
.day-chip input:checked + span {
  background: var(--tide-deep);
  border-color: var(--tide-deep);
  color: #fff;
}
.day-chip input:focus-visible + span { outline: 2.5px solid var(--tide); outline-offset: 2px; }

.monthly-visit {
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  padding: var(--sp-s) var(--sp-m) var(--sp-m);
}
.monthly-visit legend { font-size: .88rem; }

/* ---------------------------------------------------------------
   Scrollable modal bodies
   A long form that scrolls with no visible scrollbar reads as a form
   with missing fields. These make the overflow obvious: a permanent
   slim scrollbar, and a soft fade at the bottom edge that disappears
   once you reach the end.
   --------------------------------------------------------------- */
.modal-body {
  scrollbar-width: thin;
  scrollbar-color: var(--sage) transparent;
  scroll-behavior: smooth;
}
.modal-body::-webkit-scrollbar { width: 10px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb {
  background: var(--sage);
  border: 3px solid var(--paper);
  border-radius: 999px;
}
.modal-body::-webkit-scrollbar-thumb:hover { background: #a9c6c1; }

/* The fade sits on the body's own background so it scrolls away at the
   end of the content rather than hovering permanently. */
.modal-body {
  background:
    linear-gradient(var(--paper) 30%, rgba(255,255,255,0)) top / 100% 2.4rem no-repeat local,
    linear-gradient(rgba(255,255,255,0), var(--paper) 70%) bottom / 100% 2.4rem no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(18,48,60,.10), rgba(0,0,0,0)) top / 100% .7rem no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(18,48,60,.10), rgba(0,0,0,0)) bottom / 100% .7rem no-repeat scroll;
  background-color: var(--paper);
}

/* Monthly visits sit side by side, so the fieldset is also a grid column */
.monthly-visit.col-md-6 { padding-top: var(--sp-s); }

/* ---------------------------------------------------------------
   Logo mark in the footer and the admin sidebar
   Both sit on dark ground, so the mark is drawn in the palest text
   colour rather than the brand teal, which would disappear.
   --------------------------------------------------------------- */
.footer-mark {
  display: block;
  width: 1.6rem;
  height: 1.6rem;
  margin-bottom: var(--sp-xs);
  color: #b8d2d7;
  opacity: .85;   /* the footer is supporting information, not a masthead */
}
/* max-width as well as width, so the mark cannot outgrow its box even
   if this rule loads late or a parent has no width of its own. */
.footer-mark svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  display: block;
}

.admin-brand-mark {
  display: inline-block;
  width: 1.6rem;
  height: 1.6rem;
  vertical-align: -0.3rem;
  margin-right: .4rem;
  color: #cfe0ee;
}
.admin-brand-mark svg { width: 100%; height: 100%; display: block; }


/* ---------------------------------------------------------------
   Social links in the footer
   Icon-only, because the platforms are recognisable by their marks and
   the names would crowd the column. Each still carries a visually
   hidden label for screen readers and a title on hover.
   --------------------------------------------------------------- */
.social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  list-style: none;
  margin: var(--sp-m) 0 0;
  padding: 0;
}

.social-link {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 50%;
  color: #b8d2d7;
  /* A hairline ring rather than a filled tile: at this size a solid
     background competes with the text beside it. */
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .22);
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.social-link svg {
  width: 1rem;
  height: 1rem;
  max-width: 100%;
  display: block;
}

.social-link:hover,
.social-link:focus-visible {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--tide-deep);
  text-decoration: none;
}

/* ---------------------------------------------------------------
   Payment method chooser (online booking confirmation)

   Without JavaScript every QR panel stays visible, stacked. The
   script adds .is-switchable, and only then does hiding start. A
   patient with scripts off gets all the QR codes rather than none.
   --------------------------------------------------------------- */

.payment-switch {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.payment-switch-btn {
  --brand: var(--tide);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 92px;
  padding: .5rem .9rem;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.payment-switch-btn:hover { border-color: var(--brand); }

/* The selected state leans on the border and ring rather than a strong
   fill. A brand-coloured wash behind a logo fights whatever colours the
   logo itself uses: green behind eSewa's green circle flattens it, and a
   dark wash would bury the black lettering. A pale tint plus a definite
   border reads as chosen without doing that. */
.payment-switch-btn.is-active {
  border-color: var(--brand);
  border-width: 2px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
  background: color-mix(in srgb, var(--brand) 10%, #fff);
}

/* color-mix is recent; older browsers simply get the border alone. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .payment-switch-btn.is-active { background: var(--mist); }
}

/* One method is not a choice.

   No selected ring, no hover, no pointer: the logo is there to say
   which bank or wallet the QR below belongs to, not to be pressed.
   Placed after .is-active so it wins whatever classes are on it. */
.payment-switch-btn.is-single {
  border-color: var(--line);
  border-width: 1.5px;
  box-shadow: none;
  background: #fff;
  cursor: default;
}

.payment-switch-btn.is-single:hover { border-color: var(--line); }

.payment-switch-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Logos vary wildly in aspect ratio, so the height is fixed and the
   width follows, rather than squashing anything into a box.

   Tall enough that a wordmark beside a symbol stays readable: at 26px a
   lockup like eSewa's shrank until only the green circle registered and
   the letters beside it turned to mush. Crop any trailing web address
   off a logo before uploading it, for the same reason: it eats height
   the name needs and is unreadable at this size regardless. */
.payment-logo {
  height: 30px;
  width: auto;
  max-width: 164px;
  object-fit: contain;
  display: block;
}

/* Bank lockups run much wider than the wallet marks: a symbol plus the
   bank's full name can be eight times as wide as it is tall. Capped at
   132px they hit the width limit first and shrank to two thirds height,
   so the name went small again. The wider cap lets them stand at full
   height; the buttons wrap onto another line if they need to. */

.payment-logo-text {
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.2;
  color: var(--brand);
}

.payment-method-panel + .payment-method-panel { margin-top: 1.25rem; }

.payment-methods.is-switchable .payment-method-panel { display: none; }
.payment-methods.is-switchable .payment-method-panel.is-active { display: block; }
.payment-methods.is-switchable .payment-method-panel + .payment-method-panel { margin-top: 0; }

.payment-method-name {
  margin: .5rem 0 0;
  font-weight: 600;
  font-size: .9rem;
  color: var(--ink);
}

/* Small preview of an uploaded QR or logo, in the admin panel. */
.qr-thumb {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  flex: none;
}

/* A quiet advisory: something worth reading, but not an error and not a
   warning. Amber rather than red, because the most common reason for it
   to appear is entirely innocent. */
.notice-soft {
  border: 1px solid #eccf94;
  border-left: 4px solid var(--marigold);
  background: var(--marigold-quiet);
  border-radius: 8px;
  padding: .6rem .8rem;
  font-size: .87rem;
  line-height: 1.5;
}
.notice-soft p:last-child { margin-bottom: 0; }

/* The detail is collapsed by default, so the note costs two lines of
   screen until someone actually wants the explanation. */
.notice-more > summary {
  cursor: pointer;
  font-weight: 600;
  color: #8a5a00;
  list-style: none;
}
.notice-more > summary::-webkit-details-marker { display: none; }
.notice-more > summary::after {
  content: " \203A";
  display: inline-block;
  transition: transform .15s ease;
}
.notice-more[open] > summary::after { transform: rotate(90deg); }
.notice-more > summary:focus-visible { outline: 2px solid var(--marigold); outline-offset: 2px; }
.notice-more > p { margin-top: .4rem; }

/* Once it is open on desktop the summary is a close control, so it reads
   as a quieter label rather than a call to action. */
@media (min-width: 768px) {
  .notice-more[open] > summary { font-weight: 500; opacity: .75; }
}

/* ---------------------------------------------------------------
   Open-day buttons on the booking form

   A browser's date box cannot grey out individual days, so the days
   the clinic actually opens are offered as buttons above it. Hidden
   until a clinic is chosen, and hidden entirely without JavaScript.
   --------------------------------------------------------------- */

.date-quickpick {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .55rem;
}

.date-chip {
  padding: .35rem .7rem;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--tide-deep, #14495a);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s ease, background .15s ease;
}

.date-chip:hover { border-color: var(--tide); }

.date-chip.is-active {
  border-color: var(--tide);
  background: var(--tide-quiet);
}

.date-chip:focus-visible {
  outline: 2px solid var(--tide);
  outline-offset: 2px;
}

/* Fingers need a bigger target than a mouse pointer. */
@media (max-width: 575px) {
  .date-chip { padding: .45rem .8rem; font-size: .88rem; }
}

/* The Nepali date for whatever is in the browser's date box. Shown
   underneath it, because the box itself only ever displays Gregorian. */
.date-bs-echo {
  margin: .4rem 0 0;
  font-size: .9rem;
  font-weight: 600;
  color: var(--tide-deep, #14495a);
}

/* The single "next available" button. One decision, not six: the patient
   almost always wants the soonest opening, and the calendar below covers
   everything else. */
.date-chip-next {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .1rem;
  padding: .45rem .9rem;
  border-radius: 10px;
  text-align: left;
}

.date-chip-lead {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ink-soft, #56707c);
}

.date-chip-date { font-size: .92rem; font-weight: 700; }

/* A missed or cancelled appointment. Muted rather than alarming: it is a
   closed record, not a problem needing attention. */
.status-cancelled {
  background: #f1f3f4;
  color: #6b7780;
  border-color: #dde2e5;
  text-decoration: line-through;
}

/* ---------------------------------------------------------------
   Grouped sidebar items (Clinic Settings)

   The group is rendered open whenever the current page is one of its
   own, so with JavaScript off the links are always visible rather than
   unreachable.
   --------------------------------------------------------------- */

.admin-nav-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.admin-nav-caret {
  transition: transform .15s ease;
  opacity: .7;
  font-size: 1.05rem;
  line-height: 1;
}

.admin-nav-group.is-open .admin-nav-caret { transform: rotate(90deg); }

.admin-nav-sub { padding-left: .55rem; }

.admin-sidebar-sublink {
  font-size: .92rem;
  padding-left: 1.4rem;
  opacity: .92;
}

@media (prefers-reduced-motion: reduce) {
  .admin-nav-caret { transition: none; }
}

/* A clinic's two rates, shown on its own card because the fee belongs
   to the clinic rather than to the practice. */
.clinic-fee-note {
  color: var(--tide-deep, #14495a);
  font-weight: 600;
}

/* A logo that needs something behind it.

   Almost every bank's artwork is dark and sits happily on the white
   button. Agricultural Development Bank sets its name in white, the way
   it appears on the green band across its own site, so on white the seal
   shows and the name disappears. Those logos get their own background,
   named per bank in includes/online.php. */
.payment-logo.has-bg {
  background: var(--logo-bg, transparent);
  padding: 3px 6px;
  border-radius: 5px;
  box-sizing: content-box;
}


/* The footer and panel marks are artwork now, not shapes that inherit
   the surrounding text colour, so they need sizing rather than a fill. */
.footer-mark img,
.admin-brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* "Developed by" reveals a second name when clicked. Styled as text
   rather than a button so the credit line still reads as one sentence,
   with a dotted underline as the only hint that it does something. */
.footer-credit-toggle {
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Deliberately indistinguishable from the text around it: no underline,
   no colour change. It reads as part of the sentence, and the reveal is
   a small thing to come across rather than something being advertised.
   The focus ring stays, so it is still reachable by keyboard. */
.footer-credit-toggle:hover { color: inherit; }

.footer-credit-toggle:focus-visible {
  outline: 2px solid var(--tide);
  outline-offset: 2px;
  border-radius: 2px;
}

/* =====================================================================
   Phone field with country picker

   The flag button, the dialling code and the number sit in one bordered
   group so they read as a single control rather than three. The picker
   is absolutely positioned under it, above everything else on the form.
   ===================================================================== */
.phone-field { position: relative; }

/* The native select stays in the DOM for forms without JavaScript. The
   script adds .js-on once it has taken over, which is what hides it. */
.phone-field.js-on .phone-cc-select { display: none; }

.phone-cc-button {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .45rem .55rem;
  border: 1px solid var(--line, #dbe6e7);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: #fff;
  line-height: 1;
}
.phone-cc-button:hover { background: var(--mist, #f4f8f9); }
.phone-cc-button:focus-visible {
  outline: 2px solid var(--sea, #14495a);
  outline-offset: -1px;
  z-index: 2;
}

/* Country flags in the phone field.

   SVG images, one per country, served from /images/flags/. Sized by
   width and height on the <img> element, so there is no layout shift
   while they load. The rounded corner matches the site's shape
   language rather than the rectangular flag corner. */
.flag-icon {
  display: inline-block;
  vertical-align: middle;
  width: 20px;
  height: 15px;
  border-radius: 2px;
  object-fit: cover;
  flex: none;
}

/* The phone field's flag slot. Was sized for an emoji glyph; now it
   holds an <img>, so the alignment changes slightly. Same visual
   result, but stable across platforms. */
.phone-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  line-height: 1;
}

.phone-caret { font-size: .7rem; color: var(--muted, #6b8189); }

.phone-dial {
  background: #fff;
  border-left: 0;
  border-right: 0;
  padding-left: 0;
  padding-right: .35rem;
  color: var(--muted, #6b8189);
}

.phone-number { border-left: 0; }

/* The picker */
.phone-dropdown {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  width: min(22rem, 100%);
  background: #fff;
  border: 1px solid var(--line, #dbe6e7);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(18, 48, 60, .16);
  overflow: hidden;
}

.phone-search {
  position: relative;
  padding: .5rem;
  border-bottom: 1px solid var(--line, #dbe6e7);
}
.phone-search input { padding-left: 2rem; }
.phone-search-icon {
  position: absolute;
  left: 1.05rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted, #6b8189);
  pointer-events: none;
}

.phone-options {
  max-height: 15rem;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  overscroll-behavior: contain;   /* stop the page scrolling behind it */
}

.phone-option {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  padding: .5rem .7rem;
  border: 0;
  background: none;
  text-align: left;
  font-size: .92rem;
  cursor: pointer;
}
.phone-option:hover,
.phone-option.is-active { background: var(--mist, #f4f8f9); }

.phone-option-name { flex: 1 1 auto; }

/* The part that matched what was typed, so the reason a row is in the
   list is visible at a glance. */
.phone-option-name mark {
  background: none;
  font-weight: 700;
  color: inherit;
  padding: 0;
}

.phone-option-dial { color: var(--muted, #6b8189); font-variant-numeric: tabular-nums; }

.phone-empty { padding: .8rem .7rem; margin: 0; color: var(--muted, #6b8189); font-size: .9rem; }

/* =====================================================================
   Appointment slip viewer

   The slip is HTML, not an embedded PDF. Chrome on Android has no
   built-in PDF viewer, so a framed PDF showed a broken-document icon
   and nothing else, and the clinic desk runs on phones.
   ===================================================================== */
.slip-viewer {
  padding: 0;
  background: #eef2f3;
  max-height: 68vh;
  overflow-y: auto;
}

.slip-loading,
.slip-problem {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted, #6b8189);
}

.slip-sheet {
  background: #fff;
  margin: .75rem;
  padding: 1.1rem 1.2rem;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(18, 48, 60, .12);
  font-size: .92rem;
  line-height: 1.5;
  color: var(--ink, #12303c);
}

.slip-head {
  text-align: center;
  padding-bottom: .7rem;
  margin-bottom: .9rem;
  border-bottom: 1px solid var(--line, #dbe6e7);
}
.slip-head p { margin: 0; }
.slip-doctor { font-weight: 700; font-size: 1.05rem; }
.slip-kind   { color: var(--muted, #6b8189); font-size: .85rem; }
.slip-ref    { margin-top: .3rem; font-weight: 700; letter-spacing: .04em; }

.slip-list { margin: 0; }

/* Label and value on one line, wrapping to two when the value is long
   rather than squeezing the address into a narrow column. */
.slip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .6rem;
  padding: .32rem 0;
  border-bottom: 1px dashed #e6eced;
}
.slip-row:last-child { border-bottom: 0; }
.slip-row dt {
  flex: 0 0 6.5rem;
  color: var(--muted, #6b8189);
  font-weight: 400;
}
.slip-row dd { flex: 1 1 10rem; margin: 0; font-weight: 600; }

.slip-qr-set {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}
.slip-qr { margin: 0; text-align: center; }
.slip-qr img {
  width: 8.5rem;
  height: 8.5rem;
  object-fit: contain;
  border: 1px solid var(--line, #dbe6e7);
  border-radius: 6px;
  padding: .25rem;
  background: #fff;
}
.slip-qr figcaption {
  margin-top: .3rem;
  font-size: .78rem;
  color: var(--muted, #6b8189);
}

.slip-foot {
  margin-top: 1rem;
  padding-top: .7rem;
  border-top: 1px solid var(--line, #dbe6e7);
  text-align: center;
  font-size: .82rem;
  color: var(--muted, #6b8189);
}
.slip-foot p { margin: 0 0 .2rem; }
.slip-note { font-style: italic; }

/* ---------------------------------------------------------------------
   Printing

   Everything on the page is hidden and the sheet alone is shown.
   visibility rather than display, because display:none on an ancestor
   would take the sheet with it whatever is set on the sheet itself.
   --------------------------------------------------------------------- */
@media print {
  body * { visibility: hidden; }

  #slipModal,
  #slipModal .modal-dialog,
  #slipModal .modal-content,
  #slipModal .slip-viewer,
  #slipModal .slip-sheet,
  #slipModal .slip-sheet * { visibility: visible; }

  /* Out of the dialog and onto the page. */
  #slipModal {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    overflow: visible;
    background: #fff;
  }
  #slipModal .modal-dialog { max-width: none; margin: 0; }
  #slipModal .modal-content { border: 0; box-shadow: none; }
  #slipModal .slip-viewer {
    max-height: none;
    overflow: visible;
    background: #fff;
  }
  #slipModal .slip-sheet {
    margin: 0;
    box-shadow: none;
    border-radius: 0;
  }

  /* Chrome and Bootstrap each dim the page behind a dialog; neither
     should end up as grey ink across the sheet. */
  #slipModal .modal-header,
  #slipModal .modal-footer,
  .modal-backdrop { display: none !important; }
}

/* The "Clinic contact" heading above the slip's footer details. */
.slip-contact-label {
  font-weight: 700;
  color: var(--ink, #12303c);
  margin-bottom: .15rem !important;
}

/* =====================================================================
   Cloudflare Turnstile

   The widget is an iframe Cloudflare controls, so nothing inside it can
   be styled. What is left is where it sits and how much room it gets,
   which is enough to stop it looking bolted on.

   data-size="flexible" makes it take the full width of its container,
   so it lines up with the inputs above it rather than sitting in a
   300px block of its own.
   ===================================================================== */
.cf-turnstile {
  margin-block: 1rem;
}

/* Flexible has a 300px floor. A narrow phone, once card padding is
   taken off, can leave less room than that, and the widget would push
   the page sideways. Scaled down rather than allowed to overflow, with
   the height reserved by hand because a transform does not change the
   space an element occupies. */
@media (max-width: 360px) {
  .cf-turnstile {
    transform: scale(.88);
    transform-origin: left center;
    height: calc(65px * .88);
  }
}

/* On a wide screen the form itself is narrow, so the widget is already
   the right width. This only stops it stretching absurdly if it is ever
   dropped into a full-width panel. */
@media (min-width: 768px) {
  .cf-turnstile { max-width: 34rem; }
}

/* =====================================================================
   Password field with a show/hide eye
   ===================================================================== */
.password-wrap { position: relative; }

/* Room for the button, so a long password does not run underneath it. */
.password-wrap .form-control { padding-right: 3rem; }

.password-eye {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 2.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft, #6b8189);
  cursor: pointer;
  border-radius: 0 8px 8px 0;
  -webkit-tap-highlight-color: transparent;
}

.password-eye:hover { color: var(--ink, #12303c); }

.password-eye:focus-visible {
  outline: 2px solid var(--tide, #14495a);
  outline-offset: -2px;
}

.password-eye svg {
  width: 1.3rem;
  height: 1.3rem;
  display: block;
}

/* ---------------------------------------------------------------
   Pagination

   Rendered once as a full desktop pager and trimmed by media
   queries for smaller screens, so the three layouts cannot drift
   apart. Same shape on every device, fewer numbers as it narrows.
   --------------------------------------------------------------- */

.pager {
  display: flex;
  flex-direction: column;
  gap: var(--sp-s);
  margin-top: var(--sp-m);
  padding: var(--sp-m) var(--sp-l);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}

.pager-count {
  margin: 0;
  align-self: flex-start;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.pager-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pager-list > li {
  margin: 0;
  padding: 0;
}

.pager-label-short {
  font-size: 1.35rem;
  line-height: 1;
  transform: translateY(-1px);
}

.pager-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 .75rem;
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 1;
  color: var(--tide-deep);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color .15s ease,
    background-color .15s ease,
    color .15s ease;
}

.pager-link:hover,
.pager-link:focus-visible {
  border-color: var(--tide);
  background: var(--tide-quiet);
  color: var(--tide-deep);
  text-decoration: none;
}

.pager-link.is-current {
  background: var(--tide-deep);
  border-color: var(--tide-deep);
  color: var(--paper);
  cursor: default;
}

.pager-link.is-off {
  color: var(--ink-soft);
  opacity: .45;
  cursor: default;
  pointer-events: none;
}

.pager-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 2.25rem;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

/* Desktop shows "Previous" and "Next" as words. The short form is
   the arrow shown on a narrow screen. */
.pager-label-short { display: none; }

/* Tablet and below: drop the ±2 numbers. The window shrinks to
   current ±1, plus the first and last pages. */
@media (max-width: 991.98px) {
  .pager-list > li.pager-far { display: none; }
}

/* Phone: also drop the first and last numbers. Only the current ±1
   and the two ellipses remain. Prev/Next collapse to arrows, and the
   touch targets grow to 44px. */
@media (max-width: 575.98px) {
  .pager-list > li.pager-first,
  .pager-list > li.pager-last { display: none; }

  .pager-label-full { display: none; }
  .pager-label-short { display: inline-flex; }

  .pager-link,
  .pager-gap {
    height: 2.75rem;
    min-width: 2.75rem;
  }
  }
  /* ---------------------------------------------------------------
   The error page

   Uses the same panel, palette and buttons as the rest of the site,
   so an error reads as part of the practice rather than as a
   browser fault. The status code is set large and quiet — visible,
   not alarming.
   --------------------------------------------------------------- */
.error-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: var(--sp-xl) var(--sp-l);
  text-align: center;
  max-width: 38rem;
  margin-inline: auto;
}

@media (min-width: 992px) {
  .error-panel {
    max-width: 46rem;
    padding: var(--sp-2xl) var(--sp-xl);
  }
}

.error-code {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 40, 'opsz' 144;
  font-size: clamp(3.5rem, 1.75rem + 7.5vw, 9rem);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -0.04em;
  color: var(--sage);
  margin: 0 0 var(--sp-m);
}

.error-title {
  font-size: var(--step-2);
  margin-bottom: var(--sp-s);
}

.error-body {
  color: var(--ink-soft);
  font-size: var(--step-1);
  line-height: 1.55;
  max-width: 42ch;
  margin-inline: auto;
  margin-bottom: var(--sp-l);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-s);
  margin-bottom: var(--sp-l);
}

.error-urgent {
  font-size: var(--step--1);
  color: var(--ink-soft);
  max-width: 44ch;
  margin-inline: auto;
  margin-bottom: 0;
  padding-top: var(--sp-m);
  border-top: 1px solid var(--line);
}

/* Phones held in landscape.
   The viewport width jumps (from ~400px to ~800px) but the physical
   height is short. The usual fluid type grows for a desktop that
   does not exist; this brings it back down and shortens the vertical
   padding so the panel fits without scrolling. */
@media (max-height: 500px) and (orientation: landscape) {
  .band {
    padding-block: var(--sp-m);
  }

  .error-panel {
    max-width: 42rem;
    padding: var(--sp-m) var(--sp-l);
  }

  .error-code {
    font-size: 3rem;
    margin-bottom: var(--sp-s);
  }

  .error-title {
    font-size: var(--step-1);
  }

  .error-body {
    font-size: var(--step-0);
    margin-bottom: var(--sp-m);
  }

  .error-actions {
    margin-bottom: var(--sp-m);
    gap: var(--sp-xs);
  }

    .error-urgent {
    padding-top: var(--sp-s);
  }
}

/* Inactive booking tabs... */
#clinic-pane:not(.active),
#online-pane:not(.active) {
  display: none !important;
}
#clinic-pane.active,
#online-pane.active {
  display: block !important;
  opacity: 1 !important;
}
