/* ============================================================
   Trade client portal + admin console.
   Layers on top of styles.css and reuses its tokens, so the
   portal feels like part of the site rather than a bolted-on
   tool. Anything not defined here comes from styles.css.
   ============================================================ */

body.portal { background: var(--cream); }

/* The hidden attribute must beat our own display rules. Without this,
   .login-wrap's `display: grid` overrides it and the login card stays
   on screen underneath the signed-in console. */
[hidden] { display: none !important; }

.portal-bar {
  background: var(--charcoal);
  color: var(--cream-soft);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.portal-bar .container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.portal-bar img { height: 34px; width: auto; }
.portal-bar strong {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.15;
}
.portal-bar .spacer { margin-left: auto; }
.portal-bar .who {
  font-size: 0.85rem;
  opacity: 0.75;
  white-space: nowrap;
}
.portal-bar button {
  font: inherit;
  font-size: 0.85rem;
  background: transparent;
  color: var(--cream-soft);
  border: 1.5px solid rgba(240, 235, 220, 0.35);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}
.portal-bar button:hover { background: rgba(240, 235, 220, 0.12); }

.portal-main { padding: var(--space-md) 0 var(--space-xl); }
.portal-main > .container { max-width: 940px; }

.portal-head { margin-bottom: var(--space-md); }
.portal-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--charcoal);
  margin-bottom: 0.3rem;
}
.portal-head p { color: var(--charcoal-soft); max-width: 62ch; }

.panel {
  background: var(--paper);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}
.panel > h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--olive-dark);
  margin-bottom: 0.75rem;
}
.panel > h2 .sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--charcoal-soft);
  display: block;
  margin-top: 0.15rem;
}

/* "Coming up": booked days a few days out that want a heads-up email.
   Warm-tinted so it reads as an alert without shouting. */
.panel.remind {
  background: #FFF8E9;
  border: 1px solid rgba(232, 182, 92, 0.55);
}
.panel.remind > h2 { color: var(--rust-dark); }
.remind-job {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(0, 1.4fr) auto;
  gap: 0.6rem 1rem;
  align-items: center;
  padding: 0.7rem 0;
  border-top: 1px solid rgba(232, 182, 92, 0.35);
}
.remind-job:first-child { border-top: 0; padding-top: 0.2rem; }
.remind-job.is-done { opacity: 0.6; }
.remind-when strong, .remind-who strong { display: block; font-size: 0.95rem; }
.remind-when span, .remind-who span { display: block; font-size: 0.8rem; color: var(--charcoal-soft); }
.remind-acts { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.remind-done { font-size: 0.78rem; color: var(--charcoal-soft); }
@media (max-width: 640px) {
  .remind-job { grid-template-columns: 1fr; gap: 0.3rem; }
  .remind-acts { justify-content: flex-start; margin-top: 0.2rem; }
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 76vh;
  display: grid;
  place-items: center;
  padding: var(--space-md) var(--space-sm);
}
.login-card {
  background: var(--paper);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--space-lg) var(--space-md);
  width: min(430px, 100%);
  text-align: center;
}
.login-card img { height: 62px; margin-bottom: var(--space-sm); }
.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--charcoal);
  margin-bottom: 0.4rem;
}
.login-card p.intro {
  color: var(--charcoal-soft);
  font-size: 0.92rem;
  margin-bottom: var(--space-md);
}
.login-card input {
  text-align: center;
  letter-spacing: 0.06em;
  font-size: 1.05rem;
}
.login-card .btn { width: 100%; margin-top: 0.75rem; }
.login-note {
  margin-top: var(--space-md);
  font-size: 0.82rem;
  color: var(--charcoal-soft);
  line-height: 1.6;
}

/* ---------- Shared form bits ---------- */
.field { margin-bottom: 1rem; text-align: left; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  color: var(--charcoal);
}
.field .hint {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--charcoal-soft);
  display: block;
  margin-top: 0.15rem;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 2px solid var(--olive-light);
  border-radius: var(--radius-sm);
  background: var(--cream-soft);
  color: var(--charcoal);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--olive);
  background: var(--paper);
}
.field textarea { min-height: 110px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.rate-input { position: relative; }
.rate-input span {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: var(--charcoal-soft);
  pointer-events: none;
}
.rate-input input { padding-left: 1.9rem; }

.msg {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: none;
}
.msg.is-shown { display: block; }
.msg.error { background: #FBE6E1; color: var(--urgent-dark); }
.msg.ok { background: var(--olive-pale); color: var(--olive-dark); }

/* ---------- Calendar ---------- */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: 0.85rem;
}
.cal-head strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--charcoal);
}
.cal-nav { display: flex; gap: 0.4rem; }
.cal-nav button {
  font: inherit;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--olive-light);
  background: var(--paper);
  color: var(--olive-dark);
  font-size: 1.1rem;
  cursor: pointer;
}
.cal-nav button:hover:not(:disabled) { background: var(--olive-pale); }
.cal-nav button:disabled { opacity: 0.35; cursor: not-allowed; }

.cal-grid {
  display: grid;
  /* minmax(0, 1fr), not 1fr: a plain 1fr column still grows to fit the
     longest name on a square, which threw the whole month out of line on
     a phone. This pins every column to an equal share and lets the name
     truncate instead. */
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.cal-dow {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--charcoal-soft);
  padding-bottom: 0.35rem;
}

.cal-day {
  position: relative;
  aspect-ratio: 1 / 1;
  min-width: 0;               /* so a long name cannot widen the cell */
  min-height: 44px;           /* stays tappable on a phone */
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--cream-soft);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--charcoal);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  transition: transform 0.12s var(--ease-out), background 0.12s;
}
.cal-day.pad { visibility: hidden; }
.cal-day:hover:not(:disabled) { transform: translateY(-2px); }

.cal-day.is-free { background: var(--olive-pale); color: var(--olive-dark); }
.cal-day.is-selected {
  background: var(--olive);
  color: var(--cream-soft);
  border-color: var(--olive-dark);
}
.cal-day.is-blocked,
.cal-day.is-past {
  background: transparent;
  color: #B9B7AE;
  cursor: not-allowed;
  text-decoration: line-through;
}
.cal-day.is-booked {
  background: var(--rust-light);
  color: var(--rust-dark);
  cursor: not-allowed;
}

/* Ryan's own job, admin diary only. Same rust as a client booking so the
   month still reads at a glance, dashed so he can tell which are his. */
.cal-day.is-booked.is-own {
  border-color: var(--rust);
  border-style: dashed;
}
/* A job he has pencilled in but not confirmed. Still a free day underneath,
   because a client can still request it; the dashed rust ring and the demand
   count are what mark it out. */
.cal-day.is-pencilled {
  border-color: var(--rust);
  border-style: dashed;
}

/* Holiday. Visually distinct from an ordinary blocked day in Ryan's own
   diary; clients never see the difference, only that the day is gone. */
.cal-day.is-holiday {
  background: var(--sky);
  color: #29546B;
  text-decoration: none;
}
.cal-day.is-mine {
  border-color: var(--sun);
  border-style: dashed;
}

/* A booked day that belongs to the signed-in client. Same rust as any
   other booked day so the month still reads at a glance, but ringed and
   ticked so they can pick out their own work. */
.cal-day.is-mine-booked {
  border-color: var(--rust);
  border-style: solid;
  box-shadow: inset 0 0 0 1px var(--rust-light);
}
.cal-mine {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  color: var(--rust-dark);
}

/* Who the day is for, admin diary only. One truncated line under the
   number; the cell is square so there is room for it at every width. */
.cal-who {
  display: block;
  max-width: 100%;
  padding: 0 3px;
  box-sizing: border-box;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}
.cal-day.is-booked .cal-who { color: var(--rust-dark); }
.cal-day.is-pencilled .cal-who { color: var(--olive-dark); }

/* The draft sheet: a drafted email shown on the page, with Gmail /
   mail-app / copy buttons, instead of a mailto: that may open nothing. */
.draft-sheet {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(41, 42, 39, 0.55);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0.75rem;
}
.draft-card {
  width: min(680px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--paper);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.1rem 1.1rem;
}
.draft-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.draft-head h2 { font-family: var(--font-display); font-size: 1.1rem; color: var(--olive-dark); margin: 0; }
.draft-close {
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--cream); color: var(--charcoal);
  font-size: 1.3rem; cursor: pointer;
}
.draft-row { display: flex; gap: 0.6rem; font-size: 0.85rem; margin-bottom: 0.3rem; }
.draft-row span { color: var(--charcoal-soft); min-width: 3.6rem; }
.draft-row strong { overflow-wrap: anywhere; }
#draftBody {
  width: 100%; margin: 0.5rem 0 0.7rem;
  font: 0.86rem/1.5 ui-monospace, Menlo, Consolas, monospace;
  background: var(--cream-soft);
  border: 2px solid var(--olive-light);
  border-radius: var(--radius-sm);
  padding: 0.7rem;
  resize: vertical;
}
.draft-acts { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.draft-acts .btn { text-decoration: none; }
.draft-hint { font-size: 0.78rem; color: var(--charcoal-soft); margin: 0.6rem 0 0; }
@media (min-width: 720px) {
  .draft-sheet { align-items: center; }
}

/* Release / bring-back controls inside the day editor. */
.day-release {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed rgba(119, 60, 30, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(240, 218, 200, 0.35);
}
.day-release-label { font-size: 0.8rem; font-weight: 800; color: var(--charcoal-soft); margin: 0.5rem 0 0.25rem; }
.day-release > button:first-child + .day-release-label { margin-top: 0.6rem; }
.day-release-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  font-size: 0.85rem; padding: 0.25rem 0;
}
.day-release-row em { color: var(--charcoal-soft); font-style: normal; font-size: 0.78rem; }

/* Demand marker. Deliberately a count and nothing else: no
   company, no amount. Enough to say "get your skates on". */
.cal-dot {
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  padding: 2px 5px;
  border-radius: var(--radius-pill);
  background: var(--sun);
  color: var(--charcoal);
}
.cal-day.is-selected .cal-dot { background: var(--cream-soft); }

/* Quiet marker on a day that carries one of Ryan's notes. Deliberately
   just a dot: a glance at the month should not reveal what he is doing. */
.cal-note-mark {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rust);
}
.cal-day.is-blocked .cal-note-mark { background: var(--charcoal-soft); }

.cal-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.9rem;
  font-size: 0.78rem;
  color: var(--charcoal-soft);
}
.cal-key span { display: inline-flex; align-items: center; gap: 0.35rem; }
.cal-key i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}
.cal-key i.free { background: var(--olive-pale); border: 1px solid var(--olive-light); }
.cal-key i.sel { background: var(--olive); }
.cal-key i.booked { background: var(--rust-light); }
.cal-key i.booked.own { border: 2px dashed var(--rust); }
.cal-key i.pencilled { background: var(--olive-pale); border: 2px dashed var(--rust); }
.cal-key i.mine { background: var(--rust-light); border: 2px solid var(--rust); }
.cal-key i.demand { background: var(--sun); }

.selected-summary {
  margin-top: var(--space-sm);
  padding: 0.75rem 1rem;
  background: var(--olive-pale);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--olive-dark);
}
.selected-summary strong { font-weight: 800; }

/* ---------- Kit checkboxes ---------- */
.kit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}
.kit-grid label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.75rem;
  background: var(--cream-soft);
  border: 2px solid var(--olive-light);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.kit-grid label:has(input:checked) {
  background: var(--olive-pale);
  border-color: var(--olive);
  color: var(--olive-dark);
}
.kit-grid input { width: 18px; height: 18px; accent-color: var(--olive); flex: none; }

/* ---------- Photos ---------- */
.photo-drop {
  border: 2px dashed var(--olive-light);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  text-align: center;
  color: var(--charcoal-soft);
  font-size: 0.88rem;
  cursor: pointer;
  background: var(--cream-soft);
}
.photo-drop:hover { border-color: var(--olive); background: var(--olive-pale); }
.photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.photo-thumb {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--charcoal);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(41, 42, 39, 0.82);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Request cards ---------- */
.req {
  border: 2px solid var(--olive-light);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
  background: var(--paper);
}
.req-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.req-top h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--charcoal);
}
.req-top .rate {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--olive-dark);
  white-space: nowrap;
}
.req-meta { font-size: 0.82rem; color: var(--charcoal-soft); margin-bottom: 0.6rem; }
.req-brief {
  font-size: 0.92rem;
  white-space: pre-wrap;
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.85rem;
  background: var(--cream-soft);
  border-radius: var(--radius-sm);
}
.req-kit { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.req-kit span {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--olive-pale);
  color: var(--olive-dark);
}

.day-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.55rem 0;
  border-top: 1px solid var(--olive-light);
}
.day-row .d { font-weight: 700; font-size: 0.9rem; min-width: 8.5rem; }
.day-row .acts { margin-left: auto; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.day-row .acts button {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 32px;
}
/* These are used inside request rows and standalone in the day editor,
   so the sizing lives on the classes rather than on a parent selector. */
.btn-accept, .btn-counter, .btn-decline, .btn-ghost {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  min-height: 34px;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-accept { background: var(--olive); color: var(--cream-soft); }
.btn-accept:hover { background: var(--olive-dark); }
.btn-counter { background: var(--sun); color: var(--charcoal); }
.btn-counter:hover { filter: brightness(0.94); }
.btn-decline { background: transparent; color: var(--urgent-dark); border-color: #E7C4BB !important; }
.btn-decline:hover { background: #FBE6E1; }
.btn-ghost { background: transparent; color: var(--charcoal-soft); border-color: var(--olive-light) !important; }
.btn-ghost:hover { background: var(--cream-soft); }

.chip {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.chip.pending   { background: #EDEBE2; color: var(--charcoal-soft); }
.chip.accepted  { background: var(--olive); color: var(--cream-soft); }
.chip.countered { background: var(--sun); color: var(--charcoal); }
.chip.backup    { background: var(--sky); color: #29546B; }
.chip.declined  { background: #FBE6E1; color: var(--urgent-dark); }
.chip.withdrawn { background: #EDEBE2; color: var(--charcoal-soft); }

.empty {
  text-align: center;
  padding: var(--space-lg) var(--space-sm);
  color: var(--charcoal-soft);
  font-size: 0.92rem;
}

.code-reveal {
  background: var(--charcoal);
  color: var(--sun);
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  word-break: break-all;
  margin: 0.75rem 0;
}

.tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.tabs button {
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--olive-light);
  background: var(--paper);
  color: var(--charcoal-soft);
  cursor: pointer;
}
.tabs button.is-active {
  background: var(--olive);
  border-color: var(--olive);
  color: var(--cream-soft);
}

.legal {
  font-size: 0.78rem;
  color: var(--charcoal-soft);
  line-height: 1.65;
  border-top: 1px solid var(--olive-light);
  padding-top: var(--space-sm);
  margin-top: var(--space-md);
}

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .portal-bar strong { font-size: 0.9rem; }
  .portal-bar .who { display: none; }
  .cal-grid { gap: 3px; }
  /* Width is pinned by the 7-column grid, so buy the height back
     instead: a 40x44 cell is a comfortable thumb target. */
  .cal-day { font-size: 0.85rem; min-height: 44px; aspect-ratio: auto; }
  .day-row .acts button,
  .btn-accept, .btn-counter, .btn-decline, .btn-ghost {
    min-height: 40px; padding: 0.5rem 0.9rem;
  }
  .kit-grid { grid-template-columns: 1fr 1fr; }
  .kit-grid label { font-size: 0.8rem; padding: 0.5rem 0.55rem; }
  .day-row .acts { margin-left: 0; width: 100%; }
  .panel { padding: var(--space-sm); }
}

/* ============================================================
   Terms of work: the page, and the modal the booking form shows.
   The modal pulls its wording out of portal-terms.html so there
   is one source of truth. Styling them together keeps them
   reading the same whichever way the client arrives.
   ============================================================ */
.terms-page { max-width: 720px; padding: 1.5rem 0 3rem; }
.terms-back { margin: 0 0 1rem; font-size: 0.9rem; }
.terms-page h1 {
  font-family: var(--font-display);
  color: var(--olive-dark);
  font-size: 1.7rem;
  margin: 0 0 0.75rem;
}
.terms-meta { color: var(--charcoal); opacity: 0.75; font-size: 0.9rem; margin-bottom: 1.5rem; }
.terms-page h2,
.terms-sheet h2 {
  font-family: var(--font-display);
  color: var(--olive-dark);
  font-size: 1.12rem;
  margin: 1.6rem 0 0.5rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(41, 42, 39, 0.1);
}
.terms-page p,
.terms-sheet p { margin: 0 0 0.7rem; line-height: 1.6; }
.terms-page strong,
.terms-sheet strong { color: var(--charcoal); }

/* The two paragraphs that matter most get a rule down the side, so
   nobody can say the weather and safety terms were buried. */
.terms-note {
  border-left: 3px solid var(--rust);
  padding: 0.55rem 0.8rem;
  background: rgba(119, 60, 30, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-weight: 600;
}
.terms-contact { margin-top: 1.8rem; padding-top: 0.9rem; border-top: 1px solid rgba(41,42,39,0.1); }

/* ---------- the agree-before-sending modal ---------- */
.terms-modal {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(41, 42, 39, 0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 0.75rem;
}
.terms-card {
  width: min(680px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--paper, var(--cream-soft));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.terms-card-head {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(41, 42, 39, 0.12);
}
.terms-card-head h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--olive-dark);
  margin: 0;
  border: 0;
  padding: 0;
}
.terms-card-head p { margin: 0.25rem 0 0; font-size: 0.86rem; opacity: 0.8; }

/* The scroller. Its own scrollbar, so "scroll to the bottom" means
   something the client can actually see happening. */
.terms-sheet {
  overflow-y: auto;
  padding: 0.9rem 1.1rem;
  font-size: 0.92rem;
  -webkit-overflow-scrolling: touch;
}
.terms-sheet h1 { display: none; }         /* the modal head says it already */
.terms-sheet h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0.4rem; }

.terms-card-foot {
  padding: 0.8rem 1.1rem 0.95rem;
  border-top: 1px solid rgba(41, 42, 39, 0.12);
  background: rgba(41, 42, 39, 0.03);
}
.terms-progress {
  font-size: 0.84rem;
  margin: 0 0 0.6rem;
  color: var(--rust);
  font-weight: 600;
}
.terms-progress.is-read { color: var(--olive-dark); }
.terms-actions { display: flex; gap: 0.6rem; }
.terms-actions .btn { flex: 1; }
.terms-actions .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 560px) {
  .terms-card { max-height: 95vh; }
  .terms-actions { flex-direction: column-reverse; }
}

/* The end-of-terms marker the observer watches. One pixel of height so it
   is a real box that can intersect; no height at all and some browsers
   never report it. */
.terms-end { height: 1px; }
