/* Layout: sticky bar, compact hero with three machine facts, calculator = preview (left) + params and price (right), then projects, process, request. */
/* Калькулятор на кремовом фоне, токены сайта (site.css). */
:root {
  --bg: var(--cream);
  --surface: #FFFFFF;
  --surface-2: #F7F4EE;
  --fg: var(--fg-dark);
  --muted: var(--muted-dark);
  --line: var(--line-light);
  --accent: #0B6E78;
  --accent-ink: #FFFFFF;
  --accent-soft: #D7ECEE;
  --grid: #E8E3DA;
  --font-display: var(--font);
  --font-body: var(--font);
  --font-mono: var(--mono);
}

/* calculator */
.calc-page section { padding-block: 28px; }
.calc-page h2 { font-size: 24px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.calc { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; }
.calc.rates2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 920px) { .calc, .calc.rates2 { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.preview { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 460px; }
.preview-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.preview-top .name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canvas { position: relative; background:
  linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 20px 20px,
  linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 20px 20px, var(--surface-2); min-height: 320px; }
.canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.canvas .drop { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.canvas.over::after { content: "Отпустите файл"; position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent-soft) 70%, transparent); color: var(--fg); font-weight: 600; }
.dims { position: absolute; left: 12px; bottom: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); background: var(--surface); padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); }
.legend { position: absolute; right: 12px; top: 10px; display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 3px; background: var(--accent); vertical-align: middle; margin-right: 5px; border-radius: 2px; }
.legend i.p { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.legend i.s { background: none; border-top: 2px dashed var(--muted); height: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.stat { padding: 10px 16px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat small { display: block; color: var(--muted); font-size: 12px; }
.stat b { font-family: var(--font-mono); font-weight: 500; font-size: 17px; }
.warnings { padding: 0 16px 12px; display: grid; gap: 6px; }
.warnings:empty { display: none; }
.warn { font-size: 13px; padding: 8px 10px; border-radius: 6px; background: color-mix(in srgb, var(--warn) 12%, var(--surface)); color: var(--fg); border-left: 3px solid var(--warn); }
.warn.bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border-left-color: var(--bad); }

.uploader { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cbtn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; font-size: 14px; }
.cbtn:hover { border-color: var(--accent); }
.cbtn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cbtn.primary:hover { filter: brightness(1.08); }
.cbtn.small { padding: 6px 10px; font-size: 13px; }
.cbtn[disabled] { opacity: .5; cursor: default; }

.params { padding: 16px; display: grid; gap: 14px; align-content: start; }
.calc-page .field { display: grid; gap: 5px; }
.calc-page .field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.calc-page .field select, .calc-page .field input[type=number], .calc-page .field input[type=text], .calc-page .field input[type=tel], .calc-page .field textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 4px; accent-color: var(--accent); }
.check small { display: block; color: var(--muted); font-size: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { padding: 8px; border: 0; background: var(--surface-2); cursor: pointer; font-size: 14px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

.price { border-top: 1px solid var(--line); padding: 16px; display: grid; gap: 10px; }
.lines { display: grid; gap: 6px; font-size: 14px; }
.lines div { display: flex; justify-content: space-between; gap: 12px; }
.lines div span:first-child { color: var(--muted); min-width: 0; }
.lines div span:last-child { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines .disc span:last-child { color: var(--ok); }
.total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--line); padding-top: 10px; }
.total b { font-family: var(--font-display); font-size: 28px; font-weight: 600; }
.total small { color: var(--muted); font-size: 12px; display: block; }
.time { font-size: 13px; color: var(--muted); }
.actions { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }

/* samples */
.samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.sample { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; text-align: left; display: grid; gap: 8px; }
.sample:hover { border-color: var(--accent); }
.sample.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.sample svg { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; max-width: 100%; background: var(--surface-2); border-radius: 6px; padding: 6px; }
.sample b { font-size: 14px; font-weight: 600; line-height: 1.3; }
.sample small { color: var(--muted); font-size: 12px; font-family: var(--font-mono); }

/* my projects */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.proj { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; }
.proj svg { width: 84px; height: 64px; background: var(--surface-2); border-radius: 6px; }
.proj b { display: block; font-size: 14px; }
.proj small { color: var(--muted); font-size: 12px; display: block; }
.proj .pr { font-family: var(--font-mono); font-size: 14px; margin-top: 2px; }
.proj .ops { display: flex; gap: 6px; margin-top: 6px; }
.proj .ops button { padding: 3px 8px; font-size: 12px; }
.empty { color: var(--muted); padding: 18px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
.status { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* process */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; counter-reset: s; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; counter-increment: s; }
.step::before { content: counter(s); font-family: var(--font-mono); color: var(--accent); font-size: 13px; display: block; margin-bottom: 6px; }
.step b { display: block; margin-bottom: 4px; }
.step p { color: var(--muted); font-size: 14px; }

/* materials table */
.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* request */
.request { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 760px) { .request { grid-template-columns: minmax(0, 1fr); } }
.form { padding: 16px; display: grid; gap: 12px; }
.summary { padding: 16px; display: grid; gap: 8px; align-content: start; }
.summary pre { margin: 0; font-family: var(--font-mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); padding: 10px; border-radius: 6px; }
.hidden-svg { position: fixed; left: -20000px; top: 0; width: 1px; height: 1px; overflow: hidden; }
@media (prefers-reduced-motion: no-preference) { .cbtn, .sample { transition: border-color .15s, filter .15s; } }
