/* BugOutBot v2 — Compass & sun clock, Lookalikes, Knot animations.
   Uses theme tokens only, so day / night / red all work. */

/* ---------- shared ---------- */
.ka-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ka-jump .action-btn { padding: 6px 11px; font-size: 12px; }
.tools-item .ico.is-sprite { display: flex; align-items: center; justify-content: center; }
.tools-item .ico.is-sprite .need-svg { display: block; width: 32px; height: 32px; shape-rendering: crispEdges; image-rendering: pixelated; }

/* ---------- Knot animations ---------- */
.ka-card { --kr-plate: #f6f1e6; --kr-case: #3a2a18; --kr-a: #d9893b; --kr-b: #4f8fd6; --kr-main: #6a9e5e;
  --kr-hi: rgba(255,255,255,.38); --kr-whip: #2a1c10; --kr-obj: #8a6a48; --kr-obj-hi: rgba(255,255,255,.22);
  --kr-hint: #d0442a; --kr-label: #3a3428; }
[data-theme="night"] .ka-card { --kr-plate: #10140f; --kr-case: #050604; --kr-a: #d98a40; --kr-b: #5b95d8;
  --kr-main: #5f8f55; --kr-hi: rgba(255,255,255,.22); --kr-whip: #f0e6d0; --kr-obj: #6b5238; --kr-obj-hi: rgba(255,255,255,.12);
  --kr-hint: #ff8a52; --kr-label: #c9c2b0; }
[data-theme="red"] .ka-card { --kr-plate: #120300; --kr-case: #000; --kr-a: #ff6b2b; --kr-b: #b8321a;
  --kr-main: #6e1a08; --kr-hi: rgba(255,160,120,.25); --kr-whip: #ffb08a; --kr-obj: #4a1406; --kr-obj-hi: rgba(255,120,60,.15);
  --kr-hint: #ffb08a; --kr-label: #ff8a52; }
.ka-use { margin: 2px 0 10px; font-size: 13px; line-height: 1.4; color: var(--ui-sub); }
.ka-use strong { color: var(--bob-ink); }
.ka-player { border: 1px solid var(--ui-hairline-strong); border-radius: var(--ui-r); overflow: hidden; background: var(--kr-plate); }
.ka-stage { touch-action: pan-y; }
.knot-svg { display: block; width: 100%; height: auto; }
.kr-plate { fill: var(--kr-plate); }
.kr-case { stroke: var(--kr-case); fill: none; }
.kr-fill { fill: none; }
.kr-c-a { stroke: var(--kr-a); }
.kr-c-b { stroke: var(--kr-b); }
.kr-c-main { stroke: var(--kr-main); }
.kr-hi { stroke: var(--kr-hi); fill: none; }
.kr-whip { stroke: var(--kr-whip); fill: none; }
.kr-obj rect, .kr-obj circle { fill: var(--kr-obj); stroke: var(--kr-case); stroke-width: 1.5; }
.kr-obj .kr-obj-hi { fill: var(--kr-obj-hi); stroke: none; }
.kr-ring-case { fill: none; stroke: var(--kr-case); }
.kr-ring-fill { fill: none; stroke: #9aa3a8; }
[data-theme="red"] .kr-ring-fill { stroke: #5a1a0a; }
.ka-cat { margin-top: 18px; }
.ka-cat-title { font-size: 18px; font-weight: 800; margin: 0 0 2px; color: var(--ui-title); }
.ka-cat-lead { margin: 0 0 6px; font-size: 13px; color: var(--ui-sub); }
.ka-jump-group { margin-top: 8px; }
.ka-jump-label { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-sub); margin: 0 0 4px; }
.ka-safety { margin: 6px 0 10px; padding: 8px 10px; border-radius: var(--ui-r-tile); font-size: 13px; line-height: 1.4;
  background: var(--ui-tile-neutral); border-left: 4px solid var(--kr-hint); color: var(--ui-title); }
.ka-safety.is-rescue { border-left-color: #c0392b; font-weight: 700; }
.ka-steps { margin: 8px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.45; color: var(--ui-title); }
.kr-hint-line { stroke: var(--kr-hint); stroke-width: 2.6; stroke-dasharray: 6 4; fill: none; stroke-linecap: round; }
.kr-hint-head { fill: var(--kr-hint); }
.kr-label { font: 700 11px/1 system-ui, sans-serif; fill: var(--kr-label); }
.ka-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 0;
  background: var(--ui-surface); border-top: 1px solid var(--ui-hairline); }
.ka-count { font-size: 12px; font-weight: 800; color: var(--ui-sub); font-variant-numeric: tabular-nums; }
.ka-dots { display: flex; gap: 6px; }
.ka-dot { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: var(--ui-hairline-strong); cursor: pointer; }
.ka-dot.is-on { background: var(--bob-accent); }
.ka-cap { margin: 0; padding: 6px 12px 10px; min-height: 3.2em; font-size: 14px; line-height: 1.4; font-weight: 600;
  background: var(--ui-surface); color: var(--ui-title); }
.ka-controls { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 8px; padding: 0 10px 10px; background: var(--ui-surface); }
.ka-btn { min-height: 44px; border-radius: var(--ui-r-tile); border: 1px solid var(--ui-hairline-strong);
  background: var(--ui-tile-neutral); color: var(--ui-title); font-weight: 800; font-size: 14px; cursor: pointer; }
.ka-btn:disabled { opacity: .45; }
.ka-btn:active { border-color: var(--bob-accent); }
.ka-play { background: var(--bob-accent); border-color: transparent; color: #fff; }
[data-theme="red"] .ka-play { color: #160400; }
.ka-play.is-playing { background: var(--ui-tile-neutral); color: var(--ui-title); border-color: var(--bob-accent); }

/* ---------- Compass ---------- */
.cp-top { display: flex; align-items: center; gap: 14px; margin: 8px 0 10px; }
.cp-dial-wrap { flex: 0 0 auto; width: min(54vw, 210px); aspect-ratio: 1; border-radius: 50%;
  background: var(--ui-surface); box-shadow: var(--ui-elev); border: 1px solid var(--ui-hairline-strong); }
.cp-dial { display: block; width: 100%; height: 100%; }
.cp-bezel { fill: none; stroke: var(--ui-hairline-strong); stroke-width: 2; }
.cp-tick { stroke: var(--ui-sub); stroke-width: 1; }
.cp-tick.is-major { stroke: var(--ui-title); stroke-width: 2; }
.cp-num { font: 600 9px system-ui, sans-serif; fill: var(--ui-sub); text-anchor: middle; }
.cp-card { font: 900 17px system-ui, sans-serif; fill: var(--ui-title); text-anchor: middle; }
.cp-card.is-n { fill: #e8402a; }
.cp-needle-n { fill: #e8402a; }
.cp-needle-s { fill: var(--ui-sub); }
.cp-hub { fill: var(--ui-title); }
.cp-lubber { fill: var(--bob-accent); }
.cp-rose { transition: transform .15s linear; }
.cp-dial-wrap.is-idle .cp-needle-n, .cp-dial-wrap.is-idle .cp-needle-s { opacity: .35; }
[data-theme="red"] .cp-card.is-n, [data-theme="red"] .cp-needle-n { fill: #ff6b2b; }
.cp-read { min-width: 0; }
.cp-deg { font-size: 44px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ui-title); }
.cp-cardinal { margin-top: 6px; font-size: 15px; font-weight: 800; color: var(--ui-title); }
.cp-mag { margin-top: 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-sub); }
.cp-status { margin: 8px 0 0; font-size: 13px; color: var(--ui-sub); }
.cp-start { min-height: 44px; padding: 8px 18px; font-size: 14px; background: var(--bob-accent); color: #fff; border-color: transparent; }
[data-theme="red"] .cp-start { color: #160400; }

/* ---------- Sun clock ---------- */
.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.sc-chip { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--ui-hairline-strong);
  background: var(--ui-tile-neutral); color: var(--ui-title); font-weight: 700; font-size: 13px; cursor: pointer; }
.sc-chip.is-on { background: var(--bob-accent); border-color: transparent; color: #fff; }
[data-theme="red"] .sc-chip.is-on { color: #160400; }
.sc-big { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--ui-r-tile);
  background: var(--ui-surface); border: 1px solid var(--ui-hairline); box-shadow: var(--ui-elev); }
.sc-big strong { font-size: 22px; line-height: 1.15; font-weight: 900; color: var(--ui-title); }
.sc-big span { font-size: 13px; color: var(--ui-sub); line-height: 1.35; }
.sc-bar { position: relative; height: 10px; margin: 12px 2px; border-radius: 999px;
  background: linear-gradient(90deg, #2a3550, #f0a830 12%, #ffe07a 50%, #f0a830 88%, #2a3550); opacity: .9; }
[data-theme="red"] .sc-bar { background: linear-gradient(90deg, #2a0600, #b8321a 15%, #ff6b2b 50%, #b8321a 85%, #2a0600); }
.sc-bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: rgba(0,0,0,.35); }
.sc-bar-now { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px;
  background: var(--ui-title); box-shadow: 0 0 0 2px var(--bob-card); }
.sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-cell { display: flex; flex-direction: column; padding: 10px 12px; border-radius: var(--ui-r-tile);
  background: var(--ui-tile-neutral); border: 1px solid var(--ui-hairline); }
.sc-k { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ui-sub); }
.sc-v { font-size: 20px; font-weight: 900; color: var(--ui-title); font-variant-numeric: tabular-nums; }
.sc-sub { font-size: 11px; color: var(--ui-sub); }
.sc-where { margin: 10px 0 0; font-size: 12px; color: var(--ui-sub); }

/* ---------- Fist method ---------- */
.fm-fig { margin: 8px 0; border-radius: var(--ui-r-tile); overflow: hidden; border: 1px solid var(--ui-hairline); }
.fm-svg { display: block; width: 100%; height: auto; }
.fm-sky { fill: #cfe3f2; } .fm-ground { fill: #7c8f5a; } .fm-horizon { stroke: #3d4a2c; stroke-width: 2; }
.fm-sun { fill: #ffcf3a; stroke: #f0a020; stroke-width: 2; }
.fm-arm { fill: #d9a27a; stroke: #6b4428; stroke-width: 1.5; }
.fm-finger { fill: #e8b890; stroke: #6b4428; stroke-width: 1.5; }
.fm-num { font: 800 10px system-ui, sans-serif; fill: #1a1e18; }
.fm-lbl { font: 800 11px system-ui, sans-serif; fill: #1a1e18; }
[data-theme="night"] .fm-sky { fill: #1c2a38; } [data-theme="night"] .fm-ground { fill: #2c3a22; }
[data-theme="night"] .fm-num, [data-theme="night"] .fm-lbl { fill: #ece6d6; }
[data-theme="night"] .fm-horizon { stroke: #8a9a70; }
[data-theme="red"] .fm-sky { fill: #1a0500; } [data-theme="red"] .fm-ground { fill: #3a0c02; }
[data-theme="red"] .fm-sun { fill: #ff6b2b; stroke: #ff3b1a; }
[data-theme="red"] .fm-arm, [data-theme="red"] .fm-finger { fill: #6e1a08; stroke: #ff6b2b; }
[data-theme="red"] .fm-num, [data-theme="red"] .fm-lbl { fill: #ff8a52; }
[data-theme="red"] .fm-horizon { stroke: #ff6b2b; }

/* ---------- Lookalikes ---------- */
.lk-warn-note { background: rgba(200, 50, 42, .12); border-left-color: #c8322a; }
.lk-call { margin-top: 10px; }
.lk-call-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px;
  border-radius: var(--ui-r); background: #c8322a; color: #fff; text-decoration: none; box-shadow: var(--ui-elev); }
.lk-call-k { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; opacity: .9; }
.lk-call-n { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
[data-theme="red"] .lk-call-btn { background: #ff3b1a; color: #160400; }
.lk-call-sub { margin: 8px 0 0; font-size: 13px; line-height: 1.4; }
.lk-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.lk-kind { align-self: flex-start; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; background: var(--ui-tile-neutral); color: var(--ui-sub); border: 1px solid var(--ui-hairline); }
.lk-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lk-card.is-single .lk-cols { grid-template-columns: 1fr; }
.lk-col { --c: #3d8a4a; min-width: 0; padding: 8px; border-radius: var(--ui-r-tile);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 9%, transparent); }
.lk-bad { --c: #c8322a; }
[data-theme="red"] .lk-good { --c: #ff8a52; } [data-theme="red"] .lk-bad { --c: #ff3b1a; }
.lk-fig { border-radius: 10px; overflow: hidden; background: var(--bob-fig-plate); }
[data-theme="night"] .lk-fig { background: #10140f; }
[data-theme="red"] .lk-fig { background: #120300; }
.lk-card.is-single .lk-fig { max-width: 260px; }
.lk-tag { display: inline-block; margin-top: 8px; padding: 2px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 900;
  text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--c); }
[data-theme="red"] .lk-tag { color: #160400; }
.lk-name { margin: 6px 0 4px; font-size: 13.5px; line-height: 1.25; font-weight: 900; }
.lk-tells { margin: 0; padding-left: 16px; font-size: 12.5px; line-height: 1.4; }
.lk-tells li + li { margin-top: 4px; }
.lk-diag-note { margin: 8px 0 0; font-size: 11px; color: var(--ui-sub); }
.lk-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.lk-photo { margin: 0; }
.lk-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; display: block; }
.lk-credit { display: block; font-size: 10px; color: var(--ui-sub); margin-top: 2px; }
/* diagrams */
.lk-svg { display: block; width: 100%; height: auto; }
.lk-svg .lk-line { fill: none; stroke: #3a2a18; stroke-width: 1.6; stroke-linecap: round; }
.lk-svg .lk-t { font: 700 8.5px system-ui, sans-serif; fill: #3a3428; }
.lk-svg .lk-tan { fill: #c8a070; stroke: #5a3e20; stroke-width: 1.5; }
.lk-svg .lk-hollow { fill: #fffaf0; stroke: #5a3e20; stroke-width: 1; }
.lk-svg .lk-cotton { fill: #f2ece0; stroke: #8a6a48; stroke-width: 1; }
.lk-svg .lk-red { fill: #b0452a; stroke: #4a1a0a; stroke-width: 1.5; }
.lk-svg .lk-gold { fill: #f0b040; stroke: #8a5a10; stroke-width: 1.5; }
.lk-svg .lk-orange { fill: #ee7a1a; stroke: #7a3a08; stroke-width: 1.5; }
.lk-svg .lk-white { fill: #fdfbf6; stroke: #6a6050; stroke-width: 1.5; }
.lk-svg .lk-wood { fill: #7a5a38; stroke: #3a2a18; stroke-width: 1; }
.lk-svg .lk-soil { stroke: #6a5030; stroke-width: 3; }
.lk-svg .lk-berry { fill: #2e1838; stroke: #12081a; stroke-width: 1; }
.lk-svg .lk-berry-r { fill: #2a1428; stroke: #12081a; stroke-width: 1.2; }
.lk-svg .lk-magenta { stroke: #c2307a; stroke-width: 4; stroke-linecap: round; }
.lk-svg .lk-seed { fill: #d8b878; stroke: #6a4a20; stroke-width: 1.2; }
.lk-svg .lk-green { fill: #5aa04a; stroke: #2a5020; stroke-width: 1.4; }
[data-theme="night"] .lk-svg .lk-line { stroke: #d8cfb8; }
[data-theme="night"] .lk-svg .lk-t { fill: #d8cfb8; }
[data-theme="night"] .lk-svg .lk-berry, [data-theme="night"] .lk-svg .lk-berry-r { fill: #4a2a58; stroke: #c8b8d8; }
[data-theme="red"] .lk-svg .lk-line { stroke: #ff6b2b; }
[data-theme="red"] .lk-svg .lk-t { fill: #ff8a52; }
[data-theme="red"] .lk-svg :is(.lk-tan, .lk-gold, .lk-orange, .lk-green, .lk-seed, .lk-red, .lk-wood) { fill: #5a1406; stroke: #ff6b2b; }
[data-theme="red"] .lk-svg :is(.lk-hollow, .lk-cotton, .lk-white) { fill: #2a0800; stroke: #ff6b2b; }
[data-theme="red"] .lk-svg :is(.lk-berry, .lk-berry-r) { fill: #1a0300; stroke: #ff6b2b; }
[data-theme="red"] .lk-svg .lk-magenta { stroke: #ff3b1a; }
[data-theme="red"] .lk-photo img { filter: grayscale(1) sepia(1) hue-rotate(-30deg) saturate(3) brightness(.7); }
@media (max-width: 360px) { .lk-cols { grid-template-columns: 1fr; } }

/* Phone landscape: keep the dial on-screen beside the heading readout. */
@media (orientation: landscape) and (max-height: 500px) {
  .cp-dial-wrap { width: min(30vw, 36vh, 140px); }
  .cp-deg { font-size: 32px; }
  .cp-top { gap: 14px; margin: 2px 0 6px; align-items: center; }
  .cp-start { min-height: 40px; padding: 6px 16px; }
}
