/* Pier Management – complaints admin. Same brand tokens as the public form (docs/design.md),
   denser type scale because this is a working tool. */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/poppins-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/poppins-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/poppins-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/poppins-700-latin.woff2") format("woff2"); }

:root {
  --font: "Poppins", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --navy: #092a30; --navy-soft: #123f47;
  --turquoise: #25cbd3; --turquoise-ink: #157a80;
  --tint: #e4f7f9; --tint-soft: #f3fbfc;
  --canvas: #f5f8f8; --surface: #ffffff;
  --ink: #0e2a2f; --slate: #3a5559; --rule: #d5e1e3; --rule-strong: #9fb6ba;
  --error: #b3261e; --error-tint: #fbe9e7;
  --success: #0f7a4a; --success-tint: #e3f5ec;
  --warn: #8a5300; --warn-tint: #fdf1dc;
  --radius: 10px; --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(9, 42, 48, .06), 0 8px 24px rgba(9, 42, 48, .06);
  --focus: 0 0 0 3px var(--surface), 0 0 0 6px var(--turquoise);
  --wrap: 90rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
body { margin: 0; font-family: var(--font); font-size: .9375rem; line-height: 1.5; color: var(--ink); background: var(--canvas); display: flex; flex-direction: column; min-height: 100vh; -webkit-font-smoothing: antialiased; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: 1.25rem; }
a { color: var(--turquoise-ink); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { color: var(--navy); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.skip-link { position: absolute; left: -9999px; top: .5rem; z-index: 20; padding: .5rem .75rem; background: var(--navy); color: #fff; border-radius: 6px; }
.skip-link:focus { left: .5rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--slate); }
.nowrap { white-space: nowrap; }
.text-error { color: var(--error); font-weight: 600; }

/* ---------- Top bar ---------- */
.topbar { background: var(--navy); color: #fff; }
.topbar__inner { display: flex; align-items: center; gap: 2rem; min-height: 3.75rem; padding-block: .5rem; }
.brand { display: inline-flex; align-items: center; gap: .9rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand__logo { height: 2.1rem; width: auto; display: block; }
.brand__service { font-size: .9375rem; font-weight: 500; padding-left: .9rem; border-left: 1px solid rgba(255, 255, 255, .25); line-height: 1.2; }
.topbar__nav { display: flex; gap: .25rem; }
.topbar__link { color: rgba(255, 255, 255, .8); text-decoration: none; padding: .4rem .8rem; border-radius: 8px; font-weight: 500; }
.topbar__link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.topbar__link.is-active { color: #fff; background: rgba(255, 255, 255, .12); }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: .75rem; font-size: .875rem; }
.topbar__name { font-weight: 600; }
.topbar__meta { color: rgba(255, 255, 255, .65); }
.topbar__logout { margin: 0; }
.link-button { font: inherit; background: none; border: 0; padding: .3rem .6rem; color: #fff; text-decoration: underline; cursor: pointer; border-radius: 6px; }
.link-button:hover { background: rgba(255, 255, 255, .08); }
.roofline { height: 4px; background: linear-gradient(90deg, var(--turquoise) 0 62%, rgba(37, 203, 211, .35) 62% 100%); }

.main { flex: 1; padding-block: 1.75rem 3rem; }
.site-footer { background: var(--navy); color: rgba(255, 255, 255, .7); font-size: .8125rem; padding-block: 1rem; }

/* ---------- Typography ---------- */
.display { font-size: 1.75rem; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; color: var(--navy); margin: 0 0 .35rem; }
.lede { font-size: 1rem; color: var(--slate); margin: 0 0 1.25rem; }
.eyebrow { margin: 0 0 .2rem; font-size: .875rem; font-weight: 500; color: var(--turquoise-ink); }
.section-title { font-size: 1.0625rem; font-weight: 600; color: var(--navy); margin: 0 0 1rem; }
.subsection-title { font-size: .9375rem; font-weight: 600; color: var(--navy); margin: 1.5rem 0 .75rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.backlink { margin: 0 0 .75rem; font-size: .875rem; }
.backlink a { text-decoration: none; }
.backlink a:hover { text-decoration: underline; }
p { margin: 0 0 1rem; }

/* ---------- Sheets ---------- */
.sheet { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 1.5rem; }
.sheet--narrow { max-width: 40rem; padding: 2rem; }
.sheet--table { padding: 0; overflow: hidden; }
.sheet--section { margin-bottom: 1.25rem; }
.empty { padding: 2.5rem 1.5rem; text-align: center; color: var(--slate); margin: 0; }

/* ---------- Login ---------- */
.login { display: flex; justify-content: center; padding-block: 2.5rem 3rem; }
.login__card { width: 100%; max-width: 28rem; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.login__band { background: var(--navy); color: #fff; padding: 1.75rem 2rem 1.5rem; position: relative; }
.login__band::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--turquoise) 0 62%, rgba(37, 203, 211, .35) 62% 100%); }
.login__band .brand__logo { height: 3rem; width: auto; display: block; }
.login__tagline { margin: .9rem 0 0; font-size: .9375rem; color: rgba(255, 255, 255, .8); }
.login__body { padding: 1.75rem 2rem 2rem; }
.login__body .display { font-size: 1.5rem; }
.login__note { margin: 1.25rem 0 0; font-size: .8125rem; color: var(--slate); line-height: 1.5; }
.login-page .topbar__nav, .login-page .topbar__user { display: none; }
.button--ms { width: 100%; justify-content: center; gap: .75rem; }
.button__ms-logo { width: 1.25rem; height: 1.25rem; flex: none; }

/* ---------- Queue ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: .5rem; }
/* The queue is the one wide page (owner's request 8 Oct 2026): a broader main column, tighter
   cells and a one-line filter bar so the overdue flags are visible without scrolling sideways. */
.main--wide { max-width: 112rem; padding-inline: 1.5rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem .7rem; align-items: flex-end; margin-bottom: 1rem; padding: .7rem .85rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters__field { display: flex; flex-direction: column; gap: .2rem; flex: 0 0 auto; }
.filters__field--search { flex: 1 1 12rem; min-width: 9rem; max-width: 21rem; }
.filters__field--check { flex-direction: row; align-items: center; gap: .4rem; min-width: 0; flex-shrink: 0; padding-bottom: .5rem; white-space: nowrap; font-size: .8125rem; }
.filters__label { font-size: .75rem; font-weight: 600; color: var(--slate); white-space: nowrap; }
.filters__actions { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; padding-bottom: .1rem; }
.select--compact { padding: .4rem 2rem .4rem .6rem; font-size: .8125rem; background-position: right .6rem center; }
.filters .input--compact { padding: .4rem .6rem; font-size: .8125rem; }
/* Every dropdown and date box the same width and never squeezed (owner, 26 Oct 2026: the date boxes overlapped); the search box is the only one that stretches. */
.filters .select--compact, .filters .filters__date { width: 9rem; min-width: 9rem; }
.filters .select--compact { text-overflow: ellipsis; }
/* ... and the same height: the search box, dropdowns and date pickers all render at 2.375rem. */
.filters .input--compact, .filters .select--compact, .filters .filters__date { box-sizing: border-box; height: 2.375rem; padding-top: 0; padding-bottom: 0; line-height: 1.2; appearance: none; -webkit-appearance: none; }
.filters .select--compact { appearance: none; -webkit-appearance: none; }
/* One line only when everything fits (search, four filters, two dates, the tick box, Apply and the two buttons); below that the buttons drop to a second row rather than squeezing the labels. */
@media (min-width: 112rem) { .filters { flex-wrap: nowrap; } }
.table--queue { font-size: .8125rem; }
.table--queue th { padding: .65rem .6rem; }
.table--queue td { padding: .55rem .6rem; }

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th { text-align: left; font-weight: 600; color: var(--slate); font-size: .75rem; letter-spacing: .01em; padding: .8rem .9rem; border-bottom: 1px solid var(--rule); background: var(--tint-soft); white-space: nowrap; }
.table td { padding: .7rem .9rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table tbody tr:hover { background: var(--tint-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--error); }
.table__ref { font-weight: 600; text-decoration: none; color: var(--navy); white-space: nowrap; }
.table__ref:hover { text-decoration: underline; color: var(--turquoise-ink); }
.table__sub { display: block; font-size: .75rem; color: var(--slate); }

.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--tint); color: var(--navy); }
.badge--large { font-size: .875rem; padding: .3rem .85rem; }
.badge--new { background: var(--turquoise); color: var(--navy); }
.badge--acknowledged { background: var(--tint); color: var(--turquoise-ink); }
.badge--investigating { background: #fff3cd; color: #6b4b00; }
.badge--responded { background: var(--success-tint); color: var(--success); }
.badge--closed { background: #e6ebec; color: var(--slate); }
.badge--escalated { background: #efe4f6; color: #5b2a86; }
/* External referrals (PRS, ICO), owner's choice 8 Oct 2026: a red pill in the Stage cell and a
   light red row tint. The overdue left border still shows on top. */
.badge--referred { background: var(--error-tint); color: var(--error); }
.table tr.is-referred > td { background: #fff5f4; }
.table tr.is-referred:hover > td { background: #ffeceb; }
.flag { display: inline-block; padding: .05rem .45rem; border-radius: 6px; font-size: .7rem; font-weight: 700; vertical-align: middle; }
.flag--error { background: var(--error); color: #fff; }
.flag--warn { background: var(--warn-tint); color: var(--warn); }

/* ---------- Case ---------- */
.case-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; margin-bottom: 1rem; }
.case-head__meta { color: var(--slate); margin: 0; font-size: .9375rem; }
.case-head__status { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }
.case-head__handler { font-size: .875rem; }
.case-head__link { font-size: .8125rem; }
.case-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.col-head { display: flex; flex-direction: column; gap: .1rem; padding: 0 0 .75rem; margin-bottom: 1rem; border-bottom: 3px solid var(--rule); }
.col-head--submitted { border-bottom-color: var(--rule-strong); }
.col-head--handling { border-bottom-color: var(--turquoise); }
.col-head__title { margin: 0; font-size: 1.125rem; font-weight: 600; color: var(--navy); }
.col-head__sub { margin: 0; font-size: .8125rem; color: var(--slate); }
/* The read-only column sits on a tinted panel so it reads as a document, not a form. */
.case-grid__submitted { background: var(--tint-soft); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 1.25rem; }
.case-grid__submitted .sheet--section { box-shadow: none; border: 1px solid var(--rule); }
.case-grid__submitted .sheet--section:last-child { margin-bottom: 0; }
.case-grid__submitted .sheet--highlight { border-left: 4px solid var(--turquoise); }

.notice { border-radius: var(--radius); padding: .75rem 1rem; margin: 0 0 .9rem; font-size: .9375rem; border: 1px solid transparent; }
.notice--ok { background: var(--success-tint); color: var(--success); border-color: #bfe6d0; }
.notice--warn { background: var(--warn-tint); color: var(--warn); border-color: #f1dcb0; }
.notice--info { background: var(--tint); color: var(--navy); border-color: #bfe9ee; }
.notice--error { background: var(--error-tint); color: var(--error); border-color: #f0c2bd; }
.notice__actions { margin-top: .6rem; }
.notice a { color: inherit; font-weight: 600; }
.notice--compact { padding: .5rem .75rem; margin-bottom: .6rem; font-size: .8125rem; } /* the Questions section: every notice the same, smaller size (owner, 28 Oct 2026) */

.summary-list { margin: 0; }
.summary-list__row { display: grid; grid-template-columns: minmax(8rem, 11rem) 1fr; gap: .25rem 1rem; padding: .5rem 0; border-bottom: 1px solid var(--rule); }
.summary-list__row:last-child { border-bottom: 0; }
.summary-list__key { font-weight: 600; color: var(--slate); margin: 0; font-size: .8125rem; }
.summary-list__value { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }

.files { list-style: none; margin: 0; padding: 0; }
.files__item { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--rule); }
.files__item:last-child { border-bottom: 0; }
.files__meta { color: var(--slate); font-size: .8125rem; white-space: nowrap; }
.files__name { overflow-wrap: anywhere; }
.files__group { margin: 0 0 .5rem; font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); }
.files + .files__group { margin-top: 1rem; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--rule); }
.timeline__item { position: relative; padding: 0 0 1rem 1rem; }
.timeline__item::before { content: ""; position: absolute; left: calc(-1rem - 6px); top: .4rem; width: 10px; height: 10px; border-radius: 50%; background: var(--rule-strong); border: 2px solid var(--surface); }
.timeline__item--status::before { background: var(--turquoise); }
.timeline__item--note::before { background: var(--navy); }
.timeline__item--change::before { background: var(--turquoise-ink); }
.timeline__when { font-size: .75rem; color: var(--slate); }
.timeline__who { font-weight: 600; margin-right: .35rem; }
.timeline__item--note .timeline__text { display: block; margin-top: .2rem; white-space: pre-line; background: var(--tint-soft); border-radius: 8px; padding: .5rem .75rem; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.1rem; }
.form-group--error { position: relative; padding-left: .9rem; }
.form-group--error::before { content: ""; position: absolute; left: 0; top: .2rem; bottom: .2rem; width: 3px; border-radius: 3px; background: var(--error); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
/* Paired fields share one set of rows (label / hint / error / control), so the boxes line up
   even when only one of the pair has a hint. */
@supports (grid-template-rows: subgrid) {
  .field-row .form-group { display: grid; grid-template-rows: subgrid; grid-row: span 4; align-content: start; }
  .field-row .form-group > .label { grid-row: 1; margin-bottom: .25rem; }
  .field-row .form-group > .hint { grid-row: 2; margin: 0 0 .35rem; align-self: start; }
  .field-row .form-group > .error-message { grid-row: 3; margin: 0 0 .35rem; }
  .field-row .form-group > .input, .field-row .form-group > .select, .field-row .form-group > .textarea { grid-row: 4; align-self: end; }
  .field-row .form-group > .char-count { grid-row: 5; }
  .field-row .form-group:has(> .char-count) { grid-row: span 5; }
}
.field-row .form-group > .input--small, .field-row .form-group > .input--date { max-width: none; }
.label, .legend { display: block; font-weight: 600; font-size: .875rem; color: var(--navy); margin-bottom: .3rem; }
.fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.hint { color: var(--slate); font-size: .8125rem; margin: -.1rem 0 .45rem; }
.hint--tight { margin: -.7rem 0 1.1rem 2.25rem; }
.case-grid__handling .hint { font-size: .78rem; line-height: 1.4; }
.error-message { color: var(--error); font-weight: 600; font-size: .8125rem; margin: 0 0 .4rem; }
.input, .select, .textarea { font: inherit; width: 100%; padding: .55rem .75rem; color: var(--ink); background: var(--surface); border: 1.5px solid var(--rule-strong); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--slate); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { border-color: var(--turquoise-ink); box-shadow: 0 0 0 4px rgba(37, 203, 211, .3); border-radius: var(--radius); }
.select { appearance: none; -webkit-appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%233a5559' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m5 7.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; background-size: 1rem; }
.textarea { resize: vertical; min-height: 5rem; }
.input--small { max-width: 11rem; }
.input--medium { max-width: 18rem; }
.input--date { max-width: 13rem; }
/* A date the system stamped: shown in the box's place, not editable (14 Oct 2026). */
.input--locked { background: var(--tint-soft); color: var(--slate); border-style: dashed; cursor: not-allowed; }
.input--error, .select--error, .textarea--error { border-color: var(--error); }
.char-count { color: var(--slate); font-size: .8125rem; margin-top: .3rem; }
.char-count--warning { color: var(--warn); }
.char-count--error { color: var(--error); font-weight: 600; }
.check { width: 1.1rem; height: 1.1rem; accent-color: var(--navy); margin: 0; }
.check-inline { display: inline-flex; align-items: center; gap: .5rem; margin-top: .5rem; font-size: .8125rem; color: var(--slate); }

/* Checkbox / radio components (shared macros) */
.radios, .checkboxes { display: flex; flex-direction: column; gap: .35rem; }
.radios--inline { flex-direction: row; flex-wrap: wrap; gap: .4rem 1.5rem; }
.radios__item, .checkboxes__item { position: relative; display: flex; align-items: flex-start; min-height: 1.75rem; padding-left: 2.25rem; }
.checkboxes + .hint { margin-top: .2rem; padding-left: 2.25rem; } /* a single tick box's hint sits under its label */
.radios__input, .checkboxes__input { position: absolute; left: 0; top: .1rem; width: 1.5rem; height: 1.5rem; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.radios__label, .checkboxes__label { padding: .2rem 0; cursor: pointer; line-height: 1.4; font-weight: 500; }
.radios__label::before, .checkboxes__label::before { content: ""; position: absolute; left: 0; top: .1rem; width: 1.5rem; height: 1.5rem; border: 1.5px solid var(--rule-strong); background: var(--surface); border-radius: 6px; }
.radios__label::before { border-radius: 50%; }
.checkboxes__label::after { content: ""; position: absolute; left: .5rem; top: .45rem; width: .5rem; height: .85rem; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); }
.checkboxes__input:checked + .checkboxes__label::before { border-color: var(--navy); background: var(--navy); }
.checkboxes__input:checked + .checkboxes__label::after { transform: rotate(45deg) scale(1); }
.radios__label::after { content: ""; position: absolute; left: .4375rem; top: .5375rem; width: .625rem; height: .625rem; border-radius: 50%; background: var(--navy); transform: scale(0); }
.radios__input:checked + .radios__label::after { transform: scale(1); }
.radios__input:checked + .radios__label::before { border-color: var(--turquoise-ink); background: var(--tint); }
.radios__input:focus-visible + .radios__label::before, .checkboxes__input:focus-visible + .checkboxes__label::before { box-shadow: 0 0 0 4px rgba(37, 203, 211, .35); border-color: var(--turquoise-ink); }

.conditional { margin: -.25rem 0 1.1rem .7rem; padding-left: 1.1rem; border-left: 2px solid var(--rule); }
[hidden] { display: none !important; }

.actions { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.actions__note { font-size: .8125rem; color: var(--slate); }
.button { font: inherit; font-weight: 600; display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.2rem; min-height: 2.6rem; border: 1.5px solid var(--navy); border-radius: var(--radius); background: var(--navy); color: #fff; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.button:hover { background: var(--navy-soft); border-color: var(--navy-soft); color: #fff; }
.button:focus-visible { box-shadow: var(--focus); border-radius: var(--radius); }
.button--secondary { background: var(--surface); color: var(--navy); border-color: var(--rule-strong); }
.button--secondary:hover { background: var(--tint-soft); border-color: var(--navy); color: var(--navy); }
.button--small { padding: .45rem .9rem; min-height: 2.2rem; font-size: .875rem; }

.error-summary { border: 1.5px solid var(--error); border-left-width: 6px; background: var(--error-tint); border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: 1rem; }
.error-summary__title { margin: 0 0 .4rem; font-size: 1rem; color: var(--error); }
.error-summary__list { margin: 0; padding-left: 1.2rem; }
.error-summary__list a { color: var(--error); font-weight: 600; }
.error-summary p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 70rem) {
  .case-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 48rem) {
  .topbar__inner { flex-wrap: wrap; gap: .75rem 1.25rem; }
  .topbar__user { margin-left: 0; width: 100%; justify-content: space-between; }
  .brand__service { display: none; }
  .case-head { flex-direction: column; }
  .case-head__status { flex-direction: row; align-items: center; }
  .field-row { grid-template-columns: 1fr; }
  .summary-list__row { grid-template-columns: 1fr; gap: .1rem; }
  .sheet { padding: 1.1rem; }
}

/* Step 6: export button, lookup tabs and tables */
.filters__export { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; margin-left: auto; padding-bottom: .1rem; }
.filters__export .button { white-space: nowrap; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1rem; border-bottom: 1px solid var(--rule); }
.tabs__link { padding: .55rem .9rem; font-size: .9375rem; font-weight: 500; color: var(--slate); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0; }
.tabs__link:hover { color: var(--navy); background: var(--tint-soft); }
.tabs__link.is-active { color: var(--navy); font-weight: 600; border-bottom-color: var(--turquoise); }
.table tr.is-inactive td { color: var(--slate); }
.table tr.is-inactive .table__ref { color: var(--slate); }
.table__actions { text-align: right; }
.table__actions .link, .table__actions .link-button { color: var(--turquoise-ink); padding: .1rem .3rem; font-size: .875rem; }
.table__actions .link-button:hover { background: var(--tint-soft); color: var(--navy); }
.inline-form { display: inline; margin-left: .5rem; }

/* Admin section */
.topbar__link--admin { margin-right: .5rem; padding-block: .35rem; border: 1px solid rgba(255, 255, 255, .25); }
.topbar__link--admin.is-active { border-color: var(--turquoise); }
.admin-cards { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .75rem; }
.admin-card { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--tint-soft); }
.admin-card__title { font-weight: 600; color: var(--navy); text-decoration: none; }
.admin-card__title:hover { color: var(--turquoise-ink); text-decoration: underline; }
.admin-card__meta { font-size: .8125rem; color: var(--slate); }

/* Queue search and paging */
.filters__field--search { flex: 1 1 12rem; min-width: 10rem; max-width: 18rem; }
.input--compact { padding: .45rem .7rem; font-size: .875rem; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-top: 1rem; }
.pagination__summary { margin: 0; font-size: .875rem; color: var(--slate); }
.pagination__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.pagination__link { display: inline-block; min-width: 2.2rem; padding: .4rem .7rem; text-align: center; font-size: .875rem; font-weight: 500; color: var(--navy); text-decoration: none; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.pagination__link:hover { background: var(--tint-soft); border-color: var(--navy); }
.pagination__link.is-current { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 600; }
.pagination__link.is-disabled { color: var(--slate); background: transparent; opacity: .55; }
.pagination__gap { display: inline-block; padding: .4rem .3rem; color: var(--slate); }

/* Dashboard */
.dash-note { font-size: .8125rem; margin: -.5rem 0 1rem; }
.dash-note a { color: var(--turquoise-ink); }
.tiles, .kpis { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.tile, .kpi { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--tint-soft); min-height: 6.5rem; }
.tile--alert { border-color: var(--error); background: var(--error-tint); }
.tile__label, .kpi__label { font-size: .8125rem; font-weight: 500; color: var(--slate); line-height: 1.3; }
.tile__value, .kpi__value { font-size: 2rem; font-weight: 600; color: var(--navy); line-height: 1.1; margin-top: auto; }
.tile--alert .tile__value { color: var(--error); }
.tile__link { font-size: .8125rem; color: var(--turquoise-ink); text-decoration: none; margin-top: .25rem; }
.tile__link:hover { text-decoration: underline; }
.kpi__delta { font-size: .8125rem; font-weight: 600; margin-top: .25rem; }
.kpi__delta--neutral { color: var(--slate); font-weight: 500; }
.kpi__delta--good { color: var(--success); }
.kpi__delta--bad { color: var(--error); }
.period { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin: 0 0 1rem; }
.period__label { font-size: .8125rem; font-weight: 600; color: var(--slate); }
.period__list { list-style: none; margin: 0; padding: .2rem; display: flex; flex-wrap: wrap; gap: .2rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; }
.period__link { display: inline-block; padding: .35rem .85rem; border-radius: 999px; font-size: .875rem; font-weight: 500; color: var(--navy); text-decoration: none; }
.period__link:hover { background: var(--tint-soft); }
.period__link.is-active { background: var(--navy); color: #fff; font-weight: 600; }
.period__range { font-size: .8125rem; color: var(--slate); }
.period__link--static { color: var(--slate); cursor: default; }
/* Pickers sit on the same line as the pills, labels inline, so nothing drops below the bar. */
.period__form { display: flex; align-items: center; gap: .6rem; }
.period__field { display: flex; flex-direction: row; align-items: center; gap: .35rem; font-size: .8125rem; font-weight: 600; color: var(--slate); }
.period__date { width: 10rem; padding: .3rem .5rem; font-size: .8125rem; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.chart { margin: 0; }
.chart__title { font-size: .9375rem; font-weight: 600; color: var(--navy); margin: 0 0 .9rem; }
.chart__title .muted { font-weight: 400; font-size: .8125rem; }
.empty--tight { padding: 1rem 0; text-align: left; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.hbars__row { display: grid; grid-template-columns: minmax(6rem, 9rem) minmax(5rem, 1fr) 2rem; align-items: center; gap: .75rem; font-size: .875rem; }
.hbars__label { color: var(--ink); overflow-wrap: anywhere; }
.hbars__bar { display: block; width: 100%; height: 12px; }
.hbars__fill { fill: var(--turquoise-ink); }
.hbars__value { text-align: right; font-variant-numeric: tabular-nums; color: var(--slate); font-weight: 600; }
.legend { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: .8125rem; color: var(--ink); }
.legend__item { display: inline-flex; align-items: center; gap: .45rem; }
.legend__swatch { display: inline-block; width: .9rem; height: .9rem; border-radius: 3px; }
.legend__swatch--a, .columns__bar--1 { background: var(--turquoise-ink); fill: var(--turquoise-ink); }
.legend__swatch--b, .columns__bar--2 { background: var(--rule-strong); fill: var(--rule-strong); }
.columns { display: block; width: 100%; height: auto; max-width: 60rem; font-family: var(--font); }
.columns__grid { stroke: var(--rule); stroke-width: 1; }
.columns__tick, .columns__label { fill: var(--slate); font-size: 11px; font-variant-numeric: tabular-nums; }
.columns__bar:hover { opacity: .8; }
.chart__table { margin-top: .75rem; font-size: .875rem; }
.chart__table summary { cursor: pointer; color: var(--turquoise-ink); font-weight: 500; }
.chart__table .table-scroll { margin-top: .5rem; }
.table--compact th, .table--compact td { padding: .55rem .7rem; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody th { text-align: left; font-weight: 600; color: var(--navy); padding: .55rem .7rem; border-bottom: 1px solid var(--rule); }

/* Staff responses (7 Oct 2026) */
.responses { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.responses__item { padding: .85rem 0; border-bottom: 1px solid var(--rule); }
.responses__item:first-child { padding-top: 0; }
.responses__item:last-child { border-bottom: 0; }
.responses__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .75rem; margin-bottom: .3rem; }
.responses__method { font-weight: 600; color: var(--navy); }
.responses__meta { font-size: .8125rem; color: var(--slate); }
.responses__summary { margin: 0 0 .4rem; white-space: pre-line; overflow-wrap: anywhere; }
.responses__item .files { margin-top: .25rem; }
.responses__item .files__item { padding: .3rem 0; border-bottom: 0; }
/* Questions to the complainant (26 Oct 2026): a folded section with pills in its heading */
.sheet--fold > summary { list-style: none; cursor: pointer; }
.sheet--fold > summary::-webkit-details-marker { display: none; }
.sheet-fold__toggle { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.sheet-fold__title { margin: 0; }
.sheet-fold__pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.sheet-fold__hint::before { content: "+ Show"; font-size: .8125rem; font-weight: 500; color: var(--turquoise-ink); margin-left: auto; }
.sheet--fold[open] > .sheet-fold__toggle .sheet-fold__hint::before { content: "– Hide"; }
.sheet-fold__hint { margin-left: auto; }
.sheet--fold[open] > summary { margin-bottom: 1rem; }
.ask-question { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.ask-question__title { margin: 0 0 .25rem; font-size: 1rem; color: var(--navy); }
.questions { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.questions__item { padding: .85rem 0; border-bottom: 1px solid var(--rule); }
.questions__item:first-child { padding-top: 0; }
.questions__item:last-child { border-bottom: 0; }
.questions__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .75rem; margin-bottom: .3rem; }
.questions__meta { font-size: .8125rem; color: var(--slate); }
.questions__question { margin: 0 0 .4rem; white-space: pre-line; }
.questions__answer { margin: 0 0 .3rem; white-space: pre-line; }
.questions__note { margin: 0; font-size: .875rem; }
.questions__item .files { margin-top: .25rem; }
.questions__item .files__item { padding: .3rem 0; border-bottom: 0; }
.badge--q-open { background: var(--warn-tint, #fdf1dc); color: var(--warn, #8a5300); }
.badge--q-answered { background: #e3f3e8; color: #0f7a4a; }
.badge--q-withdrawn, .badge--q-expired { background: var(--tint-soft); color: var(--slate); }
.inline-form--block { display: block; margin: .35rem 0 0; }
.questions__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: .5rem; }
.button:disabled, .button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.button--secondary:disabled:hover { background: var(--surface); border-color: var(--rule-strong); }
.questions__actions .inline-form--block { margin: 0; }
.inline-form--block .link-button { color: var(--turquoise-ink); padding: .1rem .3rem; }
.inline-form--block .link-button:hover { background: var(--tint-soft); color: var(--navy); }
.responses__item .files__name { font-size: .9375rem; }
.timeline__item--response::before { background: var(--success); }
.file-input { display: block; width: 100%; font: inherit; font-size: .9375rem; padding: .45rem 0; }
.file-input::file-selector-button { font: inherit; font-weight: 600; font-size: .875rem; padding: .45rem .9rem; margin-right: .75rem; border: 1.5px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); color: var(--navy); cursor: pointer; }
.file-input::file-selector-button:hover { background: var(--tint-soft); border-color: var(--navy); }
.file-input:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius); }

/* Drop zone for response files (progressively enhanced; the native input stays without JS) */
.dropzone { position: relative; border: 2px dashed var(--rule-strong); border-radius: var(--radius); padding: .75rem 1rem; background: var(--tint-soft); transition: border-color .15s, background .15s; }
.dropzone.is-enhanced { padding: 1.1rem 1rem; text-align: center; cursor: pointer; }
.dropzone.is-enhanced .file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dropzone.is-over { border-color: var(--turquoise-ink); background: var(--tint); }
.dropzone:focus-within { border-color: var(--turquoise-ink); box-shadow: 0 0 0 4px rgba(37, 203, 211, .3); }
.dropzone__text { margin: 0; font-size: .9375rem; color: var(--slate); }
.dropzone__text strong { color: var(--navy); }
.dropzone__browse { color: var(--turquoise-ink); font-weight: 600; text-decoration: underline; }
.dropzone__warn { margin: .6rem 0 0; font-size: .8125rem; color: var(--warn); background: var(--warn-tint); border-radius: 6px; padding: .45rem .7rem; text-align: left; }
.dropzone__list { list-style: none; margin: .75rem 0 0; padding: 0; text-align: left; display: flex; flex-direction: column; gap: .3rem; }
.dropzone__file { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .4rem .7rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; font-size: .875rem; }
.dropzone__name { overflow-wrap: anywhere; }
.dropzone__size { color: var(--slate); white-space: nowrap; margin-left: auto; }
.dropzone__remove { font: inherit; font-size: .8125rem; font-weight: 600; color: var(--error); background: none; border: 0; padding: .1rem .4rem; cursor: pointer; border-radius: 6px; }
.dropzone__remove:hover { background: var(--error-tint); }
.staff-note { margin: .75rem 0 0; font-size: .8125rem; }

/* ---- Case page polish (9 Oct 2026): response clock, quick actions, Stage 1 summary, timeline filter ---- */
.case-head__badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.badge--clock-neutral { background: var(--tint); color: var(--navy); }
.badge--clock-warn { background: #fff3cd; color: #6b4b00; }
.badge--clock-error { background: #fde7e9; color: #a4262c; }
.badge--clock-ok { background: var(--success-tint); color: var(--success); }
.quick-actions { display: flex; gap: .4rem; margin-top: .25rem; }
/* Right-hand Stage 1 snapshot: grey, so turquoise means "Stage 2" everywhere on the page (14 Oct 2026). */
.sheet--stage1 { border-left: 4px solid var(--rule-strong); }
/* Left column on an escalated case: Stage 2 group first, Stage 1 folded (owner's option 2, 14 Oct 2026). */
.stage-divider { display: block; margin: 0 0 .6rem; font-size: .8125rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--slate); }
.stage-divider--stage2 { color: var(--turquoise-ink); padding-bottom: .4rem; border-bottom: 2px solid var(--turquoise); }
.stage-group { margin-top: 1.5rem; border-top: 2px solid var(--rule-strong); padding-top: .9rem; }
.stage-group__toggle { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }
.stage-group__toggle::-webkit-details-marker { display: none; }
.stage-group__toggle .stage-divider { margin: 0; }
.stage-group__hint { font-size: .8125rem; color: var(--turquoise-ink); font-weight: 500; }
.stage-group__hint::before { content: "+ Show the original complaint"; }
.stage-group[open] .stage-group__hint::before { content: "– Hide the original complaint"; }
.stage-group__body { margin-top: 1rem; }
.summary-list--compact .summary-list__row { padding: .25rem 0; }
.timeline__filter { margin: 0 0 .75rem; }
.timeline--hide-system .timeline__item--system { display: none; }

/* Responses emailed from the case page (decision 12 Oct 2026) */
.responses__subject { margin: 0 0 .3rem; font-size: .9375rem; overflow-wrap: anywhere; }
.compose-meta { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0 0 1rem; font-size: .9375rem; }
.compose-meta dt { font-weight: 600; color: var(--slate); }
.compose-meta dd { margin: 0; overflow-wrap: anywhere; }
.compose-none { margin: 1.5rem 0 0; }
.kept-files { list-style: none; margin: 0 0 .75rem; padding: 0; }
.kept-files__item { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; font-size: .9375rem; }
.details { border: 1px solid var(--rule); border-radius: var(--radius); padding: .6rem 1rem; margin-top: 1.5rem; }
.details > summary { cursor: pointer; font-weight: 600; color: var(--navy); font-size: .9375rem; }
.details[open] > summary { margin-bottom: .5rem; }
.details--inline { border: 0; padding: 0; margin: .25rem 0 .5rem; }
.details--inline > summary { font-size: .8125rem; font-weight: 500; color: var(--turquoise-ink); }
.email-text { white-space: pre-wrap; font: inherit; font-size: .875rem; line-height: 1.5; background: var(--tint-soft); padding: .9rem 1rem; border-radius: var(--radius); overflow-wrap: anywhere; margin: .5rem 0 0; }
.sheet--preview { max-width: 56rem; }
.email-meta { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0 0 1.25rem; font-size: .9375rem; }
.email-meta dt { font-weight: 600; color: var(--slate); }
.email-meta dd { margin: 0; overflow-wrap: anywhere; }
.email-preview { border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.25rem 1.5rem; background: #fff; font-family: Calibri, Carlito, Arial, sans-serif; font-size: 11pt; line-height: 1.45; color: #000001; overflow-wrap: anywhere; }
.email-preview__p { margin: 0 0 12px; }
.sig { margin-top: 24px; }
.sig__line { margin: 0; }
.sig__line--gap { margin-top: 12px; }
.sig__line--icon img { vertical-align: middle; margin-right: 6px; }
.sig__link { color: #0645AD; text-decoration: none; }
.sig__banner-row { display: flex; flex-wrap: nowrap; align-items: flex-start; margin-top: 12px; max-width: 1010px; }
.sig__banner-row a { display: block; flex: 0 1 279px; min-width: 0; }
.sig__banner-img { display: block; flex: 0 1 452px; min-width: 0; width: 100%; height: auto; }
.sig__badge-img { display: block; width: 100%; height: auto; }
.sig__small { margin-top: 12px; font-size: 9pt; color: #6D6D6D; }
.preview-actions { margin-top: 1.25rem; align-items: center; }
.preview-actions form { display: inline; }

/* Questions to the complainant sent as a set (30 Oct 2026): one card per set, the question blocks on the ask form. */
.question-sets { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.question-set { padding: .85rem 1rem; margin-bottom: .75rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.question-set--open { border-color: var(--warn, #8a5300); border-left-width: 3px; }
.question-set .questions { margin: .35rem 0 0; }
.question-set .questions__item { padding: .5rem 0; }
.question-set .questions__item:last-child { padding-bottom: 0; }
.questions__number { font-weight: 600; color: var(--turquoise-ink); }
.questions__kind { font-size: .8125rem; color: var(--slate); white-space: normal; }
.questions__item--withdrawn .questions__question { color: var(--slate); }
.ask-block { border: 1px solid var(--rule); border-radius: var(--radius); margin: 0 0 .75rem; padding: .75rem 1rem .25rem; min-width: 0; }
.ask-block__legend { display: flex; align-items: baseline; gap: 1rem; width: 100%; padding: 0 .35rem; font-weight: 600; font-size: .9375rem; color: var(--navy); }
.ask-block__title { flex: 1; }
.ask-block__remove { color: var(--turquoise-ink); padding: .1rem .3rem; font-size: .8125rem; font-weight: 400; }
.ask-block__remove:hover { background: var(--tint-soft); color: var(--navy); }
.ask-block .form-group:last-child { margin-bottom: .5rem; }

/* "Download case summary" in the case header (30 Oct 2026): a turquoise button with a document icon. */
.button--pdf { background: var(--tint); color: var(--turquoise-ink); border-color: var(--turquoise-ink); margin-top: .15rem; }
.button--pdf:hover { background: var(--turquoise-ink); color: #fff; border-color: var(--turquoise-ink); }
.button__icon { width: 1.05rem; height: 1.05rem; flex: none; }
.button__tag { font-size: .6875rem; font-weight: 700; letter-spacing: .04em; padding: .1rem .35rem; border-radius: 4px; background: var(--turquoise-ink); color: #fff; line-height: 1.2; }
.button--pdf:hover .button__tag { background: #fff; color: var(--turquoise-ink); }
