@layer reset, base, layout, parts, tools;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
  button, input { font: inherit; }
  table { border-collapse: separate; border-spacing: 0; }
  [hidden] { display: none !important; }
}

@layer base {
  :root {
    color-scheme: light;
    --cream: #fbf7ee;
    --paper: #fffdf9;
    --ink: #26364a;
    --mut: #4c5b70;
    --blue: #2854b8;
    --blue-deep: #21499f;
    --wash: #e4ecfc;
    --line: #c4cddd;
    font-family: ui-rounded, "Trebuchet MS", sans-serif;
    font-size: 18px;
    background: var(--cream);
    color: var(--ink);
  }
  body { font-size: 1rem; line-height: 1.75; }
  h1, h2, h3 { font-family: inherit; line-height: 1.2; font-weight: 700; letter-spacing: normal; text-wrap: pretty; }
  h1 { font-size: clamp(2.3rem, 4.8vw, 4rem); line-height: 1.12; max-width: 19ch; }
  h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
  h3 { font-size: 1.35rem; }
  p, dd, li, td, th, h1, h2, h3, legend, a { overflow-wrap: anywhere; }
  a { color: var(--blue-deep); text-underline-offset: .2em; text-decoration-thickness: .08em; }
  a:hover { color: var(--blue); text-decoration-thickness: .14em; }
  :focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; }
  p + p { margin-top: .9rem; }
  button { cursor: pointer; }
  ::selection { color: var(--ink); background: #d4e1ff; }
}

@layer layout {
  .w { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
  .mast { padding-block: 1.6rem 1.2rem; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; }
  .mast .cap { color: var(--mut); max-width: 28ch; text-align: right; }
  .bc { padding-block: .4rem; color: var(--mut); }
  .bc ol { list-style: none; padding: 0; display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
  .bc li { font-size: .94rem; }
  .bc a { display: inline-flex; min-height: 44px; align-items: center; }
  .op { padding-block: 2rem 4rem; display: grid; grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
  .op > div, .margin { min-width: 0; }
  .lead { margin-top: 1.8rem; max-width: 58ch; font-size: 1.06rem; }
  .margin { padding: 1.7rem; border-radius: 28px; border-top: 7px solid var(--blue); background: var(--wash); }
  .paper { background: var(--paper); border-radius: 28px 28px 0 0; }
  .art { padding-block: 3.5rem 4rem; }
  .col { min-width: 0; max-width: 74ch; margin-inline: auto; }
  .foot { padding-block: 2rem 2.5rem; max-width: 74ch; color: var(--mut); font-size: .94rem; }
  .hd { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-top: 3rem; margin-bottom: 1.2rem; }
  .hd h2, .hd h3 { min-width: 0; }
  .hd h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
  .col > .hd:first-child, .col > section:first-child > .hd:first-child { margin-top: 0; }
  .row { display: flex; flex-wrap: wrap; gap: .8rem; }
  @media (max-width: 760px) {
    .w { width: calc(100% - 40px); }
    .mast { display: block; padding-block: 1.2rem .8rem; }
    .mast .cap { margin-top: .35rem; text-align: left; max-width: none; }
    .op { grid-template-columns: minmax(0, 1fr); gap: 1.8rem; padding-block: 1.6rem 2.5rem; }
    .lead { font-size: 1rem; }
    .margin { padding: 1.4rem; border-radius: 24px; }
    .art { padding-block: 2.5rem 3rem; }
    .hd { margin-top: 2.5rem; gap: .65rem; }
    .foot { padding-block: 1.6rem 2rem; }
  }
}

@layer parts {
  .name { font-size: 1.3rem; font-weight: 750; color: var(--blue-deep); }
  .cap { font-size: .94rem; line-height: 1.55; font-weight: 600; letter-spacing: normal; text-transform: none; }
  .op > div > .cap { display: inline-block; margin-bottom: 1.1rem; padding: .4rem .9rem; border-radius: 999px; color: var(--blue-deep); background: var(--wash); }
  .margin .cap { color: var(--blue-deep); margin-bottom: .75rem; }
  .sub { display: block; font-weight: 500; font-size: .52em; line-height: 1.4; margin-top: .65em; color: var(--mut); }
  .side { font-size: clamp(1.2rem, 1.8vw, 1.5rem); line-height: 1.55; }
  .date { padding: 1rem 1.2rem; margin-block: 1.5rem; border-radius: 18px; font-size: .94rem; color: var(--mut); background: var(--cream); }
  .mut { color: var(--mut); font-size: .94rem; }
  .ref { display: inline-flex; justify-content: center; align-items: center; min-width: 44px; min-height: 44px; flex: 0 0 auto; font-size: .94rem; border-radius: 50%; background: var(--wash); }
  .ref:hover { background: #d4e1ff; }
  .go { display: flex; align-items: center; justify-content: space-between; gap: .8rem; min-height: 52px; padding: .65rem 1.1rem; border-radius: 999px; background: var(--wash); font-size: 1rem; font-weight: 700; }
  .go:hover { background: #d4e1ff; }
  .go span { font-size: 1.3rem; flex-shrink: 0; }
  .routes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .routes > div { padding: 1.2rem; border-radius: 24px; background: var(--cream); min-width: 0; }
  .routes dt { font-weight: 700; }
  .routes .go { background: transparent; padding: 0 0 .6rem; border-radius: 0; align-items: start; }
  .routes .go span { line-height: 1.4; }
  .routes dd { color: var(--mut); margin-top: .4rem; font-size: .94rem; }
  .cmp { width: 100%; table-layout: fixed; margin-block: 1.2rem 1.8rem; }
  .cmp caption { font-size: .94rem; text-align: left; padding-bottom: .8rem; color: var(--mut); }
  .cmp th, .cmp td { font-size: 1rem; text-align: left; vertical-align: top; padding: 1rem 1.1rem; border-bottom: 2px solid var(--paper); background: var(--cream); }
  .cmp thead th { background: var(--wash); color: var(--blue-deep); }
  .cmp th:first-child { width: 28%; }
  .cmp th[scope="row"] { font-weight: 700; }
  .cmp thead th:first-child { border-top-left-radius: 20px; }
  .cmp thead th:last-child { border-top-right-radius: 20px; }
  .cmp tbody tr:last-child th { border-bottom-left-radius: 20px; }
  .cmp tbody tr:last-child td { border-bottom-right-radius: 20px; }
  .bill, .flags { display: grid; gap: 1rem; }
  .bill > div, .flags > div { padding: 1.4rem; border-radius: 24px; background: var(--cream); }
  .bill dt, .flags dt { font-weight: 700; margin-bottom: .3rem; }
  .bill > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr); gap: 1rem; }
  .list { padding-left: 1.4rem; margin-top: 1rem; }
  .list li + li { margin-top: .7rem; }
  .list li::marker { color: var(--blue); }
  .sum { margin-top: 3rem; padding: 1.8rem; border-radius: 28px; color: white; background: var(--blue); }
  .sum .hd { margin-top: 0; }
  .sum h2 { font-size: 1.5rem; }
  .sum .go { margin-top: 1.2rem; background: var(--paper); color: var(--blue-deep); }
  .sum .go:hover { background: var(--cream); }
  .sum :focus-visible { outline-color: var(--paper); }
  .sum .list li::marker { color: inherit; }
  .help { background: var(--wash); padding: 1.6rem; border-radius: 24px; margin-block: 1.5rem; }
  .help .hd { margin-top: 0; }
  .strong { font-weight: 700; }
  .notes { padding-top: 3rem; }
  .notes h2 { font-size: 1.5rem; }
  .nl { list-style: none; padding: 0; margin-top: 1rem; }
  .nl li { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .35rem; padding-block: .6rem; }
  .mark { font-size: .94rem; padding-top: .45rem; color: var(--mut); }
  .src { display: flex; align-items: center; min-height: 44px; padding-block: .45rem; font-size: .94rem; }
  .qs { border: 0; padding: 0; margin: 1.8rem 0; min-inline-size: 0; }
  .qs legend { font-weight: 700; font-size: 1.2rem; margin-bottom: .8rem; padding: 0; max-width: 100%; }
  .chk { display: flex; gap: .8rem; align-items: start; min-height: 60px; padding: 1rem; margin-block: .55rem; border: 2px solid transparent; border-radius: 20px; background: var(--cream); cursor: pointer; }
  .chk input { width: 40px; height: 40px; margin: 0; flex: 0 0 auto; accent-color: var(--blue); }
  .chk:has(input:checked) { background: var(--wash); border-color: var(--blue); }
  .chk span { font-size: 1rem; min-width: 0; }
  .ctl { margin-block: 1.5rem; }
  button { min-height: 48px; max-width: 100%; padding: .7rem 1.3rem; color: white; background: var(--blue); border: 2px solid var(--blue); border-radius: 999px; font-size: 1rem; font-weight: 700; }
  button.quiet { color: var(--blue-deep); background: var(--paper); }
  button:hover { color: white; background: var(--blue-deep); border-color: var(--blue-deep); }
  .picked h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
  .picked { background: var(--wash); padding: 1.5rem; border-radius: 24px; margin-block: 1rem; }
  #kit-status { font-size: 1rem; }
  @media (max-width: 600px) {
    .routes { grid-template-columns: minmax(0, 1fr); }
    .bill > div { display: block; }
    .cmp th:first-child { width: 32%; }
    .cmp th, .cmp td { padding: .85rem .6rem; }
    .sum { padding: 1.4rem; }
    .go { padding-inline: 1rem; }
  }
}

@layer tools {
  .skip { position: absolute; top: .5rem; left: 1rem; transform: translateY(-200%); background: var(--blue); color: white; padding: .7rem 1.2rem; border-radius: 999px; min-height: 44px; z-index: 2; }
  .skip:focus { transform: none; }
  .skip:hover { color: white; background: var(--blue-deep); }
  :target { scroll-margin-top: 1.5rem; }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  }
  @media print {
    :root { color-scheme: light; background: white; color: black; font-size: 16px; }
    .paper { background: white; color: black; }
    .w { width: 100%; }
    .op, .art { display: block; padding-block: 1rem; }
    .margin, .bc, .skip, .ctl { display: none; }
    h1 { font-size: 2rem; }
    .col, .foot { max-width: none; }
    .sum, .help, .picked, .date, .routes > div, .bill > div, .flags > div { background: white; color: black; break-inside: avoid; }
    .sum { border: 2px solid #c4cddd; }
    a, .name, .cap, .mut, .mark, .foot { color: black; }
  }
}
