/*
 * CompassPro: the tool's own components, styled in the site's design language (10 Nov 2026, on the UltraCompress Pro template,
 * after the Clock, whose shared block the first part of this file copies; it came from Prana Breathing Exercises, the Decision
 * Maker, the Employee ID Card Generator, SpinForge and EngCalc). Base: /libs/site-pages.css (tokens, Inter and Space Grotesk,
 * buttons, theme toggle, focus rings) and /libs/shared-nav.css (the site's header and footer). The second part is the
 * original's components (the dial, the readout, saved places, the radar, the sky chart, the world map, the level, Sight and
 * the windows) on the site's tokens, each part of a screen a card; the instrument keeps its own colour tokens (--north,
 * --course, --qibla, --sun ...), one colour for one meaning everywhere, and Night light reddens the tool and its windows.
 * Light is the default; dark applies when <html> has no data-theme.
 * Assembled once from the Clock's file and the original's style.css, then edited by hand: this file is the source.
 */

/* ----- Tokens the tool adds ----- */
:root {
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --ring: rgba(139, 92, 246, 0.18);
    --app-max: 1600px;
    --radius-lg: 16px;
    --line: rgba(0, 0, 0, 0.1);
    --line-strong: rgba(0, 0, 0, 0.24);
    --ok: #166534;
    --ok-soft: rgba(22, 101, 52, 0.09);
    --bad: #b91c1c;
    --bad-soft: rgba(185, 28, 28, 0.08);
    --warn: #92400e;
    --warn-soft: rgba(217, 119, 6, 0.1);
}
:root:not([data-theme="light"]) {
    --surface: #14141f;
    --surface-2: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.26);
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, 0.1);
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, 0.1);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.1);
}

/* ----- Page: full width, the page provides the side space ----- */
.container.app-container { max-width: calc(var(--app-max) + 2 * var(--content-gutter)); margin-top: 16px; }
@media (min-width: 640px) { .container.app-container { margin-top: 24px; } }

/* ----- The site header is the first thing on the page and stays at the top ----- */
body { padding-top: 0; }
body > header { position: sticky; top: 0; z-index: 50; }
header .site-nav { position: relative; top: auto; }
.theme-toggle { top: 90px; }
@media (max-width: 639.98px) { .theme-toggle { top: 75px; } } /* the header is 81 px tall from 640 px, 65 px below */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ----- Hero ----- */
.app-hero { margin: 0 0 2rem; text-align: center; }
.app-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 1.25rem; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text-strong); }
.app-brand img { width: 44px; height: 44px; border-radius: 12px; display: block; }
.app-hero h1 { margin-bottom: 0.75rem; }
.app-tagline { color: var(--text-2); font-size: 1.125rem; line-height: 1.6; max-width: 46rem; margin: 0 auto; }

/* ----- Small helpers ----- */
main [hidden], .dialog [hidden], .session [hidden] { display: none !important; } /* the script hides parts that carry their own display */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-2); }
.small { font-size: 0.9rem; }
.block { display: block; }
.hint { color: var(--text-3); font-size: 0.8rem; font-weight: 400; line-height: 1.45; }
.err { color: var(--bad); font-size: 0.85rem; font-weight: 600; }
.err:empty { display: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link:hover { color: var(--link-hover); }
code { font-size: 0.85em; padding: 1px 6px; border-radius: 6px; background: var(--code-bg); color: var(--code-text); }
kbd { font-family: inherit; font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9999px; font-family: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1.2; padding: 12px 24px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-strong); border: 1px solid var(--surface-border); padding: 11px 23px; }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn-danger { background: var(--surface); color: var(--danger); border: 1px solid rgba(185, 28, 28, 0.35); padding: 11px 23px; }
.btn-danger:hover:not(:disabled) { background: var(--danger-strong); color: #fff; border-color: transparent; transform: translateY(-2px); }
.btn-sm { font-size: 0.85rem; padding: 9px 16px; }
.btn-secondary.btn-sm, .btn-danger.btn-sm { padding: 8px 15px; }
.btn-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex-shrink: 0; padding: 0; font-family: inherit; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.icon-btn:hover { border-color: var(--brand); color: var(--link); background: var(--surface); }
.icon-btn.del:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn:focus-visible, .link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Toolbar ----- */
.app-shell { margin: 0 0 3rem; scroll-margin-top: 90px; }
.app-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0 0 1.25rem; }
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 10px; border-radius: 9999px; border: 1px solid var(--tint-brand-border); background: var(--tint-brand); min-width: 220px; max-width: 100%; }
.status-icon { font-size: 1.3rem; line-height: 1; }
.status-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.status-main { font-weight: 700; font-size: 0.85rem; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-sub { font-size: 0.72rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--surface-2); max-width: 100%; }
.view-tab { padding: 8px 16px; border: 0; border-radius: 9999px; background: transparent; font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.view-tab:hover { color: var(--link); }
.view-tab.active { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.view-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.view[hidden] { display: none; }
.shell-hint { margin-top: 14px; }

/* ----- Fields ----- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.label { font-weight: 600; font-size: 0.85rem; color: var(--text-strong); }
.input, .select { width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px; background: var(--field); border: 1px solid var(--field-border); border-radius: 12px; font-family: inherit; font-size: 0.95rem; color: var(--text); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder { color: var(--placeholder); }
.input[aria-invalid="true"] { border-color: var(--bad); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
input[type="time"].input { color-scheme: light; width: 9em; }
:root:not([data-theme="light"]) input[type="time"].input { color-scheme: dark; }
.select { width: auto; max-width: 100%; appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; cursor: pointer; }
.select option { color: #0a0a14; background: #fff; }
.num-input { width: 7.5em; }
.num-input.wide { width: 10em; }
.check-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 0.925rem; color: var(--text); padding: 4px 0; }
.check-row input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.seg button:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.seg button[aria-checked="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--chip); font-family: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.chip .ico { width: 15px; height: 15px; color: var(--link); }
.chip:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Windows ----- */
.dialog { margin: auto; border: 1px solid var(--surface-border); border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 16px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); }
.dialog--narrow { width: min(420px, calc(100vw - 16px)); }
.dialog--wide { width: min(680px, calc(100vw - 16px)); }
.dialog::backdrop { background: rgba(10, 10, 20, 0.6); backdrop-filter: blur(6px); }
.dialog[open] { animation: pop 0.2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } }
.dialog-head { padding: 18px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-title { margin: 0; font-size: 1.15rem; }
.dialog-close { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: border-color 0.2s ease, color 0.2s ease; }
.dialog-close:hover { border-color: var(--brand); color: var(--link); }
.dialog-body { padding: 20px; overflow-y: auto; max-height: calc(100vh - 210px); display: flex; flex-direction: column; gap: 14px; }
.dialog-actions { padding: 14px 20px; border-top: 1px solid var(--surface-border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.confirm-message { margin: 0; color: var(--text); }
.help-body h3 { margin: 6px 0 0; font-size: 1rem; }
.help-body p { margin: 0; color: var(--text-2); }

/* ----- Toasts ----- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { pointer-events: auto; background: #0a0a14; color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); border-left: 4px solid var(--brand); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); min-width: 260px; max-width: 420px; font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; animation: slideIn 0.3s ease; transition: opacity 0.3s ease, transform 0.3s ease; }
.toast button { background: none; border: 0; padding: 0; color: #c4b5fd; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.toast.leaving { opacity: 0; transform: translateX(40px); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.toast.good { border-left-color: #4ade80; }
.toast.bad { border-left-color: #f87171; }

/* ----- Information sections ----- */
.info-section { margin: 0 0 2.5rem; }
.info-section h2 { font-size: 1.75rem; margin: 0 0 1.25rem; }
.info-section .info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 1rem 0 1.5rem; }
.info-stack { display: grid; gap: 12px; }
.info-card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: var(--surface-shadow); padding: 20px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.info-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.info-card--small { padding: 16px; box-shadow: none; }
.info-card h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.info-card p { color: var(--text-2); margin-bottom: 0.75rem; }
.info-card p:last-child { margin-bottom: 0; }
.step-card { position: relative; padding-top: 24px; }
.step-num { position: absolute; top: -16px; left: 20px; width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-brand); color: #fff; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 0.75rem; }
.step-head h3 { margin: 0; }
.step-emoji { font-size: 1.6rem; line-height: 1; }
.info-section details.info-card { padding: 0; }
.info-section details.info-card summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.info-section details.info-card summary::-webkit-details-marker { display: none; }
.info-section details.info-card summary::after { content: '+'; color: var(--link); font-weight: 700; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.info-section details.info-card[open] summary::after { content: '\2212'; }
.info-section details.info-card p { padding: 0 20px 16px; margin: 0; color: var(--text-2); }



/* ===== CompassPro components ===== */

/* ----- The site's text rules (p, ul, li, headings) must not reach the tool: same weight as the site's, loaded later ----- */
:where(.app-shell) p, :where(.app-shell) ul, :where(.app-shell) ol, :where(.app-shell) li, :where(.dialog) p, :where(.dialog) li, :where(.sight) p { margin: 0; line-height: 1.5; }
:where(.app-shell) ul, :where(.app-shell) ol, :where(.sight) ul { padding: 0; list-style: none; }
:where(.app-shell) h2, :where(.app-shell) h3, :where(.app-shell) h4, :where(.dialog) h3 { margin: 0; line-height: 1.25; }
:where(.app-shell) dl, :where(.app-shell) dd { margin: 0; }

/* ----- The instrument's own colours: one colour, one meaning, everywhere (dial, sky chart, map and lists) ----- */
:root {
    --north: #c81e1e;
    --course: #a3157f;
    --qibla: #0d7a52;
    --sun: #c26b00;
    --sun-ink: #8a4f00;
    --moon: #4b5a7a;
    --star: #3a4cc0;
    --iso-e: #c2410c;
    --iso-w: #1d5fbf;
    --face: #ffffff;
    --bezel: #eef0f6;
    --bezel-edge: #b9c1ce;
    --tick: #141a2b;
    --tick-faint: #6b7280;
    --land: #d6dce5;
    --sea: #eef2f7;
    --night-shade: rgba(24, 40, 96, 0.11);
}
:root:not([data-theme="light"]) {
    --north: #ff6b5f;
    --course: #f06ad4;
    --qibla: #3fcf92;
    --sun: #f5a524;
    --sun-ink: #f7c56a;
    --moon: #c3cde0;
    --star: #a3b2ff;
    --iso-e: #ff9a5c;
    --iso-w: #6fa8ff;
    --face: #14141f;
    --bezel: #0d0d16;
    --bezel-edge: #3a3a4f;
    --tick: #ecebe6;
    --tick-faint: #9097a8;
    --land: #2a2d45;
    --sea: #10111c;
    --night-shade: rgba(0, 0, 0, 0.35);
}
/* Night light: red on black keeps your eyes used to the dark. The tool and its windows only (the site's moon button sets
   the rest of the page dark). Shapes, not colours, tell the markers apart. */
body.cp-night :is(.app-shell, .dialog, .sight) {
    --surface: #0a0000;
    --surface-2: #160302;
    --surface-border: #3a0905;
    --surface-shadow: none;
    --text: #ff4a3a;
    --text-strong: #ff5a48;
    --text-2: #e0392b;
    --text-3: #ef4434; /* 5.5:1 on the night surface */
    --line: #3a0905;
    --line-strong: #5c120b;
    --chip: #0a0000;
    --chip-border: #5c120b;
    --field: #050000;
    --field-border: #5c120b;
    --placeholder: #9c1f15;
    --brand: #ff4a3a;
    --link: #ff6a5a;
    --link-hover: #ff7a6a;
    --gradient-brand: linear-gradient(135deg, #5c120b, #3a0905);
    --tint-brand: #160302;
    --tint-brand-border: #5c120b;
    --ok: #ff6a5a;
    --warn: #ff6a5a;
    --bad: #ff4a3a;
    --north: #ff2a1a;
    --course: #ff6a5a;
    --qibla: #e0392b;
    --sun: #ff5a48;
    --sun-ink: #ff5a48;
    --moon: #c2281c;
    --star: #ff7a6a;
    --iso-e: #ff5a48;
    --iso-w: #b2241a;
    --face: #050000;
    --bezel: #0f0201;
    --bezel-edge: #5c120b;
    --tick: #ff4a3a;
    --tick-faint: #c2281c;
    --land: #2a0603;
    --sea: #050000;
    --night-shade: rgba(0, 0, 0, 0.5);
    color: var(--text);
}
body.cp-night .app-shell .card, body.cp-night .dialog { background: var(--surface); }
/* the whole tool on black, also its headings and notes between the cards; the shadow reaches 16 px past it without moving anything */
body.cp-night .app-shell { background: #000; box-shadow: 0 0 0 16px #000; border-radius: 6px; }
body.cp-night .view-tab.active, body.cp-night .seg button[aria-checked="true"], body.cp-night .chip[aria-pressed="true"], body.cp-night .btn-primary { color: #ffd2cc; box-shadow: none; }

/* ----- Toolbar: the place button ----- */
.place-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 18px 6px 12px; border-radius: 9999px; border: 1px solid var(--tint-brand-border); background: var(--tint-brand); min-width: 240px; max-width: 100%; text-align: left; font-family: inherit; color: var(--text); cursor: pointer; transition: border-color 0.2s ease; }
.place-pill:hover { border-color: var(--brand); }
.place-pill:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.place-ico { width: 22px; height: 22px; color: var(--north); }
.place-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.place-name { font-weight: 700; font-size: 0.9rem; color: var(--text-strong); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }
.place-change { font-size: 0.75rem; font-weight: 600; color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.place-sub { font-size: 0.75rem; color: var(--text-3); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.view-tab { display: inline-flex; align-items: center; gap: 6px; }
/* when the toolbar does not fit one row: the place and the buttons first, the tabs on their own row under them */
@media (min-width: 640px) and (max-width: 1279.98px) { .app-toolbar .view-tabs { order: 3; } }
.view-tab .ico { width: 16px; height: 16px; }

/* ----- Screens, cards and headings ----- */
.screen { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.view-head { display: flex; flex-direction: column; gap: 4px; }
.view-head h2 { font-size: 1.5rem; color: var(--text-strong); }
.lead { color: var(--text-2); max-width: 72ch; }
.note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--tint-brand-border); background: var(--tint-brand); font-size: 0.925rem; color: var(--text); }
.note .ico { color: var(--link); margin-top: 2px; }
.card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); padding: 20px; min-width: 0; }
.section { display: flex; flex-direction: column; gap: 14px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.sec-head h3 { font-size: 1.15rem; color: var(--text-strong); }
.section h4 { font-size: 1rem; margin: 6px 0 0; color: var(--text-strong); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (min-width: 1000px) { .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.shell-hint { margin-top: 18px; color: var(--text-3); font-size: 0.85rem; }
.empty { color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 18px 8px; text-align: center; font-size: 0.925rem; }
.error { color: var(--bad); font-size: 0.875rem; font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.grid2, .grid3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 560px) {
    .grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.field > span:first-child, .field > label:first-child { font-size: 0.85rem; font-weight: 600; color: var(--text-strong); }
.field.inline { flex-direction: row; align-items: center; gap: 10px; }
.field.inline .input { width: 8.5em; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row .input { flex: 1; min-width: 0; }
.field-label { font-size: 0.85rem; font-weight: 600; color: var(--text-strong); }
.calc { display: flex; flex-direction: column; gap: 12px; }
.calc-actions { margin-top: 12px; }
.big-answer { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.big-answer:empty { display: none; }

/* rows of facts */
.rows { display: flex; flex-direction: column; }
.rows > div { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 4px 16px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.rows > div:last-child { border-bottom: 0; }
.rows dt { color: var(--text-2); font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.rows dd { font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.rows dd strong { font-weight: 700; color: var(--text-strong); }
.rows .sub { display: block; font-size: 0.82rem; color: var(--text-3); }
.rows .copy-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.8rem; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.legend .line { width: 18px; height: 0; border-top: 3px solid; flex: none; }
.legend .dash { width: 18px; height: 0; border-top: 2px dashed; flex: none; }
.lg-sun { border-color: var(--sun); }
.lg-moon { border-color: var(--moon); }
.lg-qibla { border-color: var(--qibla); }
.lg-iso-e { border-color: var(--iso-e); }
.lg-iso-w { border-color: var(--iso-w); }
.lg-text { border-color: var(--text); }
.lg-course { border-color: var(--course); }
.lg-north { background: var(--north); }

/* marker chips */
.mk-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 2px solid currentColor; }
.mk-dot.sun { color: var(--sun); }
.mk-dot.moon { color: var(--moon); }
.mk-dot.qibla { color: var(--qibla); border-radius: 3px; }
.mk-dot.star { color: var(--star); transform: rotate(45deg); border-radius: 2px; }
.mk-dot.target { color: var(--course); transform: rotate(45deg); border-radius: 1px; }
.chip.mk[aria-pressed="true"] { background: var(--surface); color: var(--text-strong); border-color: var(--text-strong); }
.chip.mk[aria-pressed="true"] .mk-dot { background: currentColor; }
.chip[aria-pressed="true"]:not(.mk) { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.btn[aria-pressed="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }

/* ----- The instrument ----- */
.instrument { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 900px) { .instrument { grid-template-columns: minmax(320px, min(560px, 44vw)) minmax(0, 1fr); } }
.dial-wrap { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.dial { width: 100%; max-width: max(240px, min(520px, calc(100svh - 260px))); aspect-ratio: 1; display: block; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 50%; }
.dial.manual { cursor: grab; }
.dial.manual:active { cursor: grabbing; }
.dial:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; }
.dial text, .radar text, .skychart text, .map text, .decl-diagram text, .level text, .sight-tape text { font-family: 'Inter', system-ui, sans-serif; }
.dial-note { font-size: 0.85rem; color: var(--text-2); text-align: center; max-width: 46ch; min-height: 1.3em; }
.readout { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.heading-block { display: flex; flex-direction: column; gap: 2px; }
.heading { display: inline-flex; align-items: flex-start; align-self: flex-start; background: none; border: 0; padding: 0; border-radius: 12px; color: var(--text-strong); cursor: pointer; font-family: inherit; }
.heading:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.heading-num { font-size: clamp(3.6rem, 9vw, 5.6rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.heading-unit { font-size: clamp(1.8rem, 4.2vw, 2.6rem); font-weight: 600; line-height: 1.1; color: var(--text-2); margin-left: 2px; }
.heading-sub { font-size: 1.05rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; color: var(--text-strong); }
.heading-sub span { color: var(--text-2); font-size: 0.95rem; }
.status { font-size: 0.875rem; color: var(--text-2); display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); flex: none; }
.dot.live { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.held { background: var(--course); }
.startbox { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding-left: 8px; border-left: 3px solid var(--brand); }
.north-row, .markers-row { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; }
.course-panel { display: flex; flex-direction: column; gap: 10px; padding-left: 8px; border-left: 4px solid var(--course); }
.course-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.course-sw { display: inline-block; width: 14px; height: 14px; background: var(--course); transform: rotate(45deg); border-radius: 2px; flex: none; }
.course-title { font-size: 0.9rem; color: var(--text-2); }
.course-turn { font-size: 1.45rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.course-turn.on, .go-turn.on { color: var(--ok); }
.course-edit { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ----- Navigate ----- */
.go-card { display: flex; flex-direction: column; gap: 12px; }
.go-name { font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: 10px; color: var(--text-strong); overflow-wrap: anywhere; }
.go-name .course-sw { width: 12px; height: 12px; }
.go-big { display: flex; gap: 28px; flex-wrap: wrap; align-items: baseline; }
.go-big div { display: flex; flex-direction: column; }
.go-big b { font-size: 2.3rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; color: var(--text-strong); }
.go-big span { font-size: 0.85rem; color: var(--text-2); }
.go-turn { font-weight: 700; font-size: 1.1rem; color: var(--text-strong); }
.radar { width: 100%; max-width: 460px; aspect-ratio: 1; display: block; align-self: center; }
.list { margin: 0; padding: 0; list-style: none; }
.wp { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.wp:last-child { border-bottom: 0; }
.wp.active { box-shadow: inset 3px 0 0 var(--course); padding-left: 8px; }
.wp-name { font-weight: 700; overflow-wrap: anywhere; color: var(--text-strong); }
.wp-sub { font-size: 0.82rem; color: var(--text-3); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wp-dir { font-variant-numeric: tabular-nums; font-size: 0.9rem; color: var(--text); }
.wp-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* ----- Sky ----- */
.skychart { width: 100%; max-width: 520px; aspect-ratio: 1; display: block; align-self: center; }
.timebar { display: flex; flex-direction: column; gap: 10px; }
.timebar .range { width: 100%; accent-color: var(--sun); min-height: 32px; margin: 0; }
.timebar-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: var(--text-strong); }
.input.date { width: auto; color-scheme: light; }
:root:not([data-theme="light"]) .input.date { color-scheme: dark; }

/* ----- Map ----- */
.map-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.map-zoom { display: flex; align-items: center; gap: 8px; }
.map-zoom .icon-btn { border-color: var(--chip-border); background: var(--surface); }
.map-wrap { position: relative; width: 100%; border: 1px solid var(--surface-border); border-radius: var(--radius-lg); overflow: hidden; background: var(--sea); }
.map { display: block; width: 100%; height: min(72vh, 760px); min-height: 320px; touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.map.flat { cursor: grab; }
.map.dragging { cursor: grabbing; }
.field-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 560px) { .field-wrap { grid-template-columns: 200px minmax(0, 1fr); } }
.decl-diagram { width: 200px; height: auto; display: block; justify-self: center; }

/* ----- Tools ----- */
.level-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: center; }
@media (min-width: 560px) { .level-wrap { grid-template-columns: 200px minmax(0, 1fr); } }
.level { width: 200px; height: 200px; display: block; justify-self: center; }
.game { display: flex; flex-direction: column; gap: 12px; color: var(--text); }
.game-ask { font-size: 1.5rem; font-weight: 700; color: var(--text-strong); overflow-wrap: anywhere; }
.game-score { display: flex; gap: 24px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.game-score b { font-size: 1.3rem; color: var(--text-strong); }

/* ----- Windows ----- */
.city-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; border-top: 1px solid var(--line); }
.city-list button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; padding: 10px 4px; min-height: 48px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-family: inherit; font-size: 0.95rem; color: var(--text); cursor: pointer; }
.city-list button:hover, .city-list button:focus-visible { background: var(--surface-2); color: var(--link); }
.city-list button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.city-list small { color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.85rem; }
.city-list .city-none { padding: 12px 4px; }
details.manual { border-top: 1px solid var(--line); padding-top: 12px; }
details.manual summary { cursor: pointer; font-weight: 600; min-height: 32px; color: var(--text-strong); }
details.manual[open] summary { margin-bottom: 12px; }
details.manual .manual-body { display: flex; flex-direction: column; gap: 12px; }
.set-group { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.set-group:first-child { border-top: 0; padding-top: 0; }
.set-group h3 { font-size: 0.95rem; margin: 0; color: var(--text-strong); }
.help-body ul.examples { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.steps { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.cal-anim { width: 100%; max-width: 320px; height: auto; align-self: center; }
.cal-path { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 5 6; }
.cal-phone rect { fill: var(--surface-2); stroke: var(--text-strong); stroke-width: 2; }
.cal-phone .cal-screen { fill: var(--surface); stroke: none; }
.cal-phone { offset-path: path("M160 85c-28-38-52-55-80-55a55 55 0 0 0 0 110c28 0 52-17 80-55s52-55 80-55a55 55 0 0 1 0 110c-28 0-52-17-80-55z"); animation: eight 4.5s linear infinite; }
@keyframes eight { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.cal-state { font-weight: 600; color: var(--text-strong); }
.cal-state:empty { display: none; }
#wpForm { display: contents; }

/* ----- Sight (camera) ----- */
.sight { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: #000; color: #fff; overflow: hidden; }
.sight[open] { display: block; }
.sight::backdrop { background: #000; }
html:has(.sight[open]) { overflow: hidden; }
.sight video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sight-tape { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 96px; display: block; }
.sight-layer { position: absolute; inset: 0; pointer-events: none; }
.sight-mark { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.85rem; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); }
.sight-mark i { display: block; width: 26px; height: 26px; border-radius: 50%; border: 3px solid currentColor; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45); }
.sight-mark.square i { border-radius: 4px; }
.sight-mark.diamond i { transform: rotate(45deg); border-radius: 3px; }
.sight-horizon { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed rgba(255, 255, 255, 0.55); }
.sight-reticle { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); pointer-events: none; }
.sight-reticle::before, .sight-reticle::after { content: ""; position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4); }
.sight-reticle::before { left: 50%; top: -18px; bottom: -18px; width: 2px; transform: translateX(-50%); }
.sight-reticle::after { top: 50%; left: -18px; right: -18px; height: 2px; transform: translateY(-50%); }
.sight-top { position: absolute; left: 0; right: 0; top: 100px; padding: 0 16px; display: flex; justify-content: center; }
.sight-msg { background: rgba(0, 0, 0, 0.7); border-radius: 10px; padding: 6px 12px; font-size: 0.95rem; max-width: 60ch; text-align: center; color: #fff; }
.sight-msg:empty { display: none; }
.sight-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; align-items: center; background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); }
.sight-read { display: flex; flex-direction: column; align-items: center; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); }
.sight-read .num { font-size: 3.4rem; font-weight: 800; line-height: 1; }
.sight-sub { font-size: 1rem; }
.sight-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sight-actions .btn { background: #fff; color: #0a0a14; border: 0; padding: 10px 18px; font-size: 0.95rem; }
.sight-actions .btn:hover { background: #ede9fe; }
.sight-list { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.sight-list li { background: rgba(0, 0, 0, 0.7); border-radius: 8px; padding: 3px 9px; }
body.cp-night .sight video { filter: grayscale(1) sepia(1) saturate(6) hue-rotate(-50deg) brightness(0.55); }
body.cp-night .sight, body.cp-night .sight-msg { color: #ff4a3a; }
body.cp-night .sight-actions .btn { background: #160302; color: #ff5a48; }

/* ----- Dial ----- */
.d-bezel { fill: var(--bezel); stroke: var(--bezel-edge); stroke-width: 2; }
.d-fixmark { stroke: var(--tick-faint); stroke-width: 3; stroke-linecap: round; }
.d-face { fill: var(--face); stroke: var(--bezel-edge); stroke-width: 2; }
.d-tick1 { stroke: var(--tick-faint); stroke-width: 1.6; }
.d-tick5 { stroke: var(--tick); stroke-width: 2.6; }
.d-tick10 { stroke: var(--tick); stroke-width: 4; }
.d-num { fill: var(--tick); font-size: 38px; font-weight: 600; font-variant-numeric: tabular-nums; }
.d-n { fill: var(--north); font-size: 92px; font-weight: 800; }
.d-c { fill: var(--tick); font-size: 70px; font-weight: 700; }
.d-i { fill: var(--tick-faint); font-size: 34px; font-weight: 650; }
.d-npt { fill: var(--north); }
.d-ring { fill: none; stroke: var(--line); stroke-width: 2; }
.d-spoke { stroke: var(--tick-faint); stroke-width: 2; }
.d-lubber path { fill: var(--tick); }
.d-lubber .d-lubber-line { stroke: var(--tick); stroke-width: 5; fill: none; }
.d-pointer path { fill: var(--tick); }
.d-level-ring { fill: none; stroke: var(--tick-faint); stroke-width: 2; }
.d-bubble { fill: color-mix(in srgb, var(--ok) 30%, transparent); stroke: var(--ok); stroke-width: 3; }
.d-bubble.off { fill: color-mix(in srgb, var(--warn) 25%, transparent); stroke: var(--warn); }
.d-wedge { fill: color-mix(in srgb, var(--course) 35%, transparent); }
.d-course-line { stroke: var(--course); stroke-width: 9; stroke-linecap: round; }
.d-course-head { fill: var(--course); }
.d-course-tail { stroke: var(--course); stroke-width: 5; stroke-dasharray: 16 14; }
.m-sun circle { fill: var(--sun); stroke: var(--face); stroke-width: 3; }
.m-sun path { stroke: var(--sun); stroke-width: 4; stroke-linecap: round; }
.m-sun.hollow circle { fill: var(--face); stroke: var(--sun); stroke-width: 4; }
.m-moon circle { fill: var(--face); stroke: var(--moon); stroke-width: 4; }
.m-moon .m-moon-lit { fill: var(--moon); }
.m-moon.hollow .m-moon-lit { fill: none; }
.m-qibla rect { fill: var(--qibla); stroke: var(--face); stroke-width: 3; }
.m-qibla path { stroke: var(--face); stroke-width: 3; }
.m-star { fill: var(--star); stroke: var(--face); stroke-width: 2; }
.m-star.hollow { fill: var(--face); stroke: var(--star); stroke-width: 3; }
.m-target path { fill: var(--course); stroke: var(--face); stroke-width: 3; }
.m-target circle { fill: var(--face); }
.m-back { fill: none; stroke: var(--course); stroke-width: 4; }

/* ----- Sky chart and radar ----- */
.s-sky { fill: var(--surface); stroke: var(--tick); stroke-width: 3; }
.s-ring { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 4 6; }
.s-spoke { stroke: var(--line); stroke-width: 1.5; }
.s-tick { stroke: var(--tick-faint); stroke-width: 2; }
.s-n { fill: var(--north); font-size: 40px; font-weight: 800; }
.s-card { fill: var(--text-strong); font-size: 34px; font-weight: 700; }
.s-deg { fill: var(--text-2); font-size: 22px; }
.s-alt { fill: var(--text-2); font-size: 20px; }
.s-qibla { stroke: var(--qibla); stroke-width: 5; stroke-linecap: round; }
.s-solstice { fill: none; stroke: var(--sun); stroke-width: 2.5; stroke-dasharray: 8 8; opacity: 0.8; }
.s-sunpath { fill: none; stroke: var(--sun); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.s-moonpath { fill: none; stroke: var(--moon); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.s-sunray { stroke: var(--sun); stroke-width: 2.5; stroke-dasharray: 3 7; }
.s-sunray-end { fill: var(--sun); }
.s-moonray { stroke: var(--moon); stroke-width: 2.5; stroke-dasharray: 3 7; }
.s-hour { fill: var(--surface); stroke: var(--sun-ink); stroke-width: 3; }
.s-hourlabel { fill: var(--sun-ink); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.s-sun { fill: var(--sun); stroke: var(--surface); stroke-width: 4; }
.s-moon { fill: var(--moon); stroke: var(--surface); stroke-width: 4; }
.s-star { fill: var(--star); }
.s-label { fill: var(--text-strong); font-size: 24px; font-weight: 650; paint-order: stroke; stroke: var(--surface); stroke-width: 6px; }
.s-facing { stroke: var(--text-strong); stroke-width: 4; stroke-dasharray: 2 10; stroke-linecap: round; }
.s-zenith { fill: var(--text-strong); }
.r-bg { fill: var(--surface); stroke: var(--tick); stroke-width: 3; }
.r-ring { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.r-spoke { stroke: var(--line); stroke-width: 1.5; }
.r-dist { fill: var(--text-2); font-size: 22px; font-variant-numeric: tabular-nums; }
.r-facing { stroke: var(--text-strong); stroke-width: 3; stroke-dasharray: 2 10; stroke-linecap: round; }
.r-route { stroke: var(--course); stroke-width: 4; }
.r-pt { fill: var(--surface); stroke: var(--text-strong); stroke-width: 3; }
.r-pt.target { fill: var(--course); stroke: var(--surface); }
.r-label { fill: var(--text-strong); font-size: 24px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 6px; }
.r-you { fill: var(--north); stroke: var(--surface); stroke-width: 4; }

/* ----- Level, tape, north arrows ----- */
.l-bg { fill: var(--surface); stroke: var(--tick); stroke-width: 3; }
.l-ring { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.l-bubble { fill: color-mix(in srgb, var(--warn) 30%, transparent); stroke: var(--warn); stroke-width: 3; }
.l-bubble.flat { fill: color-mix(in srgb, var(--ok) 30%, transparent); stroke: var(--ok); }
.l-none { fill: var(--text-2); font-size: 16px; }
.t-bg { fill: rgba(0, 0, 0, 0.6); }
.t-tick { stroke: #fff; stroke-width: 2; }
.t-num { fill: #fff; font-size: 20px; font-weight: 650; }
.t-n { fill: #ff6a5e; font-size: 24px; font-weight: 800; }
.t-centre { stroke: #ff6a5e; stroke-width: 4; }
.n-true { stroke: var(--text-strong); stroke-width: 3; }
.n-true-star { fill: var(--text-strong); }
.n-mag { stroke: var(--north); stroke-width: 3; }
.n-mag-head { fill: var(--north); }
.n-grid { stroke: var(--text-2); stroke-width: 3; stroke-dasharray: 7 5; }
.n-label { fill: var(--text-strong); font-size: 14px; font-weight: 650; }
.n-arc { fill: none; stroke: var(--north); stroke-width: 1.5; }
.n-val { fill: var(--north); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ----- World map ----- */
.mp-sea { fill: var(--sea); }
.mp-land { fill: var(--land); stroke: none; }
.mp-grat { fill: none; stroke: var(--line); stroke-width: 1; }
.mp-night { fill: var(--night-shade); stroke: none; }
.mp-iso { fill: none; stroke-width: 1.3; opacity: 0.85; }
.mp-iso.e { stroke: var(--iso-e); }
.mp-iso.w { stroke: var(--iso-w); }
.mp-iso.z { stroke: var(--text-strong); stroke-width: 2.4; opacity: 1; }
.mp-isolabel { font-size: 12px; font-weight: 700; paint-order: stroke; stroke: var(--sea); stroke-width: 4px; font-variant-numeric: tabular-nums; }
.mp-isolabel.e { fill: var(--iso-e); }
.mp-isolabel.w { fill: var(--iso-w); }
.mp-isolabel.z { fill: var(--text-strong); }
.mp-route { fill: none; stroke-width: 3; stroke-linecap: round; }
.mp-route.target { stroke: var(--course); }
.mp-route.qibla { stroke: var(--qibla); }
.mp-rim { fill: none; stroke: var(--tick); stroke-width: 2; }
.mp-rimtick { stroke: var(--tick); stroke-width: 1.5; }
.mp-n { fill: var(--north); font-size: 16px; font-weight: 800; }
.mp-card { fill: var(--text-strong); font-size: 14px; font-weight: 700; }
.mp-deg { fill: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.mp-range { fill: none; stroke: var(--tick-faint); stroke-width: 1; stroke-dasharray: 3 5; }
.mp-rangelabel { fill: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--sea); stroke-width: 3px; }
.mp-pt { fill: var(--surface); stroke: var(--text-strong); stroke-width: 2; }
.mp-pt.you { fill: var(--north); stroke: var(--surface); }
.mp-pt.you .mp-you-halo { fill: none; stroke: var(--north); stroke-width: 2; }
.mp-pt.target { fill: var(--course); stroke: var(--surface); }
.mp-pt.qibla { fill: var(--qibla); stroke: var(--surface); }
.mp-pt.pole { fill: none; stroke: var(--north); stroke-width: 2.5; }
.mp-pt.city { fill: var(--text-2); stroke: none; }
.mp-pt.pick { stroke: var(--text-strong); stroke-width: 3; }
.mp-label { font-size: 12px; font-weight: 650; fill: var(--text-strong); paint-order: stroke; stroke: var(--sea); stroke-width: 3.5px; }
.mp-label.city { font-weight: 500; fill: var(--text-2); }
.mp-label.pole { fill: var(--north); }

/* ----- Phones ----- */
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .app-toolbar { gap: 10px; }
    .toolbar-left, .toolbar-right { width: 100%; }
    .place-pill { min-width: 0; flex: 1 1 auto; }
    /* five tabs at 16 px do not fit one row on a phone: three, then two wider ones */
    .app-toolbar .view-tabs { width: 100%; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; border-radius: 24px; }
    .view-tab { grid-column: span 2; justify-content: center; padding: 8px 6px; gap: 5px; min-width: 0; }
    .view-tab:nth-child(n+4) { grid-column: span 3; }
    .toolbar-right .btn { flex: 1 1 auto; }
    .card { padding: 16px; }
    .map { height: auto; min-height: 0; aspect-ratio: 1; }
    .map.flat { aspect-ratio: 4 / 3; }
    .rows > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .go-big b { font-size: 1.9rem; }
    .toasts { bottom: 16px; right: 16px; left: 16px; align-items: stretch; }
    .toast { min-width: 0; max-width: none; }
    .dialog-body, .dialog-head, .dialog-actions { padding-left: 16px; padding-right: 16px; }
    .info-section h2 { font-size: 1.4rem; }
    .info-section .info-grid, .info-three { grid-template-columns: 1fr; }
    .info-card { padding: 16px; }
    .step-num { left: 16px; }
}
@media (max-width: 459px) {
    .view-tab .ico { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .btn, .info-card, .dialog, .dialog[open], .toast, .seg button, .chip, .view-tab, .place-pill, .cal-phone { transition: none; animation: none; }
}
@media (forced-colors: active) {
    .d-npt, .d-n, .d-course-head { fill: CanvasText; }
}
/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026). The dial, charts and map are drawings. */
@media (max-width: 639.98px) {
    main button, main select, main summary, main [role="button"],
    main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]) { min-height: 44px; }
    main .seg button, main .view-tab, main .chip, main .place-pill { min-height: 44px; }
    main .icon-btn { width: 44px; height: 44px; min-width: 44px; }
    main .heading { min-height: 0; }
    main .check-row, main .range, main .timebar .range { min-height: 44px; align-items: center; }
    .dialog details.manual summary { min-height: 44px; display: flex; align-items: center; }
    main :is(p, li, .hint, .label, .input, .select, kbd, .seg button, .chip, .muted, .lead, .note, .field-label, .place-sub,
        .place-change, .rows dt, .rows dd, .rows .sub, .wp-sub, .wp-dir, .legend, .course-title, .go-big span, .dial-note,
        .status, .view-tab, .shell-hint, .field > span:first-child, .field > label:first-child, .small, .error) { font-size: 1rem; }
    main .heading-sub span { font-size: 1rem; }
    .dialog button, .dialog .btn, .dialog select, .dialog input:not([type="checkbox"]):not([type="range"]), .dialog summary { min-height: 44px; }
    .dialog .dialog-close, .dialog .icon-btn { width: 44px; height: 44px; }
    .dialog :is(p, .hint, .label, .input, li, kbd, small, .field > span:first-child, h3) { font-size: 1rem; }
    .sight :is(.btn, p, li) { font-size: 1rem; }
    .sight .btn { min-height: 44px; }
}
