/* BuildingTracker — Cobalt / typography and interface system */
:root {
  --bg: #f6f7fb;
  --concrete: #f6f7fb;
  --concrete-strong: #e9ecf4;
  --surface: #fff;
  --paper: #fbfcff;
  --border: #e5e8f0;
  --border-strong: #d4dae6;
  --ink: #20283d;
  --ink-soft: #505d76;
  --muted: #69758b;
  --slate-900: #182139;
  --slate-800: #263350;
  --slate-700: #43516b;
  --accent: #3559e8;
  --accent-hover: #2747c7;
  --accent-soft: #edf1ff;
  --blueprint: #3559e8;
  --blueprint-soft: #edf1ff;
  --amber: #cf8c23;
  --amber-strong: #906016;
  --amber-soft: #fff8e9;
  --amber-border: #f1dfb5;
  --amber-warn-bg: #fff5df;
  --green: #198368;
  --green-soft: #eaf6f0;
  --red: #cb4a5f;
  --red-soft: #fff0f3;
  --radius: 18px;
  --radius-sm: 9px;
  --radius-pill: 999px;
  --shadow-sm: 0 3px 16px rgba(25,40,80,.025);
  --shadow-md: 0 14px 40px rgba(25,40,80,.12);
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: var(--font-sans);
  --sidebar: 244px;
  --content-max: 1360px;
}
* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 1rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .65; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid #8ca2ff; outline-offset: 3px; }
.icon { display: inline-block; width: 19px; height: 19px; flex-shrink: 0; vertical-align: -.22em; }
[data-icon] { display: inline-flex; align-items: center; }
.num, .money, .calc, .req-subtotal, .req-total { font-variant-numeric: tabular-nums; }
.skip-link { position: fixed; top: -70px; left: 16px; z-index: 100; background: var(--accent); padding: 12px 20px; color: white; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.app { display: flex; min-height: 100dvh; }
.sidebar { width: var(--sidebar); flex-shrink: 0; position: sticky; top: 0; height: 100dvh; background: #fff; padding: 32px 18px 24px; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 5px 40px; }
.brand .logo { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 42px; background: var(--accent); color: #fff; border-radius: 12px; box-shadow: 0 5px 14px #3559e82b; }
.brand .logo svg { width: 29px; height: 29px; }
.brand .txt { font-family: var(--font-display); font-size: .9375rem; line-height: 1.3; letter-spacing: -.04em; font-weight: 800; }
.brand .txt small { display: block; margin-top: 5px; color: var(--muted); font-family: var(--font-sans); font-size: .75rem; letter-spacing: .01em; font-weight: 400; }
.nav-label { margin: 0 14px 13px; font-size: .75rem; font-weight: 600; color: #788298; }
#nav { display: grid; gap: 7px; }
.nav-item { position: relative; width: 100%; display: flex; align-items: center; gap: 13px; padding: 13px 14px; border: 0; border-radius: 11px; background: transparent; color: var(--ink-soft); font-size: .9375rem; font-weight: 500; text-align: left; cursor: pointer; transition: background .16s, color .16s; }
.nav-item .icon { width: 21px; height: 21px; color: #8490a7; }
.nav-item:hover { color: var(--accent); background: #f5f7fd; }
.nav-item.active { background: var(--accent-soft); color: #2d4fcc; font-weight: 700; }
.nav-item.active .icon { color: var(--accent); }
.nav-item.active::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-left: auto; }
.sidebar-foot { display: flex; align-items: flex-start; gap: 9px; margin-top: auto; padding: 20px 10px 0; border-top: 1px solid var(--border); font-size: .75rem; line-height: 1.7; color: var(--muted); }
.sidebar-foot b { display: block; color: var(--ink-soft); font-weight: 500; }
.sidebar-foot #save-time { display: block; }
.save-indicator { margin-top: 7px; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.main { flex: 1; min-width: 0; max-width: calc(var(--content-max) + var(--sidebar)); margin: 0 auto; padding: 35px clamp(24px, 3.2vw, 56px) 64px; outline: none; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 30px; }
.eyebrow { display: block; font-size: .75rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.topbar h1 { margin: 0; font-family: var(--font-display); font-size: clamp(1.6rem, 2.5vw, 2rem); font-weight: 800; line-height: 1.25; letter-spacing: -.045em; color: var(--slate-900); }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar-sep { height: 24px; width: 1px; background: var(--border); }
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 10px); min-width: 245px; max-width: calc(100vw - 32px); padding: 7px; z-index: 30; background: #fff; border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-md); }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-soft); font-size: .875rem; text-align: left; cursor: pointer; }
.dropdown-item:hover { background: var(--bg); color: var(--ink); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: var(--red-soft); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 28px; margin-bottom: 22px; box-shadow: var(--shadow-sm); min-width: 0; }
.card.paper { background: var(--paper); }
.card h2 { font-family: var(--font-display); font-size: 1.125rem; line-height: 1.4; letter-spacing: -.035em; font-weight: 800; margin: 0 0 6px; color: var(--ink); }
.card .sub { font-size: .875rem; line-height: 1.65; color: var(--muted); margin: 0 0 22px; max-width: 850px; }
.section-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.section-heading .sub { margin: 3px 0 0; }
.section-heading.split { justify-content: space-between; flex-wrap: wrap; }
.section-icon { width: 46px; height: 46px; display: grid; place-items: center; background: #ffffff12; border: 1px solid #ffffff20; border-radius: 13px; color: #b9c7ff; flex-shrink: 0; }
.section-icon .icon { width: 25px; height: 25px; }
.card.project-card { background: var(--slate-900); border-color: var(--slate-900); padding: 28px 30px 30px; box-shadow: 0 8px 24px #1821390d; }
.project-card h2 { color: #fff; }
.project-card .sub { color: #abb5cc; }
.project-card label.fld { color: #c4cde1; font-weight: 500; }
.project-card .inp { background: #fff; border-color: transparent; padding: 13px 15px; }
.project-card #proj-name { font-weight: 600; }
.project-card #proj-budget { font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid2 > div { min-width: 0; }
label.fld { display: block; margin: 0 0 8px; color: var(--ink-soft); font-size: .875rem; line-height: 1.4; font-weight: 500; }
.inp { display: block; width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; color: var(--ink); font-size: .9375rem; line-height: 1.5; transition: border-color .15s, box-shadow .15s; }
.inp::placeholder { color: #7d899e; }
.inp:hover { border-color: #b3bfd4; }
.inp:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px #3559e819; }
.inp-sm { width: 100px; }
.input-group { display: flex; align-items: stretch; min-width: 0; }
.input-group .inp { flex: 1; }
.input-group .inp.has-suffix { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: 0; }
.input-group .suffix { display: inline-flex; align-items: center; padding: 0 10px; color: var(--muted); background: #f8f9fc; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; white-space: nowrap; font-size: .8125rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 17px; min-height: 44px; border: 1px solid transparent; border-radius: 10px; font-size: .875rem; font-weight: 600; line-height: 1.35; cursor: pointer; transition: background .16s, border-color .16s, box-shadow .16s; white-space: nowrap; }
.btn-primary, .btn-dark { background: var(--accent); color: #fff; box-shadow: 0 3px 7px #3559e81a; }
.btn-primary:hover, .btn-dark:hover { background: var(--accent-hover); box-shadow: 0 4px 10px #3559e829; }
.btn-ghost { background: #fff; border-color: var(--border-strong); color: var(--ink-soft); }
.btn-ghost:hover { background: #f7f9ff; border-color: #b9c6e6; color: var(--accent); }
.btn-danger { background: #fff; color: var(--red); border-color: #f0c8d0; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 8px 12px; min-height: 38px; font-size: .875rem; border-radius: 8px; }
.btn-sm .icon { width: 16px; height: 16px; }
.row-delete { display: inline-grid; place-items: center; width: 36px; height: 38px; padding: 0; background: transparent; border: 1px solid transparent; border-radius: 8px; color: #8390a5; cursor: pointer; }
.row-delete .icon { width: 17px; height: 17px; }
.row-delete:hover { background: var(--red-soft); color: var(--red); }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 6px; padding: 4px 9px; font-size: .8125rem; line-height: 1.5; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip.ok { color: #187358; background: var(--green-soft); }
.chip.warn { color: var(--amber-strong); background: var(--amber-warn-bg); }
.chip.crit { color: #b33c50; background: var(--red-soft); }
.chip.slate { color: #596884; background: #f0f3f9; }
.chip .icon { width: 14px; height: 14px; }
#phases-summary, #materials-summary { white-space: normal; line-height: 1.6; }
#phases-summary { width: 100%; padding: 12px 14px; border-radius: 9px; }
.phase-chip-btn { padding: 10px 15px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--ink-soft); font-size: .875rem; cursor: pointer; transition: background .15s, border-color .15s; }
.phase-chip-btn:hover { border-color: #adbcf6; color: var(--accent); }
.phase-chip-btn.active { background: var(--accent-soft); color: var(--accent); border-color: #becbf9; font-weight: 600; }
.phase-chip-value { display: block; margin-top: 3px; font-size: .75rem; color: var(--muted); font-weight: 400; }
.phase-chip-btn.active .phase-chip-value { color: #5771c4; }
.history-title { color: var(--ink-soft); font-size: .9375rem; font-weight: 500; }
.history-title .icon { color: #8192bd; margin-right: 4px; }
.field-note { font-size: .8125rem; color: var(--muted); margin-top: 7px; }
#unplanned-list { overflow-x: auto; }
.del-name .chip { white-space: normal; }
.table-scroll:focus-visible { outline: 2px solid #8ca2ff; outline-offset: 3px; }
.kpi-grid > .card { grid-column: 1 / -1; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .875rem; font-variant-numeric: tabular-nums; }
.table th { background: #f7f8fc; padding: 13px 12px; color: var(--muted); font-weight: 500; font-size: .8125rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 14px 12px; border-bottom: 1px solid #edf0f6; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbff; }
.table tr.row-warn td:first-child { box-shadow: inset 3px 0 var(--amber); }
.table tr.row-crit td:first-child { box-shadow: inset 3px 0 var(--red); }
.table td.ok { color: var(--green); font-weight: 600; }
.table td.warn, .td-warn { color: var(--amber-strong); font-weight: 600; }
.table td.crit { color: var(--red); font-weight: 600; }
.table-scroll { overflow-x: auto; max-width: 100%; overscroll-behavior-x: contain; }
.phase-row { display: grid; grid-template-columns: minmax(145px, 1.5fr) minmax(140px, 1fr) minmax(120px, 1fr) minmax(125px, auto) 36px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf0f6; }
.phase-row:last-child { border-bottom: 0; }
.phase-row .inp { border-color: transparent; background: #f7f8fc; }
.phase-row .inp:focus { border-color: var(--accent); background: #fff; }
.phase-row .suffix { border-color: transparent; background: #f7f8fc; }
.phase-row .chip { justify-self: start; white-space: normal; }
.phase-number { font-size: .75rem; color: #8390a9; width: 24px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.phase-name { display: flex; align-items: center; min-width: 0; gap: 6px; }
.phase-row .calc { text-align: left; }
.row-head { font-size: .8125rem; color: var(--muted); font-weight: 500; padding-top: 0; padding-bottom: 13px; }
#materials-list { overflow-x: auto; }
.mat-row { display: grid; grid-template-columns: minmax(165px, 1.5fr) 75px 125px 125px 110px 115px 36px; min-width: 920px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #edf0f6; }
.mat-row .inp { font-size: .875rem; padding-left: 10px; padding-right: 10px; }
.mat-row-card { display: none; }
.calc { font-size: .9375rem; color: var(--ink-soft); text-align: right; font-weight: 500; }
.req-item-row { display: grid; grid-template-columns: minmax(160px, 1.6fr) minmax(90px, .8fr) minmax(100px, .8fr) minmax(85px, .7fr) minmax(90px, .8fr) 36px; gap: 10px; margin-bottom: 12px; align-items: center; }
.del-item-row { display: grid; grid-template-columns: minmax(160px, 1.8fr) minmax(95px, .7fr) minmax(95px, .7fr) 36px; gap: 10px; margin-bottom: 12px; align-items: center; }
.del2-row { display: grid; grid-template-columns: minmax(160px, 1.5fr) .55fr .6fr .55fr minmax(95px, .6fr) minmax(95px, .7fr) 36px; gap: 10px; margin-bottom: 12px; align-items: center; }
.req-head, .del-head { color: var(--muted); font-size: .8125rem; font-weight: 500; padding: 12px 0; border-bottom: 1px solid var(--border); }
.req-subtotal { text-align: right; font-size: .9375rem; font-weight: 600; }
.req-total { text-align: right; border-top: 1px solid var(--border); padding: 20px 0 10px; font-family: var(--font-display); font-size: 1.125rem; font-weight: 800; letter-spacing: -.025em; }
.edit-banner { background: var(--accent-soft); border: 1px solid #d5defb; color: #3a55a3; padding: 12px 16px; border-radius: 10px; font-size: .875rem; margin-bottom: 20px; }
.flex { display: flex; align-items: center; gap: 8px; }
.u { width: 80px; flex-shrink: 0; }
.del-name { font-size: .9375rem; font-weight: 500; line-height: 1.5; }
.del-name small { display: block; font-size: .8125rem; color: var(--muted); font-weight: 400; }
.del-num { font-size: .9375rem; color: var(--ink-soft); text-align: center; font-variant-numeric: tabular-nums; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: 15px; padding: 22px; min-width: 0; }
.kpi .label { color: var(--muted); font-size: .8125rem; font-weight: 500; }
.kpi .value, .kpi .value.mono { font-family: var(--font-display); font-size: clamp(1.25rem, 1.8vw, 1.75rem); font-weight: 800; letter-spacing: -.045em; margin: 12px 0 8px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi .note { font-size: .75rem; line-height: 1.6; color: var(--muted); }
.kpi:first-child { background: var(--accent-soft); border-color: #dbe2fd; }
.kpi:first-child .label, .kpi:first-child .value { color: var(--accent); }
.kpi .bar-track { margin-top: 14px; }
.bar-track { height: 6px; background: #ecf0f7; border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; transition: width .3s ease; }
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { padding: 13px 16px; margin-bottom: 8px; border: 1px solid transparent; border-radius: 9px; font-size: .875rem; line-height: 1.65; }
.alerts li.crit { color: #963e51; background: var(--red-soft); }
.alerts li.warn { color: var(--amber-strong); background: var(--amber-soft); }
.alerts li.ok { color: #23725a; background: var(--green-soft); }
.alerts li small { color: var(--muted); }
.phase-card { box-shadow: none; border-radius: 12px; margin-bottom: 14px; padding: 22px; }
.phase-card .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.phase-card .head h3 { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin: 0; letter-spacing: -.025em; }
.phase-card .head h3 .icon { color: var(--accent); }
.phase-card .nums { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin: 20px 0; }
.phase-card .num { border-right: 1px solid var(--border); padding-right: 10px; }
.phase-card .num:last-child { border-right: 0; }
.phase-card .num .k { color: var(--muted); font-size: .75rem; }
.phase-card .num .v { font-size: 1rem; margin-top: 6px; font-weight: 600; }
.phase-card .reasons { list-style: none; margin: 12px 0 0; padding: 0; color: var(--amber-strong); font-size: .875rem; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; color: var(--ink-soft); font-size: .8125rem; }
.bar-row .lbl { width: 190px; flex-shrink: 0; }
.bar-row .bar-track { flex: 1; }
.inv-row { border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 12px; }
.inv-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.inv-title { font-size: .9375rem; }
.inv-phase { color: var(--muted); font-size: .8125rem; margin-left: 10px; }
.inv-flow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .875rem; color: var(--ink-soft); }
.inv-step b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.inv-arrow { color: #9aa6ba; }
.inv-bar { flex: 1; min-width: 90px; }
.inv-reasons { margin-top: 12px; color: var(--amber-strong); font-size: .875rem; }
.inv-note { margin-top: 12px; color: var(--muted); font-size: .8125rem; }
.legend { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 20px; font-size: .875rem; color: var(--ink-soft); }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); font-size: .9375rem; line-height: 1.7; }
.empty .illus, .empty .big { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 17px; background: var(--accent-soft); color: var(--accent); margin: 0 auto 17px; }
.empty .icon { width: 26px; height: 26px; }
#toasts { position: fixed; bottom: 24px; right: 24px; z-index: 50; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--slate-900); color: #fff; padding: 15px 20px; border-radius: 12px; font-size: .875rem; box-shadow: var(--shadow-md); animation: pop .2s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.view { display: none; }
.view.active { display: block; }
.chip, .table th, .row-head, .req-head, .del-head, .kpi .label { font-size: .875rem; }

@media (max-width: 1250px) {
  :root { --sidebar: 220px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .brand { gap: 9px; }
  .brand .txt { font-size: .875rem; }
  .main { padding-left: 24px; padding-right: 24px; }
  .card { padding: 24px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .req-item-row, .del2-row { gap: 7px; }
  #req-items, #del-items { overflow-x: auto; }
  .req-item-row { min-width: 730px; }
  .del2-row { min-width: 730px; }
}
@media (max-width: 1050px) {
  .phase-row { grid-template-columns: minmax(150px, 1.4fr) minmax(125px, 1fr) minmax(115px, 1fr) 36px; }
  .phase-row > .chip { grid-column: 3; grid-row: 2; }
  .phase-row > .row-delete { grid-column: 4; grid-row: 1; }
  .phase-row.row-head { grid-template-columns: minmax(150px, 1.4fr) minmax(125px, 1fr) minmax(115px, 1fr) 36px; }
  .phase-row.row-head > :nth-child(4) { display: none; }
  .phase-card .nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .app { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 18px 20px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0 2px 18px; }
  .brand .txt { font-size: 1rem; }
  .brand .txt small { display: none; }
  .brand .logo { width: 34px; height: 36px; border-radius: 10px; }
  .nav-label, .sidebar-foot { display: none; }
  #nav { display: flex; overflow-x: auto; gap: 6px; scrollbar-width: thin; padding: 2px 0 3px; }
  .nav-item { flex-shrink: 0; width: auto; padding: 10px 12px; gap: 7px; font-size: .875rem; }
  .nav-item.active::after { display: none; }
  .nav-item .icon { width: 18px; height: 18px; }
  .main { padding: 26px 20px 44px; }
  .topbar { margin-bottom: 22px; }
  .card, .card.project-card { padding: 22px; border-radius: 15px; }
  .mat-row { display: none; }
  .mat-row-card { display: block; border: 1px solid var(--border); border-radius: 11px; padding: 16px; margin-bottom: 12px; }
  .card > .flex { flex-wrap: wrap; gap: 14px; }
  .card > .flex > .flex { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .sidebar { padding: 16px 14px 8px; }
  .main { padding: 24px 14px 40px; }
  .topbar { gap: 12px; align-items: flex-start; }
  .topbar h1 { font-size: 1.5rem; }
  .eyebrow { font-size: .75rem; }
  .topbar .btn { padding: 10px 12px; min-height: 40px; }
  .topbar .btn .icon { display: none; }
  .card, .card.project-card { padding: 20px 18px; }
  .grid2 { grid-template-columns: 1fr; gap: 16px; }
  .inp { font-size: 1rem; }
  .section-heading { gap: 12px; }
  .section-heading.split { gap: 18px; }
  .section-heading.split .btn { width: 100%; }
  .phase-row.row-head { display: none; }
  .phase-row { grid-template-columns: minmax(0, 1fr) 36px; padding: 18px 0; gap: 12px; }
  .phase-row > .phase-name { grid-column: 1; grid-row: 1; }
  .phase-row > .row-delete { grid-column: 2; grid-row: 1; }
  .phase-row > .input-group { grid-column: 1 / -1; grid-row: 2; }
  .phase-row > .calc { grid-column: 1 / -1; grid-row: 3; }
  .phase-row > .calc::before { content: "Materiales planificados: "; color: var(--muted); font-size: .8125rem; }
  .phase-row > .chip { grid-column: 1 / -1; grid-row: 4; }
  .kpi-grid { gap: 10px; }
  .kpi { padding: 16px; }
  .kpi .value, .kpi .value.mono { font-size: 1.3rem; }
  .phase-card .nums { gap: 18px 12px; }
  .bar-row { flex-wrap: wrap; gap: 8px; }
  .bar-row .lbl { width: 100%; }
  .inv-row { padding: 16px; }
  .inv-phase { display: block; margin: 4px 0 0; }
  .inv-flow { gap: 8px; }
  .inv-bar { flex-basis: 100%; margin-top: 6px; }
  #toasts { bottom: 16px; right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 380px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
