:root {
  --ink: #111b2d;
  --muted: #667085;
  --line: #dfe4ea;
  --paper: #ffffff;
  --canvas: #f4f6f8;
  --orange: #e7662f;
  --orange-dark: #bf4720;
  --green: #1f8a66;
  --green-soft: #e9f7f1;
  --navy: #101a2b;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }

.topbar { height: 78px; padding: 0 clamp(20px, 4vw, 64px); background: var(--navy); color: white; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; border: 2px solid rgba(255,255,255,.65); position: relative; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 3px; padding: 8px; transform: skew(-7deg); }
.brand-mark i { display: block; background: var(--orange); }
.brand-mark i:nth-child(1) { height: 55%; }.brand-mark i:nth-child(2) { height: 100%; }.brand-mark i:nth-child(3) { height: 72%; }
.brand strong { font-size: 19px; letter-spacing: .11em; display: block; }
.brand small { color: #abb5c5; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; display: block; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.private-pill { font-size: 12px; color: #dbe3ec; padding: 8px 11px; border: 1px solid #334057; border-radius: 99px; }
.private-pill span { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #49c392; box-shadow: 0 0 0 3px rgba(73,195,146,.13); }

main { max-width: 1480px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 58px) 54px; }
.hero { min-height: 255px; display: flex; align-items: center; justify-content: space-between; gap: 32px; background: linear-gradient(120deg, #fff 55%, #f8fafb); margin: 0 calc(clamp(18px, 4vw, 58px) * -1); padding: 46px clamp(18px, 4vw, 58px); border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .16em; margin: 0 0 10px; }
h1 { font-size: clamp(34px, 5vw, 58px); line-height: .98; margin: 0; letter-spacing: -.045em; }
.lede { color: var(--muted); max-width: 670px; font-size: 16px; line-height: 1.65; margin: 18px 0 0; }
.hero-stat { min-width: 250px; color: white; background: var(--navy); padding: 24px 26px; border-left: 4px solid var(--orange); box-shadow: var(--shadow); }
.hero-stat span, .hero-stat small { display: block; color: #aeb8c7; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.hero-stat strong { display: block; font-size: 30px; margin: 7px 0 3px; }

.workspace { display: grid; grid-template-columns: minmax(390px, 1fr) minmax(460px, 1.15fr) minmax(265px, .7fr); gap: 18px; margin-top: 26px; align-items: start; }
.panel, .settings-card, .drawing-panel { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.input-panel { padding: 22px; }
.panel-heading, .panel-heading > div, .settings-card > div, .section-heading, .drawing-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-heading h2, .settings-card h2 { font-size: 17px; margin: 0; }
.step { background: var(--orange); color: white; font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 5px 7px; margin-right: 8px; }
.step.dark { background: rgba(255,255,255,.12); color: #fff; }
.text-button { color: var(--orange-dark); background: transparent; border: 0; font-size: 12px; font-weight: 700; padding: 7px; }
.row-labels { display: grid; gap: 8px; color: #8a94a5; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 21px 7px 7px; }
.sheet-labels { grid-template-columns: 1fr 1fr 1fr 28px; }.part-labels { grid-template-columns: 1.15fr .55fr 1fr 1fr 28px; }
.form-rows { display: grid; gap: 8px; }
.form-row { display: grid; gap: 8px; align-items: center; }
.sheet-row { grid-template-columns: 1fr 1fr 1fr 28px; }.part-row { grid-template-columns: 1.15fr .55fr 1fr 1fr 28px; }
.field { min-width: 0; height: 42px; border: 1px solid var(--line); background: #fbfcfd; display: flex; align-items: center; }
.field:focus-within { outline: 2px solid rgba(231,102,47,.16); border-color: var(--orange); }
.field input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0 10px; color: var(--ink); }
.field.unit::after { content: "mm"; color: #9aa3af; font-size: 10px; padding-right: 8px; }
.color-key { width: 4px; height: 100%; flex: 0 0 auto; }
.delete-row { border: 0; background: transparent; color: #98a2b3; font-size: 18px; padding: 3px; }
.delete-row:hover { color: #b42318; }

.settings-card { padding: 24px; background: var(--navy); color: white; border-color: var(--navy); }
.settings-card > div:first-child { justify-content: flex-start; }
.settings-card h2 { margin-left: -4px; }
.machine-mode { display: block !important; margin-top: 20px; padding: 13px 14px; border-left: 3px solid var(--orange); background: #17243a; }
.machine-mode span, .machine-mode small { display: block; color: #9eabba; font-size: 9px; letter-spacing: .08em; }
.machine-mode strong { display: block; margin: 3px 0; font-size: 14px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; margin: 25px 0 20px; padding: 15px 0; border-top: 1px solid #2b374b; border-bottom: 1px solid #2b374b; cursor: pointer; }
.switch-row strong, .switch-row small { display: block; }.switch-row small { color: #9aa7ba; font-size: 11px; margin-top: 3px; }
.switch-row input { position: absolute; opacity: 0; }
.switch-row i { width: 42px; height: 23px; background: #4b5668; border-radius: 20px; position: relative; transition: .2s; }
.switch-row i::after { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .2s; }
.switch-row input:checked + i { background: var(--orange); }.switch-row input:checked + i::after { transform: translateX(19px); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.settings-grid label { color: #aab4c2; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.settings-grid label span { margin-top: 7px; height: 38px; border: 1px solid #39465b; display: flex; align-items: center; padding-right: 8px; color: #8f9bad; background: #152136; }
.settings-grid input { width: 100%; border: 0; outline: 0; padding: 0 8px; color: white; background: transparent; }
.button { border: 0; font-weight: 750; padding: 12px 16px; }
.button.primary { width: 100%; min-height: 48px; display: flex; justify-content: space-between; align-items: center; color: white; background: var(--orange); }
.button.primary:hover { background: #d95822; }.button.subtle { width: 100%; color: #bac4d3; background: transparent; margin-top: 6px; font-size: 11px; }
.button.ghost { color: white; border: 1px solid #48556a; background: transparent; }.button.compact { padding: 8px 12px; font-size: 11px; }

.results { margin-top: 58px; scroll-margin-top: 20px; }
.section-heading { margin-bottom: 18px; }.section-heading h2, .drawing-heading h2 { margin: 0; font-size: clamp(23px, 3vw, 33px); letter-spacing: -.03em; }
.validation { color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 750; padding: 9px 12px; border-radius: 4px; }.validation span { margin-right: 5px; }
.validation.error { color: #b42318; background: #fef0ef; }
.comparison-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; margin-bottom: 20px; }
.solution-card { text-align: left; background: white; border: 1px solid var(--line); padding: 0; transition: transform .15s, border-color .15s; position: relative; overflow: hidden; }
.solution-card:hover { transform: translateY(-2px); border-color: #aeb7c3; }.solution-card.selected { border: 2px solid var(--orange); }
.solution-card .recommended { position: absolute; right: 0; top: 0; background: var(--orange); color: white; padding: 6px 9px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.solution-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.solution-head span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }.solution-head strong { display: block; font-size: 20px; margin-top: 3px; }
.solution-metrics { display: grid; grid-template-columns: repeat(3, 1fr); }
.metric { padding: 15px 10px; border-right: 1px solid var(--line); }.metric:last-child { border: 0; }.metric strong,.metric span { display: block; }.metric strong { font-size: 17px; }.metric span { margin-top: 3px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.efficiency { height: 4px; background: #e7ebef; }.efficiency i { display: block; height: 100%; background: var(--green); }
.drawing-panel { padding: clamp(18px, 3vw, 30px); }
.drawing-heading { align-items: flex-start; margin-bottom: 24px; }.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; max-width: 55%; }
.legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }.legend i { width: 9px; height: 9px; }
.legend .cut-legend { width: 22px; height: 0; border-top: 2px dashed var(--orange-dark); background: transparent !important; }
.sheet-drawings { display: grid; gap: 25px; }
.sheet-figure { margin: 0; }.sheet-figure figcaption { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-bottom: 7px; }.sheet-figure figcaption strong { color: var(--ink); }
.sheet-svg-wrap { background: #e9edf1; border: 1px solid #cfd5dc; padding: 10px; overflow: hidden; }
.sheet-svg { display: block; width: 100%; max-height: 510px; }
.piece-shape { stroke: rgba(17,27,45,.58); stroke-width: 2; vector-effect: non-scaling-stroke; }
.piece-label { fill: #111b2d; font-weight: 800; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.piece-dim { fill: #3f4a5a; font-weight: 650; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.cut-line { stroke: var(--orange-dark); stroke-width: 2; stroke-dasharray: 8 6; vector-effect: non-scaling-stroke; }
.cut-marker { fill: var(--orange-dark); stroke: white; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.cut-number { fill: white; font-size: 14px; font-weight: 900; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.dimension-line { stroke: #5f6b7a; stroke-width: 1; vector-effect: non-scaling-stroke; }.dimension-text { fill: #5f6b7a; font-size: 11px; font-weight: 700; }
.operator-sheet { margin-top: 30px; border-top: 2px solid var(--ink); padding-top: 22px; }
.operator-sheet-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }.operator-sheet-head h3 { margin: 0 0 4px; font-size: 21px; }.operator-sheet-head p { margin: 0; color: var(--muted); font-size: 11px; }.operator-stamp { text-align: right; color: var(--muted); font-size: 10px; }
.cut-sheet { margin-top: 22px; break-inside: avoid; }.cut-sheet h4 { margin: 0; padding: 10px 12px; color: white; background: var(--navy); font-size: 13px; }
.cut-table { width: 100%; border-collapse: collapse; font-size: 10px; }.cut-table th { color: var(--muted); background: #f4f6f8; text-align: left; text-transform: uppercase; letter-spacing: .05em; font-size: 8px; }.cut-table th, .cut-table td { border: 1px solid var(--line); padding: 8px; }.cut-table td:first-child { width: 42px; text-align: center; font-weight: 900; color: var(--orange-dark); }.cut-table strong { color: var(--ink); }
.parts-recap { color: var(--muted); font-size: 10px; margin: 8px 0; }
.method-note { display: flex; gap: 14px; color: var(--muted); font-size: 11px; line-height: 1.5; border-top: 1px solid var(--line); margin-top: 25px; padding-top: 16px; }.method-note strong { color: var(--ink); }
.empty-state { color: var(--muted); padding: 50px 20px; text-align: center; background: #f8fafb; border: 1px dashed #cbd2da; }
.error-message { color: #b42318; background: #fef0ef; border: 1px solid #f7ccc8; padding: 13px; font-size: 12px; }
footer { max-width: 1480px; margin: 0 auto; padding: 25px clamp(18px, 4vw, 58px); border-top: 1px solid var(--line); color: var(--muted); display: flex; justify-content: space-between; gap: 20px; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }

@media (max-width: 1100px) { .workspace { grid-template-columns: 1fr 1fr; }.settings-card { grid-column: 1 / -1; }.settings-card { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; align-items: center; }.settings-card .switch-row { margin: 0; }.settings-card .button { align-self: stretch; }.settings-card .subtle { grid-column: 2; } }
@media (max-width: 760px) {
  .topbar { height: 68px; }.brand small, .private-pill { display: none; }
  .hero { display: block; padding-top: 35px; }.hero-stat { margin-top: 28px; min-width: 0; }
  .workspace { grid-template-columns: 1fr; }.settings-card { grid-column: auto; display: block; }.settings-card .switch-row { margin: 22px 0; }
  .section-heading, .drawing-heading { align-items: flex-start; flex-direction: column; }.legend { max-width: none; justify-content: flex-start; }
  .input-panel { padding: 16px; }.sheet-labels, .part-labels { display: none; }
  .form-row { padding: 11px; background: #f8fafb; border: 1px solid var(--line); }.sheet-row { grid-template-columns: 1fr 1fr 24px; }.sheet-row .field:first-child { grid-column: 1 / -1; }.part-row { grid-template-columns: .7fr 1fr 1fr 24px; }.part-row .field:first-child { grid-column: 1 / -1; }
  footer { flex-direction: column; }
}

@media print {
  .topbar-actions, .workspace, .text-button, .button, footer { display: none !important; }
  body, main { background: white; }.topbar { background: white; color: var(--ink); border-bottom: 2px solid var(--ink); }.brand { color: var(--ink); }.brand small { color: var(--muted); }
  .hero { min-height: auto; padding-top: 24px; padding-bottom: 24px; }.hero-stat { background: white; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
  .results { margin-top: 25px; }.solution-card:not(.selected) { display: none; }.drawing-panel, .solution-card { box-shadow: none; break-inside: avoid; }.method-note { font-size: 9px; }.operator-sheet { break-before: page; }.cut-sheet { break-before: page; }.cut-sheet:first-of-type { break-before: avoid; }
}
