:root { color-scheme: dark; --bg:#161a20; --panel:#202630; --card:#29313c; --line:#394453; --text:#f5f7fa; --muted:#aeb7c4; --blue:#1976d2; --green:#18a558; --red:#b83b3b; --orange:#d17a18; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html,body { width:100%; height:100%; margin:0; font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif; background:var(--bg); color:var(--text); }
button,input,select { font:inherit; }
button { color:inherit; cursor:pointer; border:0; font-weight:700; }
.shell { height:100%; display:grid; grid-template-columns:82% 18%; }
.map-panel { position:relative; min-width:0; background:#101318; }
#map { width:100%; height:100%; border:0; display:block; }
.edition { position:absolute; left:16px; bottom:16px; z-index:2; padding:7px 10px; border:1px solid #ffffff30; border-radius:999px; background:#12171ddd; color:inherit; font-size:10px; font-weight:800; letter-spacing:.15em; text-decoration:none; }
.edition:hover { border-color:#ffffff80; background:#2b333ddd; }
.sidebar { display:flex; flex-direction:column; gap:9px; width:100%; height:100vh; min-height:0; padding:0; overflow-x:hidden; overflow-y:scroll; overscroll-behavior:contain; scrollbar-gutter:stable; border-left:1px solid var(--line); background:var(--panel); }
.sidebar > * { flex-shrink:0; }
.sidebar { scrollbar-color:#667589 #171c23; scrollbar-width:auto; }
.sidebar::-webkit-scrollbar { width:12px; }
.sidebar::-webkit-scrollbar-track { background:#171c23; }
.sidebar::-webkit-scrollbar-thumb { border:3px solid #171c23; border-radius:999px; background:#667589; }
.sidebar::-webkit-scrollbar-thumb:hover { background:#8191a6; }
header { display:flex; justify-content:space-between; gap:12px; align-items:start; margin-bottom:4px; }
.eyebrow { color:#7eb8ff; font-size:11px; font-weight:800; letter-spacing:.16em; }
h1 { margin:3px 0 0; font-size:21px; line-height:1.15; }
.icon { width:38px; height:38px; border-radius:8px; background:#394553; font-size:20px; }
.account-panel { display:grid; gap:7px; width:95%; }
.account-panel > button { min-height:43px; border-radius:6px; padding:10px 12px; text-align:left; }
.account { display:grid; grid-template-columns:30px minmax(0,1fr) auto; gap:8px; align-items:center; font-size:11px; }
.account img { width:30px; height:30px; border-radius:50%; }
.compact-account { min-height:34px; padding:7px 9px; text-align:center; }
.cloud-save-status { color:var(--muted); font-size:11px; }
.track-list { display:grid; gap:7px; min-height:160px; max-height:45vh; padding-right:4px; overflow-y:auto; overscroll-behavior:contain; scrollbar-color:#667589 #202630; scrollbar-width:thin; }
.track-list::-webkit-scrollbar { width:9px; }
.track-list::-webkit-scrollbar-track { background:#202630; }
.track-list::-webkit-scrollbar-thumb { border:2px solid #202630; border-radius:999px; background:#667589; }
.track-row { display:grid; gap:8px; padding:9px; border:1px solid transparent; border-radius:6px; background:#151a21; }
.track-row.active { border-color:#1976d2; background:#182331; }
.track-row-main { display:grid; gap:3px; min-width:0; padding:0; background:transparent; text-align:left; }
.track-row-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.track-row-time { color:var(--muted); font-size:10px; font-weight:400; }
.track-thumbnail { width:100%; max-width:160px; height:auto; aspect-ratio:16/9; border-radius:4px; background:#151a21; }
.track-row-actions { display:flex; flex-wrap:wrap; gap:4px; }
.track-row-actions button:first-child { flex:1; }
.track-row-actions button { padding:5px 7px; border-radius:4px; background:#465466; font-size:10px; }
.track-row-actions button:disabled { color:#8fbff1; background:#26394e; cursor:default; }
.track-row-actions .track-delete { background:#713636; }
.track-row-actions .track-save-as { background:#176b47; }
.track-row-actions .track-close { background:#5d4930; }
.top-new { width:95%; min-height:43px; border-radius:6px; padding:10px 12px; text-align:left; }
.flow-choice { display:grid; grid-template-columns:1fr 1fr; gap:7px; width:95%; margin:0; padding:0; border:0; }
.flow-choice label { display:flex; align-items:center; gap:8px; margin:0; padding:10px 12px; border:1px solid #4d5a69; border-radius:6px; background:#151a21; color:var(--text); font-size:11px; cursor:pointer; }
.flow-choice input { width:17px; height:17px; padding:0; accent-color:var(--blue); }
.direction-choice { grid-template-columns:repeat(3,minmax(0,1fr)); margin-top:7px; }
.direction-choice label { justify-content:center; gap:4px; padding:10px 4px; letter-spacing:0; }
.direction-choice input { flex-shrink:0; }
.direction-choice label:has(input:disabled) { opacity:.4; cursor:not-allowed; }
.card { width:95%; margin:0; border:1px solid #394453; border-radius:8px; overflow:hidden; background:var(--card); }
.card-title { display:flex; width:100%; justify-content:space-between; padding:13px; background:transparent; font-size:11px; letter-spacing:.08em; text-align:left; }
.card:not(.open) .card-body { display:none; }
.card:not(.open) .card-title span { transform:rotate(180deg); }
.card-body { max-height:none; padding:0 12px 12px; overflow:visible; overscroll-behavior:auto; scrollbar-gutter:auto; scrollbar-color:#667589 #202630; scrollbar-width:thin; font-size:14px; }
.card-body::-webkit-scrollbar { width:9px; }
.card-body::-webkit-scrollbar-track { background:#202630; }
.card-body::-webkit-scrollbar-thumb { border:2px solid #202630; border-radius:999px; background:#667589; }
.card-body::-webkit-scrollbar-thumb:hover { background:#8191a6; }
.line-editing .card-body { max-height:none; overflow:visible; overscroll-behavior:auto; scrollbar-gutter:auto; }
.advanced-editing .card-body { max-height:none; overflow:visible; overscroll-behavior:auto; scrollbar-gutter:auto; }
label { display:block; margin:7px 0 6px; color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.row,.two,.bearing { display:grid; grid-template-columns:1fr auto; gap:7px; }
.two { grid-template-columns:1fr 1fr; }
input,select { min-width:0; border:1px solid #4d5a69; border-radius:6px; padding:10px; background:#151a21; color:white; outline:none; }
input:focus { border-color:#65aaff; box-shadow:0 0 0 3px #1976d233; }
.actions { display:grid; gap:7px; }
.actions button,.secondary,.save { min-height:43px; border-radius:6px; padding:10px 12px; text-align:left; }
.primary { background:var(--blue); }.compact { border-radius:6px; padding:0 16px; }
.success { background:var(--green); }.danger { background:var(--red); }.warning { background:var(--orange); }.secondary { background:#465466; }.ghost { background:#6f2929; }
.bearing { grid-template-columns:1fr 70px 1fr; margin-bottom:7px; }
.bearing button { height:42px; border-radius:6px; background:#465466; font-size:21px; }
.bearing output { display:grid; place-items:center; border-radius:6px; background:#f4f6f8; color:#202630; font-weight:800; }
.status { margin-top:auto; padding:11px; border-radius:7px; background:#151a21; color:#dce3eb; font-size:13px; line-height:1.35; }
.save { position:sticky; z-index:4; bottom:0; flex:0 0 auto; background:#e04b32; text-align:center; text-transform:uppercase; letter-spacing:.08em; }
button:disabled { opacity:.42; cursor:not-allowed; }
.check { display:flex; align-items:center; gap:8px; text-transform:none; letter-spacing:0; font-size:12px; }
.check input { width:17px; height:17px; padding:0; accent-color:var(--blue); }
input[type="range"] { width:100%; padding:0; accent-color:var(--blue); }
label output { float:right; color:var(--text); }
.tool-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.tool-grid button { min-height:62px; border-radius:6px; text-align:center; font-size:18px; }
.tool-grid small { display:block; margin-top:4px; font-size:10px; }
.tool-grid button.active { outline:2px solid #65aaff; background:#1976d2; }
.metrics { display:grid; grid-template-columns:1fr 1fr; gap:5px 10px; padding:10px; border-radius:6px; background:#151a21; font-size:11px; }
.metrics output { text-align:right; font-weight:700; }
.sector-lengths { display:grid; gap:7px; }
.sector-length-row { display:grid; grid-template-columns:1fr minmax(0,2fr); align-items:center; gap:8px; }
.sector-length-row label { margin:0; }
.sector-length-row input { width:100%; }
.hint { padding:9px; border-radius:6px; background:#151a21; color:var(--muted); font-size:11px; }
@media (max-width:760px) { .shell { grid-template-columns:1fr; grid-template-rows:52vh 48vh; height:100vh; min-height:0; }.map-panel { min-height:0; }.sidebar { height:48vh; max-height:48vh; border-left:0; border-top:1px solid var(--line); }.edition { bottom:10px; } }

/* Fusion-inspired project data panel. */
.shell { grid-template-columns:15% minmax(0,1fr) 15%; transition:grid-template-columns .2s ease; }
.file-panel { z-index:5; display:flex; flex-direction:column; min-width:0; height:100vh; overflow:hidden; border-right:1px solid #394453; background:#171c23; }
.file-panel-header { display:flex; align-items:center; justify-content:space-between; min-height:54px; margin:0; padding:8px 9px 8px 12px; border-bottom:1px solid #394453; background:#202630; }
.file-panel-title { display:flex; align-items:center; gap:9px; min-width:0; }
.file-panel-title>div { display:grid; gap:2px; min-width:0; }
.file-panel-title strong { font-size:10px; letter-spacing:.12em; }
.file-panel-title small { color:var(--muted); font-size:9px; letter-spacing:.08em; }
.file-panel-mark { display:grid; place-items:center; width:27px; height:27px; color:#fff; background:var(--blue); font-size:13px; font-style:italic; font-weight:900; }
.file-panel-toggle { flex:0 0 32px; width:32px; height:32px; border-radius:5px; color:#dbe4ec; background:#394553; font-size:24px; line-height:1; }
.file-panel-content { display:flex; flex:1; flex-direction:column; gap:14px; min-height:0; padding:12px; overflow:hidden; }
.project-browser { display:flex; flex:1; flex-direction:column; gap:10px; min-height:0; }
.project-new { flex:0 0 auto; min-height:38px; border-radius:5px; background:var(--green); text-align:left; padding:8px 11px; font-size:11px; letter-spacing:.06em; }
.file-panel .track-list { flex:1; align-content:start; min-height:120px; max-height:none; padding-right:5px; }
.file-panel .track-row { position:relative; grid-template-columns:minmax(0,1fr) 30px; align-items:center; gap:6px; padding:10px; border-color:#303a46; background:#202630; }
.file-panel .track-row.active { border-color:#65aaff; box-shadow:inset 4px 0 #2f9cff,0 0 0 1px #2f9cff55; background:#263b51; }
.file-panel .track-row.active .track-row-name { display:-webkit-box; overflow:hidden; white-space:normal; overflow-wrap:anywhere; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; }
.track-menu-toggle { width:30px; height:30px; border-radius:5px; color:#dbe4ec; background:transparent; font-size:20px; line-height:1; }
.track-menu-toggle:hover,.track-menu-toggle[aria-expanded="true"] { background:#394553; }
.file-panel .track-row-actions { position:absolute; z-index:20; top:40px; right:8px; display:grid; width:132px; padding:5px; border:1px solid #526071; border-radius:6px; background:#252d37; box-shadow:0 12px 24px #0008; }
.file-panel .track-row-actions[hidden] { display:none; }
.file-panel .track-row-actions button,.file-panel .track-row-actions button:first-child { width:100%; min-height:32px; padding:7px 9px; border-radius:3px; background:transparent; text-align:left; font-size:10px; font-weight:600; }
.file-panel .track-row-actions button:hover:not(:disabled) { background:#3a4654; }
.file-panel .track-row-actions button:disabled { color:#7e8a98; background:transparent; }
.file-panel .track-row-actions .track-delete { color:#ffaaa5; }
.file-panel .track-row-actions .track-save-as { color:#9ee0bd; }
.file-panel .track-row-actions .track-save-now { color:#83c4ff; }
.file-panel .track-row-actions .track-close { color:#e5c18f; }
.file-actions { display:grid; grid-template-columns:1fr auto; flex:0 0 auto; gap:7px; padding-top:10px; border-top:1px solid #394453; }
.file-actions button { min-height:34px; border-radius:5px; padding:7px 9px; text-align:left; font-size:9px; }
.file-panel-collapsed { grid-template-columns:48px minmax(0,1fr) 15%; }
.file-panel-collapsed .file-panel { background:#202630; }
.file-panel-collapsed .file-panel-header { justify-content:center; padding:8px; }
.file-panel-collapsed .file-panel-title,.file-panel-collapsed .file-panel-content { display:none; }
@media (max-width:1000px) { .shell { grid-template-columns:15% minmax(0,1fr) 15%; }.file-panel-collapsed { grid-template-columns:48px minmax(0,1fr) 15%; } }
@media (max-width:760px) { .shell,.file-panel-collapsed { position:relative; grid-template-columns:1fr; grid-template-rows:52vh 48vh; }.file-panel { position:absolute; top:0; bottom:48vh; left:0; width:min(310px,82vw); height:auto; box-shadow:12px 0 28px #0008; }.file-panel-collapsed .file-panel { width:48px; }.sidebar { grid-row:2; }.map-panel { grid-row:1; } }
@media (prefers-reduced-motion:reduce) { .shell { transition:none; } }

/* Whole-editor light theme, controlled by the existing map theme toggle. */
body.light-mode { --bg:#e4e8ec; --panel:#eef1f4; --card:#fff; --line:#b8c1ca; --text:#1d2832; --muted:#63717e; color-scheme:light; }
body.light-mode .file-panel { border-color:var(--line); background:#dce2e7; }
body.light-mode .file-panel-header,body.light-mode .file-panel-collapsed .file-panel { border-color:var(--line); background:#eef1f4; }
body.light-mode .sidebar { border-color:var(--line); background:var(--panel); scrollbar-color:#98a5b0 #dce2e7; }
body.light-mode .sidebar::-webkit-scrollbar-track { background:#dce2e7; }
body.light-mode .sidebar::-webkit-scrollbar-thumb { border-color:#dce2e7; background:#98a5b0; }
body.light-mode .card,body.light-mode .track-row,body.light-mode .flow-choice label { border-color:var(--line); background:#fff; }
body.light-mode .file-panel .track-row { border-color:#bdc6ce; background:#f7f9fa; }
body.light-mode .file-panel .track-row.active { border-color:#1976d2; background:#e0eefb; box-shadow:inset 4px 0 #1976d2,0 0 0 1px #1976d233; }
body.light-mode .track-row-actions { border-color:#9da9b4; background:#fff; box-shadow:0 12px 24px #23303d2e; }
body.light-mode .file-panel .track-row-actions button:hover:not(:disabled) { background:#e5ebf0; }
body.light-mode .track-menu-toggle { color:#26333d; }
body.light-mode .track-menu-toggle:hover,body.light-mode .track-menu-toggle[aria-expanded="true"],body.light-mode .icon { color:#1d2832; background:#d2dae1; }
body.light-mode input,body.light-mode select,body.light-mode .hint,body.light-mode .status { border-color:#aeb9c3; color:#1d2832; background:#fff; }
body.light-mode .secondary { color:#fff; background:#596979; }
body.light-mode .card-title { color:#1d2832; }
body.light-mode .bearing output { color:#1d2832; background:#fff; }
body.light-mode .cloud-save-status,body.light-mode .track-row-time,body.light-mode label { color:#63717e; }
body.light-mode .file-actions { border-color:var(--line); }
body.light-mode .status { color:#34424e; }

/* Readable, normalized editor typography. */
html,body { font-size:13px; line-height:1.4; }
.eyebrow { font-size:12px; letter-spacing:.13em; }
.file-panel-title strong { font-size:11px; letter-spacing:.1em; }
.file-panel-title small { font-size:10px; }
.cloud-save-status { font-size:11px; line-height:1.45; }
.project-new { font-size:11px; }
.track-row-name { font-size:12px; line-height:1.35; }
.track-row-time { font-size:10px; line-height:1.35; }
.file-panel .track-row-actions button,.file-panel .track-row-actions button:first-child { font-size:11px; line-height:1.25; }
.file-actions button { font-size:10px; }
.card-title { font-size:12px; line-height:1.3; letter-spacing:.065em; }
.card-body { font-size:13px; }
label { font-size:11px; line-height:1.35; letter-spacing:.065em; }
.flow-choice label { font-size:11px; }
.hint { font-size:11px; line-height:1.45; }
.status { font-size:12px; line-height:1.45; }
.track-row-actions { line-height:1.3; }
.tool-grid small { font-size:10px; }
.metrics { font-size:11px; }
.edition { font-size:10px; }
@media (max-width:760px) { html,body { font-size:13px; }.file-panel-title strong { font-size:10px; }.card-title { font-size:11px; } }

/* Compact right workflow panel and 13px maximum interface type. */
.sidebar { gap:6px; font-size:12px; }
.sidebar * { font-size:12px !important; }
.sidebar header { min-height:34px; margin-bottom:2px; }
.sidebar button,.sidebar input,.sidebar select,.sidebar output,.sidebar label,.sidebar small,.sidebar .card-body,.sidebar .status { font-size:12px; }
.sidebar .eyebrow { font-size:12px; }
.sidebar .icon { width:32px; height:32px; }
.sidebar .account-panel { gap:4px; }
.sidebar .card-title { padding:10px; font-size:12px; }
.sidebar .card-body { padding:0 9px 9px; }
.sidebar .actions { gap:5px; }
.sidebar .actions button,.sidebar .secondary,.sidebar .save { min-height:36px; padding:8px 9px; }
.sidebar input,.sidebar select { padding:8px; }
.sidebar .flow-choice { gap:5px; }
.sidebar .flow-choice label { min-height:36px; padding:7px 9px; }
.sidebar .bearing { grid-template-columns:1fr 58px 1fr; gap:5px; margin-bottom:5px; }
.sidebar .bearing button { height:36px; }
.sidebar .tool-grid { gap:5px; }
.sidebar .tool-grid button { min-height:50px; font-size:12px; }
.sidebar .status { padding:8px; font-size:12px; }
.sidebar .save { min-height:38px; font-size:12px; }
.file-panel-toggle,.track-menu-toggle { font-size:13px; }
.sector-total.warning { color:#ff6b5f; }

/* Compact location/view controls. */
.sidebar .location-view-card .card-title { min-height:28px; padding:6px 9px; font-size:12px !important; }
.sidebar .location-view-card button,.sidebar .location-view-card label,.sidebar .location-view-card input,.sidebar .location-view-card output { font-size:9px !important; }
.sidebar .location-view-card .card-body { padding:0 8px 7px; }
.sidebar .location-view-card label { margin:3px 0 2px; font-size:9px; }
.sidebar .location-view-card .flow-choice { width:100%; gap:3px; margin-bottom:3px; }
.sidebar .location-view-card .flow-choice label { min-height:24px; margin:0; padding:3px 6px; font-size:9px; }
.sidebar .location-view-card .flow-choice input { width:12px; height:12px; }
.sidebar .location-view-card .row { grid-template-columns:minmax(0,1fr) auto; gap:3px; width:100%; }
.sidebar .location-view-card .row input { width:100%; height:28px; padding:4px 7px; }
.sidebar .location-view-card .row button { min-height:28px; height:28px; padding:3px 9px; }
.sidebar .location-view-card .bearing { grid-template-columns:1fr 45px 1fr; gap:3px; margin-bottom:0; }
.sidebar .location-view-card .bearing button { min-height:26px; height:26px; padding:2px 5px; }
.sidebar .location-view-card .bearing output { min-height:26px; }

/* Consent banner; all editor content is masked from Clarity recordings. */
.cookie-banner{position:fixed;z-index:1000;right:16px;bottom:16px;left:16px;display:flex;align-items:center;justify-content:space-between;gap:24px;max-width:1080px;margin:auto;padding:18px 20px;border:1px solid #53606b;color:#eef2f4;background:#171d25;box-shadow:0 18px 55px #0009}.cookie-banner strong{font-size:14px}.cookie-banner p{max-width:680px;margin:5px 0 0;color:#aab4bc;font-size:12px;line-height:1.5}.cookie-actions{display:flex;align-items:center;gap:12px;flex:none}.cookie-actions a{color:#66d9e8;text-decoration:underline;font-size:11px}.cookie-actions button{min-height:40px;padding:0 14px;border:0;color:#fff;background:#d92d28;font-weight:800;cursor:pointer}.cookie-actions .cookie-essential{color:#eef2f4;background:#303943;border:1px solid #596672}@media(max-width:700px){.cookie-banner{align-items:stretch;flex-direction:column}.cookie-actions{justify-content:space-between;flex-wrap:wrap}}

.mobile-editor-notice { display:none; }
html.phone-editor-notice .shell { display:none; }
html.phone-editor-notice .mobile-editor-notice { position:fixed; inset:0; z-index:900; display:flex; align-items:center; justify-content:center; overflow-y:auto; padding:24px; background:var(--bg); }
.mobile-editor-message { width:100%; max-width:420px; margin:auto; text-align:center; }
.mobile-editor-message h1 { margin:0 0 16px; font-size:26px; line-height:1.2; }
.mobile-editor-message p { margin:0 0 24px; color:var(--muted); font-size:16px; line-height:1.6; }
.mobile-editor-message a { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:12px 20px; border-radius:6px; background:var(--blue); color:white; font-size:16px; font-weight:700; text-decoration:none; }
.mobile-editor-message a:focus-visible { outline:2px solid white; outline-offset:4px; }
#elevation-profile { width:100%; height:auto; background:#171c23; border-radius:6px; margin:8px 0; }
#elevation-warnings button { font-size:11px; text-align:left; margin:3px 0; }
