/* core-tools.css: launcher, address checker, gateway calculator, toggle chips, desktop-steps toggle.
   Loaded via meta "styles" on pages that use launcher.js / address-checker.js / gateway.js / toggle.js. */

[hidden] { display: none !important; }

/* Links styled as chips (the base .chip is a button) */
a.chip { display: inline-flex; align-items: center; text-decoration: none; font-variant-numeric: tabular-nums; }
a.chip:hover { border-color: var(--ink); color: var(--ink); }
a.chip::after { content: "↗"; margin-left: 0.35rem; font-weight: 400; color: var(--muted); }

/* Launcher */
.launcher { margin: 0; container-type: inline-size; }
.launcher-actions { margin-top: 0; }
.launcher-open { flex: 1 1 12rem; white-space: nowrap; font-size: 1.1875rem; min-height: 3.5rem; font-variant-numeric: tabular-nums; }
/* Keep "Open 192.168.1.254" and Copy on one line on phones: the label shrinks with the box (cqi) instead
   of pushing Copy onto a line of its own. Very narrow boxes stack both buttons at full width. Browsers
   without container units keep the plain wrapping row above. */
@supports (font-size: 1cqi) {
  .launcher-actions { flex-wrap: nowrap; }
  .launcher-open { flex: 1 1 auto; min-width: 0; padding-left: 0.8rem; padding-right: 0.8rem; font-size: clamp(1rem, 5.7cqi, 1.1875rem); }
  @container (max-width: 17.5rem) {
    .launcher-actions { flex-wrap: wrap; }
    .launcher-actions > .button { flex: 1 1 100%; }
  }
}
.launcher-open::after { content: "↗"; font-weight: 400; opacity: 0.85; }
.launcher-note { display: flex; gap: 0.55rem; align-items: baseline; font-size: 0.9375rem; color: var(--muted); margin: 0.75rem 0 0; }
.launcher-led { flex: none; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--wan); transform: translateY(-0.05rem); }
.launcher-chips-label { font-size: 0.9375rem; font-weight: 600; margin: 1rem 0 0; }
.launcher-hint { margin: 0.75rem 0 0; }

.launcher-actions .button.secondary { flex: none; min-height: 3.5rem; padding-left: 0.9rem; padding-right: 0.9rem; font-size: 0.9375rem; }

.tool > h2:first-child, .tool > section > h2:first-child { margin-top: 0; }
input::placeholder { color: #8a96a3; font-weight: 400; opacity: 1; }

/* A tool block split into labelled parts */
.tool-part + .tool-part { border-top: 1px dashed var(--rule); margin-top: 1.1rem; padding-top: 1.1rem; }
.tool-part > h2, .tool-part > h3 { margin-top: 0; font-size: 1.0625rem; }

/* Address checker */
.checker label, .gateway label { font-size: 1rem; }
.checker .actions, .gateway .actions { margin-top: 0.6rem; }
.checker-result, .gateway-result { margin-top: 0.9rem; padding: 0.8rem 0.9rem; border-radius: var(--radius-label); border: 1px solid var(--rule); background: var(--paper); }
.checker-result > :last-child, .gateway-result > :last-child { margin-bottom: 0; }
.checker-result p, .gateway-result p { margin-bottom: 0.5rem; }
.checker-result.is-ok, .gateway-result.is-ok { border-color: #9fd3b7; background: #eef8f2; }
.checker-result.is-warn, .gateway-result.is-warn { border-color: #e9cf95; background: var(--lan-wash); }
.checker-typed { font-size: 0.875rem; color: var(--muted); }
.checker-typed code { font: 600 0.9375rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); word-break: break-all; }
.checker-verdict, .gateway-verdict { font-size: 1.125rem; font-weight: 600; }
.checker-faults { padding-left: 1.1rem; font-size: 0.9375rem; }
.gateway input { font: 700 1.25rem/1.2 var(--font); font-variant-numeric: tabular-nums; }

/* Toggle chips (Android / iPhone) */
.toggle-chips { margin: 0 0 0.75rem; }
[data-toggle-group]:not(.toggle-ready) [data-toggle-panel] + [data-toggle-panel] { margin-top: 1rem; }
.panel-title { font-weight: 700; margin: 0 0 0.35rem; }
.toggle-ready .panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Desktop steps live behind a toggle (mobile first) */
details.desktop-steps { border: 1px solid var(--rule); border-radius: var(--radius-label); padding: 0.55rem 0.8rem; margin: 1rem 0; background: var(--surface); }
details.desktop-steps:last-of-type { border-bottom: 1px solid var(--rule); }
details.desktop-steps summary { font-weight: 600; color: var(--muted); }

/* Task grid on the home page (what do you want to do?) */

/* Card that links onward to another page */
.onward { display: block; border: 1px solid var(--rule); border-left: 4px solid var(--wan); border-radius: 0 var(--radius-label) var(--radius-label) 0; background: var(--surface); padding: 0.8rem 0.95rem; margin: 1rem 0; }
.onward > :last-child { margin-bottom: 0; }
.symptoms { list-style: none; padding: 0; margin: 0.5rem 0 0.75rem; }
.symptoms li + li { margin-top: 0; border-top: 1px solid var(--rule); }
.symptoms a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; text-decoration: none; color: var(--ink); }
.symptoms a::after { content: "›"; color: var(--wan); font-weight: 700; }


/* Hero launcher: the router's front panel. The one dark, loud element on a page; everything else stays
   on paper. Status light = what the browser says about the connection (launcher.js heroStatus). */
.tool-hero { --pad: 1.125rem; padding-top: 0; overflow: hidden; }
.launcher[data-hero] { --panel-ink: #eef3f8; --panel-muted: #a9b6c4; --panel-line: rgba(255, 255, 255, 0.16);
  position: relative; background: linear-gradient(180deg, #1f2b38 0%, #16202b 100%); color: var(--panel-ink);
  margin: 0 calc(-1 * var(--pad)) 1.25rem; padding: 1rem var(--pad) 1.15rem; border-bottom: 1px solid #0d141c; }
.launcher[data-hero]::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: rgba(255, 255, 255, 0.12); }
.tool-hero > .launcher[data-hero]:last-child, .tool-hero > .tool-part:only-child > .launcher[data-hero] { margin-bottom: calc(-1 * var(--pad)); }
.launcher[data-hero] .hint { color: var(--panel-muted); }
.panel-status { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.85rem; font-size: 0.9375rem; color: var(--panel-ink); line-height: 1.35; }
.panel-led { flex: none; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #6f7e8e; box-shadow: 0 0 0 3px rgba(111, 126, 142, 0.25); }
.panel-status[data-state="wifi"] .panel-led, .panel-status[data-state="ethernet"] .panel-led { background: #2bd17e; box-shadow: 0 0 0 3px rgba(43, 209, 126, 0.25), 0 0 10px rgba(43, 209, 126, 0.7); }
.panel-status[data-state="cellular"] .panel-led, .panel-status[data-state="none"] .panel-led { background: #f0b429; box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.25), 0 0 10px rgba(240, 180, 41, 0.6); animation: led-blink 1.1s steps(2, start) infinite; }
@keyframes led-blink { to { visibility: hidden; } }
.launcher[data-hero] .launcher-open { background: #2f74ec; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 16px rgba(0, 0, 0, 0.35); }
.launcher[data-hero] .launcher-open:hover { background: #3d80f2; }
.launcher[data-hero] .button.secondary { background: transparent; color: var(--panel-ink); border-color: var(--panel-line); }
.launcher[data-hero] .button.secondary:hover { border-color: var(--panel-ink); color: #fff; }
.launcher[data-hero] .launcher-chips-label { color: var(--panel-muted); font-weight: 500; }
.launcher[data-hero] a.chip { background: rgba(255, 255, 255, 0.06); border-color: var(--panel-line); color: var(--panel-ink); }
.launcher[data-hero] a.chip::after { color: var(--panel-muted); }
.launcher[data-hero] a.chip:hover { border-color: var(--panel-ink); color: #fff; }
.launcher[data-hero] a:not(.button):not(.chip) { color: #9cc2ff; }
.launcher[data-hero] .launcher-open, .open-bar .launcher-open { color: #fff; }
.tool-hero > .tool-part:first-child + .tool-part { border-top: 0; margin-top: 0; padding-top: 0.25rem; }
@media (min-width: 40rem) { .tool-hero { --pad: 1.5rem; } }

/* Bottom bar: the hero's Open button, once the hero has scrolled away */
.open-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #16202b; border-top: 1px solid #0d141c;
  padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(13, 20, 28, 0.25); animation: bar-in 0.18s ease-out; }
.open-bar-row { display: flex; gap: 0.5rem; max-width: 46rem; margin: 0 auto; }
.open-bar .launcher-open { flex: 1 1 auto; min-height: 3.1rem; background: #2f74ec; }
.open-bar .button.secondary { flex: none; min-height: 3.1rem; background: transparent; color: #eef3f8; border-color: rgba(255, 255, 255, 0.2); }
body.has-open-bar { padding-bottom: 4.5rem; }
@keyframes bar-in { from { transform: translateY(100%); } }
