/* ============================================================
   EndoMed — Animowana makieta panelu pacjenta (showcase)
   Reużywalny komponent: .panel-showcase[data-device="phone|browser"]
   Sceny: Pulpit -> Dieta -> Badania+AI, auto-przewijanie jak wideo.
   Kolory dziedziczone z hosta przez --ps-* (z fallbackami EndoMed).
   ============================================================ */
.ps-root{
  --ps-teal:        var(--c-teal, #1B9AA3);
  --ps-teal-deep:   var(--c-teal-deep, #0D6E75);
  --ps-teal-ink:    var(--c-teal-ink, #064E54);
  --ps-green:       var(--c-green, #2EAD5C);
  --ps-green-pale:  var(--c-green-pale, #DFFAE5);
  --ps-ink:         var(--c-ink, #0F2D3D);
  --ps-ink-2:       var(--c-ink-2, #4B5A63);
  --ps-ink-3:       var(--c-ink-3, #8595A0);
  --ps-bg:          var(--c-panel-bg, #EFF7F8);
  --ps-surface:     #ffffff;
  --ps-line:        rgba(15,45,61,.09);
  --ps-warn:        #E0894B;
  --ps-warn-pale:   #FBEFE2;
  font-family: 'Outfit', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.ps-root *{ box-sizing: border-box; margin: 0; }

/* ── Device chrome ─────────────────────────────────────── */
.ps-device{
  position: relative;
  background: #0B1F2E;
  box-shadow: 0 50px 120px -30px rgba(6,40,46,.55), 0 0 0 1px rgba(255,255,255,.04) inset;
}
.ps-phone .ps-device{
  width: 320px;
  border-radius: 46px;
  padding: 13px;
}
.ps-phone .ps-notch{
  position: absolute; top: 13px; left: 50%; transform: translateX(-50%);
  width: 116px; height: 26px; background: #0B1F2E; border-radius: 0 0 16px 16px; z-index: 6;
}
.ps-browser .ps-device{
  width: 760px;
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
}
.ps-browser .ps-bar{
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px; background: #0B1F2E;
}
.ps-browser .ps-bar i{ width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,.22); }
.ps-browser .ps-bar .ps-url{
  margin-left: 10px; flex: 1; max-width: 320px;
  height: 22px; border-radius: 6px; background: rgba(255,255,255,.08);
  display: flex; align-items: center; padding: 0 12px;
  font-size: 11px; color: rgba(255,255,255,.5); letter-spacing: .01em;
}

/* ── Screen ────────────────────────────────────────────── */
.ps-screen{
  position: relative;
  overflow: hidden;
  background: var(--ps-bg);
}
.ps-phone .ps-screen{ border-radius: 34px; height: 592px; }
.ps-browser .ps-screen{ height: 470px; }

.ps-scene{
  position: absolute; inset: 0;
  padding: 34px 18px 18px;
  display: flex; flex-direction: column; gap: 11px;
  opacity: 0;
  transform: translateY(14px) scale(.985);
  transition: opacity .7s var(--ease,cubic-bezier(.16,1,.3,1)), transform .7s var(--ease,cubic-bezier(.16,1,.3,1));
  pointer-events: none;
}
.ps-scene.is-active{ opacity: 1; transform: none; }
.ps-browser .ps-scene{ padding: 20px 22px; }

/* App header inside scene */
.ps-head{ display: flex; align-items: flex-start; justify-content: space-between; }
.ps-eyebrow{ font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ps-teal); }
.ps-greet{ font-family: 'Merriweather', serif; font-size: 18px; font-weight: 700; color: var(--ps-ink); margin-top: 3px; line-height: 1.15; }
.ps-chip{ font-size: 10px; font-weight: 600; color: var(--ps-teal-deep); background: #fff; border: 1px solid var(--ps-line); padding: 5px 10px; border-radius: 100px; white-space: nowrap; }
.ps-avatar{ width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,var(--ps-teal),var(--ps-teal-deep)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

/* generic card */
.ps-card{ background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: 18px; padding: 14px 15px; box-shadow: 0 2px 8px rgba(15,45,61,.04); }
.ps-card.dark{ background: linear-gradient(150deg,var(--ps-teal-deep),var(--ps-teal-ink)); border-color: transparent; color: #fff; }
.ps-label{ font-size: 10.5px; color: var(--ps-ink-3); font-weight: 500; }
.ps-row{ display: flex; align-items: center; justify-content: space-between; }
.ps-grid2{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* metric */
.ps-metric{ font-family: 'Merriweather', serif; font-weight: 700; color: var(--ps-ink); line-height: 1; }
.ps-metric small{ font-size: .5em; font-weight: 600; color: var(--ps-ink-3); margin-left: 3px; font-family: 'Outfit',sans-serif; }
.ps-delta{ font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 100px; }
.ps-delta.ok{ color: var(--ps-green); background: var(--ps-green-pale); }
.ps-delta.teal{ color: var(--ps-teal-deep); background: #E4F4F5; }

/* mini bar chart */
.ps-bars{ display: flex; align-items: flex-end; gap: 5px; height: 46px; margin-top: 12px; }
.ps-bars i{ flex: 1; height: 100%; border-radius: 3px 3px 0 0; background: #CDE8EA; transform: scaleY(.25); transform-origin: bottom; }
.ps-bars i.on{ background: var(--ps-teal-deep); }
.is-active .ps-bars i{ animation: psBar .7s var(--ease,cubic-bezier(.16,1,.3,1)) forwards; }
.is-active .ps-bars i:nth-child(1){ animation-delay:.05s } .is-active .ps-bars i:nth-child(2){ animation-delay:.12s }
.is-active .ps-bars i:nth-child(3){ animation-delay:.19s } .is-active .ps-bars i:nth-child(4){ animation-delay:.26s }
.is-active .ps-bars i:nth-child(5){ animation-delay:.33s } .is-active .ps-bars i:nth-child(6){ animation-delay:.40s }
.is-active .ps-bars i:nth-child(7){ animation-delay:.47s }
@keyframes psBar{ from{ transform: scaleY(.12); opacity: .4 } to{ transform: scaleY(var(--h,.6)); opacity: 1 } }

/* progress ring */
.ps-ring{ position: relative; width: 76px; height: 76px; flex-shrink: 0; }
.ps-ring svg{ width: 100%; height: 100%; transform: rotate(-90deg); }
.ps-ring .track{ fill: none; stroke: #E2EEF0; stroke-width: 9; }
.ps-ring .arc{ fill: none; stroke: var(--ps-green); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 207; stroke-dashoffset: 207; }
.is-active .ps-ring .arc{ animation: psArc 1.1s .25s var(--ease,cubic-bezier(.16,1,.3,1)) forwards; }
@keyframes psArc{ to{ stroke-dashoffset: var(--off,70); } }
.ps-ring .ps-ring-c{ position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ps-ring .ps-ring-c b{ font-family: 'Merriweather',serif; font-size: 17px; color: var(--ps-ink); }
.ps-ring .ps-ring-c span{ font-size: 8.5px; color: var(--ps-ink-3); }

/* appointment / list rows */
.ps-appt small{ font-size: 9px; opacity: .65; letter-spacing: .08em; text-transform: uppercase; }
.ps-appt .t{ font-size: 13px; font-weight: 600; margin-top: 3px; }
.ps-appt .s{ font-size: 11px; opacity: .7; margin-top: 2px; }

/* meal rows */
.ps-meal{ display: flex; align-items: center; gap: 11px; }
.ps-thumb{ width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; background:
  repeating-linear-gradient(135deg,#DCEFF0 0 7px,#D0E8EA 7px 14px); position: relative; overflow: hidden; }
.ps-thumb::after{ content: attr(data-l); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 7px; color: var(--ps-teal-deep); opacity: .55; font-family: ui-monospace,monospace; text-align: center; }
.ps-meal .nm{ font-size: 12px; font-weight: 600; color: var(--ps-ink); line-height: 1.25; }
.ps-meal .mt{ font-size: 10px; color: var(--ps-ink-3); margin-top: 2px; }
.ps-meal .kc{ font-size: 11px; font-weight: 700; color: var(--ps-teal-deep); white-space: nowrap; }

/* macros */
.ps-macro{ }
.ps-macro .ps-mrow{ display: flex; justify-content: space-between; font-size: 10px; color: var(--ps-ink-2); margin-bottom: 4px; }
.ps-macro .ps-mbar{ height: 6px; border-radius: 100px; background: #E2EEF0; overflow: hidden; }
.ps-macro .ps-mbar i{ display: block; height: 100%; border-radius: 100px; width: 0; }
.is-active .ps-macro .ps-mbar i{ animation: psFill 1s .3s var(--ease,cubic-bezier(.16,1,.3,1)) forwards; }
@keyframes psFill{ to{ width: var(--w,60%); } }

/* lab rows */
.ps-lab{ display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--ps-line); }
.ps-lab:last-child{ border-bottom: 0; }
.ps-lab .nm{ font-size: 12px; font-weight: 600; color: var(--ps-ink); }
.ps-lab .rg{ font-size: 9.5px; color: var(--ps-ink-3); margin-top: 1px; }
.ps-lab .vl{ font-size: 13px; font-weight: 700; color: var(--ps-ink); font-family: 'Merriweather',serif; }
.ps-pill{ font-size: 9px; font-weight: 700; padding: 3px 8px; border-radius: 100px; }
.ps-pill.ok{ color: var(--ps-green); background: var(--ps-green-pale); }
.ps-pill.warn{ color: var(--ps-warn); background: var(--ps-warn-pale); }

/* AI banner */
.ps-ai{ background: linear-gradient(150deg,var(--ps-teal-deep),var(--ps-teal-ink)); color: #fff; border-radius: 16px; padding: 13px 14px; }
.ps-ai .h{ display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.ps-ai .h .d{ width: 7px; height: 7px; border-radius: 50%; background: #6DD98A; box-shadow: 0 0 0 4px rgba(109,217,138,.25); }
.is-active .ps-ai .h .d{ animation: psPulse 1.6s ease-in-out infinite; }
@keyframes psPulse{ 0%,100%{ box-shadow: 0 0 0 3px rgba(109,217,138,.2) } 50%{ box-shadow: 0 0 0 7px rgba(109,217,138,0) } }
.ps-ai .m{ font-size: 12px; line-height: 1.5; margin-top: 7px; }
.ps-ai .m b{ color: #B9F0C8; }

/* nav rail (browser) */
.ps-rail{ display: flex; gap: 6px; flex-wrap: wrap; }
.ps-rail span{ font-size: 10.5px; font-weight: 600; color: var(--ps-ink-3); padding: 6px 11px; border-radius: 100px; }
.ps-rail span.on{ color: #fff; background: var(--ps-teal-deep); }

.ps-browser .ps-pane{ display: grid; grid-template-columns: 1fr 1fr; gap: 14px; flex: 1; }
.ps-browser .ps-colstack{ display: flex; flex-direction: column; gap: 11px; }

/* dots */
.ps-dots{ display: flex; gap: 7px; align-items: center; }
.ps-dot{ width: 7px; height: 7px; border-radius: 50%; background: var(--c-dot, rgba(15,45,61,.18)); transition: width .35s var(--ease,cubic-bezier(.16,1,.3,1)), background .35s; }
.ps-dot.is-active{ width: 22px; border-radius: 100px; background: var(--c-dot-on, var(--ps-teal)); }

.ps-caption{ font-size: 11.5px; font-weight: 600; letter-spacing: .04em; color: var(--c-caption, var(--ps-ink-3)); text-transform: uppercase; }
