/* KI Hub section — visual pass v2 (design-export port) */

/* ── Eyebrow label ──────────────────────────────────────────── */
.kihub-eyebrow {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}

/* ── KPI row: 3-column grid on hub ─────────────────────────── */
.kihub-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
@media (max-width: 900px) { .kihub-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .kihub-kpi-grid { grid-template-columns: 1fr; } }

/* KPI card inner layout */
.kihub-kpi {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: calc(var(--pad-card) * var(--d));
}
.kihub-kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.kihub-kpi-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.kihub-kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-chip);
  display: grid;
  place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  /* fallback for browsers without color-mix */
  background: var(--hover);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  flex: 0 0 34px;
}
.kihub-kpi-value {
  font-size: var(--fs-display);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--ink);
}
.kihub-kpi-sub {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  font-weight: 500;
}

/* ── Hero scan card ─────────────────────────────────────────── */
.kihub-hero-card {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
  background: color-mix(in srgb, var(--accent) 6%, var(--card));
  /* fallback */
  background: var(--card);
  background: color-mix(in srgb, var(--accent) 6%, var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: calc(var(--pad-card) * var(--d));
  box-shadow: var(--shadow);
}
.kihub-hero-left {
  flex: 1 1 300px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.kihub-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  /* fallback */
  background: var(--hover);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: var(--r-pill);
  padding: 4px 11px 4px 8px;
  width: fit-content;
  margin-bottom: 12px;
}
.kihub-hero-title {
  font-size: var(--fs-h1);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--ink);
}
.kihub-hero-desc {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0 0 20px;
  max-width: 400px;
}
.kihub-steps {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-bottom: 22px;
}
.kihub-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.kihub-step-n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: var(--fs-xs);
  font-weight: 800;
  flex: 0 0 26px;
  margin-top: 1px;
}
.kihub-step-body {}
.kihub-step-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink);
}
.kihub-step-sub {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  margin-top: 1px;
  line-height: 1.4;
}

/* right: decorative preview placeholder */
.kihub-hero-right {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 280px;
}
.kihub-hero-preview {
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--hover);
  background: color-mix(in srgb, var(--accent) 7%, var(--hover));
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--accent);
  opacity: .6;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ── Tile grids ─────────────────────────────────────────────── */
.kihub-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}
@media (max-width: 1200px) { .kihub-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .kihub-tiles { grid-template-columns: 1fr; } }

/* ── Tool tile card ─────────────────────────────────────────── */
.kihub-tile {
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: calc(var(--pad-card) * var(--d));
}
.kihub-tile:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.kihub-tile.kihub-soon {
  opacity: .6;
  cursor: default;
  pointer-events: none;
}
.kihub-tile.kihub-soon:hover {
  transform: none;
  box-shadow: var(--shadow);
  border-color: var(--line);
}

/* tile top row: icon + badge */
.kihub-tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

/* icon container */
.kihub-tic {
  width: 42px;
  height: 42px;
  border-radius: var(--r-chip);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  /* fallback */
  background: var(--hover);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex: 0 0 42px;
}

/* tile name + desc */
.kihub-tile-name {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--ink);
  flex: 1;
}
.kihub-tile-desc {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  line-height: 1.5;
  margin: 0;
}

/* format chips row */
.kihub-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 4px;
}
.kihub-fmt {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  background: transparent;
  white-space: nowrap;
}

/* tile footer row: cost + arrow */
.kihub-tile-foot {
  display: flex;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  gap: 8px;
}
.kihub-cost {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-weight: 600;
  flex: 1;
}
.kihub-tile-foot .kihub-arrow {
  color: var(--accent);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

/* "Beliebt" badge pill */
.kihub-badge-popular {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  /* fallback */
  background: var(--hover);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  border-radius: var(--r-pill);
  padding: 2px 9px;
  white-space: nowrap;
}

/* "Bald" chip */
.kihub-badge-soon {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-3);
  background: var(--hover);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  padding: 2px 9px;
  white-space: nowrap;
}

/* ── Section headers (eyebrow + h2) ────────────────────────── */
.kihub-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.kihub-section-head-left {}
.kihub-section-title {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 0;
  color: var(--ink);
}
.kihub-section-sub {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  margin-top: 3px;
  font-weight: 500;
}

/* ── Recent results (history table) ────────────────────────── */
.kihub-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 14px;
}
.kihub-recent-title {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 0;
}

/* ── Helloha teaser card ────────────────────────────────────── */
.kihub-helloha {
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  /* fallback */
  border-color: var(--line);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--accent) 5%, var(--card));
  /* fallback */
  background: var(--card);
  background: color-mix(in srgb, var(--accent) 5%, var(--card));
  border-radius: var(--r-card);
  padding: calc(var(--pad-card) * var(--d));
  box-shadow: var(--shadow);
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.kihub-helloha-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-chip);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  /* fallback */
  background: var(--hover);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex: 0 0 42px;
}
.kihub-helloha-body {
  flex: 1;
  min-width: 0;
}
.kihub-helloha-tag {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.kihub-helloha-title {
  font-size: var(--fs-h2);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0 0 5px;
}
.kihub-helloha-desc {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0;
}

/* ── Balance pill (in topbar) ──────────────────────────────── */
.kihub-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  /* fallback */
  background: var(--hover);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  border: none;
}
.kihub-balance a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

/* ── Studio view ────────────────────────────────────────────── */
.kihub-input {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--r-ctl);
  background: var(--field);
  color: var(--ink);
  padding: 10px 13px;
  font: inherit;
  font-size: var(--fs-body);
  margin: 10px 0;
  resize: vertical;
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.kihub-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.kihub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
/* override chip.active color for inline style chips */
.kihub-chips .chip.active,
.kihub-chips .chip.kihub-style.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  /* fallback */
  background: var(--hover);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border-color: var(--accent);
}
.kihub-imgs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 640px) { .kihub-imgs { grid-template-columns: 1fr; } }
.kihub-img {
  width: 100%;
  border-radius: var(--r-chip);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.kihub-img-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kihub-text-out {
  white-space: pre-wrap;
  margin-bottom: 10px;
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  padding: 12px 14px;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--ink-2);
}

/* back breadcrumb row */
.kihub-back-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

/* generate button — full-accent, full-width when standalone */
#kihub-generate {
  min-width: 160px;
}

/* ── Scan view ──────────────────────────────────────────────── */
.kihub-scan-tbl input,
.kihub-scan-tbl select {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  padding: 5px 7px;
  font: inherit;
  max-width: 100%;
  outline: 0;
  transition: border-color .14s;
}
.kihub-scan-tbl input:focus,
.kihub-scan-tbl select:focus {
  border-color: var(--accent);
}
.kihub-scan-tbl .ksr-name { width: 100%; min-width: 140px; }
.kihub-price-cell { white-space: nowrap; font-weight: 700; }
.kihub-price-cell .ksr-price { width: 84px; text-align: right; font-weight: 700; }

/* ── Chat view ──────────────────────────────────────────────── */
.kihub-chat-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--gap);
}
@media (max-width: 900px) { .kihub-chat-wrap { grid-template-columns: 1fr; } }
.kihub-chat-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.kihub-chat-msgs {
  min-height: 280px;
  max-height: 55vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  padding: 4px 0;
}
/* chat bubbles */
.kihub-msg {
  background: var(--hover);
  border-radius: 12px 12px 12px 3px;
  padding: 10px 13px;
  max-width: 86%;
  white-space: pre-wrap;
  font-size: var(--fs-sm);
  line-height: 1.55;
  align-self: flex-start;
  border: 1px solid var(--line);
}
.kihub-msg-user {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  border-radius: 12px 12px 3px 12px;
  align-self: flex-end;
}
/* pending "…" bubble */
.kihub-msg-pending {
  opacity: .6;
}
/* input row */
.kihub-chat-inputrow {
  display: flex;
  gap: 8px;
}
.kihub-chat-inputrow input {
  flex: 1;
  border: 1px solid var(--line-2);
  border-radius: var(--r-ctl);
  background: var(--field);
  color: var(--ink);
  padding: 8px 12px;
  font: inherit;
  font-size: var(--fs-body);
  outline: 0;
  transition: border-color .14s, box-shadow .14s;
}
.kihub-chat-inputrow input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

/* ── Back button (breadcrumb style) ────────────────────────── */
.kihub-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-3);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  transition: color .14s;
}
.kihub-back-btn:hover { color: var(--ink); }

/* ── KI-Guthaben card ───────────────────────────────────────── */
.credit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.credit-title {
  font-size: var(--fs-lg, 17px);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}
.credit-subtitle {
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.credit-topup-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--fs-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .14s;
  flex-shrink: 0;
}
.credit-topup-btn:hover { opacity: .82; }
.credit-topup-btn:disabled { opacity: .45; cursor: default; }

/* Balance row */
.credit-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.credit-balance-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.credit-balance-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.credit-balance-unit {
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.credit-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.credit-badge-ok {
  background: color-mix(in srgb, var(--success, #22c55e) 12%, transparent);
  color: color-mix(in srgb, var(--success, #22c55e) 80%, var(--ink));
}
.credit-badge-warn {
  background: color-mix(in srgb, var(--warn, #f59e0b) 12%, transparent);
  color: color-mix(in srgb, var(--warn, #f59e0b) 70%, var(--ink));
}

/* Progress bar */
.credit-bar-track {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: var(--line);
  margin-bottom: 24px;
}
.credit-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
  transition: width .3s ease;
  max-width: 100%;
}
/* threshold marker knob (design: small dot on the bar) */
.credit-bar-knob {
  position: absolute;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--card, #fff);
  box-shadow: 0 0 0 1px var(--line);
  transform: translate(-50%, -50%);
}

/* Pack cards grid */
.credit-packs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 500px) {
  .credit-packs-grid { grid-template-columns: 1fr; }
}
.credit-pack-card {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: var(--r-card, 10px);
  padding: 14px 12px 12px;
  cursor: pointer;
  background: var(--card);
  transition: border-color .14s, background .14s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.credit-pack-card:hover { border-color: var(--ink-3); }
.credit-pack-card.credit-pack-selected {
  border: 2px solid var(--ink);
  background: color-mix(in srgb, var(--ink) 4%, var(--card));
}
.credit-pack-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}
.credit-pack-unit {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.credit-pack-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.credit-pack-price {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
}
.credit-pack-bonus {
  font-size: 12px;
  font-weight: 700;
  color: var(--success, #15875a);
}
.credit-pack-beliebt {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--bg);
}

/* Divider */
.credit-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 4px 0 18px;
}

/* Auto-topup row */
.credit-autotopup-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.credit-autotopup-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}
.credit-autotopup-label {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}
.credit-autotopup-sub {
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.credit-autotopup-right {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.credit-threshold-group {
  display: flex;
  align-items: center;
  gap: 9px;
}
.credit-threshold-group .mlabel {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-3);
  text-transform: none;
  letter-spacing: 0;
}

/* ── Markdown renderer (KI Hub chat) ────────────────────────── */
.kihub-md-tbl {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-sm);
  margin: 8px 0;
}
.kihub-md-tbl th,
.kihub-md-tbl td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
}
.kihub-md-tbl th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: color-mix(in srgb, var(--ink) 4%, var(--card));
}
.kihub-md-h {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--ink);
  margin: 10px 0 4px;
  padding: 0;
}
.kihub-md-hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 10px 0;
}
.kihub-msg ol,
.kihub-msg ul {
  padding-left: 18px;
  margin: 6px 0;
}
.kihub-msg li { margin: 2px 0; }
/* Allow tables to scroll on narrow bubbles */
.kihub-msg { max-width: 100%; overflow-x: auto; }

/* ── Per-view section header (design LEVIAPAY-Dashboard-6) ──── */
.kihub-hd-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.kihub-hd-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--card, #fff);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .14s, color .14s, background .14s;
}
.kihub-hd-back:hover {
  border-color: var(--ink-3);
  color: var(--ink);
  background: var(--hover);
}
.kihub-hd-text {}

/* ── Studio: two-panel Eingabe / Ergebnis layout ────────────── */
.kihub-studio-wrap {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: var(--gap);
  align-items: start;
  margin-top: 12px;
}
@media (max-width: 980px) { .kihub-studio-wrap { grid-template-columns: 1fr; } }
.kihub-panel-title {
  font-size: var(--fs-lg, 17px);
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}
.kihub-panel-sub {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  margin: 3px 0 14px;
}
.kihub-field-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-2);
  margin-top: 10px;
}
.kihub-studio-input .kihub-input { margin: 6px 0 4px; }
.kihub-studio-input .kihub-chips { margin: 6px 0 4px; }
.kihub-studio-input #kihub-generate { margin-top: 14px; }

/* Ergebnis panel */
.kihub-result-panel { min-height: 420px; }
.kihub-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.kihub-result-badge {
  font-size: var(--fs-xs, 12px);
  font-weight: 700;
  color: var(--ink-2);
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  white-space: nowrap;
}
.kihub-result-body {}
/* hatched empty/pending state (design: striped placeholder) */
.kihub-result-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 330px;
  border-radius: var(--r-chip);
  border: 1px solid var(--line);
  background: repeating-linear-gradient(
    -45deg,
    var(--hover),
    var(--hover) 10px,
    transparent 10px,
    transparent 20px
  );
}
.kihub-result-empty-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-xs, 12px);
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-3);
  background: var(--card, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 13px;
  box-shadow: var(--shadow);
  max-width: 85%;
  text-align: center;
}

/* Social result: image left, caption right (design 08) */
.kihub-social-split {
  display: grid;
  grid-template-columns: minmax(180px, 320px) 1fr;
  gap: var(--gap);
  align-items: start;
}
@media (max-width: 760px) { .kihub-social-split { grid-template-columns: 1fr; } }
.kihub-imgs-1 { grid-template-columns: 1fr; }
.kihub-social-caption {}

/* Menucard export action rows (design 03) */
.kihub-action-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.kihub-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  padding: 12px 14px;
  cursor: pointer;
  background: var(--card, #fff);
  transition: border-color .14s, background .14s;
}
.kihub-action-row:hover {
  border-color: var(--ink-3);
  background: var(--hover);
}
.kihub-action-row.kihub-action-disabled {
  cursor: default;
  opacity: .62;
}
.kihub-action-row.kihub-action-disabled:hover {
  border-color: var(--line);
  background: var(--card, #fff);
}
.kihub-action-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--hover);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.kihub-action-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.kihub-action-txt strong {
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--ink);
}
.kihub-action-txt span {
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.kihub-action-row .kihub-arrow { color: var(--ink-3); }

/* ── Hub: hero right composition (design 01) ────────────────── */
.kihub-hero-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.kihub-hero-photo { flex: 0 0 130px; }
.kihub-hero-mini-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 7px;
}
.kihub-hero-dropzone {
  height: 170px;
  border: 1.5px dashed var(--line-2);
  border-radius: 10px;
  background: var(--card, #fff);
}
.kihub-hero-menuimg {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.kihub-hero-arrow {
  color: var(--ink-3);
  flex-shrink: 0;
  margin-top: 18px;
}
.kihub-hero-products { flex: 1; min-width: 240px; }
.kihub-hero-prodcard {
  background: var(--card, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.kihub-hero-prodhead {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--ink);
}
.kihub-hero-prodhead strong { font-weight: 700; flex: 1; }
.kihub-hero-new {
  font-size: 11px;
  font-weight: 700;
  background: var(--ink);
  color: var(--card, #fff);
  border-radius: 6px;
  padding: 2px 8px;
}
.kihub-hero-prod {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border-bottom: 1px solid var(--line);
}
.kihub-hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kihub-hero-prod-txt {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.kihub-hero-prod-txt strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kihub-hero-prod-txt span {
  font-size: 11px;
  color: var(--ink-3);
}
.kihub-hero-price {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.kihub-hero-more {
  padding: 8px 13px;
  font-size: 11.5px;
  color: var(--ink-3);
}
@media (max-width: 1100px) {
  .kihub-hero-right { display: none; }
}

/* "Aktiv" tile badge (design: dot + label) */
.kihub-badge-active {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
}
.kihub-badge-active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2fae6b;
}
.kihub-create-link {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink);
}

/* ── Helloha banner, large design variant ───────────────────── */
.kihub-helloha-lg {
  display: block;
  padding: 22px 24px;
}
.kihub-helloha-lg .kihub-helloha-body { max-width: none; }
.kihub-helloha-lg { position: relative; }
.kihub-helloha-lg .kihub-helloha-cta {
  position: absolute;
  top: 22px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
@media (max-width: 800px) {
  .kihub-helloha-lg .kihub-helloha-cta {
    position: static;
    flex-direction: row;
    align-items: center;
    margin-top: 12px;
  }
}
.kihub-helloha-lg .kihub-helloha-desc { max-width: 62ch; }
.kihub-helloha-rabatt {
  background: color-mix(in srgb, #2fae6b 12%, transparent);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  margin: 10px 0;
  max-width: 62ch;
}
.kihub-helloha-rabatt strong { color: var(--ink); }
.kihub-helloha-btn {
  background: #0d6e5f;
  color: #fff;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}
.kihub-helloha-btn:hover { background: #0a5a4e; color: #fff; }
.kihub-helloha-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  padding: 0;
}
.kihub-helloha-toggle:hover { color: var(--ink); }
.kihub-helloha-details {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  margin-top: 10px;
  max-width: 62ch;
}

/* ── Scan: step cards + review grid (design 02) ─────────────── */
.kihub-scan-step-title {
  font-size: var(--fs-lg, 17px);
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}
.kihub-scan-filecard {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 12px;
}
.kihub-scan-thumb {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.kihub-scan-fileinfo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}
.kihub-scan-filename {
  font-weight: 700;
  color: var(--ink);
  font-size: var(--fs-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.kihub-scan-filemeta {
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.kihub-scan-other {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 0;
  margin-top: 4px;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
}
.kihub-scan-other:hover { color: var(--ink); }
.kihub-scan-other:disabled { opacity: .5; cursor: default; }

.kihub-cat-cell {
  white-space: nowrap;
}
.kihub-cat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
}
.ksr-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  transition: background .13s, color .13s;
}
.ksr-del:hover { background: var(--hover); color: #d5484f; }
.kihub-scan-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}
.kihub-scan-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card, #fff);
  color: var(--ink-3);
  font-size: var(--fs-sm);
  padding: 12px 15px;
  margin-top: 12px;
}
.kihub-scan-hint strong { color: var(--ink-2); }

/* ── Hub gallery "Zuletzt erstellt" + history table (design 01/11) ── */
.kihub-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .kihub-gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .kihub-gallery { grid-template-columns: 1fr; } }
.kihub-gal-card { min-width: 0; }
.kihub-gal-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 128px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: repeating-linear-gradient(
    -45deg,
    var(--hover),
    var(--hover) 9px,
    transparent 9px,
    transparent 18px
  );
  margin-bottom: 8px;
}
.kihub-gal-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--ink-3);
  background: var(--card, #fff);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 9px;
}
.kihub-gal-name {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kihub-gal-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.kihub-gal-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  transition: background .13s, color .13s;
}
.kihub-gal-copy:hover { background: var(--hover); color: var(--ink); }
.kihub-history-name { font-weight: 700; color: var(--ink); }
.kihub-history-action { text-align: right; }

/* ── Chat sidebar list (design 09) ──────────────────────────── */
.kihub-chat-list-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 10px 0 6px;
}
.kihub-chat-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 9px;
  background: none;
  padding: 8px 9px;
  cursor: pointer;
  transition: background .13s;
}
.kihub-chat-item:hover { background: var(--hover); }
.kihub-chat-item.active { background: var(--hover); }
.kihub-chat-item-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card, #fff);
  color: var(--ink-3);
}
.kihub-chat-item-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.kihub-chat-item-txt strong {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kihub-chat-item-txt span {
  font-size: 11px;
  color: var(--ink-3);
}

/* overrides for the legacy hero-right sizing (old preview box rules above) */
.kihub-hero-right {
  flex: 1 1 440px;
  min-width: 0;
  max-width: none;
}
.kihub-hero-products { min-width: 0; }
.kihub-hero-left .lp-btn { align-self: flex-start; }

/* ── Design pass: scan-grid controls (black checkmarks, design 02) ── */
.kihub-scan-tbl input,
.kihub-scan-tbl select {
  padding: 9px 12px;
  border-radius: 10px;
  border-color: var(--line-2);
  font-size: var(--fs-body);
}
.kihub-scan-tbl select { cursor: pointer; }
.kihub-price-cell .ksr-price { width: 92px; }
.kihub-scan-tbl .ksr-inc {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1.5px solid var(--line-2);
  border-radius: 7px;
  background: var(--card, #fff);
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  transition: background .13s, border-color .13s;
}
.kihub-scan-tbl .ksr-inc:checked {
  background: var(--solid, #111);
  border-color: var(--solid, #111);
}
.kihub-scan-tbl .ksr-inc:checked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><path d="M4.5 12.8 9.8 18 19.5 6.6"/></svg>')
    no-repeat center / 13px;
}

/* ── Design pass: tool pages fill the viewport (all tool designs) ── */
.kihub-studio-wrap {
  align-items: stretch;
  min-height: max(540px, calc(100vh - 265px));
}
.kihub-result-panel {
  display: flex;
  flex-direction: column;
}
.kihub-result-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.kihub-result-body > .kihub-imgs,
.kihub-result-body > .kihub-social-split,
.kihub-result-body > .kihub-text-out { flex: 0 0 auto; }
.kihub-result-empty { flex: 1; }
.kihub-chat-wrap { min-height: max(540px, calc(100vh - 265px)); }
.kihub-chat-msgs {
  flex: 1;
  max-height: none;
  min-height: 0;
}
@media (max-width: 980px) {
  .kihub-studio-wrap, .kihub-chat-wrap { min-height: 0; }
  .kihub-chat-msgs { max-height: 55vh; }
}
/* the tile-foot rule gives .kihub-cost flex:1 — neutralize inside chat */
.kihub-chat-main .kihub-cost { flex: 0 0 auto; }
