@font-face {
  font-family: "Anybody";
  src: url("fonts/anybody-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5efe2;
  --paper: #fffdf7;
  --ink: #2a1d14;
  --muted: #5d4c3e;
  --line: #dccfb8;
  --brand: #3a2416;
  --brand-ink: #f7e9cf;
  --accent: #a3460f;
  --accent-ink: #ffffff;
  --open: #2d7a4c;
  --open-soft: #dcefe2;
  --capped: #d6b170;
  --drone: #e8d3a8;
  --new: #e9a23b;
  --warn: #8a3b0c;
  --focus: #1f6fb2;
  --head: "Anybody", "Arial Black", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17110c;
    --paper: #211812;
    --ink: #f1e6d6;
    --muted: #c4b09a;
    --line: #42321f;
    --brand: #0f0a06;
    --brand-ink: #f2c98a;
    --accent: #f0a35e;
    --accent-ink: #1c120a;
    --open: #63c48c;
    --open-soft: #1d3326;
    --capped: #9b7840;
    --drone: #6a5434;
    --new: #d08a2c;
    --warn: #f3b27a;
    --focus: #7fb8ec;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--body); }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.topbar { background: var(--brand); color: var(--brand-ink); }
.topbar-in { display: flex; align-items: center; min-height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font: 800 19px/1 var(--head); letter-spacing: .01em; }

.hero { padding: 26px 0 10px; max-width: 760px; }
h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.12; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 6vw, 42px); margin: 0 0 10px; }
.lede { margin: 0; color: var(--muted); font-size: 18px; max-width: 62ch; }

/* ---------- tool ---------- */
.tool { display: grid; gap: 22px; margin: 18px 0 40px; align-items: start; }
/* phone: hives, then the plan, then the shared settings; desktop: inputs left, plan right */
@media (min-width: 900px) {
  .tool { grid-template-columns: 380px 1fr; grid-template-rows: auto 1fr; grid-template-areas: "form res" "set res"; row-gap: 0; }
  #planner { grid-area: form; } .results { grid-area: res; } .settings { grid-area: set; }
}
@media (max-width: 899px) { .settings { margin-top: -8px; } }

.inputs fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.global { padding-top: 14px !important; margin-top: 14px !important; border-top: 2px solid var(--line) !important; }
.hive { padding: 16px 0 !important; border-bottom: 1px solid var(--line) !important; }
.field { display: flex; flex-direction: column; gap: 5px; margin: 0 0 12px; min-width: 0; }
.field > label, .lab { font-weight: 600; font-size: 15px; }
.opt { font-weight: 400; color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: end; }
.pair.names { grid-template-columns: 1fr 1fr auto; }
input[type=text], input[type=number], input[type=date], select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 6px; min-height: 46px; padding: 8px 10px; width: 100%; min-width: 0;
}
input[type=date] { padding: 6px 8px; }
input:focus, select:focus { border-color: var(--accent); }
.suffix { display: flex; align-items: center; gap: 8px; }
.suffix input { width: 90px; }
.hint { margin: 2px 0 0; font-size: 15px; color: var(--muted); }
.label-line { margin-top: 8px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }
.check.wide { margin: -2px 0 0; }

.seg { display: flex; border: 1.5px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--paper); }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 44px; font-weight: 600; font-size: 15px; border-left: 1px solid var(--line); }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--brand); color: var(--brand-ink); }
@media (prefers-color-scheme: dark) { .seg input:checked + span { background: var(--accent); color: var(--accent-ink); } }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; }

.btn {
  font: 600 16px/1.2 var(--body); min-height: 46px; padding: 10px 16px; border-radius: 6px; cursor: pointer;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { border-style: solid; border-color: var(--line); background: var(--paper); }
.btn:hover { filter: brightness(1.06); }
.row { margin: 14px 0 0; }
.x { align-self: end; margin-bottom: 12px; width: 46px; height: 46px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 6px; font-size: 24px; line-height: 1; cursor: pointer; }
.linkbtn { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; min-height: 32px; }

/* ---------- results ---------- */
.results { min-width: 0; }
.plan { background: var(--paper); border: 1.5px solid var(--line); border-top: 6px solid var(--brand); border-radius: 8px; padding: 16px 18px 6px; margin: 0 0 18px; }
@media (prefers-color-scheme: dark) { .plan { border-top-color: var(--accent); } }
.ph { font-size: 22px; margin: 0; }
.ph span { font: 400 16px var(--body); color: var(--muted); margin-left: 4px; }
.meta { margin: 4px 0 12px; color: var(--muted); font-size: 15px; }
.answer { border-left: 5px solid var(--open); padding: 2px 0 2px 14px; margin: 0 0 14px; }
.answer.none { border-left-color: var(--warn); }
.answer p { margin: 0 0 6px; }
.big { font: 800 clamp(24px, 5vw, 32px)/1.15 var(--head); margin: 0 0 4px !important; }
.big strong { color: var(--open); font-weight: 800; }
.win { font-size: 17px; font-weight: 600; }
.warn { color: var(--warn); font-size: 15px; }

.tl { position: relative; height: 26px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }

.tl .bit { position: absolute; top: 0; bottom: 0; display: block; border: 0; border-radius: 0; }
.tl .capped { background-color: var(--capped); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='14' viewBox='0 0 12 14'%3E%3Cpath d='M6 1l5 3v6l-5 3-5-3V4z' fill='none' stroke='%23000' stroke-opacity='.18' stroke-width='1'/%3E%3C/svg%3E"); }
.tl .drone { background: var(--drone); }
.tl .open { background: var(--open); }
.tl .new { background: repeating-linear-gradient(135deg, var(--new) 0 6px, transparent 6px 10px); }
.tl .mark { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; background: var(--ink); }
.tl-axis { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-top: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 14px; color: var(--muted); margin: 4px 0 10px; }
.legend > span { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.legend .k { display: inline-block; width: 14px; height: 12px; border-radius: 2px; }
.k.drone { background: var(--drone); }
.k.new { background: repeating-linear-gradient(135deg, var(--new) 0 3px, transparent 3px 5px); border: 1px solid var(--new); }
.k.capped { background: var(--capped); }
.k.open { background: var(--open); }

.steps-d summary { cursor: pointer; font-weight: 600; min-height: 40px; padding: 8px 0; }
.pair > .field:only-child { grid-column: 1 / -1; }
.steps { list-style: none; margin: 0 0 8px; padding: 0; }
.steps li { display: grid; grid-template-columns: 7.2em 4.2em 1fr; gap: 0 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 16px; }
.steps time { font-weight: 600; font-variant-numeric: tabular-nums; }
.steps .day { color: var(--muted); font-size: 14px; padding-top: 2px; }
.steps small { display: block; color: var(--muted); font-size: 15px; }
.steps .k-treat .what, .steps .k-treat-side .what { font-weight: 700; color: var(--open); }
.steps .k-info .what { color: var(--muted); }
@media (max-width: 480px) {
  .steps li { grid-template-columns: auto 1fr; gap: 0 10px; }
  .steps .what { grid-column: 1 / -1; }
}

.visits { background: var(--paper); border: 1.5px solid var(--line); border-radius: 8px; padding: 14px 18px; margin: 0 0 18px; }
.visits h2 { font-size: 20px; margin: 0 0 8px; }
.visits ol { list-style: none; margin: 0; padding: 0; }
.visits > ol > li { display: grid; grid-template-columns: 7.2em 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.visits time { font-weight: 600; }
.visits ul { list-style: none; margin: 0; padding: 0; }
.visits .k-treat, .visits .k-treat-side { color: var(--open); font-weight: 600; }
.visits .yd { color: var(--muted); }
.visits .hn { font-weight: 700; }
@media (max-width: 480px) { .visits > ol > li { grid-template-columns: 1fr; gap: 0; } }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 6px; }
.saved { font-size: 15px; color: var(--muted); margin: 10px 0 0; }
.toast { min-height: 1.5em; font-weight: 600; color: var(--open); margin: 6px 0 0; }

/* ---------- content ---------- */
.content { max-width: 720px; padding-bottom: 30px; }
.content h2 { font-size: 26px; margin: 34px 0 10px; }
.content p, .content li { max-width: 68ch; }
.methods { padding-left: 1.2em; }
.methods li { margin: 0 0 8px; }
table.dev { border-collapse: collapse; margin: 6px 0 14px; font-size: 16px; min-width: 300px; }
table.dev caption { text-align: left; color: var(--muted); font-size: 15px; padding-bottom: 4px; }
table.dev th, table.dev td { text-align: left; padding: 6px 18px 6px 0; border-bottom: 1px solid var(--line); }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; min-height: 44px; }
.faq details p { margin: 0 0 14px; }
.sources { font-size: 15px; color: var(--muted); margin-top: 26px; }

footer { border-top: 1px solid var(--line); padding: 22px 0 32px; font-size: 15px; color: var(--muted); }
.sb-footer p { margin: 0 0 8px; }

.nf { padding: 40px 0 60px; }

.printable { display: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- print ---------- */
@page { margin: 11mm 12mm; }
@media print {
  :root { --bg: #fff; --paper: #fff; --ink: #000; --muted: #333; --line: #999; --open: #1d6b3d; --capped: #d9b777; --drone: #eedcb5; --new: #e9a23b; --warn: #7a2f05; }
  body { background: #fff; color: #000; font-size: 10.5pt; line-height: 1.35; }
  .topbar, .hero, .tool, .content, footer { display: none !important; }
  body:not([data-print=cards]) #print-plan { display: block; }
  body[data-print=cards] #print-cards { display: block; }
  body.one-hive:not([data-print]) #print-plan { display: none; }
  body.one-hive:not([data-print]) #print-cards { display: block; }
  .wrap { max-width: none; padding: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .ph-head { border-bottom: 2pt solid #000; margin-bottom: 10pt; padding-bottom: 6pt; }
  .ph-brand { margin: 0; font: 800 9pt var(--head); letter-spacing: .04em; color: #555; }
  .ph-head h2 { font-size: 20pt; margin: 2pt 0; }
  .ph-sub { margin: 0; font-size: 10pt; }
  .ph-label { font-size: 9.5pt; margin: 10pt 0 0; color: #333; }
  #print-plan h3 { font-size: 13pt; margin: 11pt 0 3pt; }
  table.p-sum, table.p-dates, table.p-steps { width: 100%; border-collapse: collapse; }
  .p-sum th { text-align: left; font-size: 9.5pt; border-bottom: 1.5pt solid #000; padding: 3pt 6pt 3pt 0; }
  .p-sum td { vertical-align: top; border-bottom: .75pt solid #999; padding: 3.5pt 6pt 3.5pt 0; }
  .p-sum tr, .p-dates tr, .p-steps tr { break-inside: avoid; }
  .p-dates td { border-bottom: .5pt solid #bbb; padding: 2.1pt 6pt 2.1pt 0; vertical-align: top; }
  .p-dates thead { display: table-header-group; }
  .p-dates th { text-align: left; font-size: 8.5pt; font-weight: 400; color: #444; padding: 0 6pt 2pt 0; }
  .p-dates tbody { break-inside: avoid; page-break-inside: avoid; }
  .p-dates tr.first td { border-top: 1pt solid #000; }
  .p-dates .dt { width: 7.5em; font-weight: 700; white-space: nowrap; }
  td.cb { width: 16pt; }
  td.cb::before { content: ""; display: inline-block; width: 9pt; height: 9pt; border: 1pt solid #000; vertical-align: -1pt; }

  .card { border: 1.5pt solid #000; padding: 9pt 11pt; margin: 0 0 9mm; break-inside: avoid; page-break-inside: avoid; }
  .card header h2 { font-size: 16pt; margin: 0; }
  .card header h2 span { font: 400 11pt var(--body); }
  .card header p { margin: 2pt 0 7pt; font-size: 9.5pt; }
  .card .answer { margin: 0 0 7pt; padding-left: 8pt; border-left-width: 3pt; }
  .card .big { font-size: 17pt; }
  .card .win, .card .warn, .card .answer p { font-size: 10pt; margin-bottom: 2pt; }
  .card .tl { height: 13pt; border-color: #777; }
  .card .tl-axis, .card .legend { font-size: 8.5pt; color: #333; margin: 2pt 0; }
  .card .legend .k { width: 10pt; height: 8pt; }
  .p-steps td { border-top: .5pt solid #bbb; padding: 3pt 5pt 3pt 0; vertical-align: top; font-size: 9.5pt; }
  .p-steps .dt { white-space: nowrap; width: 7.2em; font-weight: 700; }
  .p-steps .dy { white-space: nowrap; width: 3.8em; color: #444; }
  .p-steps span { color: #333; font-size: 9pt; }
  .p-steps .k-treat b, .p-steps .k-treat-side b { color: var(--open); }
  .notes { margin: 10pt 0 0; font-size: 9.5pt; }
  .notes-h { margin: 8pt 0 0; font-size: 9.5pt; font-weight: 700; }
  .lines { height: 120pt; background: repeating-linear-gradient(to bottom, transparent 0 21pt, #aaa 21pt 21.6pt); }
  .card { break-after: page; page-break-after: always; }
  .card:last-child { break-after: auto; page-break-after: auto; }
  .p-dates tr.k-treat td, .p-dates tr.k-treat-side td { font-weight: 700; }
  .ph-label { break-before: avoid; }
  .card .ph-label { font-size: 8.5pt; margin-top: 5pt; }
}
.cage-hint { margin: -6px 0 6px; }

/* shared link choice */
.shared { margin: 14px 0 0; padding: 12px 16px; background: var(--paper); border-left: 5px solid var(--accent); max-width: 760px; }
.shared p { margin: 0; }
.shared .sh-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.shared .linkbtn { min-height: 44px; }

/* "typical, check your colony" tags */
a.typ { font: 400 14px/1.3 var(--body); color: var(--muted); margin-left: 4px; white-space: nowrap; }
.steps a.typ { margin-left: 6px; }
.p-steps .typ, .card .typ { font-weight: 400; font-size: 8.5pt; color: #444; }
