/* App screens on the website, rebuilt from the approved Designstudio mockups (app-screens/app.css):
   same frame, app bar, cards, status pills, buttons, radii and spacing.
   Colours come only from tokens.css. The mockup's status hues are mapped onto the Himbeere tokens:
   done = success/mint, expected = sky, warning = warning/sun, problem = danger, neutral = sunken.
   Since 19.11. success and warning are dark enough to be used directly as pill text. */

[data-ui] {
  --zp-ok-bg: color-mix(in srgb, var(--deco-4) 24%, var(--app-surface));
  --zp-ok-fg: var(--app-success);
  --zp-wait-bg: var(--app-sky);
  --zp-wait-fg: var(--app-sky-ink);
  --zp-warn-bg: color-mix(in srgb, var(--deco-3) 30%, var(--app-surface));
  --zp-warn-fg: var(--app-warning);
  --zp-bad-bg: color-mix(in srgb, var(--app-danger) 11%, var(--app-surface));
  --zp-bad-fg: var(--app-danger);
  font-family: var(--font-body);
  color: var(--app-ink);
  text-align: left;
}

/* Device frame */
.zp-phone {
  width: 390px; height: 844px;
  border-radius: 48px; padding: 12px;
  background: var(--app-ink);
  box-shadow: 0 30px 80px color-mix(in srgb, var(--app-head) 28%, transparent);
}
.zp-scr {
  width: 100%; height: 100%;
  border-radius: 38px; overflow: hidden;
  background: var(--app-bg);
  display: flex; flex-direction: column; position: relative;
  font-size: 15px; line-height: 1.4;
}
.zp-status { height: 44px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 26px 0 30px; font-size: 14px; font-weight: 600; }
.zp-island { width: 120px; height: 32px; border-radius: 20px; background: var(--app-ink); }
.zp-appbar { padding: 8px 18px 10px; display: flex; align-items: center; gap: 10px; flex: none; }
.zp-h1 { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--app-head); line-height: 1.2; }
.zp-h2 { font-family: var(--font-display); font-size: 19px; font-weight: 800; color: var(--app-head); }
.zp-h3 { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--app-head); }
.zp-kita { font-size: 12.5px; color: var(--app-ink-2); }
.zp-avatar { margin-left: auto; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--app-accent); color: var(--app-on-accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.zp-content { flex: 1; min-height: 0; padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.zp-meta { font-size: 12.5px; color: var(--app-ink-2); }

.zp-card { background: var(--app-surface); border-radius: 14px; padding: 14px; box-shadow: 0 1px 0 color-mix(in srgb, var(--app-ink) 6%, transparent), 0 1px 2px color-mix(in srgb, var(--app-ink) 5%, transparent); }
.zp-card.zp-sky { background: var(--app-sky); }
.zp-card.zp-flush { padding: 2px 14px; }
.zp-row { display: flex; align-items: center; gap: 10px; }
.zp-row > div { min-width: 0; }
.zp-row > .zp-spill, .zp-row > .swap { margin-left: auto; }
.zp-gap { gap: 8px; }
.zp-end { justify-content: flex-end; }

.zp-it { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.zp-it + .zp-it { border-top: 1px solid var(--app-line); }
.zp-t { flex: 1; min-width: 0; }
.zp-t b { display: block; font-weight: 600; font-size: 14px; }
.zp-t small { display: block; color: var(--app-ink-2); font-size: 12px; }
.zp-av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--app-sky-ink); background: var(--app-sky); }
.zp-av.av-berry { background: var(--app-accent-soft); color: var(--app-head); }
.zp-av.av-mint { background: var(--zp-ok-bg); }
.zp-av.av-sun { background: var(--zp-warn-bg); }

/* Status pills (mockup: .spill) */
.zp-spill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.zp-spill.ok { background: var(--zp-ok-bg); color: var(--zp-ok-fg); }
.zp-spill.wait { background: var(--zp-wait-bg); color: var(--zp-wait-fg); }
.zp-spill.warn { background: var(--zp-warn-bg); color: var(--zp-warn-fg); }
.zp-spill.bad { background: var(--zp-bad-bg); color: var(--zp-bad-fg); }
.zp-spill.neutral { background: var(--app-sunken); color: var(--app-ink); }
.zp-spill.origin { background: var(--app-accent-soft); color: var(--app-accent); font-weight: 500; }

/* Buttons (mockup: .btn) */
.zp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 12px; border-radius: 11px; font-weight: 600; font-size: 13.5px; border: 1px solid var(--app-ctrl); color: var(--app-ink); background: var(--app-surface); }
.zp-btn.primary { background: var(--app-accent); color: var(--app-on-accent); border-color: var(--app-accent); }

.zp-banner { display: flex; align-items: center; gap: 10px; background: var(--zp-warn-bg); color: var(--zp-warn-fg); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 500; }
.zp-undo { display: flex; align-items: center; gap: 12px; background: var(--app-head); color: var(--app-on-accent); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; }
.zp-undo b { margin-left: auto; color: var(--app-sky-2); font-weight: 600; }

.zp-radio { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--app-line); border-radius: 12px; background: var(--app-surface); }
.zp-radio.on { border-color: var(--app-accent); background: var(--app-accent-soft); }

.zp-tabbar { display: flex; border-top: 1px solid var(--app-line); background: var(--app-surface); padding: 8px 6px 22px; flex: none; margin-top: auto; }
.zp-tabbar div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--app-ink-2); font-weight: 500; }
.zp-tabbar div.on { color: var(--app-accent); }
.zp-tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Bottom sheet (mockup: .sheet over a scrim) */
.zp-scr-sheet { background: color-mix(in srgb, var(--app-ink) 32%, var(--app-bg)); }
.zp-sheet { margin-top: 10px; flex: 1; background: var(--app-surface); border-radius: 24px 24px 0 0; padding: 12px 18px 28px; display: flex; flex-direction: column; gap: 12px; }
.zp-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--app-line); margin: 0 auto 2px; }
.zp-field { display: flex; flex-direction: column; gap: 5px; }
.zp-label { color: var(--app-ink-2); font-weight: 600; font-size: 12px; }
.zp-seg { display: flex; border: 1px solid var(--app-ctrl); border-radius: 11px; overflow: hidden; font-size: 13px; font-weight: 600; }
.zp-seg span { flex: 1; text-align: center; padding: 9px 6px; }
.zp-seg span.on { background: var(--app-accent); color: var(--app-on-accent); }

/* A phone cropped by its card: the top of the device peeks out of the timeline card */
.zp-crop { width: 100%; max-width: 360px; min-width: 0; height: auto; border-radius: 40px 40px 0 0; padding: 10px 10px 0; }
.zp-crop .zp-scr { height: auto; border-radius: 30px 30px 0 0; padding-bottom: 18px; }

/* State change inside a screen: the old pill gives way to the new one */
.swap { display: inline-grid; justify-items: end; align-items: center; }
.swap > * { grid-area: 1 / 1; }
.swap .was { visibility: hidden; }
