/* Curtain calculator on top of design/days.css: tokens only */
.num { font-variant-numeric: tabular-nums; }
.lead { font-size: var(--step-1); max-width: 62ch; }
.h3 { font-size: var(--step-2); }
.r, .table .r { text-align: right; }
.hero { padding-block: var(--space-6) var(--space-3); }
.calc-section { padding-top: 0; }

/* Sticky bar: window tabs + sums */
.calc-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin-bottom: var(--space-4); padding-block: var(--space-2);
  background: var(--bg); border-bottom: var(--border-width) solid var(--border);
}
.tabs { display: flex; gap: var(--space-2); overflow-x: auto; min-width: 0; max-width: 100%; padding-block: var(--space-1); }
.tab {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; flex: none;
  min-height: var(--tap); padding: var(--space-1) var(--space-3);
  border: var(--border-width) solid var(--border); border-radius: var(--radius-2);
  background: var(--surface); color: var(--text); font: inherit; font-size: var(--step--1); cursor: pointer;
}
.tab small { color: var(--muted); }
.tab:hover { border-color: var(--border-strong); }
.tab[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.tab:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 2px; }
.sums { display: flex; gap: var(--space-5); margin-left: auto; }
.sums div { display: flex; flex-direction: column; align-items: flex-end; }
.sums span { color: var(--muted); font-size: var(--step--1); }
.sums b { font-size: var(--step-1); }

.calc-grid { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .calc-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); } }
.calc .alert { margin-bottom: var(--space-4); }

fieldset.card { min-width: 0; margin: 0; }
fieldset.card > legend:not(.visually-hidden) { float: left; width: 100%; padding: 0; margin-bottom: var(--space-1); font-weight: 700; }
fieldset.card > legend + * { clear: both; }
.calc .card { min-width: 0; }

.unit-input { position: relative; }
.unit-input .input { padding-right: 3.5em; width: 100%; }
.unit-input span {
  position: absolute; right: var(--space-3); top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: var(--step--1); pointer-events: none;
}
.own { padding: var(--space-3); border: var(--border-width) dashed var(--border-strong); border-radius: var(--radius-2); }
.own-rr { grid-column: 1 / -1; }

.layer-sum { font-size: var(--step--1); }
.lines td:first-child, #total .table td:first-child { white-space: normal; }
.table td small { display: block; font-size: var(--step--1); }
.steps { display: flex; flex-direction: column; gap: var(--space-2); padding-left: var(--space-5); font-size: var(--step--1); }
.total-sum { font-size: var(--step-3); }
#total { margin-top: var(--space-6); }

/* Sketch and cutting plan */
.sketch-card { padding: var(--space-3); }
.sketch { display: block; width: 100%; height: auto; max-height: 50vh; }
.sketch text, .scheme text { font-size: var(--step--1); fill: var(--muted); }
.sk-floor { stroke: var(--border-strong); stroke-width: 2; }
.sk-win { fill: none; stroke: var(--border-strong); stroke-width: 2; }
.sk-win rect { fill: var(--surface-2); }
.sk-rod { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.sk-rod-end { fill: var(--text); }
.sk-drape { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.sk-tulle { fill: var(--surface); fill-opacity: 0.55; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 2; }
.sk-fold { stroke: var(--border-strong); stroke-width: 1; }
.sk-tape { fill: var(--border-strong); }
.sk-eyelet { fill: var(--bg); stroke: var(--text); stroke-width: 1.5; }
.sk-puddle { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.sk-dim line { stroke: var(--muted); stroke-width: 1; }
.sk-dim text { fill: var(--text); }
.scheme { margin: var(--space-3) 0 0; }
.scheme svg { display: block; width: 100%; height: auto; }
.sk-roll { fill: var(--surface-2); stroke: var(--border-strong); }
.sk-cut { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.sk-hatch { stroke: var(--muted); stroke-width: 1; }
.scheme .sk-num { fill: var(--text); font-weight: 700; }

.how-steps { padding-left: var(--space-5); }
.how-steps h2 { margin-bottom: var(--space-1); }
