/* Terrain module (/terrain). Uses the tokens from brand.css. */
.tr-hero{display:flex; justify-content:space-between; align-items:flex-end; gap:20px; max-width:none;}
.tr-hero > div:first-child{max-width:640px;}

.tr-lang{display:flex; gap:4px; padding:4px; border-radius:10px; background:var(--nivelle);
  border:1px solid var(--hairline); flex:none;}
.tr-lang input{position:absolute; opacity:0; pointer-events:none;}
.tr-lang span{display:block; padding:.35rem .8rem; border-radius:7px; font-size:.82rem;
  font-weight:600; color:var(--navaris); cursor:pointer;}
.tr-lang input:checked + span{background:var(--noxen); color:#fff;}
.tr-lang input:focus-visible + span{outline:2px solid var(--cymaris); outline-offset:2px;}

.tr-drop{display:flex; flex-direction:column; align-items:center; gap:4px; padding:26px 20px;
  border:1.5px dashed var(--cymaris); border-radius:var(--radius); background:var(--nivelle);
  cursor:pointer; text-align:center; transition:background .15s, border-color .15s;}
.tr-drop:hover, .tr-drop.is-over{background:var(--claria); border-color:var(--navaris);}
.tr-drop:focus-within{outline:2px solid var(--cymaris); outline-offset:2px;}
.tr-drop b{font-size:1.05rem;}
.tr-drop span{color:var(--muted); font-size:.9rem;}
.tr-drop.is-busy{opacity:.6; pointer-events:none;}
.tr-drop.is-small{flex-direction:row; justify-content:center; gap:10px; padding:12px 16px;}

.tr-msg{margin:12px 0 0; padding:10px 14px; border-radius:10px; background:#fdecea; color:#8a1f17;
  font-size:.92rem;}

.tr-head{margin:30px 0 16px;}
.tr-head h2{margin:0; font-size:clamp(1.4rem,3vw,1.9rem); letter-spacing:-.01em;}
.tr-head p{margin:4px 0 0; color:var(--muted); font-size:.95rem;}

.tr-card{background:#fff; border:1px solid var(--hairline); border-radius:var(--radius);
  box-shadow:var(--shadow);}
/* the 3D view and the figures side by side, the controls in a full-width card under both */
.tr-main{display:grid; grid-template-columns:minmax(0,1fr) 300px; grid-template-areas:"view stats" "tools tools"; gap:18px; align-items:start;}

.tr-view{grid-area:view; overflow:hidden;}
.tr-stats{grid-area:stats;}
.tr-canvas{position:relative; height:min(62vh,560px); min-height:340px;
  background:linear-gradient(#f6fafc,#e9eff3); touch-action:none;}
.tr-canvas canvas{display:block; width:100%; height:100%;}
.tr-north{position:absolute; top:12px; right:12px; width:40px; height:40px; pointer-events:none;}
.tr-zoom{position:absolute; right:12px; bottom:12px; display:flex; flex-direction:column;
  border-radius:10px; overflow:hidden; border:1px solid var(--hairline); background:#fff;}
.tr-zoom button{width:36px; height:36px; border:0; background:#fff; font:inherit; font-size:1.2rem;
  font-weight:600; color:var(--noxen); cursor:pointer;}
.tr-zoom button + button{border-top:1px solid var(--hairline);}
.tr-zoom button:hover{background:var(--nivelle);}
.tr-legend{position:absolute; left:12px; bottom:12px; display:flex; align-items:center; gap:6px;
  padding:5px 9px; border-radius:8px; background:rgba(255,255,255,.9); font-size:.74rem;
  font-weight:600; color:var(--noxen); pointer-events:none;}
.tr-legend i{width:74px; height:8px; border-radius:4px;
  background:linear-gradient(90deg,#2f6f73,#6fa58a,#c5d59a,#ead9a0,#d6a46b,#a8693f);}
.tr-legend[hidden]{display:none;}

.tr-tools{grid-area:tools; display:flex; flex-wrap:wrap; gap:12px 20px; align-items:flex-end;
  justify-content:space-between; padding:16px 18px;}
.tr-toggles{order:3; flex:1 1 100%;}
/* a slider field: one line of label + value, then the slider (and its buttons) on a 34 px line */
.tr-field{display:flex; flex-direction:column; gap:6px; min-width:0;}
.tr-exag{flex:0 1 300px;}
.tr-fhead{display:flex; align-items:baseline; gap:8px; margin:0; font-size:.8rem; color:var(--muted);}
.tr-fhead b{color:var(--noxen); font-weight:600; font-size:.86rem; font-variant-numeric:tabular-nums;}
.tr-fline{display:flex; align-items:center; gap:10px; height:34px;}
/* sliders drawn here, not by the browser: a thin track and a round handle */
input.tr-range{flex:1; min-width:0; height:24px; margin:0; padding:0; border:0; background:transparent;
  -webkit-appearance:none; appearance:none; cursor:pointer; --tr:#E6EDF2;}
.tr-range::-webkit-slider-runnable-track{height:6px; border-radius:3px; background:var(--tr); box-shadow:inset 0 0 0 1px var(--hairline);}
.tr-range::-moz-range-track{height:6px; border-radius:3px; background:var(--tr); box-shadow:inset 0 0 0 1px var(--hairline);}
.tr-range::-webkit-slider-thumb{-webkit-appearance:none; width:18px; height:18px; margin-top:-6px; border-radius:50%;
  background:#fff; border:2px solid var(--noxen); box-shadow:0 1px 3px rgba(10,37,54,.25);}
.tr-range::-moz-range-thumb{width:14px; height:14px; border-radius:50%; background:#fff; border:2px solid var(--noxen); box-shadow:0 1px 3px rgba(10,37,54,.25);}
input.tr-range:focus-visible{outline:none;}
.tr-range:focus-visible::-webkit-slider-thumb{outline:2px solid var(--cymaris); outline-offset:2px;}
.tr-range:focus-visible::-moz-range-thumb{outline:2px solid var(--cymaris); outline-offset:2px;}
/* the time slider: daylight over the terrain in yellow, night grey; the handle is the sun */
input.tr-range--day{--tr:linear-gradient(90deg,#E6EDF2 var(--day-a,0%),#F6C453 var(--day-a,0%),#F6C453 var(--day-b,0%),#E6EDF2 var(--day-b,0%));}
.tr-range--day::-webkit-slider-thumb{background:#ffc533; border-color:#fff; box-shadow:0 0 0 1px var(--hairline),0 1px 3px rgba(10,37,54,.25);}
.tr-range--day::-moz-range-thumb{background:#ffc533; border-color:#fff; box-shadow:0 0 0 1px var(--hairline),0 1px 3px rgba(10,37,54,.25);}
.tr-toggles{display:flex; flex-wrap:wrap; gap:6px 16px;}
.tr-chk{display:inline-flex; align-items:center; gap:6px; font-size:.86rem; cursor:pointer;
  min-height:28px;}
.tr-chk input{width:16px; height:16px; accent-color:var(--noxen); margin:0;}
.tr-chk:has(input:disabled){color:var(--muted); cursor:default;}
.tr-key{width:14px; height:3px; border-radius:2px; display:inline-block;}
.tr-key--dls{background:#c2255c;}
.tr-btns{display:flex; gap:8px;}
.tr-btn{font:inherit; font-size:.84rem; font-weight:600; padding:.45rem .8rem; border-radius:8px;
  border:1px solid var(--hairline); background:#fff; color:var(--noxen); cursor:pointer;
  white-space:nowrap;}
.tr-btn:hover{border-color:var(--navaris);}

.tr-stats{padding:18px;}
.tr-stat{margin-bottom:14px;}
.tr-stat span{display:block; font-size:.78rem; color:var(--muted);}
.tr-stat b{display:block; font-size:1.12rem; font-variant-numeric:tabular-nums;}
.tr-stat.is-big b{font-size:1.7rem; line-height:1.15;}
.tr-classes{border-top:1px solid var(--hairline); padding-top:12px; margin-top:2px;}
.tr-classes h4{margin:0 0 8px; font-size:.78rem; font-weight:500; color:var(--muted);}
.tr-class{display:grid; grid-template-columns:16px 1fr auto; gap:8px; align-items:center;
  font-size:.86rem; padding:3px 0;}
.tr-class i{width:10px; height:10px; margin-left:3px; border-radius:50%; box-shadow:inset 0 0 0 1px rgba(10,37,54,.15);}
.tr-class b{font-variant-numeric:tabular-nums;}
.tr-bar{grid-column:2 / 4; height:4px; border-radius:2px; background:var(--nivelle); overflow:hidden;}
.tr-bar u{display:block; height:100%; border-radius:2px;}

.tr-profiles{margin-top:18px; padding:18px;}
.tr-profiles-head h3{margin:0; font-size:1.1rem;}
.tr-profiles-head p{margin:2px 0 10px; color:var(--muted); font-size:.84rem;}
.tr-scroll{overflow-x:auto; -webkit-overflow-scrolling:touch;}
#tr-profiles{min-width:680px;}
.tr-profile{margin-top:14px;}
.tr-profile h4{margin:0 0 2px; font-size:.95rem;}
.tr-profile svg{display:block; width:100%; height:auto; font-family:var(--font-ui);}

/* contour file (DLS 2019 KMZ) */
.tr-key--f19{background:#1864ab;} .tr-key--above{background:#e8590c; height:4px;} .tr-key--below{background:#0ca678; height:4px;}
.tr-filebar{order:3; flex:1 1 100%; display:flex; flex-wrap:wrap; align-items:flex-start; gap:8px 14px;}
.tr-filebtn{flex:none; display:inline-flex; align-items:center;}
.tr-filebtn:focus-within{outline:2px solid var(--cymaris); outline-offset:2px;}
.tr-fnote{flex:1 1 280px; margin:0; font-size:.8rem; color:var(--muted); line-height:1.5;}
.tr-fnote b{color:var(--noxen); font-weight:600; word-break:break-all;}
.tr-fnote small{display:block; margin-top:4px; font-size:.76rem;}
.tr-fkeys{display:flex; flex-wrap:wrap; gap:2px 14px; margin-top:4px; color:var(--noxen);}
.tr-fkeys span{display:inline-flex; align-items:center; gap:6px;}
.tr-ferr{color:#8a1f17;}

/* sun and shade */
.tr-btn--main{background:var(--noxen); border-color:var(--noxen); color:#fff;}
.tr-btn--main:hover{background:var(--navaris); border-color:var(--navaris);}
.tr-btn--main:disabled{opacity:.7; cursor:progress;}
.tr-btn--sm{font-size:.78rem; padding:.3rem .65rem;}
.tr-legend--sun i{background:linear-gradient(90deg,#272a5c,#55358a,#9c3f7d,#d4613f,#f2a23a,#fbe08a);}
.tr-sunnow{position:absolute; left:12px; top:12px; right:64px; width:fit-content; margin:0; padding:5px 10px;
  border-radius:8px; background:rgba(255,255,255,.92); font-size:.76rem; font-weight:600; color:var(--noxen);
  pointer-events:none; font-variant-numeric:tabular-nums;}
.tr-sunnow[hidden]{display:none;}
/* sun bar: first in the controls card, date and time side by side, label / slider / buttons rows aligned */
.tr-sunbar{order:-1; flex:1 1 100%; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px 28px;
  padding-bottom:14px; border-bottom:1px dashed var(--hairline);}
.tr-sunbar[hidden]{display:none;}
.tr-presets{display:flex; flex-wrap:wrap; gap:6px;}
.tr-presets .tr-btn, .tr-play{height:34px; padding-top:0; padding-bottom:0; display:inline-flex; align-items:center; justify-content:center;}
.tr-play{flex:none; width:42px; padding:0; font-size:.8rem;}

.tr-sun{margin-top:18px; padding:18px;}
.tr-sun-head{display:flex; justify-content:space-between; align-items:flex-start; gap:12px 20px; flex-wrap:wrap;}
.tr-sun-head h3{margin:0; font-size:1.1rem;}
.tr-sun-head p{margin:2px 0 0; color:var(--muted); font-size:.84rem; max-width:620px;}
.tr-sun-grid{display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px 24px; margin-top:14px; align-items:start;}
.tr-sun-fig{margin:0; min-width:0;}
#tr-sun-chart svg{display:block; font-family:var(--font-ui);}
.tr-sun-keys{display:flex; flex-wrap:wrap; gap:4px 14px; margin-top:6px; font-size:.78rem; color:var(--muted);}
.tr-sun-keys span{display:inline-flex; align-items:center; gap:6px;}
.sc-key{display:inline-block; width:16px; height:3px; border-radius:2px; background:var(--c); flex:none;}
.tr-sun-table th .sc-key{margin-right:7px; vertical-align:middle;}
.sc-dec{--c:#3f6fb0;} .sc-eq{--c:#2f8f8f;} .sc-jun{--c:#d9822b;} .sc-day{--c:#EB6834;}
.sc-hzkey{height:10px; background:#cbb89c;}
.sc-offkey{background:none; border-top:2px dashed var(--muted); height:0;}
.sc-grid{stroke:#D7E0E6; stroke-width:.8;}
.sc-ax{fill:#6E8597; font-size:11px; font-variant-numeric:tabular-nums;}
.sc-hz{fill:#cbb89c; opacity:.55;}
.sc-arc{fill:none; stroke:var(--c); stroke-width:2.2; stroke-linejoin:round; stroke-linecap:round;}
.sc-arc.sc-day{stroke-width:3;}
.sc-arc.off{stroke-dasharray:2 5; opacity:.7;}
.sc-dot{fill:var(--c);}
.sc-hr{fill:var(--noxen); font-size:11px; font-weight:600; paint-order:stroke; stroke:#fff; stroke-width:3px;}
.sc-sun{fill:#ffc533; stroke:#fff; stroke-width:2;}
.sc-sun.off{fill:#e6dcc4;}
.tr-sun-side{min-width:0;}
.tr-sun-table{width:100%; border-collapse:collapse; font-size:.82rem; font-variant-numeric:tabular-nums;}
.tr-sun-table th, .tr-sun-table td{padding:7px 10px 7px 0; text-align:left; vertical-align:top; border-bottom:1px solid var(--hairline);}
.tr-sun-table thead th{font-size:.76rem; font-weight:500; color:var(--muted);}
.tr-sun-table thead small{display:block; font-size:.7rem; font-weight:400;}
.tr-sun-table tbody th{font-weight:500; white-space:nowrap;}
.tr-sun-table td{white-space:nowrap;}
.tr-sun-table b{font-weight:600;}
.tr-sun-table tr.is-day th{font-weight:600;}
.tr-sun-map{margin-top:14px; padding:12px; border-radius:10px; background:var(--nivelle);}
.tr-sun-map .tr-chk{font-weight:600;}
.tr-sun-map select{display:block; margin:6px 0 0; width:100%; max-width:320px; font:inherit; font-size:.86rem;
  padding:.4rem .5rem; border-radius:8px; border:1px solid var(--hairline); background:#fff; color:var(--noxen);}
#tr-sunmap-stat{margin:8px 0 0; font-size:.84rem; color:var(--noxen);}
#tr-sunmap-stat:empty{display:none;}
.tr-sun-note{margin:14px 0 0; color:var(--muted); font-size:.8rem; line-height:1.5;}

.tr-foot{margin:18px 0 0; color:var(--muted); font-size:.8rem; line-height:1.55;}
.tr-foot b{color:var(--noxen);}
.tr-foot a{color:var(--navaris);}

@media (max-width:900px){
  .tr-main{grid-template-columns:1fr; grid-template-areas:"view" "tools" "stats";}
  .tr-sun-grid{grid-template-columns:1fr;}
  .tr-stats{display:grid; grid-template-columns:1fr 1fr; gap:0 18px;}
  .tr-stats .tr-classes{grid-column:1 / -1;}
}
@media (max-width:640px){
  .tr-hero{flex-direction:column; align-items:flex-start;}
  .tr-canvas{height:58vh; min-height:300px;}
  .tr-chk{min-height:34px;}
  .tr-btn{padding:.6rem .9rem;}
  .tr-btn--sm{padding:.45rem .7rem;}
  .tr-sun-head .tr-btn--main{width:100%;}
  .tr-sunnow{font-size:.72rem;}
  .tr-tools{padding:14px 12px;}
  .tr-sunbar{grid-template-columns:minmax(0,1fr);}
  .tr-exag{flex:1 1 100%;}
  .tr-fline{height:40px;}
  .tr-presets .tr-btn, .tr-play{height:38px;}
  .tr-presets .tr-btn{flex:1 1 0; padding:0 6px;}
  .tr-play{width:46px;}
}

/* the sun table stacks on phones: the date on its own line, then sunrise, sunset, direct sun */
@media (max-width:560px){
  .tr-sun-table thead{display:none;}
  .tr-sun-table, .tr-sun-table tbody{display:block;}
  .tr-sun-table tr{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:3px 10px; padding:8px 0; border-bottom:1px solid var(--hairline);}
  .tr-sun-table th, .tr-sun-table td{border:0; padding:0; white-space:normal;}
  .tr-sun-table td{font-size:.76rem; white-space:nowrap;}
  .tr-sun-table tbody th{grid-column:1 / -1;}
  .tr-sun-table td::before{content:attr(data-l); display:block; font-size:.72rem; color:var(--muted);}
}

/* full screen: colours for feasi (light only, like the rest of the page) */
:root{--tfs-bg:#fff; --tfs-fg:var(--noxen); --tfs-muted:var(--muted); --tfs-line:var(--hairline); --tfs-accent:var(--noxen);
  --tfs-accent-fg:#fff; --tfs-ring:var(--cymaris); --tfs-night:#D7E0E6; --tfs-stage:linear-gradient(#f6fafc,#e9eff3);
  --tfs-shadow:0 1px 3px rgba(10,37,54,.12);}
.is-fs .tr-sunnow{display:none !important;}
.is-fs .tr-zoom{bottom:12px;}
/* Full-screen terrain (terrain-fs.js / fullscreen.mjs): the 3D box moves into .tfs-stage.
   Colours come from the --tfs-* variables set above for this app. */
html.tfs-lock, html.tfs-lock body { overflow: hidden !important; overscroll-behavior: none; }
.tfs-open { position: absolute; top: 60px; right: 12px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  border-radius: 50%; border: 1px solid var(--tfs-line); background: var(--tfs-bg); color: var(--tfs-fg); cursor: pointer; z-index: 2; }
.tfs-open:hover { border-color: var(--tfs-fg); }
.tfs-open:focus-visible, .tfs-close:focus-visible, .tfs-chip:focus-visible, .tfs-play:focus-visible { outline: 2px solid var(--tfs-ring); outline-offset: 2px; }
.is-fs .tfs-open { display: none; }
.tfs { position: fixed; inset: 0; z-index: 3000; height: 100vh; height: 100dvh; display: grid; grid-template-rows: minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr); background: var(--tfs-stage); color: var(--tfs-fg); font-family: inherit;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px); }
.tfs-stage { grid-row: 1; grid-column: 1; position: relative; min-height: 0; min-width: 0; }
.tfs-stage > .is-fs { position: absolute !important; inset: 0; height: auto !important; min-height: 0 !important; border-radius: 0; }
.tfs-top { grid-row: 1; grid-column: 1; align-self: start; z-index: 3; display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 62px 0 10px; pointer-events: none; min-width: 0; }
.tfs-top > * { pointer-events: auto; }
.tfs-close { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--tfs-line); background: var(--tfs-bg);
  color: var(--tfs-fg); font: inherit; font-size: 16px; line-height: 1; cursor: pointer; box-shadow: var(--tfs-shadow); }
.tfs-read { display: flex; flex-direction: column; gap: 1px; padding: 6px 12px; border-radius: 14px; background: var(--tfs-bg);
  box-shadow: var(--tfs-shadow); font-size: 12px; line-height: 1.35; color: var(--tfs-muted); font-variant-numeric: tabular-nums; min-width: 0; }
.tfs-read:empty, .tfs-read:has(.tfs-clock:empty) { display: none; }
.tfs-clock { font-size: 15px; font-weight: 600; color: var(--tfs-fg); }
.tfs-alt { color: var(--tfs-fg); }
.tfs-bar { grid-row: 2; grid-column: 1; display: flex; flex-direction: column; gap: 10px; background: var(--tfs-bg);
  border-top: 1px solid var(--tfs-line); padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); min-width: 0; }
.tfs-wait { margin: 0; font-size: 13px; color: var(--tfs-muted); }
.tfs-bar.is-off .tfs-chips, .tfs-bar.is-off .tfs-row, .tfs-bar.is-off .tfs-map { opacity: .4; pointer-events: none; }
.tfs-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.tfs-chips::-webkit-scrollbar { display: none; }
.tfs-chip { flex: none; position: relative; height: 36px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--tfs-line);
  background: transparent; color: var(--tfs-fg); font: inherit; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center;
  cursor: pointer; white-space: nowrap; touch-action: manipulation; }
.tfs-chip.is-on { background: var(--tfs-accent); border-color: var(--tfs-accent); color: var(--tfs-accent-fg); }
.tfs-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.tfs-row { display: flex; gap: 12px; align-items: center; }
.tfs-play { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--tfs-accent); color: var(--tfs-accent-fg);
  font: inherit; font-size: 15px; cursor: pointer; touch-action: manipulation; }
.tfs-time { flex: 1; min-width: 0; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: pan-y; }
.tfs-time::-webkit-slider-runnable-track { height: 10px; border-radius: 5px;
  background: linear-gradient(90deg, var(--tfs-night) var(--day-a, 0%), #F6C453 var(--day-a, 0%), #F6C453 var(--day-b, 0%), var(--tfs-night) var(--day-b, 0%)); }
.tfs-time::-moz-range-track { height: 10px; border-radius: 5px;
  background: linear-gradient(90deg, var(--tfs-night) var(--day-a, 0%), #F6C453 var(--day-a, 0%), #F6C453 var(--day-b, 0%), var(--tfs-night) var(--day-b, 0%)); }
.tfs-time::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -10px; border-radius: 50%;
  background: #FFC533; border: 3px solid var(--tfs-bg); box-shadow: 0 0 0 1px var(--tfs-line); }
.tfs-time::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #FFC533; border: 3px solid var(--tfs-bg); box-shadow: 0 0 0 1px var(--tfs-line); }
.tfs-map { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--tfs-fg); cursor: pointer;
  align-self: flex-start; min-height: 32px; margin: 0; }
/* the host pages style every label and input: reset what the bar draws itself */
.tfs-chip { flex-direction: row; margin: 0; gap: 0; }
.tfs .tfs-time { border: 0; padding: 0; border-radius: 0; box-shadow: none; outline-offset: 4px; }
.tfs-map input { width: 18px; height: 18px; margin: 0; accent-color: var(--tfs-accent); }
/* phones on their side: the bar goes to the right */
@media (orientation: landscape) and (max-height: 560px) {
  .tfs { grid-template-columns: minmax(0, 1fr) min(300px, 44vw); grid-template-rows: minmax(0, 1fr); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .tfs-bar { grid-row: 1; grid-column: 2; border-top: 0; border-left: 1px solid var(--tfs-line); overflow-y: auto; justify-content: center;
    padding: 10px calc(12px + env(safe-area-inset-right, 0px)) 10px 12px; }
  .tfs { padding-right: 0; }
  .tfs-chips { flex-wrap: wrap; overflow: visible; }
  .tfs-read { font-size: 11.5px; }
}
/* tablets and desktop: the bar's controls keep a readable width */
@media (min-width: 761px) and (min-height: 561px) {
  .tfs-bar { align-items: center; }
  .tfs-bar > * { width: min(760px, 100%); }
  .tfs-bar > .tfs-map { align-self: center; }
}
.tfs-holder { visibility: hidden; }
.tr-chk[hidden]{display:none;}

/* buildings around the plot (terrain-buildings.js) */
.tr-bldbar{order:3; flex:1 1 100%; display:flex; flex-direction:column; gap:8px; padding-top:10px; border-top:1px dashed var(--hairline);}
.tr-bldbar[hidden], .tr-bedit[hidden], .tr-bform[hidden], .tr-bfl[hidden], .tr-bbtns [hidden]{display:none;}
.tr-bldrow{display:flex; flex-wrap:wrap; gap:8px 16px; align-items:center; justify-content:space-between;}
.tr-bedit{display:flex; gap:6px; flex-wrap:wrap;}
.tr-bform{display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center; padding:10px 12px; border-radius:10px; background:var(--nivelle);}
.tr-bhint{margin:0; flex:1 1 100%; font-size:.84rem; color:var(--noxen); font-weight:500;}
.tr-bfl{display:inline-flex; align-items:center; gap:8px; font-size:.84rem;}
.tr-bfl input{width:76px; font:inherit; font-size:16px; padding:.35rem .5rem; border:1px solid var(--hairline); border-radius:8px; background:#fff; color:var(--noxen);}
.tr-bbtns{display:flex; flex-wrap:wrap; gap:6px;}
.tr-btn:disabled{opacity:.45; cursor:default;}
.tr-bnote{margin:0; font-size:.8rem; color:var(--muted); line-height:1.5;}
.tr-bnote small{display:block; margin-top:3px; font-size:.74rem;}
.tr-canvas.is-picking canvas{cursor:crosshair;}
