:root {
  --bg: #f1f2ed; --surface: #fbfcf8; --surface-2: #e7ebe4; --text: #172019;
  --muted: #657067; --line: #d3d9d2; --brand: #2f6f4e; --brand-2: #24573d;
  --accent: #d7e6dc; --danger: #a53e36; --shadow: 0 18px 55px rgba(30, 48, 36, .1);
}
[data-theme="dark"] {
  --bg: #101511; --surface: #18201a; --surface-2: #202a23; --text: #edf3ed;
  --muted: #9eaaa1; --line: #2d3a31; --brand: #67b486; --brand-2: #83c99e;
  --accent: #203c2c; --danger: #ef8279; --shadow: 0 18px 55px rgba(0, 0, 0, .3);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(circle at 12% 4%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 28%), radial-gradient(circle at 88% 22%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 26%), var(--bg); color: var(--text); font-family: "DM Sans", sans-serif; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .025; z-index: 10; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E"); }
.topbar { height: 72px; padding: 0 max(24px, calc((100vw - 1180px)/2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 8; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font: 800 14px/1 "Manrope"; letter-spacing: .16em; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid color-mix(in srgb, var(--brand) 68%, var(--line)); border-radius: 11px; color: var(--brand); background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 13%, var(--surface)), var(--surface)); box-shadow: inset 0 1px 0 color-mix(in srgb, white 48%, transparent), 0 7px 18px color-mix(in srgb, var(--brand) 14%, transparent); }
.brand-mark svg { width: 30px; height: 30px; overflow: visible; }
.brand-mark path { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.brand-roof { stroke-width: 2.7; }
.brand-wall { stroke-width: 2.1; opacity: .82; }
.brand-calc { stroke-width: 1.8; }
.brand-name { display: flex; align-items: baseline; letter-spacing: .12em; }
.brand-name strong { font: inherit; }
.brand-name em { color: var(--brand); font-style: normal; }
.top-actions, .api-status { display: flex; align-items: center; gap: 12px; }
.api-status { color: var(--muted); font-size: 12px; }
.api-status i { width: 8px; height: 8px; background: #d2a53b; border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, #d2a53b 18%, transparent); }
.api-status.ready i { background: #4b9d69; box-shadow: 0 0 0 4px color-mix(in srgb, #4b9d69 18%, transparent); }
.api-status.error i { background: var(--danger); }
.icon-button { border: 1px solid var(--line); color: var(--text); background: var(--surface); width: 38px; height: 38px; border-radius: 10px; }
main { width: min(1180px, calc(100% - 40px)); margin: auto; }
.hero { padding: 82px 0 58px; max-width: 890px; }
.eyebrow, .step-label { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1, h2, h3 { font-family: "Manrope", sans-serif; margin-top: 0; }
h1 { max-width: 840px; margin: 15px 0 20px; font-size: clamp(42px, 6vw, 76px); line-height: .99; letter-spacing: -.055em; }
.hero > p { color: var(--muted); font-size: 18px; line-height: 1.65; max-width: 720px; }
.location-box { display: inline-flex; flex-direction: column; gap: 6px; margin-top: 22px; }
label { color: var(--muted); font-size: 12px; font-weight: 700; }
input, textarea, select { width: 100%; margin-top: 8px; padding: 14px 15px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; outline: none; transition: .2s; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent); }
.location-box input { min-width: 310px; }
.workspace { padding-bottom: 80px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tab { border: 0; border-bottom: 2px solid transparent; padding: 15px 20px; color: var(--muted); background: transparent; white-space: nowrap; font-weight: 700; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab span { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-left: 5px; padding: 0 5px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 9px; }
.panel { display: none; }
.panel.active { display: block; animation: rise .28s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr); gap: 20px; }
.card { background: color-mix(in srgb, var(--surface) 96%, transparent); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.card h2 { font-size: 26px; margin: 8px 0; }
.muted { color: var(--muted); }
textarea { resize: vertical; min-height: 180px; font-size: 15px; line-height: 1.6; }
.example-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 22px; }
.chip, .secondary-button { color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; font-size: 12px; font-weight: 700; }
.primary-button { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border: 0; border-radius: 11px; color: white; background: var(--brand); font-weight: 800; transition: .2s; }
.primary-button:hover { background: var(--brand-2); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.assistant-options { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 16px 0 12px; padding: 16px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; }
.assistant-options div { display: flex; flex-direction: column; gap: 3px; }
.assistant-options strong { font-size: 13px; }
.assistant-options div > span { color: var(--muted); font-size: 11px; }
.switch { position: relative; flex: 0 0 48px; width: 48px; height: 27px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > span { display: block; width: 48px; height: 27px; border-radius: 99px; background: var(--line); transition: .2s; }
.switch > span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 19px; height: 19px; border-radius: 50%; background: white; box-shadow: 0 2px 7px rgba(0,0,0,.22); transition: .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(21px); }
.custom-hint { margin: 0 0 18px; color: var(--muted); font-size: 11px; }
.custom-hint b { color: var(--brand); }
.primary-button.compact { height: 48px; justify-content: center; align-self: end; }
.process-list { list-style: none; padding: 0; margin: 26px 0; display: grid; gap: 18px; }
.process-list li { display: flex; gap: 13px; align-items: center; }
.process-list i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 800; background: var(--accent); color: var(--brand); }
.process-list div { display: flex; flex-direction: column; gap: 2px; }
.process-list span { color: var(--muted); font-size: 12px; }
.disclaimer { border-top: 1px solid var(--line); padding-top: 18px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.loading-card { margin-top: 20px; display: flex; align-items: center; gap: 18px; padding: 22px; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; }
.loading-card div:last-child { display: flex; flex-direction: column; gap: 3px; }
.loading-card span { color: var(--muted); font-size: 12px; }
.spinner { width: 31px; height: 31px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.result { margin-top: 22px; display: grid; gap: 18px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric { padding: 19px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.metric span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.metric strong { display: block; margin-top: 7px; font: 800 22px/1.2 "Manrope"; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-heading h2 { margin-bottom: 0; }
.export-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.export-actions button { border: 1px solid var(--line); color: var(--text); background: var(--surface-2); border-radius: 9px; padding: 10px 14px; font-weight: 700; }
.table-wrap { overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 11px; border-bottom: 1px solid var(--line); }
td { padding: 13px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
.status-tag { display: inline-block; padding: 4px 7px; border-radius: 5px; font-size: 9px; font-weight: 800; background: var(--accent); color: var(--brand); }
.status-tag.pending { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.detail-grid ul { padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.search-grid { display: grid; grid-template-columns: 1.7fr .55fr .55fr .7fr .7fr .9fr; gap: 12px; margin-top: 20px; }
.offers-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.offer-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.offer-card h3 { font-size: 15px; line-height: 1.35; min-height: 40px; }
.offer-card .price { display: block; font: 800 25px/1 "Manrope"; margin: 14px 0 5px; color: var(--brand); }
.offer-card small { color: var(--muted); }
.offer-card button { width: 100%; margin-top: 15px; padding: 10px; border: 1px solid var(--brand); color: var(--brand); background: transparent; border-radius: 8px; font-weight: 700; }
#cartCard { margin-top: 18px; }
.cart-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.cart-row, .saved-row { display: grid; grid-template-columns: 1.5fr .5fr .6fr .2fr; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.cart-row button, .saved-row button { border: 0; background: transparent; color: var(--danger); font-weight: 800; }
.saved-row { grid-template-columns: 1.5fr 1fr .8fr auto; }
.saved-list:empty::after { content: "Nenhum orçamento salvo ainda."; display: block; color: var(--muted); padding: 22px 0; }
.catalog-layout { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr); gap: 20px; }
.custom-form { display: grid; gap: 12px; margin-top: 20px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.custom-list { display: grid; gap: 10px; margin-top: 18px; }
.custom-list:empty::after { content: "Nenhum material personalizado cadastrado."; display: block; padding: 30px 0; text-align: center; color: var(--muted); font-size: 12px; }
.custom-item { display: grid; grid-template-columns: 1fr auto; gap: 15px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.custom-item strong, .custom-item small { display: block; }
.custom-item small { margin-top: 4px; color: var(--muted); }
.custom-item button { border: 0; color: var(--danger); background: transparent; font-weight: 800; }
.search-note { grid-column: 1 / -1; padding: 16px 18px; border: 1px dashed var(--line); color: var(--muted); background: var(--surface); border-radius: 12px; font-size: 12px; }
.regional-metrics { margin-top: 24px; }
.regional-filter { display: block; max-width: 420px; margin-top: 22px; }
#regionalItems small { color: var(--muted); }
#refreshRegional:disabled { opacity: .55; cursor: wait; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 380px; padding: 14px 18px; border-radius: 10px; color: white; background: #25322a; box-shadow: var(--shadow); transform: translateY(30px); opacity: 0; pointer-events: none; transition: .25s; z-index: 20; }
.toast.show { transform: none; opacity: 1; }
.toast.error { background: #8c3731; }
@media (max-width: 900px) { .panel-grid, .detail-grid, .catalog-layout { grid-template-columns: 1fr; } .summary-grid { grid-template-columns: repeat(2, 1fr); } .offers-grid { grid-template-columns: repeat(2, 1fr); } .search-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { main { width: min(100% - 24px, 1180px); } .topbar { padding: 0 14px; } .api-status span { display: none; } .hero { padding: 48px 0 38px; } h1 { font-size: 42px; } .hero > p { font-size: 15px; } .location-box, .location-box input { width: 100%; min-width: 0; } .tabs { margin-inline: -12px; padding-inline: 8px; } .card { padding: 20px; border-radius: 14px; } .summary-grid, .offers-grid, .search-grid, .two-columns { grid-template-columns: 1fr; } .cart-row, .saved-row { grid-template-columns: 1fr auto; } .cart-row span:nth-child(2), .saved-row span:nth-child(2) { display: none; } .section-heading, .cart-footer { align-items: flex-start; flex-direction: column; } .assistant-options { align-items: flex-start; } }
