:root {
  color-scheme: light;
  --cp-bg: #f7f4ef;
  --cp-bg-elevated: #fcfbf8;
  --cp-surface: #ffffff;
  --cp-surface-soft: #f5f5f5;
  --cp-border: #dedede;
  --cp-border-strong: #919191;
  --cp-text: #242424;
  --cp-text-muted: #5c5c5c;
  --cp-text-soft: #6f6f6f;
  --cp-accent: #b11f4b;
  --cp-accent-hover: #9a1a41;
  --cp-accent-soft: rgba(177, 31, 75, 0.08);
  --cp-accent-fg: #ffffff;
  --cp-success: #16a34a;
  --cp-danger: #dc2626;
  --cp-warning: #f59e0b;
  --cp-link: #0078d4;
  --cp-shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
  --cp-overlay: rgba(255, 255, 255, 0.8);
  --cp-panel: rgba(255, 255, 255, 0.86);
  --cp-panel-strong: rgba(255, 255, 255, 0.96);
  --cp-sheen: rgba(255, 255, 255, 0.55);
  --cp-highlight: rgba(177, 31, 75, 0.12);
  --hc-1: #b11f4b; --hc-2: #2f6f4f; --hc-3: #b26a00; --hc-4: #3b5b92;
  --hc-5: #7a4b8c; --hc-6: #8a6d3b; --hc-7: #0f766e; --hc-8: #6b7280;
  --tabbar-h: 60px;
}
html[data-theme="dark"] {
  /* Matches the BN Metro Dashboard palette */
  color-scheme: dark;
  --cp-bg: #1a1d23;
  --cp-bg-elevated: #22262e;
  --cp-surface: #2a2e37;
  --cp-surface-soft: #22262e;
  --cp-border: #3a3f4a;
  --cp-border-strong: #6b7280;
  --cp-text: #f0f0f0;
  --cp-text-muted: #a0a8b4;
  --cp-text-soft: #a0a8b4;
  --cp-accent: #0078d4;
  --cp-accent-hover: #2b88d8;
  --cp-accent-soft: rgba(0, 120, 212, 0.18);
  --cp-accent-fg: #ffffff;
  --cp-success: #10b981;
  --cp-danger: #ef4444;
  --cp-warning: #f59e0b;
  --cp-link: #2b88d8;
  --cp-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --cp-overlay: rgba(0, 0, 0, 0.6);
  --cp-panel: rgba(42, 46, 55, 0.86);
  --cp-panel-strong: rgba(42, 46, 55, 0.96);
  --cp-sheen: rgba(255, 255, 255, 0.04);
  --cp-highlight: rgba(0, 120, 212, 0.3);
  --hc-1: #f472b6; --hc-2: #34d399; --hc-3: #fbbf24; --hc-4: #60a5fa;
  --hc-5: #c084fc; --hc-6: #fb923c; --hc-7: #2dd4bf; --hc-8: #a0a8b4;
}
html[data-theme="dark"] .card { border: 1px solid var(--cp-border); box-shadow: none; }
html[data-theme="dark"] table.res tbody tr:hover { background: #333843; }
html[data-theme="dark"] table.res th, html[data-theme="dark"] table.dogs th, html[data-theme="dark"] table.plain th { color: #6b7280; text-transform: uppercase; letter-spacing: .5px; font-size: 11px; }
html[data-theme="dark"] tr.changed td.new { color: var(--cp-link); }
html[data-theme="dark"] .tag.chg { color: var(--cp-link); border-color: var(--cp-link); }
html[data-theme="dark"] table.matrix td.no, html[data-theme="dark"] .msg.err, html[data-theme="dark"] input.bad { background: rgba(239, 68, 68, 0.15); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cp-bg); color: var(--cp-text);
  font-family: "Segoe UI", Aptos, Calibri, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px; line-height: 1.4;
}
.mono { font-family: Consolas, "Courier New", Courier, monospace; }
header {
  padding: 20px 24px 12px; display: flex; flex-wrap: wrap; gap: 12px;
  align-items: flex-end; justify-content: space-between;
}
.hright { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
h1 { margin: 0; font-size: 22px; }
h2 { margin: 0 0 4px; font-size: 16px; }
h3 { margin: 16px 0 6px; font-size: 14px; }
.sub { color: var(--cp-text-muted); margin-top: 2px; }
main { padding: 0 24px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 1400px; }
main > section { min-width: 0; }
.card {
  background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: 16px;
  padding: 16px; box-shadow: 0 0 2px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.14);
}
.card-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.muted { color: var(--cp-text-muted); }
.soft { color: var(--cp-text-soft); font-size: 12px; }
button {
  font: inherit; border: 1px solid var(--cp-border-strong); background: var(--cp-surface);
  color: var(--cp-text); border-radius: 0.625rem; padding: 6px 12px; cursor: pointer;
}
button:hover { background: var(--cp-surface-soft); }
button.primary { background: var(--cp-accent); border-color: var(--cp-accent); color: var(--cp-accent-fg); font-weight: 600; }
button.primary:hover { background: var(--cp-accent-hover); }
button.danger { border-color: var(--cp-danger); color: var(--cp-danger); }
button.big { padding: 10px 22px; font-size: 15px; }
button.icon { border: none; background: transparent; padding: 4px 8px; color: var(--cp-text-muted); }
button.icon:hover { color: var(--cp-danger); background: transparent; }
button.link { border: none; background: transparent; padding: 0; color: var(--cp-link); text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea {
  font: inherit; color: var(--cp-text); background: var(--cp-bg-elevated);
  border: 1px solid var(--cp-border); border-radius: 0.625rem; padding: 5px 8px;
}
input:disabled, select:disabled { opacity: .85; background: transparent; border-color: transparent; color: var(--cp-text); -webkit-text-fill-color: var(--cp-text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cp-accent); outline-offset: -1px; }
input.bad { border-color: var(--cp-danger); background: var(--cp-accent-soft); }
input.need { border-color: var(--cp-warning); border-width: 2px; }
input.need:disabled { border-color: var(--cp-warning); border-style: dashed; }
input.need::placeholder { color: var(--cp-warning); font-weight: 700; opacity: 1; }
textarea { width: 100%; min-height: 110px; font-family: Consolas, "Courier New", Courier, monospace; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hunters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 12px; }
.hunter { border: 1px solid var(--cp-border); border-left: 5px solid var(--hc); border-radius: 0.625rem; padding: 10px; background: var(--cp-bg-elevated); }
.hunter.locked { background: var(--cp-surface-soft); }
.hunter.ro { background: var(--cp-surface-soft); }
.hunter.mine { box-shadow: 0 0 0 1px var(--cp-accent) inset; }
.hunter-head { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.hunter-head .h-name { flex: 1; font-weight: 600; min-width: 120px; }
.own { font-size: 12px; border-radius: 999px; padding: 2px 10px; border: 1px solid var(--cp-border); color: var(--cp-text-muted); white-space: nowrap; }
.own.me { border-color: var(--cp-accent); color: var(--cp-accent); font-weight: 600; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--hc); flex: none; }
table { border-collapse: collapse; }
table.dogs { width: 100%; }
table.dogs th { text-align: left; font-weight: 500; font-size: 12px; color: var(--cp-text-muted); padding: 2px 4px; }
table.dogs td { padding: 2px 4px; }
table.dogs td input[type=text] { width: 100%; }
table.dogs td.idc { width: 76px; }
table.dogs td.codec { width: 112px; }
table.dogs td.act { width: 78px; text-align: center; }
button.toggle { font-size: 12px; padding: 3px 10px; border-radius: 999px; min-width: 68px; }
button.toggle.on { border-color: var(--cp-success); color: var(--cp-success); }
button.toggle.off { border-style: dashed; border-color: var(--cp-border-strong); color: var(--cp-text-soft); }
table.dogs tr.inactive td.dlabel { color: var(--cp-text-muted); }
table.res tr.inactive td { color: var(--cp-text-soft); }
.cell.idle { border: 1px dashed var(--hc); border-left-width: 1px; background: transparent; opacity: .6; }
table.dogs td.dlabel { font-weight: 600; padding-left: 6px; white-space: nowrap; }
table.dogs td.lk, table.dogs td.del { width: 34px; text-align: center; }
label.chk { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; font-size: 13px; }
.groups { display: grid; gap: 10px; }
.group { border: 1px solid var(--cp-border); border-radius: 0.625rem; padding: 10px; background: var(--cp-bg-elevated); }
.group .g-name { flex: 1; min-width: 160px; font-weight: 600; }
.pill { display: inline-flex; gap: 5px; align-items: center; border: 1px solid var(--cp-border); border-radius: 999px; padding: 3px 10px; margin: 6px 6px 0 0; background: var(--cp-surface); cursor: pointer; }
.pill .dot { width: 9px; height: 9px; }
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 24px; }
.setting { display: grid; gap: 4px; }
.setting .lbl { font-weight: 600; }
.runbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.progress { flex: 1; min-width: 160px; height: 8px; background: var(--cp-surface-soft); border-radius: 999px; overflow: hidden; border: 1px solid var(--cp-border); }
.progress > div { height: 100%; width: 0; background: var(--cp-accent); transition: width .1s; }
.msg { border-radius: 0.625rem; padding: 8px 12px; margin: 6px 0; border: 1px solid var(--cp-border); }
.msg.err { border-color: var(--cp-danger); color: var(--cp-danger); background: var(--cp-accent-soft); }
.msg.warn { border-color: var(--cp-warning); }
.msg.ok { border-color: var(--cp-success); }
.msg.info { border-color: var(--cp-link); }
.stale { border: 1px dashed var(--cp-warning); padding: 6px 10px; border-radius: 0.625rem; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.chip { border: 1px solid var(--cp-border); border-radius: 999px; padding: 4px 12px; background: var(--cp-bg-elevated); }
.chip.good { border-color: var(--cp-success); }
.chip.bad { border-color: var(--cp-danger); color: var(--cp-danger); }
.chip.warn { border-color: var(--cp-warning); }
.good-t { color: var(--cp-success); font-weight: 600; }
.bad-t { color: var(--cp-danger); font-weight: 600; }
.warn-t { color: var(--cp-warning); font-weight: 600; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.res { width: 100%; }
table.res th, table.res td { border-bottom: 1px solid var(--cp-border); padding: 5px 8px; text-align: left; }
table.res th { font-weight: 600; font-size: 12px; color: var(--cp-text-muted); }
tr.changed td.new { color: var(--cp-accent); font-weight: 700; }
td.idv { font-family: Consolas, "Courier New", Courier, monospace; white-space: nowrap; }
.tag { font-size: 11px; border-radius: 999px; padding: 1px 8px; border: 1px solid var(--cp-border); color: var(--cp-text-muted); white-space: nowrap; }
.tag.chg { border-color: var(--cp-accent); color: var(--cp-accent); }
.tag.admin { border-color: var(--cp-accent); color: var(--cp-accent); }
table.matrix th, table.matrix td { border: 1px solid var(--cp-border); padding: 5px 8px; text-align: center; min-width: 44px; }
table.matrix th { font-weight: 600; font-size: 12px; }
table.matrix td.ok { color: var(--cp-success); font-weight: 700; }
table.matrix td.no { color: var(--cp-danger); font-weight: 700; background: var(--cp-accent-soft); }
table.matrix td.diag { color: var(--cp-text-soft); background: var(--cp-surface-soft); }
table.grid th, table.grid td { border: 1px solid var(--cp-border); padding: 2px; text-align: center; font-size: 11px; }
table.grid th { color: var(--cp-text-muted); font-weight: 600; min-width: 46px; }
table.grid td { min-width: 46px; height: 36px; vertical-align: middle; }
.cell { border-radius: 6px; padding: 2px 3px; line-height: 1.15; border-left: 3px solid var(--hc); background: color-mix(in srgb, var(--hc) 18%, transparent); margin: 1px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 92px; }
td.dup { outline: 2px solid var(--cp-danger); outline-offset: -2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0; font-size: 12px; }
.legend span { display: inline-flex; gap: 5px; align-items: center; }
ul.tight { margin: 4px 0; padding-left: 20px; }
.hidden { display: none !important; }
html.native [data-web-only] { display: none !important; }
details summary { cursor: pointer; font-weight: 600; }
.collapse-btn { border: none; background: transparent; padding: 0; font: inherit; font-weight: inherit; color: inherit; cursor: pointer; text-align: left; }
.collapse-btn:hover { background: transparent; color: var(--cp-accent); }
.collapse-btn .caret { display: inline-block; width: 1em; transition: transform .15s; }
#groupsCard.collapsed .collapsible { display: none !important; }
#groupsCard.collapsed .caret { transform: rotate(-90deg); }
#groupsCard.collapsed .card-head { margin-bottom: 0; }
.seg { display: inline-flex; border: 1px solid var(--cp-border-strong); border-radius: 0.625rem; overflow: hidden; }
.seg button { border: none; border-radius: 0; padding: 5px 12px; background: transparent; }
.seg button.on { background: var(--cp-accent); color: var(--cp-accent-fg); font-weight: 600; }

/* header: sync pill + menu */
.syncpill { border-radius: 999px; font-size: 12px; padding: 4px 12px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.syncpill.s-synced { border-color: var(--cp-success); }
.syncpill.s-syncing, .syncpill.s-connecting { border-color: var(--cp-link); }
.syncpill.s-offline { border-color: var(--cp-warning); }
.syncpill.s-error, .syncpill.s-removed { border-color: var(--cp-danger); color: var(--cp-danger); }
.hmenu { position: relative; }
.hmenu > summary { list-style: none; border: 1px solid var(--cp-border-strong); border-radius: 0.625rem; padding: 6px 12px; font-weight: 400; background: var(--cp-surface); }
.hmenu > summary::-webkit-details-marker { display: none; }
.hmenu-items { display: flex; flex-wrap: wrap; gap: 8px; }

/* club card */
.club-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 10px; }
.club-form { border: 1px solid var(--cp-border); border-radius: 0.625rem; padding: 12px; background: var(--cp-bg-elevated); display: grid; gap: 8px; align-content: start; }
.club-form h3 { margin: 0; }
.club-form input[type=text] { width: 100%; }
.field { display: grid; gap: 4px; font-size: 13px; }
.field > span { font-weight: 600; }
/* kill log */
.kill-form { border: 1px solid var(--cp-border-strong); border-radius: 0.625rem; padding: 12px; margin: 10px 0 14px; background: var(--cp-bg-elevated); display: grid; gap: 12px; }
.kill-form h3 { margin: 0; }
.kill-form input[type=text], .kill-form input[type=date], .kill-form input[type=time], .kill-form select, .kill-form textarea { width: 100%; font-size: 16px; padding: 8px 10px; box-sizing: border-box; }
.kill-form textarea { resize: vertical; font-family: inherit; }
.kf-static { font-size: 15px; padding: 4px 0; }
.kf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kf-dogs { display: flex; flex-wrap: wrap; gap: 6px; }
.kf-dog { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--cp-border); border-radius: 999px; padding: 5px 12px 5px 8px; cursor: pointer; font-size: 14px; font-weight: 400; min-height: 34px; }
.kf-dog input { width: 18px; height: 18px; margin: 0; accent-color: var(--cp-accent); }
.kf-dog.on { border-color: var(--cp-accent); background: var(--cp-accent-soft); }
.kf-pack { margin: 2px 0 8px; display: grid; gap: 4px; }
.kv-seg { margin-bottom: 12px; }
.kv-seg button { padding: 7px 16px; }
.ms-fines td, .ms-fines th { white-space: nowrap; }
.ms-settings { margin-top: 16px; border: 1px solid var(--cp-border); border-radius: 0.625rem; padding: 10px 12px; background: var(--cp-bg-elevated); }
.kf-addpack { border-style: dashed; border-radius: 999px; font-size: 14px; padding: 5px 12px; }
.kf-hint { font-weight: 400; margin-top: 2px; }
.kf-sex { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.kf-sex .seg button { padding: 8px 18px; font-size: 15px; }
.kf-points { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.kf-points input { width: 70px; font-size: 16px; padding: 7px 8px; }
.kf-btns { gap: 8px; }
.kill-range { margin: 8px 0 4px; }
.kill-range select { padding: 7px 10px; font-size: 14px; }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 4px 24px; }
.lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lb-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; overflow: hidden; border: 1px solid var(--cp-border); background: var(--cp-bg-elevated); }
.lb-bar { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--hc) 16%, transparent); z-index: 0; }
.lb-row > :not(.lb-bar) { position: relative; z-index: 1; }
.lb-rank { width: 26px; text-align: center; font-weight: 700; flex: none; }
.lb-name { flex: 1; min-width: 0; font-weight: 600; }
.lb-name .soft { font-weight: 400; font-size: 12px; }
.lb-n { font-weight: 800; font-size: 18px; flex: none; }
.kill-list { display: grid; gap: 8px; }
.kill-item { border: 1px solid var(--cp-border); border-left: 5px solid var(--hc); border-radius: 0.625rem; padding: 8px 12px; background: var(--cp-bg-elevated); display: grid; gap: 2px; }
.ki-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ki-block { border: 1px solid var(--cp-border); border-radius: 999px; padding: 1px 9px; font-size: 12px; color: var(--cp-text-muted); }
.ki-edit { margin-left: auto; padding: 3px 12px; font-size: 13px; }
.ki-notes { font-size: 13px; color: var(--cp-text-muted); font-style: italic; }
.ks-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; margin: 10px 0 6px; }
.ks-tile { border: 1px solid var(--cp-border); border-radius: 0.625rem; padding: 8px 10px; background: var(--cp-bg-elevated); min-width: 0; }
.ks-tile .v { font-size: 22px; font-weight: 800; line-height: 1.15; white-space: nowrap; }
.ks-tile .l { font-size: 12px; color: var(--cp-text-muted); font-weight: 600; }
.ks-tile .s { font-size: 11px; color: var(--cp-text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ks-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 6px 28px; }
.ks-charts h4, #killsBody h4 { margin: 10px 0 6px; font-size: 14px; }
.kc { display: flex; align-items: stretch; gap: 6px; height: 140px; }
.kc-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.kc-n { font-size: 12px; font-weight: 700; height: 16px; line-height: 16px; }
.kc-bar { flex: 1; width: 100%; max-width: 36px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 6px 6px 2px 2px; overflow: hidden; background: var(--cp-surface-soft); }
.kc-b { display: block; background: var(--cp-accent); }
.kc-d { display: block; background: color-mix(in srgb, var(--cp-accent) 38%, var(--cp-bg-elevated)); }
.kc-l { font-size: 11px; color: var(--cp-text-muted); margin-top: 4px; white-space: nowrap; }
.kc-key, .kc-note { font-size: 12px; color: var(--cp-text-muted); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.kc-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.kc-key i.kb { background: var(--cp-accent); }
.kc-key i.kd { background: color-mix(in srgb, var(--cp-accent) 38%, var(--cp-bg-elevated)); }
.ks-seasons td, .ks-seasons th { white-space: nowrap; }
.share-req b { font-weight: 700; }
.club-grid { display: grid; gap: 8px; margin: 8px 0; }
.codebox { font-family: Consolas, "Courier New", Courier, monospace; font-size: 20px; letter-spacing: 2px; font-weight: 700; }
.newcodes { border: 2px solid var(--cp-warning); border-radius: 0.625rem; padding: 12px; margin: 8px 0; }
table.plain { width: 100%; }
/* Today's hunt */
.today-h { border: 1px solid var(--cp-border); border-left: 5px solid var(--hc); border-radius: 0.625rem; padding: 6px 10px; margin: 6px 0; background: var(--cp-bg-elevated); }
.today-h > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; padding: 4px 0; list-style: none; }
.today-h > summary::-webkit-details-marker { display: none; }
.today-h > summary::after { content: '▾'; color: var(--cp-text-muted); }
.today-h:not([open]) > summary::after { content: '▸'; }
.today-dogs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; margin: 6px 0 4px; }
.today-dog { display: flex; align-items: center; gap: 6px; border: 1px solid var(--cp-border); border-radius: 8px; padding: 4px 6px 4px 10px; min-height: 44px; }
.today-dog .td-pick { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; flex: none; min-height: 36px; }
.today-dog input[type=checkbox] { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--hc); }
.today-dog .td-c { white-space: nowrap; }
.today-dog .mono { color: var(--cp-text-muted); font-size: 12px; min-width: 34px; }
.today-dog .td-name { flex: 1; min-width: 0; padding: 6px 8px; font-size: 14px; }
.today-dog.on { border-color: var(--hc); background: color-mix(in srgb, var(--hc) 16%, transparent); }
.today-dog.off-dog:not(.on) .td-pick { opacity: .55; }
.today-go { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0; }
.today-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--cp-border); border-left: 5px solid var(--hc); border-radius: 0.625rem; background: var(--cp-bg-elevated); }
.today-quick .tq-text { flex: 1 1 220px; }
.today-quick .soft { font-size: 13px; margin-top: 2px; }
.today-list .tl-edit { margin-left: auto; padding: 3px 12px; font-size: 13px; }
.today-edit-h { margin-top: 18px; }
.today-add { margin: 8px 0 4px; }
.today-add select { width: 100%; max-width: 360px; padding: 9px 10px; }
.today-go .soft { flex: 1 1 200px; font-size: 13px; }
.pet { font-size: 12px; font-weight: 600; color: var(--cp-text-muted); line-height: 1.2; }
.pet::before { content: '🐕 '; }
.today-list { border-left: 4px solid var(--hc); padding-left: 10px; margin: 10px 0 14px; }
.today-list .tl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.today-list .idv { font-family: ui-monospace, Consolas, monospace; white-space: nowrap; }
.tag.bad { border-color: var(--cp-danger); color: var(--cp-danger); }
.tag.warn { border-color: var(--cp-warning); color: var(--cp-warning); }
.badge.info { background: var(--cp-accent); color: #fff; }
table.plain th, table.plain td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--cp-border); vertical-align: middle; }
table.plain th { font-weight: 600; font-size: 12px; color: var(--cp-text-muted); }
.club-compact { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.trackwarn { font-size: 12px; color: var(--cp-text-muted); border-left: 3px solid var(--cp-warning); padding: 2px 8px; margin: 8px 0 0; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; visibility: hidden; pointer-events: none; background: var(--cp-surface); color: var(--cp-text); border: 1px solid var(--cp-border-strong); padding: 10px 16px; border-radius: 12px; box-shadow: var(--cp-shadow); z-index: 3000; transition: transform .25s ease, opacity .25s ease, visibility 0s linear .25s; max-width: min(560px, 92vw); font-size: 14px; }
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; pointer-events: auto; transition: transform .25s ease, opacity .25s ease, visibility 0s; }

/* bottom tab bar (phones) */
#tabbar { display: none; }

#roster { display: none; }
.roster-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--cp-text); padding-bottom: 4px; margin-bottom: 10px; }
.roster-head h1 { font-size: 18px; }
.roster-grid { columns: 3 200px; column-gap: 14px; }
.roster-hunter { break-inside: avoid; page-break-inside: avoid; margin: 0 0 12px; display: inline-block; width: 100%; }
.roster-hunter h2 { font-size: 13px; margin: 0 0 3px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--cp-border-strong); padding-bottom: 2px; }
.roster-hunter h2 span { font-weight: 400; font-size: 11px; color: var(--cp-text-muted); }
.roster-hunter table { width: 100%; font-size: 11px; }
.roster-hunter th { text-align: left; font-weight: 600; color: var(--cp-text-muted); padding: 1px 3px; border-bottom: 1px solid var(--cp-border); }
.roster-hunter td { padding: 1px 3px; border-bottom: 1px solid var(--cp-border); white-space: nowrap; }
.roster-hunter td.note { white-space: normal; font-size: 10px; color: var(--cp-text-muted); }
.roster-hunter td.mono { font-family: Consolas, "Courier New", Courier, monospace; }
.roster-hunter td.st-off { font-weight: 600; }

@media (min-width: 761px) {
  .hmenu > summary { display: none; }
}

@media (max-width: 760px) {
  body { font-size: 15px; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  header { padding: calc(10px + env(safe-area-inset-top)) 12px 8px; align-items: center; flex-wrap: nowrap; }
  header .title { min-width: 0; }
  h1 { font-size: 18px; white-space: nowrap; }
  .sub { display: none; }
  main { padding: 0 8px 16px; gap: 10px; }
  .card { padding: 12px; border-radius: 12px; }
  input, select, textarea { font-size: 16px; }
  button { padding: 8px 12px; }
  button.icon { padding: 6px 6px; }
  .hright { flex-wrap: nowrap; }
  .syncpill { max-width: 46vw; }
  .hmenu-items { display: grid; position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; background: var(--cp-surface); border: 1px solid var(--cp-border-strong); border-radius: 12px; padding: 8px; box-shadow: var(--cp-shadow); min-width: 200px; }
  .hmenu-items button { text-align: left; }

  main > section[data-tab] { display: none; }
  body[data-tab="collars"] main > section[data-tab~="collars"],
  body[data-tab="today"] main > section[data-tab~="today"],
  body[data-tab="board"] main > section[data-tab~="board"],
  body[data-tab="kills"] main > section[data-tab~="kills"],
  body[data-tab="plan"] main > section[data-tab~="plan"],
  body[data-tab="club"] main > section[data-tab~="club"] { display: block; }

  #tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--cp-surface); border-top: 1px solid var(--cp-border); padding-bottom: env(safe-area-inset-bottom); }
  #tabbar button { flex: 1; border: none; border-radius: 0; background: transparent; padding: 7px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; color: var(--cp-text-muted); position: relative; min-height: var(--tabbar-h); }
  #tabbar button.on { color: var(--cp-accent); font-weight: 700; }
  #tabbar .ti { font-size: 20px; line-height: 1.15; }
  #tabbar .badge { position: absolute; top: 4px; left: calc(50% + 8px); background: var(--cp-warning); color: #000; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 0 5px; min-width: 16px; }
  #tabbar .badge.info { background: var(--cp-accent); color: #fff; }
  .today-dogs { grid-template-columns: 1fr; }
  .today-go button, .today-quick button { flex: 1 1 100%; }
  #toast { bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); }

  .hunters { grid-template-columns: 1fr; gap: 10px; }
  .hunter { padding: 8px 6px 8px 8px; }
  table.dogs td { padding: 2px 2px; }
  table.dogs th { padding: 2px 2px; font-size: 11px; }
  table.dogs td.dlabel { padding-left: 2px; font-size: 13px; white-space: nowrap; }
  table.dogs td.idc { width: 56px; }
  table.dogs td.codec { width: 102px; }
  table.dogs td.codec input { letter-spacing: -0.06em; padding-left: 3px; padding-right: 3px; }
  table.dogs td.lk { width: 24px; }
  table.dogs td.del { width: 22px; }
  table.dogs td.act { width: 56px; }
  table.dogs td input[type=text] { padding: 6px 4px; }
  button.toggle { min-width: 0; width: 100%; padding: 5px 2px; font-size: 11px; }
  .runbar .big { flex: 1 1 140px; }
  .card-head > .row { width: 100%; }
  .card-head > .row > button { flex: 1; }
  #resultBtns > button { flex: 1 1 auto; padding: 8px 10px; }
  #resultBtns > button.primary { flex-basis: 100%; }
  table.res td, table.res th { white-space: nowrap; }
  .desc { display: none; }
}

@media print {
  html, html[data-theme="dark"] {
    --cp-bg: #ffffff; --cp-bg-elevated: #ffffff; --cp-surface: #ffffff; --cp-surface-soft: #f3f3f3;
    --cp-border: #cfcfcf; --cp-border-strong: #777777; --cp-text: #000000; --cp-text-muted: #444444; --cp-text-soft: #555555;
    --cp-accent: #000000; --cp-link: #000000; --cp-accent-soft: #f3f3f3; --cp-highlight: #eeeeee;
  }
  @page { margin: 0.4in; }
  body { padding: 0 !important; background: white; }
  body.print-roster header, body.print-roster main { display: none !important; }
  body.print-roster #roster { display: block; }
  main > section[data-tab] { display: block !important; }
  main > section[data-tab].hidden { display: none !important; }
  .no-print, #tabbar, #toast { display: none !important; }
  .chip.grp { display: none !important; }
  .card { box-shadow: none; }
}

.fb-form { display: grid; gap: 8px; max-width: 560px; }
.fb-form .seg { justify-self: start; }
textarea.fb-text { font-family: inherit; min-height: 120px; resize: vertical; }

.push-prefs { display: grid; gap: 6px; margin: 4px 0 2px; }
.push-prefs .chk { font-size: 14px; }

.kf-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.kp-wrap { position: relative; }
.kp { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; border: 1px solid var(--cp-border); background: var(--cp-surface-soft); display: block; }
.kp-missing { opacity: .35; }
.kp-x { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; padding: 0; font-size: 13px; line-height: 1; background: var(--cp-surface); }
.kp-add { width: 88px; height: 88px; border: 2px dashed var(--cp-border-strong); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; font-size: 26px; color: var(--cp-text-muted); }
.kp-add span { font-size: 11px; font-weight: 600; }
.ki-photos { display: flex; gap: 6px; margin-top: 6px; }
.ki-photos .kp { width: 72px; height: 72px; cursor: zoom-in; }
#lightbox { position: fixed; inset: 0; z-index: 4000; background: rgba(0,0,0,.88); display: none; align-items: center; justify-content: center; padding: 16px; }
#lightbox.on { display: flex; }
#lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
#lightbox .lb-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; padding: 0; }
#lightbox .lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; }

/* message board */
.bd-rules, .bd-compose { border: 1px solid var(--cp-border); border-radius: 0.625rem; padding: 10px 12px; background: var(--cp-bg-elevated); display: grid; gap: 8px; margin: 10px 0 14px; }
.bd-rules button { justify-self: start; }
.bd-compose textarea, .bd-edit textarea, .bd-reply textarea { font-family: inherit; min-height: 0; resize: vertical; box-sizing: border-box; width: 100%; padding: 8px 10px; }
.btn-like { font: inherit; border: 1px solid var(--cp-border-strong); background: var(--cp-surface); color: var(--cp-text); border-radius: 0.625rem; padding: 6px 12px; cursor: pointer; }
.bd-photos { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.bd-post { border: 1px solid var(--cp-border); border-radius: 0.625rem; padding: 10px 12px; background: var(--cp-surface); margin-bottom: 10px; display: grid; gap: 6px; }
.bd-post.pinned { border-color: var(--cp-accent); background: var(--cp-accent-soft); }
.bd-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bd-body { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.bd-pics { flex-wrap: wrap; }
.bd-pics .kp { width: 110px; height: 110px; }
.bd-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.bd-chip { border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.bd-chip.on, .bd-picker button.on { border-color: var(--cp-accent); background: var(--cp-accent-soft); }
.bd-picker { display: flex; gap: 4px; flex-wrap: wrap; }
.bd-picker button { font-size: 20px; padding: 2px 8px; border-radius: 999px; }
.bd-seen summary { cursor: pointer; }
.bd-menu { margin-left: auto; position: relative; }
.bd-menu summary { list-style: none; cursor: pointer; padding: 0 8px; font-size: 18px; line-height: 1; color: var(--cp-text-muted); }
.bd-menu summary::-webkit-details-marker { display: none; }
.bd-menu-list { position: absolute; right: 0; top: 22px; z-index: 20; background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: 0.625rem; box-shadow: var(--cp-shadow); display: grid; min-width: 190px; padding: 4px; }
.bd-menu-list button { border: none; text-align: left; padding: 8px 10px; }
.bd-comments { border-top: 1px solid var(--cp-border); padding-top: 6px; display: grid; gap: 8px; }
.bd-comment { padding-left: 10px; border-left: 3px solid var(--cp-border); display: grid; gap: 2px; }
.bd-reply { display: flex; gap: 6px; align-items: flex-end; }
.bd-edit { display: grid; gap: 6px; }
.bd-reports { border: 1px solid var(--cp-danger); border-radius: 0.625rem; padding: 4px 12px 10px; margin: 10px 0; }
.bd-report { display: grid; gap: 4px; padding: 6px 0; border-top: 1px solid var(--cp-border); }
.bd-report:first-of-type { border-top: none; }
.bd-quote { padding: 4px 8px; border-left: 3px solid var(--cp-border-strong); overflow-wrap: anywhere; }
.bd-top { flex-wrap: nowrap; align-items: flex-start; }
.bd-refresh { flex: none; }
.plan-line { margin: 6px 0 2px; }

/* how-to tour and guide */
#helpBox { position: fixed; inset: 0; z-index: 3000; background: var(--cp-overlay); display: none; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
#helpBox.on { display: flex; }
.help-card { background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: 16px; box-shadow: var(--cp-shadow); padding: 18px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; box-sizing: border-box; }
.help-card.tour { text-align: center; }
.tour-icon { font-size: 52px; line-height: 1.1; }
.help-card.tour h2 { margin: 8px 0 6px; }
.help-card.tour p { line-height: 1.5; margin: 0 0 12px; }
.tour-dots { display: flex; gap: 6px; justify-content: center; margin: 4px 0 14px; }
.tour-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--cp-border-strong); opacity: .5; }
.tour-dots span.on { background: var(--cp-accent); opacity: 1; }
.tour-btns { justify-content: center; }
.help-card.guide details { border-top: 1px solid var(--cp-border); padding: 8px 0; }
.help-card.guide summary { font-weight: 700; cursor: pointer; }
.help-body { line-height: 1.5; }
.help-body p { margin: 8px 0; }
/* Garmin's 9-digit track codes on the narrowest phones (these are Android; iPhones are 375px+ and keep 16px so they don't zoom). */
@media (max-width: 370px) { table.dogs td.codec { width: 90px; } table.dogs td.codec input { font-size: 14px; } }
