/* CalEng — interface técnica para pré-dimensionamento de muro de flexão. */
:root {
    --bg-canvas: #f3f7fb;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --surface-strong: #eef4f9;
    --border: #d7e0ea;
    --border-strong: #bdcad8;
    --text-main: #213247;
    --text-heading: #0b1f35;
    --text-muted: #627287;
    --accent: #075985;
    --accent-dark: #063f5e;
    --accent-soft: #e0f2fe;
    --success: #15803d;
    --success-soft: #f0fdf4;
    --danger: #b91c1c;
    --danger-soft: #fef2f2;
    --warning: #a16207;
    --shadow-sm: 0 1px 2px rgb(15 23 42 / 6%);
    --shadow-md: 0 10px 30px rgb(15 23 42 / 8%);
}

* { box-sizing: border-box; }

html { background: var(--bg-canvas); scroll-behavior: smooth; }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--text-main);
    background: var(--bg-canvas);
    font: 400 14px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

/* Aviso persistente e confirmação de cada processamento solicitado. */
.calculation-notice { padding: 15px 18px; margin: 0 0 18px; border: 1px solid #b9d9ef; border-left: 4px solid var(--accent); border-radius: 8px; background: #edf7ff; color: #183d56; font-size: .88rem; line-height: 1.65; }
.calculation-notice strong { display: block; margin-bottom: 3px; }
.calculation-notice-caption { margin: 8px 0 0; color: var(--text-muted); font-size: .8rem; }
.calculation-dialog { box-sizing: border-box; width: min(580px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: clamp(20px, 4vw, 32px); overflow-y: auto; color: #213247; background: #fff; border: 1px solid #bdcad8; border-radius: 16px; box-shadow: 0 20px 70px #0b1f3540; }
.calculation-dialog::backdrop { background: #081a30b3; }
.calculation-dialog__eyebrow { color: #075985; font-size: .75rem; font-weight: 800; letter-spacing: .08em; }
.calculation-dialog h2 { margin: 10px 0 20px; color: #0b1f35; font-size: 1.4rem; }
.calculation-dialog p { margin: 0 0 16px; font-size: .95rem; line-height: 1.65; }
.calculation-dialog .calculation-dialog__footnote { padding-top: 16px; border-top: 1px solid #d7e0ea; color: #4b5d72; font-size: .8rem; }
.calculation-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.calculation-dialog__actions button { min-height: 44px; padding: 10px 14px; border: 1px solid #bdcad8; border-radius: 8px; background: #fff; color: #213247; font-weight: 700; cursor: pointer; }
.calculation-dialog__actions #calculation-notice-confirm { background: #075985; color: #fff; border-color: #075985; }
.calculation-dialog__actions button:focus-visible { outline: 3px solid #0284c7; outline-offset: 3px; }
.calculation-dialog__actions button:disabled { opacity: .6; cursor: wait; }
@media (max-width: 520px) { .calculation-dialog__actions { flex-direction: column; }.calculation-dialog__actions button { width: 100%; } }
@media print { .calculation-dialog { display: none !important; }.calculation-notice { break-inside: avoid; } }

/* Login */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at 20% 20%, #0c749b 0, transparent 35%), #071d30;
}

.login-card {
    width: min(100%, 420px);
    padding: clamp(28px, 6vw, 44px);
    text-align: center;
    background: rgb(255 255 255 / 98%);
    border: 1px solid rgb(255 255 255 / 28%);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgb(0 0 0 / 30%);
}

.login-brand { height: 58px; max-width: 100%; margin-bottom: 18px; border-radius: 8px; object-fit: contain; }
.login-card h2 { margin: 0 0 8px; color: var(--text-heading); font-size: 1.35rem; border: 0; }
.login-card p { margin: 0 0 24px; color: var(--text-muted); }
.login-card input { width: 100%; height: 46px; padding: 0 13px; margin: 0 0 12px; color: var(--text-heading); background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; }
.login-card input:focus { border-color: var(--accent); outline: 3px solid rgb(7 89 133 / 15%); }
.login-card button { width: 100%; min-height: 46px; color: #fff; background: var(--accent); border: 0; border-radius: 8px; font-weight: 700; cursor: pointer; transition: background .18s ease, transform .18s ease; }
.login-card button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.login-error { display: none; margin: 14px 0 0 !important; color: var(--danger) !important; font-size: .875rem; font-weight: 600; }

/* Aplicação */
.app-container { max-width: 1440px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 40px) 48px; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0 24px; }
.brand { display: flex; align-items: center; min-width: 0; gap: 16px; }
.brand-copy { min-width: 0; }
.app-header h1 { margin: 0 0 3px; color: var(--text-heading); font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 750; letter-spacing: -.025em; }
.app-header p { margin: 0; color: var(--text-muted); font-size: .9rem; }
.header-kicker { display: block; margin-bottom: 3px; color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.logout-button { flex: 0 0 auto; padding: 9px 14px; color: #9f1239; background: #fff; border: 1px solid #fecdd3; border-radius: 8px; font-size: .85rem; font-weight: 700; cursor: pointer; }
.logout-button:hover { color: #fff; background: #be123c; border-color: #be123c; }

/* Navegação por etapas */
.tabs { display: flex; gap: 8px; padding: 5px; margin-bottom: 18px; overflow-x: auto; background: #e7eef5; border-radius: 12px; scrollbar-width: thin; }
.tab-btn { min-height: 40px; padding: 8px 14px; white-space: nowrap; color: var(--text-muted); background: transparent; border: 1px solid transparent; border-radius: 8px; font-size: .82rem; font-weight: 650; cursor: pointer; transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.tab-btn:hover { color: var(--text-heading); background: rgb(255 255 255 / 65%); }
.tab-btn.active { color: var(--accent-dark); background: var(--surface); border-color: #fff; box-shadow: var(--shadow-sm); }
.tab-btn:focus-visible, .btn:focus-visible, .logout-button:focus-visible { outline: 3px solid rgb(14 165 233 / 35%); outline-offset: 2px; }

.panel { min-height: 460px; padding: clamp(18px, 3vw, 32px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); animation: fadeInTab .2s ease-out; }
@keyframes fadeInTab { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

h2 { margin: 0 0 24px; padding-bottom: 12px; color: var(--text-heading); border-bottom: 1px solid var(--border); font-size: 1.2rem; font-weight: 750; letter-spacing: -.01em; }
h3 { margin: 22px 0 12px; color: var(--accent-dark); font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.panel > h2:first-child { margin-top: 0; }

/* Formulário e esquemas */
.geometry-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr); gap: 24px; align-items: start; margin-bottom: 24px; }
.geometry-inputs { min-width: 0; }
.geometry-visual { min-width: 0; padding: 18px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 12px; }
.geometry-visual h3 { margin-top: 0; padding-bottom: 11px; border-bottom: 1px solid var(--border); }
.svg-container { overflow: auto; }
.input-group { padding: 18px; margin-bottom: 16px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 12px; }
.input-group h3 { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.input-field { display: grid; grid-template-columns: minmax(0, 1fr) 106px; align-items: center; gap: 12px; min-height: 42px; padding: 4px 0; border-bottom: 1px dashed #dce5ed; }
.input-field label { color: #405167; font-size: .82rem; font-weight: 550; }
.input-field input, .input-field select { width: 100%; min-height: 34px; padding: 5px 8px; color: var(--text-heading); background: #fff; border: 1px solid var(--border-strong); border-radius: 6px; text-align: right; }
.input-field select { text-align: left; cursor: pointer; }
.input-field input[readonly] { color: #5f7183 !important; background: #eaf0f5 !important; cursor: not-allowed !important; }
.input-field input:focus, .input-field select:focus, .select-bitola:focus { border-color: var(--accent); outline: 3px solid rgb(7 89 133 / 13%); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 0; border-radius: 8px !important; box-shadow: 0 3px 7px rgb(7 89 133 / 16%); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.btn:hover { filter: brightness(.95); transform: translateY(-1px); box-shadow: 0 5px 12px rgb(7 89 133 / 18%); }

/* Memorial técnico e resultados */
.memorial-block { padding: 18px 20px; margin: 0 0 16px; background: linear-gradient(90deg, #f8fcff, #fff 75%); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; }
.memorial-block h4 { margin: 0 0 12px; color: var(--text-heading); font-size: .9rem; font-weight: 750; }
.memorial-step { padding: 5px 0; color: #405167; font-size: .9rem; overflow-wrap: anywhere; }
.memorial-step + .memorial-step { border-top: 1px dashed #e4ebf1; }
.math-font, table, input, .result-value { font-family: "Roboto Mono", Consolas, "Courier New", monospace; }
.math-eq { color: #405167; }
.math-val { color: var(--accent-dark); font-family: "Roboto Mono", Consolas, monospace; font-weight: 750; }
.status-tag { display: inline-flex; align-items: center; padding: 3px 7px; margin: 0 2px; border-radius: 5px; font-size: .76rem; font-weight: 800; letter-spacing: .02em; }
.status-aprovado { color: var(--success); background: var(--success-soft); border: 1px solid #86efac; }
.status-reprovado { color: var(--danger); background: var(--danger-soft); border: 1px solid #fca5a5; }
.alert-box { display: flex; align-items: center; gap: 10px; padding: 14px 16px; margin-bottom: 20px; color: var(--danger); background: var(--danger-soft); border: 1px solid #fecaca; border-radius: 9px; font-weight: 700; }
.alert-box::before { content: "!"; display: inline-grid; width: 21px; height: 21px; place-items: center; color: #fff; background: var(--danger); border-radius: 50%; font-size: .82rem; }

/* Relatório técnico consolidado */
.report-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.report-toolbar p { margin: 6px 0 0; color: var(--text-muted); }
.report-export-button { flex: 0 0 auto; padding: 0 18px; color: #fff; background: var(--accent); font-weight: 800; }
.report-export-button:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; transform: none; }
.technical-report { max-width: 1080px; margin: 0 auto; }
.report-empty { padding: 40px 24px; text-align: center; color: var(--text-muted); background: var(--surface-subtle); border: 1px dashed var(--border-strong); border-radius: 12px; }
.report-empty h3 { margin: 0 0 8px; }
.report-stale-notice { padding: 12px 14px; margin-bottom: 16px; color: #854d0e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; font-weight: 700; }
.report-cover { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 24px; margin-bottom: 20px; color: #fff; background: linear-gradient(135deg, #063f5e, #075985 58%, #0e7490); border-radius: 12px; }
.report-cover__eyebrow { margin-bottom: 6px; color: #bae6fd; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.report-cover h3 { margin: 0; color: #fff; font-size: 1.35rem; letter-spacing: -.015em; }
.report-cover p { max-width: 720px; margin: 8px 0 0; color: #e0f2fe; }
.report-stage { align-self: start; padding: 8px 10px; color: #eff6ff; border: 1px solid rgb(255 255 255 / 35%); border-radius: 6px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-align: center; text-transform: uppercase; }
.report-stage--pending { color: #fef3c7; border-color: #fcd34d; background: rgb(120 53 15 / 22%); }
.report-meta, .report-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.report-meta__item, .report-summary__item { padding: 12px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 8px; }
.report-meta__item span, .report-summary__item span { display: block; margin-bottom: 4px; color: var(--text-muted); font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.report-meta__item strong, .report-summary__item strong { color: var(--text-heading); font-size: .82rem; overflow-wrap: anywhere; }
.report-summary__item .status-tag { margin: 0; }
.report-section { padding: 22px; margin-bottom: 18px; background: #fff; border: 1px solid var(--border); border-radius: 10px; break-inside: avoid; }
.report-section > h3 { margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.report-section > h3 > span { display: inline-grid; width: 22px; height: 22px; margin-right: 8px; place-items: center; color: #fff; background: var(--accent); border-radius: 50%; font-size: .7rem; }
.report-section__intro { margin: -5px 0 16px; color: var(--text-muted); font-size: .86rem; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.report-table-wrap { overflow-x: auto; }
.report-table { width: 100%; min-width: 0; margin: 0; font-size: .8rem; }
.report-table th, .report-table td { padding: 8px 10px; }
.report-copy { overflow-x: auto; }
.report-copy .data-table { min-width: 620px; }
.report-copy .memorial-block { break-inside: avoid; }
.report-conclusion { border-left: 4px solid var(--accent); }
.report-conclusion--pending { border-left-color: var(--danger); background: #fffafa; }
.report-conclusion p { margin: 0 0 10px; }
.report-conclusion ul { padding-left: 20px; margin: 8px 0 0; color: #405167; }

/* Tabelas */
.data-table { width: 100%; min-width: 620px; margin-top: 8px; overflow: hidden; background: #fff; border: 1px solid var(--border); border-collapse: separate; border-spacing: 0; border-radius: 10px; font-size: .83rem; }
.data-table th, .data-table td { padding: 10px 12px; text-align: right; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.data-table th:last-child, .data-table td:last-child { border-right: 0; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table thead th { color: #fff; background: #123a58; font-size: .75rem; font-weight: 750; letter-spacing: .02em; }
.data-table tbody tr:nth-child(even) { background: #f8fafc; }
.data-table tbody tr:hover { background: #eff8ff; }
.data-table tfoot th { color: var(--text-heading); background: #e8f1f8; font-weight: 800; }
.select-bitola { padding: 4px 6px; color: var(--text-heading); background: #fff; border: 1px solid var(--border-strong); border-radius: 5px; cursor: pointer; }

#prancha-tabela-aco, #prancha-svg-container, #prancha-svg-superior { width: 100%; max-width: 100%; border: 1px solid var(--border) !important; border-radius: 10px; box-shadow: var(--shadow-sm); }

/* Aba 4: cada quadro tem seu próprio fluxo; nenhuma tabela disputa a mesma faixa. */
.steel-schedule { overflow: hidden; }
.steel-schedule__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 24px; align-items: start; font-family: Inter, sans-serif; }
.steel-schedule__positions, .steel-schedule__summary { min-width: 0; }
.steel-schedule__summary { display: grid; gap: 24px; }
.steel-schedule__positions > table, .steel-schedule__summary > div > table { display: table; }
.steel-schedule__positions { overflow-x: auto; padding-bottom: 4px; }
.steel-schedule__summary > div { min-width: 0; overflow-x: auto; }
.steel-schedule__summary .data-table { min-width: 0; font-size: .74rem; }
.steel-schedule__summary .data-table th, .steel-schedule__summary .data-table td { padding: 7px 6px; }
.concrete-summary-table thead th { color: var(--text-heading) !important; background: #f8fafc !important; border-color: var(--border) !important; }
.concrete-summary-table tbody td { color: var(--text-main) !important; background: #fff; border-color: var(--border) !important; }
.concrete-summary-table tbody td:nth-child(2) { color: #1d4ed8 !important; }
.steel-budget { display: grid; gap: 18px; margin-top: 28px; padding: 24px; color: var(--text-main); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); font-family: Inter, sans-serif; }
.steel-budget__head { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.steel-budget__head h3 { margin: 2px 0 6px; color: var(--text-heading); font-size: 1.12rem; }
.steel-budget__head p { max-width: 720px; margin: 0; color: var(--text-muted); font-size: .85rem; line-height: 1.5; }
.section-kicker { margin: 0 !important; color: var(--accent) !important; font-size: .7rem !important; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.budget-status { display: inline-flex; flex: 0 0 auto; align-items: center; min-height: 28px; padding: 5px 9px; border: 1px solid currentColor; border-radius: 999px; font-size: .72rem; font-weight: 800; line-height: 1; white-space: nowrap; }
.budget-status--updated { color: #047857; background: #ecfdf5; }
.budget-status--stale { color: #b45309; background: #fffbeb; }
.budget-status--manual { color: #1d4ed8; background: #eff6ff; }
.budget-status--unavailable, .budget-status--loading { color: #64748b; background: #f8fafc; }
.budget-status--failure { color: #b91c1c; background: #fff1f2; }
.steel-budget__filters, .budget-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.steel-budget label { display: grid; gap: 5px; color: #405167; font-size: .72rem; font-weight: 750; }
.steel-budget select, .steel-budget input { width: 100%; min-width: 0; min-height: 34px; padding: 7px 8px; color: var(--text-main); background: #fff; border: 1px solid var(--border-strong); border-radius: 6px; font: inherit; font-size: .82rem; }
.steel-budget select:disabled { color: #94a3b8; background: #f8fafc; cursor: not-allowed; }
.price-trace-card { padding: 14px 16px; background: #f8fafc; border: 1px solid var(--border); border-radius: 9px; }
.price-trace-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.price-trace-card dl div { min-width: 0; }
.price-trace-card dt { margin-bottom: 3px; color: var(--text-muted); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.price-trace-card dd { margin: 0; color: var(--text-heading); font-size: .8rem; font-weight: 650; overflow-wrap: anywhere; }
.price-trace-card a { color: #0369a1; text-decoration: underline; }
.price-trace-card__note, .budget-disclaimer { margin: 12px 0 0; color: var(--text-muted); font-size: .75rem; line-height: 1.5; }
.budget-import-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 14px; color: #405167; background: #f8fafc; border: 1px dashed var(--border-strong); border-radius: 9px; }
.budget-import-panel strong { display: block; color: var(--text-heading); font-size: .82rem; }
.budget-import-panel p { margin: 3px 0 0; font-size: .73rem; line-height: 1.45; }
.budget-import-panel a { color: #0369a1; font-size: .76rem; font-weight: 750; text-decoration: underline; white-space: nowrap; }
.budget-file-input { display: inline-flex !important; grid-template-columns: auto; padding: 7px 10px; color: #fff !important; background: #123a58; border-radius: 6px; font-size: .75rem !important; text-align: center; cursor: pointer; white-space: nowrap; }
.budget-file-input input { position: absolute; width: 1px; min-height: 1px; padding: 0; opacity: 0; pointer-events: none; }
.budget-import-feedback { padding: 9px 12px; border-left: 3px solid currentColor; border-radius: 5px; font-size: .78rem; }
.budget-manual-note, .budget-alert { padding: 10px 12px; color: #1e3a8a; background: #eff6ff; border-left: 3px solid #2563eb; border-radius: 5px; font-size: .8rem; line-height: 1.45; }
.budget-alert { color: #991b1b; background: #fff1f2; border-left-color: #dc2626; }
.budget-table-wrap { overflow-x: auto; }
.steel-budget-table { min-width: 1100px; margin: 0; }
.steel-budget-table thead th { color: #fff !important; background: #123a58 !important; border-color: #123a58 !important; }
.steel-budget-table td { color: var(--text-main) !important; border-color: var(--border) !important; vertical-align: top; }
.steel-budget-table td:nth-child(1), .steel-budget-table td:nth-child(7) { white-space: nowrap; }
.manual-price-input { display: flex !important; grid-template-columns: auto minmax(76px, 1fr); align-items: center; gap: 5px; color: var(--text-muted) !important; white-space: nowrap; }
.manual-price-input input { min-height: 28px; padding: 4px 5px; }
.row-price-status { display: grid; gap: 3px; color: var(--text-heading); font-weight: 700; }
.row-price-status small { color: var(--text-muted); font-size: .68rem; font-weight: 500; line-height: 1.35; }
.row-price-status--unavailable { color: #64748b; }
.row-price-status--manual { color: #1d4ed8; }
.row-price-status--stale { color: #b45309; }
.row-price-status--updated { color: #047857; }
.budget-composition { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 22px; align-items: start; }
.budget-options { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; background: #f8fafc; border: 1px solid var(--border); border-radius: 9px; }
.budget-summary { display: grid; gap: 0; margin: 0; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.budget-summary div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 12px; background: #fff; border-bottom: 1px solid var(--border); }
.budget-summary div:nth-child(even) { background: #f8fafc; }
.budget-summary div:last-child { border-bottom: 0; }
.budget-summary dt, .budget-summary dd { margin: 0; font-size: .8rem; }
.budget-summary dt { color: #405167; }
.budget-summary dd { color: var(--text-heading); font-weight: 800; text-align: right; }
.budget-summary__total { color: #fff; background: #123a58 !important; }
.budget-summary__total dt, .budget-summary__total dd { color: #fff; font-size: .88rem; }

/* Prancha: vistas independentes com espaço reservado para título e cotas. */
.drawing-views-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.drawing-viewport { min-width: 0; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-sm); }
.drawing-viewport__header { padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid #e4ebf1; }
.drawing-viewport__header h4 { margin: 0 0 3px; color: var(--text-heading); font-size: .82rem; letter-spacing: .04em; }
.drawing-viewport__header span { color: var(--text-muted); font-size: .68rem; font-weight: 700; }
.drawing-viewport__canvas { overflow: auto; }
.drawing-viewport__canvas svg { display: block; width: 100%; min-width: 520px; height: auto; }


@media (max-width: 980px) {
    .geometry-layout { grid-template-columns: 1fr; }
    .geometry-visual { width: 100%; }
    .steel-schedule__layout { grid-template-columns: 1fr; }
    .steel-schedule__summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .drawing-views-grid { grid-template-columns: 1fr; }
    .report-meta, .report-summary { grid-template-columns: 1fr 1fr; }
    .steel-budget__filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .price-trace-card dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .budget-composition { grid-template-columns: 1fr; }
    .budget-import-panel { grid-template-columns: 1fr auto; }
    .budget-import-panel > div { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
    .app-container { padding: 14px 12px 32px; }
    .app-header { align-items: flex-start; padding: 8px 4px 18px; }
    .brand { gap: 10px; }
    .app-header p { display: none; }
    .logout-button { padding: 7px 10px; }
    .tabs { margin-inline: -2px; border-radius: 10px; }
    .tab-btn { padding: 8px 11px; font-size: .76rem; }
    .panel { min-height: 0; padding: 18px 14px; border-radius: 10px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .input-field { grid-template-columns: minmax(0, 1fr) 116px; }
    .input-group, .memorial-block { padding: 14px; }
    .data-table { font-size: .76rem; }
    .steel-schedule { padding: 14px !important; }
    .steel-schedule__summary { grid-template-columns: 1fr; }
    .steel-budget { padding: 16px; }
    .steel-budget__head { display: grid; }
    .steel-budget__filters, .budget-options, .price-trace-card dl { grid-template-columns: 1fr; }
    .budget-import-panel { grid-template-columns: 1fr; align-items: start; }
    .budget-import-panel > div { grid-column: auto; }
    .report-toolbar, .report-cover { grid-template-columns: 1fr; display: grid; }
    .report-toolbar { gap: 12px; }
    .report-export-button { width: 100%; }
    .report-meta, .report-summary, .report-grid { grid-template-columns: 1fr; }
    .report-section, .report-cover { padding: 16px; }
}

@media print {
    body { background: #fff; }
    .tabs, .logout-button, #btn-calcular, .report-toolbar { display: none !important; }
    .panel { border: 0; box-shadow: none; }
    .technical-report { max-width: none; }
    .report-section { border-color: #d1d5db; box-shadow: none; }
    .report-section--page-start { break-before: page; page-break-before: always; }
    .memorial-block, .report-table-wrap, .report-conclusion, .report-section > h3, .report-section > h4, .data-table tr { break-inside: avoid; page-break-inside: avoid; }
    .report-section > h3, .report-section > h4, .memorial-step { break-after: avoid; page-break-after: avoid; }
    .data-table thead { display: table-header-group; }
}
