/* GeoVision 360 v1.0.0 – stylesheet
   Copyright © 2026 Haglöf Sweden AB. All rights reserved. */
/* Instrument-style tool, same family as Stockpile360: control column left, views right; stacks on phones */
:root {
  --bg: #eceee9; --panel: #f8f9f6; --sunk: #e2e6e0; --ink: #1c2420; --muted: #5a665f; --line: #cbd2cb;
  --accent: #00497f; --accent-ink: #ffffff; --accent-soft: #d5e3ef; --base: #c8501a; --pt: #26302b; --roof: #2f7fb0;
  --warn: #8a5a00; --warn-bg: #fbefd2; --bad: #a3261b; --wall: #d9d4c7;
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "Barlow Semi Condensed", "Segoe UI", system-ui, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 6px; color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121715; --panel: #1a201d; --sunk: #0e1211; --ink: #e4eae6; --muted: #93a098; --line: #2d3732;
  --accent: #5aa2dc; --accent-ink: #04121f; --accent-soft: #122e47; --base: #ee7a3e; --pt: #dfe6e1; --roof: #6fb6e0;
  --warn: #f0c35a; --warn-bg: #3a2e12; --bad: #ff8a7a; --wall: #4a4740; color-scheme: dark } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.4; }
.app { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; padding-block: 16px 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 1600px; margin: 0 auto; }
@media (max-width: 900px) { .app { grid-template-columns: minmax(0, 1fr); } }

header.brand { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.brandlogo { display: inline-flex; align-items: center; line-height: 0; }
.brandlogo img { height: 46px; width: auto; display: block; }
.brandlogo .lg-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brandlogo .lg-light { display: none; } :root:not([data-theme="light"]) .brandlogo .lg-dark { display: block; } }
@media (max-width: 560px) { .brandlogo img { height: 34px; } }
.wordmark svg { width: 46px; height: 46px; flex: none; }
.wordmark h1 { font-family: var(--font-display); font-weight: 700; font-size: 34px; letter-spacing: .03em; margin: 0; text-transform: uppercase; line-height: 1; }
.wordmark h1 span { color: var(--accent); }
.brand .ver { font-family: var(--font-data); font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; align-self: center; }
.brand > p { flex: 1 1 240px; min-width: 0; margin: 0; color: var(--muted); font-size: 14px; }
.brand .logo { display: inline-flex; align-self: center; }
.brand .logo img { height: 34px; width: auto; aspect-ratio: 98.57 / 43.8; display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand .logo img { filter: brightness(0) invert(1); } }
.seg.langseg { width: auto; flex: none; }
.langseg button { padding: 3px 9px; font-size: 13px; font-family: var(--font-data); }

aside { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.panel h2 { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 14px; margin: 0; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.drop { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 14px; text-align: center; cursor: pointer; background: var(--sunk); transition: border-color .15s, background .15s; }
.drop:hover, .drop:focus-visible, body.dragging .drop { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.drop strong { display: block; font-size: 16px; }
.drop small { color: var(--muted); }
.examples { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 13px; color: var(--muted); }
.field { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); align-items: center; gap: 8px; }
.field label { color: var(--muted); font-size: 14px; }
input[type="text"], input[type="number"], input[type="date"], select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; width: 100%; min-width: 0; }
textarea { resize: vertical; min-height: 54px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; width: 100%; }
.seg button { flex: 1; border: 0; border-radius: 0; background: var(--bg); color: var(--ink); padding: 6px 8px; font: inherit; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg button:not([aria-pressed="true"]):hover { background: var(--accent-soft); }
button.btn { font: inherit; font-weight: 500; border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 6px 12px; border-radius: 4px; cursor: pointer; }
button.btn:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
button.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.btn.primary:not(:disabled):hover { filter: brightness(1.08); color: var(--accent-ink); }
button.btn.small { padding: 3px 8px; font-size: 13px; }
a.btn { font: inherit; font-weight: 500; border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 3px 10px; font-size: 13px; border-radius: 4px; text-decoration: none; display: inline-block; }
a.btn:hover { border-color: var(--accent); color: var(--accent); }
button.btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.btn:disabled { opacity: .4; cursor: not-allowed; }
button.link { border: 0; background: none; color: var(--accent); font: inherit; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chkrow { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); cursor: pointer; }
.chkrow input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
dl.meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; margin: 0; font-size: 14px; }
dl.meta dt { color: var(--muted); }
dl.meta a.osm { font-family: var(--font-body); font-size: 14px; color: var(--accent); }
dl.meta dd { margin: 0; font-family: var(--font-data); font-size: 13px; overflow-wrap: anywhere; }
.customcrs { display: flex; flex-direction: column; gap: 6px; border-left: 2px solid var(--accent-soft); padding-left: 10px; }
.customcrs small { color: var(--muted); }
details.adv summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details.adv[open] summary { margin-bottom: 8px; }
details.adv .field { margin-bottom: 8px; }

.result { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(5, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.result > div { padding: 12px 14px; border-left: 1px solid var(--line); min-width: 0; }
.result > div:first-child { border-left: 0; background: var(--ink); color: var(--panel); }
.result .k { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--muted); font-weight: 600; }
.result > div:first-child .k { color: inherit; opacity: .75; }
.result .v { font-family: var(--font-data); font-size: 21px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result .v.big { font-size: 38px; line-height: 1.1; }
.result .sub { font-size: 13px; color: var(--muted); }
.result > div:first-child .sub { color: inherit; opacity: .8; }
.result.wall { grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); }
.tables.one { grid-template-columns: minmax(0, 1fr); }
.result .empty { grid-column: 1 / -1; background: var(--panel) !important; color: var(--muted) !important; padding: 18px; }
@media (max-width: 1250px) { .result, .result.wall { grid-template-columns: repeat(3, minmax(0, 1fr)); } .result > div:first-child { grid-column: 1 / -1; } .result > div:nth-child(3n+2) { border-left: 0; } .result > div:nth-child(n+2) { border-top: 1px solid var(--line); } }
@media (max-width: 560px) { .result, .result.wall { grid-template-columns: repeat(2, minmax(0, 1fr)); } .result > div:nth-child(n) { border-left: 1px solid var(--line); } .result > div:nth-child(2n) { border-left: 0; } .result > div:first-child { border-left: 0; } }
.warns { display: flex; flex-direction: column; gap: 6px; }
.warn { background: var(--warn-bg); color: var(--warn); border-radius: 4px; padding: 8px 10px; font-size: 14px; }
.error { background: var(--warn-bg); color: var(--bad); border-radius: 4px; padding: 8px 10px; font-size: 14px; }

.viewcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-width: 0; }
.viewbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.viewbar h3 { margin: 0; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .08em; font-size: 14px; font-weight: 600; }
.viewbar .grow { flex: 1; }
label.chk { display: inline-flex; gap: 5px; align-items: center; font-size: 14px; color: var(--muted); cursor: pointer; }
label.chk input { accent-color: var(--accent); margin: 0; }
.canvaswrap { position: relative; min-width: 0; }
canvas { display: block; width: 100%; touch-action: none; }
#plan { height: min(60vh, 600px); min-height: 340px; cursor: crosshair; }
#plan.panning { cursor: grabbing; }
#elev { height: 260px; }
#v3wrap { height: min(62vh, 560px); min-height: 340px; position: relative; cursor: grab; touch-action: none; }
#v3wrap.drag { cursor: grabbing; }
#v3wrap canvas { width: 100% !important; height: 100% !important; }
.v3msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 15px; pointer-events: none; text-align: center; padding: 20px; }
.view3dbtns { display: flex; flex-wrap: wrap; gap: 4px; }
.view3dbtns .btn { min-width: 34px; }
.zoombtns { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.zoombtns button { width: 32px; height: 32px; font-size: 17px; padding: 0; background: var(--panel); }
.zoombtns .zsep { height: 6px; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--panel); font-family: var(--font-data); font-size: 12px; padding: 5px 7px; border-radius: 4px; white-space: nowrap; transform: translate(12px, -110%); z-index: 2; }
.hint { font-size: 13px; color: var(--muted); padding: 6px 12px 10px; }
.selbox { border-top: 1px solid var(--line); padding: 8px 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.selbox code { font-family: var(--font-data); font-size: 13px; }
.selbox .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 12px 4px; border-top: 1px solid var(--line); }
.filterbar .flabel { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 600; color: var(--muted); }
.legendrow { display: flex; flex-wrap: wrap; gap: 6px; }
.fbtn { font: inherit; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 3px 10px 3px 8px; cursor: pointer; user-select: none; }
.fbtn:hover { border-color: var(--accent); }
.fbtn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.fbtn[aria-pressed="false"] { opacity: .55; }
.fbtn[aria-pressed="false"] .lbl { text-decoration: line-through; }
.fbtn .n { font-family: var(--font-data); font-size: 12px; color: var(--muted); }
.fbtn:disabled { opacity: .3; cursor: default; }
.fbtn i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; }
.fbtn i.dot { border-radius: 50%; }
.fquick { font-size: 13px; color: var(--muted); margin-left: auto; }

.tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .tables { grid-template-columns: minmax(0, 1fr); } }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data th:first-child, table.data td:first-child, table.data th.l, table.data td.l { text-align: left; }
table.data td { font-family: var(--font-data); font-size: 13px; }
table.data th { font-weight: 500; color: var(--muted); }
table.data tbody tr { cursor: default; }
table.data tbody tr:hover td, table.data tbody tr.hl td { background: var(--accent-soft); }
table.data tfoot td { font-weight: 600; border-bottom: 0; border-top: 2px solid var(--line); }
table.data tr.active td { color: var(--accent); font-weight: 500; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.tblwrap { overflow-x: auto; }

footer { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
footer .copy { margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
footer a { color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 8px 14px; border-radius: 4px; font-size: 14px; z-index: 20; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
