:root {
  --ink: #17262f;
  --muted: #4a5b66;
  --bg: #ffffff;
  --tint: #eef4f7;
  --line: #d3dfe6;
  --primary: #0b5d7a;
  --primary-dark: #084760;
  --focus: #b45309;
  --notice-bg: #f3f8fb;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.container { width: 100%; max-width: 62rem; margin: 0 auto; padding: 0 1rem; }
.container.narrow { max-width: 44rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
.small { font-size: .9rem; color: var(--muted); }

/* Header / footer */
.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-top: .8rem; padding-bottom: .8rem; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--primary-dark); text-decoration: none; }
.site-header nav a { font-size: .95rem; }
.site-footer { margin-top: .5rem; padding: .15rem 0 0; background: var(--bg); border-top: 0; font-size: .8125rem; line-height: 1.25; color: var(--muted); }
.site-footer p { margin: 0 0 .05rem; }
.site-footer .small { font-size: .75rem; line-height: 1.2; }
.site-footer p:last-child { margin-bottom: 0; }

/* Type */
h1 { font-size: 1.7rem; line-height: 1.25; margin: 1.5rem 0 .75rem; color: var(--primary-dark); }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 0 0 .5rem; color: var(--primary-dark); }
h3 { font-size: 1.05rem; margin: 1.25rem 0 .4rem; }
p, ul { margin: 0 0 1rem; }
ul { padding-left: 1.25rem; }
li { margin-bottom: .35rem; }
.lead { font-size: 1.15rem; color: var(--muted); }
.crumbs { margin: 1.25rem 0 0; font-size: .95rem; }

/* Home */
/* Page frame: the dark hero fills the space between header and footer, so there is no empty white block below the footer. */
body:has(.hero) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body:has(.hero) main { flex: 1 0 auto; display: flex; flex-direction: column; }

/* Header: light and compact, with a solid brand rule on top; the dark hero beneath closes it. */
body:has(.hero) .site-header { border-top: 4px solid var(--primary-dark); border-bottom: 0; }
body:has(.hero) .header-row { padding-top: .4rem; padding-bottom: .4rem; }
body:has(.hero) .brand { font-size: 1.2rem; letter-spacing: -.01em; }
body:has(.hero) .main-nav { gap: 0 1.25rem; }
body:has(.hero) .main-nav a { padding: .3rem 0 .15rem; line-height: 1.35; color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
body:has(.hero) .main-nav a:hover { color: var(--primary-dark); border-bottom-color: var(--primary); }

/* Hero: dark brand colour, white headline, the search panel as the one light surface. */
.hero { flex: 1 0 auto; display: flex; align-items: center; margin: 0; padding: 1.75rem 0 2rem; background: var(--primary-dark); color: #fff; border-bottom: 4px solid var(--primary); }
.hero .container.narrow { max-width: 62rem; }
.hero h1 { margin: 0 0 .9rem; font-size: clamp(2rem, 7.4vw + .55rem, 2.9rem); line-height: 1.1; letter-spacing: -.015em; color: #fff; text-wrap: balance; }
.hero .lead { max-width: 34rem; margin: 0 0 1.5rem; font-size: 1.075rem; line-height: 1.6; color: #d3e5ee; }
.hero .search-form { max-width: 32rem; margin: 0 0 .9rem; padding: 1rem 1.1rem 1.15rem; background: #fff; border: 0; border-radius: .35rem; box-shadow: 0 14px 28px -16px rgba(0, 0, 0, .6); }
.hero .search-form label { margin-bottom: .45rem; font-size: 1rem; font-weight: 700; color: var(--primary-dark); }
.hero .search-form input[type="search"] { min-height: 3.2rem; font-size: 1rem; color: var(--ink); background: #fff; border: 2px solid var(--primary); border-radius: .3rem; text-overflow: ellipsis; }
.hero .search-form input[type="search"]::placeholder { color: #566873; opacity: 1; text-overflow: ellipsis; }
.hero .search-form .btn { min-height: 3.2rem; padding: 0 1.2rem; font-weight: 700; background: var(--primary); border-color: var(--primary); }
.hero .search-form .btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.hero .btn-row { margin: 0; gap: .6rem; }
.hero .btn-secondary { background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .7); }
.hero .btn-secondary:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: #fff; }

/* Footer: compact, neutral, readable. */
body:has(.hero) .site-footer { margin: 0; padding: .65rem 0 .75rem; background: var(--tint); border-top: 0; font-size: .8125rem; line-height: 1.42; color: var(--muted); }
body:has(.hero) .site-footer p { margin: 0 0 .2rem; }
body:has(.hero) .site-footer .small { font-size: .78rem; line-height: 1.42; }
body:has(.hero) .site-footer p:last-child { margin-bottom: 0; }
body:has(.hero) .site-footer strong { color: var(--ink); }

/* Wide screens: headline and paragraph on the left, search panel and browse buttons on the right. Same HTML, same reading order on small screens. */
@media (min-width: 62rem) {
  .hero { padding: 2.25rem 0 2.5rem; }
  .hero .container.narrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 30rem); grid-template-rows: auto auto; column-gap: 2.75rem; align-items: start; }
  .hero h1 { grid-column: 1; grid-row: 1; align-self: end; margin: 0 0 1rem; }
  .hero .lead { grid-column: 1; grid-row: 2; margin: 0; }
  .hero .search-form { grid-column: 2; grid-row: 1; align-self: end; max-width: none; margin: 0 0 1rem; padding: 1.15rem 1.25rem 1.3rem; }
  .hero .btn-row { grid-column: 2; grid-row: 2; }
}

/* Phones: stack the search field and button, and give the placeholder room so it is never cut off. */
@media (max-width: 29.99rem) {
  .hero .search-row { flex-direction: column; }
  .hero .search-form { padding: .85rem .85rem 1rem; }
  .hero .search-form input[type="search"] { padding-left: .65rem; padding-right: .65rem; }
  .hero .search-form .btn { width: 100%; }
  .hero .btn-row .btn { flex: 1 1 100%; text-align: center; }
}
@media (max-width: 26rem) { .hero .search-form input[type="search"]::placeholder { font-size: .875rem; } }
@media (max-width: 21rem) {
  .hero .search-form { padding: .75rem .7rem .9rem; }
  .hero .search-form input[type="search"] { padding-left: .55rem; padding-right: .55rem; }
  .hero .search-form input[type="search"]::placeholder { font-size: .8125rem; }
}

/* Buttons & forms */
.btn { display: inline-block; font: inherit; font-weight: 600; color: #fff; background: var(--primary); border: 2px solid var(--primary); border-radius: .4rem; padding: .7rem 1.25rem; text-decoration: none; cursor: pointer; min-height: 2.75rem; }
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--primary); }
.btn-secondary:hover { background: var(--tint); color: var(--primary-dark); }
.search-form { margin: 1.5rem 0; }
.search-form label { display: block; font-weight: 600; margin-bottom: .4rem; }
.search-row { display: flex; gap: .5rem; }
input[type="search"] { flex: 1; min-width: 0; font: inherit; padding: .7rem .8rem; border: 2px solid #7a8f9b; border-radius: .4rem; min-height: 2.75rem; }
textarea { width: 100%; font: inherit; padding: .7rem .8rem; border: 2px solid #7a8f9b; border-radius: .4rem; resize: vertical; }

/* Notices */
.notice { background: var(--notice-bg); border-left: 4px solid var(--primary); padding: .75rem 1rem; font-size: .95rem; color: var(--muted); }

/* Lists of operations */
.proc-list { list-style: none; padding: 0; margin: 1rem 0 0; border-top: 1px solid var(--line); }
.proc-list li { margin: 0; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.proc-list a { display: block; font-weight: 600; font-size: 1.1rem; }
.proc-list span { display: block; color: var(--muted); font-size: .95rem; }
.results-title { margin-top: 1.5rem; font-size: 1.1rem; }

/* Procedure page */
section { margin-bottom: 1.75rem; }
.risk-list li { margin-bottom: .5rem; }
.discuss { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 2px solid var(--line); }
fieldset { border: 1px solid var(--line); border-radius: .4rem; margin: 0 0 1rem; padding: .5rem 1rem 1rem; }
legend { font-weight: 700; padding: 0 .4rem; }
.check { display: flex; gap: .75rem; align-items: flex-start; padding: .55rem 0; border-top: 1px solid var(--line); }
.check:first-of-type { border-top: 0; }
.check input { width: 1.4rem; height: 1.4rem; flex: none; margin: .2rem 0 0; accent-color: var(--primary); }
.check label { cursor: pointer; }
.check-title { display: block; font-weight: 600; }
.check-desc { display: block; font-size: .95rem; color: var(--muted); }

/* Summary */
.op-name { font-size: 1.2rem; font-weight: 600; }
.summary-list { list-style: none; padding: 0; }
.summary-list li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.summary-list strong, .summary-list span { display: block; }
.summary-list span { color: var(--muted); font-size: .95rem; }
.questions { white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

@media (min-width: 40rem) {
  body { font-size: 1.125rem; }
  h1 { font-size: 2.1rem; }
}

@media print {
  body { font-size: 12pt; color: #000; }
  .site-header, .no-print, .skip { display: none !important; }
  .hero { background: none; border-bottom: 0; color: #000; display: block; padding: 0; }
  .hero h1, .hero .lead { color: #000; }
  .hero .search-form { box-shadow: none; border: 1px solid #999; }
  .hero .btn-secondary { color: #000; border-color: #000; }
  body:has(.hero) { display: block; min-height: 0; }
  body:has(.hero) .site-footer { background: none; }
  .site-footer { background: none; border-top: 1px solid #999; margin-top: 1rem; padding: .4rem 0 0; color: #000; }
  .site-footer .small { color: #000; font-size: 9pt; }
  h1, h2 { color: #000; }
  .notice { background: none; border: 1px solid #999; color: #000; }
  .summary-list span { color: #000; }
  a { color: #000; text-decoration: none; }
  section { break-inside: avoid; }
}

/* ---- Phase 3 additions ---- */
.main-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; font-size: .95rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 .5rem; }
.chip { display: inline-block; padding: .35rem .85rem; border: 1px solid var(--line); border-radius: 2rem; text-decoration: none; font-size: .95rem; background: #fff; }
.chip-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-on:hover { background: var(--primary-dark); color: #fff; }
.alt-name, .meta { display: block; color: var(--muted); font-size: .95rem; }
.meta { font-size: .85rem; }
.cta { margin: 0 0 1.75rem; }
.btn-large { font-size: 1.1rem; padding: .85rem 1.5rem; }
.step { font-size: 1.1rem; margin-top: 1.5rem; }
.prepared { color: var(--muted); margin: 0 0 1.25rem; }
.q-list { margin-bottom: .75rem; }
.share-form, .share-box { margin: 2rem 0 1.75rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--notice-bg); }
.share-form h2, .share-box h2 { font-size: 1.15rem; }
.share-box input[type="text"] { flex: 1; min-width: 0; font: inherit; padding: .7rem .8rem; border: 2px solid #7a8f9b; border-radius: .4rem; min-height: 2.75rem; }
@media print { .prepared { color: #000; } .main-nav { display: none; } }

/* ---- Legal patch: footer links, cookie notice, legal pages ---- */
.footer-links a { white-space: nowrap; }
.site-footer .company-info,
.site-footer .footer-links { overflow-wrap: break-word; }
.legal h2 { margin-top: 1.75rem; }
.legal ul { padding-left: 1.25rem; }
.legal address { font-style: normal; margin: 0 0 1rem; }
.cookie-notice { position: sticky; bottom: 0; z-index: 20; background: #fff; border-top: 2px solid var(--primary); box-shadow: 0 -2px 8px rgba(0, 0, 0, .12); padding: .6rem 0; }
.cookie-notice[hidden] { display: none; }
.cookie-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.cookie-row p { margin: 0; flex: 1 1 18rem; font-size: .9rem; }
.cookie-row .btn { padding: .4rem 1.25rem; }
@media print { .cookie-notice { display: none !important; } }
