:root {
  --bg: #e6e2dc;
  --paper: #f5f3ef;
  --sheet: #fbfaf8;
  --ink: #2f2b27;
  --muted: #5d574f;
  --line: #c8c1b7;
  --line-2: #ddd7cf;
  --cone: #f26b1d;
  --cone-ink: #a3410b;
  --cone-tint: #fbe3d3;
  --tape: #f4c03f;
  --wall: #ddd6cc;
  --display: 'Saira Condensed', 'Arial Narrow', sans-serif;
  --text: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --w: 1160px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 400 1.0625rem/1.6 var(--text); overflow-x: hidden;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(47, 43, 39, .07) 1px, transparent 1.4px), radial-gradient(rgba(255, 255, 255, .35) 1px, transparent 1.6px);
  background-size: 23px 19px, 31px 29px;
  background-position: 0 0, 11px 7px;
}
a { color: var(--cone-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cone); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.02; margin: 0 0 .45em; letter-spacing: -.005em; }
h1 { font-size: clamp(2.5rem, 5.6vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.65rem, 2.8vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 700; }
.lede { font-size: 1.15rem; line-height: 1.55; color: var(--muted); max-width: 38em; margin: 0 0 1.4rem; }

/* Topo com fita de trena */
.top { background: var(--ink); color: var(--paper); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--paper); text-decoration: none; font: 800 1.7rem/1 var(--display); --ink: var(--paper); }
.brand i, .foot-brand i { font-style: normal; color: var(--cone); font-weight: 600; }
.nav { display: flex; gap: 2px; }
.nav a { color: var(--paper); text-decoration: none; padding: 8px 12px; font-weight: 500; border-radius: 2px; }
.nav a:hover { background: rgba(255, 255, 255, .08); }
.nav a[aria-current] { background: var(--cone); color: var(--ink); font-weight: 600; }
.nav a:focus-visible { outline-color: var(--tape); }
.tape {
  height: 18px; background-color: var(--cone);
  background-image:
    linear-gradient(90deg, var(--ink) 1.5px, transparent 1.5px),
    linear-gradient(90deg, var(--ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink) 1px, transparent 1px);
  background-size: 100px 12px, 50px 8px, 10px 5px;
  background-repeat: repeat-x;
  background-position: 23px 0, 23px 0, 23px 0;
  border-bottom: 1px solid var(--ink);
}

/* Hero */
.hero { padding: 40px 0 48px; }
.hero-head { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 48px; align-items: end; margin-bottom: 22px; }
.hero-head h1 { margin: 0; }
.hero-head .lede { margin: 0; }
.help { font-size: .9rem; color: var(--muted); margin: 12px 0 0; }

/* Grade das ferramentas */
.tool-grid { display: grid; grid-template-columns: minmax(330px, .9fr) 1.1fr; gap: 28px; align-items: start; }
.result-col { min-width: 0; position: sticky; top: 12px; }

/* Formulário */
.panel { display: grid; gap: 20px; background: var(--paper); padding: 20px; border: 1.5px solid var(--ink); }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; min-width: 0; }
legend { font: 700 1.2rem/1 var(--display); padding: 0 0 10px; display: flex; align-items: center; gap: 8px; width: 100%; }
legend::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fld { display: grid; gap: 5px; align-content: start; }
.fld-l { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.fld-l small, .seg small { font-weight: 400; color: var(--muted); font-size: .84rem; }
.fld-in { display: flex; align-items: stretch; border: 1.5px solid #9d958a; background: #fff; border-radius: 2px; }
.fld-in:focus-within { border-color: var(--cone-ink); box-shadow: 0 0 0 3px var(--cone-tint); }
.fld-in input { border: 0; min-width: 0; flex: 1; box-shadow: none !important; }
.un { display: flex; align-items: center; padding: 0 10px; font: 500 .9rem var(--mono); color: var(--muted); background: var(--paper); border-left: 1px solid var(--line-2); }
input, select { font: 500 1.05rem var(--text); color: var(--ink); background: #fff; border: 1.5px solid #9d958a; border-radius: 2px; padding: 9px 10px; width: 100%; min-height: 46px; font-variant-numeric: tabular-nums; }
input:focus, select:focus { border-color: var(--cone-ink); outline: none; box-shadow: 0 0 0 3px var(--cone-tint); }
.hint { margin: -4px 0 0; font-size: .88rem; color: var(--muted); }

/* Linhas de parede */
.wall-row { display: grid; grid-template-columns: 30px repeat(4, minmax(0, 1fr)) 34px; gap: 8px; align-items: end; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.wall-row:first-child { padding-top: 0; }
.wall-row label { display: grid; gap: 3px; font-size: .8rem; color: var(--muted); font-weight: 500; }
.wall-row input { min-height: 42px; padding: 7px 8px; }
.wall-row .un { padding: 0 6px; font-size: .8rem; }
.wr-name { font: 700 1.05rem var(--mono); color: var(--cone-ink); align-self: center; padding-top: 18px; }
.wr-del { min-height: 42px; border: 1.5px solid var(--line); background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; border-radius: 2px; }
.wr-del:hover { border-color: var(--ink); color: var(--ink); }
.btn-line { justify-self: start; font: 600 .95rem var(--text); background: transparent; color: var(--ink); border: 1.5px dashed var(--ink); padding: 9px 14px; cursor: pointer; border-radius: 2px; }
.btn-line:hover { background: var(--cone-tint); }

/* Seletor segmentado */
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--ink); }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg label { position: relative; cursor: pointer; }
.seg label + label { border-left: 1.5px solid var(--ink); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.seg span { display: block; padding: 9px 10px; text-align: center; font-weight: 600; line-height: 1.25; min-height: 44px; }
.seg small { display: block; }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:checked + span small { color: #d6cfc5; }
.seg input:focus-visible + span { outline: 3px solid var(--cone); outline-offset: -3px; }

details.prices { border-top: 1px solid var(--line); padding-top: 12px; }
details.prices summary { cursor: pointer; font-weight: 600; }
details.prices summary small { font-weight: 400; color: var(--muted); }
details.prices .row3 { margin-top: 12px; }

/* Resultado: prancha */
.sheet { background: var(--sheet); border: 1.5px solid var(--ink); padding: 20px 20px 16px; }
.big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big strong { font: 800 clamp(3.4rem, 7vw, 4.8rem)/.9 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.big span { font: 600 1.35rem var(--display); color: var(--muted); }
.sub { font: 500 .92rem/1.5 var(--mono); color: var(--muted); margin: 8px 0 16px; overflow-wrap: anywhere; }
.buy { border-left: 5px solid var(--cone); background: var(--paper); padding: 12px 16px; margin-bottom: 16px; }
.buy h3 { font-size: 1.15rem; margin: 0 0 6px; }
.buy ul { list-style: none; margin: 0; padding: 0; }
.buy li { padding: 3px 0; font-size: 1.05rem; }
.buy li b { font-family: var(--mono); font-weight: 600; }
.buy li small { color: var(--muted); }
.buy p { margin: 6px 0 0; font-size: .95rem; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; margin: 14px 0 0; }
.facts div { padding: 8px 0; border-top: 1px solid var(--line-2); }
.facts dt { font-size: .85rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.warn { font-size: .92rem; color: var(--muted); margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line-2); }
.warn.strong { color: var(--ink); border-top: 0; background: var(--cone-tint); padding: 10px 12px; }
.err { color: #8c2a0a; font-weight: 600; margin: 0; }

/* Desenho técnico */
.drawing { margin: 0; border: 1px solid var(--line); background: #fff; background-image: linear-gradient(var(--line-2) 1px, transparent 1px), linear-gradient(90deg, var(--line-2) 1px, transparent 1px); background-size: 20px 20px; background-position: -1px -1px; }
.drawing svg { display: block; width: 100%; height: auto; padding: 10px 0 2px; overflow: visible; }
.drawing figcaption { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--ink); background: var(--sheet); padding: 6px 10px; font: 500 .78rem/1.3 var(--mono); }
.drawing .esc { color: var(--muted); }
.drawing text { font: 500 11px var(--mono); fill: var(--ink); }
.cota path { stroke: var(--cone); stroke-width: 1.2; fill: none; }
.cota text { fill: var(--cone-ink); font-weight: 600; }
.wall { fill: var(--wall); stroke: var(--ink); stroke-width: 1.6; }
.hatch { stroke: #c2b8ab; stroke-width: .8; }
.open rect { fill: #fff; stroke: var(--ink); stroke-width: 1.2; }
.open path { fill: none; stroke: var(--muted); stroke-width: .8; stroke-dasharray: 3 2; }
.drawing .tag { font-weight: 600; }
.drawing .area { fill: var(--muted); }
.floor { stroke: var(--ink); stroke-width: 2; }
.floorfill { fill: #f1ece5; }
.tile { fill: none; stroke: #9f968a; stroke-width: 1; }
.roomline { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.conc { fill: #d3ccc2; stroke: var(--ink); stroke-width: 1.8; }
.dot { fill: #81786d; }
.tri { fill: #9c9286; }
.mortar { fill: #e2ddd5; }
.brick { fill: #cfa98a; stroke: #a8836a; stroke-width: .5; }

/* Blocos da home */
.block { padding: 44px 24px 4px; }
.tool-rule { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); display: grid; grid-template-columns: repeat(4, 1fr); }
.tool-rule li { border-right: 1px solid var(--line); }
.tool-rule li:last-child { border-right: 0; }
.tool-rule a { display: grid; gap: 4px; padding: 0 16px 16px 0; text-decoration: none; color: var(--ink); height: 100%; }
.tool-rule li + li a { padding-left: 16px; }
.tr-n { font: 600 .78rem var(--mono); color: var(--cone-ink); border-left: 2px solid var(--ink); padding: 0 0 10px 5px; height: 22px; margin-left: -1px; }
.tool-rule li + li .tr-n { margin-left: -17px; }
.tr-name { font: 700 1.4rem/1.1 var(--display); }
.tool-rule a:hover .tr-name { color: var(--cone-ink); text-decoration: underline; text-decoration-thickness: 2px; }
.tr-desc { color: var(--muted); font-size: .97rem; line-height: 1.45; }

.refs { display: grid; grid-template-columns: 1.25fr 1fr .9fr; gap: 32px; }
.tbl { overflow-x: auto; max-width: 100%; }
table.ref { width: 100%; border-collapse: collapse; background: var(--sheet); font-size: .95rem; line-height: 1.35; }
table.ref caption { text-align: left; font-size: .88rem; color: var(--muted); padding-bottom: 6px; }
table.ref th, table.ref td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
table.ref thead th { border-bottom: 2px solid var(--ink); font-size: .86rem; }
table.ref td.n { font-family: var(--mono); font-size: .9rem; white-space: nowrap; }
.note { font-size: .92rem; color: var(--muted); margin: 10px 0 0; }

/* Listas de posts */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list.two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; border-top: 2px solid var(--ink); }
.post-list li { border-bottom: 1px solid var(--line); }
.post-list a { display: grid; gap: 4px; padding: 16px 0; text-decoration: none; color: var(--ink); }
.pl-title { font: 700 1.3rem/1.15 var(--display); }
.post-list a:hover .pl-title { color: var(--cone-ink); text-decoration: underline; }
.pl-desc { color: var(--muted); font-size: .97rem; line-height: 1.45; }
.post-list time { font: 500 .78rem var(--mono); color: var(--muted); }
.list-page { padding-top: 36px; padding-bottom: 20px; }
.list-page .post-list { border-top: 2px solid var(--ink); max-width: 820px; }

/* Páginas de ferramenta e artigo */
.tool-page { padding-top: 26px; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.tool-head { margin-bottom: 20px; }
.how { margin-top: 44px; max-width: 800px; }
.more { margin-top: 32px; }
.more h2 { font-size: 1.45rem; }
.more ul { padding-left: 1.2em; margin: 0; }
.more li { margin: 6px 0; }
.article { padding-top: 28px; max-width: 840px; }
.article-head { margin-bottom: 22px; }
.byline { font-size: .92rem; color: var(--muted); }
.prose { font-size: 1.1rem; line-height: 1.7; }
.prose h2 { margin: 1.7em 0 .5em; }
.prose h3 { margin: 1.4em 0 .4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; max-width: 40em; }
.prose li { margin: .3em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .98rem; line-height: 1.4; background: var(--sheet); font-variant-numeric: tabular-nums; display: block; overflow-x: auto; max-width: 100%; }
.prose thead th { border-bottom: 2px solid var(--ink); }
.prose th, .prose td { border-bottom: 1px solid var(--line-2); padding: 9px 12px; text-align: left; vertical-align: top; }
.prose th { font-weight: 600; font-size: .9rem; }
.prose blockquote { margin: 1.2em 0; padding: 6px 0 6px 18px; border-left: 4px solid var(--cone); color: var(--muted); }
.prose code { font: .9em var(--mono); background: var(--paper); padding: 1px 5px; }
.prose strong { font-weight: 700; }
.tool-callout { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--sheet); border: 1.5px solid var(--ink); border-left: 6px solid var(--cone); padding: 14px 18px; margin-bottom: 28px; }
.tool-callout p { margin: 0; font-weight: 500; max-width: 32em; }
.btn { display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; padding: 10px 16px; border-radius: 2px; }
.btn:hover { background: #000; }
.sources { margin-top: 36px; font-size: .97rem; }
.sources h2 { font-size: 1.4rem; }
.sources ul { padding-left: 1.2em; }
.sources li { margin: 4px 0; overflow-wrap: anywhere; }
.disclaimer { font-size: .92rem; line-height: 1.5; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 28px; }
.static { padding-bottom: 20px; }
.contact-pending { background: var(--sheet); border-left: 4px solid var(--cone); padding: 10px 14px; }

/* Rodapé */
.foot { margin-top: 64px; background: var(--ink); color: #d9d2c8; padding: 34px 0 18px; font-size: .95rem; }
.foot-in { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
.foot-brand { display: flex; align-items: center; gap: 10px; font: 800 1.4rem var(--display); color: var(--paper); margin: 0 0 8px; --ink: var(--paper); }
.foot a { color: var(--paper); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; align-content: start; }
.foot-copy { font: 500 .8rem var(--mono); color: #b3aba0; margin-top: 22px; }

@media (max-width: 980px) {
  .tool-grid { grid-template-columns: 1fr; }
  .result-col { position: static; }
  .refs { grid-template-columns: 1fr; }
  .tool-rule { grid-template-columns: 1fr 1fr; }
  .tool-rule li:nth-child(2) { border-right: 0; }
  .tool-rule li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tool-rule li:nth-child(3) a { padding-left: 0; }
  .tool-rule li:nth-child(3) .tr-n { margin-left: -1px; }
  .hero-head { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .block { padding: 36px 16px 4px; }
  .top-in { flex-wrap: wrap; gap: 0; padding-top: 10px; }
  .brand { font-size: 1.5rem; }
  .nav { width: calc(100% + 32px); margin: 6px -16px 0; padding: 0 8px 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 8px 12px; }
  .hero { padding-top: 26px; }
  .panel { padding: 16px 14px; }
  .sheet { padding: 16px 14px 12px; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .wall-row { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 4px; }
  .wr-name { grid-column: 1 / 4; padding-top: 0; }
  .wr-del { grid-column: 4; grid-row: 1; justify-self: end; min-height: 34px; width: 38px; }
  .wall-row .un { display: none; }
  .tool-rule, .post-list.two, .facts { grid-template-columns: 1fr; }
  .tool-rule li { border-right: 0; border-top: 1px solid var(--line); }
  .tool-rule li:first-child { border-top: 0; }
  .tool-rule li a, .tool-rule li + li a { padding: 0 0 14px 0; }
  .tool-rule li .tr-n, .tool-rule li + li .tr-n { margin-left: -1px; }
  .foot-in { grid-template-columns: 1fr; }
  .prose { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
