:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  --bg: #0b1422;
  --sidebar: #0a121e;
  --panel: #111d2d;
  --panel-top: #16263a;
  --border: #26384d;
  --text: #f1f6fe;
  --muted: #a4b7cd;
  --accent: #73d7ff;
  --green: #68dfb0;
  --orange: #ffc17c;
  --red: #ff9b9f;
  --radius: 17px;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; line-height: 1.5; }
h1, h2, p, dl, dd { margin: 0; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.45rem); font-weight: 720; line-height: 1.05; letter-spacing: -.053em; }
h2 { font-size: 1.22rem; letter-spacing: -.026em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .36; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.skip { position: absolute; left: 1rem; top: -6rem; z-index: 20; background: var(--accent); color: #081624; padding: .7rem; }
.skip:focus { top: 1rem; }
.layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 27px 15px 17px; background: linear-gradient(165deg, #0e1827, var(--sidebar) 42%); border-right: 1px solid #203144;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 0 9px; }
.brand-mark {
  width: 43px; height: 43px; display: inline-grid; place-items: center; border-radius: 10px;
  color: #e8f3fb; border: 1px solid #2a485e; background: linear-gradient(145deg, #183046, #0c1826); flex: none;
}
.brand strong { display: block; font-size: 1.25rem; letter-spacing: .18em; line-height: 1.2; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: .57rem; letter-spacing: .07em; white-space: nowrap; }
.sidebar nav { margin-top: 52px; }
.nav-label {
  display: block; margin: 0 11px 9px; color: #94abc0; font-size: .72rem; font-weight: 700; letter-spacing: .15em;
}
.manager-label { margin-top: 26px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 12px;
  color: #b5c6d8; border: 1px solid transparent; border-radius: 9px; background: transparent; font-size: .93rem; font-weight: 600;
}
.nav-item svg { flex: none; }
.nav-item:hover, .nav-item.selected { background: #142b40; color: #eef7ff; }
.nav-item.selected { border-color: #294968; background: linear-gradient(100deg, #183653, #13263b); box-shadow: inset 3px 0 #70d6ff; }
.nav-item.selected svg { color: var(--accent); }
.sidebar-bottom { margin-top: auto; }
.sidebar-bottom p { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; margin: 0 10px 12px; }
.sidebar-bottom p span, .eyebrow span { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--accent); }
.sidebar-bottom button { border-top-color: #213145; border-radius: 4px; }
.workspace { min-width: 0; }
.topbar {
  height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 0 32px; border-bottom: 1px solid #203144; background: #0d1725;
}
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #c3d2e2; font-size: .91rem; font-weight: 600; }
.breadcrumb svg { color: var(--accent); width: 17px; }
.profile-wrap { position: relative; }
.profile { background: none; border: 0; display: flex; align-items: center; gap: 11px; text-align: left; padding: 4px; }
.profile strong, .profile small { display: block; }
.profile strong { font-size: .88rem; }
.profile small { color: var(--muted); font-size: .77rem; }
.profile svg { color: var(--muted); margin-left: 7px; width: 16px; }
.avatar { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; background: #184666; color: #d7f2ff; font-size: .79rem; font-weight: 700; }
.profile-menu {
  position: absolute; z-index: 2; right: 0; top: calc(100% + 8px); min-width: 190px; padding: 6px;
  border: 1px solid var(--border); background: var(--panel); border-radius: 10px; box-shadow: 0 14px 25px #0006;
}
.profile-menu > span { display: block; padding: 8px; font-size: .78rem; color: var(--muted); }
.profile-menu .button { display: flex; width: 100%; min-height: 36px; justify-content: flex-start; border-color: transparent; background: transparent; }
.profile-menu .button:hover, .profile-menu .current { background: #1a344a; }
main { padding: 28px 32px 40px; max-width: 1600px; margin: 0 auto; }
.hero {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center;
  min-height: 221px; padding: 30px 34px; border: 1px solid #31516d; border-radius: var(--radius);
  background: radial-gradient(ellipse at 84% 110%, #1a5681, transparent 63%), linear-gradient(115deg, #14243a, #142f49);
  box-shadow: 0 20px 48px #040a1538, inset 0 1px #a2dbff12;
}
.hero::before {
  position: absolute; inset: 0; z-index: -1; content: "";
  background-image: linear-gradient(90deg, #14243a 21%, transparent 77%),
    repeating-linear-gradient(90deg, transparent 0 29px, #7bc8ff16 29px 30px),
    repeating-linear-gradient(0deg, transparent 0 29px, #7bc8ff16 29px 30px);
}
.hero-drawing { position: absolute; z-index: -1; pointer-events: none; inset: 0; mask-image: linear-gradient(90deg, transparent 37%, #000 67%); }
.hero-drawing i {
  position: absolute; display: block; width: 50%; height: 94%; right: -3%; top: 22%;
  border: 1px solid #99d8ff78; box-shadow: inset 0 0 0 5px #92d9ff16, 0 16px 40px #06162866;
  transform: skewY(-10deg); background: linear-gradient(160deg, #84d6ff23, #08305c82 65%, #58b9ec3a);
}
.hero-drawing i:nth-child(2) {
  width: 46%; right: -3%; top: 33%;
  background: repeating-linear-gradient(90deg, #0d325032 0 70px, #a7dcff66 70px 71px, #122b3d8c 71px 75px), linear-gradient(156deg, #70d2ff38, #17304b65 65%, #9cd8ff20);
}
.hero-drawing i:nth-child(3) { width: 57%; right: -1%; top: 85%; height: 0; box-shadow: 0 0 14px #aee4ff78; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: #8fddff; font-weight: 700; font-size: .72rem; letter-spacing: .13em; }
.hero p, .page-heading p, .proposal-heading p { color: #bfcee0; margin-top: 9px; }
.hero-copy .button { margin-top: 19px; }
.button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 8px 14px;
  border: 1px solid #314a64; border-radius: 9px; background: #17283b; color: var(--text); font-weight: 650;
  font-size: .89rem; white-space: nowrap; text-decoration: none;
}
.button svg { width: 17px; height: 17px; flex: none; }
.button:hover:not(:disabled) { background: #1c3449; border-color: #4b6e8a; }
.button.primary { background: linear-gradient(180deg, #99e6ff, #68cfff); color: #071a2a; border-color: #9ce3ff; box-shadow: 0 6px 18px #1599e632, inset 0 1px #d8f7ff90; }
.button.primary:hover { background: #81dcff; border-color: #a8e7ff; }
.button.danger { background: #a83845; border-color: #bd5260; color: white; }
.button.danger:hover { background: #bc3c4b; }
.danger-outline { color: var(--red); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); gap: 14px; margin: 18px 0 22px; }
.metric {
  display: flex; align-items: flex-start; gap: 13px; min-width: 0; padding: 16px;
  border: 1px solid var(--border); border-radius: 13px; background: linear-gradient(126deg, var(--panel-top), var(--panel));
  box-shadow: inset 0 1px #c3e1ff0a, 0 8px 20px #03081422;
}
.metric-icon { width: 35px; height: 35px; display: inline-grid; place-items: center; flex: none; border-radius: 8px; color: var(--accent); background: #17364c; }
.metric-icon svg { width: 18px; height: 18px; }
.metric.orange .metric-icon { color: var(--orange); background: #3c2e28; }
.metric.green .metric-icon { color: var(--green); background: #153c38; }
.metric-text { min-width: 0; }
.metric-text span, .metric-text small { display: block; color: #b0c1d2; }
.metric-text span { font-size: .87rem; }
.metric-text strong { display: block; margin: 1px 0 2px; font-size: clamp(1.16rem, 2vw, 1.8rem); letter-spacing: -.045em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.metric-text small { font-size: .73rem; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.list-panel { overflow: hidden; box-shadow: 0 15px 35px #03091330; }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 17px 20px; }
.list-toolbar .filters { padding: 0; margin-left: auto; }
.list-toolbar .search { width: clamp(230px, 26vw, 360px); }
.project-cell { display: flex; align-items: center; gap: 10px; }
.project-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 8px; color: #83c8ed; background: #192e46; border: 1px solid #28435e; }
.project-icon svg { width: 16px; height: 16px; }
.section-title { padding: 20px 22px 0; }
.section-title p, .editor-panel > p, .section-title.inline p { color: var(--muted); margin-top: 4px; font-size: .9rem; }
.section-title.inline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 0; margin-bottom: 15px; }
.filters { display: flex; gap: 12px; padding: 17px 22px; }
.search { display: flex; flex: 1; align-items: center; gap: 9px; max-width: 404px; min-width: 0; padding-left: 11px; background: #0e1926; border: 1px solid #2b4055; border-radius: 8px; color: var(--muted); }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search svg { width: 17px; flex: none; }
.search input { border: 0; background: transparent; width: 100%; min-width: 0; padding-left: 0; }
.search input:focus-visible { outline: none; }
input, select, textarea {
  min-height: 41px; padding: 8px 11px; border: 1px solid #2b4055; border-radius: 8px;
  background: #0e1926; color: var(--text); font-size: .92rem;
}
input::placeholder { color: #9cafc2; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, #a7bed2 50%), linear-gradient(135deg, #a7bed2 50%, transparent 50%); background-position: right 15px center, right 10px center; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead { background: #0e1826; }
th { color: #bbcde0; font-weight: 650; font-size: .83rem; }
th, td { padding: 9px 15px; border-bottom: 1px solid #26384b; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
td { font-size: .89rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #182c42; }
.table-link { border: 0; padding: 0; color: #eef6ff; background: none; text-align: left; font-weight: 670; }
.table-link:hover { color: var(--accent); }
.code { display: block; color: var(--muted); font-size: .76rem; margin-top: 1px; }
.right { text-align: right; }
.amount { font-weight: 680; white-space: nowrap; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.positive { color: var(--green); }
.negative { color: var(--red); }
.nowrap { white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 3px 9px; border: 1px solid #43546a; border-radius: 20px; background: #243348; color: #d2dfec; font-size: .76rem; font-weight: 650; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.enviado { background: #17344a; border-color: #2c526e; color: #9ddfff; }
.status.aprovado { background: #163731; border-color: #28574d; color: #9be6cc; }
.status.fechado { background: #253047; border-color: #464d6d; color: #cfceff; }
.row-actions { display: flex; justify-content: flex-end; gap: 3px; }
.icon-button { min-height: 33px; width: 34px; padding: 6px; background: transparent; border-color: transparent; color: #a9bfd3; }
.icon-button[data-action*="delete"]:hover, .icon-button[data-action*="remove"]:hover { color: var(--red); }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: .83rem; }
.pagination > div { display: flex; align-items: center; gap: 6px; }
.page-button, .page-current { display: inline-grid; place-items: center; width: 33px; height: 33px; min-height: 0; padding: 0; border-radius: 7px; }
.page-current { background: #20435e; border: 1px solid #315f7c; color: #bde9ff; font-weight: 700; }
.empty { color: var(--muted); text-align: center; padding: 36px 12px; }
.empty svg { color: var(--accent); }
.empty p { margin-top: 7px; }
.page-heading, .back-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; }
.page-heading h1 { font-size: clamp(1.8rem, 4vw, 2.55rem); }
.page-heading .eyebrow, .proposal-heading .eyebrow { margin-bottom: 7px; }
.back-actions, .back-actions > div { display: flex; flex-wrap: wrap; gap: 8px; }
.customer { grid-template-columns: minmax(0, 1fr); }
.customer .sidebar { display: none; }
.customer .back-actions { justify-content: flex-end; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 20px; padding: 0; list-style: none; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); padding: 10px 12px; font-size: .88rem; }
.steps li span { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: #223247; }
.steps li.current { color: #c7eeff; border-color: #3a7394; background: #173247; }
.steps li.current span { background: var(--accent); color: #0b1d2a; font-weight: 700; }
.steps li.done span { color: var(--green); }
.editor-layout, .proposal-grid, .analysis-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.editor-rail, .proposal-rail { position: sticky; top: 16px; min-width: 0; }
.editor-rail .summary, .proposal-rail .summary { background: linear-gradient(145deg, #1a324c, #121f31 75%); border-color: #36536e; }
.sketch-preview { padding: 15px; margin-top: 14px; }
.sketch-preview h2 { margin: 0 0 11px 2px; }
.editor-panel, .summary, .proposal-heading, .approval { padding: 20px; }
.editor-panel + .editor-panel { margin-top: 15px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.field { display: grid; align-content: start; gap: 5px; min-width: 0; font-size: .88rem; color: #cfdeed; }
.field em { color: var(--accent); font-style: normal; }
.field input, .field textarea, .field select { width: 100%; }
details { margin-top: 17px; }
summary { cursor: pointer; color: #c9eaff; font-size: .9rem; }
.type-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.type-picker svg { color: var(--accent); }
.item { border: 1px solid var(--border); border-radius: 9px; background: #121f2e; }
.item summary { display: flex; align-items: center; gap: 10px; padding: 10px; list-style: none; color: var(--text); font-weight: 700; }
.item summary::-webkit-details-marker { display: none; }
.item summary::after { content: ""; width: 7px; height: 7px; margin-left: 2px; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: rotate(-45deg); }
.item[open] summary::after { transform: rotate(45deg); }
.item summary small { color: var(--muted); font-size: .76rem; margin-left: auto; font-weight: 400; }
.item-body { padding: 0 13px 13px; border-top: 1px solid var(--border); }
.item-sketch { display: none; margin-top: 16px; max-width: 350px; }
.sketch {
  --line: #75c3ef;
  --glass: #193d55;
  --paper: #0e1a29;
  margin: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--paper);
}
.sketch-stage {
  --drawing-width: min(var(--frame-width), calc(100% - 77px));
  position: relative; height: 157px; color: var(--line);
  background-image: linear-gradient(90deg, #71bafa12 1px, transparent 1px), linear-gradient(#71bafa12 1px, transparent 1px);
  background-size: 15px 15px;
}
.sketch-frame {
  position: absolute; left: 17px; top: 10px; display: flex;
  width: var(--drawing-width); height: var(--frame-height);
  border: 2px solid var(--line); padding: 2px; gap: 2px;
}
.sketch-frame.track { border-top-width: 4px; border-bottom-width: 4px; }
.sketch-leaf {
  display: grid; position: relative; place-items: center; flex: 1 1 0; min-width: 0;
  overflow: hidden; border: 1px solid var(--line); background: var(--glass);
}
.sketch-leaf span { font-size: .8rem; font-weight: 650; line-height: 1; }
.sketch-frame.filled .sketch-leaf { background: repeating-linear-gradient(0deg, var(--glass) 0 7px, #327497 7px 8px); }
.sketch-leaf.fixed { background: var(--paper); }
.sketch-leaf.swings::before, .sketch-leaf.projecting::before {
  position: absolute; inset: 4px; content: ""; background: var(--line); opacity: .74;
  clip-path: polygon(0 0, 100% 49%, 100% 51%, 0 100%, 0 98%, 97% 50%, 0 2%);
}
.sketch-leaf.swings.reverse::before { transform: scaleX(-1); }
.sketch-leaf.projecting::before { clip-path: polygon(0 100%, 49% 0, 51% 0, 100% 100%, 98% 100%, 50% 3%, 2% 100%); }
.sketch-width, .sketch-height { position: absolute; font-size: .73rem; white-space: nowrap; line-height: 1.3; }
.sketch-width {
  left: 17px; top: calc(var(--frame-height) + 17px); width: var(--drawing-width); padding-top: 2px;
  text-align: center; border-top: 1px solid var(--line);
}
.sketch-height {
  left: calc(var(--drawing-width) + 24px); top: 10px; height: var(--frame-height);
  display: flex; align-items: center; padding-left: 4px; border-left: 1px solid var(--line);
}
.sketch figcaption { display: grid; gap: 2px; padding: 8px 11px 10px; border-top: 1px solid var(--border); font-size: .86rem; }
.sketch figcaption span, .sketch figcaption small { color: var(--muted); font-size: .76rem; }
.sketch-prompt { padding: 10px 0; }
.sketch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 243px), 1fr)); gap: 10px; padding: 0 18px; }
.sketch-disclaimer { margin: 8px 18px 13px; color: var(--muted); font-size: .8rem; }
.item-footer, .editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.summary h2 { margin-bottom: 10px; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 7px 0; color: #bfcede; font-size: .9rem; }
.total-line strong { color: var(--text); white-space: nowrap; }
.total-line.grand { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); color: #c1e9ff; font-weight: 650; }
.total-line.grand strong { color: var(--accent); font-size: 1.25rem; }
.proposal-rail .total-line.grand, .editor-rail .total-line.grand { display: grid; gap: 3px; }
.proposal-rail .total-line.grand strong, .editor-rail .total-line.grand strong { font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.042em; }
.proposal-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; padding: 25px; background: linear-gradient(117deg, #1a3149, #121e30 73%); }
.proposal-heading h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.proposal-identity { display: flex; align-items: flex-start; gap: 15px; min-width: 0; }
.proposal-identity .brand-mark { width: 47px; height: 47px; background: #173653; border-color: #3d607a; }
.proposal-identity h1 { overflow-wrap: anywhere; }
.proposal-meta { display: flex; flex-wrap: wrap; gap: 9px 25px; margin-top: 12px; font-size: .9rem; }
.proposal-meta dt { color: var(--muted); font-size: .75rem; }
.proposal-meta dd { font-weight: 620; }
.proposal-section { margin-bottom: 14px; overflow: hidden; }
.proposal-section h2 { padding: 13px 18px; }
.proposal-sketches { border-color: #38536d; background: linear-gradient(145deg, #192d42, #121f30); }
.proposal-sketches .sketch, .sketch-preview .sketch { --line: #23638a; --glass: #d7eaf6; --paper: #eef6fc; }
.proposal-sketches .sketch-stage, .sketch-preview .sketch-stage {
  background-image: linear-gradient(90deg, #6099bb29 1px, transparent 1px), linear-gradient(#6099bb29 1px, transparent 1px);
}
.proposal-sketches figcaption, .sketch-preview figcaption { background: #101f30; }
.proposal-section tfoot { background: #152638; }
.proposal-section :last-child > tr:last-child :is(th, td) { border-bottom: 0; }
.conditions dl { padding: 0 18px 16px; }
.conditions dt { font-weight: 650; margin-top: 6px; }
.conditions dd { color: #bbccdd; overflow-wrap: anywhere; }
.approval { margin-top: 14px; }
.approval p, .approval .button { margin-top: 12px; }
.approval .positive { display: flex; align-items: center; gap: 6px; }
.signature { margin-top: 36px; border-top: 1px solid var(--border); padding-top: 6px; color: var(--muted); text-align: center; font-size: .83rem; }
.analysis-grid { margin-bottom: 15px; }
.profit-charts {
  --aqua: #58d8f5; --violet: #ac93fa; --amber: #ffc17b;
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 15px; margin-bottom: 22px;
}
.chart-card { padding: 17px 19px 20px; background: linear-gradient(150deg, #17273b, #101c2b 67%); }
.chart-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; margin-bottom: 14px; }
.chart-heading p { color: var(--muted); margin-top: 3px; font-size: .82rem; }
.chart-key, .cost-key { list-style: none; margin: 0; padding: 0; }
.chart-key { display: flex; gap: 9px; margin-top: 4px; color: var(--muted); font-size: .79rem; }
.chart-key li { display: flex; align-items: center; gap: 4px; }
.chart-key i, .cost-key i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.chart-key .aqua, .cost-key .aqua { background: var(--aqua); }
.chart-key .violet, .cost-key .violet { background: var(--violet); }
.cost-key .amber { background: var(--amber); }
.chart-row { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr); align-items: center; gap: 10px; padding: 5px 0; }
.chart-row + .chart-row { border-top: 1px solid #233449; }
.chart-project { min-width: 0; overflow-wrap: anywhere; font-size: .86rem; }
.chart-project .table-link { min-width: 0; }
.chart-bar-line { display: grid; grid-template-columns: minmax(12px, 1fr) auto; align-items: center; gap: 7px; }
.chart-track { height: 6px; border-radius: 6px; background: #28394c; }
.chart-track span { height: 100%; display: block; border-radius: inherit; }
.chart-track .aqua { background: linear-gradient(90deg, #2c94ee, var(--aqua)); }
.chart-track .violet { background: linear-gradient(90deg, #7765d6, var(--violet)); }
.bar-value { min-width: 13ch; white-space: nowrap; text-align: right; font-size: .76rem; font-variant-numeric: tabular-nums; color: #d3e0ee; }
.cost-chart { display: flex; gap: 17px; align-items: center; flex-wrap: wrap; }
.cost-ring {
  display: grid; place-items: center; flex: none; width: 142px; aspect-ratio: 1; margin: 0 auto; border-radius: 50%;
  background: conic-gradient(var(--aqua) 0 var(--first), var(--violet) var(--first) var(--second), var(--amber) var(--second) 100%);
  box-shadow: 0 0 26px #58d8f520;
}
.cost-ring.zero { background: #31465d; box-shadow: none; }
.cost-ring > div { display: grid; place-content: center; width: 112px; aspect-ratio: 1; border-radius: 50%; text-align: center; background: #131f30; }
.cost-ring span { color: var(--muted); font-size: .75rem; }
.cost-ring strong { font-size: .9rem; white-space: nowrap; letter-spacing: -.025em; }
.cost-key { flex: 1 0 150px; }
.cost-key li { display: flex; align-items: center; gap: 7px; padding: 4px 0; }
.cost-key li + li { border-top: 1px solid #26384b; }
.cost-key div { flex: 1; }
.cost-key span, .cost-key strong { display: block; font-size: .79rem; }
.cost-key span, .cost-key small { color: var(--muted); }
.cost-key small { font-size: .74rem; white-space: nowrap; }
.labor .table-scroll { margin-top: 10px; }
.labor th:first-child, .labor td:first-child { padding-left: 10px; }
.formula { margin-top: 2px; font-size: .83rem; }
.extra-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: 10px; border-top: 1px solid var(--border); padding: 10px 0; }
.extra-list small, .extra-list p { display: block; color: var(--muted); }
.extra-list p { font-size: .87rem; overflow-wrap: anywhere; }
dialog { width: min(480px, calc(100vw - 28px)); padding: 21px; border: 1px solid #3d586e; background: #152536; color: var(--text); border-radius: var(--radius); }
dialog::backdrop { background: #020912bd; }
dialog p { margin-top: 5px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.login { min-height: 100vh; display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 13px; text-align: center; }
.login p { color: var(--muted); margin-bottom: 6px; }
#notice { position: fixed; z-index: 5; bottom: 16px; right: 16px; max-width: min(430px, calc(100vw - 32px)); padding: 11px 16px; border: 1px solid #387393; border-radius: 9px; background: #18374d; color: #e0f5ff; transform: translateY(150%); opacity: 0; pointer-events: none; transition: .18s ease; }
#notice.visible { opacity: 1; transform: translateY(0); }
#app { transition: opacity .14s ease; }
#app[inert] { opacity: .76; }
#main:focus { outline: none; }
#loading {
  position: fixed; z-index: 10; inset: 13px auto auto 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 9px; pointer-events: none;
  padding: 8px 13px; border: 1px solid #3c6f91; border-radius: 24px;
  background: #142b40f5; box-shadow: 0 6px 22px #04101b68, inset 0 1px #b3eaff15;
  color: #d9f4ff; font-size: .83rem; font-weight: 620; white-space: nowrap;
}
#loading[hidden] { display: none; }
#loading.initial {
  top: 50%; transform: translate(-50%, -50%); padding: 11px 17px;
  box-shadow: 0 9px 28px #040c17a0, 0 0 32px #419ce824;
}
.spinner {
  width: 16px; height: 16px; flex: none; border: 2px solid #78d9ff42; border-top-color: #92e5ff;
  border-radius: 50%; animation: loading-spin .62s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }
@media (max-width: 1140px) {
  .layout { grid-template-columns: 190px minmax(0, 1fr); }
  .customer { grid-template-columns: minmax(0, 1fr); }
  main, .topbar { padding-left: 21px; padding-right: 21px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-layout, .proposal-grid, .analysis-grid { grid-template-columns: minmax(0, 1fr); }
  .editor-rail, .proposal-rail { position: static; }
  #draft-sketch { display: none; }
  .item-sketch { display: block; }
  .list-toolbar .filters { margin-left: 0; }
}
@media (max-width: 720px) {
  .layout { display: flex; flex-direction: column; }
  .sidebar { position: static; display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 7px; height: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0; gap: 5px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand-mark svg { width: 27px; }
  .brand strong { font-size: .9rem; }
  .brand small, .nav-label, .sidebar-bottom p { display: none; }
  .sidebar nav { margin: 0; display: flex; gap: 3px; }
  .nav-item { font-size: .77rem; gap: 4px; padding: 5px 6px; }
  .nav-item svg { width: 15px; height: 15px; }
  .sidebar-bottom { margin: 0 0 0 auto; }
  .sidebar-bottom button { border: 0; }
  main, .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar { height: 55px; }
  main { padding-top: 14px; }
  .hero { min-height: 0; flex-direction: column; align-items: flex-start; gap: 14px; padding: 17px; }
  .hero p { font-size: .92rem; }
  .hero-copy .button { margin-top: 14px; }
  .metrics { gap: 7px; margin: 12px 0 15px; }
  .metric { padding: 9px 7px; gap: 6px; }
  .metric-icon { height: 26px; width: 26px; }
  .metric-icon svg { width: 14px; }
  .metric-text span { font-size: .74rem; }
  .metric-text small { font-size: .68rem; }
  .section-title, .filters, .pagination { padding-left: 10px; padding-right: 10px; }
  .filters { flex-wrap: wrap; }
  .search { flex-basis: 100%; max-width: none; }
  .list-toolbar { padding: 12px; }
  .list-toolbar .filters, .list-toolbar .search { width: 100%; }
  .project-icon { display: none; }
  th, td, th:first-child, td:first-child, th:last-child, td:last-child { padding-left: 9px; padding-right: 9px; }
  .table-link { min-width: 105px; }
  .steps li { flex-direction: column; text-align: center; padding: 5px 3px; font-size: .76rem; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .editor-panel, .summary, .proposal-heading, .approval { padding: 13px; }
  .proposal-identity { gap: 8px; }
  .proposal-identity .brand-mark { width: 31px; height: 31px; }
  .profit-charts { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .chart-card { padding: 12px; }
  .chart-row { grid-template-columns: minmax(78px, 1fr) minmax(0, 2fr); gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .spinner { animation: none; border-right-color: #92e5ff; }
}
@media print {
  :root { color-scheme: light; --text: #101b26; --muted: #3d4e61; --border: #bbb; --accent: #124e70; --green: #235344; background: #fff; }
  body, main, .layout, .workspace, .proposal-grid { display: block; padding: 0; margin: 0; }
  .sidebar, .topbar, .back-actions, .skip, #loading, #notice, .approval button { display: none !important; }
  .proposal .panel, .proposal tr, .proposal tfoot, .proposal thead { background: #fff; color: var(--text); }
  .proposal-rail { position: static; }
  .proposal-rail .summary, .proposal-sketches figcaption { background: #fff; }
  .proposal .brand-mark { background: #f0f6fb; color: #25546d; }
  .proposal .panel { break-inside: avoid; margin-bottom: 8px; }
  .proposal .proposal-sketches { break-inside: auto; }
  .sketch { --line: #164e6e; --glass: #e5f3fb; --paper: #fff; break-inside: avoid; }
  .sketch-stage { background: #fff; }
  .proposal :is(p, dd, th, dt, .eyebrow, .total-line span, .status) { color: #182b3b; }
  .proposal :is(td, th) { border-bottom-color: #ccc; }
  .proposal .status { background: none; }
  .proposal h1 { font-size: 1.7rem; }
  .proposal h2 { font-size: 1.05rem; }
  .proposal-section h2, .proposal td, .proposal th { padding-top: 5px; padding-bottom: 5px; }
  .signature { margin-top: 18px; }
}
