/* ============================================================================
   Kundenportal — merged review shells (Surface A / B / C)
   Review chrome only. Deliberately NOT the product design system: the chrome is
   graphite + mono, the product prototypes inside are light + Domain DS, so a
   reviewer can never mistake scaffolding for product.
   Adapted from the design project's app-shell.css (the merged-shell engine that
   lived inside Claude Design). Two changes: the Google Fonts @import is gone —
   the prototype must load with outbound network blocked — and the review bar
   grew a surface switcher and a per-screen state selector.
   ========================================================================== */

:root {
  --ink:            #0b0d10;
  --ink-2:          #12151a;
  --ink-3:          #191d24;
  --line:           #262c35;
  --line-soft:      #1c212a;
  --fg:             #e8ecf2;
  --fg-2:           #9aa5b4;
  --fg-3:           #66707e;
  --accent:         #7dd3c0;          /* overridden per surface */
  --accent-ink:     #04120f;
  --rail:           270px;
  --sans: ui-sans-serif, 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Faint grain + a single directional wash: atmosphere without noise. */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1100px 620px at 8% -10%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.014) 0 1px, transparent 1px 3px);
}

.app { position: relative; z-index: 1; display: flex; height: 100vh; }

/* ---------------------------------------------------------------- rail --- */

.rail {
  width: var(--rail);
  flex: 0 0 var(--rail);
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  display: flex; flex-direction: column;
  min-height: 0;
}

.rail__head { padding: 22px 20px 16px; border-bottom: 1px solid var(--line-soft); }

.rail__eyebrow {
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--accent);
  display: flex; align-items: center; gap: 8px;
}
.rail__eyebrow::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), transparent);
}
.rail__title {
  margin: 10px 0 4px; font-size: 21px; font-weight: 800; letter-spacing: -.025em; line-height: 1.1;
}
.rail__sub { font-size: 12.5px; color: var(--fg-2); line-height: 1.45; }

.rail__scroll { flex: 1; overflow-y: auto; padding: 12px 12px 20px; min-height: 0; }
.rail__scroll::-webkit-scrollbar { width: 9px; }
.rail__scroll::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box;
}

.grp {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--fg-3); padding: 16px 8px 7px;
}

.nav { display: flex; flex-direction: column; gap: 1px; }

.nav__item {
  --row: transparent;
  display: grid; grid-template-columns: 34px 1fr; align-items: baseline; gap: 8px;
  padding: 9px 9px 9px 8px; border: 0; border-radius: 8px;
  background: var(--row); color: var(--fg-2);
  font-family: var(--sans); font-size: 13.5px; text-align: left; cursor: pointer;
  position: relative; transition: background .16s ease, color .16s ease;
  animation: rise .34s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.nav__item:hover { --row: #ffffff09; color: var(--fg); }
.nav__item[aria-current='true'] {
  --row: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--fg); font-weight: 600;
}
.nav__item[aria-current='true']::before {
  content: ''; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 2px;
  background: var(--accent); border-radius: 0 2px 2px 0;
}

.nav__code {
  font-family: var(--mono); font-size: 10px; letter-spacing: .04em;
  color: var(--fg-3); padding-top: 1px;
}
.nav__item[aria-current='true'] .nav__code { color: var(--accent); }
.nav__label { line-height: 1.3; }
.nav__note { display: block; font-size: 11px; color: var(--fg-3); margin-top: 2px; line-height: 1.35; }
.nav__item--gap .nav__label { color: var(--fg-3); }
.nav__item--gap .nav__code { color: #6b5a2e; }

.dot {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: #b8862b; margin-left: 6px; vertical-align: middle;
}

.rail__foot {
  border-top: 1px solid var(--line-soft); padding: 12px 16px 14px;
  font-family: var(--mono); font-size: 10px; color: var(--fg-3); line-height: 1.6;
}
.rail__foot a { color: var(--fg-2); }

/* --------------------------------------------------------------- stage --- */

.stage { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 9px 18px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink-2) 92%, transparent);
  backdrop-filter: blur(6px);
}
.bar__tag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; font-weight: 600;
  color: var(--accent-ink); background: var(--accent);
  padding: 3px 7px; border-radius: 4px;
}
.bar__where { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }
.bar__where em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--fg-3); margin-left: 7px; }
.bar__spacer { flex: 1; }
.bar__grp { display: flex; align-items: center; gap: 6px; }
.bar__lbl {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--fg-3);
}
.chip {
  border: 1px solid var(--line); background: var(--ink-3); color: var(--fg-2);
  font-family: var(--sans); font-size: 12px; padding: 4px 10px; border-radius: 999px;
  cursor: pointer; transition: all .15s ease;
}
.chip:hover { border-color: var(--fg-3); color: var(--fg); }
.chip[aria-pressed='true'] {
  background: color-mix(in srgb, var(--accent) 18%, var(--ink-3));
  border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--fg);
}
.chip--ghost { background: transparent; }

.frames { flex: 1; position: relative; min-height: 0; overflow: auto; }

/* Desktop surfaces: the prototype fills the stage. */
.frames--desktop { padding: 0; }
.frames--desktop iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

/* Mobile-first surface C: the prototype is staged in a device, because that is
   its primary review viewport — not an afterthought. */
.frames--mobile { display: grid; place-items: start center; padding: 30px 20px 40px; }
.phone {
  width: 402px; height: 858px; max-height: calc(100vh - 130px);
  border-radius: 42px; padding: 11px;
  background: linear-gradient(160deg, #2a3038, #14181e);
  box-shadow: 0 40px 90px -30px #000, 0 0 0 1px #333c47, inset 0 1px 0 #4a545f;
  position: relative; flex: 0 0 auto;
}
.phone::after {
  content: ''; position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  width: 104px; height: 24px; border-radius: 14px; background: #0a0c0f; z-index: 3;
  pointer-events: none;
}
.phone__screen {
  width: 100%; height: 100%; border-radius: 32px; overflow: hidden; background: #fff;
  position: relative;
}
.phone__screen iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.frames--mobile.is-wide .phone { width: 100%; max-width: 1180px; height: calc(100vh - 130px); border-radius: 14px; padding: 0; }
.frames--mobile.is-wide .phone::after { display: none; }
.frames--mobile.is-wide .phone__screen { border-radius: 14px; }

iframe.is-hidden { display: none !important; }

/* ------------------------------------------------------------ gap card --- */

.gap {
  max-width: 640px; margin: 8vh auto; padding: 34px 34px 30px;
  border: 1px solid var(--line); border-left: 3px solid #b8862b;
  border-radius: 12px; background: linear-gradient(180deg, var(--ink-2), var(--ink));
  animation: rise .4s cubic-bezier(.2,.7,.3,1) both;
}
.gap__eyebrow {
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: #d1a144;
}
.gap__title { margin: 12px 0 14px; font-size: 25px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.gap__body { color: var(--fg-2); font-size: 14.5px; line-height: 1.65; }
.gap__body strong { color: var(--fg); font-weight: 600; }
.gap__meta {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 11.5px; color: var(--fg-3); line-height: 1.8;
}
.gap__meta b { color: var(--fg-2); font-weight: 400; }

.loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--fg-3); pointer-events: none;
}

/* -------------------------------------------------------------- narrow --- */

@media (max-width: 900px) {
  body { overflow: auto; }
  .app { flex-direction: column; height: auto; min-height: 100vh; }
  .rail { width: 100%; flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail__scroll { max-height: 46vh; }
  .frames--mobile { padding: 16px 10px 30px; }
  .phone { width: 100%; max-width: 402px; height: 780px; }
  .frames--desktop { height: 78vh; }
}

/* ===================================================== local shell additions */

/* Surface switcher — the merged apps were three files; here they are three
   entries in one browser, so switching audience never leaves the page. */
.surfaces { display: flex; gap: 4px; padding: 12px 12px 0; }
.surf {
  flex: 1; border: 1px solid var(--line); background: var(--ink-3); color: var(--fg-2);
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  padding: 7px 4px; border-radius: 7px; cursor: pointer; transition: all .15s ease;
}
.surf:hover { color: var(--fg); border-color: var(--fg-3); }
.surf[aria-pressed='true'] {
  background: color-mix(in srgb, var(--accent) 20%, var(--ink-3));
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  color: var(--fg);
}

/* The state selector. Options come from the screen's own data-props enum, so
   an empty row means the screen declares no states — not that we lost them. */
.states {
  display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
  padding: 8px 18px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink-2) 60%, transparent);
}
.states__grp { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; max-width: 100%; }
.states__lbl {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--fg-3); margin-right: 2px;
}
.states__count { color: var(--fg-3); font-size: 9.5px; font-family: var(--mono); }
.chip--state { font-family: var(--mono); font-size: 11px; padding: 3px 8px; }
.states__none {
  font-family: var(--mono); font-size: 11px; color: var(--fg-3); letter-spacing: .04em;
}
.states__none b { color: #d1a144; font-weight: 400; }

.gap__lost {
  margin-top: 16px; padding: 12px 14px; border-radius: 8px;
  background: #ffffff08; border: 1px solid var(--line-soft);
  font-size: 13px; line-height: 1.6; color: var(--fg-2);
}
.gap__lost b { color: #d1a144; font-weight: 600; }

.states__status { flex-basis: 100%; font-family: var(--mono); font-size: 10.5px; display: flex; gap: 12px; flex-wrap: wrap; }
.states__ok   { color: var(--fg-3); }
.states__warn { color: #d1a144; }
