/* ==========================================================================
   TuxSpace — "device panel" design system
   Skeuomorphic hacker-hardware aesthetic: brushed metal, riveted panels,
   LED indicators, backlit LCD-style inputs. Deliberately not the
   green-on-black terminal cliché — amber + cyan accents over graphite/steel.
   ========================================================================== */

@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-400.woff2') format('woff2');
  font-weight: 400 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jbmono-400.woff2') format('woff2');
  font-weight: 400 500; font-style: normal; font-display: swap;
}
@font-face {
  /* CRT terminal face — used only by the retro public pages (body.retro) */
  font-family: 'VT323';
  src: url('/fonts/vt323-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  /* metals + darks */
  --graphite-900: #14161a;
  --graphite-800: #1c1f24;
  --panel-800: #21252b;
  --steel-700: #3a3f47;
  --steel-600: #4b515b;
  --rivet: #5b616b;

  /* accents */
  --amber-400: #ffb454;
  --amber-500: #ff9f2e;
  --cyan-400: #5ad1e6;
  --cyan-500: #33b9d1;
  --copper-400: #c98a4b;
  --red-500: #e5484d;
  --green-500: #4fce7f;

  /* text */
  --paper-100: #ece8df;
  --paper-300: #b9b5ab;
  --paper-500: #82807c;

  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --radius-panel: 14px;
  --radius-control: 8px;
  --shadow-deep: 0 20px 50px -20px rgba(0,0,0,0.65), 0 2px 6px rgba(0,0,0,0.4);

  --font-crt: 'VT323', 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(90,209,230,0.06), transparent 60%),
    radial-gradient(1000px 500px at 90% 10%, rgba(255,180,84,0.05), transparent 55%),
    linear-gradient(180deg, var(--graphite-900), #101216 60%);
  color: var(--paper-100);
  font-family: var(--font-body);
  line-height: 1.5;
}

a { color: var(--cyan-400); }
a:hover { color: var(--cyan-500); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---- brushed metal texture, used behind panels ---- */
.brushed {
  background-image:
    repeating-linear-gradient(100deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 3px),
    linear-gradient(160deg, var(--panel-800), var(--graphite-800) 70%);
}

/* ---- riveted panel, the core signature component ---- */
.panel {
  position: relative;
  border-radius: var(--radius-panel);
  border: 1px solid var(--steel-700);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255,255,255,0.04);
  padding: 28px;
}
.panel::before, .panel::after,
.panel .rivet-tl, .panel .rivet-tr, .panel .rivet-bl, .panel .rivet-br {
  content: '';
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8b909a, var(--rivet) 55%, #24262b 100%);
  box-shadow: 0 1px 1px rgba(0,0,0,0.6);
}
.panel::before { top: 10px; left: 10px; }
.panel::after { top: 10px; right: 10px; }
.panel .rivet-bl { bottom: 10px; left: 10px; }
.panel .rivet-br { bottom: 10px; right: 10px; }

/* ---- status strip: the repeated LED-panel motif across all chrome ---- */
.status-strip {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--steel-700);
  background: linear-gradient(180deg, #24272d, #1a1c20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 6px 16px rgba(0,0,0,0.35);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--paper-300);
  width: fit-content;
}
.led {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 7px;
  background: var(--steel-600);
  box-shadow: inset 0 0 1px rgba(0,0,0,0.6);
}
.led.on.amber { background: var(--amber-400); box-shadow: 0 0 8px 1px var(--amber-400); }
.led.on.cyan { background: var(--cyan-400); box-shadow: 0 0 8px 1px var(--cyan-400); }
.led.on.green { background: var(--green-500); box-shadow: 0 0 8px 1px var(--green-500); }
.led.pulse { animation: ledpulse 2.4s ease-in-out infinite; }
@keyframes ledpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ---- top nav ---- */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 10px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px;
}
.topnav .brand { margin-right: auto; }
@media (max-width: 720px) {
  .topnav { padding: 14px 16px; }
  .topnav .status-strip { display: none; }   /* decorative — the live CHAT led lives on the chat page itself */
  .topnav .navlinks { width: 100%; justify-content: flex-start; }
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.01em;
  color: var(--paper-100);
  text-decoration: none;
}
.brand .mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, var(--panel-800), var(--graphite-800));
  border: 1px solid var(--steel-700);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
  font-size: 16px;
}
.navlinks { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ---- account menu: <details> popover, same mechanics as the chat popovers ---- */
.acct-menu { position: relative; }
.acct-menu > summary {
  list-style: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--steel-700); color: var(--paper-100);
  background: transparent; white-space: nowrap;
}
.acct-menu > summary::-webkit-details-marker { display: none; }
.acct-menu[open] > summary { border-color: var(--cyan-400); color: var(--cyan-400); }
.acct-menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 224px; max-width: calc(100vw - 32px); padding: 6px;
  background: var(--panel-800); border: 1px solid var(--steel-700);
  border-radius: var(--radius-panel); box-shadow: var(--shadow-deep);
  z-index: 50;
}
.acct-menu-panel a,
.acct-menu-logout {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 8px;
  font-family: var(--font-body); font-size: 13px; color: var(--paper-100);
  text-decoration: none; background: transparent; border: 0; cursor: pointer;
}
.acct-menu-panel a:hover,
.acct-menu-logout:hover { background: var(--graphite-800); }
.acct-menu-logout { color: var(--red-500); font-weight: 600; }
.acct-menu-panel hr { border: 0; border-top: 1px solid var(--steel-700); margin: 6px 4px; }

/* ---- buttons: physical toggle-switch feel ---- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--steel-700);
  border-radius: var(--radius-control);
  padding: 10px 18px;
  cursor: pointer;
  color: var(--paper-100);
  background: linear-gradient(180deg, #2b2f36, #1e2126);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 2px 0 rgba(0,0,0,0.35), 0 6px 14px rgba(0,0,0,0.25);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 4px rgba(0,0,0,0.5); }
.btn-primary {
  background: linear-gradient(180deg, var(--amber-400), var(--amber-500));
  border-color: #c67d1f;
  color: #241703;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 2px 0 #8a5813, 0 8px 18px rgba(255,159,46,0.25);
}
.btn-ghost { background: transparent; box-shadow: none; }
.btn-danger { border-color: #7a2325; color: var(--red-500); background: linear-gradient(180deg, #2b1c1d, #1e1515); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- backlit LCD-style form fields ---- */
label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--paper-300); font-family: var(--font-mono); margin: 16px 0 6px; }
label:first-child { margin-top: 0; }
input[type=text], input[type=password], input[type=email], textarea, select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--amber-400);
  background: #0f1114;
  border: 1px solid #000;
  border-radius: var(--radius-control);
  padding: 12px 14px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.7), inset 0 0 20px rgba(255,180,84,0.03);
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--cyan-400); box-shadow: inset 0 2px 6px rgba(0,0,0,0.7), 0 0 0 3px rgba(90,209,230,0.15); }
textarea { font-family: var(--font-mono); min-height: 260px; resize: vertical; }
/* #html-editor is swapped for a CodeMirror instance by html-editor.js;
   this is only what shows before that JS runs, or if it fails to load. */
#html-editor { min-height: 620px; }
.field-error { color: var(--red-500); font-size: 13px; margin-top: 10px; font-family: var(--font-mono); }
.field-ok { color: var(--green-500); font-size: 13px; margin-top: 10px; font-family: var(--font-mono); }

/* ---- layout helpers ---- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px 60px; }
.narrow { max-width: 460px; margin: 60px auto; padding: 0 24px; }
.grid-2 { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }
.muted { color: var(--paper-500); }
.mono { font-family: var(--font-mono); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; margin: 0 0 12px; }
p { color: var(--paper-300); }

/* ---- hero / splash ---- */
.hero { padding: 60px 24px 40px; text-align: center; }
.alpha-plate {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 7px 16px; border-radius: 999px; width: fit-content;
  border: 1px solid var(--amber-500);
  background: linear-gradient(180deg, #2a2620, #1e1b16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 6px 16px rgba(0,0,0,0.35);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--amber-400);
}
.alpha-plate .mono { color: var(--paper-500); letter-spacing: 0.04em; text-transform: none; }
.hero h1 { font-size: clamp(38px, 6vw, 64px); color: var(--paper-100); margin-bottom: 14px; }
.hero .tagline { font-size: 18px; color: var(--paper-300); max-width: 560px; margin: 0 auto 34px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; margin-bottom: 46px; flex-wrap: wrap; }
.glass-sheen {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,0.05) 0%, transparent 30%, transparent 70%, rgba(255,255,255,0.03) 100%);
}
.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 36px; }
@media (max-width: 760px) { .feature-row { grid-template-columns: 1fr; } }
.feature-card { text-align: left; }
.feature-card .icon { font-size: 22px; margin-bottom: 10px; display: block; }
.feature-card h3 { font-size: 15px; color: var(--paper-100); }
.feature-card p { font-size: 13.5px; margin: 0; }

/* ---- dashboard ---- */
.quota-track { height: 8px; border-radius: 999px; background: #0f1114; overflow: hidden; border: 1px solid #000; box-shadow: inset 0 1px 3px rgba(0,0,0,0.6); }
.quota-fill { height: 100%; background: linear-gradient(90deg, var(--cyan-400), var(--amber-400)); }
.stat { font-family: var(--font-mono); font-size: 13px; color: var(--paper-300); }
.upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin-top: 14px; }
.upload-thumb { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--steel-700); aspect-ratio: 1; background: #0f1114; }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-thumb .url-copy { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,0.7); font-family: var(--font-mono); font-size: 9px; padding: 3px 4px; text-align: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.upload-thumb:hover .url-copy { opacity: 1; }

.profile-frame-wrap { border-radius: var(--radius-panel); overflow: hidden; border: 1px solid var(--steel-700); box-shadow: var(--shadow-deep); background: #0f1114; }
.profile-frame-wrap iframe { display: block; width: 100%; min-height: 640px; border: 0; background: #fff; }

/* ---- chat: full-viewport, modeled on deviantArt's chat (tabbed rooms,
   topic/rules banner, message+roster split, bottom composer) ---- */
body.chat-page { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
body.chat-page .topnav { flex: none; }
.chat-app { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }

.chat-roomtabs { flex: none; display: flex; align-items: flex-end; gap: 3px; padding: 10px 16px 0; background: var(--panel-800); border-bottom: 1px solid var(--steel-700); overflow-x: auto; }
.chat-roomtab { padding: 8px 16px; font-size: 13px; border: 1px solid var(--steel-700); border-bottom: none; border-radius: 8px 8px 0 0; background: #1a1c20; color: var(--paper-500); text-decoration: none; white-space: nowrap; }
.chat-roomtab.active { background: #101317; color: var(--cyan-400); font-weight: 600; }
.chat-roomtab-add { position: relative; }
.chat-roomtab-add summary { list-style: none; padding: 8px 14px; font-size: 12px; color: var(--paper-500); border: 1px dashed var(--steel-700); border-radius: 8px 8px 0 0; cursor: pointer; white-space: nowrap; }
.chat-roomtab-add summary::-webkit-details-marker { display: none; }
.chat-roomtab-add[open] summary { color: var(--cyan-400); border-color: var(--cyan-400); }

.chat-topicbar { flex: none; padding: 8px 16px; font-size: 12.5px; color: var(--paper-500); background: #15171b; border-bottom: 1px solid var(--steel-700); }
.chat-topicbar b { color: var(--amber-400); }

.chat-toparagraph { flex: none; padding: 10px 16px; font-size: 13px; line-height: 1.6; color: var(--paper-100); background: linear-gradient(180deg, rgba(90,209,230,0.08), transparent); border-bottom: 1px solid var(--steel-700); }
.chat-toparagraph a { color: var(--cyan-400); }

.chat-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 220px; position: relative; background-size: cover; background-position: center; }
.chat-main.has-bg { background-color: #101317; }
.chat-main.has-bg::before { content: ''; position: absolute; inset: 0; background: rgba(10,12,15,0.72); pointer-events: none; }
@media (max-width: 760px) { .chat-main { grid-template-columns: 1fr; } .chat-sidebar-col { display: none; } }

.chat-messages-col { position: relative; z-index: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.chat-sidebar-col { position: relative; z-index: 1; overflow-y: auto; border-left: 1px solid var(--steel-700); background: rgba(33,37,43,0.92); padding: 14px; }
.chat-sidebar-group { margin-bottom: 18px; }
.chat-sidebar-group h4 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--paper-500); margin: 0 0 8px; }

.chat-msg { font-size: 14px; }
.chat-msg .who { font-family: var(--font-mono); font-size: 12px; color: var(--cyan-400); margin-right: 8px; text-decoration: none; }
.chat-msg a.who:hover { text-decoration: underline; }
.chat-msg .who.admin { color: var(--amber-400); }
.chat-msg .who.bot { color: var(--green-500); }
.who-emoji { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.18em; }
.chat-msg .ts { font-family: var(--font-mono); font-size: 10px; color: var(--paper-500); margin-left: 8px; }
.chat-msg .body code { background: #0f1114; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--steel-700); font-size: 12.5px; }
.chat-msg .body .chat-img { display: block; max-width: 260px; max-height: 260px; width: auto; height: auto; border-radius: 8px; border: 1px solid var(--steel-700); margin-top: 4px; object-fit: contain; }
.chat-msg .body img.chat-img[alt="emoji"] { display: inline-block; max-width: 28px; max-height: 28px; vertical-align: -6px; border: 0; margin: 0 1px; border-radius: 0; }
.chat-msg.system { color: var(--paper-500); font-family: var(--font-mono); font-size: 12px; text-align: center; }
a.online-user {
  display: flex; flex-direction: column; gap: 2px; font-size: 13px;
  padding: 5px 6px; margin: 0 -6px; border-radius: 6px;
  font-family: var(--font-mono); color: inherit; text-decoration: none;
}
a.online-user:hover { background: rgba(255,255,255,0.05); }
.online-user-top { display: flex; align-items: center; gap: 8px; }
.online-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-avatar { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; border: 1px solid var(--steel-700); flex: none; }
.online-status {
  display: flex; align-items: center; gap: 4px; padding-left: 26px;
  font-size: 11px; color: var(--paper-500);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.online-status .who-emoji { width: 12px; height: 12px; }

/* user context menu (click a name) */
.chat-user-menu {
  position: fixed; z-index: 60; min-width: 180px;
  background: var(--graphite-800); border: 1px solid var(--steel-700);
  border-radius: 8px; box-shadow: var(--shadow-deep); padding: 6px;
  font-family: var(--font-mono);
}
.chat-user-menu-name { font-size: 12px; color: var(--cyan-400); padding: 4px 8px 6px; border-bottom: 1px solid var(--steel-700); margin-bottom: 4px; }
.chat-user-menu button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--paper-100); font: inherit; font-size: 12.5px; padding: 7px 8px;
  border-radius: 5px; cursor: pointer;
}
.chat-user-menu button:hover:not(:disabled) { background: rgba(255,255,255,0.06); }
.chat-user-menu button:disabled { opacity: 0.4; cursor: default; }
.chat-user-menu button .muted { font-size: 10.5px; }

/* unread-DM badge on a roster row */
.dm-badge {
  margin-left: auto; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--amber-400); color: #1a1204;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}

/* DM panel — slides over the chat body */
.dm-panel {
  position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column;
  background: var(--graphite-900, #16181c);
}
.dm-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--steel-700); background: var(--panel-800); }
.dm-back { background: none; border: 0; color: var(--cyan-400); font-size: 18px; cursor: pointer; line-height: 1; }
.dm-peer { color: var(--paper-100); text-decoration: none; font-family: var(--font-mono); font-size: 14px; }
.dm-peer:hover { text-decoration: underline; }
.dm-peer-status { font-family: var(--font-mono); font-size: 11px; color: var(--paper-500); }
.dm-scroll { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.dm-empty { color: var(--paper-500); font-size: 12px; text-align: center; margin-top: 20px; }
.dm-msg { max-width: 78%; align-self: flex-start; background: var(--panel-800); border: 1px solid var(--steel-700); border-radius: 10px; padding: 7px 11px; font-size: 13.5px; }
.dm-msg.mine { align-self: flex-end; background: #1d3a2b; border-color: #2c5a41; }
.dm-msg .dm-ts { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 9.5px; color: var(--paper-500); }
.dm-msg .dm-body img.chat-img[alt="emoji"] { display: inline-block; max-width: 22px; max-height: 22px; vertical-align: -5px; }
.dm-gate { padding: 20px; text-align: center; color: var(--paper-500); font-size: 13px; }
.dm-composer { position: relative; display: flex; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--steel-700); background: var(--panel-800); }
.dm-composer input { flex: 1; }
.dm-msg .dm-body .chat-img { display: block; max-width: 200px; max-height: 200px; width: auto; height: auto; border-radius: 8px; border: 1px solid var(--steel-700); margin-top: 4px; object-fit: contain; }

/* status setter — a popup above the composer in chat, a plain inline
   block on the dashboard. Controls always stack full-width. */
.status-form label { display: block; font-size: 11px; font-family: var(--font-mono); color: var(--paper-500); margin: 9px 0 3px; }
.status-form label:first-child { margin-top: 0; }
.status-form select,
.status-form input[type="text"] { display: block; width: 100%; box-sizing: border-box; }

.chat-status-details { position: relative; }
.chat-status-details > summary {
  cursor: pointer; list-style: none; color: var(--cyan-400);
  border: 1px solid var(--steel-700); border-radius: 5px; padding: 2px 8px;
}
.chat-status-details > summary::-webkit-details-marker { display: none; }
.chat-status-details[open] > summary { background: rgba(255,255,255,0.06); }
.chat-status-panel {
  position: absolute; bottom: calc(100% + 8px); right: 0; width: 264px;
  background: var(--graphite-800); border: 1px solid var(--steel-700);
  border-radius: 8px; box-shadow: var(--shadow-deep); padding: 14px; z-index: 45;
}

.chat-composer { flex: none; position: relative; border-top: 1px solid var(--steel-700); background: var(--panel-800); padding: 10px 16px; }
.chat-composer-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--paper-500); font-family: var(--font-mono); margin-bottom: 6px; }
.chat-composer-row { display: flex; gap: 10px; }
.chat-composer-row input { flex: 1; }

/* Slash-command autocomplete menu — pops up above the input when it
   starts with "/", Tab completes the highlighted entry (shell-style),
   Enter/click runs it (opens the matching picker below). */
.chat-slash-menu {
  position: absolute; bottom: calc(100% + 6px); left: 0; min-width: 260px;
  background: var(--graphite-800); border: 1px solid var(--steel-700); border-radius: 8px;
  box-shadow: var(--shadow-deep); overflow: hidden; z-index: 20;
}
.chat-slash-item { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; font-size: 13px; cursor: pointer; }
.chat-slash-item .cmd { font-family: var(--font-mono); color: var(--cyan-400); }
.chat-slash-item .desc { color: var(--paper-500); font-size: 12px; }
.chat-slash-item.active { background: var(--panel-800); }

/* Gallery/emoji picker — a simple modal over the whole chat app. */
.chat-picker-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(10,12,15,0.7);
  display: flex; align-items: center; justify-content: center;
}
.chat-picker-box {
  width: min(560px, 92%); max-height: 70%; display: flex; flex-direction: column;
  background: var(--graphite-800); border: 1px solid var(--steel-700); border-radius: 12px;
  box-shadow: var(--shadow-deep); padding: 14px 16px;
}
.chat-picker-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12px; color: var(--paper-300); text-transform: uppercase; letter-spacing: .06em; }
.chat-picker-search { margin-bottom: 10px; }
.chat-picker-grid { overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(72px,1fr)); gap: 8px; }
.chat-picker-grid .chat-picker-thumb {
  aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--steel-700); background: var(--panel-800);
  display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden;
  /* Grid items default to min-width/min-height:auto — sized to fit their
     content's *intrinsic* size, not the grid track, unless told
     otherwise. Some OpenMoji SVGs carry no explicit width/height
     attribute (viewBox only), which browsers then size at the CSS
     replaced-element default of 300x150 — each such thumb was blowing
     way past its 72px track and overlapping its neighbors. min-width/
     height:0 forces every thumb to respect the grid track regardless of
     what its image's intrinsic size claims to be. */
  min-width: 0; min-height: 0;
}
.chat-picker-grid .chat-picker-thumb:hover { border-color: var(--cyan-400); }
.chat-picker-grid .chat-picker-thumb img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.chat-picker-empty { color: var(--paper-500); font-size: 13px; grid-column: 1 / -1; text-align: center; padding: 20px 0; }

.chat-settings-details summary { list-style: none; cursor: pointer; color: var(--paper-500); }
.chat-settings-details summary::-webkit-details-marker { display: none; }
.chat-settings-details[open] summary { color: var(--cyan-400); }
.chat-settings-panel { position: absolute; right: 16px; bottom: 60px; width: 340px; max-width: calc(100vw - 32px); background: var(--panel-800); border: 1px solid var(--steel-700); border-radius: 10px; padding: 16px; box-shadow: 0 12px 30px rgba(0,0,0,0.5); z-index: 20; }
.chat-popform { position: absolute; top: 100%; left: 0; margin-top: 4px; width: 260px; background: var(--panel-800); border: 1px solid var(--steel-700); border-radius: 8px; padding: 14px; box-shadow: 0 12px 30px rgba(0,0,0,0.5); z-index: 20; }

footer.sitefoot { text-align: center; padding: 40px 24px; color: var(--paper-500); font-family: var(--font-mono); font-size: 12px; }
.uk-badge {
  position: relative;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2b2f36, #1c1f24);
  border: 1px solid var(--steel-700);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -2px 4px rgba(0,0,0,0.4), 0 3px 8px rgba(0,0,0,0.35);
}
.uk-badge-rivet {
  width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #9aa0aa, var(--rivet) 60%, #202226 100%);
  box-shadow: 0 1px 1px rgba(0,0,0,0.6);
}
.uk-flag {
  width: 22px; height: 11px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), inset 0 0 3px rgba(0,0,0,0.5), 0 1px 1px rgba(255,255,255,0.15);
}
.uk-badge-text { font-size: 10px; letter-spacing: 0.08em; color: var(--paper-300); }

.tabbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tabbar a { padding: 8px 14px; border-radius: 999px; font-size: 13px; font-family: var(--font-mono); border: 1px solid var(--steel-700); color: var(--paper-300); text-decoration: none; }
.tabbar a.active { color: var(--graphite-900); background: var(--cyan-400); border-color: var(--cyan-400); }

code.inline { font-family: var(--font-mono); background: #0f1114; border: 1px solid var(--steel-700); padding: 2px 6px; border-radius: 5px; }

/* =====================================================================
   Profile music player — app chrome, rendered by profile-view.ejs
   OUTSIDE the sandboxed iframe. ~320x100 docked bar, MySpace-player
   spirit: art tile, song title, big transport + seek. One base layout,
   then per-skin looks. body.has-music shrinks .frame-shell to fit.
   ===================================================================== */
.music-widget {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 8px; z-index: 60;
  display: flex; gap: 12px; align-items: stretch;
  width: 340px; max-width: calc(100vw - 24px); height: 100px; box-sizing: border-box;
  padding: 10px 12px;
  background: var(--graphite-800); border: 1px solid var(--steel-700);
  border-radius: 8px; box-shadow: 0 8px 26px rgba(0,0,0,0.5);
  font-family: var(--font-mono); font-size: 12px; color: var(--paper-100);
}
.music-widget .mw-art {
  flex: none; width: 78px; height: 78px; align-self: center;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-800); border: 1px solid var(--steel-700); border-radius: 4px;
  color: var(--cyan-400); font-size: 34px; overflow: hidden;
}
.music-widget .mw-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.music-widget .mw-title {
  font-weight: 700; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.music-widget .mw-controls { display: flex; align-items: center; gap: 8px; }
.music-widget .mw-toggle {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--steel-700); background: var(--panel-800);
  color: var(--cyan-400); font-size: 12px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.music-widget .mw-toggle:hover { filter: brightness(1.15); }
.music-widget .mw-seek {
  flex: 1; min-width: 0; height: 5px; -webkit-appearance: none; appearance: none;
  border-radius: 999px; cursor: pointer;
  background: linear-gradient(90deg, currentColor 0%, currentColor var(--seek,0%), rgba(128,128,128,0.35) var(--seek,0%));
}
.music-widget .mw-seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 12px; height: 12px;
  border-radius: 50%; background: currentColor; border: 2px solid rgba(0,0,0,0.3);
}
.music-widget .mw-seek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: currentColor; }
.music-widget .mw-time { flex: none; font-size: 10.5px; opacity: 0.8; white-space: nowrap; }

/* --- MySpace '05: the classic embedded media player, at usable size --- */
.music-widget.skin-myspace-2005 {
  background: linear-gradient(180deg,#e8eef7,#b9c8e1);
  border: 1px solid #fff; outline: 1px solid #6b7f9e; outline-offset: -2px;
  border-radius: 3px; box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  font-family: Tahoma, Verdana, Geneva, sans-serif; color: #16336b;
}
.music-widget.skin-myspace-2005 .mw-art { background: #cdd8ec; border-color: #6b7f9e; color: #4a6299; border-radius: 2px; }
.music-widget.skin-myspace-2005 .mw-toggle {
  width: 30px; height: 24px; border-radius: 2px;
  border: 1px solid #6b7f9e; background: linear-gradient(#fdfdfd,#c9d5e8); color: #16336b;
}
.music-widget.skin-myspace-2005 .mw-seek { color: #3a5fa8; }

/* --- Winamp: dark metal + LCD-green readout --- */
.music-widget.skin-winamp {
  background: linear-gradient(#3b3f47,#23262c);
  border: 1px solid #12141a; border-radius: 2px;
  box-shadow: inset 0 1px 0 #5a5f68, 0 8px 22px rgba(0,0,0,0.55);
  color: #12e21a;
}
.music-widget.skin-winamp .mw-art { background: #14161b; border-color: #000; color: #12e21a; }
.music-widget.skin-winamp .mw-toggle { border-radius: 2px; background: #1b1d22; border-color: #000; color: #12e21a; }

/* --- Terminal --- */
.music-widget.skin-terminal {
  background: #05070a; border: 1px solid #123; border-radius: 4px; color: #35e0d8;
}
.music-widget.skin-terminal .mw-art { background: #0a0f14; border-color: #123; }
.music-widget.skin-terminal .mw-title::before { content: '> '; opacity: 0.6; }
.music-widget.skin-terminal .mw-toggle { background: #0a0f14; border-color: #123; color: #35e0d8; border-radius: 2px; }

/* --- Vaporwave --- */
.music-widget.skin-vaporwave {
  background: linear-gradient(120deg,#ff3ca6,#7a5cff,#22d3ee);
  border: 0; color: #fff; text-shadow: 0 0 6px rgba(0,0,0,0.35);
  box-shadow: 0 0 22px rgba(255,60,166,0.5);
}
.music-widget.skin-vaporwave .mw-art { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.4); color: #fff; }
.music-widget.skin-vaporwave .mw-toggle { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.5); color: #fff; }

/* --- Pastel --- */
.music-widget.skin-pastel {
  background: #fff6f0; border: 1px solid #ffd4e2; color: #b0568a;
  box-shadow: 0 6px 18px rgba(255,182,203,0.4);
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.music-widget.skin-pastel .mw-art { background: #ffe1ec; border-color: #ffc2d6; }
.music-widget.skin-pastel .mw-toggle { background: #ffe1ec; border-color: #ffc2d6; color: #b0568a; }

/* --- Pixel / Game Boy --- */
.music-widget.skin-pixel {
  background: #9bbc0f; border: 3px solid #0f380f; border-radius: 0;
  color: #0f380f; box-shadow: 4px 4px 0 #0f380f;
}
.music-widget.skin-pixel .mw-art { background: #8bac0f; border: 2px solid #0f380f; border-radius: 0; color: #0f380f; }
.music-widget.skin-pixel .mw-toggle { border-radius: 0; border: 2px solid #0f380f; background: #8bac0f; color: #0f380f; }

/* --- Minimal: matches the slim bar (default) --- */
.music-widget.skin-minimal {
  background: linear-gradient(180deg,#24272d,#1a1c20);
  border: 1px solid var(--steel-700);
}
.music-widget.skin-minimal .mw-seek { color: var(--cyan-400); }

/* =====================================================================
   Feed posts — loves, comments, per-post themes
   ===================================================================== */
.post-card { scroll-margin-top: 80px; }
.post-content { position: relative; }
.post-content.is-themed { margin-top: 2px; }
.post-body { white-space: pre-wrap; word-break: break-word; margin: 0; }
.post-body img { max-width: 100%; }

.post-theme-reset {
  position: absolute; top: 6px; right: 6px;
  font-family: var(--font-mono); font-size: 10px; line-height: 1;
  padding: 3px 7px; border-radius: 999px; cursor: pointer;
  background: rgba(0,0,0,0.35); color: #fff; border: 1px solid rgba(255,255,255,0.35);
}
.post-theme-reset:hover { background: rgba(0,0,0,0.55); }

.post-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.love-btn, .comment-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-800); border: 1px solid var(--steel-700); color: var(--paper-300);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer;
  font-family: var(--font-mono);
}
.love-btn:hover, .comment-toggle:hover { border-color: var(--cyan-400); }
.love-btn .love-glyph { color: var(--paper-500); }
.love-btn.loved { border-color: #e0578a; color: #ff8fb4; }
.love-btn.loved .love-glyph { color: #ff5c8a; }

.post-retheme { margin-left: auto; }
.post-retheme > summary { cursor: pointer; list-style: none; font-family: var(--font-mono); font-size: 12px; color: var(--cyan-400); }
.post-retheme > summary::-webkit-details-marker { display: none; }
.retheme-form { display: flex; gap: 6px; margin-top: 8px; }
.retheme-form select { flex: 1; }

.comments { margin-top: 12px; border-top: 1px solid var(--steel-700); padding-top: 12px; }
.comment { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 13.5px; }
.comment-who { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--paper-100); }
.comment-who img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.comment-who .comment-mono {
  width: 20px; height: 20px; border-radius: 50%; background: var(--panel-800);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 11px; color: var(--cyan-400);
}
.comment-body { margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.comment-body img { max-width: 100%; }
.comment-del {
  background: none; border: 0; color: var(--paper-500); font-size: 11px;
  cursor: pointer; text-decoration: underline; padding: 0; margin-top: 2px;
}
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form input[type="text"] { flex: 1; }

#theme-preview .contrast-warn { pointer-events: none; }

/* =====================================================================
   Profile contact panel — app chrome on /u/:username (friend / DM /
   block / comment). Rendered OUTSIDE the sandboxed iframe. Skinned to
   match the profile theme. The {{profile_comments}} token renders the
   same wall INSIDE the iframe with inline styles (renderProfile.js).
   ===================================================================== */
.contact-fab {
  position: fixed; left: 14px; bottom: 14px; z-index: 61;
  padding: 9px 15px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--steel-700); background: var(--graphite-800); color: var(--paper-100);
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}
.contact-fab:hover { filter: brightness(1.12); }

.contact-panel {
  position: fixed; left: 14px; bottom: 14px; z-index: 62;
  width: 330px; max-width: calc(100vw - 28px); max-height: 74vh; overflow-y: auto;
  box-sizing: border-box; padding: 14px 15px;
  background: var(--graphite-800); border: 1px solid var(--steel-700); border-radius: 10px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.55);
  font-family: var(--font-sans, system-ui), sans-serif; font-size: 13px; color: var(--paper-100);
}
.contact-panel[hidden] { display: none; }
.contact-panel .cp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.contact-panel .cp-title { font-family: var(--font-mono); font-size: 12px; }
.contact-panel .cp-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--paper-500); }
.contact-panel .cp-close { margin-left: auto; background: none; border: 0; color: var(--paper-500); font-size: 17px; line-height: 1; cursor: pointer; }
.contact-panel .cp-note { color: var(--paper-300); font-size: 12.5px; line-height: 1.5; margin: 0 0 10px; }
.contact-panel .cp-actions { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.contact-panel .cp-actions form { margin: 0; }
.cp-btn {
  display: block; width: 100%; box-sizing: border-box; text-align: center;
  padding: 8px 10px; border-radius: 7px; cursor: pointer; text-decoration: none;
  font-family: var(--font-mono); font-size: 12.5px;
  border: 1px solid var(--steel-700); background: var(--panel-800); color: var(--paper-100);
}
.cp-btn:hover { border-color: var(--cyan-400); }
.cp-btn-primary { background: var(--cyan-400); color: var(--graphite-900); border-color: var(--cyan-400); font-weight: 700; }
.cp-btn-danger:hover { border-color: var(--red-500); color: var(--red-500); }
.cp-btn-disabled { opacity: 0.45; cursor: not-allowed; }

.contact-panel .cp-comments-head { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--paper-500); margin-bottom: 8px; }
.contact-panel .cp-comment-form { display: flex; gap: 6px; margin-bottom: 10px; }
.contact-panel .cp-comment-form input { flex: 1; min-width: 0; }
.contact-panel .cp-comment-form .cp-btn { width: auto; padding: 6px 12px; }

/* comment rows — shared class names with the in-iframe token (that copy
   carries its own inline styles; these style the panel copy) */
.contact-panel .tux-comment { border: 1px solid var(--steel-700); border-radius: 8px; padding: 8px 10px; margin-bottom: 7px; background: rgba(255,255,255,0.03); }
.contact-panel .tux-comment-who { color: var(--cyan-400); text-decoration: none; font-weight: 600; font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.contact-panel .tux-comment-who img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.contact-panel .tux-comment-who .tux-comment-mono { width: 20px; height: 20px; border-radius: 50%; background: var(--panel-800); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.contact-panel .tux-comment-time { color: var(--paper-500); font-size: 10.5px; margin-left: 5px; }
.contact-panel .tux-comment-body { margin-top: 5px; font-size: 13px; line-height: 1.5; color: var(--paper-300); white-space: pre-wrap; word-break: break-word; }
.contact-panel .tux-comment-body img { max-width: 100%; }
.contact-panel .tux-comment-del { display: inline; }
.contact-panel .tux-comment-del button { background: none; border: 0; color: var(--paper-500); font-size: 10.5px; cursor: pointer; text-decoration: underline; padding: 0; margin-top: 3px; }

/* --- skins --- */
.contact-panel.skin-paper, .contact-fab.skin-paper {
  background: linear-gradient(180deg,#eef2f9,#c3d0e6); color: #16336b; border: 1px solid #fff; outline: 1px solid #6b7f9e; outline-offset: -2px;
  font-family: Tahoma, Verdana, sans-serif;
}
.contact-panel.skin-paper .cp-btn { background: linear-gradient(#fff,#d5deee); color: #16336b; border-color: #6b7f9e; }
.contact-panel.skin-paper .cp-btn-primary { background: #3a5fa8; color: #fff; }
.contact-panel.skin-paper .cp-title, .contact-panel.skin-paper .cp-meta, .contact-panel.skin-paper .cp-comments-head { color: #3a5fa8; }
.contact-panel.skin-paper .tux-comment { background: rgba(255,255,255,0.6); border-color: #9fb0cf; }
.contact-panel.skin-paper .tux-comment-body, .contact-panel.skin-paper .tux-comment-who { color: #16336b; }

.contact-panel.skin-terminal, .contact-fab.skin-terminal {
  background: #05070a; border: 1px solid #123; color: #35e0d8; font-family: var(--font-mono);
}
.contact-panel.skin-terminal .cp-btn { background: #0a0f14; border-color: #123; color: #35e0d8; }
.contact-panel.skin-terminal .cp-btn-primary { background: #35e0d8; color: #05070a; }

.contact-panel.skin-neon, .contact-fab.skin-neon {
  background: #150d1f; border: 1px solid #7a5cff; color: #f4e9ff; box-shadow: 0 0 22px rgba(122,92,255,0.4);
}
.contact-panel.skin-neon .cp-btn { background: #1f1530; border-color: #7a5cff; color: #f4e9ff; }
.contact-panel.skin-neon .cp-btn-primary { background: linear-gradient(120deg,#ff3ca6,#7a5cff); color: #fff; border: 0; }

.contact-panel.skin-zine, .contact-fab.skin-zine {
  background: #f4f1ea; border: 2px solid #111; color: #111; font-family: Georgia, serif;
}
.contact-panel.skin-zine .cp-btn { background: #fff; border: 1.5px solid #111; color: #111; border-radius: 0; }
.contact-panel.skin-zine .cp-btn-primary { background: #111; color: #f4f1ea; }
.contact-panel.skin-zine .cp-title, .contact-panel.skin-zine .cp-comments-head { color: #111; }

.contact-panel.skin-pastel, .contact-fab.skin-pastel {
  background: #fff6f0; border: 1px solid #ffd4e2; color: #7a1f4f; font-family: 'Segoe UI', system-ui, sans-serif;
}
.contact-panel.skin-pastel .cp-btn { background: #ffe1ec; border-color: #ffc2d6; color: #7a1f4f; }
.contact-panel.skin-pastel .cp-btn-primary { background: #ff9dc7; color: #4a1030; }
.contact-panel.skin-pastel .cp-title, .contact-panel.skin-pastel .cp-comments-head { color: #b0568a; }

.contact-panel.skin-minimal, .contact-fab.skin-minimal {
  background: linear-gradient(180deg,#24272d,#1a1c20); border: 1px solid var(--steel-700);
}

/* =====================================================================
   Retro-future treatment — PUBLIC PAGES ONLY (body.retro on splash,
   login, register, 404, account-closed). Nothing here touches the
   logged-in site; every selector is scoped under body.retro. It leans
   the existing dark "device panel" system harder into CRT / BBS: harder
   edges, hard-offset shadows, a stronger scanline+roll, a dithered
   ground, and VT323 for display type.
   ===================================================================== */

body.retro {
  /* keep the base gradient ground, add an ordered dot-dither on top,
     faintly tinted phosphor-amber/green */
  background:
    radial-gradient(circle at 50% 50%, rgba(255,180,84,0.05) 0.5px, transparent 0.7px) 0 0 / 3px 3px,
    radial-gradient(circle at 50% 50%, rgba(79,206,127,0.035) 0.5px, transparent 0.7px) 1px 1px / 3px 3px,
    linear-gradient(180deg, var(--graphite-900), #0c0e11 70%);
  background-attachment: fixed;
}
body.retro ::selection { background: var(--amber-400); color: #000; }

/* ---- CRT overlay (partials-crt.ejs) ---- */
.crt-glass, .crt-roll { display: none; }
body.retro .crt-glass,
body.retro .crt-roll {
  display: block; position: fixed; inset: 0; pointer-events: none;
}
body.retro .crt-glass {
  z-index: 9997;
  background:
    radial-gradient(120% 120% at 50% 50%, transparent 55%, rgba(0,0,0,0.55) 100%);
  box-shadow: inset 0 0 120px rgba(0,0,0,0.5), inset 0 0 2px rgba(90,209,230,0.25);
}
body.retro .crt-roll {
  z-index: 9998;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.16) 0 1px, transparent 1px 2px);
}
body.retro .crt-roll::after {
  content: ''; position: absolute; left: 0; right: 0; height: 22%;
  background: linear-gradient(180deg, transparent, rgba(90,209,230,0.05) 45%, rgba(255,255,255,0.04) 50%, transparent);
  animation: crt-roll 7.5s linear infinite;
}
@keyframes crt-roll { from { top: -25%; } to { top: 105%; } }

/* ---- panels as terminal windows ---- */
body.retro .panel {
  border-radius: 3px;
  border: 2px solid var(--steel-600);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.03);
}
body.retro .panel .rivet-bl,
body.retro .panel .rivet-br { opacity: 0.5; }

.crt-bar { display: none; }
body.retro .crt-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin: -28px -28px 18px;               /* pull to the panel edges (.panel padding: 28px) */
  padding: 6px 12px;
  border-radius: 1px 1px 0 0;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--amber-400);
  background: #0c0f12; border-bottom: 1px solid var(--steel-700);
}
body.retro .crt-bar::after {
  content: '▓▒░'; letter-spacing: 1px; color: var(--steel-600); font-size: 9px;
}

/* ---- chunky buttons that physically press ---- */
body.retro .btn {
  border-radius: 2px; border-width: 2px;
  box-shadow: 3px 3px 0 #000;
  transition: transform .04s, box-shadow .04s;
}
body.retro .btn:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 #000; }
body.retro .btn:active { transform: translate(2px,2px); box-shadow: 0 0 0 #000; }
body.retro .btn-primary { box-shadow: 3px 3px 0 #000, inset 0 1px 0 rgba(255,255,255,0.25); }

/* ---- squared, backlit form fields ---- */
body.retro input[type=text],
body.retro input[type=password],
body.retro input[type=email],
body.retro select,
body.retro textarea {
  border-radius: 0; border: 1px solid var(--steel-600);
  box-shadow: inset 0 0 0 2px #0b0d10, inset 0 2px 8px rgba(0,0,0,0.6);
}
body.retro input:focus,
body.retro select:focus,
body.retro textarea:focus {
  outline: 2px solid var(--cyan-400); outline-offset: 0;
}
body.retro .field label,
body.retro form label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; }
body.retro form label::before { content: '> '; color: var(--cyan-400); }

/* ---- links ---- */
body.retro a { text-decoration: underline; text-underline-offset: 2px; }
body.retro a:visited { color: var(--cyan-500); }
body.retro a:focus-visible { outline: 2px solid var(--cyan-400); outline-offset: 2px; }

/* ---- hero: blocky CRT headline ---- */
body.retro .hero h1 {
  font-family: var(--font-crt);
  font-size: clamp(46px, 8vw, 88px);
  line-height: 0.92; letter-spacing: 0.01em; text-transform: uppercase;
  color: var(--paper-100);
  text-shadow: 2px 0 var(--cyan-500), -2px 0 rgba(255,159,46,0.75);
}
body.retro .hero .tagline { font-family: var(--font-mono); font-size: 14.5px; }

/* ALPHA plate -> blinking tag */
body.retro .alpha-plate { border-radius: 2px; }
body.retro .alpha-plate > span:first-child { animation: crt-blink 1.2s steps(1) infinite; }
@keyframes crt-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.35; } }

/* boot lines above the hero */
.crt-boot { display: none; }
body.retro .crt-boot {
  display: block; width: fit-content; max-width: 100%; margin: 0 auto 20px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.7;
  color: var(--green-500); text-align: left; white-space: pre;
  overflow: hidden;
}
body.retro .crt-boot span {
  display: block; overflow: hidden; white-space: nowrap;
  width: 0; animation: crt-type .5s steps(30) forwards;
}
body.retro .crt-boot span:nth-child(2) { animation-delay: .5s; }
body.retro .crt-boot span:nth-child(3) { animation-delay: 1s; }
body.retro .crt-boot span:nth-child(3)::after {
  content: '▊'; animation: crt-blink 1s steps(1) infinite;
}
@keyframes crt-type { to { width: 100%; } }

/* feature cards -> corner-bracketed */
body.retro .feature-card { position: relative; padding: 4px 4px 4px 12px; }
body.retro .feature-card::before,
body.retro .feature-card::after {
  content: ''; position: absolute; width: 9px; height: 9px;
  border: 2px solid var(--cyan-500);
}
body.retro .feature-card::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
body.retro .feature-card::after  { bottom: 0; right: 0; border-left: 0; border-top: 0; }
body.retro .feature-card h3 { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.03em; }

/* 404 */
body.retro .crt-404 {
  font-family: var(--font-crt); font-size: clamp(64px, 16vw, 140px); line-height: 1;
  color: var(--red-500); text-shadow: 3px 0 var(--cyan-500), -3px 0 #000;
  animation: crt-jitter 3.5s steps(1) infinite;
}
@keyframes crt-jitter {
  0%, 92%, 100% { transform: translate(0,0); }
  93% { transform: translate(-2px, 1px); }
  95% { transform: translate(2px, -1px); }
  97% { transform: translate(-1px, 0); }
}

@media (prefers-reduced-motion: reduce) {
  body.retro .crt-roll::after { animation: none; opacity: 0; }
  body.retro .alpha-plate > span:first-child,
  body.retro .crt-boot span:nth-child(3)::after { animation: none; opacity: 1; }
  body.retro .crt-boot span { animation: none; width: 100%; }
  body.retro .crt-404 { animation: none; }
}

@media (max-width: 640px) {
  body.retro .panel { box-shadow: 4px 4px 0 rgba(0,0,0,0.55); }
  body.retro .btn { box-shadow: 2px 2px 0 #000; }
  body.retro .crt-boot { font-size: 10.5px; }
}
