/* Fonts are self-hosted (assets/fonts, SIL Open Font License); the site requests nothing from third parties. */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/barlow-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/barlow-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/barlow-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/barlow-semi-condensed-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/barlow-semi-condensed-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Layout: drafting table. Tool rail on the left, plan sheet in the middle, readings on the right;
   the guide below reads as a single column. */
:root {
  --bg: #E7EAEE; --sheet: #FBFCFD; --panel: #F3F5F8; --ink: #1B222C; --muted: #5A6473; --line: #C8CFD8;
  --grid: #E1E6EC; --grid-strong: #C9D1DA; --accent: #2F43C4; --accent-soft: rgba(47, 67, 196, .12); --on-accent: #FFFFFF;
  --danger: #B42335; --shadow: 0 10px 30px rgba(20, 28, 40, .16);
  --m-tijolo: #9C4A2C; --m-concreto: #555D69; --m-gesso: #97A0AC; --m-madeira: #A26B22; --m-vidro: #2A8FBA; --m-metal: #1F242B;
  --q0: #1A9850; --q1: #86C65A; --q2: #EFC23F; --q3: #EE8547; --q4: #D33343;
  --font-display: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101419; --sheet: #171C23; --panel: #141920; --ink: #E5E9EF; --muted: #98A2B1; --line: #2C3440;
    --grid: #1F252E; --grid-strong: #2C3440; --accent: #8D9BFF; --accent-soft: rgba(141, 155, 255, .16); --on-accent: #10131A;
    --danger: #FF7A88; --shadow: 0 10px 30px rgba(0, 0, 0, .5);
    --m-tijolo: #D27C59; --m-concreto: #A7AEB9; --m-gesso: #717A87; --m-madeira: #D4A35A; --m-vidro: #6BC6EA; --m-metal: #E3E7ED;
    color-scheme: dark;
  }
}

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: 1440px; margin: 0 auto }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; line-height: 1.15 }
p { margin: 0 }
a { color: var(--accent) }
img { max-width: 100% }
[hidden] { display: none !important }
.eyebrow { font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); display: block }
.muted { color: var(--muted) }
.small { font-size: 13px }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.skip { position: absolute; left: -999px; top: 8px; background: var(--sheet); padding: 6px 10px; z-index: 50 }
.skip:focus { left: 16px }

button, select, input, textarea { font: inherit; color: inherit }
button {
  cursor: pointer; border: 1px solid var(--line); background: var(--sheet); border-radius: 6px; padding: 7px 11px; font-weight: 500;
}
button:hover { border-color: var(--muted) }
button:disabled { opacity: .6; cursor: progress }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent) }
button.ghost { background: transparent }
button.danger, .menu-list .danger { color: var(--danger) }
button.primary.danger { background: var(--danger); border-color: var(--danger); color: var(--sheet) }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
select, input[type=number], input[type=text], textarea {
  background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; width: 100%;
}
input[type=range], input[type=checkbox] { accent-color: var(--accent) }
input[type=range] { width: 100% }
kbd { font-family: var(--font-mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: auto }
.btnrow { display: flex; flex-wrap: wrap; gap: 6px }
.check { display: flex; align-items: center; gap: 7px; font-size: 14px }
.hint { font-size: 13px; color: var(--muted) }

/* header */
.site { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-block: 14px 6px }
.logo { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--ink); text-decoration: none }
.logo svg { width: 28px; height: 28px; flex: none }
.projbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0 }
.projbar select { width: auto; max-width: 230px; font-weight: 500 }
details.menu { position: relative }
details.menu > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); background: var(--sheet); border-radius: 6px; padding: 7px 11px; font-weight: 500 }
details.menu > summary::-webkit-details-marker { display: none }
details.menu > summary::after { content: " ▾"; color: var(--muted) }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 190px; display: flex; flex-direction: column; padding: 4px;
  background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow) }
.menu-list button { border: 0; background: transparent; text-align: left; padding: 8px 10px }
.menu-list button:hover { background: var(--accent-soft) }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0 }

.intro { padding-block: 6px 14px; display: flex; flex-direction: column; gap: 4px }
.intro h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 700 }
.intro p { color: var(--muted); max-width: 70ch }

.note-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--accent-soft); border-radius: 8px; padding: 9px 12px; margin-bottom: 14px }
.note-bar .sp { flex: 1 1 220px; min-width: 0 }

/* tool layout: map with its toolbar on the left, results column on the right */
.app { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start }
.panel { display: flex; flex-direction: column; gap: 16px; min-width: 0 }
.group { display: flex; flex-direction: column; gap: 7px }
.board { display: flex; gap: 10px; align-items: flex-start; min-width: 0 }
.toolbar { flex: none; width: 128px; display: flex; flex-direction: column; gap: 4px }
.toolbar button { display: flex; align-items: center; gap: 8px; text-align: left; background: transparent; border-color: transparent }
.toolbar button[aria-pressed="true"] { background: var(--sheet); border-color: var(--ink); font-weight: 600 }
.toolbar .undo { margin-top: 8px; border-color: var(--line); justify-content: center }
.canvas-area { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center }
.opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0 }
.opts select { width: auto; max-width: 260px }
.opts input[type=range] { width: 90px }
.opt-label { font-size: 13px; color: var(--muted) }
.opts-heat { margin-left: auto }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; font-size: 13px; text-align: left; width: fit-content }

.stage { display: flex; flex-direction: column; gap: 10px; min-width: 0 }
.stagebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px }
.floors { display: flex; flex-wrap: wrap; gap: 6px }
.floors button { padding: 5px 10px; font-size: 14px }
.floors button[aria-selected="true"] { background: var(--ink); color: var(--sheet); border-color: var(--ink) }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--sheet) }
.seg button { border: 0; border-radius: 0; padding: 6px 14px; background: transparent; font-family: var(--font-mono); font-size: 13px }
.seg button + button { border-left: 1px solid var(--line) }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--sheet) }
.readout { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); min-width: 0; min-height: 1.5em }
.readout b { color: var(--ink); font-weight: 500 }
.sheet { position: relative; max-width: 100%; background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; overflow: hidden }
canvas { display: block; max-width: 100%; touch-action: none; cursor: crosshair }
#labelInput { position: absolute; width: 150px; padding: 3px 6px; font-size: 13px; z-index: 2 }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted) }
.legend span { display: inline-flex; align-items: center; gap: 6px }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none }
.foot { font-size: 12.5px; color: var(--muted); max-width: 80ch }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0 }
.card h2 { font-size: 17px; font-weight: 700 }
.big { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums }
.big small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 6px }
.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--grid) }
.rows { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px }
.r { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center }
.r .n { font-family: var(--font-mono); font-variant-numeric: tabular-nums }
.r em { font-style: normal; color: var(--muted); font-size: 12.5px }
.bands3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center }
.bands3 div { background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; padding: 6px 4px }
.bands3 .v { font-family: var(--font-mono); font-size: 15px; font-variant-numeric: tabular-nums }
.bands3 .l { font-size: 11.5px; color: var(--muted) }
.link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; font-size: 13.5px; align-items: baseline }
.link .full { grid-column: 1 / -1 }
.pill { font-family: var(--font-mono); font-size: 12px; border-radius: 999px; padding: 1px 8px; white-space: nowrap; color: #111 }
.pill-wire { background: var(--grid); color: var(--ink) }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px }
.fields label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted) }
textarea { min-height: 110px; font-family: var(--font-mono); font-size: 12px; resize: vertical }


/* guide */
.guide { max-width: 760px; margin: 48px auto 0; display: flex; flex-direction: column; gap: 14px; font-size: 16.5px; line-height: 1.65 }
.guide h2 { font-size: 26px; font-weight: 700; margin-top: 22px }
.guide h3 { font-size: 19px; font-weight: 600; margin-top: 6px }
.guide ol, .guide ul { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet) }
table { border-collapse: collapse; width: 100%; font-size: 14.5px }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top }
tr:last-child td { border-bottom: 0 }
th { font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted) }
td.num, th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0 }
.faq summary { cursor: pointer; font-weight: 600 }
.faq details p { margin-top: 8px }

.site-foot { margin-top: 56px; padding-block: 20px 32px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13.5px; color: var(--muted) }
.site-foot a, .site-foot .linkbtn { color: var(--muted) }

/* dialogs, banner, toast */
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; background: var(--sheet); color: var(--ink); box-shadow: var(--shadow); width: min(460px, calc(100vw - 32px)) }
dialog::backdrop { background: rgba(10, 14, 20, .45) }
.dlg { padding: 18px; display: flex; flex-direction: column; gap: 12px }
.dlg h2 { font-size: 20px }
.dlg .field { display: flex; flex-direction: column; gap: 4px; font-size: 14px }
.dlg .end { flex-direction: row-reverse; justify-content: flex-start }
.dlg fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; margin: 0 }
.dlg legend { font-weight: 600; padding: 0 4px }
#modelsDlg { width: min(560px, calc(100vw - 32px)) }
#modelList { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px }
#modelList li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; padding: 8px 10px; border-bottom: 1px solid var(--line) }
#modelList li:last-child { border-bottom: 0 }
#modelList button { padding: 3px 8px; font-size: 13px }
.ml-name { display: flex; flex-direction: column; min-width: 0 }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px }
.bandchecks { display: flex; flex-wrap: wrap; gap: 6px 14px }
.err { color: var(--danger); font-size: 13.5px; min-height: 1em }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 45; max-width: min(520px, calc(100vw - 32px));
  background: var(--ink); color: var(--sheet); padding: 10px 14px; border-radius: 8px; font-size: 14px; box-shadow: var(--shadow) }

/* site menu and language switcher */
.sitenav { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none }
.sitenav a, .navbtn { white-space: nowrap; color: var(--ink); text-decoration: none; font-weight: 500; padding: 6px 10px; border-radius: 6px; border: 0; background: transparent; font-size: 15px }
.sitenav a:hover, .navbtn:hover { background: var(--accent-soft) }
.langsw select { width: auto; font-weight: 500 }
.projbar { margin-bottom: 14px }
.projbar select { width: auto; max-width: 260px; font-weight: 500 }
[id] { scroll-margin-top: 16px }
.guide.doc { margin-top: 16px }
.guide.doc h1 { font-size: 32px }

/* guided tour */
.tour { position: fixed; inset: 0; z-index: 60 }
.tour-spot { position: fixed; border-radius: 8px; box-shadow: 0 0 0 9999px rgba(8, 12, 18, .62); transition: all .25s ease; pointer-events: none }
.tour-card { position: fixed; background: var(--sheet); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 8px; outline: none }
.tour-card h2 { font-size: 20px }
.tour-count { font-family: var(--font-mono); font-size: 12px; color: var(--muted) }
.tour-actions { align-items: center; margin-top: 4px }
.tour-gap { flex: 1 }

/* Wide screens: the plan follows the scroll while the side columns are taller than it. */
@media (min-width: 1101px) {
  .stage { position: sticky; top: calc(12px + env(safe-area-inset-top, 0px)) }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr) }
  .panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) }
}
@media (max-width: 720px) {
  .board { flex-direction: column; align-items: stretch }
  .toolbar { width: auto; flex-direction: row; flex-wrap: wrap }
  .toolbar button { border-color: var(--line) }
  .toolbar .undo { margin-top: 0 }
  .toolbar kbd { display: none }
  .opts-heat { margin-left: 0 }
  .sitenav { order: 3; flex-basis: 100% }
  .langsw { margin-left: auto }
  .guide { font-size: 16px }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important } }
