:root {
  color-scheme: light;
  --ink: #0b0c0d;
  --paper: #f2efe6;
  --paper-2: #fffdf7;
  --acid: #c9ff3d;
  --signal: #f05b45;
  --muted: #666962;
  --line: #cbc7bb;
  --mono: "Courier New", Courier, monospace;
  --sans: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
  font-family: var(--sans);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

a {
  color: inherit;
}

.portal-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.portal-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--acid);
  font: 900 14px/1 var(--sans);
}

.portal-header > a:last-child {
  font: 700 10px/1 var(--mono);
  text-decoration: none;
  text-transform: uppercase;
}

.portal-shell {
  width: min(1180px, calc(100% - 40px));
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(520px, 1.15fr);
  gap: clamp(40px, 7vw, 100px);
  margin: 0 auto;
  padding: clamp(52px, 8vw, 112px) 0;
}

.portal-intro {
  align-self: start;
}

.portal-kicker,
.field-label,
.thread-meta,
.quote-label {
  font: 700 9px/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portal-kicker {
  margin: 0 0 24px;
  color: #4d5f17;
}

.portal-intro h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(52px, 7vw, 94px);
  line-height: 0.9;
  letter-spacing: -0.075em;
}

.portal-intro > p:not(.portal-kicker) {
  max-width: 540px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.portal-route {
  display: grid;
  gap: 12px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.portal-route span {
  font: 700 9px/1.4 var(--mono);
  text-transform: uppercase;
}

.portal-card {
  padding: clamp(26px, 4vw, 52px);
  border: 1px solid var(--line);
  background: var(--paper-2);
  box-shadow: 14px 14px 0 rgba(11, 12, 13, 0.08);
}

.portal-card h2 {
  margin: 0 0 8px;
  font-size: 31px;
  letter-spacing: -0.05em;
}

.portal-card > p {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.portal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.field {
  display: grid;
  gap: 9px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  font: 400 14px/1.45 var(--sans);
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.field-help {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.category-picker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.category-option {
  position: relative;
}

.category-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-option span {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 13px;
  cursor: pointer;
  transition: 160ms ease;
}

.category-option b {
  font-size: 13px;
}

.category-option small {
  color: var(--muted);
  font-size: 10px;
}

.category-option input:checked + span {
  border-color: var(--ink);
  background: var(--acid);
  box-shadow: inset 0 -4px 0 var(--ink);
}

.category-option input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.portal-button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 0 22px;
  font: 800 10px/1 var(--mono);
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.portal-button:hover,
.portal-button:focus-visible {
  outline: 0;
  background: var(--acid);
  color: var(--ink);
}

.portal-button-secondary {
  background: transparent;
  color: var(--ink);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 8px;
}

.form-actions small {
  max-width: 330px;
  color: var(--muted);
  line-height: 1.5;
}

.alert {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px solid #a92a1d;
  background: #fff0eb;
  color: #782218;
  font-size: 13px;
  line-height: 1.5;
}

.success-card {
  text-align: left;
}

.success-signal {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 50%;
  background: var(--acid);
  font-weight: 900;
}

.reference-box {
  margin: 28px 0;
  padding: 18px;
  border: 1px dashed var(--ink);
  background: var(--paper);
}

.reference-box small {
  display: block;
  margin-bottom: 8px;
  font: 700 9px/1 var(--mono);
  text-transform: uppercase;
}

.reference-box strong {
  font: 800 17px/1 var(--mono);
}

.thread-shell,
.quote-shell {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(50px, 7vw, 90px) 0;
}

.thread-head,
.quote-head {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: flex-end;
  margin-bottom: 36px;
}

.thread-head h1,
.quote-head h1 {
  margin: 10px 0 0;
  font-size: clamp(38px, 6vw, 70px);
  letter-spacing: -0.065em;
}

.status-pill {
  display: inline-flex;
  padding: 9px 12px;
  border: 1px solid var(--ink);
  background: var(--acid);
  font: 800 9px/1 var(--mono);
  text-transform: uppercase;
}

.thread-list {
  display: grid;
  gap: 14px;
}

.message {
  max-width: 82%;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.message-admin {
  margin-left: auto;
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.message p {
  margin: 12px 0 0;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.65;
}

.message-admin .thread-meta {
  color: var(--acid);
}

.thread-compose {
  margin-top: 28px;
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 30px;
}

.quote-table th,
.quote-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.quote-table th {
  font: 700 9px/1 var(--mono);
  text-transform: uppercase;
}

.quote-table .number {
  text-align: right;
  white-space: nowrap;
}

.quote-totals {
  width: min(420px, 100%);
  margin: 24px 0 0 auto;
}

.quote-total-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.quote-total-row:last-child {
  border-bottom: 4px solid var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.quote-note {
  margin-top: 35px;
  padding: 20px;
  border-left: 4px solid var(--acid);
  background: var(--paper-2);
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
}

.quote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

@media (max-width: 820px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-form {
    grid-template-columns: 1fr;
  }

  .field-wide,
  .category-picker,
  .form-actions {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .portal-header {
    padding-inline: 18px;
  }

  .portal-brand {
    font-size: 12px;
  }

  .portal-header > a:last-child {
    font-size: 0;
  }

  .portal-header > a:last-child::after {
    content: "Back ↗";
    font-size: 9px;
  }

  .portal-shell,
  .thread-shell,
  .quote-shell {
    width: min(100% - 28px, 1180px);
  }

  .category-picker {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .thread-head,
  .quote-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-button {
    width: 100%;
  }

  .message {
    max-width: 94%;
  }

  .quote-table {
    display: block;
    overflow-x: auto;
  }
}

@media print {
  .portal-header,
  .quote-actions,
  .thread-compose {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .quote-shell {
    width: 100%;
    padding: 0;
  }
}

.thread-status-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.thread-live-status {
  color: var(--muted);
  font: 700 8px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thread-live-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #b58c2c;
  vertical-align: 1px;
}

.thread-live-status[data-state="online"]::before {
  background: #57a618;
  box-shadow: 0 0 10px rgba(87, 166, 24, 0.4);
}

.thread-live-status[data-state="offline"]::before {
  background: #b64234;
  box-shadow: none;
}

@media (max-width: 640px) {
  .thread-status-group {
    justify-content: flex-start;
  }
}

/* Browser-fit hardening for live customer pages — 2026-08-03 */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.portal-header,
.portal-shell,
.thread-shell,
.quote-shell,
.portal-card,
.thread-card,
.quote-card {
  min-width: 0;
  max-width: 100%;
}

img,
video,
iframe,
svg {
  max-width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  .portal-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

@media (max-width: 480px) {
  .portal-header {
    min-height: 58px;
    gap: 12px;
    padding: 8px 14px;
  }

  .portal-mark {
    width: 36px;
    height: 36px;
  }

  .portal-shell,
  .thread-shell,
  .quote-shell {
    width: min(100% - 20px, 1180px);
    padding-block: 24px 40px;
  }

  .portal-intro h1 {
    font-size: clamp(40px, 14vw, 60px);
  }

  .portal-intro > p:not(.portal-kicker) {
    margin-top: 18px;
    font-size: 14px;
  }

  .portal-card {
    padding: 20px 16px;
    box-shadow: 7px 7px 0 rgba(11, 12, 13, 0.08);
  }

  .thread-head,
  .quote-head,
  .quote-actions,
  .form-actions {
    width: 100%;
  }

  .quote-table th,
  .quote-table td {
    min-width: 110px;
    padding: 11px 9px;
  }
}

/* ============================================================
   Interface pass — 9 September 2026
   BTN-1: the submit is the point of this page, so it stops
   looking like a footnote. Only the submit changes; the other
   .portal-button links keep their existing treatment.
   ============================================================ */
.portal-button[type="submit"] {
  min-height: 54px;
  justify-content: center;
  gap: 10px;
  border: 1px solid #0b0c0d;
  background: var(--acid, #c9ff3d);
  color: #0b0c0d;
  padding-inline: 26px;
  font-size: 13px;
  letter-spacing: .06em;
  white-space: nowrap;
}
.portal-button[type="submit"]:hover,
.portal-button[type="submit"]:focus-visible {
  background: #0b0c0d;
  color: var(--acid, #c9ff3d);
}
/* BTN-4: the arrow means "leaves the site"; this submits a form. */
.portal-button[type="submit"] span { display: none; }

@media (max-width: 640px) {
  .portal-button[type="submit"] { width: 100%; }
}

/* ============================================================
   Interface pass, part two — 9 September 2026
   ============================================================ */

/* FRM-2: the selected service is already shown by the highlighted
   card above. Keep the live region for screen readers, but stop it
   looking like a bordered field or a file drop zone. */
#selected-service-display.reference-box {
  border: 0;
  background: none;
  padding: 2px 0;
  font-weight: 800;
}

/* FRM-3: match the stacked wordmark used on the main site so the
   brand does not change shape when a customer follows an emailed
   link into the request desk. */
.portal-brand > span:last-child {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.05;
}
.portal-brand strong {
  font-size: 13px;
  letter-spacing: .02em;
}
.portal-brand small {
  font-size: 8px;
  letter-spacing: .34em;
  opacity: .75;
}

/* ============================================================
   Responsive pass - 10 September 2026
   Measured on the live request page: the back link rendered
   10px tall at 10px type, and the category radios 13px tall.
   Both are things a customer has to hit on a phone.
   ============================================================ */

/* R6 - the back link was a 10px-tall target. */
.portal-header > a[href="/"]:not(.portal-brand) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 12px;
}

/* R7 - the category choice is the first thing anyone touches. */
input[name="category"] {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
label:has(input[name="category"]) {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

/* Stops iOS zooming the page in whenever a field takes focus. */
@media (max-width: 640px) {
  .portal input,
  .portal select,
  .portal textarea,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px;
  }
}

/* ============================================================
   2026 palette - 10 September 2026
   The storefront moved to violet/magenta on white. A customer
   reaches these pages straight from an emailed link, so they
   have to look like the same company. This is a re-tokenisation
   plus the few rules that had a colour baked in rather than
   taken from a token.
   ============================================================ */

:root {
  --ink: #14111d;
  --paper: #f7f5fb;
  --paper-2: #ffffff;
  --violet: #7b2ff7;
  --magenta: #f0119b;
  --grad: linear-gradient(90deg, #7b2ff7 0%, #f0119b 100%);
  /* --acid was a bright green used both as a background under dark
     text and as text on the dark staff bubble. A light lilac is
     the one value that still reads in both places. */
  --acid: #ece1ff;
  --signal: #f0119b;
  --muted: #6b6480;
  --line: #e7e2f2;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

body { background: var(--paper); }

.portal-kicker { color: var(--magenta); }

.portal-mark,
.status-pill,
.success-signal {
  border-color: transparent;
  background: var(--grad);
  color: #fff;
}
.portal-mark { border-radius: 12px; }
.status-pill { border-radius: 999px; padding: 10px 14px; }

.portal-button {
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .04em;
}
.portal-button:hover,
.portal-button:focus-visible {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
}
.portal-button-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.portal-button-secondary:hover,
.portal-button-secondary:focus-visible {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
}
.portal-button[type="submit"] {
  border: 0;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
}
.portal-button[type="submit"]:hover,
.portal-button[type="submit"]:focus-visible {
  background: var(--violet);
  color: #fff;
}

.portal-card,
.message,
.quote-note,
.alert { border-radius: 16px; }

.portal-card {
  border-color: var(--line);
  box-shadow: 0 18px 44px rgba(20, 17, 29, .08);
}

.field input,
.field select,
.field textarea { border-radius: 10px; }

.field input:focus,
.field select:focus,
.field textarea:focus { outline-color: var(--violet); }

.category-option span { border-radius: 12px; }
.category-option input:checked + span {
  border-color: var(--violet);
  background: var(--acid);
  box-shadow: inset 0 -4px 0 var(--violet);
}
.category-option input:focus-visible + span { outline-color: var(--violet); }

.reference-box { border-color: var(--line); border-radius: 12px; }

.quote-note { border-left-color: var(--violet); }
.quote-total-row:last-child { border-bottom-color: var(--violet); }

/* The staff bubble stays dark, so its meta line has to lighten. */
.message-admin { background: var(--ink); }
.message-admin .thread-meta { color: #d9c8ff; }

/* A gradient does not print. Quotes get printed. */
@media print {
  .portal-mark,
  .status-pill,
  .success-signal,
  .portal-button[type="submit"] {
    background: none;
    color: var(--ink);
  }
}
