/* NestGuard Analytics: one stylesheet for every page.
   Layout: tokens > base > shell (top bar, page head, tabs) > components > pages > print.
   Colours are tokens, so dark mode and any future re-theme only touch :root. */

:root {
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f8f9fd; --ink: #0e1626; --mute: #5d6b86; --faint: #8a96ad; --line: #e2e7f1;
  --accent: #2459e8; --accent-hover: #1b47c0; --accent-ink: #ffffff; --accent-soft: #e8eeff; --accent-line: #c5d3fb;
  --nav: #0b1324; --nav-2: #131d36; --nav-ink: #e8edf8; --nav-mute: #8e9cbb;
  --ok: #0f7b6c; --ok-soft: #e1f4f1; --warn: #a96a00; --warn-soft: #fdf1d6; --bad: #cf2a3a; --bad-soft: #fde7ea;
  --info: #2459e8; --muted-soft: #eef1f7;
  --radius: 14px; --radius-sm: 9px; --gap: 18px;
  --shadow-sm: 0 1px 2px rgba(14, 22, 38, .05);
  --shadow: 0 1px 2px rgba(14, 22, 38, .04), 0 6px 20px rgba(14, 22, 38, .06);
  --shadow-lg: 0 12px 40px rgba(14, 22, 38, .16);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1020; --surface: #111a2e; --surface-2: #0e1628; --ink: #e8edf8; --mute: #97a5c2; --faint: #6c7a98; --line: #1f2b47;
    --accent: #6f9bff; --accent-hover: #93b3ff; --accent-ink: #091022; --accent-soft: #182654; --accent-line: #2c4285;
    --nav: #060b17; --nav-2: #0d1528; --nav-ink: #e8edf8; --nav-mute: #7c8bab;
    --ok: #4fd1bd; --ok-soft: #10332f; --warn: #f0b95a; --warn-soft: #3a2f16; --bad: #ff7b86; --bad-soft: #3c1a20;
    --muted-soft: #16213a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 22px rgba(0, 0, 0, .28);
    --shadow-lg: 0 14px 44px rgba(0, 0, 0, .55);
  }
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { letter-spacing: -.012em; line-height: 1.25; margin: 0; }
h2 { font-size: 15.5px; font-weight: 650; margin-bottom: 10px; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 10px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------------------------------------------------------------- shell: top bar */
.topbar { background: linear-gradient(180deg, var(--nav) 0%, var(--nav-2) 100%); color: var(--nav-ink); position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 6px 18px rgba(0, 0, 0, .18); }
.topbar-in { max-width: 1320px; margin: auto; padding: 0 clamp(14px, 3vw, 28px); display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--nav-ink); font-weight: 700; font-size: 16px; letter-spacing: -.015em; padding: 10px 0; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--nav-mute); font-size: 13.5px; font-weight: 550; padding: 7px 12px; border-radius: 8px; transition: background .12s, color .12s; }
.nav a:hover { color: var(--nav-ink); background: rgba(255, 255, 255, .07); text-decoration: none; }
.nav a.active { color: #fff; background: rgba(255, 255, 255, .13); }
.user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--nav-mute); margin-left: auto; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 12.5px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* a trap field: people never see it, bots fill it in */
.req-note { color: var(--muted, #4a5878); font-size: 12.5px; }
a.avatar { text-decoration: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-pic { width: 180px; height: 180px; border-radius: 50%; overflow: hidden; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  font-size: 64px; font-weight: 700; border: 3px solid var(--line); flex: none; }
.profile-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-row { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
code.secret { font-size: 17px; letter-spacing: .08em; word-break: break-word; user-select: all; }
#mfaCodeList { font-family: var(--mono); font-size: 15px; line-height: 1.6; background: var(--muted-soft); padding: 10px 14px; border-radius: 8px; }
.user b { color: var(--nav-ink); font-weight: 600; display: block; line-height: 1.15; }
.user small { display: block; color: var(--nav-mute); text-transform: uppercase; letter-spacing: .05em; font-size: 10.5px; }
.user a { color: var(--nav-mute); font-size: 12.5px; }
.user a:hover { color: var(--nav-ink); }
.user a.btn, .user a.btn:hover, .user a.avatar { color: var(--accent-ink, #fff); }   /* welcome page "Log in" / "Open the site" button */

/* phones and small tablets: the page links fold into a Menu button (common.js ACT.navmenu) */
.menu-btn { display: none; }
@media (max-width: 900px) {
  .topbar.has-menu .topbar-in { flex-wrap: wrap; gap: 0 10px; min-height: 54px;
    padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .topbar.has-menu .brand { flex: 0 1 auto; min-width: 0; font-size: 15px; padding: 8px 0; }
  .topbar.has-menu .brand img { width: 30px; height: 30px; flex: none; }
  .topbar.has-menu .brand-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .topbar.has-menu .user { order: 2; gap: 12px; flex: none; }
  .topbar.has-menu .user > span { display: none; }      /* name and role: the avatar links to the profile */
  .topbar.has-menu .user a:not(.avatar) { font-size: 14px; padding: 10px 2px; }
  .topbar.has-menu .menu-btn { order: 3; display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
    width: 44px; height: 44px; padding: 0; flex: none; background: transparent; border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px;
    box-shadow: none; color: var(--nav-ink); }
  .topbar.has-menu .menu-btn:hover { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .28); }
  .topbar.has-menu .menu-btn i { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .15s, opacity .15s; }
  .topbar.has-menu.open .menu-btn i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .topbar.has-menu.open .menu-btn i:nth-child(2) { opacity: 0; }
  .topbar.has-menu.open .menu-btn i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .topbar.has-menu .nav { order: 4; flex: 1 0 100%; display: none; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 2px;
    padding: 6px 0 12px; border-top: 1px solid rgba(255, 255, 255, .08);
    max-height: calc(100vh - 54px); max-height: calc(100dvh - 54px); overflow-y: auto; overscroll-behavior: contain; }
  .topbar.has-menu.open .nav { display: flex; }
  .topbar.has-menu .nav a { font-size: 16px; padding: 12px 12px; }
  /* welcome page: a few section links, scrolled sideways under the brand instead of wrapping */
  .topbar:not(.has-menu) .nav { order: 4; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .topbar:not(.has-menu) .nav a { white-space: nowrap; }
}

main { padding: clamp(16px, 3vw, 30px) clamp(14px, 3vw, 28px) 56px; max-width: 1320px; margin: auto; }
main.narrow { max-width: 780px; }
main.medium { max-width: 1040px; }

/* ---------------------------------------------------------------- shell: page header and tabs */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: clamp(21px, 3vw, 27px); font-weight: 750; }
.page-head .sub { color: var(--mute); margin: 4px 0 0; font-size: 14px; max-width: 70ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: thin; }
.tab { appearance: none; background: none; border: 0; border-bottom: 2.5px solid transparent; color: var(--mute); font: inherit; font-weight: 600;
  font-size: 14px; padding: 11px 16px; margin: 0 0 -1px; border-radius: 0; cursor: pointer; white-space: nowrap; transition: color .12s, border-color .12s; }
.tab:hover { color: var(--ink); background: none; border-color: var(--line); }
.tab[aria-selected="true"] { color: var(--accent); border-color: var(--accent); }
.tab .count { margin-left: 6px; font-size: 11.5px; background: var(--muted-soft); color: var(--mute); padding: 1px 7px; border-radius: 999px; }
.tab-panel { display: none; animation: rise .18s ease-out; }
.tab-panel.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- components: cards and grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: var(--gap); box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.inner { margin: 14px 0 0; box-shadow: none; background: var(--surface-2); }
.card > h2:first-child, .card > .card-head h2 { margin-bottom: 4px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.grid .card { margin: 0; }
@media (max-width: 460px) { .grid, .grid.two { grid-template-columns: 1fr; } }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 620px) { .row, .row.three { grid-template-columns: 1fr; } }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stack > * + * { margin-top: 12px; }
.mt { margin-top: var(--gap); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 14px; margin-bottom: var(--gap); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden; color: var(--mute); font-size: 12.5px; font-weight: 550; }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.stat.warn::before { background: var(--warn); } .stat.bad::before { background: var(--bad); } .stat.ok::before { background: var(--ok); }
.stat b { display: block; font-size: 30px; line-height: 1.1; color: var(--ink); font-weight: 750; letter-spacing: -.025em; margin-bottom: 2px; }
.stat small { display: block; margin-top: 4px; font-weight: 400; color: var(--faint); }

/* ---------------------------------------------------------------- components: buttons and forms */
button, .btn { appearance: none; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid var(--accent); background: var(--accent);
  color: var(--accent-ink); border-radius: var(--radius-sm); padding: 8px 16px; margin: 0; display: inline-flex; align-items: center; gap: 6px;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .06s; text-decoration: none; }
button:hover, .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button.alt, .btn.alt { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
button.alt:hover, .btn.alt:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
button.ghost { background: transparent; color: var(--accent); border-color: transparent; padding: 6px 10px; }
button.ghost:hover { background: var(--accent-soft); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.small, td button { padding: 4px 11px; font-size: 12.5px; }
button.touch, .btn.touch { min-height: 44px; padding: 10px 16px; font-size: 15px; }  /* one-handed beach actions */
button.wide { width: 100%; justify-content: center; padding: 13px 18px; font-size: 16px; }
button:disabled { opacity: .55; cursor: default; transform: none; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 12px; }

label { display: block; font-size: 12.5px; font-weight: 600; color: var(--mute); margin: 14px 0 5px; }
label.check { display: inline-flex; gap: 8px; align-items: center; margin: 0; font-weight: 450; font-size: 13.5px; color: var(--ink); cursor: pointer; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 12px; transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--accent-line); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-soft); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; padding: 0; accent-color: var(--accent); }
input[type=range] { padding: 0; accent-color: var(--accent); }
input[type=file] { padding: 8px; background: var(--surface-2); }
.inline input, .inline select { width: auto; }
textarea { font-family: var(--font); resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 13px; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 4px 14px; align-items: end; }
.filters label { margin-top: 8px; }
.filters .wide { grid-column: 1 / -1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.chip { font-size: 12px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 3px 11px; font-weight: 600; }

.note { color: var(--mute); font-size: 12.5px; margin-top: 6px; }
.err { color: var(--bad); margin-top: 8px; font-size: 13.5px; font-weight: 550; }
.bad { color: var(--bad); } .warn { color: var(--warn); } .ok { color: var(--ok); }
.muted { color: var(--mute); }

/* ---------------------------------------------------------------- components: tables, badges */
.table-wrap { overflow: auto; max-height: 520px; margin-top: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.table-wrap.tall { max-height: 700px; }
table { border-collapse: collapse; font-size: 13.5px; width: 100%; }
th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-weight: 650; color: var(--mute); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .05em; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 14px; white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; text-align: left; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td button { margin: 2px 4px 2px 0; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 2.5px 10px; border-radius: 999px; background: var(--muted-soft); color: var(--mute); white-space: nowrap; }
.pill.active, .pill.info { background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.invited, .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.inactive { background: var(--muted-soft); color: var(--faint); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.linkbox { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.linkbox input { font-family: var(--mono); font-size: 12px; flex: 1; min-width: 200px; }
.empty { text-align: center; padding: 40px 16px; color: var(--mute); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.skeleton { background: linear-gradient(90deg, var(--muted-soft) 25%, var(--surface-2) 50%, var(--muted-soft) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; min-height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton.tall { height: 300px; } .skeleton.line { height: 16px; margin: 10px 0; }

.toast-host { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--nav); color: var(--nav-ink); padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 360px; animation: rise .18s ease-out; }
.toast.bad { background: var(--bad); color: #fff; }

/* ---------------------------------------------------------------- photos */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; margin-top: 14px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .12s, box-shadow .12s, border-color .12s; color: var(--ink); }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent-line); text-decoration: none; }
.pcard .thumb { aspect-ratio: 4 / 3; background: var(--muted-soft); position: relative; display: grid; place-items: center; color: var(--faint); font-size: 12px; overflow: hidden; }
.pcard .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; background: #fff; }
.pcard .thumb .pill { position: absolute; top: 10px; left: 10px; box-shadow: var(--shadow-sm); }
.pcard .meta { padding: 12px 14px 14px; display: grid; gap: 3px; font-size: 13px; }
.pcard .meta b { font-size: 14px; font-weight: 650; }
.pcard .meta span { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 10px; flex-wrap: wrap; color: var(--mute); font-size: 13px; }

img.shot { max-width: 100%; max-height: 680px; margin-top: 12px; border-radius: 12px; display: block; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
figure { margin: 0; }
img.shot, img.back, img.zoomable { cursor: zoom-in; }
img.guide-img { width: 100%; height: auto; border-radius: 12px; display: block; }
.terms dt { font-weight: 700; margin-top: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.terms dd { margin: 4px 0 0 26px; color: var(--muted, #4a5878); }
.chip { width: 16px; height: 16px; border-radius: 4px; border: 1px solid #0b1324; display: inline-block; }
.chip.c-central { background: #1d4ed8; } .chip.c-lateral { background: #9cc3f5; } .chip.c-marginal { background: #f1c27a; } .chip.c-end { background: #e8836b; }
.chip.c-tympanic { background: #8fd19e; } .chip.c-beak { background: #c9b48a; }
.ed-dock { position: sticky; bottom: 0; z-index: 5; margin: 14px -20px -20px; padding: 10px 20px; text-align: center; background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 16px 16px; box-shadow: 0 -6px 16px rgba(11, 23, 48, .08); }
.ed-dock img.shot { max-height: 30vh; margin: 0; }
.ed-dock.big img.shot { max-height: 58vh; }
.ed-stage { position: relative; display: inline-block; line-height: 0; }
.ed-stage canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; touch-action: none; cursor: move; }
.oval-box { padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; }
body.zoom-open { overflow: hidden; }
.zoombox { position: fixed; inset: 0; z-index: 1000; background: rgba(7, 14, 30, .94); display: flex; flex-direction: column; }
.zoombar { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 10px; flex-wrap: wrap; }
.zoombar button { min-width: 44px; min-height: 44px; padding: 0 14px; font-size: 1.1rem; background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .25); border-radius: 10px; }
.zoombar button:hover { background: rgba(255, 255, 255, .26); }
.zoomlabel { color: #fff; min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.zoomstage { flex: 1; position: relative; overflow: hidden; touch-action: none; cursor: grab; }
.zoomstage:active { cursor: grabbing; }
.zoomstage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: #fff; user-select: none; -webkit-user-drag: none; }
.zoomhint { color: rgba(255, 255, 255, .6); text-align: center; font-size: .8rem; padding: 6px 10px 12px; }
.backs { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
img.back { max-height: 270px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.slider { display: grid; grid-template-columns: 210px 1fr; gap: 10px; align-items: center; margin: 4px 0; }
.slider span { font-size: 13px; color: var(--mute); font-weight: 550; }
.slider label { margin: 0; display: contents; }
@media (max-width: 560px) { .slider { grid-template-columns: 1fr; } }
code { background: var(--muted-soft); padding: 1px 6px; border-radius: 5px; font-size: .92em; font-family: var(--mono); }
.md h2, .md h3, .md h4 { margin: 18px 0 4px; } .md p { margin: 6px 0; } .md ul { padding-left: 20px; }

/* ---------------------------------------------------------------- weather, map, reports */
.wx { display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: center; }
.wx .big { font-size: 54px; font-weight: 750; letter-spacing: -.04em; line-height: 1; }
.wx .big small { font-size: 22px; font-weight: 600; color: var(--mute); }
.wx .what { font-size: 17px; font-weight: 650; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.fact { background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 11px 14px; }
.fact span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 650; }
.fact b { font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.tip { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 10px 10px 0; margin-top: 10px; font-size: 13.5px; }
.tip.warn { border-color: var(--warn); background: var(--warn-soft); }

.map { height: min(62vh, 560px); min-height: 340px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; background: var(--muted-soft); }
.map.short { height: 340px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--mute); margin-top: 10px; align-items: center; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

.timeline { display: grid; gap: 12px; }
.report { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.report header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; margin-bottom: 8px; }
.report h3 { font-size: 15px; }
.counts { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.counts span { background: var(--muted-soft); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; color: var(--mute); }
.counts b { color: var(--ink); font-size: 14px; }

.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.cta .btn-lg { flex: 1; min-width: 180px; justify-content: center; }
.greet { background: linear-gradient(135deg, var(--nav) 0%, #1c3a8a 100%); color: #fff; border: 0; }
.greet h2 { font-size: 22px; font-weight: 750; margin-bottom: 4px; } .greet p { color: rgba(255, 255, 255, .78); }
.greet .btn { background: #fff; color: #0b1324; border-color: #fff; } .greet .btn.alt { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.greet .btn:hover { background: #e8eeff; color: #0b1324; }

/* ---------------------------------------------------------------- sign-in pages */
body.login { display: grid; place-items: center; min-height: 100vh; padding: 20px;
  background: radial-gradient(900px 520px at 12% -8%, var(--accent-soft), transparent 62%), radial-gradient(700px 420px at 100% 110%, var(--accent-soft), transparent 60%), var(--bg); }
.login form { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px; width: 100%; max-width: 390px; box-shadow: var(--shadow-lg); }
.login .logo { width: 84px; height: 84px; border-radius: 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.login h1 { margin: 0 0 4px; font-size: 22px; font-weight: 750; }
.login .note { margin: 0 0 10px; }

/* ---------------------------------------------------------------- print: a clean page for nest reports */
@media print {
  .topbar, .tabs, .actions, button, .btn, .filters, .pager, .toast-host { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  main { max-width: none; padding: 0; }
  .card, .stat, .report { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  .tab-panel { display: block !important; }
  .table-wrap { max-height: none; overflow: visible; }
  a { color: #000; }
}
.span-all { grid-column: 1 / -1; }
.legend i.blue { background: #2459e8; } .legend i.amber { background: #f0a22e; } .legend i.red { background: #d92d3a; }
.leaflet-popup-content { font: 13px/1.5 var(--font); } .leaflet-container { font-family: var(--font); }

/* ---------------------------------------------------------------- welcome page (public) */
body.welcome { background: var(--bg); }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: 12px; font-weight: 700; color: var(--sky, #9fb8ff); margin: 0 0 10px; }
.w-hero { background: radial-gradient(900px 480px at 85% -10%, #2a4ea8 0%, transparent 62%), linear-gradient(180deg, var(--nav) 0%, #10224f 100%); color: #fff; }
.w-hero-in { max-width: 1180px; margin: auto; padding: clamp(36px, 7vw, 84px) clamp(16px, 4vw, 32px); display: grid; grid-template-columns: 1.25fr 1fr; gap: 36px; align-items: center; }
.w-hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.1; font-weight: 800; letter-spacing: -.025em; margin: 0 0 16px; }
.w-hero .lead { font-size: clamp(16px, 2vw, 19px); color: rgba(255, 255, 255, .84); max-width: 58ch; margin: 0 0 22px; }
.w-hero .btn { background: #fff; color: #0b1324; border-color: #fff; }
.w-hero .btn:hover { background: #e8eeff; }
.w-hero .btn.ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.w-hero .btn.ghost-light:hover { background: rgba(255, 255, 255, .1); }
.w-hero .fine { color: rgba(255, 255, 255, .62); font-size: 13px; margin-top: 16px; }
.w-art { width: min(100%, 380px); justify-self: center; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .35)); }
@media (max-width: 820px) { .w-hero-in { grid-template-columns: 1fr; } .w-art { width: 240px; order: -1; } }
.w-main { max-width: 900px; margin: auto; padding: 24px clamp(16px, 4vw, 32px) 56px; }
.w-section { padding: 30px 0; border-bottom: 1px solid var(--line); }
.w-section:last-child { border-bottom: 0; }
.w-section h2 { font-size: clamp(21px, 3vw, 27px); font-weight: 750; margin-bottom: 14px; letter-spacing: -.02em; }
.w-section p, .w-section li { font-size: 16px; color: var(--ink); max-width: 72ch; }
.w-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 700px) { .w-cols { grid-template-columns: 1fr; } }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 16px 64px; position: relative; box-shadow: var(--shadow-sm); }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 16px; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 750; }
.steps b { display: block; font-size: 17px; margin-bottom: 2px; }
.steps span { color: var(--mute); }
.w-care ul { background: var(--warn-soft); border: 1px solid transparent; border-left: 4px solid var(--warn); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 22px 14px 38px; margin: 0; }
.w-care li { margin: 6px 0; }
ul.plain { padding-left: 20px; } ul.plain li { margin: 6px 0; }
.w-end { text-align: center; } .w-end p { margin: 0 auto 16px; color: var(--mute); }
.w-foot { text-align: center; color: var(--faint); font-size: 13px; padding: 18px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- head photos (upload choice, photo guides, lists) */
fieldset.subject { border: 0; padding: 0; margin: 0 0 6px; min-width: 0; }
fieldset.subject legend { font-weight: 650; font-size: 14px; margin-bottom: 8px; padding: 0; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
label.opt { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: pointer; color: var(--ink); font-weight: 450; font-size: 13.5px; }
label.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
label.opt input { margin-top: 3px; }
label.opt b { display: block; font-size: 14px; }
label.opt small { display: block; color: var(--mute); font-size: 12.5px; margin-top: 2px; }
.guide { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 16px; align-items: start; margin-top: 12px;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.guide ul.tips { margin: 0; padding-left: 18px; font-size: 13.5px; }
.guide ul.tips li { margin-bottom: 4px; }
svg.head-guide { width: 100%; height: auto; display: block; }
.hg-frame { fill: var(--surface); stroke: var(--faint); stroke-width: 2; }
.hg-head { fill: var(--muted-soft); stroke: var(--ink); stroke-width: 2; }
.hg-hl { fill: var(--warn-soft); stroke: var(--warn); stroke-width: 2.5; }
.hg-eye { fill: var(--ink); }
.hg-dot { fill: var(--ink); }
.hg-seam { fill: none; stroke: var(--faint); stroke-width: 1.5; }
.hg-arrow { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.hg-text { fill: var(--mute); font-size: 11px; font-family: var(--font); }
.hg-text.hg-strong { fill: var(--warn); font-weight: 700; }
.hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 14px; }
.hgrid .card { margin: 0; }
.hcard figure.hthumb { margin: 0; }
.hcard img.back { max-width: 100%; }
figure.match { max-width: 180px; margin: 0; }
details summary { cursor: pointer; font-size: 13px; color: var(--accent); margin-top: 8px; }
@media (max-width: 640px) {
  .choice { grid-template-columns: 1fr; }
  .guide { grid-template-columns: 1fr; }
  svg.head-guide { max-width: 220px; margin: 0 auto; }
}
figure.match img.back { max-width: 100%; }
.btn.small { padding: 4px 11px; font-size: 12.5px; }

/* hatchling IDs: one code per hatchling ties its shell photo and head close-ups together */
.hcode { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .02em; }
.hatch-banner { font-size: 15px; }
.btn.same, button.same { font-size: 16px; padding: 12px 18px; }
.hstate { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.check-list li { margin: 4px 0; }

/* degrees C / F switch (templates/_tempunit.html) */
.tempunit { display: inline-flex; }
.tempunit button { min-width: 44px; padding-left: 10px; padding-right: 10px; }
.tempunit button:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tempunit button:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
@media print { .tempunit { display: none; } }

/* phone app: offline queue banner (offline.js), logout question, "new version" bar and install hint (pwa.js) */
.qbar { max-width: 1320px; margin: 10px auto 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 10px 10px 0; font-size: 14px; width: calc(100% - 2 * clamp(14px, 3vw, 28px)); }
.qbar.warn { border-color: var(--warn); background: var(--warn-soft); }
.qbar-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.qbar-btns { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qbar button.small, .qbar .btn.small { min-height: 36px; }
.qbar .note { margin-top: 4px; }
.qlist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.qlist li { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; }
.qthumb { width: 48px; height: 48px; flex: none; border-radius: 6px; object-fit: cover; background: var(--muted-soft); }
.qtext { flex: 1; min-width: 0; display: grid; }
.qtext b { overflow-wrap: anywhere; }
.qtext small { color: var(--mute); }
.qtext .err { margin: 0; font-size: 12.5px; }
.qmodal { position: fixed; inset: 0; background: rgba(6, 11, 23, .55); display: grid; place-items: center; padding: 16px; z-index: 200; }
.qmodal-in { background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 20px; max-width: 440px; width: 100%; box-shadow: var(--shadow-lg); }
.update-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 150; min-height: 48px; padding: 12px 20px;
  border-radius: 999px; box-shadow: var(--shadow-lg); font-size: 15px; max-width: calc(100% - 32px); }
.update-bar:active { transform: translateX(-50%) translateY(1px); }
.install-hint .note { margin: 6px 0; }
@media print { .qbar, .update-bar, #installHint { display: none !important; } }

/* ---------------------------------------------------------------- scale card (exact physical size in print) */
.size { margin: 8px 0 2px; }
ol.plain-steps { margin: 0; padding-left: 20px; font-size: 14px; } ol.plain-steps li { margin-bottom: 6px; }
.scale-sheet { display: flex; flex-wrap: wrap; gap: 6mm; margin-top: 16px; overflow-x: auto; background: #fff; padding: 6mm; border-radius: 12px; }
img.scale-card-img { width: 85mm; height: 55mm; max-width: none; flex: none; display: block; }
@media print {
  @page { margin: 12mm; }
  .scale-help, .sub { display: none !important; }
  .scale-print-note { border: 1px solid #000; background: #fff; font-size: 12pt; }
  .scale-sheet { padding: 0; gap: 6mm; margin-top: 6mm; overflow: visible; }
  img.scale-card-img { break-inside: avoid; }
}
