/* =====================================================================
   ArtisanNow - Core Stylesheet
   Vanilla CSS, no preprocessor, no framework.
   Supports IE9+ gracefully and modern browsers fully.
   ===================================================================== */

:root {
  --bg:          #0d1117;
  --bg-2:        #131b24;
  --panel:       #18222f;
  --panel-2:     #1e2a38;
  --border:      #2a3947;
  --border-soft: #223040;

  --text:        #e6edf3;
  --text-dim:    #93a4b6;
  --text-faint:  #63758a;

  --accent:      #ff7a2f;
  --accent-2:    #ff9a5c;
  --accent-dim:  rgba(255,122,47,0.14);

  --green:       #2ecc71;
  --green-dim:   rgba(46,204,113,0.14);
  --blue:        #3b9dff;
  --blue-dim:    rgba(59,157,255,0.14);
  --amber:       #ffb020;
  --amber-dim:   rgba(255,176,32,0.14);
  --red:         #ff5d5d;
  --red-dim:     rgba(255,93,93,0.14);
  --purple:      #a77dff;

  --radius:      10px;
  --radius-sm:   7px;
  --radius-lg:   16px;

  /* Translucent surface for sticky/floating panels (header, map
     overlays). Needs its own variable because these sit over page
     content and must stay semi-transparent in both themes. */
  --glass:       rgba(19,27,36,0.92);
  --glass-solid: rgba(24,34,47,0.94);

  --shadow:      0 4px 20px rgba(0,0,0,0.35);
  --shadow-lg:   0 18px 50px rgba(0,0,0,0.5);

  --header-h:    62px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

h1,h2,h3,h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }

p { margin: 0 0 1em; }
small { font-size: 12.5px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: #2e3d4e; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #3c4f64; }

/* ---------------------------------------------------------------
   LAYOUT
   --------------------------------------------------------------- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 560px; }
.container-mid { max-width: 920px; }

.page-body { flex: 1; padding: 24px 0 60px; }

/* ---------------------------------------------------------------
   HEADER
   --------------------------------------------------------------- */
.site-header {
  height: var(--header-h);
  background: var(--glass);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 500;
  backdrop-filter: blur(10px);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #ff5722);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
  box-shadow: 0 3px 10px rgba(255,122,47,0.35);
}
.brand-mark svg { width: 17px; height: 17px; }

.header-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.header-nav a {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-weight: 550;
  font-size: 13.5px;
  transition: background .15s, color .15s;
}
.header-nav a:hover { background: var(--panel-2); color: var(--text); }
.header-nav a.active { background: var(--accent-dim); color: var(--accent-2); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ---------------------------------------------------------------
   AVAILABILITY SWITCH (Online / Busy / Offline)
   A three-way segmented control. The coloured "glider" slides to the
   active option; each option keeps its own semantic colour.
   --------------------------------------------------------------- */
.avail-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  flex: none;
  user-select: none;
}

/* The sliding pill behind the active option. */
.avail-switch .avail-glider {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: calc((100% - 6px) / 3);
  border-radius: 999px;
  background: #47586b;
  transition: transform .26s cubic-bezier(.3,.8,.3,1), background .2s;
  pointer-events: none;
  z-index: 0;
}
.avail-switch.is-online  .avail-glider { transform: translateX(0);    background: rgba(46,204,113,.20); box-shadow: inset 0 0 0 1px rgba(46,204,113,.55); }
.avail-switch.is-busy    .avail-glider { transform: translateX(100%); background: rgba(255,176,32,.20); box-shadow: inset 0 0 0 1px rgba(255,176,32,.55); }
.avail-switch.is-offline .avail-glider { transform: translateX(200%); background: rgba(147,164,182,.16); box-shadow: inset 0 0 0 1px rgba(147,164,182,.42); }

.avail-switch .avail-opt {
  position: relative;
  z-index: 1;
  flex: 1 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 13px;
  background: none;
  border: 0;
  border-radius: 999px;
  color: var(--text-faint);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .2px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .18s;
}
.avail-switch .avail-opt:hover:not(:disabled):not(.active) { color: var(--text-dim); }

.avail-switch .ao-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
  flex: none;
  transition: opacity .18s, box-shadow .18s;
}
.avail-switch .avail-opt.active .ao-dot { opacity: 1; }

/* Active option colours */
.avail-switch .avail-opt[data-status="online"].active  { color: var(--green); }
.avail-switch .avail-opt[data-status="busy"].active    { color: var(--amber); }
.avail-switch .avail-opt[data-status="offline"].active { color: var(--text-dim); }

/* Live pulse only while genuinely online and taking work. */
.avail-switch.is-online .avail-opt[data-status="online"].active .ao-dot {
  animation: availPulse 2s ease-out infinite;
}
@keyframes availPulse {
  0%   { box-shadow: 0 0 0 0 rgba(46,204,113,.6); }
  70%  { box-shadow: 0 0 0 7px rgba(46,204,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); }
}

/* Locked while on a live job: the system owns the state. */
.avail-switch.is-locked { opacity: .82; }
.avail-switch.is-locked .avail-opt { cursor: not-allowed; }
.avail-switch.is-locked .avail-opt:not(.active) { opacity: .4; }
.avail-switch .avail-opt:disabled { cursor: not-allowed; }

.avail-switch.is-saving { pointer-events: none; opacity: .65; }

/* ---------------------------------------------------------------
   AVAILABILITY SWITCH ON A PHONE
   ---------------------------------------------------------------
   The old rule hid every label except the active one, which left two
   unlabelled 7px dots either side of one word. Nobody can tell which
   dot is Busy and which is Offline, and at 25px wide neither is a
   usable tap target - the control was effectively unusable on the
   device most artisans use.

   Instead of squeezing it, the header is given a second row on small
   screens and the switch takes the full width of it. All three labels
   stay visible, each option becomes a proper 44px-tall target, and the
   sliding glider still shows which one is active.

   The header grows from 62px to 108px when it wraps, so anything
   pinned below it is offset by the same amount via --header-h.
   --------------------------------------------------------------- */
@media (max-width: 900px) {
  /* 124px, measured: 44px switch + 8px row gap + ~48px of chrome row +
     16px of padding. At 108px the two rows did not fit and .site-header
     clipped the logo off the top of the page - height is fixed, so
     anything taller than the variable simply overflows out of view. */
  body.has-avail { --header-h: 124px; }

  /* Belt and braces: if a translation or a larger font makes the rows
     taller than the variable, grow instead of clipping. */
  body.has-avail .site-header { height: auto; min-height: var(--header-h); }

  /* Both containers have to wrap. The switch is a child of
     .header-right, not .header-inner - giving it flex-basis:100%
     without wrapping its ACTUAL parent just made .header-right wider
     than the screen, and Offline ran off the right edge. */
  body.has-avail .header-inner {
    flex-wrap: wrap;
    align-content: center;
    /* align-items:center would centre the logo against the FULL
       two-row height, floating it down beside the switch. The logo
       belongs on row one, next to the icons. */
    align-items: flex-start;
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 8px 10px;
  }
  /* Sit on row one, level with the 34-40px icon buttons. align-self is
     deliberately NOT center: the brand shares a flex line with
     .header-right, which is 102px tall because it contains the wrapped
     switch, so centring dropped the logo down beside the switch. */
  body.has-avail .brand { align-self: flex-start; height: 40px; }
  body.has-avail .header-right {
    flex-wrap: wrap;
    row-gap: 8px;
    justify-content: flex-end;
    min-width: 0;
    /* basis 0, not auto.
       With `auto` the basis is max-content, and max-content here
       includes the full-width switch - so .header-right was wider than
       the space left beside the logo and wrapped onto its own line,
       giving THREE stacked rows and a 156px header. Basis 0 lets it
       shrink to whatever is left next to the brand, so the icons sit on
       row one and only the switch wraps. */
    flex: 1 1 0;
  }

  /* Row two: the switch alone, full width. order keeps it after the
     avatar regardless of source order. */
  body.has-avail .avail-switch {
    order: 10;
    flex: 1 0 100%;
    width: 100%;
    padding: 4px;
    border-radius: 12px;
  }
  body.has-avail .avail-switch .avail-glider { border-radius: 9px; }

  .avail-switch .avail-opt {
    padding: 10px 8px;
    font-size: 13px;
    min-height: 44px;          /* real tap target */
    gap: 7px;
  }

  /* Every label stays. That is the whole point. */
  .avail-switch .ao-text { display: inline; }
  .avail-switch .ao-dot  { width: 9px; height: 9px; }
}

/* Very narrow phones: keep all three labels, just tighten them. */
@media (max-width: 400px) {
  .avail-switch .avail-opt { font-size: 12px; padding: 10px 4px; gap: 5px; }
  .avail-switch .ao-dot { width: 8px; height: 8px; }
}

/* User chip / dropdown */
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 5px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s;
}
.user-chip:hover { border-color: #3d5064; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex: none; letter-spacing: .3px;
}
.avatar.lg { width: 54px; height: 54px; font-size: 19px; }
.avatar.xl { width: 76px; height: 76px; font-size: 26px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }

.user-chip .u-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-chip .u-name { font-size: 13px; font-weight: 620; }
.user-chip .u-role { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .6px; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 210px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 600;
}
.dropdown.open .dropdown-menu { display: block; }

/* Notifications have a wider content surface on desktop, but must never
   be wider than a phone viewport. The old inline 320px width could push the
   right edge off-screen on narrow Android devices. */
.notification-menu {
  width: 320px;
  /* Anchor to the viewport rather than the bell's narrow flex item. The
     bell is followed by the profile chip, so an item-relative dropdown
     can open too far left and be clipped on a phone. */
  position: fixed;
  top: calc(var(--header-h) + 8px);
  right: 20px;
  left: auto;
  max-width: calc(100vw - 24px);
  max-height: min(400px, calc(100vh - 86px));
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  box-sizing: border-box;
}
.notification-menu-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
.notification-menu-head strong {
  min-width: 0;
  font-size: 13px;
}
.notification-menu-head .btn {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 3px 9px;
  font-size: 11.5px;
}

.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 0; background: transparent;
  color: var(--text-dim);
  font: inherit; font-size: 13.5px;
  text-align: left; cursor: pointer;
  border-radius: var(--radius-sm);
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--panel-2); color: var(--text); }
.dropdown-menu .danger { color: var(--red); }
.dropdown-menu .divider { height: 1px; background: var(--border); margin: 5px 0; }

/* Notification bell */
.bell {
  position: relative;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-dim);
}
.bell:hover { color: var(--text); border-color: #3d5064; }
.bell svg { width: 17px; height: 17px; }
.bell .badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  display: none; align-items: center; justify-content: center;
  border: 2px solid var(--bg-2);
}
.bell.has-unread .badge { display: flex; }

.notification-menu #notifList,
.notification-menu .notif-item {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.notification-menu .notif-item {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.notification-menu .n-title,
.notification-menu .n-body,
.notification-menu .n-time {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 560px) {
  .notification-menu {
    right: 12px;
    top: calc(var(--header-h) + 8px);
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 76px);
  }
  .notification-menu-head {
    padding: 10px 11px;
  }
  .notification-menu-head .btn {
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }
}

/* ---------------------------------------------------------------
   BUTTONS
   --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit; font-size: 13.5px; font-weight: 620;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s, opacity .15s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-loading { opacity: .55; cursor: not-allowed; pointer-events: none; }

.btn svg { width: 15px; height: 15px; flex: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: #fff; }

.btn-success { background: var(--green); color: #05230f; }

/* Booking a busy artisan is allowed but deliberately looks different
   from booking a free one, so the client registers the difference
   before they tap rather than after. */
.btn-amber { background: var(--amber); color: #2a1c00; border-color: var(--amber); }
.btn-amber:hover { background: #ffc047; color: #2a1c00; }
.btn-success:hover { background: #45d685; color: #05230f; }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #ff7676; color: #fff; }

.btn-blue { background: var(--blue); color: #04223f; }
.btn-blue:hover { background: #5cb0ff; color: #04223f; }

.btn-ghost { background: var(--panel); border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); border-color: #3d5064; }

.btn-outline { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }

.btn-icon { padding: 8px; width: 34px; height: 34px; }

/* ---------------------------------------------------------------
   FORMS
   --------------------------------------------------------------- */
.form-group { margin-bottom: 15px; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; min-width: 0; }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 620;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: .1px;
}
label .req { color: var(--accent); margin-left: 2px; }

.input, input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="number"], input[type="search"],
input[type="datetime-local"], input[type="date"], select, textarea {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.5; }

select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%2393a4b6' d='M6 8.5L1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 11px;
  padding-right: 34px;
}

.input:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }

.input-hint { font-size: 12px; color: var(--text-faint); margin-top: 5px; }
.input-error { border-color: var(--red) !important; }
.field-error { font-size: 12px; color: var(--red); margin-top: 5px; }

.input-group { position: relative; display: flex; }
.input-group .input-prefix {
  display: flex; align-items: center; padding: 0 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text-faint); font-size: 13px; font-weight: 600;
}
.input-group .input-prefix + input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.check-row { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 12px; }
.check-row input[type="checkbox"], .check-row input[type="radio"] {
  width: 16px; height: 16px; margin: 2px 0 0; flex: none; accent-color: var(--accent);
}
.check-row label { margin: 0; font-weight: 500; color: var(--text-dim); font-size: 13.5px; }

/* Segmented role picker */
.seg-picker { display: flex; gap: 10px; }
.seg-option {
  flex: 1;
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
  background: var(--bg-2);
}
.seg-option:hover { border-color: #46596e; }
.seg-option input { position: absolute; opacity: 0; }
.seg-option.selected { border-color: var(--accent); background: var(--accent-dim); }
.seg-option .so-icon { font-size: 21px; margin-bottom: 5px; display: block; }
.seg-option .so-title { display: block; font-weight: 650; font-size: 13.5px; color: var(--text); line-height: 1.3; }
.seg-option .so-desc { display: block; font-size: 11.5px; color: var(--text-faint); margin-top: 3px; line-height: 1.4; }

/* ---------------------------------------------------------------
   CARDS / PANELS
   --------------------------------------------------------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-pad { padding: 18px; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.card-head h3 { margin: 0; font-size: 14.5px; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 18px; }
.card-foot {
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  display: flex; gap: 9px; align-items: center;
}

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }

/* ---------------------------------------------------------------
   BADGES / PILLS
   --------------------------------------------------------------- */
.badge-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .2px;
  white-space: nowrap;
  line-height: 1.5;
}
.badge-green  { background: var(--green-dim); color: var(--green); }
.badge-blue   { background: var(--blue-dim);  color: var(--blue); }
.badge-amber  { background: var(--amber-dim); color: var(--amber); }
.badge-red    { background: var(--red-dim);   color: var(--red); }
.badge-grey   { background: rgba(147,164,182,.13); color: var(--text-dim); }
.badge-accent { background: var(--accent-dim); color: var(--accent-2); }
.badge-purple { background: rgba(167,125,255,.15); color: var(--purple); }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; }
.dot-green { background: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.dot-amber { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-dim); }
.dot-grey  { background: #6b7c8f; }
.dot-red   { background: var(--red); }

.pulse { animation: pulse 1.9s ease-out infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46,204,113,.55); }
  70%  { box-shadow: 0 0 0 9px rgba(46,204,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); }
}

.verified-tick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--blue); color: #fff; flex: none;
}
.verified-tick svg { width: 9px; height: 9px; }

/* ---------------------------------------------------------------
   CATEGORY CHIPS
   --------------------------------------------------------------- */
.chip-scroll {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 3px 0 9px;
  scrollbar-width: thin;
}
.chip-scroll::-webkit-scrollbar { height: 5px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
  transition: border-color .15s, background .15s, color .15s;
}
.chip:hover { border-color: #46596e; color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .chip-count {
  font-size: 10.5px;
  background: rgba(255,255,255,.14);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
}
.chip:not(.active) .chip-count { background: rgba(147,164,182,.16); }
.chip .cat-swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }

/* ---------------------------------------------------------------
   ALERTS
   --------------------------------------------------------------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 15px;
  border: 1px solid transparent;
  line-height: 1.5;
}
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.alert-error   { background: var(--red-dim);   border-color: rgba(255,93,93,.3);  color: #ffb3b3; }
.alert-success { background: var(--green-dim); border-color: rgba(46,204,113,.3); color: #8ce8b4; }
.alert-info    { background: var(--blue-dim);  border-color: rgba(59,157,255,.3); color: #9fd0ff; }
.alert-warn    { background: var(--amber-dim); border-color: rgba(255,176,32,.3); color: #ffd98a; }
.alert ul { margin: 5px 0 0; padding-left: 18px; }

/* ---------------------------------------------------------------
   TOASTS
   --------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  top: calc(var(--header-h) + 14px);
  right: 18px;
  z-index: 3000;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 340px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s cubic-bezier(.2,.8,.3,1);
  pointer-events: auto;
}
.toast.out { animation: toastOut .25s forwards; }
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast.info    { border-left-color: var(--blue); }
.toast.warn    { border-left-color: var(--amber); }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-title { font-weight: 650; font-size: 13.5px; margin-bottom: 2px; }
.toast .t-msg { font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }
.toast .t-close {
  background: none; border: 0; color: var(--text-faint);
  cursor: pointer; font-size: 17px; line-height: 1; padding: 0 2px;
}
.toast .t-close:hover { color: var(--text); }

@keyframes toastIn  { from { opacity: 0; transform: translateX(40px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px) scale(.96); } }

/* ---------------------------------------------------------------
   MODALS
   --------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(3,7,12,.78);
  z-index: 2000;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s cubic-bezier(.2,.85,.3,1);
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  margin: auto;
}
.modal.wide { max-width: 760px; }
.modal.narrow { max-width: 420px; }

@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .m-close {
  margin-left: auto;
  background: none; border: 0;
  color: var(--text-faint);
  font-size: 21px; line-height: 1; cursor: pointer;
  padding: 0 3px;
}
.modal-head .m-close:hover { color: var(--text); }

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 15px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  background: var(--bg-2);
  flex: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---------------------------------------------------------------
   LOADING
   --------------------------------------------------------------- */
.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: inline-block;
  flex: none;
}
.spinner.lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-block {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  padding: 50px 20px;
  color: var(--text-faint);
  font-size: 13.5px;
}

.skeleton {
  background: linear-gradient(90deg, var(--panel-2) 25%, #263547 50%, var(--panel-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.empty-state {
  text-align: center;
  padding: 46px 22px;
  color: var(--text-faint);
}
.empty-state .es-icon {
  font-size: 34px; margin-bottom: 12px; opacity: .5;
  display: flex; justify-content: center;
}
.empty-state .es-icon svg { width: 40px; height: 40px; }
.empty-state h4 { color: var(--text-dim); margin-bottom: 5px; font-size: 15px; }
.empty-state p { font-size: 13px; margin: 0; }

/* ---------------------------------------------------------------
   TABLES
   --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th {
  text-align: left;
  padding: 11px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-weight: 650;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .55px;
  white-space: nowrap;
}
table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
table.data tbody tr:hover { background: rgba(255,255,255,.022); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .cell-user { display: flex; align-items: center; gap: 10px; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------
   STATS GRID
   --------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.stat:before {
  content: ""; position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
}
.stat.green:before  { background: var(--green); }
.stat.blue:before   { background: var(--blue); }
.stat.amber:before  { background: var(--amber); }
.stat.red:before    { background: var(--red); }
.stat.purple:before { background: var(--purple); }

.stat .s-label {
  font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--text-faint);
  font-weight: 620; margin-bottom: 7px;
}
.stat .s-value {
  font-size: 26px; font-weight: 720;
  line-height: 1.05; letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
}
.stat .s-sub { font-size: 12px; color: var(--text-faint); margin-top: 5px; }

/* ---------------------------------------------------------------
   UTILITIES
   --------------------------------------------------------------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.gap-24 { gap: 24px; } .gap-32 { gap: 32px; }
.flex-1 { flex: 1; min-width: 0; }
.flex-wrap { flex-wrap: wrap; }
.ml-auto { margin-left: auto; }
.mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.py-24 { padding-top: 24px; padding-bottom: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-blue { color: var(--blue); }
.text-accent { color: var(--accent); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-600 { font-weight: 620; }
.fw-700 { font-weight: 700; }
.fs-11 { font-size: 11px; } .fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; }
.fs-16 { font-size: 16px; } .fs-18 { font-size: 18px; } .fs-20 { font-size: 20px; }
.mono { font-family: var(--mono); font-size: .92em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.divider-h { height: 1px; background: var(--border); margin: 16px 0; }
.uppercase { text-transform: uppercase; letter-spacing: .5px; }
.rel { position: relative; }
.pointer { cursor: pointer; }

/* Star rating */
.stars { display: inline-flex; gap: 1px; color: var(--amber); font-size: 13px; line-height: 1; }
.stars .star-off { color: #3d4b5c; }
.star-input { display: inline-flex; gap: 5px; }
.star-input button {
  background: none; border: 0; cursor: pointer;
  font-size: 27px; line-height: 1; color: #3d4b5c;
  padding: 0; transition: color .12s, transform .12s;
}
.star-input button:hover { transform: scale(1.13); }
.star-input button.on { color: var(--amber); }

/* Progress bar */
.progress { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.progress .bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.progress .bar.green { background: var(--green); }
.progress .bar.red { background: var(--red); }
.progress .bar.blue { background: var(--blue); }

/* ---------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------- */
@media (max-width: 1024px) {
  .header-nav { display: none; }
}

@media (max-width: 768px) {
  body { font-size: 14px; }
  .container { padding: 0 14px; }
  .header-inner { padding: 0 14px; gap: 10px; }
  .user-chip .u-meta { display: none; }
  .user-chip { padding: 4px; }
  .form-row { flex-direction: column; gap: 0; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat .s-value { font-size: 21px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .toast-stack { left: 12px; right: 12px; max-width: none; }
  .seg-picker { flex-direction: column; }
  h1 { font-size: 21px; }
}

@media (max-width: 480px) {
  .brand span.brand-text { display: none; }
  .card-pad, .card-body { padding: 14px; }
}

/* Accessibility */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------------------------------------------------------------
   GOOGLE SIGN-IN BUTTON
   Google's brand guidelines: white surface, dark text, full-colour
   "G", and the wordmark left untranslated.
   --------------------------------------------------------------- */
.btn-google {
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  font-weight: 600;
  gap: 11px;
}
.btn-google:hover {
  background: #f7f8f8;
  color: #1f1f1f;
  border-color: #d2d5d9;
  box-shadow: 0 1px 3px rgba(0,0,0,.28);
}
.btn-google svg { width: 19px; height: 19px; flex: none; }

/* "or use your email" rule */
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-faint);
  font-size: 12px;
}
.or-divider:before,
.or-divider:after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------------------------------------------------------------
   FINISH-YOUR-PROFILE BANNER
   --------------------------------------------------------------- */
.setup-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 17px;
  background: linear-gradient(90deg, rgba(59,157,255,.13), rgba(59,157,255,.03));
  border: 1px solid rgba(59,157,255,.32);
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.setup-banner .sb-icon {
  width: 36px; height: 36px; flex: none;
  border-radius: 50%;
  background: rgba(59,157,255,.16);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
}
.setup-banner .sb-icon svg { width: 18px; height: 18px; }
.setup-banner strong { color: var(--blue); font-size: 14px; }

@media (max-width: 620px) {
  .setup-banner { flex-wrap: wrap; }
  .setup-banner .btn { width: 100%; }
}


/* -----------------------------------------------------------------
   CLIENT-SIDE STATUS PILL
   -----------------------------------------------------------------
   Colour AND word together, never colour alone: a red/green-blind
   client must still be able to read who is available.
   ----------------------------------------------------------------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
  vertical-align: middle;
}
.status-pill .sp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status-pill.is-online  { color: var(--green); background: var(--green-dim); border-color: rgba(46,204,113,0.32); }
.status-pill.is-busy    { color: var(--amber); background: var(--amber-dim); border-color: rgba(255,176,32,0.32); }
.status-pill.is-offline { color: var(--text-faint); background: rgba(255,255,255,0.05); border-color: var(--border); }
/* Admin-imported artisan: reachable by phone, not live in the app. Blue
   rather than red - they are available, just through a different route. */
.status-pill.is-directory { color: var(--blue); background: var(--blue-dim); border-color: rgba(59,157,255,0.32); }

/* Only the online pill pulses - a heartbeat means "here right now". */
.status-pill.is-online .sp-dot { animation: spPulse 2s ease-in-out infinite; }
@keyframes spPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* One-line explanation under the trade on a busy artisan's card. */
.ac-status-note {
  font-size: 11px;
  line-height: 1.35;
  color: var(--amber);
  margin-top: 2px;
}

/* -----------------------------------------------------------------
   PRICING PICKER (signup / profile)
   Three stacked choices rather than a dropdown, so the difference
   between them is readable before the artisan commits.
   ----------------------------------------------------------------- */
.price-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.price-opt {
  position: relative;
  display: block;
  padding: 11px 13px 11px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.price-opt:hover { border-color: #46596e; }
.price-opt input { position: absolute; opacity: 0; }
.price-opt.active { border-color: var(--accent); background: var(--accent-dim); }

/* The radio dot is drawn rather than native, so it matches the theme. */
.price-opt:before {
  content: '';
  position: absolute;
  left: 13px; top: 50%;
  width: 15px; height: 15px;
  margin-top: -8px;
  border: 2px solid var(--border-2, #46596e);
  border-radius: 50%;
  background: transparent;
}
.price-opt.active:before {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3.5px var(--accent);
}
.price-opt .po-title { display: block; font-weight: 650; font-size: 13.5px; color: var(--text); }
.price-opt .po-desc  { display: block; font-size: 11.5px; color: var(--text-faint); margin-top: 2px; line-height: 1.4; }

/* -----------------------------------------------------------------
   LGA SELECT
   A native <select> holding all 774 LGAs in <optgroup>s by state.
   Native is deliberate: the browser gives keyboard type-ahead, the
   phone's own scroll picker and screen-reader support for nothing.
   ----------------------------------------------------------------- */
/* ---------------------------------------------------------------
   SEARCHABLE LGA COMBOBOX

   The results list is absolutely positioned so it overlays whatever is
   below rather than shoving the rest of the form down every keystroke.
   The wrapper is the positioning context.
   --------------------------------------------------------------- */
.lga-field { display: block; }
.lga-combo { position: relative; }

.lga-combo .lga-search {
  width: 100%;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%237b8794' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.2-3.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px 50%;
  padding-left: 34px;
}

.lga-results {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.lga-group {
  padding: 7px 12px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--panel);
  position: sticky;
  top: 0;
}

.lga-opt {
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
}
.lga-opt:hover,
.lga-opt.is-active { background: var(--accent-dim); color: var(--accent); }
.lga-opt.is-chosen { font-weight: 650; color: var(--accent); }
.lga-opt.is-chosen::after { content: ' \2713'; }

.lga-empty {
  padding: 14px 12px;
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
}

.lga-count {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--text-faint);
  min-height: 14px;
}

/* Comfortable tap targets on a phone. */
@media (max-width: 980px) {
  .lga-opt { padding: 12px; font-size: 14.5px; }
  .lga-results { max-height: 50vh; }
}

.lga-select {
  /* Inherits the shared input/select skin; these are the only extras. */
  max-width: 100%;
}
.lga-select optgroup {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--panel);
}
.lga-select option {
  font-weight: 400;
  font-size: 13.5px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  background: var(--panel-2);
  padding: 4px 8px;
}

/* -----------------------------------------------------------------
   LIVE LOCATION SWITCH
   ----------------------------------------------------------------- */
.loc-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 2px;
}
.loc-toggle.is-locked { opacity: .65; }

.switch { position: relative; display: inline-block; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  display: block;
  width: 42px; height: 24px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  transition: background .15s, border-color .15s;
}
.switch-knob {
  display: block;
  width: 18px; height: 18px;
  margin: 2px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform .15s, background .15s;
}
.switch input:checked + .switch-track {
  background: var(--green-dim);
  border-color: var(--green);
}
.switch input:checked + .switch-track .switch-knob {
  transform: translateX(18px);
  background: var(--green);
}
.switch input:disabled + .switch-track { cursor: not-allowed; opacity: .6; }

/* Rate line on a listing card; negotiable is words, not a number. */
.ac-rate.is-nego { font-size: 12px; color: var(--amber); font-weight: 600; }

/* "Around Ikeja, Lagos" under an artisan who is not live-tracked. */
.ac-loc-note {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

.quote-box.is-nego { border-color: rgba(255,176,32,.35); background: var(--amber-dim); }

/* Small inline link, e.g. "Forgot password?" beside a field label. */
.text-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.text-link:hover { text-decoration: underline; }

/* Search box with a leading magnifier icon. Shared by the client's
   artisan finder and the admin user/booking tables, so it lives here
   rather than in map.css - the admin pages never load that file. */
.search-field { position: relative; margin-bottom: 11px; }
.search-field svg {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-faint);
  pointer-events: none;
}
.search-field input {
  padding-left: 35px;
  background: var(--panel);
  font-size: 13.5px;
}
.search-field input::-webkit-search-cancel-button { filter: invert(.6); }

/* The native date picker renders its own text and icon, and both default
   to black-on-white, which is unreadable on this dark theme. */
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.75); cursor: pointer; }
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field { color: var(--text); }
input[type="date"]:invalid::-webkit-datetime-edit { color: var(--text-faint); }

/* ------------------------------------------------------------------
   Site footer - the copyright line on every page.
   .app-shell is a flex column with min-height:100vh and .page-body has
   flex:1, so this is pushed to the bottom of short pages instead of
   floating halfway up.
   ------------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--panel);
  padding: 16px 0;
  margin-top: auto;
}
.foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-faint);
}
.foot-copy a {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
}
.foot-copy a:hover { color: var(--accent); text-decoration: underline; }
.foot-app { font-weight: 600; letter-spacing: .2px; }

@media (max-width: 560px) {
  .foot-inner { justify-content: center; text-align: center; }
}

/* Profile photo editor on the account page. */
.avatar-editor { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.avatar-editor .avatar.xl { flex: none; }
@media (max-width: 520px) {
  .avatar-editor { flex-direction: column; align-items: center; text-align: center; }
  .avatar-editor .flex-1 { width: 100%; }
  .avatar-editor .flex.gap-8 { justify-content: center; }
}

/* ------------------------------------------------------------------
   Password show/hide. Applied to every password input by app.js, so
   the input keeps its own styling and the button sits on top of it.
   ------------------------------------------------------------------ */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 44px; width: 100%; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 7px;
  color: var(--text-faint); cursor: pointer;
}
.pw-toggle:hover { color: var(--text); background: var(--panel-2); }
.pw-toggle:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.pw-toggle svg { width: 17px; height: 17px; }

/* ------------------------------------------------------------------
   Marketing sections on the public homepage.
   These live here rather than in a <style> block inside index.php so
   that rewriting the page cannot silently take the layout with it.
   ------------------------------------------------------------------ */
.trade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.trade-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  transition: border-color .16s ease, transform .16s ease;
}
.trade-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.trade-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 11px;
  color: #fff; font-size: 12px; font-weight: 700;
  margin-bottom: 12px;
}
.trade-name { display: block; font-weight: 680; font-size: 14.5px; margin-bottom: 4px; }
.trade-desc { display: block; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.step-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 22px 20px;
}
.step-num {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  font-weight: 760; font-size: 14px; margin-bottom: 13px;
}
.step-card h4 { margin: 0 0 6px; font-size: 15px; }
.step-card p  { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.6; }

.cta-panel {
  background: linear-gradient(150deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px 28px;
  text-align: center;
}

@media (max-width: 900px) {
  .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .steps-grid { grid-template-columns: 1fr; }
  .trade-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* Captcha control on the signup form. */
.captcha-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; flex-wrap: wrap; }
.captcha-img {
  height: 46px; width: 150px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel-2);
  image-rendering: -webkit-optimize-contrast;
}

/* ------------------------------------------------------------------
   Admin notice banner. No close button anywhere in this component -
   that is the point of it. Only an admin can remove the message.
   ------------------------------------------------------------------ */
.notice-banner {
  display: flex; align-items: flex-start; gap: 13px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 11px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--panel);
}
.notice-banner.nb-info    { border-left-color: var(--blue); }
.notice-banner.nb-success { border-left-color: var(--green); }
.notice-banner.nb-warn    { border-left-color: var(--amber); }
.nb-icon { flex: none; margin-top: 1px; }
.nb-icon svg { width: 18px; height: 18px; }
.nb-info    .nb-icon { color: var(--blue); }
.nb-success .nb-icon { color: var(--green); }
.nb-warn    .nb-icon { color: var(--amber); }
.nb-title { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.nb-body  { font-size: 13.5px; color: var(--text-dim); line-height: 1.6; }
.nb-meta  { font-size: 11.5px; color: var(--text-faint); margin-top: 6px; }

/* =====================================================================
   LIGHT THEME
   ---------------------------------------------------------------------
   Every colour in the app comes from the variables in :root, so a light
   theme is just a second set of values. The switch is a data-theme
   attribute on <html>, written server-side before the first paint - so
   there is no flash of the wrong theme while a stylesheet loads.

   These are NOT the dark values inverted. A dark UI leans on glow and
   heavy shadow to separate surfaces; on white that reads as grubby, so
   panels are separated by crisp hairline borders and much lighter
   shadows instead. The accent orange is also darkened a little: the
   bright #ff7a2f that pops on near-black fails contrast on white.
   ===================================================================== */
html[data-theme="light"] {
  --bg:          #f4f6f9;
  --bg-2:        #ffffff;
  --panel:       #ffffff;
  --panel-2:     #eef2f7;
  --border:      #d7dee7;
  --border-soft: #e6ebf1;

  --text:        #14202c;
  --text-dim:    #4d6070;
  --text-faint:  #77889a;

  /* Darker than the dark-theme orange so it clears contrast on white. */
  --accent:      #e2620d;
  --accent-2:    #b94f08;
  --accent-dim:  rgba(226,98,13,0.12);

  --green:       #1a8a4c;
  --green-dim:   rgba(26,138,76,0.13);
  --blue:        #1668c4;
  --blue-dim:    rgba(22,104,196,0.13);
  --amber:       #9a6600;
  --amber-dim:   rgba(224,160,26,0.18);
  --red:         #cf2f2f;
  --red-dim:     rgba(207,47,47,0.12);
  --purple:      #7145d6;

  --glass:       rgba(255,255,255,0.92);
  --glass-solid: rgba(255,255,255,0.96);

  --shadow:      0 2px 10px rgba(16,32,48,0.09);
  --shadow-lg:   0 14px 38px rgba(16,32,48,0.16);
}

/* ---- Places that hardcode a dark value and cannot use a variable ---- */

/* The header sits on --bg-2, which is pure white in light mode; without
   its own border the page top has no edge at all. */
html[data-theme="light"] .app-header {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 3px rgba(16,32,48,0.06);
}

/* Buttons whose text colour was chosen against a dark background. */
html[data-theme="light"] .btn-primary { color: #fff; }
html[data-theme="light"] .btn-blue    { background: var(--blue);  color: #fff; border-color: var(--blue); }
html[data-theme="light"] .btn-blue:hover  { background: #1259ab; color: #fff; }
html[data-theme="light"] .btn-amber   { background: var(--amber); color: #fff; border-color: var(--amber); }
html[data-theme="light"] .btn-amber:hover { background: #815500; color: #fff; }
html[data-theme="light"] .btn-success  { color: #fff; }
html[data-theme="light"] .btn-danger   { color: #fff; }

/* The eye icon in a password field. */
html[data-theme="light"] .pw-toggle:hover { background: var(--panel-2); }

/* Google Maps info windows are styled with !important in map.css to beat
   the API's own inline styles, so they need overriding the same way. */
html[data-theme="light"] .gm-style .gm-style-iw-c,
html[data-theme="light"] .gm-style .gm-style-iw-t::after {
  background: #ffffff !important;
  border-color: var(--border) !important;
}

/* Search-box magnifier and inputs sit on white panels. */
html[data-theme="light"] .search-field input { background: var(--bg); }

/* The homepage phone mockup is deliberately dark in both themes - it is
   a picture OF the app, not part of the page chrome, and a white slab on
   a white page disappears. Only its outer frame is softened. */
html[data-theme="light"] .phone-frame {
  box-shadow: 0 18px 44px rgba(16,32,48,0.22);
}

/* The hero glow is a warm haze designed for a near-black backdrop. */
html[data-theme="light"] .hero-glow {
  background: radial-gradient(ellipse at center, rgba(226,98,13,0.10), transparent 68%);
}

/* Code and pre blocks. */
html[data-theme="light"] code,
html[data-theme="light"] pre { background: var(--panel-2); color: var(--text); }

/* Alert text was picked to glow on near-black (#ffb3b3, #8ce8b4 and so
   on). Those wash out completely on a pale tinted background, so light
   mode uses the deep version of each colour instead. */
html[data-theme="light"] .alert-error   { color: #a11b1b; border-color: rgba(207,47,47,.35); }
html[data-theme="light"] .alert-success { color: #10613a; border-color: rgba(26,138,76,.35); }
html[data-theme="light"] .alert-info    { color: #10457f; border-color: rgba(22,104,196,.35); }
html[data-theme="light"] .alert-warn    { color: #7a4f00; border-color: rgba(154,102,0,.35); }

/* ---- The toggle control itself ---- */
.theme-toggle {
  width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-dim);
  cursor: pointer;
  flex: none;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.theme-toggle svg { width: 17px; height: 17px; }

/* Show the sun in dark mode (tap for light) and the moon in light mode. */
.theme-toggle .ic-sun  { display: block; }
.theme-toggle .ic-moon { display: none; }
html[data-theme="light"] .theme-toggle .ic-sun  { display: none; }
html[data-theme="light"] .theme-toggle .ic-moon { display: block; }

/* =====================================================================
   PUBLIC REFERRAL PAGE (a.php)
   The page an artisan's shared link opens. Readable logged-out, so it
   has to stand on its own without the dashboard chrome around it.
   ===================================================================== */
/* Safety net: no icon inside the referral card may exceed its line.
   Belt and braces against an SVG that loses its explicit size. */
.ref-card svg,
.ref-review svg { max-width: 22px; max-height: 22px; }

.ref-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
}
.ref-head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}
.ref-head-main { flex: 1; min-width: 200px; }
.ref-name {
  margin: 0 0 2px;
  font-size: 24px;
  line-height: 1.2;
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.ref-verified {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 700;
  color: var(--blue);
  background: var(--blue-dim);
  border-radius: 20px;
  padding: 3px 10px 3px 7px;
}
.ref-verified svg { width: 13px; height: 13px; }
.ref-trade { color: var(--accent); font-weight: 600; font-size: 14.5px; }
.ref-meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 9px;
  font-size: 13px; color: var(--text-dim);
}
.ref-meta-item strong { color: var(--text); }

.ref-price-box {
  text-align: right;
  min-width: 150px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.ref-price-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-faint); font-weight: 700; margin-bottom: 3px;
}
.ref-price { font-size: 18px; font-weight: 750; color: var(--text); }
.ref-price-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }

.ref-bio {
  margin: 20px 0 0;
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 14px;
}
.ref-skills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.ref-skill {
  font-size: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
  border-radius: 20px;
  padding: 4px 11px;
}
.ref-where {
  display: flex; align-items: center; gap: 7px;
  margin-top: 16px;
  font-size: 13px; color: var(--text-dim);
}
.ref-where svg { width: 15px; height: 15px; color: var(--accent); flex: none; }

.ref-cta {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}
.ref-cta .btn { width: 100%; justify-content: center; }
.ref-cta-note {
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--text-faint);
  text-align: center;
}

.ref-reviews { margin-top: 26px; }
.ref-section-title { font-size: 16px; margin: 0 0 12px; }
.ref-review {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.ref-review-top { display: flex; align-items: center; gap: 10px; }
.ref-review-who { font-weight: 600; font-size: 13.5px; }
.ref-review-when { font-size: 11.5px; color: var(--text-faint); }
.ref-review-stars { margin-left: auto; color: var(--amber); font-size: 13px; letter-spacing: 1px; }
.ref-review-text {
  margin: 9px 0 0;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.55;
}
.ref-foot-note {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
}

@media (max-width: 620px) {
  .ref-card { padding: 20px 16px; }
  .ref-price-box { text-align: left; width: 100%; }
  .ref-name { font-size: 21px; }
}

/* =====================================================================
   SHARE / REFERRAL PANEL (artisan dashboard)
   ===================================================================== */
.share-link-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.share-link-input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}
.share-link-input:focus { outline: none; border-color: var(--accent); }
.share-copy-btn { flex: none; min-width: 84px; justify-content: center; }
.share-copy-btn.copied {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.share-hint {
  font-size: 12.5px;
  color: var(--text-faint);
  margin-top: 12px;
  line-height: 1.55;
}
.share-code {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .5px;
}

/* A choice card that submits a form instead of following a link - used
   when a Google signup is waiting for the visitor to pick a role. */
.choice-form { display: contents; }
button.choice-card {
  font: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
}

/* Visitor-facing auth buttons. Bigger than .btn-sm, which is meant for
   in-app toolbar actions - these are the only way into the product. */
.btn-auth {
  font-size: 15px;
  font-weight: 650;
  padding: 10px 20px;
  min-height: 42px;
}

/* Hero call to action - the single most important button on the site. */
.btn-xl {
  font-size: 18px;
  font-weight: 700;
  padding: 16px 40px;
  min-height: 56px;
  border-radius: 12px;
}

@media (max-width: 560px) {
  .btn-auth { font-size: 14px; padding: 9px 14px; min-height: 40px; }
  .btn-xl   { font-size: 17px; padding: 15px 30px; width: 100%; justify-content: center; }
}

/* =====================================================================
   PWA INSTALL PROMPT

   A centred dialog. It used to be a bar pinned to the bottom edge,
   where it competed with the cookie notice for the same strip and was
   easy to read as a piece of page furniture rather than a question.
   Centred, it reads as what it is - and on a tall phone it lands in the
   thumb's reach instead of under it.

   The outer element is the dimmed backdrop; .pwa-ib-card is the panel.
   z-index stays below .modal-backdrop (2000) so a real modal always
   wins, and above the cookie bar (900) since that one is answered
   first anyway.
   ===================================================================== */
.pwa-install-bar {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 7, 12, .72);
  backdrop-filter: blur(3px);
  overflow-y: auto;
  /* Fades in; the card itself does the movement. */
  opacity: 0;
  transition: opacity .28s ease;
}
.pwa-install-bar.is-in { opacity: 1; }

.pwa-ib-card {
  margin: auto;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 26px 22px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  /* Rises into place a frame after insertion - .is-in is added on a
     timeout, so there is a value to animate from. */
  transform: translateY(14px) scale(.97);
  opacity: 0;
  transition: transform .3s cubic-bezier(.2,.85,.3,1), opacity .3s ease;
}
.pwa-install-bar.is-in .pwa-ib-card { transform: none; opacity: 1; }

/* The app icon, so the prompt is visibly about THIS app and not a
   generic browser message. */
.pwa-ib-icon { flex: none; display: flex; }
.pwa-ib-icon img {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  display: block;
  box-shadow: var(--shadow-lg);
}

@media (prefers-reduced-motion: reduce) {
  .pwa-install-bar,
  .pwa-ib-card { transition: opacity .2s; transform: none; }
}

/* The prompt no longer sits over the page, so nothing has to move out
   of its way. The class is still set by pwa.js as the "a prompt is up"
   flag, and locks scrolling behind the dialog the way a modal does. */
body.has-install-bar { overflow: hidden; }

.pwa-ib-text { min-width: 0; }

/* Only the heading is a block. The iOS instructions bold "Share" and
   "Add to Home Screen" mid-sentence, and a blanket strong{display:block}
   snapped that one line into five with the full stop stranded on its
   own row. Scoped with > so nested emphasis stays inline. */
.pwa-ib-text > strong {
  display: block;
  font-size: 16px;
  margin-bottom: 5px;
}
.pwa-ib-text span {
  display: block;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
}
.pwa-ib-text span strong { color: var(--text); white-space: nowrap; }

/* Full-width stacked buttons: the primary action should be the widest
   thing on the card, and at this width two side-by-side buttons are
   narrow enough to mis-tap. */
.pwa-ib-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
}
.pwa-ib-actions .btn { width: 100%; min-height: 44px; }

@media (max-width: 380px) {
  .pwa-ib-card { padding: 22px 18px 18px; gap: 12px; }
  .pwa-ib-icon img { width: 56px; height: 56px; }
}

/* The signed-out Help-Guide link. A plain link beside the Log in /
   Sign up buttons: visible, but not competing with the two controls
   that are the actual way into the app. */
.header-help-link {
  font-size: 13px;
  font-weight: 560;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0 4px;
  white-space: nowrap;
}
.header-help-link:hover { color: var(--text); text-decoration: underline; }
.header-help-link.is-active { color: var(--text); }

/* The footer copy of the same link. */
.foot-help {
  color: var(--text-dim);
  text-decoration: none;
  margin-right: 12px;
}
.foot-help:hover { color: var(--text); text-decoration: underline; }

/* Below the nav breakpoint the header is tight: the two auth buttons
   are what must survive, so the link steps aside there. It is still in
   the footer and, once signed in, in the dropdown menu. */
@media (max-width: 560px) {
  .header-help-link { display: none; }
}

/* Notification opt-in row on the account page. */
.notif-optin {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.notif-optin .no-main { flex: 1; min-width: 0; }
.notif-optin .no-main strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.notif-optin .no-main span { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

/* =====================================================================
   COOKIE NOTICE
   ---------------------------------------------------------------------
   Bottom-anchored, full width, above everything except modals. It is
   deliberately NOT a blocking overlay: this site sets a session cookie,
   a theme cookie and the banner's own answer - no trackers - so there
   is nothing to gate behind a decision.

   z-index sits below .modal-backdrop (1000) so a modal always wins, and
   above the install bar so the two never fight for the same corner.
   ===================================================================== */
.cookie-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  background: var(--glass-solid, var(--panel));
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .28);
  /* Starts off-screen and slides up once .is-in is added, so it does
     not flash in the middle of the first paint. */
  transform: translateY(110%);
  transition: transform .32s cubic-bezier(.3, .8, .3, 1);
  /* Never let the bar cover the whole phone; it scrolls if it must. */
  max-height: 60vh;
  overflow-y: auto;
  /* Clear of the iPhone home indicator. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.cookie-bar.is-in  { transform: translateY(0); }
.cookie-bar.is-out { transform: translateY(110%); }

/* Reserve room while the notice is up, so it does not sit on top of the
   footer or the last card.
   Driven by a body class set in header.php rather than :has(), which
   Safari only shipped in 15.4 - and an artisan on an older phone would
   get the footer permanently hidden behind the bar.

   --cookie-h is the height to reserve. It is a variable because the
   chat screen cannot use padding at all (see below) and needs the same
   number to subtract from its own height. */
:root { --cookie-h: 128px; }
body.has-cookie-bar { padding-bottom: var(--cookie-h); }

@media (max-width: 720px) {
  /* Stacked layout: paragraph on its own line, full-width button. */
  :root { --cookie-h: 190px; }
}

/* THE CHAT SCREEN IS DIFFERENT.
   .chat-page is a fixed-height flex column - header, messages, composer
   - so padding on <body> reserves nothing: the column is still
   100dvh tall and the composer still sits at the bottom of the viewport,
   underneath the notice. The send button was literally unclickable,
   with the cookie bar swallowing the tap.
   The column has to be SHORTER instead. */
body.has-cookie-bar .chat-page {
  height: calc(100vh - var(--header-h) - var(--cookie-h));
  height: calc(100dvh - var(--header-h) - var(--cookie-h));
}

.cookie-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.cookie-ico { color: var(--accent); flex: none; display: flex; }

.cookie-text { flex: 1; min-width: 0; }
.cookie-text strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 2px;
}
.cookie-text span {
  display: block;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
}
.cookie-text a { color: var(--accent-2); text-decoration: underline; }

.cookie-ok { flex: none; white-space: nowrap; }

@media (max-width: 720px) {
  /* Stack on a phone: the paragraph needs the full width, and the
     button needs to be a full-width target rather than a chip wedged
     into the corner. */
  .cookie-inner {
    flex-wrap: wrap;
    padding: 13px 14px;
    gap: 10px;
  }
  .cookie-ico { display: none; }
  .cookie-text { flex: 1 0 100%; }
  .cookie-text span { font-size: 13px; }
  .cookie-ok {
    flex: 1 0 100%;
    min-height: 44px;
    font-size: 14px;
  }
}

/* The install bar and the cookie bar both live at the bottom. The
   cookie notice is answered once and then gone, so it takes the spot
   and the install prompt waits its turn above it. */
.cookie-bar ~ .pwa-install-bar { bottom: 78px; }


/* =====================================================================
   NAV BADGE
   ---------------------------------------------------------------------
   Count of chats needing attention, beside the "My chats" link.
   Lives here rather than in chat.css because the header is on every
   page and chat.css is only loaded on the two chat screens - the badge
   was otherwise unstyled everywhere else.
   ===================================================================== */
/* Count of chats needing attention, beside the nav link.
   A real <sup>, so it sits raised against the word rather than beside
   it - and browsers already give <sup> the baseline shift, which is
   more reliable across the phones this app targets than trying to
   reproduce it with position:relative and a magic offset.
   vertical-align is restated because the default 'super' plus a
   smaller font-size drifts the pill too high on Android Chrome. */
.nav-badge {
  display: inline-block;
  min-width: 16px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  vertical-align: super;
  /* <sup> inherits a smaller size from the UA sheet; this keeps the
     pill's own metrics predictable. */
  position: relative;
  top: -1px;
}
