/* ==========================================================================
   Hündgen Kalkulationsportal – Designsystem
   Orientierung: huendgen-gmbh.de (kondensierte Versalien, Schwarz/Weiß/Grau,
   ein Rot als Akzent, eckige Formen, viel Weißraum). Bootstrap wird nur als
   technische Basis (Reboot/Grid) genutzt und hier konsequent überschrieben.
   ========================================================================== */

:root {
  --hk-black: #111111;
  --hk-ink: #1a1a1a;
  --hk-grey-900: #2b2b2b;
  --hk-grey-700: #555555;
  --hk-grey-500: #8a8a8a;
  --hk-grey-300: #cfcfcf;
  --hk-grey-200: #e3e3e3;
  --hk-grey-100: #f2f2f2;
  --hk-grey-050: #f8f8f8;
  --hk-white: #ffffff;
  --hk-red: #f5131f;
  --hk-red-dark: #c40d17;
  --hk-ok: #1f7a3a;

  --hk-font-head: "Fira Sans Extra Condensed", "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  --hk-font-body: "Lato", "Segoe UI", Arial, Helvetica, sans-serif;

  --hk-container: 1600px;
  --hk-gutter: 48px;
  --hk-space-1: 8px;
  --hk-space-2: 16px;
  --hk-space-3: 24px;
  --hk-space-4: 32px;
  --hk-space-5: 48px;
  --hk-space-6: 72px;

  --hk-header-h: 76px;
  --hk-radius: 0;
  --hk-border: 1px solid var(--hk-grey-200);
  --hk-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  --hk-transition: 160ms ease;
}

/* ---------- Basis --------------------------------------------------------- */
html { font-size: 16px; }
body {
  margin: 0;
  font-family: var(--hk-font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--hk-ink);
  background: var(--hk-white);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--hk-black); text-decoration: none; transition: color var(--hk-transition); }
a:hover { color: var(--hk-red); }
h1, h2, h3, h4, .hk-head {
  font-family: var(--hk-font-head);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 0.95;
  color: var(--hk-black);
  margin: 0;
}
h1 { font-size: clamp(40px, 4.6vw, 76px); letter-spacing: -0.02em; }
h2 { font-size: clamp(26px, 2.4vw, 38px); }
h3 { font-size: 22px; }
h4 { font-size: 17px; letter-spacing: 0.02em; }
p { margin: 0 0 var(--hk-space-2); }
small, .hk-small { font-size: 13px; color: var(--hk-grey-700); }
.hk-muted { color: var(--hk-grey-500); }
.hk-mono { font-variant-numeric: tabular-nums; }
.hk-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
hr { border: 0; border-top: var(--hk-border); margin: var(--hk-space-4) 0; opacity: 1; }
::selection { background: var(--hk-black); color: var(--hk-white); }

/* ---------- Layout -------------------------------------------------------- */
.hk-container {
  max-width: var(--hk-container);
  margin: 0 auto;
  padding: 0 var(--hk-gutter);
}
.hk-main { padding: var(--hk-space-5) 0 var(--hk-space-6); min-height: calc(100vh - var(--hk-header-h) - 64px); box-sizing: border-box; }
.hk-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--hk-space-4);
  margin-bottom: var(--hk-space-5);
  flex-wrap: wrap;
}
.hk-page-head .hk-eyebrow { margin-bottom: 10px; }
.hk-page-head .hk-sub { font-size: 17px; color: var(--hk-grey-700); margin: 14px 0 0; max-width: 60ch; }
.hk-page-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hk-eyebrow {
  font-family: var(--hk-font-head);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 13px;
  color: var(--hk-grey-500);
}
.hk-eyebrow.is-red { color: var(--hk-red); }
.hk-section { margin-bottom: var(--hk-space-5); }
.hk-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--hk-space-2);
  padding-bottom: 12px;
  margin-bottom: var(--hk-space-2);
  border-bottom: 2px solid var(--hk-black);
}
.hk-section-head h2 { font-size: 24px; }
.hk-grid { display: grid; gap: var(--hk-space-4); }
.hk-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hk-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .hk-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .hk-grid-2, .hk-grid-3 { grid-template-columns: 1fr; } }

/* ---------- Header / Navigation ------------------------------------------ */
.hk-header {
  background: var(--hk-black);
  color: var(--hk-white);
  min-height: var(--hk-header-h);
  position: sticky;
  top: 0;
  z-index: 50;
}
.hk-header .hk-container { display: flex; align-items: center; min-height: var(--hk-header-h); height: auto; gap: var(--hk-space-5); }
.hk-brand { display: flex; align-items: center; gap: 14px; color: var(--hk-white); flex: 0 0 auto; }
.hk-brand:hover { color: var(--hk-white); }
.hk-brand img { height: 34px; width: auto; display: block; }
.hk-brand-word {
  font-family: var(--hk-font-head);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}
.hk-brand-sub {
  font-family: var(--hk-font-head);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  display: block;
  margin-top: 4px;
}
/* Navigation darf umbrechen statt abgeschnitten zu werden (9 Menüpunkte im Adminbereich) */
.hk-nav { display: flex; align-items: center; flex-wrap: wrap; row-gap: 0; gap: 4px; flex: 1 1 auto; min-width: 0; }
.hk-nav::-webkit-scrollbar { display: none; }
.hk-nav a {
  font-family: var(--hk-font-head);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  padding: 8px 12px;
  position: relative;
  white-space: nowrap;
  transition: color var(--hk-transition);
}
.hk-nav a:hover { color: var(--hk-white); }
.hk-nav a.is-active { color: var(--hk-white); }
.hk-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 0;
  height: 2px;
  background: var(--hk-red);
}
.hk-nav a.is-cta { color: var(--hk-white); border: 1px solid rgba(255, 255, 255, 0.35); padding: 8px 14px; margin-right: 6px; }
.hk-nav a.is-cta:hover { border-color: var(--hk-white); }
.hk-nav a.is-cta.is-active::after { display: none; }
.hk-nav a.is-cta.is-active { border-color: var(--hk-red); }
.hk-user { display: flex; align-items: center; gap: 14px; margin-left: auto; flex: 0 0 auto; }
.hk-user span { font-size: 13px; color: rgba(255, 255, 255, 0.6); letter-spacing: 0.04em; }
.hk-user form { margin: 0; }
.hk-nav-toggle { display: none; }

/* ---------- Buttons ------------------------------------------------------- */
.btn-hk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--hk-font-head);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  padding: 15px 26px;
  border: 1px solid var(--hk-black);
  background: var(--hk-black);
  color: var(--hk-white);
  border-radius: var(--hk-radius);
  cursor: pointer;
  transition: background var(--hk-transition), border-color var(--hk-transition), color var(--hk-transition), transform var(--hk-transition);
  white-space: nowrap;
}
.btn-hk:hover { background: var(--hk-red); border-color: var(--hk-red); color: var(--hk-white); }
.btn-hk:active { transform: translateY(1px); }
.btn-hk:disabled, .btn-hk[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-hk.is-secondary { background: transparent; color: var(--hk-black); }
.btn-hk.is-secondary:hover { background: var(--hk-black); color: var(--hk-white); border-color: var(--hk-black); }
.btn-hk.is-ghost { background: transparent; border-color: transparent; color: var(--hk-grey-700); padding-left: 10px; padding-right: 10px; }
.btn-hk.is-ghost:hover { color: var(--hk-red); background: transparent; }
.btn-hk.is-danger { background: transparent; color: var(--hk-red); border-color: var(--hk-red); }
.btn-hk.is-danger:hover { background: var(--hk-red); color: var(--hk-white); }
.btn-hk.is-white { background: var(--hk-white); color: var(--hk-black); border-color: var(--hk-white); }
.btn-hk.is-white:hover { background: var(--hk-red); border-color: var(--hk-red); color: var(--hk-white); }
.btn-hk.is-lg { font-size: 17px; padding: 20px 36px; }
.btn-hk.is-sm { font-size: 13px; padding: 10px 16px; letter-spacing: 0.1em; }
.btn-hk.is-block { width: 100%; }
.btn-hk svg { width: 16px; height: 16px; }
.hk-link-arrow { font-family: var(--hk-font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-size: 14px; }
.hk-link-arrow::after { content: " →"; }

/* ---------- Formulare ----------------------------------------------------- */
.hk-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
.hk-form-grid .is-full { grid-column: 1 / -1; }
@media (max-width: 760px) { .hk-form-grid { grid-template-columns: 1fr; } }
.hk-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.hk-field label, .hk-label {
  font-family: var(--hk-font-head);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hk-grey-700);
}
.hk-input, .hk-select, .hk-textarea {
  font-family: var(--hk-font-body);
  font-size: 15px;
  color: var(--hk-ink);
  background: var(--hk-white);
  border: 1px solid var(--hk-grey-300);
  border-radius: var(--hk-radius);
  padding: 0 14px;
  height: 46px;
  width: 100%;
  outline: none;
  transition: border-color var(--hk-transition), box-shadow var(--hk-transition);
  appearance: none;
}
.hk-textarea { height: auto; min-height: 110px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.hk-input:focus, .hk-select:focus, .hk-textarea:focus { border-color: var(--hk-black); box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08); }
.hk-input[readonly] { background: var(--hk-grey-050); color: var(--hk-grey-700); }
.hk-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23111' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.hk-input-group { display: flex; align-items: stretch; }
.hk-input-group .hk-input { flex: 1 1 auto; }
.hk-input-group .hk-unit {
  display: flex; align-items: center; padding: 0 14px;
  border: 1px solid var(--hk-grey-300); border-left: 0;
  background: var(--hk-grey-050); color: var(--hk-grey-700); font-size: 13px; letter-spacing: 0.04em;
}
.hk-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--hk-grey-900); cursor: pointer; }
.hk-check input { width: 18px; height: 18px; accent-color: var(--hk-black); margin: 0; }
.hk-help { font-size: 12.5px; color: var(--hk-grey-500); }
.hk-form-actions { display: flex; gap: 12px; align-items: center; margin-top: var(--hk-space-4); flex-wrap: wrap; }
.hk-form-error {
  border-left: 3px solid var(--hk-red);
  background: #fff4f4;
  color: var(--hk-red-dark);
  padding: 12px 16px;
  margin-bottom: var(--hk-space-3);
  font-size: 14px;
}

/* ---------- Panels -------------------------------------------------------- */
.hk-panel { background: var(--hk-white); border: var(--hk-border); padding: 28px; }
.hk-panel.is-dark { background: var(--hk-black); color: var(--hk-white); border-color: var(--hk-black); }
.hk-panel.is-dark h2, .hk-panel.is-dark h3, .hk-panel.is-dark h4 { color: var(--hk-white); }
.hk-panel.is-grey { background: var(--hk-grey-050); border-color: var(--hk-grey-100); }
.hk-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.hk-panel-head h3 { font-size: 19px; letter-spacing: 0.04em; }
.hk-panel + .hk-panel { margin-top: var(--hk-space-3); }

/* Kennzahlen (minimalistisch, keine bunten Karten) */
.hk-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--hk-black); border-bottom: var(--hk-border); }
.hk-kpi { padding: 26px 0; border-right: var(--hk-border); padding-right: 24px; }
.hk-kpi + .hk-kpi { padding-left: 24px; }
.hk-kpi:last-child { border-right: 0; }
.hk-kpi .hk-kpi-value { font-family: var(--hk-font-head); font-weight: 600; font-size: 56px; line-height: 0.9; letter-spacing: -0.02em; }
.hk-kpi .hk-kpi-label { margin-top: 10px; }
.hk-kpi .hk-kpi-note { font-size: 13px; color: var(--hk-grey-500); margin-top: 6px; }
@media (max-width: 760px) { .hk-kpis { grid-template-columns: 1fr; } .hk-kpi { border-right: 0; border-bottom: var(--hk-border); padding-left: 0 !important; } }

/* Definitionslisten (Bauteildaten) */
.hk-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; margin: 0; }
.hk-dl > div { display: contents; }
.hk-dl dt, .hk-dl dd { padding: 11px 0; border-bottom: var(--hk-border); margin: 0; }
.hk-dl dt { font-family: var(--hk-font-head); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; font-size: 12.5px; color: var(--hk-grey-700); }
.hk-dl dt, .hk-dl dd { align-self: stretch; display: flex; align-items: center; min-width: 0; }
.hk-dl dd { justify-content: flex-end; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; padding-left: 12px; overflow-wrap: anywhere; }
.hk-dl dt { padding-right: 8px; }
.hk-dl dd.is-normal { font-weight: 400; }
.hk-dl.is-plain dt, .hk-dl.is-plain dd { border-bottom: 0; padding: 6px 0; }

/* ---------- Tabellen ------------------------------------------------------ */
.hk-table-wrap { overflow-x: auto; }
.hk-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.hk-table th {
  font-family: var(--hk-font-head);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hk-grey-700);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 2px solid var(--hk-black);
  white-space: nowrap;
}
.hk-table td { padding: 15px 14px; border-bottom: var(--hk-border); vertical-align: middle; }
.hk-table tbody tr { transition: background var(--hk-transition); }
.hk-table tbody tr:hover { background: var(--hk-grey-050); }
.hk-table .is-right, .hk-table td.is-num, .hk-table th.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.hk-table .is-strong { font-weight: 700; }
.hk-table .is-number { font-family: var(--hk-font-head); font-weight: 600; font-size: 16px; letter-spacing: 0.04em; }
.hk-table a.is-row-link { color: inherit; }
.hk-table a.is-row-link:hover { color: var(--hk-red); }
.hk-table .hk-inline-form { display: flex; gap: 8px; align-items: center; }
.hk-table .hk-inline-form .hk-input { height: 38px; width: 110px; font-size: 14px; }
.hk-table.is-compact td { padding: 10px 12px; }
.hk-table .is-actions { text-align: right; white-space: nowrap; }

/* ---------- Status -------------------------------------------------------- */
.hk-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--hk-font-head); font-weight: 500; font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--hk-grey-900); white-space: nowrap;
}
.hk-status::before { content: ""; width: 8px; height: 8px; background: var(--hk-grey-300); }
.hk-status.is-new::before { background: var(--hk-grey-500); }
.hk-status.is-active::before { background: var(--hk-black); }
.hk-status.is-done::before { background: var(--hk-ok); }
.hk-status.is-review { color: var(--hk-red); }
.hk-status.is-review::before { background: var(--hk-red); }
.hk-status.is-cancelled { color: var(--hk-grey-500); text-decoration: line-through; }

/* Hinweise / Meldungen */
.hk-msg { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-left: 3px solid var(--hk-grey-300); background: var(--hk-grey-050); font-size: 14px; margin-bottom: 8px; }
.hk-msg .hk-msg-level { font-family: var(--hk-font-head); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; flex: 0 0 auto; padding-top: 2px; }
.hk-msg.is-info { border-color: var(--hk-grey-500); }
.hk-msg.is-warnung, .hk-msg.is-warning { border-color: #d98b00; background: #fff8ea; }
.hk-msg.is-warnung .hk-msg-level, .hk-msg.is-warning .hk-msg-level { color: #b06f00; }
.hk-msg.is-fehler, .hk-msg.is-error { border-color: var(--hk-red); background: #fff4f4; }
.hk-msg.is-fehler .hk-msg-level, .hk-msg.is-error .hk-msg-level { color: var(--hk-red); }
.hk-msg.is-success { border-color: var(--hk-ok); background: #f0f8f2; }
.hk-msg.is-success .hk-msg-level { color: var(--hk-ok); }

.hk-flashes { position: fixed; right: 24px; top: calc(var(--hk-header-h) + 16px); z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.hk-flash { background: var(--hk-black); color: var(--hk-white); padding: 14px 18px; font-size: 14px; box-shadow: var(--hk-shadow); display: flex; gap: 14px; align-items: flex-start; animation: hk-slide 220ms ease-out; }
.hk-flash.is-error { background: var(--hk-red); }
.hk-flash.is-success { border-left: 4px solid var(--hk-ok); }
.hk-flash button { background: none; border: 0; color: inherit; opacity: 0.7; cursor: pointer; font-size: 18px; line-height: 1; padding: 0; margin-left: auto; }
@keyframes hk-slide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.hk-tag { display: inline-block; font-family: var(--hk-font-head); font-weight: 500; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; padding: 4px 8px; border: 1px solid var(--hk-grey-300); color: var(--hk-grey-700); }
.hk-tag.is-red { border-color: var(--hk-red); color: var(--hk-red); }

/* ---------- Leerer Zustand ------------------------------------------------- */
.hk-empty { padding: var(--hk-space-6) var(--hk-space-4); text-align: center; border: 1px dashed var(--hk-grey-300); }
.hk-empty h3 { font-size: 30px; margin-bottom: 8px; }
.hk-empty p { color: var(--hk-grey-700); margin-bottom: var(--hk-space-3); }
.hk-empty.is-compact { padding: var(--hk-space-4); }
.hk-empty.is-compact h3 { font-size: 20px; }

/* ---------- Upload -------------------------------------------------------- */
.hk-dropzone {
  position: relative;
  border: 2px dashed var(--hk-grey-300);
  background: var(--hk-grey-050);
  padding: 64px 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--hk-transition), background var(--hk-transition);
}
.hk-dropzone:hover, .hk-dropzone.is-dragover { border-color: var(--hk-black); background: var(--hk-white); }
.hk-dropzone.has-file { border-style: solid; border-color: var(--hk-black); background: var(--hk-white); }
.hk-dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.hk-dropzone .hk-drop-title { font-size: clamp(28px, 3vw, 44px); margin-bottom: 8px; }
.hk-dropzone .hk-drop-text { color: var(--hk-grey-700); font-size: 16px; }
.hk-dropzone .hk-drop-meta { margin-top: 18px; font-size: 13px; color: var(--hk-grey-500); letter-spacing: 0.06em; }
.hk-dropzone .hk-drop-file { display: none; margin-top: 14px; font-family: var(--hk-font-head); font-size: 22px; font-weight: 600; letter-spacing: 0.02em; }
.hk-dropzone.has-file .hk-drop-file { display: block; }
.hk-dropzone.has-file .hk-drop-text { display: none; }

.hk-loading {
  position: fixed; inset: 0; background: rgba(255, 255, 255, 0.92); z-index: 80;
  display: none; align-items: center; justify-content: center; flex-direction: column; gap: 14px; text-align: center;
}
.hk-loading.is-visible { display: flex; }
.hk-loading h2 { font-size: 40px; }
.hk-loading .hk-bar { width: 220px; height: 3px; background: var(--hk-grey-200); overflow: hidden; margin-top: 10px; }
.hk-loading .hk-bar::after { content: ""; display: block; width: 40%; height: 100%; background: var(--hk-black); animation: hk-indeterminate 1.1s infinite ease-in-out; }
@keyframes hk-indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ---------- Kalkulationsansicht (3 Spalten) -------------------------------- */
.hk-calc { display: grid; grid-template-columns: 320px minmax(0, 1fr) 400px; gap: var(--hk-space-3); align-items: start; }
@media (max-width: 1400px) { .hk-calc { grid-template-columns: 300px minmax(0, 1fr); } .hk-calc > .hk-calc-right { grid-column: 1 / -1; } }
@media (max-width: 900px) { .hk-calc { grid-template-columns: 1fr; } }
.hk-viewer { position: relative; background: var(--hk-white); border: var(--hk-border); min-height: 560px; height: calc(100vh - var(--hk-header-h) - 200px); display: flex; flex-direction: column; }
.hk-viewer-toolbar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: var(--hk-border); flex-wrap: wrap; }
.hk-viewer-toolbar .hk-legend { display: flex; gap: 16px; margin-left: auto; font-size: 12.5px; color: var(--hk-grey-700); }
.hk-legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--hk-black); vertical-align: middle; margin-right: 6px; }
.hk-legend i.is-inner { border-top-color: var(--hk-grey-700); }
.hk-legend i.is-open { border-top-color: var(--hk-red); border-top-style: dashed; }
.hk-viewer-stage { flex: 1 1 auto; overflow: hidden; cursor: grab; background: linear-gradient(var(--hk-grey-100) 1px, transparent 1px) 0 0 / 40px 40px, linear-gradient(90deg, var(--hk-grey-100) 1px, transparent 1px) 0 0 / 40px 40px, var(--hk-white); }
.hk-viewer-stage.is-panning { cursor: grabbing; }
.hk-viewer-stage svg { width: 100%; height: 100%; display: block; }
.hk-viewer-stage svg .hk-svg-contour { transition: stroke var(--hk-transition); }
.hk-viewer-stage svg .hk-svg-contour:hover, .hk-viewer-stage svg .hk-svg-contour.is-selected { stroke: var(--hk-red) !important; }
.hk-viewer-dims { position: absolute; left: 14px; bottom: 12px; font-family: var(--hk-font-head); font-weight: 600; font-size: 18px; letter-spacing: 0.02em; background: rgba(255,255,255,0.85); padding: 4px 10px; pointer-events: none; }
.hk-tool { border: 1px solid var(--hk-grey-300); background: var(--hk-white); width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-family: var(--hk-font-head); font-weight: 600; font-size: 16px; transition: all var(--hk-transition); }
.hk-tool:hover { border-color: var(--hk-black); }
.hk-tool.is-on { background: var(--hk-black); color: var(--hk-white); border-color: var(--hk-black); }
.hk-tool.is-text { width: auto; padding: 0 12px; font-size: 12.5px; letter-spacing: 0.1em; }

/* Kalkulationspanel */
.hk-pricing .hk-price-lines { border-top: 2px solid var(--hk-black); }
.hk-pricing .hk-price-line { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: var(--hk-border); font-size: 14.5px; }
.hk-pricing .hk-price-line span:last-child { font-variant-numeric: tabular-nums; font-weight: 700; }
.hk-pricing .hk-price-line.is-sub { color: var(--hk-grey-700); font-size: 13.5px; }
.hk-pricing .hk-price-line.is-sub span:last-child { font-weight: 400; }
.hk-pricing .hk-price-line.is-total { border-bottom: 0; padding-top: 16px; }
.hk-pricing .hk-price-line.is-total span:first-child { font-family: var(--hk-font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 16px; }
.hk-price-total { background: var(--hk-black); color: var(--hk-white); padding: 24px 26px; margin: 20px -28px 0; }
.hk-price-total .hk-eyebrow { color: rgba(255,255,255,0.55); }
.hk-price-total .hk-price-big { font-family: var(--hk-font-head); font-weight: 600; font-size: 52px; line-height: 0.95; letter-spacing: -0.02em; margin-top: 6px; }
.hk-price-total .hk-price-unit { display: flex; justify-content: space-between; align-items: baseline; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.18); }
.hk-price-total .hk-price-unit strong { font-family: var(--hk-font-head); font-size: 28px; font-weight: 600; }
.hk-param-note { font-size: 12.5px; color: var(--hk-grey-500); margin-top: 14px; line-height: 1.5; }

/* ---------- Login --------------------------------------------------------- */
.hk-login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(420px, 0.8fr); }
.hk-login-brand { background: var(--hk-black); color: var(--hk-white); padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.hk-login-brand::after { content: ""; position: absolute; right: -120px; bottom: -160px; width: 520px; height: 520px; border: 1px solid rgba(255,255,255,0.08); transform: rotate(12deg); pointer-events: none; }
.hk-login-brand::before { content: ""; position: absolute; right: 60px; bottom: -80px; width: 320px; height: 320px; border: 1px solid rgba(255,255,255,0.12); transform: rotate(12deg); pointer-events: none; }
.hk-login-brand h1 { color: var(--hk-white); font-size: clamp(56px, 7vw, 120px); line-height: 0.88; letter-spacing: -0.03em; }
.hk-login-brand h1 span { display: block; color: rgba(255,255,255,0.5); font-size: 0.42em; letter-spacing: 0.02em; margin-top: 16px; line-height: 1.05; }
.hk-login-brand .hk-claim { font-size: 20px; color: rgba(255,255,255,0.72); margin-top: 32px; max-width: 46ch; }
.hk-login-brand .hk-claim strong { color: var(--hk-white); font-weight: 700; }
.hk-login-brand .hk-login-foot { font-size: 12.5px; color: rgba(255,255,255,0.45); letter-spacing: 0.08em; text-transform: uppercase; font-family: var(--hk-font-head); }
.hk-login-form { display: flex; align-items: center; justify-content: center; padding: 56px 48px; background: var(--hk-white); }
.hk-login-form form { width: 100%; max-width: 400px; }
.hk-login-form h2 { font-size: 40px; margin-bottom: 6px; }
.hk-login-form .hk-field { margin-bottom: 20px; }
.hk-login-form .btn-hk { margin-top: 8px; }
@media (max-width: 900px) { .hk-login { grid-template-columns: 1fr; } .hk-login-brand { padding: 40px 28px; min-height: 40vh; } .hk-login-form { padding: 40px 24px; } }

/* ---------- Dashboard ------------------------------------------------------- */
.hk-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--hk-space-4); align-items: end; margin-bottom: var(--hk-space-5); }
.hk-hero h1 span { display: block; }
.hk-hero .hk-sub { font-size: 18px; color: var(--hk-grey-700); margin-top: 16px; }
@media (max-width: 900px) { .hk-hero { grid-template-columns: 1fr; } }
.hk-list { list-style: none; margin: 0; padding: 0; }
.hk-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: var(--hk-border); font-size: 14.5px; }
.hk-list li .is-number { font-family: var(--hk-font-head); font-weight: 600; font-size: 16px; letter-spacing: 0.04em; }
.hk-list li .is-sub { color: var(--hk-grey-500); font-size: 13px; display: block; }
.hk-list li .is-value { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }

/* ---------- Fehlerseite ------------------------------------------------------ */
.hk-error { padding: var(--hk-space-6) 0; max-width: 720px; }
.hk-error .hk-error-code { font-family: var(--hk-font-head); font-weight: 600; font-size: 120px; line-height: 0.85; color: var(--hk-grey-200); }

/* ---------- Footer ---------------------------------------------------------- */
.hk-footer { border-top: var(--hk-border); padding: 22px 0; font-size: 12.5px; color: var(--hk-grey-500); }
.hk-footer .hk-container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Responsive Feinheiten -------------------------------------------- */
@media (max-width: 1200px) {
  :root { --hk-gutter: 32px; }
  .hk-header .hk-container { gap: var(--hk-space-3); }
  .hk-nav a { font-size: 14px; padding: 8px 9px; letter-spacing: 0.08em; }
}
@media (max-width: 900px) {
  :root { --hk-gutter: 20px; --hk-header-h: 64px; }
  .hk-brand-sub { display: none; }
  .hk-nav-toggle { display: inline-flex; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,0.35); color: #fff; width: 40px; height: 40px; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; }
  .hk-nav { display: none; position: absolute; left: 0; right: 0; top: var(--hk-header-h); background: var(--hk-black); flex-direction: column; align-items: stretch; padding: 12px 20px 20px; gap: 0; border-top: 1px solid rgba(255,255,255,0.12); }
  .hk-nav.is-open { display: flex; }
  .hk-nav a { padding: 12px 0; font-size: 16px; }
  .hk-nav a.is-active::after { left: 0; right: auto; width: 32px; }
  .hk-nav a.is-cta { margin: 6px 0 10px; }
  .hk-user { margin-left: 8px; }
  .hk-user span { display: none; }
  .hk-viewer { height: 60vh; min-height: 380px; }
  .hk-price-total .hk-price-big { font-size: 40px; }
  .hk-main { padding-top: var(--hk-space-4); }
  .hk-page-head { margin-bottom: var(--hk-space-4); }
}
@media print {
  .hk-header, .hk-footer, .hk-flashes, .hk-page-actions, .btn-hk { display: none !important; }
}

/* ---------- 3D-Viewer (Version 2) --------------------------------------------- */
.hk-viewer-stage.is-3d { position: relative; background: var(--hk-white); cursor: default; }
.hk-viewer-stage.is-3d canvas { display: block; width: 100% !important; height: 100% !important; }
.hk-viewer-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--hk-font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--hk-grey-500); pointer-events: none; }
.hk-panel.is-review { border-color: var(--hk-red); }
.hk-tree { list-style: none; margin: 0; padding: 0; }
.hk-tree li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 8px; border-bottom: var(--hk-border); cursor: pointer; font-size: 14px; }
.hk-tree li:hover { background: var(--hk-grey-050); }
.hk-tree li.is-selected { background: var(--hk-black); color: var(--hk-white); }
.hk-tree li.is-selected .hk-small { color: rgba(255,255,255,.7); }

/* ---------- Baugruppen (Version 4) --------------------------------------------- */
.hk-tree-node { padding-left: calc(8px + var(--depth, 0) * 16px) !important; }
.hk-tree-node.is-assembly { font-family: var(--hk-font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; cursor: default; }
.hk-tree-node.is-assembly:hover { background: transparent; }
.hk-tree-node.is-part::before { content: "├"; color: var(--hk-grey-300); margin-right: 8px; }
.hk-position { border: var(--hk-border); padding: 16px; margin-bottom: 12px; }
.hk-position.is-review { border-color: var(--hk-red); }
.hk-table tr.is-selected td { background: var(--hk-black); color: var(--hk-white); }
.hk-table tr.is-selected td .hk-small { color: rgba(255,255,255,.7); }

/* ---------- Verfahren-Kacheln (Neue Kalkulation) ------------------------------ */
.hk-tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.hk-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; border: 1px solid var(--hk-grey-300); background: var(--hk-white); cursor: pointer; transition: border-color var(--hk-transition), background var(--hk-transition), color var(--hk-transition); text-align: center; }
.hk-tile input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.hk-tile svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.hk-tile span { font-family: var(--hk-font-head); font-weight: 500; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hk-grey-700); }
.hk-tile:hover { border-color: var(--hk-black); }
.hk-tile:has(input:checked) { background: var(--hk-black); border-color: var(--hk-black); color: var(--hk-white); }
.hk-tile:has(input:checked) span { color: var(--hk-white); }
.hk-tile:has(input:focus-visible) { outline: 2px solid var(--hk-red); outline-offset: 2px; }

/* ---------- Neue Kalkulation: kompakt, ohne Scrollen bei 1920 x 1080 ------------ */
.hk-page-head.is-compact { margin-bottom: 20px; align-items: baseline; }
.hk-page-head.is-compact h1 { font-size: clamp(32px, 3vw, 48px); }
.hk-page-head.is-compact .hk-eyebrow { margin-bottom: 6px; }
.hk-page-head.is-compact .hk-sub { margin: 0; font-size: 15px; }
.hk-new-calc .hk-dropzone { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; padding: 36px 24px; }
.hk-new-calc .hk-dropzone .hk-drop-title { font-size: clamp(26px, 2.4vw, 36px); }
.hk-new-calc .hk-panel { padding: 22px 24px; }
.hk-new-calc .hk-panel-head { margin-bottom: 14px; }
.hk-new-calc .hk-form-grid { gap: 12px 20px; }
.hk-new-calc .hk-field { gap: 5px; }
.hk-new-calc .hk-input, .hk-new-calc .hk-select { height: 42px; }
.hk-new-calc .hk-tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.hk-new-calc .hk-tile { padding: 8px 4px 7px; gap: 4px; }
.hk-new-calc .hk-tile svg { width: 34px; height: 34px; }
.hk-new-calc .hk-tile span { font-size: 10.5px; letter-spacing: 0.06em; }
.hk-new-calc .hk-help { font-size: 12px; }
@media (max-width: 1400px) { .hk-new-calc .hk-tile svg { width: 28px; height: 28px; } .hk-new-calc .hk-tile span { font-size: 9.5px; letter-spacing: 0.04em; } }
@media (max-width: 600px) { .hk-new-calc .hk-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 991px) { .hk-new-calc .hk-dropzone { min-height: 220px; } }

.hk-new-calc { margin-bottom: 0; }
main.hk-main:has(.hk-new-calc) { padding-bottom: var(--hk-space-4); }

/* ---------- Kalkulationsansicht: kompakt ---------------------------------------- */
main.hk-main:has(.hk-calc.is-compact) { padding-top: 24px; padding-bottom: 24px; }
.hk-calc-head { margin-bottom: 14px; }
.hk-page-head.hk-calc-head h1 { font-size: 26px; line-height: 1.1; }
.hk-calc-head .hk-calc-title { font-family: var(--hk-font-body); font-weight: 400; color: var(--hk-grey-700); letter-spacing: 0; text-transform: none; font-size: 15px; margin-left: 10px; }
.hk-calc-head .hk-eyebrow { font-size: 11px; margin-bottom: 2px; }
.hk-calc-head { margin-bottom: 10px; }
.hk-calc-head .hk-sub { margin: 0; }
.hk-calc-head .hk-page-actions .btn-hk { padding: 11px 18px; font-size: 13.5px; }
.hk-calc.is-compact { grid-template-columns: 300px minmax(0, 1fr) 380px; gap: 16px; }
.hk-calc.is-compact .hk-panel { padding: 16px 18px; }
.hk-calc.is-compact .hk-panel + .hk-panel { margin-top: 14px; }
.hk-calc.is-compact .hk-panel-head { margin-bottom: 10px; }
.hk-calc.is-compact .hk-panel-head h3 { font-size: 17px; }
.hk-calc.is-compact .hk-dl dt, .hk-calc.is-compact .hk-dl dd { padding: 6px 0; font-size: 13.5px; }
.hk-calc.is-compact .hk-dl dt { font-size: 11.5px; }
.hk-calc.is-compact .hk-table th { padding: 8px 10px; font-size: 11.5px; }
.hk-calc.is-compact .hk-table.is-compact td { padding: 6px 10px; font-size: 13px; }
.hk-calc.is-compact .hk-viewer { height: calc(100vh - var(--hk-header-h) - 150px); min-height: 480px; }
.hk-calc.is-compact .hk-viewer-toolbar { padding: 6px 10px; }
.hk-calc.is-compact .hk-tool { width: 32px; height: 32px; font-size: 14px; }
.hk-calc.is-compact .hk-pricing .hk-form-grid { gap: 10px 14px !important; }
.hk-calc.is-compact .hk-pricing .hk-input, .hk-calc.is-compact .hk-pricing .hk-select { height: 38px; font-size: 14px; }
.hk-calc.is-compact .hk-pricing hr { margin: 12px 0 !important; }
.hk-calc.is-compact .hk-price-line { padding: 6px 0; font-size: 13.5px; }
.hk-calc.is-compact .hk-price-line.is-total { padding-top: 10px; }
.hk-calc.is-compact .hk-price-total { padding: 16px 20px; margin: 14px -18px 0; }
.hk-calc.is-compact .hk-price-total .hk-price-big { font-size: 40px; }
.hk-calc.is-compact .hk-price-total .hk-price-unit { margin-top: 10px; padding-top: 8px; }
.hk-calc.is-compact .hk-price-total .hk-price-unit strong { font-size: 24px; }
.hk-calc.is-compact .hk-param-note { margin-top: 10px; font-size: 11.5px; line-height: 1.4; }
.hk-calc.is-compact .hk-msg { padding: 8px 10px; font-size: 13px; }
.hk-calc.is-compact .hk-eyebrow { font-size: 11.5px; }

/* Einklappbare Bereiche + Fußzeile in der Kalkulationsansicht ausblenden */
body:has(.hk-calc.is-compact) .hk-footer { display: none; }
.hk-details summary { cursor: pointer; list-style: none; font-family: var(--hk-font-head); font-weight: 500; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--hk-grey-700); display: flex; align-items: center; gap: 8px; }
.hk-details summary::-webkit-details-marker { display: none; }
.hk-details summary::before { content: "+"; font-weight: 600; width: 14px; }
.hk-details[open] summary::before { content: "–"; }
.hk-details summary h3 { font-size: 17px; }
.hk-details.is-panel summary { margin: 0; }
.hk-details.is-note { margin-top: 10px; }
.hk-details.is-note .hk-param-note { margin-top: 6px; }
.hk-details { margin-top: 12px; }
.hk-scroll-box { max-height: 170px; overflow-y: auto; }
.hk-calc.is-compact .hk-dl dt, .hk-calc.is-compact .hk-dl dd { padding: 5px 0; }
.hk-calc.is-compact .hk-price-line { padding: 5px 0; }
.hk-calc.is-compact .hk-price-total { padding: 14px 20px; }
.hk-calc.is-compact .hk-price-total .hk-price-big { font-size: 36px; }
main.hk-main:has(.hk-calc.is-compact) { min-height: 0; padding-bottom: 16px; }
.hk-calc-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.hk-calc-head .hk-calc-status { display: flex; gap: 12px; justify-content: flex-end; }
.hk-calc-head .hk-calc-status .hk-status { font-size: 11.5px; }
.hk-calc-head { flex-wrap: nowrap; }
.hk-calc.is-compact .hk-tool.is-text { width: auto; padding: 0 10px; font-size: 12px; }
.hk-details.is-note { margin-top: 16px; }
.hk-price-total + .hk-details.is-note, .hk-price-total + .hk-param-note { margin-top: 16px; }
/* Panelköpfe: Statusanzeigen dürfen umbrechen statt herauszulaufen */
.hk-panel-head { flex-wrap: wrap; row-gap: 6px; }
.hk-panel-head .hk-status, .hk-panel-head .hk-tag { white-space: normal; line-height: 1.25; }
.hk-panel-head .hk-status::before { flex: 0 0 auto; }

/* ---------- Kalkulationsansicht: Spalten scrollen unabhängig, Modell bleibt stehen ------ */
@media (min-width: 1401px) {
  .hk-calc.is-compact > .hk-calc-left, .hk-calc.is-compact > .hk-calc-right {
    position: sticky; top: calc(var(--hk-header-h) + 10px);
    max-height: calc(100vh - var(--hk-header-h) - 24px);
    overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: var(--hk-grey-300) transparent;
    padding-right: 2px;
  }
  .hk-calc.is-compact > .hk-viewer { position: sticky; top: calc(var(--hk-header-h) + 10px); }
}
.hk-tree.hk-scroll-box { max-height: 240px; }

/* ---------- Baugruppen: Positionsliste links ------------------------------------- */
.hk-pos-list { list-style: none; margin: 0; padding: 0; }
.hk-pos-row { position: relative; padding: 10px 8px 8px; border-bottom: var(--hk-border); cursor: pointer; transition: background var(--hk-transition); }
.hk-pos-row:hover { background: var(--hk-grey-050); }
.hk-pos-row.is-selected { background: var(--hk-black); color: var(--hk-white); }
.hk-pos-row.is-selected .hk-small, .hk-pos-row.is-selected .hk-pos-sub { color: rgba(255,255,255,.75); }
.hk-pos-row.is-review { box-shadow: inset 3px 0 0 var(--hk-red); }
.hk-pos-main { display: flex; align-items: baseline; gap: 10px; }
.hk-pos-no { font-family: var(--hk-font-head); font-weight: 600; font-size: 13px; color: var(--hk-grey-500); width: 18px; flex: 0 0 auto; }
.hk-pos-row.is-selected .hk-pos-no { color: rgba(255,255,255,.6); }
.hk-pos-name { flex: 1 1 auto; font-weight: 700; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.hk-pos-price { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; }
.hk-pos-sub { display: flex; justify-content: space-between; gap: 10px; padding-left: 28px; font-size: 12px; color: var(--hk-grey-700); margin-top: 2px; }
.hk-pos-toggle { margin: 4px 0 0 28px; background: none; border: 0; padding: 0; font-family: var(--hk-font-head); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hk-grey-500); cursor: pointer; }
.hk-pos-row.is-selected .hk-pos-toggle { color: rgba(255,255,255,.7); }
.hk-pos-toggle:hover { color: var(--hk-red); }
.hk-pos-instances { list-style: none; margin: 6px 0 0 28px; padding: 0; border-left: 2px solid var(--hk-grey-200); }
.hk-pos-instance { padding: 4px 10px; font-size: 12.5px; color: var(--hk-grey-700); cursor: pointer; }
.hk-pos-instance:hover { color: var(--hk-black); }
.hk-pos-instance.is-selected { color: var(--hk-red); font-weight: 700; }
.hk-pos-row.is-selected .hk-pos-instance { color: rgba(255,255,255,.8); }
.hk-pos-row.is-selected .hk-pos-instance.is-selected { color: #ff8a90; }

/* Hinweise der Baugruppe: einklappbar, Klick wählt Bauteil */
.hk-details.is-msgs { margin: 0 0 12px; }
.hk-details.is-msgs summary { padding: 8px 10px; background: var(--hk-grey-050); border-left: 3px solid var(--hk-grey-300); }
.hk-details.is-msgs.has-warning summary { background: #fff8ea; border-left-color: #d98b00; color: #b06f00; }
.hk-details.is-msgs .hk-msg-list { margin-top: 8px; }
.hk-msg.is-link { cursor: pointer; }
.hk-msg.is-link:hover { background: #ffefd0; }
.hk-msg.is-link.is-selected { outline: 2px solid var(--hk-red); outline-offset: -2px; }

.hk-pos-row.is-selected.is-partial .hk-pos-instance.is-selected { background: var(--hk-red); color: var(--hk-white); }
.hk-pos-row.is-selected .hk-pos-instance { color: rgba(255,255,255,.85); }

.hk-calc-left .hk-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.hk-calc-left .hk-tile { padding: 8px 4px 7px; gap: 4px; }
.hk-calc-left .hk-tile svg { width: 30px; height: 30px; }
.hk-calc-left .hk-tile span { font-size: 11px; }

.hk-pos-type { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.hk-pos-type .hk-select.is-sm { padding: 4px 28px 4px 8px; font-size: 12px; min-height: 0; }
.hk-pos-row.is-selected .hk-pos-type label { color: rgba(255,255,255,.75); }

@media (max-width: 1500px) { .hk-nav a { padding-left: 9px; padding-right: 9px; letter-spacing: 0.08em; } }

/* Schnellteil: Grundform-Kacheln */
.hk-tiles-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hk-tiles-quick .hk-tile svg { width: 40px; height: 40px; }
.hk-new-calc .hk-tiles-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Schnellteil: Live-Vorschau und Ausschnitt-Editor */
.hk-quick-preview { position: relative; height: 260px; border: var(--hk-border); background: var(--hk-white); overflow: hidden; }
.hk-quick-preview canvas { display: block; width: 100% !important; height: 100% !important; }
.hk-quick-reset { position: absolute; right: 8px; top: 8px; z-index: 2; }
.hk-features-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.hk-feature-row { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; padding: 8px; background: var(--hk-grey-050); border-left: 3px solid var(--hk-grey-300); }
.hk-feature-kind { font-family: var(--hk-font-head); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hk-grey-700); min-width: 92px; padding-bottom: 8px; }
.hk-feature-field { display: flex; flex-direction: column; gap: 2px; width: 74px; }
.hk-feature-field span { font-size: 11px; color: var(--hk-grey-700); }
.hk-feature-field .hk-input { padding: 5px 6px; font-size: 13px; min-height: 0; }
.hk-features-add { display: flex; gap: 6px; flex-wrap: wrap; }

.hk-pos-remark { display: flex; gap: 6px; align-items: center; flex: 1 1 100%; margin-top: 6px; }
.hk-pos-remark .hk-input { padding: 5px 8px; font-size: 12px; min-height: 0; }
/* Positionszeile: Verfahrensauswahl ordentlich breit, Bemerkungsfeld nur bei „Sonstiges“/„Kaufteil“ sichtbar */
.hk-pos-type { flex-wrap: wrap; }
.hk-pos-type .hk-select.is-sm { min-width: 170px; flex: 0 0 auto; }
.hk-pos-remark[hidden] { display: none !important; }
.hk-pos-row.is-selected .hk-pos-type label { color: rgba(255,255,255,.85); }

/* Bestelldetail: Zeichnung als Viewer in fester Höhe */
.hk-order-viewer .hk-viewer { min-height: 0; height: 520px; }
