/* =========================================================================
   Report Animal Cruelty — design system
   GOV.UK-inspired (focus states, pressable buttons, bold type, bordered
   components, fixed-width container) but its own identity: a teal-leaning
   green brand, a deep-green header rather than pure black, and soft corners.
   ========================================================================= */

:root {
  --brand: #1b7a5a;          /* distinct teal-green (not GOV.UK #00703c) */
  --brand-dark: #145e45;
  --brand-tint: #e7f3ee;
  --header-bg: #0e231c;      /* deep green-black instead of pure black */
  --header-line: #1b7a5a;

  --ink: #0b0c0c;
  --muted: #50605a;
  --line: #b1b4b6;
  --line-soft: #d7dbd9;
  --bg: #f4f6f5;
  --white: #fff;

  --link: #1d5fa8;
  --link-hover: #103e6e;
  --link-visited: #4c2c92;

  --red: #d4351c;
  --red-bg: #fbeae7;
  --amber: #d4691c;
  --blue: #1d5fa8;
  --focus: #ffdd00;          /* iconic accessible yellow focus */

  --radius: 8px;
  --radius-sm: 5px;
  --maxw: 980px;
  --maxw-wide: 1240px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 1.05rem;
}
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
body.wide main.container { max-width: var(--maxw-wide); }

/* --- Links: GOV.UK-style yellow focus --- */
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .12em; }
a:visited { color: var(--link-visited); }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
a:focus {
  outline: 3px solid transparent;
  color: var(--ink);
  background-color: var(--focus);
  box-shadow: 0 -2px var(--focus), 0 4px var(--ink);
  text-decoration: none;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--focus); outline-offset: 0;
  box-shadow: inset 0 0 0 2px var(--ink);
}

.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 12px; top: 12px; background: var(--ink); color: #fff; padding: 10px 14px; z-index: 20; border-radius: 0; box-shadow: 0 4px var(--focus); }

/* --- Header --- */
.site-header { background: var(--header-bg); color: #fff; border-bottom: 6px solid var(--header-line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 14px 20px; }
.brand { color: #fff; font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand:hover { color: #fff; text-decoration: underline; text-decoration-thickness: 3px; }
.brand:focus { color: var(--ink); }
.main-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.main-nav a { color: #fff; text-decoration: none; font-size: .98rem; }
.main-nav a:not(.btn):hover { text-decoration: underline; text-decoration-thickness: 2px; }
.main-nav a:not(.btn):focus { color: var(--ink); }
.main-nav .who { color: #b9c7c1; font-size: .82rem; }
.main-nav a.active { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; text-decoration-color: #7fd1ad; }
.main-nav a.active:focus { text-decoration-color: var(--ink); }
.inline-form { display: inline; margin: 0; }

/* --- Phase / beta banner (GOV.UK pattern) --- */
.phase-banner { border-bottom: 1px solid var(--line-soft); background: #fff; }
.phase-banner .container { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; font-size: .92rem; }
.phase-tag {
  display: inline-block; background: var(--brand); color: #fff; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; font-size: .72rem;
  padding: 3px 9px; border-radius: 3px;
}
.phase-banner p { margin: 0; color: var(--muted); }

/* --- Main --- */
main.container { padding-top: 30px; padding-bottom: 40px; min-height: 60vh; }

/* --- Typography --- */
h1 { font-size: 2.3rem; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .55em; font-weight: 800; }
h2 { font-size: 1.55rem; line-height: 1.2; margin: 1.3em 0 .45em; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.18rem; margin: 1.1em 0 .35em; font-weight: 700; }
.lead { font-size: 1.3rem; color: #2a322f; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .98rem; }
.prose { max-width: 720px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; }

/* --- Buttons (pressable GOV.UK-style with brand colour) --- */
.btn {
  position: relative; display: inline-block; cursor: pointer; border: 2px solid transparent;
  border-radius: var(--radius-sm); padding: 11px 18px; font-size: 1.05rem; font-weight: 700;
  text-decoration: none; line-height: 1.2; transition: background .1s ease;
}
.btn-lg { padding: 15px 26px; font-size: 1.15rem; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 3px 0 var(--brand-dark); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-primary:active { top: 3px; box-shadow: none; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--ink); box-shadow: 0 3px 0 var(--line); }
.btn-secondary:hover { background: #f3f2f1; color: var(--ink); }
.btn-secondary:active { top: 3px; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #eef1f0; color: var(--ink); }
.btn-link { background: none; border: 0; color: var(--link); padding: 6px 4px; font-weight: 600; text-decoration: underline; cursor: pointer; font-size: 1rem; }
.btn-link.danger { color: var(--red); }
.btn:focus { outline: 3px solid var(--focus); outline-offset: 0; box-shadow: 0 3px 0 var(--ink); color: var(--ink); background-color: var(--focus); border-color: var(--focus); }
.btn-primary:focus, .btn-secondary:focus { background-color: var(--focus); }

/* --- Back link (GOV.UK chevron) --- */
.back-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: .98rem; font-weight: 600;
  margin-bottom: 14px;
}
.back-link::before { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 2px 0 0 2px; transform: rotate(-45deg); display: inline-block; }

/* --- Cards & layout --- */
.card { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 28px; margin: 18px 0; box-shadow: 0 1px 2px rgba(11,12,12,.04); }
.card.narrow { max-width: 700px; }
.card.center { text-align: center; }
.narrow { max-width: 700px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols .card { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cards-3 { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-bottom: 3px solid var(--brand); padding-bottom: 10px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.mt { margin-top: 16px; }
@media (max-width: 760px) { .cols, .grid-2, .cards-3 { grid-template-columns: 1fr; } h1 { font-size: 1.9rem; } }

/* --- Hero --- */
.hero { padding: 12px 0 8px; }
.hero h1 { font-size: 2.8rem; }
.hero .lead { max-width: 640px; }
.steps-overview { margin-top: 8px; }
.cards-3 .card h3 { margin-top: 0; color: var(--brand-dark); }
.cta-band { text-align: center; background: var(--brand-tint); border-color: #b7dcc6; }
.cta-band h2 { margin-top: 0; }

/* --- Forms --- */
.field { margin: 0 0 20px; }
label, legend { display: block; font-weight: 700; margin-bottom: 6px; }
/* Match text-like inputs INCLUDING those with no explicit type attribute. */
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=datetime-local], input[type=date], input[type=number], input[type=search], input[type=url],
input[type=file], select, textarea {
  width: 100%; padding: 11px 12px; font-size: 1.05rem; border: 2px solid var(--ink);
  border-radius: 4px; font-family: inherit; background: #fff;
}
input[type=file] { padding: 9px; }
textarea { resize: vertical; }
fieldset { border: 0; margin: 0 0 20px; padding: 0; }
.radio, .checkbox { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; margin: 8px 0; padding: 8px 10px; border-radius: 4px; }
.radio:hover, .checkbox:hover { background: var(--brand-tint); }
.radio input, .checkbox input { width: auto; margin-top: 4px; transform: scale(1.2); }
.actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.status-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }

/* --- Flash / alerts --- */
.flash { padding: 14px 18px; border-radius: var(--radius-sm); margin: 14px 0; border-left: 6px solid; background: #fff; }
.flash-success { background: var(--brand-tint); border-color: var(--brand); }
.flash-error { background: var(--red-bg); border-color: var(--red); }
.flash ul { margin: 6px 0 0; padding-left: 1.2em; }

/* --- Inset text & warning (GOV.UK components) --- */
.inset { border-left: 6px solid var(--line); padding: 6px 0 6px 18px; margin: 18px 0; color: #2a322f; }
.warning { display: flex; align-items: center; gap: 14px; margin: 18px 0; font-weight: 700; }
.warning .icon { flex: 0 0 auto; width: 36px; height: 36px; background: var(--ink); color: #fff; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; }

/* --- Notification banner (used on confirmation) --- */
.notif { border: 4px solid var(--brand); border-radius: var(--radius); overflow: hidden; margin: 18px 0; background: #fff; }
.notif-header { background: var(--brand); color: #fff; padding: 12px 22px; font-weight: 700; }
.notif-body { padding: 24px 22px; }

/* --- Wizard progress --- */
.wizard-progress ol { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 24px; flex-wrap: wrap; }
.wizard-progress li { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); padding: 5px 12px 5px 5px; border-radius: 22px; background: #fff; border: 1px solid var(--line-soft); }
.wizard-progress .num { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: var(--line); color: #fff; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; }
.wizard-progress li.current { color: var(--ink); font-weight: 700; border-color: var(--brand); }
.wizard-progress li.current .num { background: var(--brand); }
.wizard-progress li.done .num { background: var(--brand-dark); }
.wizard-progress li.done { color: var(--brand-dark); }

/* --- Review list --- */
.review { display: grid; grid-template-columns: 170px 1fr; gap: 0; margin: 0; }
.review dt { font-weight: 700; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line-soft); }
.review dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
@media (max-width: 560px) { .review { grid-template-columns: 1fr; } .review dt { border-bottom: 0; padding-bottom: 0; } .review dd { padding-top: 2px; } }

/* --- Tables --- */
.table { width: 100%; border-collapse: collapse; background: #fff; margin: 14px 0; border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table thead th { background: #f0f3f1; border-bottom: 2px solid var(--brand); font-size: .92rem; }
.table tbody tr:hover { background: #f7faf8; }
.table tbody tr:last-child td { border-bottom: 0; }
.table code { font-size: .85rem; }
.table.audit .details { max-width: 320px; word-break: break-word; font-size: .82rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); }
.table.audit code { background: none; padding: 0; }
/* Wide tables scroll horizontally instead of overflowing on small screens. */
@media (max-width: 760px) {
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
}

/* --- Badges --- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: .76rem; font-weight: 700; background: #eef1f0; color: var(--ink); text-transform: capitalize; letter-spacing: .01em; }
.prio-emergency { background: var(--red-bg); color: var(--red); }
.prio-high { background: #fdeede; color: #8a3b00; }
.prio-medium { background: #eef1f0; }
.prio-low { background: #eef1f0; color: var(--muted); }
.status-open { background: #e6eef7; color: var(--blue); }
.status-assigned { background: #fff2cf; color: #6b5300; }
.status-in_progress { background: var(--brand-tint); color: var(--brand-dark); }
.status-closed { background: #eef1f0; color: var(--muted); }

/* --- Stats --- */
.stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin: 18px 0; }
.stat { background: #fff; border: 1px solid var(--line-soft); border-top: 5px solid var(--brand); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--ink); display: block; }
.stat:hover { background: #f7faf8; }
.stat:focus { background: var(--focus); }
.stat-num { display: block; font-size: 2.3rem; font-weight: 800; color: var(--brand-dark); line-height: 1.1; }
.stat-label { color: var(--muted); }
@media (max-width: 760px) { .stat-row { grid-template-columns: 1fr; } }

/* --- PNB --- */
.pnb-list { list-style: none; padding: 0; }
.pnb-entry { background: #fff; border: 1px solid var(--line-soft); border-left: 6px solid var(--brand); border-radius: var(--radius); padding: 18px; margin: 12px 0; }
.pnb-entry.type-amendment { border-left-color: var(--amber); background: #fffaf3; }
.pnb-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.pnb-no { font-weight: 800; font-size: 1.05rem; }
.pnb-body { white-space: pre-wrap; margin: 8px 0; }
.pnb-foot { font-size: .82rem; color: var(--muted); }
.pnb-foot code { font-size: .78rem; background: #f0f3f1; padding: 1px 5px; border-radius: 3px; }
.amend { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.amend summary { cursor: pointer; color: var(--link); font-weight: 600; }
.amend textarea { margin: 10px 0; }

/* --- Evidence --- */
.evidence-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill,minmax(130px,1fr)); gap: 12px; }
.evidence-grid img { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.file-chip { display: inline-block; padding: 28px 10px; background: #eef1f0; border-radius: var(--radius-sm); text-align: center; }
.file-list { list-style: none; padding: 0; }
.file-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }

/* --- Misc --- */
.empty { color: var(--muted); padding: 18px 0; }
.center { text-align: center; }
.big-tick { font-size: 3.4rem; color: var(--brand); line-height: 1; }
.reference-code { font-size: 1.8rem; font-weight: 800; letter-spacing: 1px; background: var(--brand-tint); color: var(--brand-dark); display: inline-block; padding: 10px 22px; border-radius: var(--radius-sm); border: 2px dashed var(--brand); }
.contact-fields.hidden { display: none; }
code { background: #f0f3f1; padding: 1px 5px; border-radius: 3px; font-size: .9em; }

/* --- Head actions --- */
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- PNB day navigation --- */
.day-nav { display: flex; align-items: stretch; justify-content: space-between; gap: 10px; margin: 16px 0; }
.day-nav .day-btn { flex: 0 0 auto; display: flex; align-items: center; padding: 10px 16px; background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); text-decoration: none; font-weight: 600; color: var(--ink); }
.day-nav .day-btn:hover { background: var(--brand-tint); }
.day-current { flex: 1 1 auto; text-align: center; background: var(--brand); color: #fff; border-radius: var(--radius); padding: 8px 16px; display: flex; flex-direction: column; justify-content: center; }
.day-current .day-label { font-size: 1.3rem; font-weight: 800; }
.day-current .day-date { font-size: .85rem; opacity: .9; }
.empty-day { margin-top: 0; }

/* --- Geo + dictation bars --- */
.geo-bar, .dictate-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.geo-status { font-size: .9rem; color: var(--muted); }
.dictate-hint { font-size: .85rem; }
.sensitive-block { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px; background: #fafbfb; }
.sensitive-block legend { padding: 0 6px; }

/* --- Entry extras --- */
.pnb-entry.is-sensitive { border-left-color: var(--red); background: #fffafa; }
.badge.type-badge { background: #e6eef7; color: var(--blue); }
.badge.warn-badge { background: #fdeede; color: #8a3b00; }
.badge.sensitive-badge { background: var(--red-bg); color: var(--red); }
.pnb-foot .stamp { display: inline-block; margin-right: 12px; }
.pnb-foot .gps { color: var(--brand-dark); font-weight: 600; }

/* --- Record groups (people / animals / certificates) --- */
.record-group { margin: 22px 0; }
.record-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--line-soft); padding-bottom: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.record-head h2 { margin: 0; font-size: 1.25rem; }
.record-head .count { color: var(--muted); font-weight: 400; }
.record-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.record-item { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px; }
.record-item .small { font-size: .85rem; margin-top: 4px; }

/* --- Section 18 certificate (screen + print) --- */
.cert-page { background: #eef1f0; }
.cert-toolbar { max-width: 820px; margin: 18px auto 0; padding: 0 16px; display: flex; justify-content: space-between; gap: 10px; }
.certificate { max-width: 820px; margin: 18px auto 40px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.cert-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 4px solid var(--brand); padding-bottom: 16px; margin-bottom: 20px; gap: 16px; }
.cert-head h1 { margin: 0; font-size: 1.9rem; }
.cert-sub { margin: 4px 0 0; color: var(--muted); }
.cert-ref { text-align: right; }
.cert-ref span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cert-ref strong { font-size: 1.2rem; }
.cert-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.cert-table th, .cert-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.cert-table th { width: 38%; color: var(--muted); font-weight: 700; }
.cert-body h2 { font-size: 1.05rem; margin: 18px 0 6px; }
.cert-statement { font-weight: 700; background: var(--brand-tint); padding: 12px 14px; border-left: 5px solid var(--brand); border-radius: 4px; }
.cert-sign { display: flex; gap: 40px; margin-top: 48px; }
.sign-box { flex: 1; border-top: 1px solid var(--ink); padding-top: 6px; }
.sign-box span { font-size: .8rem; color: var(--muted); }
.cert-foot { margin-top: 24px; font-size: .8rem; }
@media print {
  .no-print { display: none !important; }
  .cert-page { background: #fff; }
  .certificate { box-shadow: none; border: 0; margin: 0; max-width: none; padding: 0; }
  a[href]:after { content: ''; }
}

/* --- Entry media + recorder --- */
.entry-media { margin: 10px 0; }
.entry-media video, .entry-media img { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.entry-media li { display: flex; flex-direction: column; gap: 4px; }
.recorder { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px; background: #fafbfb; }
.recorder legend { padding: 0 6px; }
.recorder-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rec-preview { width: 100%; margin: 8px 0; }

/* --- Form field polish --- */
.field { position: relative; }
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=datetime-local], input[type=date], input[type=number], input[type=search], input[type=url], select, textarea {
  width: 100%; max-width: 100%; min-height: 44px; line-height: 1.3;
}
select {
  appearance: none; -webkit-appearance: none; background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230b0c0c' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.field .hint { margin: 4px 0 8px; }
.field label + .hint { margin-top: -2px; }
fieldset legend { font-size: 1.05rem; padding-bottom: 4px; }
.checkbox span, .radio span { padding-top: 1px; }
.declaration { align-items: flex-start; background: #fafbfb; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 14px; }
.wizard h2 { border-top: 1px solid var(--line-soft); padding-top: 16px; margin-top: 24px; }
.wizard h2:first-of-type { border-top: 0; padding-top: 0; }
.inline-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-row input { flex: 1 1 220px; }
@media (max-width: 520px) { .actions .btn { flex: 1 1 auto; text-align: center; } }

/* --- Signature pad --- */
.sigpad-wrap { border: 2px dashed var(--line); border-radius: var(--radius); background:
  repeating-linear-gradient(0deg, #fff, #fff 38px, #f4f6f5 38px, #f4f6f5 40px); margin: 6px 0 12px; overflow: hidden; }
.sigpad { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.sig-img { max-height: 70px; display: block; margin-bottom: 4px; }
.cert-actions { max-width: 820px; margin: 0 auto 40px; padding: 0 16px; }

/* --- Visits --- */
.visit-band { border-left: 6px solid var(--line); }
.visit-band.visit-active { border-left-color: var(--brand); background: var(--brand-tint); }
.visit-band h2 { margin-top: 0; }
[data-visit-timer] { font-variant-numeric: tabular-nums; font-weight: 700; }

/* --- Time logging --- */
.suggested { color: var(--brand-dark); margin: 6px 0; }
.dismiss-form { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.dismiss-reason { max-width: 240px; min-height: 36px; }
.time-rollup { margin-top: -6px; }
.untimed-list .untimed { border-left: 5px solid var(--amber); }
.timelog-form { margin-top: 10px; }
.timelog-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timelog-row select, .timelog-row input { min-height: 40px; }
.timelog-row .mins { width: 90px; }
.timelog-row input[type=datetime-local] { width: auto; flex: 0 1 200px; }

/* --- Witness statement body --- */
.statement-body { white-space: pre-wrap; line-height: 1.6; margin: 16px 0; }
.produce-lede { font-size: 1.05rem; margin: 18px 0 8px; }

/* --- Prosecution promotion band --- */
.prosecution-band { border-left: 6px solid var(--brand); }
.prosecution-band h2 { margin-top: 0; }

/* --- S18 exhibits (form + certificate) --- */
.exhibit-row { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; background: #fafbfb; }
.exhibit-row legend { font-weight: 700; padding: 0 6px; }
.cert-lede { font-size: 1.05rem; margin: 8px 0 16px; }
.cert-exhibits { width: 100%; border-collapse: collapse; margin: 8px 0 20px; }
.cert-exhibits th, .cert-exhibits td { border: 1px solid var(--ink); padding: 8px 10px; text-align: left; vertical-align: top; }
.cert-exhibits thead th { background: #f0f3f1; }
.cert-exhibits .ex-no { width: 90px; white-space: nowrap; }
.ex-statements { margin: 0; padding-left: 1.1em; }
.ex-statements li { margin: 2px 0; }
.cert-meta { width: 100%; border-collapse: collapse; margin: 8px 0 24px; }
.cert-meta th, .cert-meta td { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.cert-meta th { color: var(--muted); font-weight: 700; width: 16%; }
.sign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.sign-field { border-bottom: 1px solid var(--ink); padding-bottom: 6px; min-height: 56px; display: flex; flex-direction: column; justify-content: flex-end; }
.sign-field .sign-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sign-field .sign-value { font-size: 1.05rem; min-height: 24px; }
@media (max-width: 560px) { .sign-grid { grid-template-columns: 1fr; } }

/* --- Address autocomplete --- */
.addr-suggest { position: absolute; z-index: 30; left: 0; right: 0; background: #fff; border: 1px solid var(--ink);
  border-top: 0; border-radius: 0 0 4px 4px; max-height: 260px; overflow-y: auto; box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.addr-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line-soft);
  padding: 10px 12px; cursor: pointer; font-size: .95rem; }
.addr-item:hover, .addr-item:focus { background: var(--brand-tint); }

/* --- Footer (GOV.UK-style with brand top border) --- */
.site-footer { background: #fff; border-top: 5px solid var(--brand); margin-top: 56px; padding: 28px 0; font-size: .95rem; }
.site-footer p { margin: 8px 0; }
.site-footer nav { margin: 10px 0; }
.site-footer .muted { color: var(--muted); font-size: .88rem; }

/* --- Inline add row (RLOE, dropbox message) --- */
.inline-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.inline-add input[type="text"] { flex: 1 1 280px; }

/* --- Message threads (witness Dropbox) --- */
.msg-thread { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-soft); background: var(--bg); }
.msg-officer { background: var(--brand-tint); border-color: var(--brand); }
.msg-who { font-weight: 700; margin-right: 6px; }
.msg-body { white-space: pre-wrap; }
.msg-at { display: block; margin-top: 2px; }

/* --- Witness Dropbox public portal --- */
.drop-page { background: var(--bg); }
.drop-wrap { max-width: 720px; margin: 0 auto; padding: 24px 18px 48px; }
.drop-head { border-bottom: 3px solid var(--brand); padding-bottom: 12px; margin-bottom: 18px; }
.drop-head h1 { margin: 0 0 4px; }
.drop-foot { margin-top: 24px; text-align: center; }

/* --- Tabs (incident detail) — progressive enhancement --- */
/* Without JS the tablist is hidden and every panel shows (graceful fallback). */
.tabs .tablist { display: none; }
.tabs.js-tabs .tablist { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin: 18px 0 6px; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 10px 16px; font: inherit; color: var(--ink); cursor: pointer; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tab:hover { background: var(--brand-tint); }
.tab[aria-selected="true"] { border-bottom-color: var(--brand); color: var(--brand-dark); font-weight: 700; }
.tab:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.tabs.js-tabs > .tabpanel { display: none; }
.tabs.js-tabs > .tabpanel.active { display: block; }

/* --- Pop-down disclosure (e.g. create upload link) --- */
.prewrap { white-space: pre-wrap; }
.popform { position: relative; }
.popform > summary { display: inline-flex; align-items: center; list-style: none; cursor: pointer; }
.popform > summary::-webkit-details-marker { display: none; }
.popform > summary::marker { content: ""; }
.popform-panel { position: absolute; right: 0; z-index: 30; margin-top: 6px; min-width: 240px; display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: 0 8px 20px rgba(11,12,12,.14); padding: 14px; }
.popform-panel label { margin: 0; }
@media (max-width: 520px) { .popform-panel { position: static; box-shadow: none; min-width: 0; } }

/* --- Cross-incident link badge --- */
.badge-link { background: var(--brand-tint); color: var(--brand-dark); text-decoration: none; }
a.badge-link:hover { background: var(--brand); color: #fff; }
