:root {
  --ink: #18302e;
  --muted: #516762;
  --line: #dce6e2;
  --paper: #fff;
  --surface: #f3f6f5;
  --accent: #126759;
  --accent-dark: #0b4e43;
  --rail: #15312d;
  --quote: #175985;
  --win: #875204;
  --target: #744293;
  --danger: #a72f3d;
  --radius: 13px;
  --shadow: 0 2px 6px #13312d08;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #4caa97;
  outline-offset: 2px;
}
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(1.65rem, 2.7vw, 2.3rem); line-height: 1.2; letter-spacing: -.035em; }
h2 { font-size: 1.12rem; line-height: 1.35; }
h3 { font-size: 1rem; }
small { font-size: .84rem; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: -.02em; }
.text-muted { color: var(--muted); font-size: .9rem; }
.numeric { text-align: right; white-space: nowrap; }
.money { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.quote-text { color: var(--quote); font-weight: 670; }
.target-text { color: var(--target); font-weight: 670; }
.win-text { color: var(--win); font-weight: 680; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { z-index: 20; position: fixed; top: 8px; left: 8px; background: white; padding: .7rem; border-radius: 6px; }
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 1.65rem .9rem 1rem; background: var(--rail); color: #e6f1ec; }
.brand, .auth-brand { display: flex; align-items: center; gap: .7rem; }
.brand { padding: 0 .45rem 2rem; }
.brand strong { display: block; color: #f6fcf8; font-size: 1.25rem; font-weight: 750; line-height: 1.3; }
.brand small { color: #c0d3cb; font-size: .8rem; display: block; margin-top: .15rem; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; background: #38a48c; color: #0a2b25; border-radius: 11px; font-weight: 800; font-size: 1.25rem; }
.rail nav { display: grid; gap: .4rem; overflow-y: auto; }
.rail-settings { display: grid; gap: .4rem; border-top: 1px solid #466159; padding-top: .65rem; margin-top: .35rem; }
.rail nav a { display: flex; align-items: center; gap: .7rem; padding: .73rem .8rem; color: #deebe5; font-size: .95rem; border-radius: 9px; }
.rail nav a[aria-current="page"] { background: #2b5148; color: #fff; font-weight: 700; }
.rail nav a:hover { background: #25463e; }
.nav-icon { width: 15px; height: 15px; position: relative; flex-shrink: 0; color: #9fd1c1; border: 1.4px solid currentColor; border-radius: 3px; }
.grid-icon::after { content: ""; position: absolute; inset: 5px 2px 2px 5px; border-top: 1.4px solid; border-left: 1.4px solid; }
.folder-icon { height: 11px; }
.folder-icon::before { content: ""; position: absolute; left: -1px; top: -4px; width: 7px; height: 3px; border: 1.4px solid; border-bottom: 0; border-radius: 2px 2px 0 0; }
.task-icon::after { content: ""; position: absolute; top: 2px; left: 3px; width: 6px; height: 4px; border-left: 1.4px solid; border-bottom: 1.4px solid; transform: rotate(-45deg); }
.settings-icon { border-radius: 50%; }
.settings-icon::after { content: ""; position: absolute; inset: 4px; background: currentColor; border-radius: 50%; }
.file-icon::after { content: ""; position: absolute; inset: 4px 2px; border-block: 1.4px solid; }
.trend-icon::after { content: ""; position: absolute; top: 5px; left: 2px; width: 9px; height: 4px; border-top: 1.4px solid; transform: rotate(-28deg); }
.account-icon { border-radius: 50%; }
.account-icon::before { content: ""; position: absolute; top: 2px; left: 4px; width: 5px; height: 5px; border: 1.4px solid; border-radius: 50%; }
.account-icon::after { content: ""; position: absolute; bottom: 1px; left: 2px; width: 9px; height: 4px; border: 1.4px solid; border-bottom: 0; border-radius: 6px 6px 0 0; }
.account { margin-top: auto; display: flex; align-items: center; gap: .6rem; padding: .85rem .3rem 0; border-top: 1px solid #466159; }
.account div { flex: 1; min-width: 0; }
.account strong, .account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.account small { color: #c0d3cb; font-size: .78rem; }
.account-link:hover strong { text-decoration: underline; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center; background: #36584d; color: #eaf5ee; font-weight: 700; }
.rail-button { color: #c9dbd2; background: transparent; border: 0; padding: .35rem .12rem; font-size: .85rem; }
.rail-button:hover { color: white; text-decoration: underline; }
.workspace { min-width: 0; }
.content { max-width: 1540px; margin: 0 auto; padding: 1.9rem clamp(1rem, 3vw, 2.4rem) 3rem; }
.page-head, .section-head, .card-head { display: flex; align-items: center; justify-content: space-between; gap: .85rem; flex-wrap: wrap; }
.page-head { margin-bottom: 1.35rem; }
.page-head p, .section-head p, .card-head p { margin-top: .3rem; color: var(--muted); font-size: .88rem; }
.section-head { margin: 1.85rem 0 .85rem; scroll-margin-top: 1rem; }
.section-head h2 { font-size: 1.35rem; }
.card { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 1.02rem 1.12rem .9rem; }
.section-gap { margin-bottom: 1.05rem; }
.headline { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; min-width: 0; }
.quote-toolbar { margin-bottom: 1rem; }
.quote-toolbar h1 { font-size: 1.25rem; }
.headline h1 { overflow-wrap: anywhere; }
.breadcrumb { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; color: var(--muted); font-size: .87rem; margin-bottom: .7rem; }
.breadcrumb a { color: var(--accent); font-weight: 650; }
.breadcrumb a:hover, .text-link:hover, .link-button:hover { text-decoration: underline; }
.actions, .row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .52rem; }
.part-actions .row-actions { min-width: 8.4rem; }
.button {
  min-height: 39px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: .49rem .87rem;
  background: var(--paper);
  border: 1px solid #cbdad3;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 680;
  font-size: .89rem;
  line-height: 1.3;
  text-align: center;
}
.button:hover { background: #f1f6f3; border-color: #a6c6b8; }
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button.small { min-height: 34px; padding: .39rem .62rem; }
.button.danger { color: white; background: var(--danger); border-color: var(--danger); }
.button.wide { width: 100%; }
.customer-output { display: inline-flex; align-items: stretch; }
.customer-output a { border-start-end-radius: 0; border-end-end-radius: 0; }
.customer-output button { gap: .2rem; border-start-start-radius: 0; border-end-start-radius: 0; border-inline-start: 0; white-space: nowrap; }
.customer-output button.primary { border-inline-start: 1px solid #ffffff50; }
.text-link, .link-button { color: var(--accent); font-weight: 680; font-size: .88rem; }
.link-button { border: 0; background: transparent; padding: 0; text-align: left; }
.muted-link { color: var(--muted); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .2rem .58rem; line-height: 1.3; font-weight: 680; font-size: .83rem; white-space: nowrap; }
.badge.blue { color: #1c557c; background: #e7f0f7; }
.badge.green { color: #135f4d; background: #e1f2e9; }
.badge.slate { color: #435a54; background: #edf2ef; }
.badge.amber { color: #75500c; background: #fff0d4; }
.badge.red { color: #982b38; background: #fbe8e9; }
.badge.win { color: #704800; background: #f7e6af; }
.feedback { border: 1px solid #c7ded6; background: #e9f4ef; color: #204f45; padding: .75rem .9rem; margin-bottom: 1rem; border-radius: 9px; }
.feedback.error { border-color: #f1c9cc; color: #8b2333; background: #fff0f1; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.1rem; }
.comparison-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; border: 1px solid var(--line); background: #e9f1ed; border-radius: 11px; padding: .3rem; }
.comparison-modes a { display: flex; align-items: center; justify-content: center; gap: .28rem; border-radius: 8px; text-align: center; min-height: 43px; padding: .45rem .5rem; color: var(--muted); font-weight: 680; font-size: .92rem; }
.comparison-modes a:hover { background: #f2f7f4; }
.comparison-modes a[aria-current="page"] { background: var(--paper); color: var(--accent-dark); box-shadow: var(--shadow); }
.comparison-controls { padding: .95rem 1.12rem; }
.comparison-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .65rem; }
.comparison-filters label { flex: 1 1 9rem; }
.comparison-options summary { color: var(--accent-dark); font-size: .85rem; font-weight: 680; cursor: pointer; width: fit-content; }
.comparison-options .comparison-filters { margin-top: .65rem; }
.comparison-metrics .metric { min-height: 106px; }
.comparison-track { position: relative; height: 5px; margin: .55rem .35rem .18rem; min-width: 6.5rem; border-radius: 5px; background: #e6eeeb; }
.comparison-track span { position: absolute; height: 100%; border-radius: inherit; background: #7eb3a2; }
.comparison-track i { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.comparison-table td:first-child { min-width: 9rem; }
.comparison-table td:last-child { min-width: 11rem; }
.metric { display: flex; flex-direction: column; padding: .94rem 1.04rem 1rem; min-height: 125px; justify-content: center; }
.metric > span { font-weight: 660; color: var(--muted); font-size: .9rem; }
.metric > strong { display: block; font-size: clamp(1.35rem, 2.5vw, 1.95rem); font-weight: 750; line-height: 1.14; margin: .34rem 0 .37rem; letter-spacing: -.035em; }
.metric > small, .metric strong small { color: var(--muted); }
.metric.highlighted { border-color: #c2ddd2; background: #eaf5ef; }
.metric.highlighted > span { color: #315c50; }
.workbench-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(250px, 1fr); align-items: start; gap: 1.05rem; }
.two-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.05rem; align-items: start; }
.stack { display: grid; gap: 1rem; min-width: 0; }
.filter { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; padding: 0 1.12rem .95rem; }
.filter input[type="search"] { flex: 1 1 12rem; }
.filter select { max-width: 100%; width: auto; }
.filter > label { font-weight: 680; font-size: .9rem; }
.table-scroll { overflow-x: auto; border-top: 1px solid var(--line); border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .91rem; }
th, td { padding: .73rem .65rem; vertical-align: middle; border-bottom: 1px solid #e6eeeb; }
tr > :first-child { padding-left: 1.12rem; }
tr > :last-child { padding-right: 1.12rem; }
th { color: #465e56; background: #f5f8f6; white-space: nowrap; font-weight: 680; font-size: .86rem; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7faf8; }
tbody tr.selected { background: #edf7f2; }
.row-link { color: #183f36; font-weight: 720; overflow-wrap: anywhere; }
.row-link:hover { color: var(--accent); text-decoration: underline; }
.subline { display: block; margin-top: .12rem; font-size: .83rem; color: var(--muted); }
.empty-state { padding: 1.15rem; color: var(--muted); font-size: .93rem; border-top: 1px solid #e7efeb; }
.activity-list { border-top: 1px solid #e7efeb; }
.activity { padding: .72rem 1.12rem; display: flex; align-items: center; justify-content: space-between; gap: .65rem; border-bottom: 1px solid #e7efeb; }
.activity:last-child { border-bottom: 0; }
a.activity:hover { background: #f3f8f5; }
.activity div { min-width: 0; }
.activity strong { font-size: .92rem; overflow-wrap: anywhere; }
.activity small { display: block; margin-top: .1rem; color: var(--muted); }
.activity p { margin-top: .4rem; font-size: .91rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.market-card { background: #fcfefc; }
.market-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .3rem 1.12rem .7rem; }
.market-pair > div { padding-right: .6rem; }
.market-pair > div + div { border-left: 1px solid var(--line); padding-left: .85rem; }
.market-pair span { display: block; color: var(--muted); font-size: .86rem; font-weight: 650; }
.market-pair strong { display: block; font-size: 1.45rem; font-weight: 760; line-height: 1.35; letter-spacing: -.04em; }
.market-pair small, .market-source { color: var(--muted); font-size: .84rem; }
.market-source { margin: 0 1.12rem .95rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.market-source .badge { margin-right: .35rem; }
.market-trend { margin-bottom: 1rem; }
.market-trend .card-head { flex-wrap: wrap; }
.trend-panel { padding: 0 1.12rem 1.12rem; }
.trend-tools, .trend-caption, .trend-legend, .trend-detail-head, .trend-select {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem .8rem;
}
.trend-tools, .trend-caption, .trend-detail-head { justify-content: space-between; }
.trend-metals { display: flex; gap: .4rem; }
.trend-metals button[aria-pressed="true"] { background: #e3f2eb; color: var(--accent-dark); border-color: #a4cbba; }
.trend-select { font-size: .86rem; font-weight: 650; }
.trend-select select { width: auto; min-height: 34px; padding-block: .29rem; }
.trend-plot { margin: .85rem 0; }
.trend-plot canvas { display: block; width: 100%; height: clamp(190px, 22vw, 280px); cursor: crosshair; }
.trend-plot canvas:focus-visible { outline: 2px solid #4caa97; outline-offset: 2px; border-radius: 7px; }
.trend-caption { color: var(--muted); font-size: .8rem; padding: 0 .15rem; }
.trend-legend > span { display: inline-flex; align-items: center; gap: .32rem; }
.trend-legend i { display: inline-block; width: 1.15rem; border-radius: 2px; }
.trend-mean { height: 3px; background: var(--accent); }
.trend-band { height: .52rem; background: #c8e3d8; border: 1px solid #a4cbbc; }
.trend-gap { border-top: 2px dashed var(--accent); }
.trend-detail { background: #f5f9f7; border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem .8rem; }
.trend-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin: .65rem 0 0; }
.trend-values dt { color: var(--muted); font-size: .82rem; }
.trend-values dd { margin: .1rem 0 0; font-weight: 730; font-size: 1.04rem; }
.trend-values dd[data-direction="up"] { color: #9c303a; }
.trend-values dd[data-direction="down"] { color: #12634e; }
@media (max-width: 540px) {
  .trend-panel { padding-inline: .8rem; }
  .trend-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cost-rollup { margin-bottom: 1.05rem; }
.cost-bar { display: flex; overflow: hidden; height: 9px; margin: .05rem 1.12rem .85rem; background: var(--surface); border-radius: 8px; }
.cost-bar span { min-width: 0; }
.material { background: #217972; }
.process { background: #5f9bc7; }
.freight { background: #c08b42; }
.loss { background: #a86c53; }
.fees { background: #9371b5; }
.packaging { background: #a28a52; }
.vmi { background: #697985; }
.profit { background: #528264; }
.cost-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; padding: 0 1.12rem 1rem; font-size: .87rem; }
.cost-legend div { display: flex; gap: .34rem; align-items: center; flex-wrap: wrap; }
.cost-legend i { width: 9px; height: 9px; border-radius: 2px; }
.cost-legend span { color: var(--muted); }
.inline-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: .4rem 1.12rem .95rem; }
.inline-stats > div > span:first-child { display: block; color: var(--muted); font-size: .88rem; }
.inline-stats strong { display: inline-block; margin-top: .2rem; font-size: 1.45rem; margin-right: .3rem; }
.detail-note { padding: .64rem 1.12rem; background: #f6faf7; color: #34574f; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-note strong { margin-right: .5rem; }
.project-files { margin: 1.05rem 0; }
.client-selector { margin-bottom: 1.05rem; }
.lookup-options { display: grid; max-height: min(45vh, 22rem); overflow-y: auto; margin-top: .6rem; }
.lookup-options button { border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; padding: .55rem .7rem; overflow-wrap: anywhere; }
.lookup-options button:is(:hover, :focus, [aria-current]) { background: #e9f1ed; }
.customer-search { position: relative; width: min(18rem, 100%); }
.customer-results { position: absolute; z-index: 5; inset: calc(100% + .25rem) 0 auto; max-height: 15rem; overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.customer-results a, .customer-results p { display: block; padding: .55rem .75rem; overflow-wrap: anywhere; }
.customer-results a:hover, .customer-results a:focus, .customer-results a[aria-current] { background: #e9f1ed; }
.client-selector .add-customer { margin-inline-start: auto; }
.client-selector .filter { padding: .78rem 1.12rem; }
.template-settings { max-width: 54rem; }
.template-settings .check { display: flex; align-items: center; gap: .45rem; }
.template-settings .check input { flex-shrink: 0; }
input, select, textarea { width: 100%; min-width: 0; min-height: 39px; border: 1px solid #c6d8cf; border-radius: 8px; background-color: white; padding: .47rem .65rem; font-size: .93rem; line-height: 1.42; }
input::placeholder, textarea::placeholder { color: #6b7e77; font-size: .89rem; }
input[readonly] { background: #f3f7f5; color: #46625a; }
input[type="file"] { border-style: dashed; padding: .4rem; }
input[type="file"]::file-selector-button { margin-right: .55rem; padding: .35rem .58rem; background: #e8f2ed; border: 0; border-radius: 6px; color: var(--accent-dark); cursor: pointer; }
input[type="checkbox"] { width: 1rem; min-height: auto; height: 1rem; accent-color: var(--accent); }
textarea { resize: vertical; }
select { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, #527068 50%), linear-gradient(135deg, #527068 50%, transparent 50%); background-position: calc(100% - 16px) calc(50% + 1px), calc(100% - 11px) calc(50% + 1px); background-size: 5px 5px; background-repeat: no-repeat; }
.form-stack { display: grid; gap: .78rem; }
.form-stack label, .fields label { display: grid; gap: .3rem; font-size: .88rem; font-weight: 680; min-width: 0; }
.form-stack label :is(input,select,textarea), .fields label :is(input,select,textarea) { font-weight: 490; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .74rem; }
.fields.four-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.form-card, .summary-card { padding: 0 1.12rem 1.12rem; }
.form-card .card-head, .summary-card .card-head { padding-left: 0; padding-right: 0; }
.form-inset { display: grid; gap: .74rem; padding: 1.05rem 1.12rem; border-top: 1px solid var(--line); }
.form-inset > button { justify-self: start; }
.form-inset .check { display: flex; align-items: center; gap: .5rem; font-size: .88rem; }
.field-note { color: var(--muted); font-size: .87rem; line-height: 1.5; }
.form-card > .field-note { margin-top: .65rem; }
.form-card > .field-note:first-of-type { margin-bottom: .65rem; }
.import-warnings { margin: .45rem 0; padding-left: 1.25rem; line-height: 1.6; }
.import-models { margin-top: .75rem; }
.import-models > label { display: block; margin-top: .38rem; overflow-wrap: anywhere; }
.import-models > label[hidden] { display: none; }
.import-models > .fields { margin-top: .55rem; }
.import-row-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.import-verify { display: block; margin-top: .75rem; }
.aside-action { margin-top: .5rem; }
.template-help { margin-top: .75rem; color: var(--muted); font-size: .88rem; }
.template-help summary { color: var(--accent-dark); font-weight: 660; cursor: pointer; }
.template-help p { margin: .45rem 0; }
.template-sheet { display: grid; gap: .3rem; margin-top: .5rem; }
.template-help dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
.template-help code { overflow-wrap: anywhere; }
.template-price { grid-template-columns: minmax(0, 1fr) minmax(0, 6rem); }
.template-price label:has(+ [hidden]) { grid-column: 1 / -1; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(235px, 305px); gap: 1.05rem; align-items: start; }
.editor-summary { position: sticky; top: 1rem; }
.key-values { display: grid; gap: .54rem; font-size: .91rem; }
.key-values > div { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.key-values dt { color: var(--muted); }
.key-values dd { text-align: right; font-weight: 690; overflow-wrap: anywhere; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .35rem; margin: .8rem 0; border-top: 1px solid var(--line); padding-top: .65rem; }
.summary-total span { font-size: .9rem; color: var(--muted); }
.summary-total strong { font-size: 1.3rem; font-weight: 760; color: var(--accent-dark); overflow-wrap: anywhere; }
.summary-total.second { border-top: 0; padding-top: 0; }
.summary-total.second strong { font-size: 1.08rem; }
.summary-back { display: block; margin-top: .64rem; text-align: center; }
.process-list { display: grid; gap: .75rem; }
.process-item { padding: .7rem; border: 1px solid var(--line); background: #f7faf8; border-radius: 9px; }
.process-head { display: flex; justify-content: flex-end; margin-bottom: .65rem; }
.final-offer-controls { display: flex; align-items: center; gap: .5rem; }
.final-offer-controls input { flex: 1; min-width: 0; }
.final-offer-controls button { flex: none; }
.row-actions { gap: .32rem; }
.process-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.process-foot { display: flex; justify-content: space-between; gap: .55rem; margin-top: .45rem; }
.negotiation-line { display: flex; gap: .85rem; flex-wrap: wrap; font-size: .88rem; margin-top: .65rem; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .82rem 1rem; padding: .25rem 1.12rem 1rem; }
.detail-grid dt { color: var(--muted); font-size: .87rem; margin-bottom: .21rem; }
.detail-grid dd { font-size: .94rem; overflow-wrap: anywhere; }
.approval-stamp { display: grid; gap: .15rem; text-align: center; border: 1px dashed #c77d82; color: #9d303d; background: #fff7f7; border-radius: 8px; padding: .65rem; margin-bottom: .72rem; }
.approval-stamp span { font-size: .82rem; overflow-wrap: anywhere; }
.summary-card .field-note { margin-top: .5rem; }
.export-label { margin: .85rem 0 .35rem; color: var(--muted); font-size: .88rem; font-weight: 680; }
.export-actions .button { flex: 1; }
dialog { background: white; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); max-width: min(96vw, 500px); width: 100%; padding: 1.15rem 1.25rem 1.2rem; box-shadow: 0 15px 70px #112d2840; }
dialog::backdrop { background: #122d26a0; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: .7rem; margin-bottom: .8rem; }
.close { border: 0; background: #eff4f2; line-height: 1; color: var(--muted); border-radius: 7px; font-size: 1.35rem; width: 34px; height: 34px; }
.form-footer { display: flex; justify-content: flex-end; gap: .55rem; margin-top: .45rem; }
.generation-dialog { max-width: min(94vw, 520px); max-height: calc(100% - 1.5rem); scroll-padding-bottom: 4rem; }
.customer-format-dialog { max-width: min(94vw, 460px); }
.generation-part { margin: -.45rem 0 .85rem; }
.generation-dialog .template-help { margin-top: 0; }
.generation-dialog .template-help .template-help { margin-top: .6rem; }
.generation-dialog .feedback { margin: 0; }
.generation-footer { position: sticky; bottom: 0; padding-top: .5rem; background: var(--paper); justify-content: space-between; align-items: center; flex-wrap: wrap; }
.notice { max-width: 34rem; padding: 1.3rem; }
.notice p { margin: .85rem 0 1.05rem; }
.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; background: radial-gradient(ellipse at 70% 0%, #e0eee7 0, #f4f7f5 56%); }
.auth-card { width: min(100%, 430px); background: white; border: 1px solid var(--line); border-radius: 18px; padding: 1.55rem; box-shadow: 0 12px 45px #103a2420; }
.auth-brand { font-size: 1.16rem; font-weight: 750; margin-bottom: 1rem; }
.auth-card h1 { font-size: 1.48rem; margin-bottom: 1rem; }
.auth-card > p { margin: -.4rem 0 1rem; }
.auth-card button { margin-top: .3rem; }
.demo-hint { border-radius: 8px; background: #f1f6f3; padding: .68rem; font-size: .85rem; margin-top: 1.05rem; color: var(--muted); }
.demo-hint code { color: #254e43; }
.demo-hint p { margin: .23rem 0; }
.demo-hint dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: .24rem; }
.demo-hint dl > div { display: flex; gap: .35rem; align-items: baseline; }
@media (max-width: 1100px) {
  .shell { grid-template-columns: 194px minmax(0, 1fr); }
  .workbench-grid { grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr); }
  .metric { min-height: 112px; }
  .fields.four-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 930px) {
  .workbench-grid { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .editor-summary { position: static; }
}
@media (max-width: 680px) {
  .shell { display: block; }
  .comparison-modes a { flex-direction: column; gap: 0; }
  .comparison-mode-separator { display: none; }
  .rail { position: static; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; padding: .6rem .8rem; }
  .brand { padding: 0; }
  .brand-mark { width: 33px; height: 33px; flex-basis: 33px; font-size: 1rem; border-radius: 8px; }
  .brand strong { font-size: 1rem; }
  .brand small { display: none; }
  .rail nav { grid-row: 2; grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .2rem; }
  .rail-settings { display: contents; }
  .rail nav a { padding: .48rem .55rem; white-space: nowrap; font-size: .83rem; }
  .nav-icon { display: none; }
  .account { margin-top: 0; padding: 0; border: 0; gap: .35rem; }
  .avatar { display: none; }
  .account small, .account strong { font-size: .78rem; }
  .content { padding: 1rem .85rem 2.2rem; }
  .two-grid { grid-template-columns: 1fr; }
  .card-head { padding-inline: .85rem; }
  .metric { padding-inline: .72rem; }
  .metric > strong { font-size: 1.4rem; }
  .cost-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  th, td { padding: .58rem .56rem; }
  tr > :first-child { padding-left: .85rem; }
  tr > :last-child { padding-right: .85rem; }
  .project-parts td:first-child { min-width: 8.25rem; }
  .process-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields { gap: .57rem; }
  .inline-stats { gap: .6rem; }
  .inline-stats strong { font-size: 1.12rem; }
}

.workspace-host body { overflow: hidden; }
.workspace-host .shell { height: 100dvh; min-height: 0; }
.workspace-host .workspace { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.workspace-toolbar { display: flex; align-items: stretch; flex-shrink: 0; background: #e9f0ed; border-bottom: 1px solid var(--line); }
.workspace-feedback { flex: none; align-self: center; margin-left: auto; padding: .6rem clamp(.7rem, 2vw, 1.6rem); font-size: .87rem; color: var(--accent-dark); }
.workspace-frame .workspace-toolbar { display: none; }
.workspace-tabs { flex: 1; min-width: 0; position: relative; display: flex; gap: .3rem; padding: .4rem clamp(.7rem, 2vw, 1.6rem) 0; overflow-x: auto; }
.workspace-tab { display: flex; flex: 0 0 auto; align-items: center; max-width: 19rem; border-radius: 8px 8px 0 0; color: var(--muted); }
.workspace-tab:has([aria-selected="true"]) { background: white; color: var(--accent-dark); box-shadow: inset 0 -2px var(--accent); }
.workspace-tab button { border: 0; background: transparent; font-size: .87rem; }
.workspace-tab [role="tab"] { padding: .53rem .65rem; font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.workspace-close { padding: .15rem .45rem; margin-right: .25rem; border-radius: 5px; line-height: 1.4; }
.workspace-close:hover { background: #dcebe5; }
.workspace-panes { flex: 1; min-height: 0; }
.workspace-panes iframe { width: 100%; height: 100%; display: block; border: 0; }
.workspace-frame .shell { display: block; }
.workspace-frame .rail { display: none; }
.task-groups { border-top: 1px solid var(--line); }
.task-group + .task-group, .task-part-group + .task-part-group { border-top: 1px solid var(--line); }
.task-group > summary, .task-part-group > summary { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr) minmax(0, 1.05fr) auto 1rem; align-items: center; gap: .75rem; padding: .85rem 1.12rem; cursor: pointer; list-style: none; }
.task-group > summary::-webkit-details-marker, .task-part-group > summary::-webkit-details-marker { display: none; }
.task-group > summary:hover, .task-group[open] > summary,
.task-part-group > summary:hover, .task-part-group[open] > summary { background: #f1f7f4; }
.task-part-groups { margin-left: 1.12rem; border-left: 1px solid var(--line); }
.task-part-group > summary { padding-block: .65rem; }
.task-part-links { padding: .55rem 1.12rem .7rem; }
.task-group-name { overflow-wrap: anywhere; }
.task-group-count, .task-group-due { color: var(--muted); font-size: .87rem; }
.task-toggle { border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent); transform: rotate(45deg); width: .5rem; height: .5rem; }
.task-group[open] > summary .task-toggle, .task-part-group[open] > summary .task-toggle { transform: rotate(225deg); }

@media (max-width: 680px) {
  .workspace-host .shell { display: flex; flex-direction: column; }
  .workspace-host .workspace { flex: 1; }
  .task-group > summary, .task-part-group > summary { grid-template-columns: minmax(0, 1fr) auto 1rem; }
  .task-group-name { grid-column: 1 / -1; }
  .task-group-due { display: none; }
}
.market-options { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .7rem; }
[data-preview-status]:not(:empty) { margin: 0 0 .75rem; }
.process-foot { flex-wrap: wrap; }
.process-foot > small:last-child { margin-left: auto; }
