/* Helping Hands — warm, accessible, senior-friendly prototype styles */

:root {
  --cream: #FBF6EF;
  --cream-deep: #F3E6D6;
  --paper: #FFFDF9;
  --ink: #24160F;
  --ink-soft: #4E3C32;
  --line: #E4D0BE;
  --line-strong: #C9AB93;
  --terracotta: #8E2F12;
  --terracotta-hot: #A33816;
  --terracotta-soft: #F8E4D8;
  --sage: #21563B;
  --sage-hot: #1A6B45;
  --sage-soft: #E3F0E8;
  --gold: #6E470D;
  --gold-soft: #F7EED8;
  --teal: #1A4E55;
  --teal-soft: #E3F1F2;
  --rose: #7A2438;
  --rose-soft: #F8E4E8;
  --focus: #184A8C;
  --shadow: 0 10px 28px rgba(36, 22, 15, 0.08);
  --shadow-lg: 0 18px 50px rgba(36, 22, 15, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --font-ui: "Atkinson Hyperlegible", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --space: 1.25rem;
}

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

html, body {
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 19px;
  line-height: 1.5;
  min-height: 100%;
}

body {
  background-image:
    radial-gradient(ellipse at top left, rgba(142, 47, 18, 0.05), transparent 42%),
    radial-gradient(ellipse at bottom right, rgba(33, 86, 59, 0.05), transparent 40%);
}

img, svg { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 3.5vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

a {
  color: var(--terracotta);
  font-weight: 700;
  text-underline-offset: 3px;
}

a:hover { color: var(--terracotta-hot); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  z-index: 1000;
}
.skip-link:focus { top: 1rem; }

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
}

button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- App shell ---------- */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "top top"
    "nav main";
}

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.4rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--terracotta);
  color: var(--cream);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  display: block;
  line-height: 1;
}

.brand-tag {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 400;
  margin-top: 0.15rem;
}

.sim-banner {
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid #E4D19A;
  border-radius: 999px;
  padding: 0.28rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.who {
  text-align: right;
  line-height: 1.2;
}

.who-name { font-weight: 700; }
.who-role {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.sidenav {
  grid-area: nav;
  background: #FAF1E6;
  border-right: 1px solid var(--line);
  padding: 1.2rem 0.9rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidenav a,
.sidenav button.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 0.72rem 0.9rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  font-size: 1.05rem;
}

.sidenav a:hover,
.sidenav button.nav-link:hover {
  background: var(--terracotta-soft);
}

.sidenav a.active,
.sidenav button.nav-link.active {
  background: var(--terracotta);
  color: #fff;
}

.main {
  grid-area: main;
  padding: 1.6rem 1.8rem 4rem;
  max-width: 1100px;
  width: 100%;
}

/* ---------- Buttons & forms ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 0.72rem 1.15rem;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  text-decoration: none;
  min-height: 52px;
  background: var(--terracotta);
  color: #fff;
}

.btn:hover { background: var(--terracotta-hot); color: #fff; }

.btn-sage {
  background: var(--sage);
  color: #fff;
}
.btn-sage:hover { background: var(--sage-hot); color: #fff; }

.btn-ghost {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--cream-deep); color: var(--ink); }

.btn-danger {
  background: var(--rose);
  color: #fff;
}
.btn-danger:hover { background: #61182a; color: #fff; }

.btn-lg {
  min-height: 60px;
  padding: 0.9rem 1.4rem;
  font-size: 1.15rem;
  border-radius: 16px;
}

.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

label.field span.hint {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.password-field {
  position: relative;
  display: block;
}
.password-field input {
  padding-right: 4.8rem;
}
.password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.95rem;
  min-height: 44px;
  padding: 0 0.75rem;
  cursor: pointer;
}
.password-toggle:hover,
.password-toggle:focus {
  color: var(--ink);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  border: 2px solid var(--line-strong);
  background: #fff;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  min-height: 52px;
  font-weight: 400;
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.45;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--focus);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.form-grid .span-2 { grid-column: 1 / -1; }

/* ---------- Cards ---------- */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
}

.card + .card { margin-top: 1rem; }

.card-title {
  margin-bottom: 0.35rem;
}

.muted { color: var(--ink-soft); }
.small { font-size: 0.92rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.18rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--cream-deep);
  color: var(--ink);
  border: 1px solid var(--line);
}

.pill-sage { background: var(--sage-soft); color: var(--sage); border-color: #C4DEC9; }
.pill-terra { background: var(--terracotta-soft); color: var(--terracotta); border-color: #E8C3B0; }
.pill-gold { background: var(--gold-soft); color: var(--gold); border-color: #E4D19A; }
.pill-teal { background: var(--teal-soft); color: var(--teal); border-color: #BED9DC; }
.pill-rose { background: var(--rose-soft); color: var(--rose); border-color: #E8C0C8; }

.stack { display: flex; flex-direction: column; gap: 1rem; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}

.page-head p { margin: 0.25rem 0 0; max-width: 40rem; }

.flash {
  background: var(--sage-soft);
  border: 1px solid #C4DEC9;
  color: var(--sage);
  padding: 0.8rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-weight: 700;
}

.flash-warn {
  background: var(--gold-soft);
  border-color: #E4D19A;
  color: var(--gold);
}

/* ---------- Welcome ---------- */

.welcome {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 42%) 1fr;
}

.welcome-hero {
  background: var(--terracotta);
  color: var(--cream);
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.welcome-hero h1 {
  color: #fff;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin: 0.6rem 0 0.8rem;
}

.welcome-hero p {
  font-size: 1.2rem;
  color: #F8E4D8;
  max-width: 28rem;
}

.welcome-hero .brand-mark {
  background: #fff;
  color: var(--terracotta);
}

.welcome-panel {
  padding: 2rem 2rem 3rem;
  overflow: auto;
}

.account-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.7rem;
}

.account-card:hover {
  border-color: var(--terracotta);
  background: #fff;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.avatar-sm {
  width: 42px;
  height: 42px;
  font-size: 1rem;
}

.account-card .meta { flex: 1; min-width: 0; }
.account-card .meta strong { display: block; font-size: 1.1rem; }
.account-card .rate {
  font-weight: 700;
  white-space: nowrap;
  color: var(--terracotta);
}

/* ---------- Worker / person cards ---------- */

.person-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 100%;
}

.person-card header {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* ---------- Calendar ---------- */

.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.seg {
  display: inline-flex;
  background: var(--cream-deep);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.2rem;
  gap: 0.15rem;
}

.seg button {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.45rem 0.9rem;
  font-weight: 700;
  min-height: 44px;
  color: var(--ink);
}

.seg button.active {
  background: var(--paper);
  box-shadow: 0 1px 4px rgba(36,22,15,0.12);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.55rem;
}

.week-day {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 180px;
  padding: 0.65rem 0.55rem 0.8rem;
}

.week-day.today {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 2px var(--terracotta-soft);
}

.week-day h3 {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
  color: var(--ink-soft);
}

.week-day h3 b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--ink);
  text-transform: none;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.slot {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 10px;
  padding: 0.4rem 0.45rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-avail {
  background: var(--sage-soft);
  color: var(--sage);
}

.slot-booked {
  background: var(--terracotta-soft);
  color: var(--terracotta);
}

.slot-done {
  background: var(--cream-deep);
  color: var(--ink-soft);
}

.slot-live {
  background: #214A32;
  color: #fff;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.month-dow {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 0.3rem;
}

.month-cell {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 92px;
  padding: 0.4rem;
  text-align: left;
  width: 100%;
  color: inherit;
}

.month-cell:hover { border-color: var(--terracotta); }
.month-cell.outside { opacity: 0.72; }
.month-cell.today { border-color: var(--terracotta); box-shadow: 0 0 0 2px var(--terracotta-soft); }
.month-cell .num { font-weight: 700; display: block; margin-bottom: 0.2rem; }
.month-dots { display: flex; flex-wrap: wrap; gap: 3px; }
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sage);
}
.dot-booked { background: var(--terracotta); }

/* ---------- Wallets ---------- */

.wallet-card h3 { margin-bottom: 0.15rem; }
.wallet-bal {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.wallet-main { border-top: 6px solid var(--terracotta); }
.wallet-tax { border-top: 6px solid var(--gold); }
.wallet-savings { border-top: 6px solid var(--teal); }

.breakdown {
  list-style: none;
  margin: 0;
  padding: 0;
}

.breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.breakdown li:last-child { border-bottom: 0; font-weight: 700; }
.breakdown .neg { color: var(--rose); }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

table.data th, table.data td {
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

table.data td.amt { font-weight: 700; white-space: nowrap; }

/* ---------- Shift detail ---------- */

.shift-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.clock-box {
  background: var(--sage-soft);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  text-align: center;
}

.clock-box.live {
  background: var(--sage);
  color: #fff;
}

/* ---------- Modal ---------- */

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(36, 22, 15, 0.45);
  display: grid;
  place-items: center;
  padding: 1.2rem;
  z-index: 80;
}

.modal {
  background: var(--paper);
  border-radius: 20px;
  padding: 1.4rem 1.5rem 1.5rem;
  width: min(560px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  box-shadow: var(--shadow-lg);
}

.modal-wide {
  width: min(840px, 100%);
}

.modal h2 { margin-top: 0; }

/* ---------- Empty ---------- */

.empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--ink-soft);
}

/* ---------- Mobile nav ---------- */

.bottom-nav { display: none; }

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "main";
    padding-bottom: calc(5.6rem + env(safe-area-inset-bottom));
  }
  .sidenav { display: none; }
  .topbar {
    padding: 0.5rem 0.7rem 0.55rem;
    gap: 0.4rem 0.55rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
  .topbar-right { display: contents; }
  .brand { min-width: 0; }
  .brand-tag { display: none; }
  .brand-name { font-size: 1.12rem; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .topbar .btn {
    min-height: 44px;
    padding: 0.4rem 0.65rem;
    font-size: 0.9rem;
    white-space: nowrap;
    margin-left: auto;
  }
  .sim-banner {
    display: block;
    flex: 1 0 100%;
    order: 3;
    width: 100%;
    text-align: center;
    white-space: normal;
    border-radius: 10px;
    font-size: 0.78rem;
  }
  .who { display: none; }
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--paper);
    border-top: 1px solid var(--line);
    z-index: 50;
    justify-content: space-around;
    padding: 0.25rem 0.15rem calc(0.25rem + env(safe-area-inset-bottom));
  }
  .bottom-nav button, .bottom-nav a {
    flex: 1;
    background: none;
    border: 0;
    text-align: center;
    padding: 0.35rem 0.12rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--ink-soft);
    text-decoration: none;
    border-radius: 10px;
    line-height: 1.15;
    white-space: normal;
    min-height: 52px;
  }
  .bottom-nav .active { color: var(--terracotta); }
  .welcome { grid-template-columns: 1fr; }
  .welcome-hero { padding: 1.5rem 1.15rem 1.2rem; }
  .welcome-hero h1 { font-size: 2.15rem; }
  .welcome-hero p { font-size: 1.05rem; }
  .welcome-panel { padding: 1.15rem 1rem 2rem; }
  .form-grid, .grid-2, .grid-3, .week-grid { grid-template-columns: 1fr; }
  .week-grid { gap: 0.7rem; }
  .week-day { min-height: 0; }
  .month-grid { gap: 0.2rem; }
  .month-cell { min-height: 52px; padding: 0.2rem; }
  .month-dow { font-size: 0.68rem; padding: 0.15rem 0; }
  .main { padding: 1rem 0.9rem 1.5rem; }
  .page-head { margin-bottom: 1rem; }
  h1 { font-size: 1.7rem; }
  .wallet-bal { font-size: 1.65rem; }
  .account-card { align-items: flex-start; }
  .cal-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .cal-toolbar .seg { display: flex; }
  .cal-toolbar .seg button { flex: 1; }
  .modal-back {
    padding: 0.55rem;
    align-items: end;
    padding-bottom: calc(0.55rem + env(safe-area-inset-bottom));
  }
  .modal, .modal-wide {
    width: 100%;
    max-height: min(88vh, 900px);
    padding: 1.1rem 1rem 1.15rem;
    border-radius: 16px 16px 12px 12px;
  }
  .btn { white-space: normal; }
  .btn-lg {
    min-height: 52px;
    padding: 0.65rem 0.85rem;
    font-size: 1.05rem;
  }
  .btn-row { flex-wrap: wrap; }
  .btn-row .btn,
  .btn-row .btn-lg {
    width: auto;
    flex: 1 1 10rem;
    min-width: 0;
  }
  /* Standalone large buttons (e.g. End Shift) still span the screen */
  .btn-lg.btn-block { width: 100%; }
  table.data { font-size: 0.9rem; }
  .slot { white-space: normal; }
}

@media (max-width: 430px) {
  .account-card .rate { font-size: 0.95rem; }
  .person-card header { flex-wrap: wrap; }
  .month-cell { min-height: 46px; }
  .welcome-hero { padding: 1.25rem 1rem 1rem; }
}

@media (max-width: 1100px) and (min-width: 901px) {
  .week-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}


/* Room for a host badge (e.g. ship.page) so phone nav stays tappable */
body:has(ship-page-badge) .bottom-nav {
  bottom: 80px;
}
body:has(ship-page-badge).app-shell,
body:has(ship-page-badge) .app-shell {
  padding-bottom: calc(5.6rem + 80px + env(safe-area-inset-bottom));
}
body:has(ship-page-badge) .modal-back {
  padding-bottom: calc(0.55rem + 80px + env(safe-area-inset-bottom));
}

/* ---- Supabase version additions ---- */
.btn[disabled],
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
table.data td.amt {
  white-space: nowrap;
}
.statement h1 {
  font-size: 1.6rem;
}
@media print {
  .topbar,
  .sidenav,
  .bottom-nav,
  .no-print,
  .flash,
  .skip-link {
    display: none !important;
  }
  .app-shell,
  .main {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #ccc;
  }
  body {
    background: #fff !important;
  }
}

/* ---- synced calendar busy times and buffers ---- */
.slot-busy { background: #E9E4DF; color: #4A4039; border: 1px solid #CFC5BC; cursor: default; }
.slot-buffer {
  background: repeating-linear-gradient(135deg, #F1EEEB 0 6px, #E6E1DC 6px 12px);
  color: #6B625B; border: 1px dashed #C9BFB6; font-size: .8rem; cursor: default;
}
/* ---- messages ---- */
.nav-badge {
  display: inline-block; min-width: 1.3rem; padding: 0 .35rem; margin-left: .25rem; border-radius: 999px;
  background: var(--terracotta); color: #fff; font-size: .75rem; line-height: 1.3rem; text-align: center; font-weight: 700;
}
.bottom-nav .nav-badge { margin-left: .15rem; min-width: 1.1rem; line-height: 1.1rem; font-size: .68rem; }
.thread { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.msg { max-width: 85%; padding: .65rem .85rem; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); }
.msg-mine { align-self: flex-end; background: var(--cream-deep); }
.msg-theirs { align-self: flex-start; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { font-size: .78rem; color: var(--ink-soft); margin-top: .25rem; }
.btn-row.wrap { flex-wrap: wrap; }
.btn-row.wrap .btn { flex: 1 1 auto; }
/* ---- hands-free prompt (outside #app so re-renders never hide it) ---- */
.hf-prompt {
  position: fixed; inset: 0; z-index: 200; background: rgba(30, 20, 15, .72);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.hf-card { background: var(--paper); border-radius: 18px; padding: 1.4rem 1.2rem; width: min(480px, 100%); display: grid; gap: .7rem; }
.hf-card h2 { margin: 0; font-size: 1.5rem; }
.hf-card .btn { min-height: 64px; font-size: 1.15rem; }
@media print { .hf-prompt { display: none; } }

/* ---- printable tax documents ---- */
.print-only { display: none; }
.print-bar { margin-top: .6rem; }
@media print {
  @page { margin: 0.6in; }
  .print-only { display: block !important; }
  .printable .page-head, .printable form .field, .printable button, .printable .print-bar { display: none !important; }
  .printable form.cal-toolbar { display: block; margin: 0 !important; }
  .printable form.cal-toolbar h2 { margin: 0 0 .5rem; }
  .print-header { border-bottom: 2px solid #000; padding-bottom: .5rem; margin-bottom: 1rem; color: #000; font-size: 11pt; }
  .print-totals { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-top: .6rem; font-size: 12pt; }
  .printable .grid-2 { display: none !important; }
  .printable .card { break-inside: auto; padding: .4rem 0 !important; border: 0 !important; overflow: visible !important; }
  table.data { width: 100%; border-collapse: collapse; font-size: 10pt; color: #000; }
  table.data th, table.data td { border: 1px solid #999; padding: 4px 6px; }
  table.data thead { display: table-header-group; }
  table.data tr { break-inside: avoid; }
  .statement .brand-mark svg { width: 40px; height: 40px; }
  .statement .print-bar, .statement ~ .print-bar { display: none !important; }
  body, .main { color: #000 !important; font-size: 11pt; }
}

/* ---- photo pickers (Take photo / Choose from gallery) ---- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.photo-picker { margin-top: .4rem; }
.pick-btn { position: relative; cursor: pointer; min-height: 48px; display: inline-flex; align-items: center; }
.pick-btn:focus-within { outline: 3px solid var(--focus, #1d4ed8); outline-offset: 2px; }
.pick-preview { display: block; width: 140px; height: 140px; object-fit: cover; border-radius: 14px; background: var(--cream-deep); margin-bottom: .6rem; border: 1px solid rgba(0,0,0,.08); }
.pick-preview[hidden] { display: none; }
@media (max-width: 480px) { .photo-picker .pick-btn { flex: 1 1 100%; justify-content: center; } }

/* ---- role switcher + footer ---- */
.role-switch { margin: 0; }
.role-switch button { min-height: 40px; }
.app-footer { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid rgba(0,0,0,.08); }
.link-btn { background: none; border: 0; padding: .4rem 0; color: var(--terra, #A33D16); font-weight: 700; text-decoration: underline; cursor: pointer; font: inherit; min-height: 44px; }

.cal-connect-banner {
  background: var(--teal-soft);
  border: 1px solid #BED9DC;
  margin-bottom: 1rem;
}
.cal-connect-banner p { margin: 0 0 0.8rem; }
.cal-sync-status {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}
.cal-sync-status .link-btn {
  display: inline;
  padding: 0.15rem 0;
  min-height: 44px;
  font-size: inherit;
  vertical-align: baseline;
}
.cal-howto-body ol { margin: 0.2rem 0 0.6rem 1.2rem; padding: 0; }
.cal-howto-body li { margin: 0.35rem 0; }

.btn.btn-google {
  background: #fff;
  color: #1f1f1f;
  border-color: #747775;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
}
.btn.btn-google:hover:not(:disabled) {
  background: #f7f8f8;
  color: #1f1f1f;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.25);
}
.btn.btn-google:disabled { opacity: 0.7; }
.btn-google .google-g, .btn-google svg { display: block; width: 18px; height: 18px; flex-shrink: 0; }
.google-connect-wrap { margin: .2rem 0 .4rem; }
.cal-other-way summary { min-height: 44px; display: flex; align-items: center; }

@media (max-width: 760px) { .topbar .role-switch { order: 5; width: 100%; } .topbar .role-switch button { flex: 1; } }
.pick-status { margin: .4rem 0 0; font-weight: 600; }
.pick-error { color: #9B1C1C; background: #FDECEC; border: 1px solid #F5C2C2; border-radius: 10px; padding: .5rem .7rem; }
.pick-busy { color: #6B4E16; }

/* ===== My Profile + Where I work ===== */
.me-btn { display: inline-flex; align-items: center; gap: .45rem; background: none; border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem .2rem .2rem; cursor: pointer; font: inherit; font-weight: 700; color: var(--ink, #2b2118); min-height: 44px; }
.me-btn .avatar-sm { width: 36px; height: 36px; font-size: .85rem; }
.me-btn.active, .me-btn:hover { border-color: var(--terracotta); color: var(--terracotta); }
.avatar-xl { width: 112px; height: 112px; font-size: 2.2rem; object-fit: cover; }
.profile-summary { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.profile-summary .meta { flex: 1; min-width: 200px; }
.profile-jumps .btn { flex: 0 1 auto !important; }
.btn-sm { min-height: 44px; padding: .4rem .8rem; font-size: .95rem; }
.area-card .btn, .area-card summary { white-space: normal; text-align: center; }
.area-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.area-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.area-row .area-name { flex: 1 1 10rem; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.area-row .btn, .area-row .link-btn { flex: 0 0 auto; }
.near-list { border: 0; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; min-width: 0; }
.near-list legend { padding: 0; margin-bottom: .5rem; }
.near-row { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; min-height: 52px; }
.near-row.on { border-color: var(--sage, #21563B); background: #EEF5F0; }
.near-row input { width: 1.5rem; height: 1.5rem; flex: 0 0 auto; margin: 0; }
.near-row .near-name { flex: 1 1 auto; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.near-row .near-mi { flex: 0 0 auto; color: var(--ink-soft); font-weight: 700; }
.area-search { margin-top: 1rem; }
.area-search summary { font-weight: 700; cursor: pointer; min-height: 44px; display: flex; align-items: center; text-align: left; }
.area-search .field { margin-top: .6rem; }
.county-results { display: grid; gap: .45rem; margin-top: .6rem; }
.county-opt { min-height: 48px; justify-content: flex-start; }
@media (max-width: 900px) {
  .me-btn { margin-left: auto; padding-right: .55rem; }
  .topbar .me-btn + .btn { margin-left: 0; }
  .avatar-xl { width: 96px; height: 96px; }
}
@media (max-width: 430px) { .me-btn .me-label { font-size: .85rem; } }
[data-testid="role-card"] .btn, .profile-jumps .btn { white-space: normal; text-align: center; }
.main, #app, .app-shell, .card, .grid-2, .grid-3, .form-grid, .cal-toolbar, .page-head, .printable, .welcome, .welcome-panel { min-width: 0; max-width: 100%; }
.card { overflow-wrap: anywhere; }
p, h1, h2, h3, li, td, th, .muted, .small, .wallet-bal, .breakdown li, .page-head p { overflow-wrap: anywhere; }
.breakdown li { flex-wrap: wrap; }
.breakdown li span { min-width: 0; }

/* Netlify's free-plan "Powered by Netlify" badge (if shown) sits in the bottom-right corner on phones.
   Make the phone menu taller (solid background) so the badge sits inside it and page content never shows around it. */
@media (max-width: 900px) {
  body:has(#nl-badge-frame) .bottom-nav { padding-bottom: calc(64px + env(safe-area-inset-bottom)); align-items: flex-start; }
  body:has(#nl-badge-frame) .app-shell { padding-bottom: calc(5.6rem + 64px + env(safe-area-inset-bottom)); }
  body:has(#nl-badge-frame) .modal-back { padding-bottom: calc(0.55rem + 64px + env(safe-area-inset-bottom)); }
}
/* jump links / scrollIntoView land below the sticky top bar */
[id^="sec-"], #emergency-card, #household-card, .near-list, #home-messages { scroll-margin-top: 6rem; }
@media (max-width: 900px) { [id^="sec-"], #emergency-card, #household-card, .near-list, #home-messages { scroll-margin-top: 9.5rem; } }
.area-search summary { list-style: none; color: var(--terracotta); text-decoration: underline; }
.area-search summary::-webkit-details-marker { display: none; }
.area-search summary::before { content: "▸"; margin-right: .5rem; text-decoration: none; display: inline-block; }
.area-search[open] summary::before { content: "▾"; }
.geo-status { margin: .7rem 0 0; }
.geo-status[hidden] { display: none; }

/* ===== Find customers / offers ===== */
.toggle-row { display: flex; gap: .7rem; align-items: flex-start; margin: .6rem 0; cursor: pointer; }
.toggle-row input[type="checkbox"] { width: 1.5rem; height: 1.5rem; flex: 0 0 auto; margin: .1rem 0 0; }
.cust-card { display: flex; flex-direction: column; gap: .6rem; }
.cust-card .btn { white-space: normal; }
.offer-actions .btn { white-space: normal; flex: 1 1 auto !important; }

/* ===== Automatic availability: day labels (color + text) ===== */
.st-pill { display: inline-flex; align-items: center; gap: .2rem; border-radius: 999px; padding: .15rem .55rem; font-size: .78rem; font-weight: 700; border: 1px solid transparent; line-height: 1.35; white-space: normal; }
.st-pill small { font-weight: 600; font-size: .72rem; }
.st-open { background: var(--sage-soft); color: var(--sage); border-color: #9CC8AC; }
.st-partly { background: var(--gold-soft); color: var(--gold); border-color: #DDBF73; }
.st-full { background: var(--terracotta-soft); color: var(--terracotta); border-color: #E2A68F; }
.st-off { background: repeating-linear-gradient(135deg, #EFEBE7 0 6px, #E2DCD6 6px 12px); color: #3F3630; border-color: #C9BFB6; }
.st-past { background: #F3F1EF; color: #5E5650; border-color: #DCD6D1; }
.st-soon { background: #E6EEF8; color: #234468; border-color: #A9C0DD; }
.st-unset { background: #EFE9F6; color: #4B3570; border-color: #C8B7E0; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 .4rem; }

.month-cell { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; position: relative; overflow: hidden; }
.month-cell .cell-st { font-size: .72rem; font-weight: 700; line-height: 1.1; }
.month-cell .cell-n { position: absolute; top: .3rem; right: .3rem; min-width: 1.15rem; height: 1.15rem; border-radius: 999px; background: var(--terracotta); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; padding: 0 .2rem; }
.month-cell .cell-tick { position: absolute; bottom: .25rem; right: .3rem; font-weight: 800; color: var(--ink); }
.st-open-cell { background: var(--sage-soft); border-color: #9CC8AC; color: var(--sage); }
.st-partly-cell { background: var(--gold-soft); border-color: #DDBF73; color: var(--gold); }
.st-full-cell { background: var(--terracotta-soft); border-color: #E2A68F; color: var(--terracotta); }
.st-off-cell { background: repeating-linear-gradient(135deg, #F3F0ED 0 6px, #E7E2DD 6px 12px); color: #3F3630; }
.st-past-cell { background: #F6F4F2; color: #6B625B; }
.st-soon-cell { background: #E6EEF8; border-color: #A9C0DD; color: #234468; }
.st-unset-cell { background: #F4F0FA; border-color: #C8B7E0; color: #4B3570; }
.month-cell .num { color: var(--ink); }
.month-cell[disabled] { cursor: default; }
.month-cell.picked { outline: 3px solid var(--ink); outline-offset: -3px; }
.month-grid.selecting .month-cell:not([disabled]) { cursor: pointer; }

.week-day h3 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem; }
.week-day.st-off-day, .week-day.st-past-day { background: #FAF8F6; }
.slot-add { background: transparent; border: 1px dashed var(--line-strong); color: var(--ink); white-space: normal; min-height: 44px; text-align: center; }
.slot-hours { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); font-weight: 600; white-space: normal; }
.slot-dayoff { background: repeating-linear-gradient(135deg, #F1EEEB 0 6px, #E6E1DC 6px 12px); color: #3F3630; border: 1px dashed #C9BFB6; white-space: normal; }
.slot-request { background: #E4EEF0; color: var(--teal); border: 1px solid #A8C7CC; white-space: normal; }
.tag-outside { display: inline-block; background: #FFF1D6; color: #6E470D; border: 1px solid #E4C27A; border-radius: 999px; padding: .05rem .45rem; font-size: .74rem; font-weight: 700; font-style: normal; }
.slot-avail { white-space: normal; }
button.slot-avail { border: 1px solid #9CC8AC; cursor: pointer; min-height: 44px; }

.pick-chip { min-height: 44px; cursor: pointer; font-weight: 700; font-size: .9rem; padding: .35rem .75rem; }
.day-actions { display: grid; gap: .5rem; margin-top: 1rem; }
.day-actions details summary { cursor: pointer; font-weight: 700; padding: .6rem 0; }
.select-bar { margin-bottom: .8rem; box-shadow: none; border: 2px solid var(--ink); }
.select-bar .btn { white-space: normal; }
.cal-nav { display: flex; gap: .4rem; flex-wrap: wrap; }

.wh-row { display: grid; grid-template-columns: minmax(8.5rem, 10rem) 1fr; gap: .4rem .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.wh-row .wh-day { display: flex; gap: .55rem; align-items: center; font-weight: 700; cursor: pointer; min-height: 44px; }
.wh-row .wh-day input { width: 1.4rem; height: 1.4rem; margin: 0; flex: 0 0 auto; }
.wh-row .wh-times { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.wh-row .wh-times input { min-height: 44px; min-width: 0; width: 8.2rem; max-width: 100%; }
.wh-row .wh-offtext { display: none; color: var(--ink-soft); font-weight: 600; }
.wh-row.is-off .wh-times { display: none; }
.wh-row.is-off .wh-offtext { display: inline; }
.wh-row.wh-attn { background: var(--gold-soft); border-radius: 10px; padding-left: .4rem; }
.plain-list { list-style: none; margin: 0 0 .8rem; padding: 0; }
.plain-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.plain-list .btn-pair { display: flex; gap: .4rem; flex-wrap: wrap; }
#days-off h3 { margin: 1.1rem 0 .4rem; font-size: 1.05rem; }

@media (max-width: 430px) {
  .month-cell { padding: .2rem .15rem; min-height: 50px; }
  .month-cell .num { font-size: .85rem; margin-bottom: 0; }
  .month-cell .cell-st { font-size: .6rem; letter-spacing: -.01em; }
  .month-cell .cell-n { top: .15rem; right: .15rem; min-width: .95rem; height: .95rem; font-size: .58rem; }
  .wh-row { grid-template-columns: 1fr; }
  .wh-row .wh-times input { width: calc(50% - 1.2rem); }
  .cal-nav .btn { padding-left: .7rem; padding-right: .7rem; }
}
.select-bar .btn-row { flex-wrap: wrap; }
.select-bar .btn-row .btn { flex: 1 1 100%; white-space: normal; }
.day-actions .btn { white-space: normal; width: 100%; }
.btn-row .btn[data-testid="connect-ical-link"] { white-space: normal; }
.flash-error { background: var(--terracotta-soft); color: var(--terracotta); border: 1px solid #E2A68F; }

/* ---------- card payments (v2026.11.29-7) ---------- */
.test-banner { background: #FFF3C4; color: #4A3200; border: 2px dashed #B8860B; border-radius: var(--radius-sm); padding: .6rem .8rem; margin: .4rem 0 .8rem; font-size: 1rem; line-height: 1.4; overflow-wrap: anywhere; }
.test-banner strong { letter-spacing: .04em; }
.pill-warn { background: var(--gold-soft); color: var(--gold); border-color: #E2CF9F; }
.pill-danger { background: var(--rose-soft); color: var(--rose); border-color: #E7B9C3; }
.linkish { background: none; border: 0; padding: 0; color: var(--focus); text-decoration: underline; font: inherit; cursor: pointer; min-height: 0; }
.pay-block .btn { margin-top: .3rem; }
@media (max-width: 430px) {
  #sec-payments .btn-row .btn, .pay-block .btn { white-space: normal; }
}
@media (max-width: 430px) {
  [data-testid="background-card"] .btn, .modal [data-testid="req-need-card"] .btn { white-space: normal; }
}
@media (max-width: 430px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .wallet-card .btn-row { flex-wrap: wrap; }
  .wallet-card .btn-row .btn { flex: 1 1 100%; white-space: normal; }
}

/* ---------- v2026.11.30-1: phone width fit (no horizontal scroll) ---------- */
.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 900px) {
  .seg {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
  }
  .seg button {
    flex: 1 1 auto;
    padding: 0.45rem 0.55rem;
    min-width: 0;
  }
  .cal-toolbar .field,
  .cal-toolbar .btn-row,
  .cal-toolbar > .btn {
    width: 100%;
    min-width: 0;
    flex: 1 1 100%;
  }
  .cal-toolbar .field { margin: 0; }
  /* Stack ledgers into labeled cards so 4–9 columns stay on screen */
  table.data thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  table.data,
  table.data tbody {
    display: block;
    width: 100%;
  }
  table.data tr {
    display: block;
    width: 100%;
  }
  table.data tbody tr {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
    margin: 0 0 0.7rem;
  }
  table.data tbody tr:last-child { margin-bottom: 0; }
  table.data th,
  table.data td {
    display: grid;
    grid-template-columns: minmax(6.5rem, 32%) 1fr;
    gap: 0.45rem 0.7rem;
    width: 100%;
    padding: 0.28rem 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  table.data td.amt { white-space: normal; }
  table.data td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    padding-top: 0.15rem;
  }
  table.data td[colspan] {
    display: block;
    grid-template-columns: 1fr;
  }
  table.data td[colspan]::before { content: none; }
  [data-testid="file-row"] { flex-wrap: wrap; }
  [data-testid="file-row"] .btn { flex: 1 1 auto; white-space: normal; }
}
@media (max-width: 360px) {
  .main { padding-left: 0.7rem; padding-right: 0.7rem; }
  .card { padding: 1rem 0.9rem; }
  table.data td { grid-template-columns: 1fr; gap: 0.1rem 0; }
  table.data td::before { padding-top: 0.2rem; }
}

/* ---------- v2026.11.30-3: messages on Home ---------- */
.home-messages { margin: 0 0 1.3rem; min-width: 0; }
.home-messages-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}
.home-messages-head h2 { margin: 0; display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; min-width: 0; }
.home-messages-head .link-btn { margin-left: auto; padding: 0.2rem 0; white-space: nowrap; }
.home-messages .account-card { margin-bottom: 0.5rem; padding: 0.75rem 0.85rem; max-width: 100%; }
.account-card .meta .small,
.account-card .meta .muted { display: block; overflow-wrap: anywhere; }
.account-card .pill { flex-shrink: 0; }

/* Extra Tax info bubble and optional-wallet switch */
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: 2px solid var(--ink, #1f2a24);
  background: var(--paper, #fff);
  color: var(--ink, #1f2a24);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  flex: 0 0 auto;
}
.info-btn:hover, .info-btn:focus-visible { border-color: var(--terracotta, #c45c26); color: var(--terracotta, #c45c26); outline: none; }
.wallet-card h3, .extra-tax-settings h2 { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.wallet-intro-line { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 0.7rem; }
.modal-info { width: min(24rem, calc(100vw - 2rem)); max-width: 100%; }
.modal-info-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.8rem; }
.modal-info-head h2 { flex: 1 1 auto; padding-right: 0.25rem; }
.modal-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink, #1f2a24);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.modal-x:hover, .modal-x:focus-visible { background: var(--cream, #f4efe6); outline: none; }
.extra-tax-settings .toggle-row { margin-bottom: 0; }
.extra-tax-settings .toggle-row span { overflow-wrap: anywhere; }

/* Allergy & pet info: bright badge, warnings, and profile fields (wrap on a 360px phone) */
.allergy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  margin: 0.25rem 0;
  padding: 0.4rem 0.75rem;
  border: 2px solid #8e2f12;
  border-radius: 999px;
  background: #ffd24d;
  color: #5a1408;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
  white-space: normal;
  flex: 0 1 auto;
}
.allergy-badge:hover, .allergy-badge:focus-visible { filter: brightness(0.97); outline: 2px solid #8e2f12; outline-offset: 2px; }
.allergy-row { display: flex; flex-wrap: wrap; gap: 0.4rem; max-width: 100%; min-width: 0; margin-top: 0.35rem; }
.allergy-warn, .allergy-food-notice {
  max-width: 100%;
  min-width: 0;
  margin: 0.55rem 0 0;
  padding: 0.7rem 0.8rem;
  border-radius: 0.7rem;
  overflow-wrap: anywhere;
}
.allergy-warn { background: #fdecea; border: 2px solid #b42318; color: #5a1212; }
.allergy-warn-soft { background: #fff4d6; border-color: #b7791f; color: #5a3b00; }
.allergy-food-notice { background: #eef6ff; border: 2px solid #2b6cb0; color: #16324f; }
.allergy-warn p, .allergy-food-notice p, .allergy-detail p { margin: 0; overflow-wrap: anywhere; }
.allergy-detail { margin-bottom: 0.75rem; min-width: 0; }
.allergy-ack { display: flex; align-items: flex-start; gap: 0.5rem; margin-top: 0.65rem; font-weight: 700; }
.allergy-ack input { width: 1.3rem; height: 1.3rem; min-width: 1.3rem; flex: 0 0 auto; margin-top: 0.05rem; }
.allergy-fields, .allergy-field { min-width: 0; max-width: 100%; }
.allergy-fields-title, .allergy-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-weight: 700;
  margin: 0 0 0.4rem;
}
.allergy-field { margin-top: 0.95rem; }
.allergy-chips { margin: 0.35rem 0 0.5rem; }
.allergy-fields .field { min-width: 0; }
.person-card .allergy-badge, .cust-card .allergy-badge { align-self: flex-start; }

/* Rides policy notice */
.rides-notice { margin: 0.6rem 0 0; max-width: 100%; min-width: 0; }
.rides-notice p { margin: 0; overflow-wrap: anywhere; display: flex; align-items: flex-start; gap: 0.35rem; flex-wrap: wrap; }
.rides-notice .info-btn { flex: 0 0 auto; }
