/* Portal simulations — the "Watch simulation" player on the home page.
   Two layers: the PLAYER (overlay, window chrome, captions, controls) and a
   MOCK UI KIT that replicates the real portal screens (registration wizard,
   dashboards, exam page, live monitoring). Everything is ps-* prefixed so it
   can never collide with styles.css. */

/* ------------------------------------------------------------ launchers -- */
.feature-card, .step-card { display: flex; flex-direction: column; align-items: center; }
.feature-card p, .step-card p { flex: 1 0 auto; }
.sim-launch {
    margin-top: 18px;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; border-radius: 999px;
    border: 1.5px solid rgba(0, 46, 93, 0.18);
    background: #fff; color: #002E5D;
    font: 600 0.88rem/1 'Roboto', 'Segoe UI', sans-serif; letter-spacing: .01em;
    cursor: pointer; position: relative; z-index: 2;
    transition: background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.sim-launch i { color: #00a9d6; font-size: 1.05rem; transition: color .25s ease, transform .25s ease; }
.sim-launch:hover, .sim-launch:focus-visible {
    background: linear-gradient(135deg, #002E5D, #0a4a8a); color: #fff; border-color: transparent;
    box-shadow: 0 8px 20px rgba(0, 46, 93, .22); transform: translateY(-1px); outline: none;
}
.sim-launch:hover i, .sim-launch:focus-visible i { color: #00CFFD; transform: scale(1.12); }
.sim-launch:focus-visible { box-shadow: 0 0 0 3px rgba(0, 207, 253, .45); }

/* --------------------------------------------------------------- player -- */
.ps-overlay {
    position: fixed; inset: 0; z-index: 5000; display: none;
    align-items: center; justify-content: center; padding: 18px;
    background: radial-gradient(circle at 30% 20%, rgb(18, 48, 92), rgb(4, 12, 28));
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    /* Touch devices: a very short screen scrolls inside the player instead of
       the page behind it; no long-press text selection or callout; no iOS
       font inflation in landscape; no grey tap flash. */
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}
.ps-overlay.is-open { display: flex; animation: psFade .25s ease; }
@keyframes psFade { from { opacity: 0; } to { opacity: 1; } }
/* The shell is as wide as the stage can be at the height available, so a
   short laptop screen never letterboxes the stage with white side bands. */
.ps-shell { width: min(1220px, 100%, max(560px, calc((100vh - 230px) * 1280 / 760))); width: min(1220px, 100%, max(560px, calc((100dvh - 230px) * 1280 / 760))); max-height: 100%; display: flex; flex-direction: column; gap: 10px; color: #e8eef8; }
.ps-top { display: flex; align-items: center; gap: 12px; }
.ps-kicker { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #5fdcff; }
.ps-title { margin: 0; font-size: 20px; font-weight: 600; color: #fff; }
.ps-top-actions { margin-left: auto; display: flex; gap: 8px; }
.ps-icon-btn {
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer; font-size: 15px;
    display: inline-flex; align-items: center; justify-content: center; transition: background .2s;
}
.ps-icon-btn:hover, .ps-icon-btn:focus-visible { background: rgba(255, 255, 255, .16); outline: none; }
.ps-icon-btn[aria-pressed="true"] { background: rgba(0, 207, 253, .2); border-color: rgba(0, 207, 253, .5); }
/* Narrator speaking: four bars beside the chapter label, and the subtitle
   brightens, so it is obvious the caption is what is being said. */
.ps-voicebars { display: none; position: absolute; right: 14px; top: 12px; align-items: flex-end; gap: 2px; height: 11px; }
/* Animated with transform, never height: a height animation re-lays the
   caption out on every frame, and in WebKit testing that infinite layout loop
   crashed the page process within seconds (0 crashes once it moved to the
   compositor). */
.ps-voicebars i { width: 3px; height: 11px; border-radius: 1px; background: #5fdcff; transform-origin: 50% 100%; transform: scaleY(.3); animation: psBars .9s ease-in-out infinite; will-change: transform; }
.ps-voicebars i:nth-child(2) { animation-delay: -.3s; }
.ps-voicebars i:nth-child(3) { animation-delay: -.6s; }
.ps-voicebars i:nth-child(4) { animation-delay: -.15s; }
@keyframes psBars { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.ps-caption.is-speaking .ps-voicebars { display: inline-flex; }
/* Keep the subtitle clear of the speaking bars in the corner. */
.ps-shell .ps-caption { padding-right: 36px; }   /* beats the later padding shorthands */
.ps-caption.is-speaking p { color: #fff; }
/* Music or narration switched off: Font Awesome Free has no slashed
   variants of these icons, so strike them. */
.ps-icon-btn.is-off { position: relative; color: rgba(255, 255, 255, .55); }
.ps-icon-btn.is-off::after { content: ''; position: absolute; left: 10px; right: 10px; top: 50%; height: 2px; border-radius: 1px; background: currentColor; transform: rotate(-40deg); }

.ps-window { position: relative; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); transition: border-radius .4s ease; }
.ps-chrome { height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #e9edf3; border-bottom: 1px solid #d5dce6; transition: margin .45s ease; }
.ps-window.is-fullscreen .ps-chrome { margin-top: -38px; }
.ps-dots { display: flex; gap: 6px; }
.ps-dots span { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.ps-dots span:nth-child(2) { background: #febc2e; }
.ps-dots span:nth-child(3) { background: #28c840; }
.ps-navarrows { color: #8a97a8; font-size: 12px; display: flex; gap: 10px; }
.ps-url { flex: 1; height: 26px; border-radius: 7px; background: #fff; border: 1px solid #d5dce6; display: flex; align-items: center; gap: 7px; padding: 0 10px; font-size: 12.5px; color: #44526a; overflow: hidden; white-space: nowrap; }
.ps-url i { color: #1b9e4b; font-size: 11px; }
.ps-url b { font-weight: 400; color: #8a97a8; }
.ps-url .ps-url-path { color: #0f1b2d; }
.ps-viewport { position: relative; width: 100%; aspect-ratio: 1280 / 760; max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); overflow: hidden; background: #f4f6f9; }
/* Safari before 15 has no aspect-ratio: hold the 1280:760 shape with padding
   (the stage is absolutely positioned, so the viewport's box is all it needs). */
@supports not (aspect-ratio: 1 / 1) {
    .ps-viewport { height: 0; padding-top: 59.375%; max-height: none; }
}
.ps-stage {
    position: absolute; left: 0; top: 0; width: 1280px; height: 760px;
    transform-origin: 0 0; transition: transform .7s cubic-bezier(.22, .9, .3, 1);
    overflow: hidden; background: #f4f6f9; color: #1f2d3d; font-size: 14px;
}
.ps-stage.no-anim, .ps-stage.no-anim * { transition: none !important; animation-duration: 0s !important; }
.ps-stage * { pointer-events: none; box-sizing: border-box; }
/* Pausing freezes only the ambient loops. Freezing everything also froze a
   screen's fade-in at 0% when pause landed mid-transition: a blank stage. */
.ps-stage.is-paused .person, .ps-stage.is-paused .scan, .ps-stage.is-paused .ps-typing span,
.ps-stage.is-paused .ps-caret, .ps-stage.is-paused .live::before, .ps-stage.is-paused .ps-spinner,
.ps-stage.is-paused .ps-bell.is-ring i { animation-play-state: paused !important; }
.ps-screen { position: absolute; inset: 0; animation: psScreenIn .45s ease; }
@keyframes psScreenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ps-caption { position: relative; min-height: 64px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 14px; border-radius: 10px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.ps-chapter { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5fdcff; }
.ps-caption p { margin: 0; font-size: 15px; line-height: 1.45; color: #f1f5fb; }
.ps-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ps-progress { flex: 1 1 260px; display: flex; gap: 4px; height: 26px; align-items: center; }
.ps-seg { position: relative; flex: 1; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .16); cursor: pointer; border: 0; padding: 0; }
.ps-seg::after { content: ''; position: absolute; inset: -10px 0; }
/* The fill is redrawn every frame, so it scales (compositor) rather than
   changing width (layout + paint on every frame for as long as it plays). */
.ps-seg span { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 4px; background: linear-gradient(90deg, #00CFFD, #5fdcff); transform-origin: 0 50%; transform: scaleX(0); will-change: transform; }
.ps-seg.is-done span { transform: scaleX(1); }
.ps-seg:hover, .ps-seg:focus-visible { background: rgba(255, 255, 255, .3); outline: none; }
.ps-seg-tip { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; background: #0b1f3f; color: #fff; padding: 4px 8px; border-radius: 6px; opacity: 0; transition: opacity .15s; pointer-events: none; }
/* Hover only where there is a real pointer: on a phone a tap leaves :hover
   stuck, which left a tooltip floating over the progress bar. */
.ps-seg:focus-visible .ps-seg-tip { opacity: 1; }
@media (hover: hover) { .ps-seg:hover .ps-seg-tip { opacity: 1; } }
.ps-speed { height: 40px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: #fff; padding: 0 8px; font: inherit; font-size: 13px; }
.ps-speed option { color: #0f1b2d; }
.ps-keyhint { font-size: 12px; color: #9fb0c8; }

/* cursor, clicks and key overlay */
.ps-cursor { position: absolute; left: 640px; top: 420px; width: 26px; height: 26px; z-index: 900; transition-property: left, top; transition-timing-function: cubic-bezier(.3, .8, .35, 1); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.ps-cursor svg { width: 26px; height: 26px; }
.ps-cursor.is-hidden { opacity: 0; }
.ps-ripple { position: absolute; z-index: 899; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 3px solid rgba(0, 169, 214, .9); animation: psRipple .5s ease-out forwards; }
@keyframes psRipple { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.ps-keys { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 950; display: flex; gap: 8px; align-items: center; animation: psScreenIn .2s ease; }
.ps-keys kbd { min-width: 46px; text-align: center; padding: 10px 14px; border-radius: 10px; background: rgba(15, 27, 45, .88); color: #fff; font: 600 18px 'Segoe UI', sans-serif; border-bottom: 4px solid #000; box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
.ps-keys b { color: #0f1b2d; font-size: 20px; }

/* end card */
.ps-endcard { position: absolute; inset: 0; z-index: 980; display: flex; align-items: center; justify-content: center; background: rgba(5, 18, 40, .78); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: psFade .35s ease; }
.ps-endcard-box { background: #fff; border-radius: 18px; padding: 34px 40px; text-align: center; width: 560px; box-shadow: 0 30px 70px rgba(0, 0, 0, .4); }
.ps-endcard-box i.ps-end-icon { font-size: 44px; color: #1b9e4b; }
.ps-endcard-box h3 { margin: 12px 0 6px; font-size: 26px; color: #002E5D; }
.ps-endcard-box p { margin: 0 0 22px; color: #5a6b7e; font-size: 16px; line-height: 1.5; }

/* the overlay buttons inside the end card must be clickable */
.ps-endcard, .ps-endcard * { pointer-events: auto !important; }
.ps-end-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ps-end-actions button, .ps-end-actions a { font: 600 15px 'Segoe UI', sans-serif; padding: 12px 20px; border-radius: 10px; border: 0; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.ps-end-primary { background: #002E5D; color: #fff; }
.ps-end-secondary { background: #eef2f7; color: #002E5D; }
.ps-end-cta { background: #00CFFD; color: #0D1B2A; }

/* ============================================================ MOCK KIT == */
.ps-page { position: absolute; inset: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #f4f6f9; color: #1f2d3d; }
.ps-poppins { font-family: 'Poppins', 'Roboto', 'Segoe UI', sans-serif; }
.ps-logo { height: 40px; width: auto; display: block; }

/* public header + hero */
.ps-pub-header { height: 66px; display: flex; align-items: center; padding: 0 34px; background: #fff; box-shadow: 0 2px 12px rgba(0, 46, 93, .08); position: relative; z-index: 2; }
.ps-pub-nav { margin-left: auto; display: flex; gap: 26px; align-items: center; font-weight: 500; color: #002E5D; font-size: 14px; }
.ps-pub-nav .ps-cta { background: #D20000; color: #fff; padding: 9px 16px; border-radius: 8px; }
.ps-hero { position: absolute; top: 66px; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; background: linear-gradient(rgba(0, 24, 72, .72), rgba(0, 18, 51, .82)), url('/static/images/spacs-hero-img1.jpg') center/cover; }
.ps-hero h1 { margin: 0 0 14px; font-size: 52px; line-height: 1.12; font-weight: 700; letter-spacing: .5px; }
.ps-hero p { margin: 0 0 30px; font-size: 19px; color: #ffd900; }
.ps-hero-btns { display: flex; gap: 16px; justify-content: center; }
.ps-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 8px; font-weight: 600; font-size: 15px; border: 2px solid transparent; transition: transform .15s ease, filter .15s ease, background .2s ease; white-space: nowrap; }
.ps-btn.is-pressed { transform: scale(.96); filter: brightness(.9); }
.ps-btn-cyan { background: #00CFFD; color: #0D1B2A; }
.ps-btn-ghost { background: transparent; color: #fff; border-color: #fff; }
.ps-btn-navy { background: #002E5D; color: #fff; }
.ps-btn-red { background: #D20000; color: #fff; }
.ps-btn-green { background: #16a34a; color: #fff; }
.ps-btn-light { background: #eef2f7; color: #002E5D; }
.ps-btn-outline { background: #fff; color: #002E5D; border-color: #cdd5e1; }
.ps-btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 7px; }
.ps-btn[disabled], .ps-btn.is-disabled { opacity: .45; }

/* modal */
.ps-modal-back { position: absolute; inset: 0; z-index: 40; background: rgba(5, 15, 35, .55); display: flex; align-items: center; justify-content: center; animation: psFade .2s ease; }
.ps-modal { background: #fff; border-radius: 14px; box-shadow: 0 30px 70px rgba(0, 0, 0, .3); padding: 28px 30px; width: 520px; max-height: 700px; animation: psPop .28s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes psPop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.ps-modal h2 { margin: 0 0 8px; color: #002E5D; font-size: 24px; }
.ps-modal p { margin: 0 0 18px; color: #4a5a70; line-height: 1.5; }
.ps-role-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 13px; border-radius: 8px; background: #002E5D; color: #fff; font-size: 16px; font-weight: 500; margin-bottom: 12px; transition: background .2s, transform .15s; }
.ps-role-btn.is-hover { background: #1e90ff; transform: translateY(-2px); }

/* forms */
.ps-field { margin-bottom: 14px; }
.ps-label { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; color: #002E5D; margin-bottom: 6px; }
.ps-label i { color: #00a9d6; }
.ps-label .ps-req { color: #D20000; }
.ps-input { width: 100%; height: 42px; border: 1.5px solid #d6dde7; border-radius: 9px; background: #fff; padding: 0 13px; font: inherit; font-size: 14px; color: #1f2d3d; display: flex; align-items: center; transition: border-color .2s, box-shadow .2s; overflow: hidden; white-space: nowrap; }
.ps-input.is-focus { border-color: #00a9d6; box-shadow: 0 0 0 3px rgba(0, 169, 214, .18); }
.ps-input .ps-ph { color: #9aa7b8; }
.ps-input .ps-caret { display: none; width: 1.5px; height: 18px; background: #1f2d3d; margin-left: 1px; animation: psBlink 1s steps(1) infinite; }
.ps-input.is-focus .ps-caret { display: inline-block; }
@keyframes psBlink { 50% { opacity: 0; } }
.ps-textarea { height: 120px; align-items: flex-start; padding: 11px 13px; white-space: pre-wrap; line-height: 1.5; }
.ps-select { position: relative; }
.ps-select::after { content: '\25BE'; position: absolute; right: 13px; top: 11px; color: #6b7a90; }
.ps-dropdown { position: absolute; left: 0; right: 0; top: 46px; background: #fff; border: 1px solid #d6dde7; border-radius: 9px; box-shadow: 0 14px 30px rgba(0, 40, 80, .15); z-index: 20; overflow: hidden; animation: psScreenIn .15s ease; }
.ps-dropdown div { padding: 9px 13px; font-size: 14px; }
.ps-dropdown div.is-hover { background: #e8f6fc; color: #002E5D; }
.ps-hint { font-size: 12px; margin-top: 5px; color: #6b7a90; min-height: 16px; }
.ps-hint.ok { color: #16a34a; }
.ps-hint.bad { color: #c62828; }
.ps-hint.wait { color: #b26a00; }
.ps-strength { height: 5px; border-radius: 4px; background: #e6ebf2; margin-top: 7px; overflow: hidden; }
.ps-strength span { display: block; height: 100%; width: 0; background: #c62828; transition: width .3s, background .3s; }
.ps-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #44526a; line-height: 1.45; }
.ps-box { flex: none; width: 19px; height: 19px; border: 2px solid #9aa7b8; border-radius: 5px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; transition: background .15s, border-color .15s; }
.ps-box.is-on { background: #00a9d6; border-color: #00a9d6; }
.ps-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #9aa7b8; display: inline-block; position: relative; flex: none; }
.ps-radio.is-on { border-color: #2a78d6; }
.ps-radio.is-on::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #2a78d6; }
.ps-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: psSpin .8s linear infinite; display: inline-block; }
.ps-spinner.dark { border-color: rgba(0, 46, 93, .2); border-top-color: #002E5D; }
@keyframes psSpin { to { transform: rotate(360deg); } }

/* registration wizard (mirrors templates/register_student.html) */
.ps-reg-bg { position: absolute; inset: 66px 0 0 0; background: linear-gradient(rgba(0, 24, 72, .78), rgba(0, 18, 51, .86)), url('/static/images/spacs-hero-img2.jpg') center/cover; }
.ps-reg-card { position: absolute; left: 50%; top: 86px; transform: translateX(-50%); width: 560px; background: #fff; border-radius: 18px; border-top: 5px solid #00CFFD; padding: 22px 34px 26px; box-shadow: 0 25px 60px rgba(0, 0, 0, .35); }
.ps-reg-head { display: flex; align-items: center; justify-content: center; gap: 14px; }
.ps-reg-icon { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(145deg, #0a3d7a, #002E5D); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.ps-reg-head h2 { margin: 0; font-size: 26px; color: #002E5D; font-weight: 700; }
.ps-reg-sub { text-align: center; color: #5a6b7e; margin: 8px 0 14px; font-size: 14px; }
.ps-steps { display: flex; align-items: center; margin: 0 24px 6px; }
.ps-steps .ps-dot { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(145deg, #00b4e0, #006f99); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; box-shadow: 0 4px 10px rgba(0, 120, 170, .3); }
.ps-steps .ps-dot.is-active { background: #002E5D; }
.ps-steps .ps-dot.is-done { background: #16a34a; }
.ps-steps .ps-line { flex: 1; height: 2px; background: #dde4ee; margin: 0 6px; }
.ps-step-labels { display: flex; justify-content: space-between; font-size: 12px; color: #6b7a90; margin: 0 6px 14px; }
.ps-step-labels b { color: #002E5D; }
.ps-reg-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.ps-file { display: flex; align-items: center; gap: 12px; }
.ps-avatar-prev { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: #e6ebf2; flex: none; }

/* email client (generic) */
.ps-mail { position: absolute; inset: 0; display: grid; grid-template-columns: 210px 360px 1fr; background: #fff; }
.ps-mail-nav { background: #f3f5f9; padding: 16px 12px; border-right: 1px solid #e3e8f0; }
.ps-mail-nav .ps-compose { background: #dbe7fb; color: #0f2c5c; border-radius: 14px; padding: 12px 16px; font-weight: 600; display: inline-flex; gap: 8px; margin-bottom: 14px; }
.ps-mail-nav div.item { padding: 8px 12px; border-radius: 0 16px 16px 0; font-size: 14px; color: #3b4a60; display: flex; justify-content: space-between; }
.ps-mail-nav div.item.is-on { background: #d3e3fd; font-weight: 700; color: #0f2c5c; }
.ps-mail-list { border-right: 1px solid #e3e8f0; overflow: hidden; }
.ps-mail-row { padding: 12px 16px; border-bottom: 1px solid #eef1f6; font-size: 13.5px; }
.ps-mail-row.is-new { background: #f2f7ff; }
.ps-mail-row.is-new b { color: #0f1b2d; }
.ps-mail-row .from { display: flex; justify-content: space-between; font-weight: 600; color: #1f2d3d; }
.ps-mail-row .from small { font-weight: 400; color: #6b7a90; }
.ps-mail-row .subj { color: #3b4a60; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-mail-read { padding: 26px 34px; overflow: hidden; }
.ps-mail-read h2 { margin: 0 0 14px; font-size: 22px; font-weight: 500; color: #1f2d3d; }
.ps-mail-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; font-size: 13.5px; color: #44526a; }
.ps-mail-letter { border: 1px solid #e3e8f0; border-radius: 12px; overflow: hidden; }
.ps-mail-letter header { background: #002E5D; color: #fff; padding: 16px 24px; display: flex; align-items: center; gap: 12px; }
.ps-mail-letter .body { padding: 22px 24px; font-size: 15px; line-height: 1.6; color: #2c3a4f; }

/* dashboards (mirror the real sidebar gradient + header) */
.ps-dash { position: absolute; inset: 0; display: grid; grid-template-columns: 236px 1fr; grid-template-rows: 54px 1fr; background: #f4f6f9; }
.ps-dhead { grid-column: 1 / -1; display: flex; align-items: center; gap: 20px; padding: 0 22px; background: #fff; box-shadow: 0 1px 6px rgba(0, 46, 93, .08); z-index: 3; }
.ps-dhead .ps-logo { height: 34px; }
.ps-dhead nav { display: flex; gap: 18px; font-size: 13.5px; font-weight: 500; color: #002E5D; }
.ps-dhead .ps-hright { margin-left: auto; display: flex; align-items: center; gap: 18px; color: #002E5D; font-size: 16px; }
.ps-bell { position: relative; }
.ps-bell b { position: absolute; top: -8px; right: -10px; background: #D20000; color: #fff; font-size: 10.5px; border-radius: 999px; padding: 1px 5px; border: 2px solid #fff; }
.ps-bell.is-ring i { animation: psRing .9s ease; transform-origin: 50% 0; }
@keyframes psRing { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } }
.ps-rolechip { background: rgba(0, 46, 93, .08); padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.ps-ava { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: #dbe4f0; flex: none; }
.ps-side { background: linear-gradient(rgb(0, 24, 72) 0%, rgb(0, 18, 51) 58%, rgb(0, 12, 34) 100%); color: #c9d6ea; padding: 14px 0; overflow: hidden; }
.ps-side .who { display: flex; gap: 10px; align-items: center; padding: 6px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: 8px; }
.ps-side .who strong { color: #fff; font-size: 13.5px; display: block; }
.ps-side .who small { font-size: 10.5px; letter-spacing: .08em; color: #8fa6c8; }
.ps-side a { display: flex; align-items: center; gap: 12px; padding: 10px 20px; margin-right: 12px; font-size: 13.5px; color: #c9d6ea; border-radius: 0 14px 14px 0; transition: background .2s, color .2s; }
.ps-side a i { width: 16px; text-align: center; color: #8fa6c8; }
.ps-side a.is-active { background: rgba(210, 0, 0, .22); color: #fff; box-shadow: inset 3px 0 0 #ff3b3b; }
.ps-side a.is-active i { color: #fff; }
.ps-side a.is-hover { background: rgba(255, 255, 255, .08); color: #fff; }
.ps-main { padding: 22px 26px; overflow: hidden; position: relative; }
.ps-h1 { margin: 0 0 4px; font-size: 24px; color: #001848; font-weight: 700; }
.ps-sub { color: #6b7a90; font-size: 13px; margin-bottom: 16px; }
.ps-tags { display: flex; gap: 8px; margin-bottom: 16px; }
.ps-tag { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 7px; background: #e6f6ec; color: #15803d; border: 1px solid #b7e4c7; }
.ps-tag.blue { background: #e8f1fc; color: #1c5cab; border-color: #c4dbf6; }
.ps-tag.navy { background: #002E5D; color: #fff; border-color: #002E5D; }
.ps-tag.red { background: #fdecec; color: #c62828; border-color: #f5c2c2; }
.ps-tag.amber { background: #fff4dc; color: #9a6400; border-color: #f4d48c; }
.ps-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0, 46, 93, .07); border: 1px solid #e6ebf2; padding: 16px 18px; margin-bottom: 14px; }
.ps-card h3 { margin: 0 0 12px; font-size: 16px; color: #001848; display: flex; align-items: center; gap: 8px; }
.ps-card h3 i { color: #00a9d6; }
.ps-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ps-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.ps-stat { background: #fff; border: 1px solid #e6ebf2; border-radius: 12px; padding: 14px 16px; box-shadow: 0 2px 10px rgba(0, 46, 93, .06); }
.ps-stat small { display: block; color: #6b7a90; font-size: 12px; font-weight: 600; }
.ps-stat strong { display: block; font-size: 26px; color: #001848; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ps-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ps-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #6b7a90; padding: 9px 10px; background: #f6f8fb; border-bottom: 1px solid #e6ebf2; }
.ps-table td { padding: 10px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.ps-table tr.is-new td { animation: psRowIn .6s ease; background: #f0fbff; }
@keyframes psRowIn { from { background: #c9f1ff; } }
.ps-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #eef1f6; color: #44526a; white-space: nowrap; }
.ps-badge.green { background: #e6f6ec; color: #15803d; }
.ps-badge.red { background: #fdecec; color: #c62828; }
.ps-badge.amber { background: #fff4dc; color: #9a6400; }
.ps-badge.blue { background: #e8f1fc; color: #1c5cab; }
.ps-badge.navy { background: #002E5D; color: #fff; }
.ps-exam-card { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: #fff; border: 1px solid #e6ebf2; border-left: 4px solid #00a9d6; border-radius: 12px; padding: 16px 18px; box-shadow: 0 2px 10px rgba(0, 46, 93, .06); animation: psScreenIn .45s ease; }
.ps-exam-card h4 { margin: 0 0 6px; color: #001848; font-size: 16px; }
.ps-exam-meta { display: flex; gap: 16px; font-size: 12.5px; color: #5a6b7e; flex-wrap: wrap; }
.ps-exam-meta i { color: #00a9d6; margin-right: 4px; }
.ps-empty { text-align: center; color: #8a97a8; padding: 26px; font-size: 13.5px; }

/* toast + notification dropdown */
.ps-toast { position: absolute; right: 22px; top: 70px; z-index: 60; min-width: 300px; max-width: 380px; display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; background: #fff; box-shadow: 0 16px 40px rgba(0, 30, 70, .2); border-left: 5px solid #16a34a; animation: psToastIn .35s cubic-bezier(.3, 1.3, .5, 1); font-size: 13.5px; }
.ps-toast i { font-size: 18px; color: #16a34a; margin-top: 1px; }
.ps-toast strong { display: block; color: #0f1b2d; margin-bottom: 2px; }
.ps-toast span { color: #4a5a70; line-height: 1.4; }
.ps-toast.warn { border-left-color: #e09f00; } .ps-toast.warn i { color: #e09f00; }
.ps-toast.bad { border-left-color: #D20000; } .ps-toast.bad i { color: #D20000; }
.ps-toast.info { border-left-color: #1c5cab; } .ps-toast.info i { color: #1c5cab; }
@keyframes psToastIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.ps-dropdown-panel { position: absolute; right: 70px; top: 50px; width: 360px; z-index: 50; background: #fff; border-radius: 12px; box-shadow: 0 20px 45px rgba(0, 30, 70, .22); border: 1px solid #e6ebf2; overflow: hidden; animation: psScreenIn .2s ease; }
.ps-dropdown-panel header { padding: 12px 16px; font-weight: 700; color: #001848; border-bottom: 1px solid #eef1f6; display: flex; justify-content: space-between; }
.ps-notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f0f3f8; font-size: 13px; }
.ps-notif.unread { background: #f2f9ff; }
.ps-notif .ic { width: 34px; height: 34px; border-radius: 50%; background: #e8f1fc; color: #1c5cab; display: flex; align-items: center; justify-content: center; flex: none; }
.ps-notif b { display: block; color: #0f1b2d; margin-bottom: 2px; }
.ps-notif small { color: #8a97a8; }

/* permission prompt (browser-style) */
.ps-perm { position: absolute; left: 20px; top: 8px; z-index: 70; width: 330px; background: #fff; border-radius: 10px; box-shadow: 0 14px 40px rgba(0, 0, 0, .28); padding: 16px 18px; font-size: 13.5px; animation: psScreenIn .2s ease; }
.ps-perm p { margin: 0 0 10px; color: #1f2d3d; }
.ps-perm div.row { display: flex; gap: 10px; align-items: center; color: #44526a; margin-bottom: 6px; }
.ps-perm .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.ps-perm .acts span { padding: 7px 16px; border-radius: 18px; border: 1px solid #c6d0de; color: #1c5cab; font-weight: 600; }
.ps-perm .acts span.allow { background: #1c5cab; color: #fff; border-color: #1c5cab; }

/* camera feed */
.ps-cam { position: relative; overflow: hidden; border-radius: 10px; background: #0b1424; }
.ps-cam svg.room { position: absolute; inset: 0; width: 100%; height: 100%; }
.ps-cam .person { transform-origin: 50% 100%; animation: psBreathe 4.5s ease-in-out infinite; transition: transform .8s ease; }
.ps-cam .person.look-away { animation: none; transform: translateX(-26px) rotate(-11deg); }
.ps-cam .person.gone { animation: none; transform: translateY(240px); }
@keyframes psBreathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2%); } }
.ps-cam .facebox { position: absolute; border: 2px solid #22e07a; border-radius: 6px; transition: all .6s ease; box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); }
.ps-cam .facebox.warn { border-color: #ffb020; }
.ps-cam .facebox.bad { border-color: #ff4d4d; }
.ps-cam .facebox label { position: absolute; left: -2px; top: -20px; background: #22e07a; color: #04210f; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px 4px 4px 0; white-space: nowrap; }
.ps-cam .facebox.warn label { background: #ffb020; color: #2a1900; }
.ps-cam .facebox.bad label { background: #ff4d4d; color: #fff; }
.ps-cam .live { position: absolute; left: 10px; top: 10px; background: #e11d2e; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 3px 7px; border-radius: 4px; display: flex; gap: 5px; align-items: center; }
.ps-cam .live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: psBlink 1.2s steps(1) infinite; }
.ps-cam .camlabel { position: absolute; left: 10px; bottom: 8px; right: 10px; display: flex; justify-content: space-between; font-size: 10.5px; color: #cfe3ff; font-family: ui-monospace, Consolas, monospace; }
.ps-cam .flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
.ps-cam .flash.go { animation: psFlash .45s ease-out; }
@keyframes psFlash { 0% { opacity: .85; } 100% { opacity: 0; } }
/* The scan line is the bottom edge of a full-height layer that slides down,
   so the loop runs on the compositor (transform) rather than relaying out
   the camera every frame (it animated `top` before). */
.ps-cam .scan { position: absolute; left: 0; right: 0; top: 0; height: 100%; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(34, 224, 122, .8), transparent) bottom / 100% 2px no-repeat; animation: psScan 2.4s linear infinite; will-change: transform; }
@keyframes psScan { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* exam page (mirrors enhanced_exam.html split view) */
.ps-exam-banner { height: 92px; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; position: relative; background: linear-gradient(135deg, #002E5D 0%, #0a3d7a 60%, #00507e 100%); }
.ps-exam-banner .ps-logo { position: absolute; left: 22px; top: 24px; height: 44px; background: #fff; border-radius: 8px; padding: 3px 6px; }
.ps-exam-banner h2 { margin: 0; font-size: 21px; letter-spacing: .04em; }
.ps-exam-banner small { display: block; font-size: 12.5px; opacity: .9; }
.ps-exam-body { position: absolute; top: 92px; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 230px 1fr 300px; gap: 14px; padding: 14px; }
.ps-exam-panel { background: #fff; border-radius: 12px; border: 1px solid #e6ebf2; box-shadow: 0 2px 10px rgba(0, 46, 93, .06); padding: 14px; overflow: hidden; }
.ps-timer { text-align: center; padding: 10px; border-radius: 10px; background: #002E5D; color: #fff; margin-bottom: 12px; }
.ps-timer small { display: block; font-size: 11px; opacity: .8; letter-spacing: .05em; }
.ps-timer strong { font-size: 28px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.ps-timer.low { background: #c62828; }
.ps-kv { display: flex; justify-content: space-between; font-size: 12.5px; padding: 6px 0; border-bottom: 1px dashed #e6ebf2; color: #44526a; }
.ps-kv b { color: #001848; font-variant-numeric: tabular-nums; }
.ps-q { padding: 12px 14px; border-radius: 10px; border: 1px solid #eef1f6; margin-bottom: 10px; font-size: 13.5px; transition: border-color .3s, background .3s; }
.ps-q.is-focus { border-color: #00a9d6; background: #f3fbfe; }
.ps-q b { color: #001848; display: block; margin-bottom: 6px; }
.ps-q ol { margin: 0; padding-left: 20px; color: #44526a; list-style: upper-alpha; }
.ps-q ol li { padding: 2px 0; }
.ps-ans { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f0f3f8; font-size: 13px; }
.ps-ans .qn { font-weight: 700; color: #001848; width: 38px; }
.ps-opt { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid #cfd8e5; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #44526a; font-size: 12.5px; transition: all .2s; }
.ps-opt.is-on { background: #2a78d6; border-color: #2a78d6; color: #fff; transform: scale(1.06); }
.ps-saved { position: absolute; right: 330px; bottom: 22px; font-size: 12px; color: #15803d; background: #e6f6ec; border: 1px solid #b7e4c7; padding: 5px 10px; border-radius: 8px; opacity: 0; transition: opacity .3s; }
.ps-saved.show { opacity: 1; }
.ps-submit { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); padding: 12px 34px; border-radius: 999px; background: #16a34a; color: #fff; font-weight: 700; box-shadow: 0 10px 24px rgba(22, 163, 74, .35); display: flex; gap: 8px; align-items: center; }
/* #exam-lockdown-overlay on the real exam page (enhanced_exam.html): near-
   opaque navy over a blurred paper, amber lock, blue gradient button. */
.ps-lock { position: absolute; inset: 0; z-index: 45; background: rgba(8, 15, 35, .93); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); display: flex; align-items: center; justify-content: center; animation: psFade .2s ease; }
.ps-lock-box { width: 440px; background: rgba(15, 23, 42, .92); border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; padding: 34px 30px; text-align: center; color: #fff; }
.ps-lock-box > i { font-size: 40px; color: #fbbf24; }
.ps-lock-box h3 { margin: 12px 0 8px; font-size: 22px; }
.ps-lock-box p { margin: 0 0 20px; color: #cbd5e1; font-size: 14px; line-height: 1.5; }
.ps-lock-btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px; border-radius: 10px; background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; font-weight: 600; font-size: 14.5px; }
.ps-lock-btn i { font-size: 14px; color: #fff; }
/* #secure-mode-gate and the "cannot start" verdict overlay: full-screen
   slate, no card. */
.ps-gate { position: absolute; inset: 0; z-index: 46; background: rgba(15, 23, 42, .97); color: #fff; display: flex; align-items: center; justify-content: center; padding: 32px; text-align: center; animation: psFade .25s ease; font-size: 16px; line-height: 1.6; }
.ps-gate > div { max-width: 560px; }
.ps-gate h2 { margin: 0 0 12px; font-size: 24px; }
.ps-gate p { margin: 0; opacity: .92; white-space: pre-line; }
.ps-gate p.sub { margin-top: 18px; opacity: .7; font-size: 14px; }
.ps-gate-btn { display: inline-block; margin-top: 20px; padding: 13px 26px; border-radius: 10px; background: #1a237e; color: #fff; font-weight: 600; }
/* Narration that is NOT portal UI (the student sees nothing): a dashed
   "simulation note" chip, so it can never be mistaken for a real message. */
.ps-note { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 960; display: flex; align-items: center; gap: 9px; padding: 9px 16px; border-radius: 999px; background: rgba(6, 14, 30, .92); border: 1.5px dashed #36c6f0; color: #bfefff; font: 600 13.5px 'Segoe UI', sans-serif; white-space: nowrap; box-shadow: 0 10px 26px rgba(0, 0, 0, .3); animation: psScreenIn .2s ease; }
.ps-note i { color: #5fdcff; }
/* A picture-in-picture of the student's desk (outside the browser). */
.ps-inset { position: absolute; right: 22px; bottom: 22px; z-index: 955; width: 300px; padding: 12px 14px 14px; border-radius: 14px; background: #0b1324; border: 1.5px dashed #36c6f0; color: #cfe3ff; text-align: center; animation: psPop .35s ease; }
.ps-inset small { display: block; font: 700 10.5px 'Segoe UI', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #5fdcff; margin-bottom: 8px; }
.ps-inset .desk { display: flex; align-items: flex-end; justify-content: center; gap: 22px; }
.ps-inset .desk span { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; transition: opacity .8s, transform .8s; }
/* Browser PDF viewer (marker-annotated examination report). */
.ps-pdfview { position: absolute; inset: 0; background: #525659; display: flex; flex-direction: column; }
.ps-pdfbar { height: 44px; flex: none; background: #323639; color: #f1f1f1; display: flex; align-items: center; gap: 14px; padding: 0 18px; font-size: 13px; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.ps-pdfbar .pg { margin-left: auto; color: #c9c9c9; }
.ps-pdfscroll { flex: 1; overflow: hidden; padding: 22px 0; }
.ps-pdfpage { width: 760px; margin: 0 auto; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .45); padding: 34px 40px 40px; font-family: Arial, Helvetica, sans-serif; color: #000; font-size: 11.5px; }
.ps-pdfpage .bar { border: 1px solid #000; padding: 6px 8px; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.ps-pdfpage table { width: 100%; border-collapse: collapse; margin: 4px 0 8px; }
.ps-pdfpage th, .ps-pdfpage td { border: 1px solid #000; padding: 4px 6px; font-size: 11px; text-align: center; }
.ps-pdfpage th { background: #dcdcdc; font-weight: 700; }
.ps-pdfpage td:first-child { text-align: left; }
.ps-pdfpage .note { font-style: italic; color: #5a5a5a; font-size: 10.5px; line-height: 1.45; margin: 0 0 8px; }

/* checklist rows (pre-exam / environment) */
.ps-checklist { display: grid; gap: 10px; }
.ps-ck { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; border: 1px solid #e6ebf2; background: #fff; font-size: 13.5px; }
.ps-ck .ic { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #eef2f7; color: #6b7a90; }
.ps-ck.ok .ic { background: #e6f6ec; color: #15803d; }
.ps-ck.bad .ic { background: #fdecec; color: #c62828; }
.ps-ck.warn .ic { background: #fff4dc; color: #9a6400; }
.ps-ck b { display: block; color: #001848; }
.ps-ck small { color: #6b7a90; }

/* live monitoring (mirrors the light deployed dashboard) */
.ps-lm { position: absolute; inset: 0; background: #f6f8fc; padding: 0; }
.ps-lm-head { height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 22px; background: #fff; border-bottom: 1px solid #e6ebf2; }
.ps-lm-head h2 { margin: 0; font-size: 18px; color: #0f1b2d; display: flex; gap: 8px; align-items: center; }
.ps-lm-head small { display: block; font-size: 11.5px; color: #6b7a90; font-weight: 400; }
.ps-pill { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; padding: 5px 10px; border-radius: 999px; background: #e8f1fc; color: #1c5cab; display: inline-flex; gap: 6px; align-items: center; }
.ps-pill.live { background: #e6f6ec; color: #15803d; }
.ps-lm-tabs { display: flex; gap: 20px; padding: 0 22px; height: 40px; align-items: center; font-size: 13px; color: #44526a; border-bottom: 1px solid #e6ebf2; background: #fff; }
.ps-lm-tabs span.is-on { color: #1c5cab; font-weight: 700; box-shadow: inset 0 -2px 0 #1c5cab; padding: 11px 0; }
.ps-lm-body { padding: 14px 22px; display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.ps-sess { background: #fff; border-radius: 12px; border: 1px solid #e6ebf2; box-shadow: 0 2px 10px rgba(0, 46, 93, .06); padding: 12px; transition: border-color .3s, box-shadow .3s; }
.ps-sess.risk-med { border-color: #f4c46a; box-shadow: 0 0 0 3px rgba(244, 196, 106, .25); }
.ps-sess.risk-high { border-color: #f19a9a; box-shadow: 0 0 0 3px rgba(241, 154, 154, .3); }
.ps-sess-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.ps-sess-head b { display: block; font-size: 13.5px; color: #0f1b2d; }
.ps-sess-head small { color: #6b7a90; font-size: 11px; }
.ps-sess-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.ps-sess-stats div { background: #f6f8fc; border-radius: 8px; padding: 6px; text-align: center; font-size: 10.5px; color: #6b7a90; }
.ps-sess-stats div b { display: block; font-size: 14px; color: #0f1b2d; font-variant-numeric: tabular-nums; }
.ps-viol { border-left: 4px solid #e09f00; background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0, 46, 93, .06); animation: psToastIn .4s ease; font-size: 12.5px; }
.ps-viol.critical { border-left-color: #D20000; }
.ps-viol .t { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: #9a6400; display: flex; justify-content: space-between; }
.ps-viol.critical .t { color: #c62828; }
.ps-viol b { display: block; margin: 3px 0; color: #0f1b2d; font-size: 13px; }
.ps-viol p { margin: 0; color: #5a6b7e; line-height: 1.4; }

/* charts */
.ps-chart { width: 100%; height: 100%; }
.ps-chart .line { fill: none; stroke: #2a78d6; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ps-chart .area { fill: url(#psArea); }
.ps-chart .grid { stroke: #eef1f6; stroke-width: 1; }
.ps-chart text { font-size: 11px; fill: #6b7a90; font-family: 'Segoe UI', sans-serif; }
.ps-draw { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: psDraw 2.2s ease forwards; }
@keyframes psDraw { to { stroke-dashoffset: 0; } }
.ps-bar { transform-origin: bottom; transform-box: fill-box; animation: psGrow 1.1s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes psGrow { from { transform: scaleY(0); } }

/* chat (mirrors messages_inline.html) */
.ps-chat { display: grid; grid-template-columns: 280px 1fr; height: 100%; background: #fff; border-radius: 12px; border: 1px solid #e6ebf2; overflow: hidden; }
.ps-chat-list { border-right: 1px solid #eef1f6; background: #fafbfd; }
.ps-chat-head { background: linear-gradient(135deg, #001848, #0f2f6b); color: #fff; padding: 14px 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.ps-thread { padding: 12px 16px; border-bottom: 1px solid #eef1f6; font-size: 13px; }
.ps-thread.is-on { background: #e8f1fc; }
.ps-thread b { display: block; color: #0f1b2d; }
.ps-thread small { color: #6b7a90; }
.ps-msgs { display: flex; flex-direction: column; padding: 16px; gap: 10px; height: calc(100% - 118px); overflow: hidden; justify-content: flex-end; }
.ps-bubble { max-width: 70%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; animation: psScreenIn .3s ease; }
.ps-bubble.them { background: #f0f3f8; color: #1f2d3d; border-bottom-left-radius: 4px; align-self: flex-start; }
.ps-bubble.me { background: #0f2f6b; color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.ps-bubble small { display: block; font-size: 10.5px; opacity: .65; margin-top: 4px; }
.ps-typing { align-self: flex-start; background: #f0f3f8; border-radius: 14px; padding: 10px 14px; display: flex; gap: 4px; }
.ps-typing span { width: 7px; height: 7px; border-radius: 50%; background: #8a97a8; animation: psDots 1.2s infinite; }
.ps-typing span:nth-child(2) { animation-delay: .15s; } .ps-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes psDots { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.ps-composer { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid #eef1f6; }
.ps-composer .ps-input { flex: 1; }

/* phone frame (responsive demo) */
.ps-phone { position: absolute; left: 50%; top: 30px; transform: translateX(-50%); width: 330px; height: 690px; border-radius: 44px; background: #0b0f17; padding: 14px; box-shadow: 0 30px 60px rgba(0, 0, 0, .35); animation: psPop .5s ease; }
.ps-phone-screen { position: relative; width: 100%; height: 100%; border-radius: 32px; overflow: hidden; background: #f4f6f9; }

/* pipeline tracker (grading stages) */
.ps-pipe { display: flex; align-items: center; gap: 0; margin: 4px 0 18px; }
.ps-pipe .st { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 150px; text-align: center; font-size: 12px; color: #6b7a90; }
.ps-pipe .st i { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #eef2f7; color: #8a97a8; font-size: 16px; transition: all .35s; }
.ps-pipe .st.is-active i { background: #00a9d6; color: #fff; box-shadow: 0 0 0 6px rgba(0, 169, 214, .18); }
.ps-pipe .st.is-done i { background: #16a34a; color: #fff; }
.ps-pipe .st.is-done, .ps-pipe .st.is-active { color: #001848; font-weight: 600; }
.ps-pipe .ln { flex: 1; height: 3px; background: #e6ebf2; border-radius: 2px; position: relative; overflow: hidden; }
.ps-pipe .ln span { position: absolute; inset: 0; width: 0; background: #16a34a; transition: width .6s ease; }
.ps-pipe .ln.is-done span { width: 100%; }

@media (max-width: 720px) {
    .ps-overlay { padding: 8px; }
    .ps-title { font-size: 16px; }
    .ps-caption p { font-size: 13.5px; }
    .ps-viewport { max-height: calc(100vh - 250px); max-height: calc(100dvh - 250px); }
    .ps-shell { width: 100%; }
    .ps-keyhint { display: none; }
    .sim-launch { padding: 9px 16px; }
    /* Four header buttons beside the title: keep them from wrapping it. */
    .ps-top-actions { gap: 5px; }
    .ps-icon-btn { width: 38px; height: 38px; font-size: 14px; border-radius: 10px; }
    .ps-icon-btn.is-off::after { left: 8px; right: 8px; }
    .ps-kicker { font-size: 10px; letter-spacing: .08em; }
}
/* Portrait phones: the 1280x760 stage at full width is a thin strip, so the
   viewport is roughly square and the camera frames the UI each action
   happens in (Player.frame). Taller than this only adds empty letterbox. */
@media (max-width: 720px) and (orientation: portrait) {
    .ps-viewport { aspect-ratio: auto; height: clamp(240px, min(96vw, calc(100vh - 300px)), 460px); height: clamp(240px, min(96vw, calc(100dvh - 300px)), 460px); max-height: none; padding-top: 0; }
}
/* Phones (either way up): the controls stay on one row - the progress bar
   takes what the buttons leave, the speed picker is compact. */
@media (max-width: 720px), (max-height: 500px) and (orientation: landscape) {
    .ps-controls { flex-wrap: nowrap; gap: 8px; }
    .ps-progress { flex: 1 1 auto; min-width: 0; }
    .ps-speed { flex: none; width: 64px; padding: 0 4px; }
}
/* Phones on their side: about 360-430px of height. Tighten everything round
   the stage so the window, the caption and the controls all fit at once. */
@media (max-height: 500px) and (orientation: landscape) {
    .ps-overlay { padding: 6px 10px; align-items: flex-start; }
    .ps-shell { width: min(100%, max(420px, calc((100vh - 150px) * 1280 / 760))); width: min(100%, max(420px, calc((100dvh - 150px) * 1280 / 760))); gap: 6px; }
    .ps-title { font-size: 15px; }
    .ps-kicker { font-size: 10px; }
    .ps-icon-btn { width: 34px; height: 34px; font-size: 13px; }
    .ps-chrome { height: 28px; }
    .ps-window.is-fullscreen .ps-chrome { margin-top: -28px; }
    .ps-viewport { max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); }
    .ps-caption { min-height: 0; padding: 6px 10px; }
    .ps-caption p { font-size: 12.5px; line-height: 1.35; }
    .ps-chapter { font-size: 10px; }
    .ps-keyhint { display: none; }
}
/* Touch screens: iOS zooms the whole page when a control under 16px is
   focused, so the speed picker must be 16px there. */
@media (pointer: coarse) {
    .ps-speed { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .ps-stage { transition: none; }
    .ps-cam .person, .ps-cam .scan { animation: none; }
}
