/* os.css: STARFRAME 95, the ISEA workstation look, for the RELIANCE site.
   Same palette, fonts and bevels as the promo spots (reliance-reel/src/lib/starframe.js). */

@font-face { font-family: 'Pix'; src: url(../fonts/PixelifySans.ttf) format('truetype'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Term'; src: url(../fonts/VT323.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: 'Orb'; src: url(../fonts/Orbitron.ttf) format('truetype'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Audio'; src: url(../fonts/Audiowide.ttf) format('truetype'); font-display: swap; }

:root {
  /* STARFRAME plastic */
  --face: #eadcb6; --light: #fff8e8; --shadow: #9b8a60; --dark: #2a2414; --text: #1b160c;
  --title: #1828f2; --title2: #2f6bff; --title-text: #fff4d6; --select: #1828f2; --field: #fffaf0; --dim: #7c7258;
  /* the 1984 palette */
  --red: #ff1a0a; --blue: #1828f2; --gold: #ffc21a; --orange: #ff7412; --cream: #ffedb8; --cyan: #18e4ff;
  --green: #24ff4c; --magenta: #ff2bd6; --white: #fff7e0; --navy: #0a1460; --term: #3dff6a;
  --bar-h: 48px;
  /* the tube: how much black bezel shows round the glass, and how round its corners are */
  --bezel: clamp(5px, 1.3vmin, 16px);
  --tube-r: clamp(22px, 5.5vmin, 58px);
  --bevel: inset 2px 2px 0 var(--light), inset -2px -2px 0 var(--shadow), 0 0 0 2px var(--dark);
  --sunken: inset 2px 2px 0 var(--shadow), inset -2px -2px 0 var(--light), 0 0 0 2px var(--dark);
  color-scheme: dark;
}
* { box-sizing: border-box; font-variant-ligatures: none !important; }   /* Pixelify's "fi" ligature reads as "A" */
html, body { margin: 0; height: 100%; overflow: hidden; }
html { background: #000; }
/* the monitor's dark plastic round the tube */
body { background: radial-gradient(ellipse 90% 80% at 50% 40%, #16150f, #050504 70%); }
button, a, input, label { touch-action: manipulation; }
body { font: 400 16px/1.45 'Pix', system-ui, sans-serif; color: var(--white); font-variant-ligatures: none; font-feature-settings: "liga" 0, "clig" 0; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
img[data-icon] { image-rendering: pixelated; width: 32px; height: 32px; flex: none; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px dashed var(--gold); outline-offset: 2px; }

/* ══════════════════════════════════════ the tube
   #screen is the glass: inset from the edges, with big round corners. Inside it, the scanlines
   (#crt) and the glass itself (#glass: dark curved edges, a soft reflection, the bulge's sheen).
   On desktop Chrome / Edge, body.warp also bends the picture (see the SVG filter in index.html). */
#screen { position: fixed; transform-origin: 50% 50%; overflow: hidden; background: #000; isolation: isolate;
  top: max(var(--bezel), env(safe-area-inset-top)); right: max(var(--bezel), env(safe-area-inset-right));
  bottom: max(var(--bezel), env(safe-area-inset-bottom)); left: max(var(--bezel), env(safe-area-inset-left));
  border-radius: var(--tube-r);
  box-shadow: 0 0 0 2px #0a0a08, 0 0 40px rgba(120, 150, 255, 0.07); }
body.warp .warpable { filter: url(#crt-warp); }
#crt { position: absolute; inset: 0; pointer-events: none; z-index: 900; }
body:not(.crt-on) #crt { display: none; }
.crt-lines { position: absolute; inset: 0; overflow: hidden;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.17) 2px 3px),
    repeating-linear-gradient(90deg, rgba(255,40,30,0.045) 0 1px, rgba(40,255,90,0.035) 1px 2px, rgba(50,80,255,0.045) 2px 3px);
  animation: flicker 5s steps(1) infinite; }
.crt-lines::after { content: ''; position: absolute; left: 0; right: 0; height: 28%; top: -30%;
  background: linear-gradient(transparent, rgba(255,255,255,0.025) 50%, transparent); animation: hum 11s linear infinite; }
#glass { position: absolute; inset: 0; pointer-events: none; z-index: 901; border-radius: inherit;
  /* edges fall away into shadow, like the glass curving back toward the bezel */
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), inset 0 0 min(9vmin, 90px) rgba(0,0,0,0.62), inset 0 0 14px 2px rgba(0,0,0,0.7);
  background:
    radial-gradient(ellipse 55% 40% at 24% 10%, rgba(255,255,255,0.075), rgba(255,255,255,0) 70%),   /* the window reflection */
    radial-gradient(ellipse 120% 90% at 50% 45%, rgba(255,255,255,0.025), rgba(255,255,255,0) 60%),  /* the bulge catching light */
    radial-gradient(ellipse 140% 130% at 50% 50%, rgba(0,0,0,0) 62%, rgba(0,0,0,0.38) 100%); }       /* vignette */
#glass::after { content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(168deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 22%); }
body:not(.crt-on) #glass { box-shadow: inset 0 0 30px rgba(0,0,0,0.5); background: none; }
body:not(.crt-on) #glass::after { display: none; }
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: 0.93; } 48% { opacity: 1; } 79% { opacity: 0.96; } }
@keyframes hum { to { top: 110%; } }

/* power on / off */
#screen.tube-on { animation: tubeOn 0.55s cubic-bezier(.2,.7,.2,1); }
#screen.tube-off { animation: tubeOff 0.5s ease-in forwards; }
@keyframes tubeOn { 0% { transform: scale(1, 0.004); filter: brightness(4); } 45% { transform: scale(1, 0.004); filter: brightness(4); } 100% { transform: none; filter: none; } }
@keyframes tubeOff { 0% { transform: none; } 55% { transform: scale(1, 0.004); filter: brightness(3); } 100% { transform: scale(0, 0.004); filter: brightness(6); } }

.stage { position: absolute; inset: 0; display: none; }
.stage.on { display: block; }
.skip-hint { position: absolute; bottom: 4.5vh; left: 0; right: 0; text-align: center; font: 18px 'Term'; color: #6d675a; margin: 0; animation: blink 1.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

/* ══════════════════════════════════════ 0. power */
#power { background: radial-gradient(ellipse 80% 70% at 50% 45%, #10140f 0%, #050605 60%, #000 100%); }
.power-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px 80px; text-align: center; gap: 6px; }
.emblem-canvas { width: 130px; height: 130px; }
#power-emblem { opacity: 0.85; margin-bottom: 6px; }
.power-title { margin: 0; font: 900 clamp(46px, 12vw, 132px)/1 'Orb'; letter-spacing: 0.05em; color: var(--cream);
  text-shadow: 3px 3px 0 var(--red), 6px 6px 0 var(--orange), 9px 9px 0 var(--gold), 0 0 40px rgba(255,120,40,0.35); padding-right: 9px; }
.power-sub { margin: 18px 0 26px; font: 500 clamp(15px, 2.2vw, 19px)/1.5 'Pix'; color: #c9c0a8; }
.power-btn { display: flex; flex-direction: column; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 6px; }
.power-ring { width: 86px; height: 86px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8e8, var(--face) 55%, #b8a77c);
  box-shadow: inset -4px -5px 0 rgba(0,0,0,0.25), 0 0 0 3px var(--dark), 0 0 0 7px #1d1a12, 0 0 34px rgba(36,255,76,0.25);
  position: relative; transition: transform 0.08s; animation: ready 2.2s ease-in-out infinite; }
.power-ring::before { content: ''; position: absolute; inset: 24px; border: 5px solid var(--red); border-top-color: transparent; border-radius: 50%; }
.power-ring::after { content: ''; position: absolute; left: 50%; top: 19px; width: 5px; height: 24px; margin-left: -2.5px; background: var(--red); border-radius: 3px; }
.power-btn:active .power-ring { transform: scale(0.94); }
@keyframes ready { 50% { box-shadow: inset -4px -5px 0 rgba(0,0,0,0.25), 0 0 0 3px var(--dark), 0 0 0 7px #1d1a12, 0 0 50px rgba(36,255,76,0.5); } }
.power-label { font: 700 15px 'Pix'; letter-spacing: 0.2em; text-transform: uppercase; color: var(--green); text-shadow: 0 0 10px rgba(36,255,76,0.6); }
.power-hint { margin: 22px 0 0; font: 18px 'Term'; color: #6f6a5c; letter-spacing: 0.06em; }
.power-quick { position: absolute; bottom: 28px; left: 0; right: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; font: 500 15px 'Pix'; color: #77705f; padding: 0 16px; }
.power-quick a { color: var(--cream); text-decoration: none; border-bottom: 2px solid rgba(255,194,26,0.5); }
.power-quick a:hover { color: var(--gold); }

/* ══════════════════════════════════════ 1. BIOS */
#bios { background: #000; padding: 7vh 6vw; }
#bios-text { margin: 0; font: clamp(17px, 2.3vw, 27px)/1.45 'Term'; color: var(--cream); white-space: pre-wrap; max-width: 70ch; text-shadow: 0 0 6px rgba(255,237,184,0.35); }
#bios-text .dim { color: #b8b0a0; } #bios-text .g { color: var(--green); } #bios-text .faint { color: #7a7466; }
#bios-emblem { position: absolute; top: 6vh; right: 6vw; width: clamp(70px, 11vw, 130px); height: auto; }

/* ══════════════════════════════════════ 2. splash */
#splash { background: #04110b; }
.splash-frame { position: absolute; inset: 6vh 6vw 9vh; border: 2px solid #2bd88a; }
.splash-frame::before, .splash-frame::after { content: ''; position: absolute; background: #04110b; }
.splash-frame::before { left: -4px; right: -4px; top: 30%; height: 38%; }
.splash-frame::after { bottom: -4px; left: 34%; width: 32%; height: 8px; }
#splash > *:not(.splash-frame):not(.skip-hint) { position: relative; }
#splash { display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
#splash.on { display: flex; }
.splash-line { position: absolute !important; top: calc(6vh + 18px); left: calc(6vw + 22px); margin: 0; font: clamp(16px, 2vw, 24px) 'Term'; color: #4dffa6; text-align: left; }
#splash-star { width: min(38vw, 32vh); height: min(38vw, 32vh); }
#splash-word { width: min(80vw, 560px); height: auto; margin-top: 2vh; }
.splash-jp { margin: 4px 0 0; font: clamp(15px, 2vw, 22px) "Yu Gothic", "Hiragino Sans", "MS Gothic", sans-serif; color: #4dffa6; letter-spacing: 0.12em; }
.splash-ed { margin: 4px 0 0; font: 500 clamp(13px, 1.6vw, 17px) 'Pix'; color: #9dffd0; letter-spacing: 0.14em; }
.splash-load { margin-top: 5vh; display: flex; flex-direction: column; align-items: center; gap: 8px; font: 22px 'Term'; color: #9dffd0; }
.splash-load .bar { width: min(64vw, 300px); height: 26px; border: 2px solid #2bd88a; padding: 3px; overflow: hidden; }
.splash-load .bar i { display: block; height: 100%; width: 34%; background: #3dffa0; animation: slide 1.6s linear infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* ══════════════════════════════════════ 3. log-on */
#login { background: linear-gradient(#1a2a9c, #2c44d6 52%, #16238a); overflow: hidden; }
.login-bg { position: absolute; inset: 0; overflow: hidden; }
.login-glow { position: absolute; left: -20%; right: -20%; bottom: 0; height: 46%; pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 50% 128%, rgba(255,194,26,0.95) 0 78%, rgba(255,116,18,0.55) 82%, rgba(255,116,18,0) 96%); opacity: 0.8; }
.stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-band { position: absolute; left: 0; right: 0; background: var(--navy); z-index: 2; }
.login-band.top { top: 0; height: 9vh; min-height: 44px; border-bottom: 3px solid var(--gold); }
.login-band.bottom { bottom: 0; height: 74px; border-top: 3px solid var(--orange); }
.login-foot { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(16px, 4vw, 48px); gap: 12px; }
.login-main { position: absolute; z-index: 1; left: 0; right: 0; top: max(9vh, 44px); bottom: 74px; display: flex; align-items: center; justify-content: center; gap: clamp(20px, 3vw, 44px); padding: 16px clamp(16px, 4vw, 56px); overflow-y: auto; }
.login-left { flex: 1 1 0; max-width: 470px; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
#login-logo { width: min(100%, 460px); height: auto; }
.login-begin { margin: 10px 0 0; font: 500 clamp(17px, 2vw, 22px) 'Pix'; color: var(--light); }
.login-divider { align-self: stretch; width: 2px; margin: 4vh 0; background: linear-gradient(transparent, rgba(255,248,232,0.75), transparent); flex: none; }
.login-right { flex: 1 1 0; max-width: 460px; animation: tileIn 0.55s cubic-bezier(.16,1,.3,1) both; }
@keyframes tileIn { from { transform: translateX(40vw); opacity: 0; } }
/* XP-style user tiles */
.users { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.user-tile { width: 100%; display: flex; align-items: center; gap: 14px; padding: 8px 12px 8px 8px; border: 0; border-radius: 14px 0 0 14px; background: transparent; cursor: pointer; text-align: left; color: var(--light); }
.user-tile:hover, .user-tile:focus-visible { background: linear-gradient(90deg, #0f1f8a, rgba(47,91,255,0.55) 70%, rgba(47,91,255,0)); outline: none; }
.user-tile .pic { width: 60px; height: 60px; flex: none; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: #0a1040; box-shadow: 0 0 0 3px #fff8e8, 0 0 0 5px #0a1460; transition: box-shadow 0.15s; }
.user-tile:hover .pic, .user-tile:focus-visible .pic { box-shadow: 0 0 0 3px var(--gold), 0 0 0 5px #0a1460, 0 0 18px rgba(255,194,26,0.6); }
.user-tile .pic img { width: 44px; height: 44px; }
.user-tile .pic img.photo { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.user-tile .who { flex: 1; min-width: 0; }
.user-tile b { display: block; font: 700 clamp(17px, 1.9vw, 21px)/1.2 'Pix'; }
.user-tile small { display: block; font: 500 14px/1.3 'Pix'; color: #c9d4ff; }
.user-tile .go { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 8px; background: #24d04c; box-shadow: 3px 3px 0 #0a5a1c; color: var(--light); font-size: 15px; opacity: 0; transition: opacity 0.15s; }
.user-tile:hover .go, .user-tile:focus-visible .go { opacity: 1; }
.user-tile.guest .pic { background: #22327a; }
.user-tile.guest b { font-size: clamp(16px, 1.7vw, 19px); }
.field { width: 100%; font: 400 18px 'Pix'; color: var(--text); background: var(--field); border: 0; border-radius: 6px; padding: 8px 12px; box-shadow: var(--sunken); outline: none; caret-color: var(--text); }
.field:focus { box-shadow: var(--sunken), 0 0 0 4px rgba(255,194,26,0.65); }
.field::placeholder { color: #a99d80; }
textarea.field { resize: vertical; min-height: 90px; line-height: 1.4; }
.go-btn { flex: none; width: 56px; height: 48px; border: 0; border-radius: 10px; background: #24d04c; box-shadow: 4px 4px 0 #0a5a1c; cursor: pointer; display: grid; place-items: center; }
.go-btn svg { width: 30px; height: 30px; fill: var(--light); }
.go-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #0a5a1c; background: #13a83a; }
.login-note { margin: 10px 0 0; max-width: 34ch; font: 500 14px/1.45 'Pix'; color: #c9d4ff; }
.turnoff { display: flex; align-items: center; gap: 12px; background: none; border: 0; cursor: pointer; font: 500 16px 'Pix'; color: var(--light); padding: 12px 8px 12px 0; }
.turnoff i { width: 40px; height: 40px; border-radius: 8px; background: var(--red); position: relative; flex: none; }
.turnoff i::before { content: ''; position: absolute; inset: 10px; border: 3px solid var(--light); border-top-color: transparent; border-radius: 50%; }
.turnoff i::after { content: ''; position: absolute; left: 18.5px; top: 7px; width: 3px; height: 13px; background: var(--light); }
.auth { font: 700 13px 'Pix'; color: #c9d4ff; letter-spacing: 0.06em; text-align: right; }

/* dial-up + welcome */
.dlg { position: absolute; z-index: 5; left: 50%; top: 50%; width: min(560px, calc(100vw - 24px)); transform: translate(-50%, -50%); animation: pop 0.25s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(0.6); opacity: 0; } }
.dial-body { padding: 16px 18px 14px; color: var(--text); }
.dial-line { display: flex; align-items: center; gap: 10px; }
.dial-line img { width: 64px; height: 64px; }
.wire { flex: 1; height: 4px; position: relative; background: repeating-linear-gradient(90deg, var(--dark) 0 10px, transparent 10px 18px); }
.wire i { position: absolute; top: -6px; width: 14px; height: 14px; left: 0; animation: data 1.1s linear infinite; opacity: 0; }
.dlg.data .wire i { opacity: 1; }
.wire i:nth-child(1) { background: var(--red); } .wire i:nth-child(2) { background: var(--gold); animation-delay: -0.22s; }
.wire i:nth-child(3) { background: var(--cyan); animation-delay: -0.44s; } .wire i:nth-child(4) { background: var(--green); animation-delay: -0.66s; }
.wire i:nth-child(5) { background: #2f5bff; animation-delay: -0.88s; }
@keyframes data { to { left: calc(100% - 14px); } }
.dial-status { margin: 16px 0 12px; font: 400 18px 'Pix'; }
.leds { display: flex; justify-content: space-around; padding: 10px 8px 6px; border-radius: 8px; background: #2a2414; box-shadow: var(--sunken); }
.leds span { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 700 11px 'Pix'; color: #d8c8a0; }
.leds i { width: 13px; height: 13px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px rgba(255,26,10,0.8); }
.leds i.rx { background: #4a1a10; box-shadow: none; }
.dlg.data .leds i.rx { animation: rx 0.18s steps(2) infinite; }
.dlg.data .leds span:nth-child(6) i { animation-duration: 0.26s; }
@keyframes rx { 50% { background: var(--gold); box-shadow: 0 0 8px rgba(255,194,26,0.9); } }
.dial-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font: 15px 'Pix'; color: var(--dim); gap: 10px; }
#welcome { position: absolute; z-index: 4; left: 0; right: 0; top: max(9vh, 44px); bottom: 74px; background: #1a2a9c; display: flex; flex-direction: column; align-items: center; justify-content: center; animation: fadeIn 0.3s both; }
#welcome-emblem { width: min(52vw, 260px); height: auto; animation: popIn 0.5s cubic-bezier(.3,1.6,.5,1) both; }
.welcome-word { margin: 6px 0 0; font: italic 700 clamp(56px, 11vw, 96px)/1 'Pix'; color: var(--light); text-shadow: 5px 5px 0 var(--navy); }
.welcome-name { margin: 14px 0 0; font: 700 clamp(20px, 3.4vw, 30px) 'Pix'; color: var(--gold); text-align: center; padding: 0 16px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { transform: scale(0.3); opacity: 0; } }

/* ══════════════════════════════════════ shared widgets */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--face); color: var(--text); box-shadow: var(--bevel); font: 500 16px 'Pix'; text-decoration: none; min-height: 40px; }
.btn:active, .btn.pressed { box-shadow: var(--sunken); transform: translate(1px, 1px); }
.btn.big { padding: 12px 20px; font-size: 17px; font-weight: 700; }
.btn.gold { background: var(--gold); }
.link { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.kicker { margin: 0; font: 700 12px 'Pix'; letter-spacing: 0.16em; color: var(--blue); }
.muted { color: #6f6650; }
.small { font-size: 14px; }
.fineprint { font-size: 14px; color: #8a8068; margin-top: 18px; }
.redact { background: var(--text); color: var(--gold); padding: 0 6px; font: 700 13px 'Pix'; letter-spacing: 0.1em; }
.pending { color: var(--dim); font-style: italic; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.stripes { display: flex; gap: 3px; margin: 0 6px 0 auto; flex: none; }
.stripes i { display: block; width: 9px; height: 22px; transform: skewX(-24deg); }
.stripes i:nth-child(1) { background: var(--red); } .stripes i:nth-child(2) { background: var(--gold); }
.stripes i:nth-child(3) { background: var(--cream); } .stripes i:nth-child(4) { background: var(--cyan); }

/* ══════════════════════════════════════ windows */
.win { position: absolute; display: flex; flex-direction: column; padding: 6px; border-radius: 14px; background: var(--face); color: var(--text);
  box-shadow: inset 3px 3px 0 var(--light), inset -3px -3px 0 var(--shadow), 0 0 0 2px var(--dark), 10px 12px 0 rgba(0,0,0,0.45); min-width: 280px; }
.win.opening { animation: winOpen 0.18s ease-out both; }
@keyframes winOpen { from { transform: scale(0.85); opacity: 0; } }
.win-title { display: flex; align-items: center; gap: 8px; height: 40px; flex: none; padding: 0 6px 0 8px; border-radius: 10px 10px 4px 4px;
  background: linear-gradient(90deg, var(--title), var(--title2)); color: var(--title-text); font: 700 17px 'Pix'; user-select: none; touch-action: none; }
.win:not(.focus) .win-title { background: linear-gradient(90deg, #6b6550, #9b927a); }
.win-title > span:first-of-type { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.win-title img { width: 26px; height: 26px; }
.win-title .stripes { margin-left: auto; }
.win-btn { width: 32px; height: 28px; flex: none; border: 0; border-radius: 6px; background: var(--face); box-shadow: var(--bevel); color: var(--text); font: 700 16px/1 'Pix'; cursor: pointer; padding: 0; }
.win-btn:active { box-shadow: var(--sunken); }
.win-btn.x { background: #ff5a3a; }
.win-body { flex: 1; min-height: 0; margin-top: 6px; overflow: auto; border-radius: 6px; position: relative; }
.win.drag { opacity: 0.94; }
.win.drag .win-title { cursor: grabbing; }
.win-title { cursor: grab; }
.win.max { --mi: max(4px, calc(var(--tube-r) * 0.18)); left: var(--mi) !important; top: var(--mi) !important; width: calc(100% - 2 * var(--mi)) !important; height: calc(100% - 2 * var(--mi)) !important; }
.win.min { display: none; }
.app { height: 100%; }
.win-body > .app { display: flex; flex-direction: column; min-height: 100%; }

/* ══════════════════════════════════════ desktop */
#desktop { background: #000; }
#sky { position: absolute; inset: 0; width: 100%; height: 100%; }
#brandmark { position: absolute; right: calc(16px + var(--tube-r) * 0.3); bottom: calc(var(--bar-h) + 18px); pointer-events: none; }
#desk-logo { width: 300px; height: auto; }
#icons { position: absolute; top: max(14px, calc(var(--tube-r) * 0.3)); left: max(10px, calc(var(--tube-r) * 0.28)); bottom: calc(var(--bar-h) + 10px); display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 98px); gap: 4px 6px; align-content: start; }
.dicon { width: 96px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; background: none; border: 0; cursor: pointer; color: var(--light); border-radius: 6px; }
.dicon img { width: 52px; height: 52px; filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.6)); transition: transform 0.1s; }
.dicon span { font: 500 14px/1.2 'Pix'; text-align: center; padding: 1px 4px; border-radius: 3px; text-shadow: 1px 1px 0 #000; }
.dicon:hover img { transform: translateY(-2px); }
.dicon.sel span, .dicon:focus-visible span { background: var(--select); text-shadow: none; }
.dicon:focus-visible { outline: none; }
.dicon.pop { animation: popIn 0.3s cubic-bezier(.3,1.6,.5,1) both; }
#windows { position: absolute; left: 0; top: 0; right: 0; bottom: var(--bar-h); pointer-events: none; }
#windows > .win { pointer-events: auto; }

/* taskbar + start */
#taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: var(--bar-h); z-index: 50; display: flex; align-items: center; gap: 6px; padding: 0 calc(10px + var(--tube-r) * 0.45) 0 calc(8px + var(--tube-r) * 0.5);
  background: var(--face); box-shadow: inset 0 3px 0 var(--light), 0 -2px 0 var(--dark); color: var(--text); }
.start-btn { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 8px; border: 0; border-radius: 9px; background: var(--face); box-shadow: var(--bevel); font: 700 17px 'Pix'; cursor: pointer; flex: none; }
.start-btn[aria-expanded="true"] { box-shadow: var(--sunken); }
.start-btn canvas { width: 26px; height: 26px; }
.quick-launch { display: flex; gap: 2px; padding: 0 6px; border-left: 2px solid var(--shadow); border-right: 2px solid var(--shadow); flex: none; }
.quick-launch button { background: none; border: 0; padding: 3px; cursor: pointer; border-radius: 4px; }
.quick-launch button:hover { background: rgba(255,255,255,0.4); }
.quick-launch img { width: 28px; height: 28px; display: block; }
.task-buttons { flex: 1; display: flex; gap: 5px; min-width: 0; overflow: hidden; }
.task-btn { flex: 0 1 190px; min-width: 44px; height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border: 0; border-radius: 8px; background: var(--face); box-shadow: var(--bevel); cursor: pointer; font: 700 14px 'Pix'; overflow: hidden; }
.task-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-btn img { width: 22px; height: 22px; }
.task-btn.active { box-shadow: var(--sunken); background: #f6ecd0; }
.tray { flex: none; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 8px; box-shadow: var(--sunken); background: var(--face); }
.tray-btn { background: none; border: 0; padding: 0; width: 26px; height: 26px; cursor: pointer; display: grid; place-items: center; }
.tray-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tray-btn .spk { fill: var(--text); }
.tray-btn .mute { display: none; stroke: var(--red); }
body.muted .tray-btn .mute { display: block; } body.muted .tray-btn .wave { display: none; }
.tray-modem { position: relative; display: flex; }
.tray-modem img { width: 24px; height: 24px; }
.tray-modem i { position: absolute; right: -2px; bottom: 1px; width: 6px; height: 5px; background: var(--green); animation: blink 0.5s steps(2) infinite; }
.clock { font: 500 16px 'Pix'; min-width: 44px; text-align: right; }

.startmenu { position: absolute; z-index: 60; left: 8px; bottom: calc(var(--bar-h) - 2px); width: min(310px, calc(100vw - 16px)); max-height: calc(100% - var(--bar-h) - 8px); display: flex; padding: 6px;
  border-radius: 12px; background: var(--face); color: var(--text); box-shadow: inset 3px 3px 0 var(--light), inset -3px -3px 0 var(--shadow), 0 0 0 2px var(--dark), 8px 8px 0 rgba(0,0,0,0.4);
  animation: smIn 0.22s cubic-bezier(.16,1,.3,1) both; transform-origin: bottom left; }
@keyframes smIn { from { transform: translateY(30px); opacity: 0; } }
.sm-banner { width: 40px; flex: none; border-radius: 8px 0 0 8px; background: linear-gradient(0deg, var(--title), #0a1040); position: relative; overflow: hidden; }
.sm-banner span { position: absolute; left: 50%; bottom: 14px; transform-origin: 0 0; transform: rotate(-90deg) translateY(-50%); white-space: nowrap; font: 24px 'Audio'; color: var(--light); }
.sm-banner b { font-weight: 400; color: var(--red); margin-left: 6px; }
.sm-items { list-style: none; margin: 0; padding: 4px 0 4px 6px; flex: 1; overflow-y: auto; }
.sm-items li.sep { height: 0; margin: 6px 4px; border-top: 2px solid var(--shadow); border-bottom: 2px solid var(--light); }
.sm-items button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 6px; background: none; cursor: pointer; font: 500 16px 'Pix'; text-align: left; color: var(--text); }
.sm-items button:hover, .sm-items button:focus-visible { background: var(--select); color: var(--light); outline: none; }
.sm-items button.talos:hover { background: #0a5a1c; color: var(--green); }
.sm-items img { width: 26px; height: 26px; }
.sm-items .state { margin-left: auto; font-size: 13px; opacity: 0.75; }

.balloon { position: absolute; z-index: 40; right: 14px; bottom: calc(var(--bar-h) + 16px); display: flex; gap: 12px; align-items: flex-start; max-width: min(340px, calc(100vw - 28px)); padding: 12px 14px; text-align: left;
  background: #fff8d8; color: var(--text); border: 3px solid var(--dark); border-radius: 16px; cursor: pointer; font: 400 15px 'Pix'; box-shadow: 6px 6px 0 rgba(0,0,0,0.35); animation: popIn 0.3s cubic-bezier(.3,1.6,.5,1) both; }
.balloon::after { content: ''; position: absolute; right: 64px; bottom: -17px; width: 22px; height: 22px; background: #fff8d8; border-right: 3px solid var(--dark); border-bottom: 3px solid var(--dark); transform: skewY(40deg) rotate(45deg); transform-origin: 0 0; }
.balloon b { display: block; font-size: 16px; }
.balloon small { display: block; color: var(--dim); margin-top: 3px; }
.balloon img { width: 36px; height: 36px; }

#toast { position: fixed; z-index: 900; left: 50%; bottom: calc(var(--bar-h) + 24px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: 0.25s;
  padding: 10px 16px; border-radius: 10px; background: #fff8d8; color: var(--text); border: 3px solid var(--dark); font: 500 16px 'Pix'; box-shadow: 5px 5px 0 rgba(0,0,0,0.35); max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ══════════════════════════════════════ document-style apps */
.doc { padding: 20px 22px 26px; background: var(--field); box-shadow: var(--sunken); border-radius: 6px; margin: 2px; flex: 1; color: var(--text); }
.doc-h { margin: 4px 0 8px; font: 700 26px/1.15 'Pix'; }
.doc p { margin: 0 0 12px; }
.sec-h { margin: 18px 0 10px; font: 700 19px 'Pix'; color: var(--blue); }
.tip { font-size: 14px; color: var(--dim); margin-top: 16px !important; }

.launchers { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 16px 0; }
.launcher { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--face); box-shadow: var(--bevel); cursor: pointer; text-align: left; color: var(--text); }
.launcher:active { box-shadow: var(--sunken); }
.launcher img { width: 40px; height: 40px; }
.launcher b { display: block; font: 700 16px 'Pix'; }
.launcher small { display: block; font: 400 13px/1.3 'Pix'; color: #6f6650; }
.latest { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: #0a1040; color: var(--light); }
.latest p { margin: 0; flex: 1; font-size: 15px; }
.latest img { width: 40px; height: 40px; }

/* mission brief: an ISEA Navigator page */
.nav-bar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 4px 2px 8px; }
.nav-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.nb { padding: 6px 12px; border: 0; border-radius: 7px; background: var(--face); box-shadow: var(--bevel); font: 700 15px 'Pix'; cursor: pointer; color: var(--text); }
.nb.on { background: var(--select); color: var(--light); box-shadow: var(--sunken); }
.address { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; font: 700 13px 'Pix'; color: var(--dim); }
.address code { flex: 1; padding: 5px 10px; border-radius: 6px; background: var(--field); box-shadow: var(--sunken); font: 18px 'Term'; color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page { flex: 1; min-height: 0; overflow: auto; padding: 22px clamp(16px, 4vw, 40px) 30px; background: var(--field); box-shadow: var(--sunken); border-radius: 6px; margin: 2px; }
.tab-panel { display: none; }
.tab-panel.on { display: block; }
.masthead, .form-head { display: flex; align-items: center; gap: 18px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 3px double var(--shadow); }
.mast-emblem { width: 96px; height: 96px; flex: none; }
.film-title { margin: 2px 0; font: 900 clamp(38px, 6vw, 58px)/1 'Orb'; letter-spacing: 0.04em; color: var(--text); text-shadow: 2px 2px 0 var(--red), 4px 4px 0 var(--orange), 6px 6px 0 var(--gold); }
.motto { margin: 8px 0 0 !important; font: italic 500 16px 'Pix'; color: var(--dim); }
.lede { font-size: 19px; line-height: 1.5; }
.page p { max-width: 68ch; }
.callout-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 6px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.file { padding: 12px 14px 4px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 2px var(--shadow); border-top: 6px solid var(--blue); }
.file:nth-child(4n+2) { border-top-color: var(--red); } .file:nth-child(4n+3) { border-top-color: var(--gold); } .file:nth-child(4n+4) { border-top-color: var(--cyan); }
.file h4 { margin: 0 0 6px; font: 700 17px 'Pix'; }
.file p { font-size: 15px; }
.crew { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.crew-card { display: flex; gap: 14px; padding: 12px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 2px var(--shadow); }
.crew-card h4 { margin: 0 0 6px; font: 700 19px 'Pix'; }
.crew-photo { width: 104px; height: 138px; flex: none; border-radius: 6px; overflow: hidden; background: #04120a; box-shadow: 0 0 0 3px var(--dark); display: grid; place-items: center; }
.crew-photo img { width: 100%; height: 100%; object-fit: cover; }
.crew-photo.nophoto span { font: 16px/1.2 'Term'; color: #2c8a4a; text-align: center;
  background: repeating-linear-gradient(transparent 0 3px, rgba(36,255,76,0.06) 3px 4px); }
.crew-photo.face canvas { width: 88%; height: 88%; object-fit: contain; display: block; }
.rank { margin: 0 !important; font: 700 12px 'Pix'; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); }
.quote { font-size: 15px; font-style: italic; color: #4c4433; }
.actor { font-size: 15px; margin-bottom: 0 !important; }
.credits { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.credits dt { font-weight: 700; color: var(--dim); }
.credits dd { margin: 0; }
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.log li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 10px 12px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 2px var(--shadow); font-size: 15px; }
.log time { font: 19px 'Term'; color: var(--blue); min-width: 92px; }
.press-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 14px; }
.press-item { display: block; padding: 14px; border: 0; border-radius: 10px; background: var(--face); box-shadow: var(--bevel); font: 700 17px 'Pix'; text-decoration: none; color: var(--text); text-align: left; cursor: pointer; }
.press-item small { display: block; font-weight: 400; font-size: 14px; color: #6f6650; margin-top: 2px; }
.press-item.pending-link::after { content: 'LINK PENDING'; display: inline-block; margin-top: 6px; font: 700 11px 'Pix'; letter-spacing: 0.1em; padding: 2px 6px; border-radius: 4px; background: var(--dark); color: var(--gold); }

/* tabs (helios) */
.tabs { flex: none; display: flex; gap: 4px; padding: 2px 2px 8px; flex-wrap: wrap; }
.tab { padding: 7px 14px; border: 0; border-radius: 7px; background: var(--face); box-shadow: var(--bevel); font: 700 15px 'Pix'; cursor: pointer; color: var(--text); }
.tab.on { background: var(--select); color: var(--light); box-shadow: var(--sunken); }
.app[data-app="helios"] > .tab-panel.on { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* HELIOS.SYS */
.helios { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 290px; gap: 8px; }
.cad { position: relative; min-height: 300px; border-radius: 8px; overflow: hidden; box-shadow: var(--sunken); touch-action: none; cursor: grab;
  background: #000 linear-gradient(rgba(24,40,242,0.35) 1px, transparent 1px) 0 0 / 100% 25%, linear-gradient(90deg, rgba(24,40,242,0.35) 1px, transparent 1px) 0 0 / 12.5% 100%; background-color: #010208; }
.cad:active { cursor: grabbing; }
#helios-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hud { position: absolute; font: 17px/1.15 'Term'; color: var(--gold); text-shadow: 0 0 6px currentColor; pointer-events: none; letter-spacing: 0.04em; }
.hud .g { color: var(--green); }
.hud.tl { left: 14px; top: 10px; } .hud.tr { right: 14px; top: 10px; color: var(--cyan); text-align: right; }
.hud.bl { left: 14px; bottom: 10px; color: #4a5cff; }
.specs { overflow: auto; padding: 14px 16px; border-radius: 8px; background: var(--field); box-shadow: var(--sunken); }
.ship-name { margin: 2px 0 10px; font: 900 34px/1 'Orb'; letter-spacing: 0.06em; text-shadow: 2px 2px 0 var(--red), 4px 4px 0 var(--gold); }
.spec-list { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 0 0 14px; font-size: 15px; }
.spec-list dt { color: var(--dim); font-weight: 700; } .spec-list dd { margin: 0; font: 19px/1.15 'Term'; color: var(--blue); }
.sys-h { margin: 0 0 6px; font: 700 12px 'Pix'; letter-spacing: 0.12em; color: var(--dim); }
.sys-btns { display: flex; flex-wrap: wrap; gap: 5px; }
.sys-btn { display: flex; align-items: center; gap: 6px; padding: 5px 9px; border: 0; border-radius: 6px; background: var(--face); box-shadow: var(--bevel); font: 700 13px 'Pix'; cursor: pointer; color: var(--text); }
.sys-btn i { width: 12px; height: 12px; border-radius: 3px; box-shadow: 0 0 0 2px var(--dark); }
.sys-btn.on { background: var(--dark); color: var(--light); box-shadow: var(--sunken); }
.sys-card { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #020a04; color: var(--term); font: 18px/1.25 'Term'; min-height: 100px; box-shadow: 0 0 0 2px var(--dark); }
.sys-card b { display: block; font-weight: 400; font-size: 21px; color: var(--sys, var(--gold)); text-shadow: 0 0 6px currentColor; margin-bottom: 4px; }
.sys-card span { display: block; }

/* the TV set (portrait) */
.tv { position: relative; aspect-ratio: 9 / 16; width: 100%; max-height: 100%; padding: 12px 12px 30px; border-radius: 22px; margin: 0 auto;
  background: linear-gradient(160deg, #3a352a, #17150f 60%); box-shadow: inset 2px 2px 0 rgba(255,255,255,0.12), inset -3px -3px 0 rgba(0,0,0,0.5), 0 0 0 2px #000; }
.tv video { width: 100%; height: 100%; display: block; border-radius: 14px; background: #000; object-fit: contain; }
.tv-badge { position: absolute; left: 18px; bottom: 7px; font: 900 12px 'Orb'; letter-spacing: 0.2em; color: #a59c84; }
.tv-led { position: absolute; right: 20px; bottom: 11px; width: 8px; height: 8px; border-radius: 50%; background: #3a120c; }
.tv.playing .tv-led { background: var(--green); box-shadow: 0 0 8px var(--green); }
.tv-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px; }
.tv-wrap .tv { width: auto; height: calc(100% - 50px); min-height: 360px; }
.tv-cap { margin: 0; max-width: 60ch; text-align: center; font-size: 15px; color: var(--text); }

/* TAPE VAULT */
.vault { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(230px, 310px) 1fr; grid-template-rows: auto 1fr; gap: 10px; }
.vault-player { display: contents; }
.vault-player .tv { grid-row: 1 / 3; grid-column: 1; align-self: start; }
.vault-info { grid-column: 2; padding: 12px 16px; border-radius: 8px; background: var(--field); box-shadow: var(--sunken); }
.vault-info h3 { margin: 2px 0 4px; font: 700 22px/1.2 'Pix'; }
.vault-info p { margin: 0 0 8px; }
.vault-list { grid-column: 2; min-height: 0; overflow: auto; display: grid; gap: 8px; align-content: start; padding: 2px 4px 6px 2px; }
.vault-cat { margin: 8px 0 0; font: 700 12px 'Pix'; letter-spacing: 0.14em; color: var(--dim); text-transform: uppercase; }
.tape { position: relative; display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px 12px 8px 8px; border: 0; border-radius: 8px; cursor: pointer; text-align: left;
  background: #1b1915; color: var(--text); box-shadow: inset 2px 2px 0 #3a362c, inset -2px -2px 0 #000, 0 0 0 2px #000; }
.tape img { width: 46px; height: 82px; object-fit: cover; border-radius: 4px; flex: none; background: #000; box-shadow: 0 0 0 2px #000; }
.tape-label { flex: 1; min-width: 0; padding: 6px 10px; border-radius: 4px; background: var(--light); box-shadow: inset 0 6px 0 var(--red), inset 0 9px 0 var(--gold); padding-top: 14px; }
.tape:nth-child(3n) .tape-label { box-shadow: inset 0 6px 0 var(--blue), inset 0 9px 0 var(--cyan); }
.tape:nth-child(3n+1) .tape-label { box-shadow: inset 0 6px 0 var(--orange), inset 0 9px 0 var(--cream); }
.tape-label code { display: block; font: 16px/1 'Term'; color: var(--dim); }
.tape-label b { display: block; font: 700 16px/1.2 'Pix'; }
.tape-label small { display: block; font: 400 13px 'Pix'; color: #6f6650; }
.tape.on { box-shadow: inset 2px 2px 0 #3a362c, inset -2px -2px 0 #000, 0 0 0 2px #000, 0 0 0 5px var(--gold); }
.tape .sticker { position: absolute; right: 10px; top: 6px; padding: 1px 7px; background: var(--red); color: var(--light); font: 700 12px 'Pix'; letter-spacing: 0.1em; transform: rotate(6deg); border-radius: 3px; }

/* CREW DOSSIER */
.positions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 8px; }
.positions > div { padding: 10px 14px; border-radius: 8px; background: #0a1040; color: var(--light); }
.positions h4 { margin: 0 0 4px; font: 700 16px 'Pix'; color: var(--gold); letter-spacing: 0.06em; }
.positions p { margin: 0; font-size: 14px; }
.form fieldset { border: 0; margin: 16px 0 0; padding: 14px 14px 8px; border-radius: 10px; background: var(--face); box-shadow: var(--bevel); }
.form legend { float: left; width: calc(100% + 28px); margin: -14px -14px 12px; padding: 6px 12px; border-radius: 8px 8px 3px 3px; background: linear-gradient(90deg, var(--title), var(--title2)); color: var(--title-text); font: 700 15px 'Pix'; }
.form legend + * { clear: left; }
.form label { display: block; font: 700 14px 'Pix'; margin-bottom: 10px; }
.form label .field { margin-top: 4px; font-size: 17px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field-h { margin: 6px 0 6px !important; font: 700 14px 'Pix'; }
.radios, .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-block !important; margin: 0 !important; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 6px 12px; border-radius: 16px; background: var(--field); box-shadow: 0 0 0 2px var(--dark); font: 500 14px 'Pix'; }
.chip input:checked + span { background: var(--blue); color: var(--light); }
.chip input:focus-visible + span { outline: 2px dashed var(--gold); outline-offset: 2px; }
.photo-pick { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.photo-pick p { flex: 1; min-width: 200px; margin: 0 0 8px !important; }
.file-btn { position: relative; margin: 0 0 8px !important; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.checks { margin: 14px 2px 4px; display: grid; gap: 8px; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font: 400 15px 'Pix' !important; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--blue); flex: none; }
.form-err { color: #c4140a; font-weight: 700; min-height: 1.4em; margin: 6px 0 !important; }
.transmit { background: #24d04c; color: var(--text); width: 100%; font-size: 19px; }
.badge-out { text-align: center; padding-top: 6px; }
.badge-out .callout-row { justify-content: center; }
.badge-wrap { display: flex; justify-content: center; margin: 12px 0; }
#badge-canvas { width: min(300px, 80%); height: auto; border-radius: 14px; box-shadow: 8px 10px 0 rgba(0,0,0,0.3); animation: printIn 1.6s steps(24) both; }
@keyframes printIn { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

/* ISEA-NET */
.comms-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.comms-head img { width: 64px; height: 64px; }
.channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.channel { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 2px var(--shadow); }
.channel img { width: 40px; height: 40px; }
.channel h4 { margin: 0; font: 700 17px 'Pix'; }
.channel .handle { display: block; font: 19px 'Term'; color: var(--blue); }
.channel p { margin: 2px 0 8px; font-size: 14px; color: #6f6650; }
.channel .btn { min-height: 34px; padding: 5px 12px; font-size: 14px; }
.pill { display: inline-block; font: 700 11px 'Pix'; letter-spacing: 0.1em; padding: 2px 7px; border-radius: 4px; background: var(--dark); color: var(--gold); }
.mailbox { margin: 18px 0 14px; padding: 14px; border-radius: 10px; background: var(--face); box-shadow: var(--bevel); }
.mailbox h4 { margin: 0 0 2px; font: 700 17px 'Pix'; }
.mail-form { display: flex; gap: 8px; margin-top: 8px; }
.mail-form .field { flex: 1; min-width: 0; }

/* FUEL DRIVE */
.gauge { margin: 16px 0; padding: 14px; border-radius: 10px; background: #14120d; box-shadow: inset 2px 2px 0 #000, 0 0 0 2px var(--dark); }
.gauge-cells { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; }
.gauge-cells i { height: 26px; border-radius: 3px; background: #2e2a1f; }
/* the cells charge up one after another: the campaign is live */
.gauge-cells i { animation: charge 3.2s ease-in-out infinite; }
.gauge-cells i:nth-child(1) { animation-delay: 0.00s; }
.gauge-cells i:nth-child(2) { animation-delay: 0.14s; }
.gauge-cells i:nth-child(3) { animation-delay: 0.28s; }
.gauge-cells i:nth-child(4) { animation-delay: 0.42s; }
.gauge-cells i:nth-child(5) { animation-delay: 0.56s; }
.gauge-cells i:nth-child(6) { animation-delay: 0.70s; }
.gauge-cells i:nth-child(7) { animation-delay: 0.84s; }
.gauge-cells i:nth-child(8) { animation-delay: 0.98s; }
.gauge-cells i:nth-child(9) { animation-delay: 1.12s; }
.gauge-cells i:nth-child(10) { animation-delay: 1.26s; }
.gauge-cells i:nth-child(11) { animation-delay: 1.40s; }
.gauge-cells i:nth-child(12) { animation-delay: 1.54s; }
@keyframes charge { 0%, 100% { background: #2e2a1f; box-shadow: none; } 25%, 60% { background: var(--gold); box-shadow: 0 0 10px var(--orange); } }
.gauge p { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 10px 0 0 !important; font: 20px 'Term'; color: #a59c84; }
.gauge b { font-weight: 400; color: var(--orange); animation: blink 1.2s steps(2) infinite; }
.fund-btns { display: grid; grid-template-columns: 1fr; gap: 12px; }
.fund-btn.gfm { min-height: 112px; }
.fund-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 96px; padding: 14px; border-radius: 12px; text-decoration: none; color: var(--text);
  box-shadow: inset 3px 3px 0 rgba(255,255,255,0.6), inset -3px -3px 0 rgba(0,0,0,0.25), 0 0 0 2px var(--dark), 5px 6px 0 rgba(0,0,0,0.3); }
.fund-btn:active { transform: translate(3px, 4px); box-shadow: inset 3px 3px 0 rgba(0,0,0,0.25), 0 0 0 2px var(--dark); }
.fund-btn b { font: 900 22px 'Orb'; letter-spacing: 0.04em; }
.fund-btn small { font: 700 13px 'Pix'; letter-spacing: 0.12em; text-transform: uppercase; }
.fund-btn.gfm { background: #24d04c; } .fund-btn.igg { background: #ff5fd8; }
.powers { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.powers li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 2px var(--shadow); font-size: 15px; }
.powers img { width: 36px; height: 36px; }

/* TALOS.EXE */
.app[data-app="talos"] { background: #020a04; border-radius: 6px; box-shadow: 0 0 0 2px #000; }
.term { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 18px; font: 22px/1.25 'Term'; color: var(--term); text-shadow: 0 0 6px rgba(61,255,106,0.55); cursor: text; }
.term-out { flex: 1; min-height: 0; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.term-out .dim { color: #1d9a40; } .term-out .me { color: var(--cream); text-shadow: 0 0 6px rgba(255,237,184,0.4); } .term-out .warn { color: var(--gold); }
.term-out pre { margin: 6px 0; font: 7px/7px monospace; color: var(--term); }
.term-in { display: flex; gap: 10px; flex: none; padding-top: 6px; }
.term-in input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--cream); font: inherit; caret-color: var(--term); text-shadow: 0 0 6px rgba(255,237,184,0.4); }

/* DISPOSAL */
.bin-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; }
.bin-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; background: none; border-radius: 6px; cursor: pointer; font: 500 16px 'Pix'; color: var(--text); text-align: left; }
.bin-list button:hover, .bin-list button.on { background: var(--select); color: var(--light); }
.bin-note { min-height: 3em; padding: 10px 12px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 2px var(--shadow); }

.nojs { position: fixed; inset: 0; z-index: 2000; background: #000; color: var(--cream); padding: 40px 24px; font: 18px/1.5 sans-serif; overflow: auto; }

/* ══════════════════════════════════════ window extras */
.wb { display: flex; gap: 4px; flex: none; }
.win.talos-win .win-title { background: linear-gradient(90deg, #0a5a1c, #24c04c); color: #eaffea; }
.win.talos-win:not(.focus) .win-title { background: linear-gradient(90deg, #22402a, #4d6e55); }
.app[data-app="talos"] { display: flex; flex-direction: column; }
.blink { animation: blink 1.2s steps(2) infinite; }

/* ══════════════════════════════════════ each account's colours */
body[data-theme="basic"] { --title: #000080; --title2: #1084d0; --select: #000080; }     /* Reznov: never changed the default */
body[data-theme="lab"] { --title: #0a4a34; --title2: #1c9c66; --select: #0a6a44; }       /* Gray: lab green */
body[data-theme="arcade"] { --title: #a0106e; --title2: #ff7412; --select: #a0106e; }    /* Winchester: neon */
body[data-theme="basic"] .dicon span { text-shadow: none; }
#wall-gl { position: absolute; inset: 0; width: 100%; height: 100%; }
.sm-items .sm-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; margin-bottom: 4px; border-bottom: 2px solid var(--shadow); }
.sm-user .pic { width: 42px; height: 42px; flex: none; border-radius: 8px; overflow: hidden; background: #0a1040; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--dark); }
.sm-user .pic img { width: 30px; height: 30px; }
.sm-user .pic img.photo { width: 100%; height: 100%; object-fit: cover; }
.sm-user b { font: 700 16px/1.2 'Pix'; }

/* ══════════════════════════════════════ Reznov */
.tour-head { display: flex; gap: 14px; align-items: flex-start; }
.tour-head img { width: 56px; height: 56px; }
.notepad { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 2px; border-radius: 6px; background: var(--field); box-shadow: var(--sunken); }
.np-menu { display: flex; gap: 16px; padding: 4px 12px; border-bottom: 2px solid var(--shadow); font: 500 14px 'Pix'; color: var(--text); }
.np-menu span::first-letter { text-decoration: underline; }
.np-text { flex: 1; margin: 0; padding: 14px 16px; overflow: auto; font: 20px/1.3 'Term'; color: var(--text); white-space: pre-wrap; }

/* ══════════════════════════════════════ Gray: the Ichor Lab */
.lab { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 300px; gap: 8px; }
.lab-view { position: relative; min-height: 320px; border-radius: 8px; overflow: hidden; box-shadow: var(--sunken); background: #020a06; }
#ichor-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
#ichor-canvas:active { cursor: grabbing; }
.lab-view .hud.tl { color: #9dffd0; } .lab-view .hud.bl { color: #2c8a4a; }
.lab-modes { position: absolute; right: 12px; bottom: 10px; display: flex; gap: 4px; }
.lab-mode { padding: 4px 10px; border: 1px solid rgba(36,255,76,0.5); border-radius: 5px; background: rgba(2,10,6,0.75); color: #9dffd0; font: 17px 'Term'; cursor: pointer; }
.lab-mode.on { background: var(--green); color: #02140a; }
.lab-fallback { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; text-align: center; font: 22px 'Term'; color: var(--term); }
.lab-panel { min-height: 0; overflow: auto; padding: 14px 16px; border-radius: 8px; background: var(--field); box-shadow: var(--sunken); display: flex; flex-direction: column; gap: 8px; }
.lab-panel > * { flex-shrink: 0; }
.lab-panel .spec-list { margin: 0; }
.lab-panel .sys-card { margin: 0; min-height: 70px; }
.spectrum { width: 100%; height: 90px; flex: none; border-radius: 6px; box-shadow: 0 0 0 2px var(--dark); }
.obs-form { display: grid; gap: 6px; }
.obs-form label { font: 700 14px 'Pix'; }
.obs-form textarea { min-height: 56px; font-size: 16px; }

/* ══════════════════════════════════════ Winchester: DIAG.EXE */
.app[data-app="diag"] { background: #0a0806; border-radius: 6px; }
.diag { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; color: #ffb36b; font: 18px 'Term'; }
.diag-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.dpanel { padding: 8px 10px; border: 1px solid rgba(255,116,18,0.45); border-radius: 6px; background: #120d08; }
.dpanel.wide { grid-column: 1 / -1; }
.dpanel h4 { margin: 0 0 6px; font: 16px 'Term'; color: var(--orange); letter-spacing: 0.08em; }
.dpanel p { margin: 6px 0 0; }
.dpanel b { font-weight: 400; color: var(--gold); }
.nozzles { display: flex; gap: 6px; height: 74px; }
.nozzles i { flex: 1; position: relative; display: flex; align-items: flex-end; background: #2e2a1f; border-radius: 3px; }
.nozzles b { display: block; width: 100%; border-radius: 3px; background: linear-gradient(var(--gold), var(--orange)); transition: height 0.12s; }
.nozzles span { position: absolute; left: 0; right: 0; bottom: 1px; text-align: center; font-size: 14px; color: #1b160c; }
.dial { width: 100%; height: 86px; display: block; }
.pods { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; align-items: center; }
.pods i { height: 14px; border-radius: 3px; overflow: hidden; background: #2e2a1f; }
.pods i b { display: block; height: 100%; background: var(--cyan); transition: width 0.12s; }
.dstat { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dstat li { display: flex; justify-content: space-between; gap: 8px; }
.dstat b.warn, .diag-log .warn { color: var(--red); }
.dgraph { width: 100%; height: 80px; display: block; }
.diag-log { flex: 1; min-height: 90px; overflow: auto; padding: 8px 10px; border-radius: 6px; background: #000; border: 1px solid rgba(255,116,18,0.3); color: #ffcf8a; font: 17px/1.25 'Term'; }
.diag-log p { margin: 0; }
.diag-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.app[data-app="diag"].hot .dpanel { border-color: var(--red); animation: blink 0.3s steps(2) infinite; }

/* ══════════════════════════════════════ Winchester: MIXTAPE.EXE */
.app[data-app="mixtape"] { background: #1b1915; border-radius: 6px; }
.deck { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.cassette { width: 100%; max-width: 340px; margin: 0 auto; padding: 12px; border-radius: 12px; background: linear-gradient(#2b2924, #141310); box-shadow: inset 2px 2px 0 #4a463a, inset -2px -2px 0 #000, 0 0 0 2px #000; flex: none; }
.cs-label { padding: 16px 12px 6px; border-radius: 6px; background: var(--light); box-shadow: inset 0 8px 0 var(--orange), inset 0 12px 0 var(--magenta); color: var(--text); }
.cs-label b { display: block; font: 700 16px 'Pix'; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-label small { font: 15px 'Term'; color: var(--dim); }
.cs-window { position: relative; width: 72%; height: 64px; margin: 10px auto 0; padding: 0 7%; display: flex; align-items: center; justify-content: space-between; border-radius: 32px; background: #0a0806; box-shadow: inset 0 0 0 2px #000, inset 0 0 0 4px #3a362c; }
.reel { width: 48px; height: 48px; border-radius: 50%; background: repeating-conic-gradient(#e8dcc0 0 20deg, #2a2414 20deg 60deg); border: 4px solid #5a5040; position: relative; z-index: 1; }
.app[data-app="mixtape"].playing .reel { animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cs-tape { position: absolute; left: 25%; right: 25%; top: 50%; height: 8px; margin-top: -4px; background: #3a2414; }
.mx-viz { width: 100%; height: 70px; flex: none; border-radius: 6px; box-shadow: 0 0 0 2px #000; }
.mx-bar { display: flex; align-items: center; gap: 8px; font: 18px 'Term'; color: #ffcf8a; }
.mx-bar input { flex: 1; min-width: 0; accent-color: var(--orange); }
.mx-controls { display: flex; justify-content: center; gap: 8px; }
.mx-controls .btn { min-width: 64px; font: 20px 'Term'; }
.mx-list { flex: 1; min-height: 80px; margin: 0; padding: 0; overflow: auto; list-style: none; counter-reset: trk; }
.mx-list li { counter-increment: trk; }
.mx-list button { width: 100%; display: flex; gap: 10px; padding: 6px 10px; border: 0; border-radius: 5px; background: none; color: #ffcf8a; font: 19px 'Term'; text-align: left; cursor: pointer; }
.mx-list button::before { content: counter(trk, decimal-leading-zero); color: #7a6a4a; }
.mx-list button:hover { background: rgba(255,116,18,0.2); }
.mx-list li.on button, .mx-list li.on button::before { background: var(--orange); color: #1b160c; }

/* ══════════════════════════════════════ Winchester: Debris Field */
.mines { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px; color: var(--text); }
.mn-head { width: min(100%, 360px); display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; border-radius: 8px; box-shadow: var(--sunken); }
.seg { min-width: 62px; padding: 2px 6px; border-radius: 4px; background: #120000; color: #ff3a1a; font: 30px/1 'Term'; text-align: center; text-shadow: 0 0 6px rgba(255,40,20,0.6); }
.mn-face { min-width: 76px; font: 20px 'Term'; }
.mn-grid { width: min(100%, 360px); aspect-ratio: 1; display: grid; grid-template-columns: repeat(9, 1fr); padding: 4px; border-radius: 6px; background: #b8a77c; box-shadow: var(--sunken);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.mn-cell { border: 0; padding: 0; display: grid; place-items: center; background: var(--face); box-shadow: inset 2px 2px 0 var(--light), inset -2px -2px 0 var(--shadow); font: clamp(22px, 6.4vw, 30px)/1 'Term'; cursor: pointer; -webkit-touch-callout: none; }
.mn-cell.open { background: #d8cba4; box-shadow: inset 1px 1px 0 #b8a77c; cursor: default; }
.mn-cell.boom { background: var(--red); }
.mn-cell img { width: 70%; height: 70%; image-rendering: pixelated; pointer-events: none; }
.mn-foot { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.mn-msg { margin: 0; text-align: center; font-size: 15px; }
.mn-msg.bad { color: #c4140a; font-weight: 700; } .mn-msg.good { color: #0a7a2a; font-weight: 700; }

/* ══════════════════════════════════════ Winchester: Cube Crunch */
.app[data-app="snake"] { background: #08021c; border-radius: 6px; }
.snake { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px; color: var(--light); }
.sn-head { width: min(100%, 420px); display: flex; justify-content: space-between; font: 22px 'Term'; color: #ff9ae8; }
.sn-head b { font-weight: 400; color: var(--gold); }
.sn-wrap { position: relative; width: min(100%, 420px); aspect-ratio: 1; flex: none; }
#sn-canvas { width: 100%; height: 100%; display: block; border-radius: 6px; image-rendering: pixelated; touch-action: none; box-shadow: 0 0 0 2px var(--magenta), 0 0 20px rgba(255,43,214,0.4); }
.sn-start { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 6px; cursor: pointer;
  background: rgba(8,2,28,0.82); color: var(--gold); font: 900 clamp(26px, 7vw, 40px) 'Orb'; text-shadow: 3px 3px 0 var(--magenta); }
.sn-start small { max-width: 30ch; font: 18px/1.3 'Term'; color: var(--light); text-shadow: none; }
.sn-pad { display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(2, 48px); gap: 6px; }
.sn-pad [data-dir="up"] { grid-column: 2; } .sn-pad [data-dir="left"] { grid-column: 1; grid-row: 2; }
.sn-pad [data-dir="down"] { grid-column: 2; grid-row: 2; } .sn-pad [data-dir="right"] { grid-column: 3; grid-row: 2; }
@media (hover: hover) and (pointer: fine) { .sn-pad { display: none; } }

/* ══════════════════════════════════════ phones (and short landscape phones): full-screen windows
   (keep this media rule the same as COMPACT in os.js) */
@media (max-width: 760px), (max-height: 500px) {
  :root { --bar-h: 54px; }
  .win, .win.max { left: 3px !important; top: 3px !important; width: calc(100% - 6px) !important; height: calc(100% - 6px) !important; min-width: 0; padding: 4px; }
  .win-title { cursor: default; height: 44px; }
  .win-btn.mx { display: none; }
  .win-btn { width: 40px; height: 34px; }
  .win-title .stripes { display: none; }
  .win-title .wb { margin-left: auto; }
  .quick-launch { display: none; }
  .task-btn { flex: 0 0 44px; padding: 0 10px; justify-content: center; }
  .task-btn span { display: none; }
  .clock { display: none; }
  .login-band.bottom, .login-foot { height: 62px; }
  .login-main, #welcome { bottom: 62px; }
  .auth { font-size: 11px; }
  .turnoff { font-size: 14px; }
  .turnoff i { width: 34px; height: 34px; }
  .turnoff i::before { inset: 8px; } .turnoff i::after { left: 15.5px; top: 5px; height: 12px; }
  .helios, .lab { grid-template-columns: 1fr; grid-template-rows: minmax(280px, 52vh) auto; overflow: auto; }
  .lab-view { min-height: 280px; }
  .lab-panel { overflow: visible; }
  .lab-modes { left: 10px; right: 10px; justify-content: center; bottom: 10px; }
  .lab-view .hud.bl { display: none; }
  .hud { font-size: 15px; }
  .hud.tr { top: 50px; left: 14px; right: auto; text-align: left; }
  .app[data-app="helios"] > .tab-panel.on { overflow: auto; }
  .vault { grid-template-columns: 1fr; grid-template-rows: none; overflow: auto; }
  .vault-player .tv { grid-row: auto; grid-column: 1; width: min(100%, 330px); }
  .vault-info, .vault-list { grid-column: 1; }
  .vault-list { overflow: visible; }
  .win-body > .app[data-app="archive"] { overflow: auto; }
  .row2 { grid-template-columns: 1fr; }
  .fund-btns { grid-template-columns: 1fr; }
  .doc { padding: 16px 14px 22px; }
  .masthead, .form-head { gap: 12px; }
  .mast-emblem { width: 64px; height: 64px; }
  .tv-wrap .tv { height: auto; width: min(100%, 340px); min-height: 0; }
  .balloon::after { right: 30px; }
  .mail-form { flex-wrap: wrap; } .mail-form .btn { flex: 1 0 100%; }
  .diag { overflow: auto; } .diag-log { flex: none; height: 150px; }
  .deck { overflow: auto; } .mx-list { flex: none; }
  .np-text { font-size: 18px; }
}
/* phones held upright: icons in a grid like a home screen, the log-on list under the logo */
@media (max-width: 760px) {
  #icons { right: 10px; grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-template-rows: none; justify-items: center; }
  .dicon { width: 100%; max-width: 92px; }
  .dicon img { width: 48px; height: 48px; }
  .dicon span { font-size: 13px; }
  #brandmark { left: 0; right: 0; display: flex; justify-content: center; bottom: calc(var(--bar-h) + 14px); }
  #desk-logo { width: 210px; }
  .login-main { flex-direction: column; justify-content: flex-start; gap: 12px; padding-top: 18px; }
  .login-left { flex: none; max-width: none; align-items: center; text-align: center; }
  #login-logo { width: min(80vw, 330px); }
  .login-begin { margin-top: 6px; }
  .login-note { font-size: 13px; }
  .login-divider { display: none; }
  .login-right { flex: none; width: 100%; max-width: 480px; }
  .user-tile { border-radius: 14px; background: rgba(10, 20, 96, 0.4); }
  .user-tile .go { opacity: 1; }
  .user-tile .pic { width: 52px; height: 52px; }
}
@media (max-height: 560px) and (min-width: 761px) { #icons { grid-template-rows: repeat(auto-fill, 86px); } .dicon img { width: 42px; height: 42px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .crt-lines { animation: none; }
}
#ichor-loading { pointer-events: none; }

/* ══════════════════════════════════════ Kim's colours */
body[data-theme="neural"] { --title: #3b1a8f; --title2: #1aa6d6; --select: #3b1a8f; }

/* ══════════════════════════════════════ the journal: lined paper, each character's own ink */
@font-face { font-family: 'Hand'; src: url(../fonts/ArchitectsDaughter.ttf) format('truetype'); font-display: swap; }
.journal { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 6px; background: linear-gradient(135deg, #4a3322, #2e1f14); }
.jr-cover { display: flex; gap: 12px; align-items: center; padding: 4px 8px; }
.jr-cover img { width: 40px; height: 40px; }
.jr-cover .kicker { color: #e8c88a; }
.jr-cover .doc-h { margin: 0; color: #fff3d6; font-size: 22px; }
.jr-page { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px 24px 66px; border-radius: 4px 10px 10px 4px; color: var(--ink, #1b160c);
  background: linear-gradient(90deg, transparent 50px, #e8a0a0 50px, #e8a0a0 52px, transparent 52px), repeating-linear-gradient(#fffbea 0 31px, #b9cbe6 31px 32px);
  background-color: #fffbea; background-attachment: local; box-shadow: inset 8px 0 12px rgba(0,0,0,0.18);
  font: 20px/32px 'Hand', 'Segoe Print', 'Bradley Hand', cursive; }
.jr-entry { margin-bottom: 32px; }
.jr-entry h4 { margin: 0; font: inherit; font-size: 15px; text-decoration: underline; opacity: 0.8; }
.jr-entry p { margin: 0; }
.jr-empty { margin: 0; opacity: 0.6; }
.jr-new { display: grid; gap: 6px; padding: 10px; border-radius: 6px; background: var(--face); color: var(--text); }
.jr-new label { font: 700 14px 'Pix'; }
.jr-new .field { min-height: 70px; font: 18px/1.4 'Hand', 'Segoe Print', cursive; }
.jr-new p { margin: 0; }

/* ══════════════════════════════════════ Reznov's album: prints on a dark table */
.album { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 210px; gap: 12px; padding: 12px; border-radius: 6px; background: radial-gradient(ellipse at 40% 40%, #3a332a, #1f1b16); }
.al-view { margin: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.al-print { max-width: 100%; display: flex; flex-direction: column; padding: 12px 12px 8px; background: #f6f1e4; box-shadow: 4px 6px 16px rgba(0,0,0,0.55); transform: rotate(-1deg); }
.al-print img { display: block; max-width: 100%; max-height: min(430px, 50vh); object-fit: contain; }
.al-print figcaption { padding-top: 8px; color: #1c2a5a; }
.al-print figcaption b { display: block; font: 400 22px/1.2 'Segoe Print', 'Bradley Hand', 'Hand', cursive; }
.al-print figcaption span { display: block; font: 16px/1.3 'Hand', 'Segoe Print', cursive; opacity: 0.75; }
.al-nav { display: flex; align-items: center; gap: 12px; color: #e8dcc0; font: 20px 'Term'; }
.al-thumbs { min-height: 0; overflow: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; padding: 4px; }
.al-thumbs button { aspect-ratio: 1; padding: 4px; border: 0; background: #f6f1e4; cursor: pointer; box-shadow: 2px 3px 6px rgba(0,0,0,0.45); }
.al-thumbs button:nth-child(odd) { transform: rotate(1.5deg); } .al-thumbs button:nth-child(even) { transform: rotate(-1.2deg); }
.al-thumbs button img { width: 100%; height: 100%; display: block; object-fit: cover; }
.al-thumbs button.on { outline: 3px solid var(--gold); }

/* ══════════════════════════════════════ Kim: TALOSMON */
.app[data-app="talosmon"] { background: #06041a; border-radius: 6px; }
.tmon { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; color: #c9c0ff; font: 18px 'Term'; }
.tm-top { display: grid; grid-template-columns: 210px 1fr; gap: 10px; }
.tm-face { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; border: 1px solid rgba(24,228,255,0.35); border-radius: 6px; background: #020a04; color: var(--term); font-size: 15px; }
.tm-face canvas { width: 100%; height: 150px; object-fit: contain; }
.tm-stats { list-style: none; margin: 0; padding: 8px 12px; display: grid; gap: 2px; align-content: center; border: 1px solid rgba(24,228,255,0.35); border-radius: 6px; }
.tm-stats li { display: flex; justify-content: space-between; gap: 8px; }
.tm-stats b { font-weight: 400; color: var(--cyan); }
.tmon .dpanel { background: #0b0826; border-color: rgba(24,228,255,0.35); }
.tmon .dpanel h4 { color: var(--cyan); }
.tm-wave { width: 100%; height: 110px; display: block; }
.tm-log { height: 130px; overflow: auto; font: 17px/1.3 'Term'; color: #e8e0ff; }
.tm-log p { margin: 0; }
.tm-log .dim { color: #7a70b0; } .tm-log .warn { color: var(--gold); } .tm-log .talos { color: var(--term); }

@media (max-width: 760px), (max-height: 500px) {
  .album { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow: auto; }
  .al-thumbs { grid-template-columns: repeat(4, 1fr); overflow: visible; }
  .al-print img { max-height: 46vh; }
  .tm-top { grid-template-columns: 1fr; }
  .jr-page { padding-left: 60px; font-size: 18px; }
}
/* the album with a single photo: just the print, no arrows or thumbnails */
.app[data-app="photos"].single .album { grid-template-columns: 1fr; }
.app[data-app="photos"].single .al-thumbs, .app[data-app="photos"].single .al-nav { display: none; }

/* ══════════════════════════════════════ ISEA Messenger: a 2000s instant messenger, in ISEA colours */
.app[data-app="msgr"] { border-radius: 6px; overflow: hidden; }
.msgr { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px 1fr; background: linear-gradient(#eef4ff, #d6e3fa);
  font: 13px/1.4 Tahoma, 'Segoe UI', Verdana, sans-serif; color: #1a2440; }
.ms-list { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid #9fb3d9; background: linear-gradient(#ffffff, #eaf1fe 60%, #dce8fb); }
.ms-brand { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: linear-gradient(#3b6fd6, #1c3f9c); color: #fff; font-size: 13px; }
.ms-brand img { width: 20px; height: 20px; }
.ms-brand b { color: var(--gold); letter-spacing: 0.06em; }
.ms-me { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid #c3d3ee; background: linear-gradient(#f6f9ff, #dfe9fb); }
.ms-me b { font-size: 14px; }
.ms-me small { display: block; color: #6a7a9a; font-style: italic; }
.ms-dp { width: 52px; height: 52px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: linear-gradient(#ffffff, #cddcf6);
  box-shadow: 0 0 0 2px #6fbf4a, 0 0 0 4px #e8f5e0, 1px 2px 6px rgba(0,0,0,0.25); }
.ms-dp:empty { visibility: hidden; }
.ms-dp img { width: 38px; height: 38px; image-rendering: pixelated; }
.ms-dp img.photo, .ms-rowpic img.photo { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.ms-status { font-size: 12px; }
.ms-status.st-online { color: #2e8b2e; } .ms-status.st-away { color: #c27a00; } .ms-status.st-busy { color: #c4140a; }
.ms-search { padding: 8px 10px; }
.ms-search .field { font: 13px Tahoma, sans-serif; padding: 5px 8px; border-radius: 12px; box-shadow: inset 0 0 0 1px #9fb3d9; }
.ms-groups { flex: 1; min-height: 0; overflow: auto; padding: 0 4px 10px; }
.ms-gh { margin: 8px 6px 2px; font-weight: 700; color: #2b4c8c; font-size: 12px; }
.ms-row { width: 100%; display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid transparent; border-radius: 4px; background: none; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.ms-row:hover { background: #e3edff; border-color: #c3d6f7; }
.ms-row.on { background: #c7dafb; border-color: #7fa3e0; }
.ms-row[hidden] { display: none; }
.ms-rowpic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 5px; background: #fff; box-shadow: 0 0 0 1px #9fb3d9; }
.ms-rowpic img { width: 24px; height: 24px; image-rendering: pixelated; }
.ms-rowtext { min-width: 0; }
.ms-rowtext b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-rowtext small { display: block; color: #6a7a9a; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-dot { width: 11px; height: 11px; flex: none; border-radius: 50%; box-shadow: inset -2px -2px 0 rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.3); }
.ms-dot.st-online { background: #47c447; } .ms-dot.st-away { background: #f2a516; } .ms-dot.st-busy { background: #e5322a; } .ms-dot.st-offline { background: #a9b2c3; }
.ms-chat { min-height: 0; display: flex; flex-direction: column; }
.ms-to { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #c3d3ee; background: linear-gradient(#f6f9ff, #dfe9fb); }
.ms-to b { display: block; font-size: 14px; }
.ms-to small { display: block; color: #6a7a9a; font-style: italic; }
.ms-back { display: none; min-height: 34px; padding: 4px 10px; }
.ms-log { flex: 1; min-height: 0; overflow: auto; padding: 12px 16px; margin: 8px 10px 0; border: 1px solid #9fb3d9; border-radius: 4px; background: #fff; }
.ms-msg { margin-bottom: 8px; }
.ms-who { margin: 0; color: #707070; }
.ms-msg.mine .ms-who { color: #3b6fd6; }
.ms-text { margin: 0 0 0 12px; color: #111; word-wrap: break-word; }
.ms-sys { margin: 4px 0 8px; color: #8a8a8a; font-style: italic; }
.emo { width: 18px; height: 18px; vertical-align: -4px; }
.ms-typing { margin: 4px 12px 0; color: #6a7a9a; font-style: italic; font-size: 12px; }
.ms-compose { margin: 8px 10px 10px; padding: 6px; border: 1px solid #9fb3d9; border-radius: 4px; background: linear-gradient(#f3f7ff, #e2ebfb); }
.ms-tools { display: flex; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; }
.ms-tool { display: grid; place-items: center; min-width: 30px; height: 28px; padding: 0 6px; border: 1px solid #9fb3d9; border-radius: 4px; background: linear-gradient(#ffffff, #dde8fb); cursor: pointer; font: 12px Tahoma, sans-serif; color: #1a2440; }
.ms-tool:hover { border-color: #3b6fd6; }
.ms-nudge { margin-left: auto; font-weight: 700; }
.ms-input { display: flex; gap: 6px; }
.ms-input textarea { flex: 1; min-width: 0; resize: none; padding: 6px 8px; border: 1px solid #9fb3d9; border-radius: 3px; font: 14px/1.35 Tahoma, sans-serif; color: #111; background: #fff; outline: none; }
.ms-input textarea:focus { border-color: #3b6fd6; }
.ms-input .btn { align-self: stretch; font: 700 13px Tahoma, sans-serif; }
.ms-readonly { margin: 8px 10px 10px; padding: 8px 10px; border: 1px dashed #9fb3d9; border-radius: 4px; color: #6a7a9a; font-style: italic; }
/* a nudge shakes the whole window */
.win.nudging { animation: nudge 0.5s linear; }
@keyframes nudge { 0%, 100% { transform: none; } 10% { transform: translate(-8px, 3px); } 20% { transform: translate(8px, -3px); } 30% { transform: translate(-7px, -2px); }
  40% { transform: translate(7px, 2px); } 50% { transform: translate(-5px, 2px); } 60% { transform: translate(5px, -2px); } 70% { transform: translate(-3px, 1px); } 80% { transform: translate(3px, -1px); } }
@media (max-width: 760px), (max-height: 500px) {
  .msgr { grid-template-columns: 1fr; font-size: 15px; }
  .msgr .ms-chat { display: none; }
  .msgr.chatting .ms-list { display: none; }
  .msgr.chatting .ms-chat { display: flex; }
  .ms-back { display: inline-flex; }
  .ms-list { border-right: 0; }
  .ms-dp { width: 44px; height: 44px; }
  .ms-input textarea { font-size: 16px; }
}
