:root {
  --bg: #090c10;
  --surface: #111720;
  --surface2: #161e29;
  --border: #1e2d3d;
  --border2: #243346;
  --text: #e4eaf4;
  --muted: #7a8a9e;
  --subtle: #3d4f63;
  --accent: #c9a227;
  --accent-dim: rgba(201, 162, 39, 0.12);
  --accent-glow: rgba(201, 162, 39, 0.25);
  --green: #2dd4a3;
  --green-dim: rgba(45, 212, 163, 0.1);
  --green-glow: rgba(45, 212, 163, 0.22);
  --danger: #e24b4a;
  --radius: 14px;
  --radius-sm: 9px;
  --max: 1100px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Manrope", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top);
  background: rgba(9, 12, 16, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

body.nav-open {
  overflow: hidden;
  touch-action: none;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 66px;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.logo:hover { text-decoration: none; }

.logo-mark {
  width: 36px;
  height: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.logo-mark span {
  border-radius: 3px;
  background: var(--subtle);
  animation: cellPulse 2.8s ease-in-out infinite;
}

.logo-mark span:nth-child(5) {
  background: var(--accent);
  animation: hotPulse 2s ease-in-out infinite;
}

.logo-mark span:nth-child(2) { animation-delay: 0.15s; }
.logo-mark span:nth-child(3) { animation-delay: 0.3s; }
.logo-mark span:nth-child(4) { animation-delay: 0.45s; }
.logo-mark span:nth-child(6) { animation-delay: 0.6s; }
.logo-mark span:nth-child(7) { animation-delay: 0.75s; }
.logo-mark span:nth-child(8) { animation-delay: 0.9s; }
.logo-mark span:nth-child(9) { animation-delay: 1.05s; }

@keyframes cellPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.9; } }
@keyframes hotPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 1; transform: scale(1.15); } }

.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}

.logo-text em { color: var(--accent); font-style: normal; }

.nav-links {
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  gap: 0.25rem;
  align-items: center;
  min-width: 0;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover { color: var(--text); background: var(--surface); text-decoration: none; }

.nav-cta--desktop { flex-shrink: 0; margin-left: auto; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav.is-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav.is-open .nav-toggle span:nth-child(2) { opacity: 0; }

.nav.is-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-link--cta { display: none; }

.calc-sticky-bar {
  margin-top: 1rem;
}

.preset-row {
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

.preset-row::-webkit-scrollbar { height: 4px; }
.preset-row::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.8rem; }

.btn-primary {
  background: var(--accent);
  color: #110e00;
  border-color: rgba(255, 220, 100, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.08);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border2);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.btn-large { width: 100%; margin-top: 1rem; padding: 0.75rem 1.25rem; font-size: 0.95rem; }

/* Hero */
.hero {
  padding: 3rem 0 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 20% -10%, rgba(201, 162, 39, 0.14) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 110%, rgba(45, 212, 163, 0.07) 0%, transparent 55%);
  pointer-events: none;
}

.hero-inner { position: relative; }

.logo-hero {
  margin: 0 0 0.85rem;
}

.logo-hero .logo-text {
  font-size: clamp(1.55rem, 3.5vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.045em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.65rem;
}

.hero-actions .btn {
  min-height: 44px;
  padding: 0.7rem 1.25rem;
  font-size: 0.92rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.eyebrow::before {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
}

h1 .highlight { color: var(--accent); }

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 38rem;
  margin-bottom: 1.5rem;
  line-height: 1.65;
}

.hero-stats {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.hero-stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--green);
  line-height: 1;
}

.hero-stat-lbl {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.2rem;
  line-height: 1.3;
}

/* Calculator window */
.calc-section { padding: 0 0 3rem; }

.calc-window {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.calc-topbar {
  background: #0d1219;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.calc-dots { display: flex; gap: 5px; }

.calc-dot { width: 10px; height: 10px; border-radius: 50%; }

.calc-topbar-title { font-size: 0.75rem; color: var(--muted); margin-left: 0.4rem; }

.calc-body { padding: 1.25rem; }

.calc-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtle);
  margin-bottom: 0.9rem;
}

.calc-divider {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.25rem;
}

.panel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  position: relative;
  z-index: 1;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.panel-head .calc-heading { margin-bottom: 0; }

.panel-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.preset {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.preset:hover,
.preset.active {
  border-color: rgba(201, 162, 39, 0.4);
  background: var(--accent-dim);
  color: var(--accent);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.field-label--full {
  grid-column: 1 / -1;
}

.field-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
  margin: 0 0 0.55rem;
}

.calc-heading--sub {
  margin-top: 1.1rem;
  margin-bottom: 0.7rem;
}

.combo-wrap {
  position: relative;
}

.combo-wrap.is-open {
  z-index: 50;
}

.panel:has(.combo-wrap.is-open) {
  z-index: 15;
}

.combo-list {
  position: absolute;
  z-index: 200;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: min(50vh, 280px);
  overflow: auto;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.combo-list[hidden] { display: none !important; }

.combo-item {
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.combo-item:hover,
.combo-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.field-hint {
  font-size: 0.72rem;
  color: var(--subtle);
  line-height: 1.35;
  margin-top: 0.35rem;
}

.combo-item small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.combo-empty {
  padding: 0.65rem 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: default;
}

.parts-hint {
  font-size: 0.78rem;
  margin: 0.35rem 0 0.65rem;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.form-input {
  background: rgba(14, 20, 28, 0.8);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.2s;
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-input::placeholder { color: var(--subtle); }

.checks {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
}

.check input { accent-color: var(--accent); width: auto; }

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 2.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.parts-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 560px;
}

.parts-table th,
.parts-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  overflow: visible;
}

.parts-table tbody tr:last-child td {
  border-bottom: none;
}

.parts-table th.col-qty { width: 128px; }
.parts-table th.col-actions { width: 84px; }
.parts-table td.col-qty {
  width: 128px;
  position: relative;
  z-index: 1;
}

.parts-table td.row-actions {
  width: 84px;
  padding-right: 0.65rem;
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
  position: relative;
  z-index: 2;
  overflow: visible;
}

.parts-table th {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
  background: #0d1219;
}

.parts-table input {
  background: rgba(14, 20, 28, 0.9);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 0.88rem;
  color: var(--text);
  width: 100%;
  min-height: 36px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.parts-table input::placeholder {
  color: var(--subtle);
}

.parts-table input:hover {
  border-color: #2f4258;
}

.parts-table input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.parts-table .part-width,
.parts-table .part-height {
  min-width: 80px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.parts-table .part-label {
  min-width: 120px;
}

.parts-table .part-dim {
  -moz-appearance: textfield;
}

.parts-table .part-dim::-webkit-outer-spin-button,
.parts-table .part-dim::-webkit-inner-spin-button,
.parts-table .part-qty::-webkit-outer-spin-button,
.parts-table .part-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-stepper {
  display: inline-flex;
  align-items: stretch;
  width: 100%;
  max-width: 118px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(14, 20, 28, 0.9);
}

.qty-btn {
  width: 32px;
  flex-shrink: 0;
  border: none;
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.qty-btn:first-child {
  border-right: 1px solid var(--border2);
}

.qty-btn:last-child {
  border-left: 1px solid var(--border2);
}

.qty-btn:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.qty-stepper .part-qty {
  flex: 1;
  min-width: 2rem;
  min-height: 36px;
  border: none !important;
  border-radius: 0;
  box-shadow: none !important;
  text-align: center;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
  background: transparent;
  -moz-appearance: textfield;
}

.th-actions,
.row-actions {
  white-space: nowrap;
}

.row-actions .btn-add-row,
.row-actions .btn-icon.remove-row {
  vertical-align: middle;
}

.row-actions .btn-add-row {
  margin-right: 0.35rem;
}

.btn-add-row,
.btn-icon.remove-row {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.btn-add-row {
  border: 1px solid rgba(45, 212, 163, 0.35);
  border-radius: 8px;
  background: var(--green-dim);
  color: var(--green);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
}

.btn-add-row:hover {
  border-color: var(--green);
  filter: brightness(1.08);
}

.tip-btn {
  position: relative;
  isolation: isolate;
}

.tip-btn::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: max-content;
  max-width: 210px;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: #0d1219;
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 300;
}

.tip-btn::before {
  content: "";
  position: absolute;
  top: calc(100% + 4px);
  right: 10px;
  border: 6px solid transparent;
  border-bottom-color: var(--border2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 301;
}

.tip-btn:hover::after,
.tip-btn:focus-visible::after,
.tip-btn:hover::before,
.tip-btn:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.parts-table tr:has(.tip-btn:hover) td.row-actions,
.parts-table tr:has(.tip-btn:focus-visible) td.row-actions {
  z-index: 20;
  position: relative;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(226, 75, 74, 0.3);
  border-radius: 8px;
  background: rgba(226, 75, 74, 0.1);
  color: var(--danger);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.error {
  color: var(--danger);
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.error.is-info {
  color: var(--muted, #6b7c90);
  font-weight: 500;
}

/* Results */
.result-panel {
  margin-top: 0.5rem;
  scroll-margin-top: 5.5rem;
  padding-bottom: env(safe-area-inset-bottom);
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.result-head .calc-heading { margin-bottom: 0; }

.result-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.calc-btn-pdf-style {
  border-color: rgba(45, 212, 163, 0.3) !important;
  color: var(--green) !important;
  background: var(--green-dim) !important;
}

#dxfBtn.is-locked,
#saveProjectBtn.is-locked {
  opacity: 0.85;
  border-style: dashed;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1rem;
}

.stat-item {
  flex: 1 1 120px;
  padding: 0.85rem 1rem;
  border-right: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-dim), transparent 70%);
}

.stat-item:last-child { border-right: none; }

.stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.stat-item strong {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--green);
}

.sheet-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.sheet-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.layout-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: #0d1219;
}

.offcuts-block { margin-top: 1rem; }

.offcuts { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 20px;
  background: var(--green-dim);
  border: 1px solid rgba(45, 212, 163, 0.25);
  color: var(--green);
}

.chip-reserved {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.cuts-block {
  margin-top: 1rem;
}

.cuts-list {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.cuts-list li {
  word-break: break-word;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.cuts-list li.muted {
  list-style: none;
  margin-left: -1.2rem;
}

.muted { color: var(--muted); }

.save-hint {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  text-align: center;
}

.save-hint[hidden] { display: none; }

/* Sections */
.section { padding: 4rem 0; }

.section.alt {
  background: #0c1118;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-tag::before {
  content: "";
  display: block;
  width: 16px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}

.section-lead {
  color: var(--muted);
  max-width: 38rem;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.section--how {
  position: relative;
  overflow: hidden;
}

.section--how::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 8% 20%, rgba(201, 162, 39, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 92% 80%, rgba(45, 212, 163, 0.05) 0%, transparent 55%);
}

.how-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.how-step {
  padding: 0;
  border-right: 1px solid var(--border);
  background: var(--surface2);
  position: relative;
  display: flex;
  flex-direction: column;
  animation: howRise 0.7s ease both;
}

.how-step:nth-child(1) { animation-delay: 0.05s; }
.how-step:nth-child(2) { animation-delay: 0.18s; }
.how-step:nth-child(3) { animation-delay: 0.3s; }

.how-step:last-child { border-right: none; }

.how-visual {
  position: relative;
  aspect-ratio: 1.15 / 1;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(9, 12, 16, 0.15), rgba(9, 12, 16, 0.72)),
    var(--bg);
}

.how-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.02);
  transition: transform 0.55s ease;
}

.how-step:hover .how-visual img {
  transform: scale(1.07);
}

.how-visual::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(17, 23, 32, 0.92));
  pointer-events: none;
}

.how-body {
  padding: 0 1.35rem 1.45rem;
  margin-top: -0.35rem;
  position: relative;
  z-index: 1;
}

.how-arrow {
  position: absolute;
  right: -13px;
  top: 42%;
  transform: translateY(-50%);
  z-index: 3;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid rgba(201, 162, 39, 0.45);
  box-shadow: 0 0 0 4px rgba(9, 12, 16, 0.55), 0 0 18px rgba(201, 162, 39, 0.18);
  animation: arrowPulse 2.4s ease-in-out infinite;
}

.how-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--accent);
  border-top: 2px solid var(--accent);
  transform: translate(-60%, -50%) rotate(45deg);
}

.how-num {
  position: absolute;
  left: 1rem;
  bottom: 0.85rem;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(9, 12, 16, 0.82);
  border: 1px solid rgba(201, 162, 39, 0.55);
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent);
  margin: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.how-step h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  letter-spacing: -0.02em;
}

.how-step p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
}

.section--features .section-lead {
  margin-bottom: 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.feature-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: howRise 0.75s ease both;
}

.feature-card:nth-child(1) { animation-delay: 0.08s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.32s; }

.feature-card:hover {
  border-color: rgba(201, 162, 39, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(201, 162, 39, 0.08);
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 75%);
  opacity: 0;
  transition: opacity 0.25s;
  z-index: 2;
}

.feature-card:hover::before { opacity: 1; }

.feature-media {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: var(--bg);
}

.feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.55s ease;
}

.feature-card:hover .feature-media img {
  transform: scale(1.06);
}

.feature-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 45%, rgba(17, 23, 32, 0.88) 100%),
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(201, 162, 39, 0.12), transparent 60%);
  pointer-events: none;
}

.feature-body {
  padding: 0.15rem 1.25rem 1.35rem;
  position: relative;
  z-index: 1;
  margin-top: -0.5rem;
}

.feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.85rem;
  color: var(--accent);
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}

.adv-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-top: 1.35rem;
}

.adv-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.adv-item strong {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.adv-item span {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.section--apps .section-lead {
  margin-bottom: 1.75rem;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.app-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem 1.4rem 1.45rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: 0.85;
}

.app-card--apk::before {
  background: linear-gradient(90deg, var(--green), transparent 70%);
}

.app-card-tag {
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.65rem;
}

.app-card--apk .app-card-tag {
  color: var(--green);
}

.app-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.55rem;
}

.app-card > p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0.9rem;
}

.app-card-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.app-card-points li {
  position: relative;
  padding-left: 1.05rem;
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.45;
}

.app-card-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.app-card--apk .app-card-points li::before {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
}

.app-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.app-card-actions .btn {
  min-height: 42px;
}

.app-card-note {
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0;
}

@keyframes howRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes arrowPulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(9, 12, 16, 0.55), 0 0 14px rgba(201, 162, 39, 0.14);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(9, 12, 16, 0.45), 0 0 22px rgba(201, 162, 39, 0.32);
  }
}

.faq-list { display: flex; flex-direction: column; gap: 0.65rem; }

.faq-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
}

.faq-item p {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3rem;
  background: var(--surface);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}

.logo--footer .logo-text { font-size: 1rem; }

.footer-copy,
.footer-links {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 6, 9, 0.75);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.modal[hidden] { display: none !important; }

.modal-card {
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 1.75rem;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-card h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.form-submit {
  margin-top: 0.35rem;
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.form-status { min-height: 1.2em; font-size: 0.85rem; }
.form-note { font-size: 0.78rem; color: var(--subtle); }
.hp { display: none !important; }
.kr-smartcaptcha {
  margin: 0.75rem 0 0.25rem;
  min-height: 100px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.form-status.is-error { color: var(--danger); }

/* Cabinet */
.cabinet-page { padding-top: 2rem; padding-bottom: 3rem; }

/* ─── KalkPlace app shell (кабинет / инструмент) ─── */
.kp-app-header {
  position: sticky;
  top: 0;
  z-index: 200;
  padding-top: env(safe-area-inset-top);
  background: rgba(9, 12, 16, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.kp-app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 58px;
}

.kp-app-header-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.kp-app-header-link:hover {
  color: var(--accent);
  text-decoration: none;
}

body.cabinet-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.cabinet-app .cabinet-page--app {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: 0;
}

body.cabinet-app .wrap--dash {
  max-width: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  padding: 0;
}

body.cabinet-app .cabinet-root {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cabinet-page--auth {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.dash-layout--app {
  flex: 1;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100dvh - 58px);
  align-items: stretch;
}

.dash-sidebar {
  position: sticky;
  top: 58px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 0.85rem;
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  min-height: calc(100dvh - 58px);
  height: calc(100dvh - 58px);
}

.dash-sidebar-user {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 0.35rem 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.dash-sidebar-head { display: flex; flex-direction: column; gap: 0.35rem; }

.cabinet-auth-wrap {
  display: flex;
  justify-content: center;
}

.cabinet-auth-card {
  width: min(440px, 100%);
}

@media (max-width: 768px) {
  .cabinet-auth-card .btn,
  .auth-page .btn[type='submit'],
  body.auth-page .cabinet-auth-card .btn {
    min-height: 48px;
  }

  .cabinet-auth-card a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.35rem 0.15rem;
  }
}

.cabinet-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
}

.cabinet-card--accent {
  border-color: rgba(201, 162, 39, 0.28);
  background: linear-gradient(160deg, rgba(201, 162, 39, 0.08), var(--surface2) 55%);
}

.cabinet-card--wide { grid-column: 1 / -1; }

.cabinet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.cabinet-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0.25rem 0 0.5rem;
}

.cabinet-lead { margin-bottom: 1rem; }

.cabinet-meta {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.35rem 0;
}

.cabinet-logout { margin-top: 1rem; }

.wrap--dash { max-width: none; }

.dash-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.dash-eyebrow {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
}

.dash-user-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.dash-plan-badge { margin: 0.15rem 0 0; align-self: flex-start; }

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 auto;
}

.dash-nav-link {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dash-nav-link:hover,
.dash-nav-link.is-active {
  background: var(--accent-dim);
  color: var(--text);
}

.dash-nav-link.is-active {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.28);
}

.dash-nav-link--external { color: var(--accent); }

.dash-sidebar-foot {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.dash-user-email {
  font-size: 0.78rem;
  margin: 0 0 0.5rem;
  word-break: break-all;
}

.dash-logout { width: 100%; }

.dash-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.dash-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
}

.dash-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dash-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.dash-panels {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.dash-panel {
  display: none !important;
  padding: 1.25rem 1.5rem 2rem;
  border: none;
  border-radius: 0;
  background: var(--bg);
  flex: 1;
}

.dash-layout[data-panel="calc"] .dash-panel[data-panel="calc"],
.dash-layout[data-panel="warehouse"] .dash-panel[data-panel="warehouse"],
.dash-layout[data-panel="projects"] .dash-panel[data-panel="projects"],
.dash-layout[data-panel="leads"] .dash-panel[data-panel="leads"],
.dash-layout[data-panel="account"] .dash-panel[data-panel="account"] {
  display: block !important;
  position: absolute;
  inset: 0;
  overflow: auto;
}

.dash-layout[data-panel="calc"] .dash-panel[data-panel="calc"] {
  display: flex !important;
  overflow: hidden;
}

.dash-main--app {
  min-height: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.dash-main--app .dash-panels {
  flex: 1;
  min-height: 0;
  padding: 0;
}

.dash-topbar--app {
  padding: 1rem 1.25rem 0.85rem;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
}

.dash-topbar-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.dash-section-tag {
  margin-bottom: 0.35rem;
}

.dash-layout[data-panel="calc"] .dash-topbar--app {
  display: none;
}

.dash-layout[data-panel="calc"] .dash-main--app {
  gap: 0;
}

.dash-panel--calc {
  padding: 0;
  border: none;
  background: var(--bg);
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.dash-calc-frame {
  width: 100%;
  flex: 1;
  min-height: calc(100dvh - 58px);
  border: none;
  border-radius: 0;
  background: var(--bg);
  display: block;
}

.dash-panel .dash-section-title,
.dash-panel .dash-block-head .dash-section-title {
  margin-bottom: 0.75rem;
}

body.app-tool {
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

body.app-tool main {
  flex: 1;
  min-height: 0;
}

body.app-tool .calc-window {
  border-radius: var(--radius);
  border-color: var(--border);
  box-shadow: none;
}

body.app-tool .calc-topbar {
  background: var(--surface);
}

body.app-tool .calc-dots {
  display: none;
}

body.app-tool .calc-topbar-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.auth-page .cabinet-page--auth {
  flex: 1;
  display: flex;
  align-items: center;
}

body.auth-page .cabinet-auth-card {
  border-color: var(--border);
  background: var(--surface2);
}

.kp-panel-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 920px;
}

.kp-panel-card {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
}

.kp-panel-card--toolbar {
  padding: 0.85rem 1.35rem;
}

.kp-panel-card--muted {
  background: rgba(255, 255, 255, 0.02);
}

.kp-panel-card--flush {
  padding: 0;
  overflow: hidden;
}

.kp-panel-card--flush .project-item,
.kp-panel-card--flush .lead-item {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.kp-panel-card--flush .project-item:last-child,
.kp-panel-card--flush .lead-item:last-child {
  border-bottom: none;
}

.kp-panel-card--flush .warehouse-table th:first-child,
.kp-panel-card--flush .warehouse-table td:first-child {
  padding-left: 1.25rem;
}

.kp-panel-card--flush .warehouse-table th:last-child,
.kp-panel-card--flush .warehouse-table td:last-child {
  padding-right: 1.25rem;
}

.dash-plan-badge.plan-badge {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
}

body.app-embed {
  overflow: hidden;
  height: 100dvh;
  background: var(--bg);
}

.app-embed .app-tool-header,
.app-embed .calc-topbar {
  display: none !important;
}

.app-embed .calc-section,
.app-embed .calc-section--app {
  padding: 0;
}

.app-embed .wrap {
  max-width: none;
  padding: 0 1rem;
}

.app-embed .calc-window {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.app-embed .calc-body {
  padding: 0.75rem 0 1.5rem;
}

.app-embed .calc-grid {
  gap: 1rem;
}

.app-embed .panel {
  border-color: var(--border);
  background: var(--surface2);
}

.app-embed .panel--material {
  background: transparent;
  border: none;
}

.app-embed .result-panel {
  margin-top: 0.5rem;
}

.app-embed .calc-divider {
  margin: 1rem 0;
}

.calc-section--app {
  padding: 1rem 0 2rem;
}

.account-panel {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 520px;
  padding: 0;
  border: none;
  background: transparent;
}

.account-panel.kp-panel-card {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.account-panel-name { margin: 0; }
.account-panel-email { margin: 0 0 0.35rem; }
.account-panel-hint { margin: 0.5rem 0 0; font-size: 0.85rem; }

.leads-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 720px;
  padding: 0;
  border: none;
  background: transparent;
}

.dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.dash-stat {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.dash-stat-label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dash-stat-value {
  margin: 0.35rem 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dash-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.dash-actions { margin-bottom: 1.25rem; }

.dash-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.dash-action-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: inherit;
  text-decoration: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.dash-action-card:hover {
  border-color: rgba(201, 162, 39, 0.35);
  transform: translateY(-1px);
}

.dash-action-icon {
  font-size: 1.1rem;
  color: var(--accent);
  line-height: 1;
}

.dash-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.dash-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dash-stock-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dash-stock-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 0.88rem;
}

.dash-billing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.dash-billing-current { min-height: 100%; }
.dash-billing-upgrade { min-height: 100%; }

.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border2);
  font-weight: 800;
  font-size: 0.9rem;
  margin: 0.35rem 0 0.75rem;
}

.plan-badge.is-standard {
  border-color: rgba(201, 162, 39, 0.35);
  background: var(--accent-dim);
  color: var(--accent);
}

.plan-badge.is-pro {
  border-color: rgba(45, 212, 163, 0.35);
  background: var(--green-dim);
  color: var(--green);
}

.pricing-lead {
  max-width: 42rem;
  margin-bottom: 1.5rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.pricing-grid--landing {
  margin-top: 0.5rem;
}

.pricing-note {
  margin-top: 1.25rem;
  text-align: center;
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  min-height: 100%;
}

.plan-card--standard {
  border-color: rgba(201, 162, 39, 0.28);
  background: linear-gradient(160deg, rgba(201, 162, 39, 0.06), var(--surface2) 60%);
}

.plan-card--pro {
  border-color: rgba(45, 212, 163, 0.28);
  background: linear-gradient(160deg, rgba(45, 212, 163, 0.06), var(--surface2) 60%);
}

.plan-card.is-current {
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.25);
}

.plan-card-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
}

.plan-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.plan-card-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.03em;
}

.plan-card-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
  min-height: 2.6rem;
}

.plan-card-list {
  list-style: none;
  margin: 0.35rem 0 0.75rem;
  padding: 0;
  flex: 1 1 auto;
}

.plan-card-list li {
  position: relative;
  padding: 0.3rem 0 0.3rem 1.1rem;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
}

.plan-card-list li.is-on::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 800;
  font-size: 0.75rem;
}

.plan-card-list li.is-off {
  color: var(--subtle);
  opacity: 0.72;
}

.plan-card-list li.is-off::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--subtle);
  font-weight: 400;
  font-size: 0.85rem;
}

.plan-card-list li.is-highlight {
  color: var(--text);
  opacity: 1;
}

.plan-card-list--full li {
  padding: 0.22rem 0 0.22rem 1.15rem;
  font-size: 0.8rem;
}

.plan-card-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: auto;
}

.plan-card .btn {
  margin-top: auto;
  width: 100%;
}

.cabinet-pay { width: 100%; margin-top: 0.75rem; }

.feature-locks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.feature-lock {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.feature-lock.is-on {
  color: var(--text);
  border-color: rgba(45, 212, 163, 0.25);
  background: rgba(45, 212, 163, 0.06);
}

.feature-lock-icon {
  width: 22px;
  text-align: center;
  font-weight: 800;
  color: var(--green);
}

.feature-lock-tag {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.empty-state {
  padding: 1rem 0 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: flex-start;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.project-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.project-item-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.nav-link--cabinet { color: var(--accent); }

.nav-link--login { color: var(--muted); }

.nav.is-auth .nav-link--login { display: none; }

.cabinet-header-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}

.cabinet-header-link.is-active {
  border-color: rgba(201, 162, 39, 0.35);
  color: var(--accent);
}

.nav-cta + .nav-cta { margin-left: 0.45rem; }

/* Responsive */
@media (max-width: 860px) {
  .wrap { padding: 0 1rem; }

  .nav {
    position: relative;
    min-height: 60px;
  }

  .nav-toggle { display: inline-flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: calc(60px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.85rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    background: #0d1219;
    border: none;
    border-top: 1px solid var(--border2);
    border-radius: 0;
    box-shadow: none;
    z-index: 140;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav.is-open .nav-links {
    display: flex;
    height: calc(100dvh - 60px - env(safe-area-inset-top, 0px));
    min-height: calc(100vh - 60px - env(safe-area-inset-top, 0px));
  }

  body.nav-open::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 130;
    background: rgba(5, 8, 12, 0.72);
    pointer-events: none;
  }

  body.nav-open header {
    z-index: 150;
    background: #0d1219;
    /* backdrop-filter creates a containing block and clips fixed menus to the header */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav-link {
    padding: 0.9rem 0.95rem;
    font-size: 1rem;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .nav-link--cta {
    display: block;
    margin-top: 0.25rem;
    border: 1px solid var(--border2);
    text-align: center;
  }

  .nav-cta--desktop { display: none; }

  .calc-grid { grid-template-columns: 1fr; }
  .how-steps { grid-template-columns: 1fr; }
  .how-step {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .how-step:last-child { border-bottom: none; }
  .how-arrow { display: none; }
  .how-visual { aspect-ratio: 16 / 10; }
  .features-grid { grid-template-columns: 1fr; }
  .feature-media { aspect-ratio: 16 / 10; }
  .adv-list { grid-template-columns: 1fr; }
  .apps-grid { grid-template-columns: 1fr; }

  .hero { padding: 2rem 0 1rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .calc-section { padding: 0 0 2rem; }
  .section { padding: 3rem 0; }

  .calc-body { padding: 1rem; }
  .calc-topbar-title {
    font-size: 0.68rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 auto;
  }

  .calc-window {
    overflow: visible;
    border-radius: 14px;
  }

  .calc-topbar {
    border-radius: 14px 14px 0 0;
    overflow: hidden;
  }

  .field-grid { grid-template-columns: 1fr; }

  .form-input,
  .combo-input {
    font-size: 16px;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }

  .panel-actions .btn { width: 100%; }

  .result-head {
    flex-direction: column;
    align-items: stretch;
  }

  .result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .result-actions .btn { width: 100%; }

  .stats-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    border: none;
    overflow: visible;
    background: transparent;
  }

  .stat-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.75rem;
  }

  .stat-item:nth-child(odd) {
    border-right: 1px solid var(--border);
  }

  .stat-item:nth-last-child(1):nth-child(odd) {
    grid-column: 1 / -1;
    border-right: 1px solid var(--border);
  }

  .stat-item strong {
    font-size: 1.05rem;
  }

  .cuts-block .calc-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    line-height: 1.35;
  }

  .cuts-block .calc-heading .muted {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
  }
}

@media (max-width: 640px) {
  .field-grid { grid-template-columns: 1fr; }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .hero-stat-num { font-size: 1.2rem; }
  .hero-stat-lbl { font-size: 0.68rem; }

  .lead { font-size: 0.95rem; }

  .parts-hint,
  .field-hint {
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .preset-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
    margin-right: -0.25rem;
  }

  .preset { flex-shrink: 0; }

  .table-wrap {
    overflow: visible;
    border: none;
    background: transparent;
    padding-bottom: 0;
    margin-bottom: 3rem;
  }

  .parts-table {
    min-width: 0;
    width: 100%;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0 0.65rem;
  }

  .parts-table thead { display: none; }

  .parts-table tbody { display: block; }

  .parts-table tr {
    display: block;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem 0.75rem;
    margin-bottom: 0.65rem;
  }

  .parts-table td,
  .parts-table td.col-qty,
  .parts-table td.row-actions,
  .parts-table td.pro-col {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.45rem 0.65rem;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: none;
    width: 100%;
    max-width: none;
  }

  /* Stretch fields, but keep action buttons at fixed touch size */
  .parts-table td > *:not(button) {
    min-width: 0;
    width: 100%;
  }

  .parts-table td::before {
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--subtle);
    line-height: 1.3;
  }

  .parts-table td[data-label=""]::before,
  .parts-table td.row-actions::before { display: none; }

  .parts-table td.row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
    margin-top: 0.15rem;
    border-top: 1px solid var(--border);
    grid-template-columns: none;
  }

  .parts-table td.row-actions > button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .parts-table .part-label,
  .parts-table .part-width,
  .parts-table .part-height,
  .parts-table .part-edge {
    min-width: 0;
  }

  .qty-stepper {
    min-width: 0;
    width: 100%;
    max-width: none;
  }

  .qty-btn {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
  }

  .qty-stepper .part-qty {
    min-height: 44px;
    font-size: 1rem;
    flex: 1 1 auto;
    width: auto;
    min-width: 2.5rem;
  }

  .btn-add-row,
  .btn-icon {
    width: 44px;
    height: 44px;
  }

  .form-input,
  .parts-table input {
    min-height: 44px;
    font-size: 16px;
  }

  .calc-sticky-bar {
    position: sticky;
    bottom: 0;
    z-index: 40;
    margin: 0.75rem -1.1rem -1.1rem;
    padding: 0.75rem 1.1rem calc(0.75rem + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(17, 23, 32, 0) 0%, rgba(17, 23, 32, 0.92) 28%, var(--surface2) 100%);
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .calc-sticky-bar .btn-large {
    margin-top: 0;
    min-height: 48px;
    font-size: 1rem;
  }

  .checks { gap: 0.65rem; }

  .option-segments,
  .option-toggles {
    flex-direction: column;
  }

  .kp-segmented {
    flex-direction: column;
  }

  .kp-segment-face {
    justify-content: flex-start;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .check {
    align-items: flex-start;
    font-size: 0.88rem;
  }

  .check input {
    width: 18px;
    height: 18px;
    margin-top: 0.15rem;
    flex-shrink: 0;
  }

  .sheet-nav .btn { min-height: 44px; min-width: 44px; }

  .layout-canvas {
    border-radius: 10px;
  }

  .modal {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .modal-card {
    border-radius: 18px 18px 14px 14px;
    max-height: 92vh;
    overflow: auto;
  }

  .tip-btn::after {
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    text-align: center;
  }

  .tip-btn::before {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .tip-btn:hover::after,
  .tip-btn:focus-visible::after {
    transform: translateX(-50%) translateY(0);
  }

  @media (hover: none) and (pointer: coarse) {
    .tip-btn::after,
    .tip-btn::before {
      display: none !important;
    }
  }

  .cabinet-grid,
  .feature-locks { grid-template-columns: 1fr; }

  .pricing-grid { grid-template-columns: 1fr; }

  .dash-layout,
  .dash-layout--app {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .dash-sidebar {
    position: static;
    min-height: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
  }

  .dash-sidebar-user {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    margin-bottom: 0;
  }

  .dash-calc-frame {
    min-height: 70vh;
  }

  .kp-app-header-link {
    font-size: 0.75rem;
  }

  .dash-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .dash-nav-link {
    width: auto;
    flex: 1 1 calc(50% - 0.25rem);
    justify-content: center;
  }

  .dash-stat-grid,
  .dash-action-grid,
  .dash-split,
  .cabinet-header-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .cabinet-header-link {
    flex: 1 1 calc(50% - 0.2rem);
  }
}

@media (max-width: 400px) {
  .hero-stats { grid-template-columns: 1fr; }

  .stats-row:not(.stats-row--kpi3) { grid-template-columns: 1fr; }

  .stats-row:not(.stats-row--kpi3) .stat-item,
  .stats-row:not(.stats-row--kpi3) .stat-item:nth-child(odd),
  .stats-row:not(.stats-row--kpi3) .stat-item:nth-last-child(1):nth-child(odd) {
    grid-column: auto;
    border-right: none;
  }

  .stats-row:not(.stats-row--kpi3) .stat-item:last-child { border-bottom: 1px solid var(--border); }

  /* Stacked part fields: label above input (not cramped 2-col) */
  .parts-table td,
  .parts-table td.col-qty,
  .parts-table td.pro-col {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    padding: 0.5rem 0;
    grid-template-columns: none;
  }

  .parts-table td::before {
    line-height: 1.2;
  }

  .parts-table td.row-actions {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
  }

  .parts-table td.col-qty .qty-stepper {
    width: 100%;
    max-width: none;
    justify-content: stretch;
  }

  .panel-actions { grid-template-columns: 1fr; }

  .result-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-mark span {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .how-step,
  .feature-card,
  .how-arrow {
    animation: none !important;
  }

  .how-visual img,
  .feature-media img,
  .feature-card:hover .feature-media img,
  .how-step:hover .how-visual img {
    transform: none !important;
    transition: none !important;
  }
}

/* ─── Material panel: Apple-style grouped form (kp-*) ─── */
.panel--material {
  padding: 1.15rem 1rem 1.25rem;
  background: transparent;
  border: none;
  box-shadow: none;
}

.panel--material .kp-panel-title {
  margin: 0 0 1.1rem;
  padding: 0 0.15rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}

.kp-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.kp-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.kp-section-label {
  margin: 0;
  padding: 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(228, 234, 244, 0.45);
}

.kp-section-label--tight {
  margin-top: 0.55rem;
}

.kp-inset {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.18);
}

.kp-inset-pad {
  padding: 0.85rem 0.9rem;
}

.kp-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.kp-stack-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.kp-footnote {
  font-size: 0.74rem;
  line-height: 1.45;
  color: rgba(228, 234, 244, 0.42);
}

.panel--material .kp-input {
  background: rgba(9, 12, 16, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.72rem 0.85rem;
  font-size: 0.92rem;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.panel--material .kp-input:focus {
  outline: none;
  border-color: rgba(45, 212, 163, 0.45);
  box-shadow: 0 0 0 3px rgba(45, 212, 163, 0.12);
  background: rgba(9, 12, 16, 0.75);
}

.kp-chip-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.15rem 0.1rem 0.35rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.kp-chip-row::-webkit-scrollbar { display: none; }

.kp-chip {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.48rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(228, 234, 244, 0.72);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.kp-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

.kp-chip.active,
.kp-chip.preset.active {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.kp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  cursor: default;
}

.kp-row:last-child {
  border-bottom: none;
}

.kp-row-label {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.25;
}

.kp-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.kp-row-caption {
  font-size: 0.74rem;
  color: rgba(228, 234, 244, 0.42);
  line-height: 1.35;
}

.kp-row-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.kp-input--num {
  width: 4.6rem;
  padding: 0.42rem 0.5rem !important;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.kp-input--num:focus {
  background: rgba(255, 255, 255, 0.06) !important;
  border-radius: 8px !important;
}

.kp-row-suffix {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(228, 234, 244, 0.42);
  min-width: 1.6rem;
}

.kp-row--switch {
  cursor: pointer;
  user-select: none;
}

.kp-switch {
  position: relative;
  display: inline-flex;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}

.kp-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  -webkit-appearance: none;
  appearance: none;
}

.kp-switch-track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 31px;
  background: rgba(120, 120, 128, 0.36);
  transition: background 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.kp-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.kp-switch {
  position: relative;
}

.kp-switch input:checked + .kp-switch-track {
  background: var(--green);
}

.kp-switch input:checked + .kp-switch-track::after {
  transform: translateX(20px);
}

.kp-switch input:focus-visible + .kp-switch-track {
  box-shadow: 0 0 0 3px rgba(45, 212, 163, 0.25);
}

.kp-segmented {
  display: flex;
  gap: 0;
  padding: 3px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.kp-segment {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  cursor: pointer;
}

.kp-segment input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.kp-segment-face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.15rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(228, 234, 244, 0.55);
  text-align: center;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.kp-segment:has(input:checked) .kp-segment-face {
  color: var(--text);
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.kp-segment.pack-mode-tight.is-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.kp-segment.pack-mode-tight.is-locked .kp-segment-face {
  pointer-events: none;
}

.kp-tier-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.42rem;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(201, 162, 39, 0.14);
}

.kp-disclosure {
  margin-top: 0.55rem;
}

.kp-row--disclosure {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.kp-row--disclosure::-webkit-details-marker { display: none; }

.kp-chevron {
  width: 7px;
  height: 7px;
  margin-left: 0.35rem;
  flex-shrink: 0;
  border-right: 1.5px solid rgba(228, 234, 244, 0.45);
  border-bottom: 1.5px solid rgba(228, 234, 244, 0.45);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.kp-disclosure[open] .kp-chevron {
  transform: rotate(45deg);
}

.kp-disclosure-body {
  padding: 0.65rem 0.9rem 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.12);
}

.kp-text-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}

.kp-text-btn:hover {
  text-decoration: underline;
}

.app-embed .panel--material {
  padding: 0.85rem 0.65rem 1rem;
}

.app-embed .panel--material .kp-panel-title {
  font-size: 1.2rem;
  margin-bottom: 0.85rem;
}

/* Calculator folds & sheet toolbar */
.calc-fold {
  margin-top: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.calc-fold summary {
  cursor: pointer;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  font-size: 0.88rem;
  list-style: none;
}

.calc-fold summary::-webkit-details-marker { display: none; }

.calc-fold .fold-body {
  padding: 0 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.fold-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(201, 162, 39, 0.22);
  vertical-align: middle;
}

.pro-fold[hidden] { display: none; }

.stock-pick-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 180px;
  overflow: auto;
  margin-bottom: 0.55rem;
}

.stock-pick-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem 0.55rem 2.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(9, 12, 16, 0.45);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.stock-pick-item:hover {
  border-color: rgba(201, 162, 39, 0.28);
}

.stock-pick-item:has(input:checked) {
  border-color: rgba(45, 212, 163, 0.35);
  background: var(--green-dim);
}

.stock-pick-item input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.stock-pick-item::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  transition: border-color 0.15s, background 0.15s;
}

.stock-pick-item:has(input:checked)::before {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 3px rgba(9, 12, 16, 0.85);
}

.cost-fold .cost-summary {
  margin: 0.5rem 0.85rem 0.85rem;
  font-size: 0.85rem;
}

.sheet-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.75rem 0 0.35rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.sheet-fill {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
  margin-right: auto;
}

.view-chips {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.view-chip {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.view-chip.active,
.view-chip:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(201, 162, 39, 0.1);
}

.check-inline {
  font-size: 0.82rem;
  margin: 0;
}

.manufacturer-profile-form {
  display: grid;
  gap: 0.75rem;
  max-width: 520px;
}

.manufacturer-profile-hint {
  margin: 0.35rem 0 0.85rem;
  font-size: 0.85rem;
}

.lead-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.lead-item {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.lead-item.is-new { border-color: rgba(201, 162, 39, 0.35); }
.lead-item.is-read { opacity: 0.92; }
.lead-item.is-closed { opacity: 0.65; }

.lead-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.lead-status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
}

.lead-item-meta,
.lead-item-calc,
.lead-item-comment {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.lead-item-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.warehouse-toolbar {
  margin: 0;
}

.warehouse-empty {
  margin: 0;
}

.canvas-tooltip {
  position: fixed;
  z-index: 200;
  max-width: 240px;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: rgba(15, 20, 28, 0.96);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.share-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 0.88rem;
}

.edge-report { padding: 0 0.85rem 0.85rem; }

.edge-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.edge-table th,
.edge-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.35rem;
  text-align: left;
}

.edge-total { font-size: 0.88rem; margin: 0.35rem 0; }

.field-label--inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  margin: 0;
}

.form-input--sm {
  width: auto;
  min-width: 4.5rem;
  padding: 0.25rem 0.4rem;
  font-size: 0.78rem;
}

.layout-canvas-wrap {
  position: relative;
}

.pro-tool.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.parts-hint code {
  font-size: 0.78rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

/* Cabinet warehouse */
.warehouse-form {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(70px, 1fr)) auto;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.warehouse-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.warehouse-table th,
.warehouse-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.35rem;
  text-align: left;
}

.warehouse-table th { color: var(--muted); font-weight: 600; }

.warehouse-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .warehouse-form { grid-template-columns: 1fr 1fr; }
  .warehouse-form .btn { grid-column: 1 / -1; }
  /* Prefer horizontal scroll over stacked chrome (workshop overrides to row) */
  .sheet-toolbar {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sheet-fill { margin-right: 0; flex-shrink: 0; }
}

@media print {
  header, .hero, .section, .site-footer, .modal, .calc-topbar, .panel-actions, .sheet-nav, .result-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .calc-window { box-shadow: none; border: none; }
}
