/* Kalsi Pro Calculator — High-Tech Industrial design system (mobile first) */
:root {
  --primary: #fedc00;
  --accent: #ffff33;
  --graphite: #1a1a1a;
  --black: #111111;
  --steel: #2b2b2b;
  --bg: #ffffff;
  --page: #f7f7f7;
  --text: #222222;
  --muted: #666666;
  --line: #dadada;
  --line-strong: #222222;
  --surface: #f7f7f7;
  --danger: #c62828;
  --ok: #1b7a3a;
  --radius: 10px;
  --radius-card: 12px;
  --tap: 48px;
  --nav-h: 72px;
  --shadow-sm: 0 1px 2px rgba(17, 17, 17, .08), 0 2px 6px rgba(17, 17, 17, .06);
  --shadow: 0 2px 0 rgba(17, 17, 17, .9), 0 8px 20px -6px rgba(17, 17, 17, .22);
  --shadow-lg: 0 4px 0 rgba(17, 17, 17, .9), 0 16px 32px -10px rgba(17, 17, 17, .32);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Roboto Mono", Menlo, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--page);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
/* Blueprint / engineering grid — fixed, pure CSS, opacity under 5% */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(17, 17, 17, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, .045) 1px, transparent 1px),
    linear-gradient(rgba(17, 17, 17, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, .022) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 16px 16px, 16px 16px;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
h1, h2, h3 { letter-spacing: -.02em; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }
main { flex: 1; }
main > * { animation: reveal .28s var(--ease) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--primary);
  box-shadow: 0 2px 0 var(--black);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 4px;
  background: repeating-linear-gradient(-45deg, var(--black) 0 6px, transparent 6px 12px); opacity: .9;
}
.topbar .container { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: .02em; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--black); color: var(--primary); font-weight: 900; font-size: 18px; border-radius: 6px;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}
.brand-text { font-size: 15px; line-height: 1.1; text-transform: uppercase; font-weight: 900; }
.brand-text small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .2em; opacity: .75; }
.back-btn {
  min-width: var(--tap); height: 40px; border: 2px solid var(--text); background: var(--bg);
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 800; font-size: 13px; padding: 0 14px; cursor: pointer; text-decoration: none;
  text-transform: uppercase; letter-spacing: .06em; box-shadow: 0 2px 0 var(--black);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.back-btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--black); }
.topbar .spacer { flex: 1; }
.tag-version {
  font-family: var(--mono); font-size: 11px; font-weight: 800; color: var(--primary); background: var(--black);
  padding: 4px 8px; border-radius: 6px; letter-spacing: .08em;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(120% 90% at 100% 0%, #333 0%, var(--graphite) 45%, var(--black) 100%);
  padding: 32px 0 36px; margin-top: 6px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(90% 90% at 80% 30%, #000, transparent 85%);
  -webkit-mask-image: radial-gradient(90% 90% at 80% 30%, #000, transparent 85%);
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px;
  background: repeating-linear-gradient(-45deg, var(--primary) 0 10px, var(--black) 10px 20px);
}
.hero .container { position: relative; display: grid; gap: 20px; align-items: center; }
@media (min-width: 640px) { .hero { padding: 48px 0 56px; } .hero .container { grid-template-columns: 1.25fr 1fr; gap: 32px; } }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 18px; height: 6px; border-radius: 1px; background: repeating-linear-gradient(-45deg, var(--text) 0 3px, var(--primary) 3px 6px); }
.hero .eyebrow { color: var(--primary); }
.hero .eyebrow::before { background: repeating-linear-gradient(-45deg, var(--primary) 0 3px, transparent 3px 6px); }
.hero h1 { font-size: clamp(34px, 10vw, 56px); line-height: 1; margin: 14px 0 12px; font-weight: 900; letter-spacing: -.035em; }
.hero h1 mark { background: none; color: var(--primary); padding: 0; display: block; }
.hero-sub {
  margin: 0 0 12px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: #fff;
  display: inline-flex; align-items: center; gap: 10px; padding-left: 12px; border-left: 3px solid var(--primary);
}
.hero p.hero-text { margin: 0; color: #c9c9c9; font-size: 16px; max-width: 38ch; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hero-stats span {
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .04); color: #e8e8e8; padding: 6px 10px; border-radius: 6px;
}
.hero-stats span b { color: var(--primary); }
.hero-art {
  position: relative; justify-self: center; width: min(68vw, 260px); aspect-ratio: 1; display: grid; place-items: center;
  order: -1;
}
@media (min-width: 640px) { .hero-art { order: 0; width: 100%; max-width: 300px; } }
.hero-art::before {
  content: ""; position: absolute; inset: 6%; border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 220, 0, .35), rgba(254, 220, 0, 0) 68%);
}
.hero-art::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(254, 220, 0, .35);
  background: conic-gradient(from 0deg, transparent 0 85%, rgba(254, 220, 0, .25) 95%, transparent 100%);
  mask-image: radial-gradient(circle, transparent 66%, #000 67%); -webkit-mask-image: radial-gradient(circle, transparent 66%, #000 67%);
}
.hero-art > img, .hero-art > svg { position: relative; z-index: 1; width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .45)); }
.hero-art .corner { position: absolute; width: 18px; height: 18px; border: 2px solid var(--primary); z-index: 1; }
.hero-art .corner.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.hero-art .corner.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.hero-art .corner.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.hero-art .corner.br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* ---------- System grid ---------- */
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 32px 0 16px; }
.section-title h2 { margin: 4px 0 0; font-size: 22px; font-weight: 900; letter-spacing: -.02em; text-transform: none; }
.section-title .kicker { display: block; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.section-title > span { font-family: var(--mono); font-size: 11px; font-weight: 800; color: var(--text); background: var(--primary); padding: 4px 8px; border-radius: 6px; white-space: nowrap; }

.systems { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding-bottom: 28px; }
@media (min-width: 640px) { .systems { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
.sys-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  min-height: 196px; padding: 14px; text-decoration: none; background: var(--bg); overflow: hidden;
  border: 2px solid var(--text); border-radius: var(--radius-card); box-shadow: var(--shadow);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
  touch-action: manipulation;
}
.sys-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); transform: scaleY(0); transform-origin: top; transition: transform .25s var(--ease); }
.sys-card:active { transform: scale(.97); box-shadow: 0 1px 0 var(--black), 0 4px 10px -4px rgba(17, 17, 17, .25); }
@media (hover: hover) {
  .sys-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
  .sys-card:hover::before { transform: scaleY(1); }
  .sys-card:hover .cta { background: var(--primary); color: var(--black); }
  .sys-card:hover .cta i { transform: translateX(3px); }
  .sys-card:active { transform: scale(.97); }
}
.sys-card .top { display: flex; justify-content: space-between; align-items: flex-start; }
.sys-icon-wrap {
  width: 64px; height: 64px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(145deg, #fff 0%, #f1f1f1 100%); border: 1.5px solid var(--line);
  box-shadow: inset 0 -3px 0 var(--primary), var(--shadow-sm);
}
@media (min-width: 640px) { .sys-icon-wrap { width: 72px; height: 72px; } }
.sys-card svg, .sys-card img.sys-icon { width: 44px; height: 44px; object-fit: contain; }
@media (min-width: 640px) { .sys-card svg, .sys-card img.sys-icon { width: 52px; height: 52px; } }
.sys-card .code { font-family: var(--mono); font-size: 10px; font-weight: 800; color: var(--muted); border: 1px solid var(--line); padding: 2px 6px; border-radius: 4px; letter-spacing: .06em; }
.sys-card .name { font-size: 18px; font-weight: 900; line-height: 1.15; letter-spacing: -.01em; }
.sys-card .desc { font-size: 12.5px; line-height: 1.4; color: var(--muted); margin-top: 4px; }
.sys-card .body { flex: 1; }
.sys-card .cta {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0 -14px -14px; padding: 9px 14px;
  background: var(--graphite); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.sys-card .cta i { font-style: normal; font-size: 15px; color: var(--primary); transition: transform .2s var(--ease); }
@media (hover: hover) { .sys-card:hover .cta i { color: var(--black); } }
.sys-card.disabled { box-shadow: none; border-style: dashed; opacity: .6; }
.sys-card.disabled .cta { background: #eee; color: var(--muted); }
.sys-card .soon { font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 4px; }

/* ---------- Panels & forms ---------- */
.page-head { padding: 24px 0 8px; }
.page-head h1 { margin: 8px 0 4px; font-size: clamp(28px, 8vw, 38px); line-height: 1.05; font-weight: 900; letter-spacing: -.03em; }
.page-head p { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 13px; }

.panel {
  border: 2px solid var(--text); border-radius: var(--radius-card); padding: 18px 16px 16px; margin: 18px 0;
  background: var(--bg); position: relative; box-shadow: var(--shadow); animation: reveal .28s var(--ease) both;
}
.panel-label {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; background: var(--graphite); color: var(--primary);
  font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: .12em; padding: 5px 10px; text-transform: uppercase; border-radius: 6px;
}
.panel-label::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--primary); }
.help { background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 8px; padding: 12px 14px; font-size: 14px; color: var(--muted); margin: 14px 0; }

.field { margin: 14px 0; }
.field label, .field .label { display: block; font-size: 12px; font-weight: 800; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .08em; color: var(--text); }
.input-wrap { position: relative; display: flex; align-items: stretch; }
.input, select.input, textarea.input {
  width: 100%; min-height: 52px; border: 2px solid var(--text); border-radius: var(--radius);
  padding: 10px 14px; background: var(--bg); font-size: 18px; font-weight: 700; appearance: none; -webkit-appearance: none;
  transition: box-shadow .15s var(--ease), border-color .15s var(--ease);
}
.input::placeholder { color: #b3b3b3; font-weight: 500; }
select.input {
  font-size: 16px; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat;
}
textarea.input { font-size: 15px; font-weight: 500; min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px rgba(254, 220, 0, .85); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(198, 40, 40, .15); }
.unit-suffix {
  display: grid; place-items: center; min-width: 56px; border: 2px solid var(--text); border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0; background: var(--graphite); color: var(--primary); font-weight: 800; font-family: var(--mono);
}
.input-wrap .input { border-radius: var(--radius) 0 0 var(--radius); }
.field-error { color: var(--danger); font-size: 13px; font-weight: 700; margin-top: 6px; min-height: 0; }
.field-hint { color: var(--muted); font-size: 12px; margin-top: 6px; font-family: var(--mono); }
.dims { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 480px) { .dims { grid-template-columns: 1fr 1fr; } }

.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px; background: var(--surface); border: 2px solid var(--text); border-radius: var(--radius); }
.segmented button {
  min-height: var(--tap); border: 1.5px solid transparent; border-radius: 7px; background: transparent; font-weight: 800; cursor: pointer; font-size: 16px;
  font-family: var(--mono); transition: background .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease); touch-action: manipulation;
}
.segmented button:active { transform: scale(.96); }
@media (hover: hover) { .segmented button:hover { background: #fff; border-color: var(--line); } }
.segmented button[aria-pressed="true"] { background: var(--primary); border-color: var(--text); box-shadow: 0 2px 0 var(--black); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 46px; padding: 9px 16px; border: 2px solid var(--text); border-radius: var(--radius); background: var(--bg);
  font-weight: 700; font-size: 14px; cursor: pointer; text-align: left; box-shadow: 0 2px 0 var(--black);
  transition: background .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease); touch-action: manipulation;
}
@media (hover: hover) { .chip:hover { background: #fffbe0; } }
.chip:active { transform: translateY(2px); box-shadow: 0 0 0 var(--black); }
.chip[aria-pressed="true"] { background: var(--graphite); color: var(--primary); }

.area-preview {
  display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .1em;
  padding: 12px 14px; background: var(--graphite); color: #cfcfcf; border-radius: var(--radius); margin-top: 10px; border-left: 4px solid var(--primary);
}
.area-preview strong { font-size: 20px; color: var(--primary); letter-spacing: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap);
  padding: 12px 18px; border: 2px solid var(--text); border-radius: var(--radius); background: var(--bg); color: var(--black);
  font-weight: 800; font-size: 14px; cursor: pointer; text-decoration: none; text-transform: uppercase; letter-spacing: .06em;
  box-shadow: 0 3px 0 var(--black); touch-action: manipulation;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease), filter .15s var(--ease);
}
@media (hover: hover) { .btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--black), 0 10px 18px -8px rgba(17, 17, 17, .4); } }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--black); }
.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--primary) 55%); color: var(--black);
  box-shadow: 0 4px 0 var(--black), 0 10px 20px -10px rgba(17, 17, 17, .45);
}
@media (hover: hover) { .btn-primary:hover { filter: saturate(1.1); box-shadow: 0 5px 0 var(--black), 0 14px 24px -10px rgba(17, 17, 17, .5); } }
.btn-primary:active { box-shadow: 0 0 0 var(--black); transform: translateY(4px); }
.btn-dark { background: var(--graphite); color: var(--primary); border-color: var(--black); }
.btn-block { width: 100%; min-height: 56px; font-size: 15px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.btn-wa { background: #25d366; color: #0b2b16; }

/* ---------- Result ---------- */
.result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.result-head .chip-tag { font-family: var(--mono); font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 6px; background: var(--graphite); color: var(--primary); letter-spacing: .08em; }
.result-head .chip-tag.ok { background: var(--primary); color: var(--black); }

.sec { margin: 26px 0 0; animation: reveal .28s var(--ease) both; }
.sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sec-num {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center; background: var(--graphite); color: var(--primary);
  font-family: var(--mono); font-weight: 900; font-size: 14px; border-radius: 8px; box-shadow: inset 0 -3px 0 var(--primary);
}
.sec-head h2 { margin: 0; font-size: 17px; font-weight: 900; letter-spacing: -.01em; line-height: 1.1; }
.sec-head h2 small { display: block; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.sec-head::after { content: ""; flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 10px); }
.sec .panel { margin: 0; }

.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); margin: 0; }
.summary-grid div { padding: 11px 0; border-bottom: 1px solid var(--line); }
.summary-grid div:nth-child(odd) { padding-right: 8px; }
.summary-grid dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; }
.summary-grid dd { margin: 3px 0 0; font-weight: 700; word-break: break-word; }
.summary-grid .wide { grid-column: 1 / -1; }
.area-big {
  display: flex; align-items: baseline; gap: 6px; margin: -18px -16px 14px; padding: 20px 16px 16px;
  background: linear-gradient(180deg, var(--accent), var(--primary) 60%); border-bottom: 2px solid var(--text);
  border-radius: calc(var(--radius-card) - 2px) calc(var(--radius-card) - 2px) 0 0;
}
.area-big strong { font-size: 44px; font-weight: 900; line-height: 1; letter-spacing: -.03em; }
.area-big span { font-family: var(--mono); font-weight: 800; }
.area-big small { margin-left: auto; font-family: var(--mono); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }

/* Recommendation — highlighted engineering card */
.reco-card {
  position: relative; overflow: hidden; background: var(--graphite); color: #fff; border: 2px solid var(--black);
  border-radius: var(--radius-card); padding: 18px 16px 16px 22px; box-shadow: var(--shadow);
}
.reco-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--primary); }
.reco-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 16px 16px;
}
.reco-card > * { position: relative; z-index: 1; }
.reco-badge {
  display: inline-flex; align-items: center; gap: 6px; background: var(--primary); color: var(--black);
  font-family: var(--mono); font-size: 10.5px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; padding: 4px 9px; border-radius: 5px;
}
.reco-badge::before { content: "✓"; font-family: var(--font); }
.reco-card .reco-text { margin: 12px 0 0; font-size: 22px; font-weight: 900; line-height: 1.2; letter-spacing: -.01em; color: #fff; word-break: break-word; }
.reco-text { margin: 0; font-weight: 600; }
.reco-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.reco-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04); border-radius: 8px; font-size: 14px; }
.reco-list li span:first-child { color: #a8a8a8; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.reco-list li span:last-child { font-weight: 800; color: var(--primary); font-size: 16px; word-break: break-word; }
.reco-card .field-hint { color: #bdbdbd; }

.mat-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.mat-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 8px 6px; border-bottom: 2px solid var(--text); }
.mat-table td { padding: 13px 6px; border-bottom: 1px solid var(--line); vertical-align: top; word-wrap: break-word; }
.mat-table tbody tr:nth-child(even) td { background: #fafafa; }
.mat-table tbody tr:last-child td { border-bottom: 0; }
.mat-table th:first-child, .mat-table td:first-child { padding-left: 0; width: 34px; font-family: var(--mono); color: var(--muted); font-size: 12px; font-weight: 700; }
.mat-table tbody tr:nth-child(even) td:first-child { padding-left: 2px; }
.mat-table .qty { text-align: right; font-weight: 900; font-size: 19px; white-space: nowrap; width: 30%; }
.mat-table .unit { width: 20%; font-family: var(--mono); font-size: 12px; font-weight: 800; padding-right: 0; }
.mat-table .spec { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.mat-name { font-weight: 700; }

.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 85%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding-bottom: 6px; margin-top: 14px; }
.gallery figure { margin: 0; scroll-snap-align: start; border: 2px solid var(--text); border-radius: var(--radius); background: var(--surface); aspect-ratio: 4 / 3; overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 640px) { .gallery { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); grid-auto-columns: auto; overflow: visible; } }
.gallery-empty { margin-top: 14px; }
.gallery-empty figure { margin: 0; aspect-ratio: 16 / 9; border: 2px solid var(--text); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.gallery-empty figure img { width: 100%; height: 100%; object-fit: cover; }
.gallery-empty p { margin: 8px 0 0; color: var(--muted); font-size: 14px; text-align: center; }

.meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 12px 0; }
.meta-row b { color: var(--text); }
.meta-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 480px) { .meta-grid { grid-template-columns: 1fr 1fr; } }
.meta-grid div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.meta-grid dt { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.meta-grid dd { margin: 2px 0 0; font-weight: 700; font-size: 14px; word-break: break-word; }
.disclaimer { font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 14px; }
.disclaimer strong { color: var(--text); display: block; text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px; margin-bottom: 4px; }

/* ---------- States ---------- */
.state { text-align: center; padding: 44px 16px; }
.state h2 { margin: 14px 0 6px; font-size: 22px; font-weight: 900; }
.state p { color: var(--muted); margin: 0 auto 18px; max-width: 40ch; }
.state-icon { width: 60px; height: 60px; margin: 0 auto; display: grid; place-items: center; background: var(--primary); border: 2px solid var(--text); border-radius: 12px; font-weight: 900; font-size: 26px; box-shadow: var(--shadow); }
.error-box { border: 2px solid var(--danger); background: #fff5f5; padding: 14px; border-radius: var(--radius); margin: 16px 0; }
.error-box strong { display: block; color: var(--danger); }
.error-box p { margin: 4px 0 0; font-size: 14px; }

.skeleton { background: linear-gradient(90deg, #ececec 25%, #f7f7f7 50%, #ececec 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-card); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Loading overlay with calculator asset */
.loading-overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; text-align: center; padding: 24px; color: #fff;
  background: rgba(17, 17, 17, .92); animation: fade .2s var(--ease) both;
}
@keyframes fade { from { opacity: 0; } }
.loader-ring { position: relative; width: 132px; height: 132px; margin: 0 auto 22px; display: grid; place-items: center; }
.loader-ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(254, 220, 0, .18); border-top-color: var(--primary); animation: spin .9s linear infinite;
}
.loader-ring::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .2); }
.loader-ring > img, .loader-ring > svg { position: relative; width: 64px; height: 64px; object-fit: contain; color: var(--primary); animation: pulse 1.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(.92); opacity: .85; } }
.loader-bar { width: 180px; height: 6px; margin: 14px auto 0; border-radius: 3px; overflow: hidden; background: repeating-linear-gradient(-45deg, var(--primary) 0 6px, #333 6px 12px); background-size: 34px 100%; animation: stripes .8s linear infinite; }
@keyframes stripes { to { background-position: 34px 0; } }
.loader { display: none; }
.loading-overlay p { font-weight: 800; margin: 0; min-height: 1.5em; font-size: 16px; letter-spacing: .01em; }
.loading-overlay .loader-kicker { font-family: var(--mono); font-size: 11px; color: var(--primary); letter-spacing: .2em; text-transform: uppercase; margin-bottom: 6px; font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--graphite); color: var(--primary); padding: 12px 18px; border-radius: var(--radius); font-weight: 700; z-index: 60;
  max-width: calc(100% - 32px); box-shadow: 0 10px 24px rgba(0, 0, 0, .3); border-left: 4px solid var(--primary); animation: fade .2s var(--ease) both;
}

/* ---------- Bottom navigation — industrial control panel ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--graphite);
  padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -8px 24px rgba(0, 0, 0, .18);
}
.bottom-nav::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: repeating-linear-gradient(-45deg, var(--primary) 0 8px, var(--black) 8px 16px); }
.bottom-nav ul { list-style: none; margin: 0 auto; padding: 8px 10px 6px; max-width: 760px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; height: var(--nav-h); }
.bottom-nav li { min-width: 0; }
.bottom-nav a {
  position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: #fff; text-decoration: none; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, .06); background: linear-gradient(180deg, #232323, #1c1c1c);
  transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease); touch-action: manipulation;
}
.bottom-nav a:active { transform: scale(.96); }
@media (hover: hover) { .bottom-nav a:hover { background: #2b2b2b; } }
.bottom-nav a svg, .bottom-nav a img.nav-icon { width: 26px; height: 26px; object-fit: contain; }
.bottom-nav a[aria-current="page"] { color: var(--primary); background: linear-gradient(180deg, #2b2b2b, #222); border-color: rgba(254, 220, 0, .35); }
.bottom-nav a[aria-current="page"]::after { content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); box-shadow: 0 0 10px rgba(254, 220, 0, .7); }
.bottom-nav a[aria-current="page"] svg, .bottom-nav a[aria-current="page"] img.nav-icon { filter: drop-shadow(0 0 6px rgba(254, 220, 0, .5)); }

.footer-note { text-align: center; color: var(--muted); font-size: 11px; padding: 12px 0 24px; font-family: var(--mono); letter-spacing: .08em; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
[hidden] { display: none !important; }
/* Admin-managed assets (fall back to built-in SVGs) */
.brand-logo { height: 34px; width: auto; max-width: 150px; object-fit: contain; display: block; }
.btn img.asset-icon { width: 20px; height: 20px; flex: none; object-fit: contain; }

/* ---------- Landing launch CTA ---------- */
.hero-sub { margin-bottom: 0; }
.launch-cta {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; min-height: 68px; margin-top: 16px; padding: 0 8px 0 22px; overflow: hidden;
  background: #fedc00; color: #111; text-decoration: none; border: 3px solid #111; border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(254, 220, 0, .55), 0 0 26px -2px rgba(254, 220, 0, .45), 0 5px 0 #000;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform .14s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
/* control-panel detailing: screws + faint panel grooves */
.launch-cta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 8px 8px, rgba(17, 17, 17, .55) 1.6px, transparent 2.2px),
    radial-gradient(circle at 8px calc(100% - 8px), rgba(17, 17, 17, .55) 1.6px, transparent 2.2px),
    repeating-linear-gradient(90deg, rgba(17, 17, 17, .05) 0 1px, transparent 1px 6px);
}
.launch-cta::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-18deg); transition: left .5s var(--ease);
}
.launch-label {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  font-size: 19px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; line-height: 1.1;
}
.launch-label small {
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .18em; opacity: .65;
  display: inline-flex; align-items: center; gap: 6px;
}
.launch-label small::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: #111; box-shadow: 0 0 0 2px rgba(17, 17, 17, .2);
  animation: launch-pulse 1.8s ease-in-out infinite;
}
.launch-key {
  position: relative; flex: none; width: 50px; height: 50px; border-radius: 8px; display: grid; place-items: center;
  background: #111; color: #fedc00; font-size: 24px; font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(254, 220, 0, .25), inset 0 -3px 0 #000;
  transition: transform .14s var(--ease), box-shadow .2s var(--ease);
}
@media (hover: hover) {
  .launch-cta:hover { box-shadow: 0 0 0 1px rgba(254, 220, 0, .7), 0 0 38px 0 rgba(254, 220, 0, .6), 0 5px 0 #000; }
  .launch-cta:hover::after { left: 120%; }
  .launch-cta:hover .launch-key { transform: translateX(2px); box-shadow: inset 0 0 0 1px rgba(254, 220, 0, .6), inset 0 -3px 0 #000, 0 0 14px rgba(254, 220, 0, .35); }
}
.launch-cta:active { transform: translateY(5px); background: #f2d100; box-shadow: 0 0 0 1px rgba(254, 220, 0, .55), 0 0 18px -2px rgba(254, 220, 0, .5), 0 0 0 #000; }
.launch-cta:active .launch-key { transform: scale(.94); }
.launch-cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@keyframes launch-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .launch-cta, .launch-cta::after, .launch-key { transition: none; }
  .launch-label small::before { animation: none; }
}
.landing-actions { padding-top: 16px; }
.landing-actions:has(.pwa-slot:empty) { display: none; }
.pwa-slot:empty { display: none; }
