* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --panel-max-width: 30rem;
}

body {
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', 'Noto Sans KR', sans-serif;
  color: #fff;
  cursor: default;
}

#game-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Subtle filmic vignette over the 3D view */
#vignette {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.38) 100%);
}

/* ═══════════ Overlays / menus ═══════════ */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  cursor: default;
}

.menu-content {
  text-align: center;
  max-width: 31.25rem;
  padding: 0 1em;
}

.title {
  font-size: 2.4rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  margin-bottom: 0.5em;
  text-transform: uppercase;
  animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.subtitle {
  font-size: 0.95rem;
  opacity: 0.6;
  margin-bottom: 2em;
  font-style: italic;
}

.menu-content button {
  display: block;
  margin: 0.8em auto;
  padding: 0.8em 2.5em;
  min-height: 3rem;
  font-size: 1.05rem;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  letter-spacing: 0.1em;
}

.menu-content button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.lang-select {
  margin-top: 2em;
  display: flex;
  justify-content: center;
  gap: 1em;
}

/* auto side-margins on .menu-content button would spread flex items apart */
.lang-select button {
  margin: 0;
}

.lang-btn {
  padding: 0.4em 1em !important;
  font-size: 0.9rem !important;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.lang-btn.active {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.8) !important;
}

.btn-reset {
  margin-top: 2.5em !important;
  padding: 0.4em 1.2em !important;
  min-height: 2.25rem !important;
  font-size: 0.7rem !important;
  opacity: 0.25;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.btn-reset:hover {
  opacity: 0.6;
  border-color: rgba(255, 100, 100, 0.5) !important;
  color: #ff8888;
}

.controls-hint {
  font-size: 0.85rem;
  opacity: 0.4;
  margin-top: 1em;
}

.pause-chapter {
  font-size: 0.85rem;
  opacity: 0.5;
  margin-bottom: 1.5em;
  letter-spacing: 0.1em;
}

/* Rotate prompt */
.rotate-icon {
  font-size: 3rem;
  margin-bottom: 0.4em;
  animation: rotateHint 2s ease-in-out infinite;
}

@keyframes rotateHint {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
}

/* ═══════════ Chapter title card ═══════════ */
#title-card {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 140;
  /* NOTE: #click-to-play sits at 150 so its prompt reads over the pre-shown card */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}

#title-card.visible { opacity: 1; }

.title-card-chapter {
  font-size: 0.85rem;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  opacity: 0.45;
  text-transform: uppercase;
  margin-bottom: 1em;
}

.title-card-name {
  font-size: 1.7rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}

/* ═══════════ Narrator Chat Log ═══════════ */
#narrator-log {
  position: fixed;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 43.75rem;
  width: 90%;
  z-index: 132; /* above the laptop OS — inner monologue keeps speaking over screens */
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

.narrator-line {
  font-size: 1.05rem;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.95);
  text-shadow:
    0 0 8px rgba(0, 0, 0, 0.95),
    0 0 16px rgba(0, 0, 0, 0.8),
    0 1px 3px rgba(0, 0, 0, 1),
    0 0 30px rgba(0, 0, 0, 0.5);
  padding: 0.2em 0;
  opacity: 1;
  transition: opacity 1.5s ease-out;
  animation: lineAppear 0.4s ease-out;
}

.narrator-line.narrator-old { opacity: 0.3; }

.narrator-line.narrator-gone {
  opacity: 0;
  transition: opacity 0.8s ease-out;
}

@keyframes lineAppear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Inner monologue — the whole game speaks in this voice */
.narrator-line.mode-inner,
.narrator-line.mode-inner_uneasy,
.narrator-line.mode-questioning,
.narrator-line.mode-cracking,
.narrator-line.mode-revealed,
.narrator-line.mode-dialogue {
  font-style: italic;
  padding-left: 1em;
}

/* Moods */
.narrator-line.mood-dry      { color: rgba(200, 210, 230, 0.88); }
.narrator-line.mood-wry      { color: rgba(210, 220, 200, 0.9); }
.narrator-line.mood-tempted  { color: rgba(235, 220, 170, 0.92); }
.narrator-line.mood-anxious  { color: rgba(220, 190, 190, 0.92); }
.narrator-line.mood-guilty   { color: rgba(200, 185, 215, 0.92); }
.narrator-line.mood-resolved { color: rgba(190, 215, 235, 0.95); }
.narrator-line.mood-calm     { color: rgba(200, 215, 255, 0.95); }

.narrator-line.mood-anxious {
  animation: lineAppear 0.4s ease-out, anxiousShake 4s ease-in-out infinite;
}

@keyframes anxiousShake {
  0%, 94%, 100% { transform: translateX(0); }
  96% { transform: translateX(1px); }
  98% { transform: translateX(-1px); }
}

/* ═══════════ Crosshair / interact prompt ═══════════ */
#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  opacity: 0.5;
  z-index: 40;
  pointer-events: none;
  font-weight: 100;
}

#interact-prompt {
  position: fixed;
  bottom: 24%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5em 1.2em;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
  z-index: 45;
  pointer-events: none;
  animation: promptPulse 2s ease-in-out infinite;
}

@keyframes promptPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ═══════════ HUD: phone badge & item chip ═══════════ */
#phone-badge {
  position: fixed;
  top: calc(var(--safe-top) + 0.75rem);
  right: 12px;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
  z-index: 60;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#phone-badge.has-unread {
  border-color: rgba(255, 210, 120, 0.6);
  animation: badgeBuzz 0.5s ease-out;
}

@keyframes badgeBuzz {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}

.phone-badge-count {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  min-width: 1.125rem;
  height: 1.125rem;
  border-radius: 0.6rem;
  background: #cc5533;
  color: #fff;
  font-size: 0.65rem;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

#phone-badge.has-unread .phone-badge-count { display: flex; }

.phone-badge-key {
  position: absolute;
  bottom: -0.45rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.05em;
}

#item-chip {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 0.75rem);
  left: 12px;
  padding: 0.45em 0.9em;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(200, 180, 100, 0.4);
  color: rgba(255, 220, 150, 0.9);
  font-size: 0.75rem;
  border-radius: 8px;
  z-index: 55;
  pointer-events: none;
  letter-spacing: 0.05em;
}

/* ═══════════ Focus panels (monitor / terminal / report / hold) ═══════════ */
.focus-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  padding: calc(var(--safe-top) + 16px) 12px calc(var(--safe-bottom) + 16px);
}

.focus-panel {
  width: 100%;
  max-width: var(--panel-max-width);
  max-height: 88vh;
  background: #0c0e14;
  border: 1px solid rgba(120, 150, 200, 0.25);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 18px rgba(80, 120, 200, 0.08);
  position: relative;
  animation: panelIn 0.35s ease-out;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* CRT scanline feel on all in-fiction screens */
.focus-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.08) 0px,
    rgba(0, 0, 0, 0.08) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
}

.focus-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7em 1em;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: rgba(160, 190, 230, 0.7);
  border-bottom: 1px solid rgba(120, 150, 200, 0.15);
  background: rgba(255, 255, 255, 0.02);
}

.focus-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.6);
  width: 2.125rem;
  height: 2.125rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.focus-close:hover { border-color: rgba(255, 255, 255, 0.5); }

.focus-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1em 1.1em;
  font-family: 'Courier New', monospace;
  font-size: 0.92rem;
  line-height: 1.75;
  color: rgba(190, 215, 245, 0.92);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.focus-panel-body h3 {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  opacity: 0.55;
  margin: 0.8em 0 0.4em;
  text-transform: uppercase;
}

.focus-panel-body .doc-line { margin: 0.25em 0; white-space: pre-wrap; }
.focus-panel-body .doc-dim { opacity: 0.5; }
.focus-panel-body .doc-warn { color: rgba(255, 170, 120, 0.95); }

/* Terminal (ASI) — green phosphor, distinct from narrator */
.terminal-panel {
  background: #060a06;
  border-color: rgba(60, 160, 80, 0.3);
}

.terminal-header {
  color: rgba(110, 220, 130, 0.65);
  border-bottom-color: rgba(60, 160, 80, 0.2);
}

.terminal-body {
  color: #4ade6a;
  text-shadow: 0 0 5px rgba(70, 220, 100, 0.25);
}

.terminal-line { white-space: pre-wrap; margin: 0.3em 0; animation: termLineIn 0.15s ease-out; }
.terminal-line.term-sys { color: rgba(140, 180, 150, 0.55); font-size: 0.8rem; }
.terminal-line.term-player { color: rgba(220, 235, 255, 0.9); }
.terminal-line.term-player::before { content: '$ '; opacity: 0.6; }

@keyframes termLineIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.terminal-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: #4ade6a;
  vertical-align: text-bottom;
  animation: cursorBlink 0.9s step-start infinite;
}

@keyframes cursorBlink {
  50% { opacity: 0; }
}

.terminal-choices {
  padding: 0.6em 1em calc(0.8em);
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  border-top: 1px solid rgba(60, 160, 80, 0.15);
}

.terminal-choices button {
  min-height: 3.25rem;
  padding: 0.6em 1em;
  background: rgba(70, 220, 100, 0.05);
  border: 1px solid rgba(70, 220, 100, 0.3);
  border-radius: 4px;
  color: rgba(210, 240, 220, 0.92);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.terminal-choices button:hover,
.terminal-choices button:active {
  background: rgba(70, 220, 100, 0.14);
}

.terminal-choices .choice-num { opacity: 0.5; margin-right: 0.6em; }

/* Report composer */
.report-panel { border-color: rgba(200, 190, 150, 0.25); }

.report-slot { margin-bottom: 1.1em; }

.report-slot-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  opacity: 0.5;
  text-transform: uppercase;
  margin-bottom: 0.4em;
}

.report-option {
  display: block;
  width: 100%;
  min-height: 3.125rem;
  margin: 0.35em 0;
  padding: 0.55em 0.9em;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  color: rgba(225, 230, 240, 0.85);
  font-family: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.report-option.selected {
  border-color: rgba(200, 190, 150, 0.75);
  background: rgba(200, 190, 150, 0.08);
  color: rgba(245, 240, 220, 0.98);
}

.report-submit {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  margin-top: 0.5em;
  background: rgba(200, 190, 150, 0.1);
  border: 1px solid rgba(200, 190, 150, 0.4);
  border-radius: 4px;
  color: rgba(245, 240, 220, 0.95);
  font-family: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.report-submit:disabled { opacity: 0.3; cursor: default; }

/* ═══════════ Phone overlay ═══════════ */
#phone-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 115;
  background: rgba(0, 0, 0, 0.45);
}

.phone-sheet {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--panel-max-width);
  height: 76%;
  background: #101318;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  padding: 10px 14px calc(var(--safe-bottom) + 10px);
  animation: sheetUp 0.3s ease-out;
}

@keyframes sheetUp {
  from { transform: translateX(-50%) translateY(40%); opacity: 0.5; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.phone-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.375rem;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.phone-handle {
  width: 2.75rem;
  height: 0.25rem;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}

.phone-wallet {
  border: 1px solid rgba(120, 200, 160, 0.3);
  border-radius: 10px;
  background: rgba(60, 160, 110, 0.06);
  padding: 0.6em 1em;
  margin-bottom: 0.7em;
}

.phone-wallet-label {
  font-family: 'Courier New', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  opacity: 0.5;
}

.phone-wallet-balance {
  font-family: 'Courier New', monospace;
  font-size: 1.4rem;
  color: rgba(150, 230, 180, 0.95);
  margin-top: 0.15em;
}

.phone-thread {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  padding: 0.4em 0.2em;
  -webkit-overflow-scrolling: touch;
}

.phone-msg {
  max-width: 82%;
  padding: 0.55em 0.85em;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  animation: msgIn 0.25s ease-out;
  white-space: pre-wrap;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.phone-msg.from-them {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
  color: rgba(235, 238, 245, 0.95);
}

.phone-msg.from-me {
  align-self: flex-end;
  background: rgba(90, 140, 220, 0.28);
  border-bottom-right-radius: 4px;
  color: rgba(240, 245, 255, 0.97);
}

.phone-msg.sys-note {
  align-self: center;
  background: none;
  font-size: 0.72rem;
  opacity: 0.45;
  padding: 0.2em;
}

.phone-msg .msg-sender {
  display: block;
  font-size: 0.68rem;
  opacity: 0.5;
  margin-bottom: 0.2em;
}

.phone-replies {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
  padding-top: 0.5em;
}

.phone-replies button {
  min-height: 3rem;
  padding: 0.5em 1em;
  background: rgba(90, 140, 220, 0.12);
  border: 1px solid rgba(90, 140, 220, 0.4);
  border-radius: 12px;
  color: rgba(230, 240, 255, 0.95);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.phone-close {
  position: absolute;
  top: 0.125rem;
  right: 0;
  width: 2.125rem;
  height: 2.125rem;
  font-size: 0.85rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

/* ═══════════ Hold overlay (copy / signature) ═══════════ */
.hold-panel { border-color: rgba(200, 150, 120, 0.3); }

.hold-status {
  min-height: 2.6em;
  font-size: 0.85rem;
  opacity: 0.75;
  margin-bottom: 0.8em;
  white-space: pre-wrap;
}

.hold-bar {
  height: 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 0.9em;
}

.hold-bar-fill {
  height: 100%;
  width: 0%;
  background: rgba(140, 200, 250, 0.7);
  transition: width 0.1s linear;
}

.hold-heat-wrap { margin-bottom: 0.9em; }

.hold-heat-label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  opacity: 0.5;
  margin-bottom: 0.25em;
}

.hold-heat {
  height: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  overflow: hidden;
}

.hold-heat-fill {
  height: 100%;
  width: 0%;
  background: rgba(120, 200, 140, 0.7);
  transition: width 0.1s linear, background 0.3s;
}

.hold-heat-fill.heat-hot { background: rgba(240, 110, 80, 0.85); }

.hold-btn {
  display: block;
  width: 100%;
  min-height: 4rem;
  background: rgba(140, 200, 250, 0.08);
  border: 1px solid rgba(140, 200, 250, 0.4);
  border-radius: 8px;
  color: rgba(230, 242, 255, 0.95);
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.hold-btn:active { background: rgba(140, 200, 250, 0.2); }

/* ═══════════ Ending / cliffhanger ═══════════ */
#ending-screen {
  background: #000;
}

.ending-content {
  text-align: center;
  max-width: 37.5rem;
  padding: 0 1.2em;
}

.ending-content button {
  display: block;
  margin: 0.8em auto;
  padding: 0.8em 2.5em;
  min-height: 3rem;
  font-size: 1rem;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.1em;
}

.ending-content button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.ending-content h2 {
  font-size: 1.8rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  margin-bottom: 1em;
}

#ending-body {
  font-size: 1rem;
  line-height: 1.9;
  opacity: 0.85;
  margin-bottom: 2em;
  white-space: pre-wrap;
}

.ending-credit {
  display: block;
  margin-top: 3em;
  font-size: 0.7rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  letter-spacing: 3px;
  text-indent: 3px;
  text-transform: uppercase;
}

.ending-credit:hover { color: rgba(255, 255, 255, 0.7); }

/* ═══════════ Webcam cliffhanger frame ═══════════ */
#webcam-frame {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 90;
  pointer-events: none;
}

.webcam-header {
  position: absolute;
  top: calc(var(--safe-top) + 1rem);
  left: 1rem;
  display: flex;
  gap: 1.125rem;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

.webcam-rec {
  color: #ff3333;
  animation: recBlink 1s ease-in-out infinite;
}

@keyframes recBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.webcam-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.07) 0px,
    rgba(0, 0, 0, 0.07) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* ═══════════ Speech toasts (ASI earbuds / guard) ═══════════ */
#speech-toasts { z-index: 132 !important;
  position: fixed;
  top: calc(var(--safe-top) + 4.25rem);
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 37.5rem;
  z-index: 65;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

.speech-line {
  padding: 0.55em 1em;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.9rem;
  line-height: 1.6;
  animation: lineAppear 0.3s ease-out;
  transition: opacity 0.9s ease, height 0.5s ease 0.4s, margin 0.5s ease 0.4s, padding 0.5s ease 0.4s;
}

.speech-line.speech-gone { opacity: 0; }

.speech-line.speech-asi {
  font-family: 'Courier New', monospace;
  color: rgba(130, 230, 150, 0.95);
  border-color: rgba(70, 220, 100, 0.35);
  text-shadow: 0 0 5px rgba(70, 220, 100, 0.25);
}

.speech-line.speech-asi::before {
  content: '● AVOLC-9.1';
  display: block;
  font-size: 0.62rem;
  opacity: 0.55;
  letter-spacing: 0.15em;
  margin-bottom: 0.25em;
}

.speech-line.speech-guard {
  color: rgba(255, 222, 170, 0.97);
  border-color: rgba(255, 200, 120, 0.35);
}

.speech-line.speech-guard::before {
  content: attr(data-speaker);
  display: block;
  font-size: 0.62rem;
  opacity: 0.55;
  letter-spacing: 0.15em;
  margin-bottom: 0.25em;
}

/* ═══════════ Misc effects ═══════════ */
.room-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.5) 100%);
  opacity: 0;
  animation: vignetteFlash 1.2s ease-out forwards;
}

@keyframes vignetteFlash {
  0% { opacity: 0.7; }
  100% { opacity: 0; }
}

.inventory-popup {
  position: fixed;
  top: calc(var(--safe-top) + 12%);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.6em 1.5em;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(200, 180, 100, 0.4);
  color: rgba(255, 220, 150, 0.9);
  font-size: 0.9rem;
  z-index: 55;
  pointer-events: none;
  animation: popupShow 3s ease-out forwards;
}

@keyframes popupShow {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

.fade-in { animation: fadeIn 1s ease-in; }
.fade-out { animation: fadeOut 1s ease-out; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* Full-screen black fader used by chapter transitions */
#screen-fader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 130;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

#screen-fader.dark { opacity: 1; }

/* ═══════════ Message arrival banner ═══════════ */
#msg-banner {
  position: fixed;
  top: calc(var(--safe-top) + 4rem);
  right: 12px;
  max-width: 21.25rem;
  z-index: 133; /* the phone buzzes over whatever screen is open */
  background: rgba(12, 14, 20, 0.92);
  border: 1px solid rgba(255, 205, 110, 0.55);
  border-left: 3px solid rgba(255, 205, 110, 0.9);
  border-radius: 10px;
  padding: 0.6em 0.9em;
  cursor: pointer;
  animation: bannerIn 0.35s ease-out;
  transition: opacity 0.8s ease, transform 0.3s ease;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

#msg-banner.banner-gone { opacity: 0; pointer-events: none; }

@keyframes bannerIn {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

#msg-banner .banner-sender {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(255, 214, 140, 0.95);
  margin-bottom: 0.2em;
}

#msg-banner .banner-preview {
  font-size: 0.85rem;
  line-height: 1.45;
  color: rgba(240, 242, 248, 0.92);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#msg-banner .banner-hint {
  margin-top: 0.35em;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
}

/* ═══════════ Desktop text scaling ═══════════ */
@media (min-width: 1024px) {
  /* Text-heavy game: desktop UI renders at 1.5x (the user reads at roughly
     browser-zoom scale). All type and UI dimensions are rem-based, so scaling
     the root scales the whole UI uniformly. */
  html { font-size: 24px; }
  .narrator-line { font-size: 1.35rem; }

  /* Choices should be scannable at a glance: drop touch-size minimums and
     give panels more height so option lists fit without scrolling. */
  .focus-panel { max-height: 92vh; }
  .terminal-choices button,
  .report-option,
  .report-submit,
  .phone-replies button { min-height: 0; }

  /* Phone: wider, taller sheet + compact bubbles so the thread reads at a glance */
  .phone-sheet { max-width: 38rem; height: 86%; }
  .phone-msg { font-size: 0.9rem; padding: 0.45em 0.8em; max-width: 76%; }
  .phone-thread { gap: 0.4em; }
  .phone-replies button { padding: 0.4em 1em; }
  .phone-wallet { padding: 0.45em 1em; margin-bottom: 0.5em; }
  .phone-wallet-balance { font-size: 1.2rem; }
  .report-option { padding: 0.45em 0.9em; margin: 0.3em 0; }
  .report-slot { margin-bottom: 0.8em; }

  .speech-line { font-size: 1.1rem; }
  #interact-prompt { font-size: 1.05rem; }
  .focus-panel-body { font-size: 1rem; }
  .terminal-choices button { font-size: 1rem; }
  #msg-banner .banner-preview { font-size: 0.95rem; }
  .title-card-name { font-size: 2.1rem; }

  /* Scroll affordance: always-visible scrollbars on reading panes */
  .focus-panel-body,
  .phone-thread {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) rgba(255, 255, 255, 0.06);
  }
  .focus-panel-body::-webkit-scrollbar,
  .phone-thread::-webkit-scrollbar { width: 12px; }
  .focus-panel-body::-webkit-scrollbar-track,
  .phone-thread::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 6px; }
  .focus-panel-body::-webkit-scrollbar-thumb,
  .phone-thread::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 6px; }
  .focus-panel-body::-webkit-scrollbar-thumb:hover,
  .phone-thread::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.45); }
  .terminal-body { scrollbar-color: rgba(70, 220, 100, 0.4) rgba(70, 220, 100, 0.08); }
  .terminal-body::-webkit-scrollbar-track { background: rgba(70, 220, 100, 0.07); }
  .terminal-body::-webkit-scrollbar-thumb { background: rgba(70, 220, 100, 0.35); }
  .terminal-body::-webkit-scrollbar-thumb:hover { background: rgba(70, 220, 100, 0.5); }

  /* Scroll shadows: a fading edge appears while more content lies below/above */
  .focus-panel-body {
    background:
      linear-gradient(#0c0e14 30%, rgba(12, 14, 20, 0)) top,
      linear-gradient(rgba(12, 14, 20, 0), #0c0e14 70%) bottom,
      radial-gradient(farthest-side at top, rgba(160, 190, 230, 0.28), transparent) top,
      radial-gradient(farthest-side at bottom, rgba(160, 190, 230, 0.28), transparent) bottom;
    background-repeat: no-repeat;
    background-size: 100% 30px, 100% 30px, 100% 12px, 100% 12px;
    background-attachment: local, local, scroll, scroll;
  }
  .terminal-body {
    background:
      linear-gradient(#060a06 30%, rgba(6, 10, 6, 0)) top,
      linear-gradient(rgba(6, 10, 6, 0), #060a06 70%) bottom,
      radial-gradient(farthest-side at top, rgba(70, 220, 100, 0.3), transparent) top,
      radial-gradient(farthest-side at bottom, rgba(70, 220, 100, 0.3), transparent) bottom;
    background-repeat: no-repeat;
    background-size: 100% 30px, 100% 30px, 100% 12px, 100% 12px;
    background-attachment: local, local, scroll, scroll;
  }
  .phone-thread {
    background:
      linear-gradient(#101318 30%, rgba(16, 19, 24, 0)) top,
      linear-gradient(rgba(16, 19, 24, 0), #101318 70%) bottom,
      radial-gradient(farthest-side at top, rgba(200, 215, 235, 0.22), transparent) top,
      radial-gradient(farthest-side at bottom, rgba(200, 215, 235, 0.22), transparent) bottom;
    background-repeat: no-repeat;
    background-size: 100% 26px, 100% 26px, 100% 10px, 100% 10px;
    background-attachment: local, local, scroll, scroll;
  }
}

/* ═══════════ Portrait mobile tuning ═══════════ */
@media (max-width: 768px) and (orientation: portrait) {
  #narrator-log { bottom: 27%; font-size: 0.85em; }
  #interact-prompt { display: none !important; } /* replaced by contextual touch pill */
  .title { font-size: 1.7rem; }
  .focus-panel { max-height: 82vh; }
}

/* ═══════════ Laptop — fake macOS desktop ═══════════ */
#laptop-os {
  position: fixed;
  inset: 0;
  z-index: 118;
  display: none;
  flex-direction: column;
  background:
    radial-gradient(120% 90% at 20% 10%, #34406b 0%, transparent 55%),
    radial-gradient(100% 80% at 85% 85%, #5b3a63 0%, transparent 55%),
    linear-gradient(160deg, #1b2033 0%, #232a44 45%, #2c2440 100%);
  font-family: -apple-system, 'Segoe UI', 'Noto Sans KR', sans-serif;
  color: #e8eaf0;
}

.os-menubar {
  display: flex;
  align-items: center;
  gap: 0.9em;
  padding: 0.22em 0.9em;
  font-size: 0.72rem;
  background: rgba(20, 22, 30, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(240, 242, 248, 0.92);
  flex-shrink: 0;
}
.os-logo { font-size: 0.85rem; }
.os-appname { font-weight: 700; }
.os-menu-item { opacity: 0.75; }
.os-tray { margin-left: auto; display: flex; gap: 0.8em; align-items: center; }
.os-batt { letter-spacing: -0.1em; opacity: 0.8; font-size: 0.6rem; }

.os-view {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0.8rem 1rem 0.4rem;
}

.os-desktop {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8em;
}
.os-wallhint { opacity: 0.4; font-size: 0.8rem; }
.os-noti {
  margin-top: 1.2em;
  padding: 0.7em 1.1em;
  background: rgba(22, 24, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 4px solid #ff9f0a;
  border-radius: 10px;
  font-size: 0.8rem;
  cursor: pointer;
  max-width: 26rem;
}
.os-noti:hover { background: rgba(40, 44, 60, 0.85); }

/* window frame */
.os-frame {
  flex: 1;
  max-width: 62rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.os-titlebar {
  display: flex;
  align-items: center;
  padding: 0.4em 0.8em;
  background: linear-gradient(#3a3d48, #32353f);
  flex-shrink: 0;
}
.os-lights { display: flex; gap: 0.45em; margin-right: 0.9em; }
.os-lights i { width: 0.75em; height: 0.75em; border-radius: 50%; display: inline-block; cursor: pointer; }
.os-lights .r { background: #ff5f57; }
.os-lights .y { background: #febc2e; }
.os-lights .g { background: #28c840; }
.os-title { font-size: 0.7rem; opacity: 0.75; }

.os-window {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.os-window.os-split { flex-direction: row; }
.os-window.os-light { background: #f4f5f7; color: #23252b; }
.os-window.os-dark { background: #16181e; color: #d9dce4; }

/* dock */
.os-dock {
  align-self: center;
  display: flex;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  margin: 0.3rem 0 0.6rem;
  background: rgba(30, 32, 44, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
  max-width: 96vw;
  overflow-x: auto;
}
.os-dock-app {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2em;
  min-width: 3.4rem;
  padding: 0.3em 0.4em;
  background: transparent;
  border: none;
  color: #e8eaf0;
  cursor: pointer;
  border-radius: 10px;
  font-family: inherit;
}
.os-dock-app:hover { background: rgba(255, 255, 255, 0.1); }
.os-dock-icon {
  width: 2.1rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 26%;
  background: linear-gradient(150deg, #5a6478, #363c4c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 6px rgba(0, 0, 0, 0.4);
}
.os-dock-app:nth-child(1) .os-dock-icon { background: linear-gradient(150deg, #2e3138, #131519); color: #7ee787; }
.os-dock-app:nth-child(2) .os-dock-icon { background: linear-gradient(150deg, #4d9fff, #1a6ae0); }
.os-dock-app:nth-child(3) .os-dock-icon { background: #fff; }
.os-dock-app:nth-child(4) .os-dock-icon { background: linear-gradient(150deg, #f0f2f6, #c9cdd6); color: #333; }
.os-dock-app:nth-child(5) .os-dock-icon { background: linear-gradient(150deg, #6cb2ff, #2f7ae0); }
.os-dock-app:nth-child(6) .os-dock-icon { background: linear-gradient(150deg, #ffffff, #e2e4ea); color: #e0453a; }
.os-dock-app:nth-child(7) .os-dock-icon { background: linear-gradient(150deg, #8a63e8, #5636b8); }
.os-dock-label { font-size: 0.55rem; opacity: 0.75; }
.os-badge {
  position: absolute;
  top: 0;
  right: 0.3rem;
  min-width: 1rem;
  height: 1rem;
  border-radius: 0.5rem;
  background: #ff3b30;
  color: #fff;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25em;
}

.os-close {
  position: absolute;
  top: 2rem;
  right: 1rem;
  padding: 0.35em 0.8em;
  background: rgba(20, 22, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: rgba(240, 242, 248, 0.85);
  font-size: 0.7rem;
  cursor: pointer;
  font-family: inherit;
}
.os-close:hover { border-color: rgba(255, 255, 255, 0.5); }

/* ── terminal app ── */
.os-app-terminal { font-family: 'Menlo', 'Courier New', monospace; }
.os-term-out {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.8em 1em;
  font-size: 0.72rem;
  line-height: 1.6;
  white-space: pre-wrap;
}
.os-term-line { margin-bottom: 0.35em; }
.os-term-cmd { color: #8ab4ff; }
.os-term-chips {
  display: flex;
  gap: 0.4em;
  padding: 0.4em 0.8em;
  overflow-x: auto;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.os-term-chips button {
  flex-shrink: 0;
  padding: 0.25em 0.7em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: #b9c3d4;
  font-family: inherit;
  font-size: 0.62rem;
  cursor: pointer;
}
.os-term-chips button:hover { background: rgba(255, 255, 255, 0.14); }
.os-term-inputrow {
  display: flex;
  gap: 0.5em;
  align-items: center;
  padding: 0.5em 1em 0.7em;
  flex-shrink: 0;
}
.os-term-ps1 { color: #7ee787; font-size: 0.72rem; white-space: nowrap; }
.os-term-inputrow input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #e8eaf0;
  font-family: inherit;
  font-size: 0.72rem;
  padding: 0.35em 0.6em;
  outline: none;
}

/* ── report empty state ── */
.os-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  color: #777;
  font-size: 0.85rem;
}
.os-empty-icon { font-size: 2rem; opacity: 0.3; }
.os-empty-sub { font-size: 0.68rem; opacity: 0.6; }

/* ── Safari: Revan portal (Naver-fidelity) ── */
.os-portal { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; }
.os-urlbar {
  display: flex; gap: 0.5em; align-items: center;
  padding: 0.3em 0.8em; background: #ececee; border-bottom: 1px solid #d8d8dc;
  font-size: 0.62rem; color: #6b6b70; flex-shrink: 0;
}
.os-urlbtn { opacity: 0.55; padding: 0 0.15em; }
.os-url {
  flex: 1; background: #fff; border-radius: 7px; padding: 0.3em 0.8em; color: #3a3a40;
  text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  box-shadow: inset 0 0 0 1px #dcdce0;
}
.os-portal-scroll { flex: 1; min-height: 0; overflow-y: auto; background: #f5f6f8; }
.os-portal-head {
  display: flex; align-items: center; gap: 1.1em;
  padding: 1.1em 1.6em 0.9em; background: #fff; flex-wrap: wrap;
}
.os-portal-head.compact { padding: 0.7em 1.6em; border-bottom: 1px solid #e8e9ec; }
.os-portal-logo {
  font-weight: 900; letter-spacing: -0.02em; font-size: 1.35rem; color: #03c75a;
  background: none; border: none; cursor: pointer; font-family: inherit; font-style: italic;
}
.os-portal-head.compact .os-portal-logo { font-size: 1rem; }
.os-portal-search {
  display: flex; flex: 1; min-width: 13rem; max-width: 30rem;
  border: 2px solid #03c75a; border-radius: 999px; overflow: hidden; background: #fff;
}
.os-portal-search input {
  flex: 1; border: none; outline: none; padding: 0.45em 1em; font-size: 0.8rem;
  font-family: inherit; color: #222;
}
.os-portal-search button {
  border: none; background: #03c75a; color: #fff; font-weight: 700; width: 2.6rem;
  cursor: pointer; font-size: 0.95rem;
}
.os-services {
  display: flex; gap: 1.3em; padding: 0.7em 1.6em 0.9em; background: #fff;
  border-bottom: 1px solid #e8e9ec; overflow-x: auto;
}
.os-service {
  display: flex; flex-direction: column; align-items: center; gap: 0.35em;
  font-size: 0.6rem; color: #444; flex-shrink: 0; cursor: pointer;
}
.os-service i {
  width: 1.9rem; height: 1.9rem; border-radius: 32%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-style: normal; font-size: 0.8rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.os-portal-cols { display: flex; gap: 1em; padding: 1em 1.6em; align-items: flex-start; flex-wrap: wrap; }
.os-box-head {
  display: flex; align-items: baseline; gap: 0.6em; padding-bottom: 0.55em;
  border-bottom: 2px solid #222;
}
.os-box-head b { font-size: 0.85rem; color: #111; }
.os-box-head span { font-size: 0.6rem; color: #999; margin-left: auto; }
.os-newsstand {
  flex: 2.2; min-width: 17rem; background: #fff; border: 1px solid #e4e5e9;
  border-radius: 10px; padding: 0.9em 1.1em;
}
.os-news-thumb {
  position: relative; overflow: hidden; border-radius: 8px; background: #dde0e6; flex-shrink: 0;
}
.os-news-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.os-news-card {
  display: block; width: 100%; text-align: left; background: none; border: none;
  font-family: inherit; cursor: pointer; padding: 0.9em 0 0.8em; border-bottom: 1px solid #eceef0;
}
.os-news-card .os-news-thumb { width: 100%; aspect-ratio: 16 / 9; margin-bottom: 0.7em; }
.os-news-card-body b { display: block; font-size: 0.95rem; line-height: 1.4; color: #111; }
.os-news-card-body span { display: block; font-size: 0.7rem; color: #666; margin-top: 0.35em; line-height: 1.55; }
.os-news-card-body em { display: block; font-size: 0.6rem; color: #999; font-style: normal; margin-top: 0.4em; }
.os-news-item {
  display: flex; gap: 0.7em; width: 100%; text-align: left; background: none; border: none;
  font-family: inherit; cursor: pointer; padding: 0.6em 0; border-bottom: 1px solid #f0f1f4;
  align-items: center;
}
.os-news-item:last-child { border-bottom: none; }
.os-news-item .os-news-thumb.sm { width: 4.6rem; aspect-ratio: 16 / 10; }
.os-news-item-title { display: block; font-size: 0.74rem; color: #222; line-height: 1.4; }
.os-news-item em { display: block; font-size: 0.58rem; color: #9aa; font-style: normal; margin-top: 0.25em; }
.os-news-item:hover .os-news-item-title, .os-news-card:hover b { text-decoration: underline; }
.os-portal-side { flex: 1; min-width: 12rem; display: flex; flex-direction: column; gap: 0.8em; }
.os-login {
  background: #fff; border: 1px solid #e4e5e9; border-radius: 10px; padding: 0.9em 1em;
  text-align: center;
}
.os-login p { font-size: 0.72rem; color: #333; line-height: 1.5; margin-bottom: 0.7em; }
.os-login-btn {
  width: 100%; background: #03c75a; color: #fff; border: none; border-radius: 8px;
  padding: 0.55em; font-weight: 700; font-size: 0.78rem; font-family: inherit; cursor: pointer;
}
.os-login-links { display: flex; justify-content: center; gap: 0.5em; margin-top: 0.6em; font-size: 0.56rem; color: #888; }
.os-login-links i { color: #ddd; font-style: normal; }
.os-trend { background: #fff; border: 1px solid #e4e5e9; border-radius: 10px; padding: 0.8em 1em; }
.os-trend-row {
  display: flex; width: 100%; align-items: center; gap: 0.6em; text-align: left;
  background: none; border: none; font-family: inherit; font-size: 0.72rem; color: #222;
  padding: 0.32em 0.1em; cursor: pointer; border-radius: 6px;
}
.os-trend-row:hover { background: #f2f4f6; }
.os-trend-row b { color: #03c75a; width: 1.1em; font-style: italic; }
.os-trend-row span { flex: 1; }
.os-trend-row i.up { color: #e03131; font-style: normal; font-size: 0.55rem; }
.os-trend-row i.dn { color: #4c8df6; font-style: normal; font-size: 0.55rem; }
.os-trend-row i.sm { color: #ccc; font-style: normal; font-size: 0.55rem; }
.os-widget-stack { display: flex; flex-direction: column; gap: 0.8em; }
.os-widget {
  background: #fff; border: 1px solid #e4e5e9; border-radius: 10px; padding: 0.7em 1em;
  display: flex; gap: 0.8em; align-items: center;
}
.os-widget b { font-size: 1.05rem; color: #222; margin-right: 0.4em; }
.os-widget span { font-size: 0.66rem; color: #667; }
.os-widget-market { display: block; }
.os-mkrow { display: flex; gap: 0.6em; font-size: 0.68rem; padding: 0.22em 0; align-items: baseline; }
.os-mkrow span { color: #444; flex: 1; }
.os-mkrow b { color: #111; font-size: 0.72rem; }
.os-mkrow em.up { color: #e03131; font-style: normal; font-size: 0.62rem; }
.os-mkrow em.dn { color: #4c8df6; font-style: normal; font-size: 0.62rem; }
.os-portal-foot { padding: 1em 1.6em 1.4em; font-size: 0.55rem; color: #aab; }

/* search results */
.os-search-tabs {
  display: flex; gap: 1.1em; padding: 0.55em 1.6em 0; background: #fff;
  border-bottom: 1px solid #e2e4e8; font-size: 0.72rem; color: #555;
}
.os-search-tabs span { padding: 0.35em 0.1em 0.5em; cursor: pointer; }
.os-search-tabs span.on { color: #03c75a; font-weight: 700; border-bottom: 2px solid #03c75a; }
.os-results { padding: 0.9em 1.6em 1.4em; display: flex; flex-direction: column; gap: 0.95em; max-width: 46rem; }
.os-results-head { font-size: 0.7rem; font-weight: 700; color: #333; border-bottom: 1px solid #e6e8ec; padding-bottom: 0.4em; }
.os-result { background: #fff; border: 1px solid #e6e8ec; border-radius: 10px; padding: 0.75em 1em; }
.os-result-src { display: flex; align-items: center; gap: 0.45em; font-size: 0.6rem; color: #666; margin-bottom: 0.3em; }
.os-result-fav {
  width: 1.15rem; height: 1.15rem; border-radius: 50%; background: #e8f6ee; color: #03a04c;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.55rem;
}
.os-result-src em { color: #aab; font-style: normal; }
.os-result-title { color: #2447b0; font-size: 0.86rem; font-weight: 600; line-height: 1.35; cursor: pointer; }
.os-result-title:hover { text-decoration: underline; }
.os-result-snippet { font-size: 0.7rem; color: #555; margin-top: 0.3em; line-height: 1.6; }
.os-noresult { color: #444; font-size: 0.8rem; padding: 1.2em 0.3em; line-height: 1.8; }
.os-noresult span { font-size: 0.66rem; color: #999; }
.os-relq {
  display: flex; flex-wrap: wrap; gap: 0.45em; align-items: center;
  background: #fff; border: 1px solid #e6e8ec; border-radius: 10px; padding: 0.7em 1em;
}
.os-relq b { font-size: 0.66rem; color: #333; margin-right: 0.4em; }
.os-relq button {
  background: #f4f6f8; border: 1px solid #e2e5ea; border-radius: 999px; color: #2447b0;
  font-family: inherit; font-size: 0.64rem; padding: 0.25em 0.75em; cursor: pointer;
}
.os-relq button:hover { background: #eaf6ef; border-color: #b8e6cb; }

/* article */
.os-article { max-width: 44rem; margin: 0 auto; background: #fff; padding: 1.1em 1.6em 1.6em; }
.os-article-press { display: flex; align-items: center; gap: 0.8em; border-bottom: 1px solid #eee; padding-bottom: 0.6em; }
.os-article-press b { font-size: 0.82rem; color: #111; }
.os-subs {
  margin-left: auto; border: 1px solid #03c75a; color: #03a04c; background: #fff;
  border-radius: 999px; font-size: 0.6rem; padding: 0.25em 0.8em; font-family: inherit; cursor: pointer;
}
.os-article h1 { font-size: 1.2rem; line-height: 1.4; color: #111; margin: 0.8em 0 0.45em; font-weight: 700; }
.os-article-meta { display: flex; gap: 0.5em; font-size: 0.62rem; color: #888; align-items: center; margin-bottom: 0.9em; }
.os-article-meta-r { margin-left: auto; color: #aaa; }
.os-article-meta-r b { border: 1px solid #ddd; border-radius: 4px; padding: 0 0.35em; font-weight: 400; }
.os-article-hero {
  position: relative; width: 100%; aspect-ratio: 3 / 2; border-radius: 8px; overflow: hidden;
  background: #dde0e6; margin: 0 0 0.4em;
}
.os-article-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.os-article-hero figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  background: linear-gradient(transparent, rgba(0,0,0,0.55)); color: rgba(255,255,255,0.85);
  font-size: 0.55rem; padding: 1.4em 0.9em 0.5em;
}
.os-article p { font-size: 0.8rem; line-height: 1.85; color: #333; margin: 0.9em 0; }
.os-article-sig { font-size: 0.66rem; color: #888; margin: 1.2em 0; }
.os-article-reacts { display: flex; gap: 0.5em; justify-content: center; padding: 0.9em 0; border-top: 1px solid #f0f0f2; }
.os-article-reacts button {
  display: flex; flex-direction: column; align-items: center; gap: 0.15em;
  background: none; border: none; font-family: inherit; cursor: pointer; padding: 0.2em 0.5em;
}
.os-article-reacts i { font-style: normal; font-size: 0.95rem; }
.os-article-reacts b { font-size: 0.56rem; color: #555; font-weight: 600; }
.os-article-reacts span { font-size: 0.55rem; color: #aaa; }
.os-comments { border-top: 1px solid #eee; padding-top: 0.8em; }
.os-comments-head { display: flex; gap: 0.5em; align-items: baseline; margin-bottom: 0.7em; }
.os-comments-head b { font-size: 0.8rem; color: #111; }
.os-comments-head span { color: #03a04c; font-weight: 700; font-size: 0.75rem; }
.os-comments-head em { margin-left: auto; font-size: 0.62rem; color: #333; font-style: normal; font-weight: 700; }
.os-comments-head em.dim { margin-left: 0.8em; color: #aaa; font-weight: 400; }
.os-comment { display: flex; gap: 0.6em; padding: 0.6em 0; border-bottom: 1px solid #f4f4f6; }
.os-comment-av {
  width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #dfe3e8; color: #778;
  display: flex; align-items: center; justify-content: center; font-size: 0.7rem; flex-shrink: 0;
}
.os-comment b { font-size: 0.62rem; color: #555; }
.os-comment p { font-size: 0.73rem !important; margin: 0.2em 0 0.35em !important; line-height: 1.6 !important; }
.os-comment-foot { display: flex; gap: 0.9em; font-size: 0.58rem; color: #999; }
.os-article-rel { border-top: 1px solid #eee; margin-top: 0.9em; padding-top: 0.7em; }
.os-article-rel h5 { font-size: 0.72rem; color: #111; margin-bottom: 0.5em; }
.os-rel-row {
  display: flex; gap: 0.6em; align-items: center; width: 100%; text-align: left;
  background: none; border: none; font-family: inherit; cursor: pointer; padding: 0.4em 0;
  font-size: 0.72rem; color: #333;
}
.os-rel-row:hover span:last-child { text-decoration: underline; }
.os-rel-thumb { position: relative; width: 3.6rem; aspect-ratio: 16/10; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: #dde0e6; }
.os-rel-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.os-rel-thumb img { z-index: 1; }
.os-linkbtn { background: none; border: none; color: #2447b0; font-family: inherit; font-size: 0.7rem; cursor: pointer; padding: 0; }

/* ── in-OS report composer ── */
.os-report { flex: 1; min-height: 0; overflow-y: auto; padding: 1em 1.4em 1.4em; max-width: 42rem; margin: 0 auto; width: 100%; }
.os-report-head b { display: block; font-size: 1rem; color: #111; }
.os-report-head span { font-size: 0.62rem; color: #888; }
.os-report-head { border-bottom: 2px solid #222; padding-bottom: 0.7em; margin-bottom: 1em; }
.os-report-slot { margin-bottom: 1.1em; }
.os-report-label {
  font-size: 0.64rem; letter-spacing: 0.08em; color: #667; text-transform: uppercase;
  margin-bottom: 0.45em; font-weight: 700;
}
.os-report-option {
  display: block; width: 100%; text-align: left; background: #fff; border: 1px solid #d8dbe2;
  border-radius: 8px; font-family: inherit; font-size: 0.76rem; color: #333;
  padding: 0.55em 0.9em; margin: 0.35em 0; cursor: pointer; line-height: 1.5;
}
.os-report-option:hover { border-color: #9fb3d8; }
.os-report-option.selected { border-color: #03a04c; background: #eefaf3; color: #111; }
.os-report-submit {
  display: block; width: 100%; background: #03c75a; border: none; border-radius: 8px;
  color: #fff; font-weight: 700; font-family: inherit; font-size: 0.82rem;
  padding: 0.65em; cursor: pointer; margin-top: 0.4em;
}
.os-report-submit:disabled { background: #d5d8de; cursor: default; }
.os-report-sent { opacity: 0.75; }

/* mobile: tighter OS chrome */
@media (max-width: 768px) and (orientation: portrait) {
  .os-view { padding: 0.4rem 0.4rem 0.2rem; }
  .os-close { top: 1.6rem; right: 0.5rem; }
  .os-dock-label { display: none; }
  .os-portal-cols { padding: 0.8em; }
  .os-portal-head, .os-services, .os-search-tabs, .os-results { padding-left: 0.9em; padding-right: 0.9em; }
}

.sl-back { display: none; } /* mobile-only back chevron in the Slack chat header */

/* ── CONNECT (Revan Works web apps: mail + calendar) ── */
.cn-app { background: #fff; color: #222; }
.cn-bar {
  display: flex; align-items: center; gap: 1em; padding: 0.5em 1em;
  border-bottom: 1px solid #e6e8ec; flex-shrink: 0; background: #fff;
}
.cn-logo { font-size: 0.9rem; font-weight: 800; letter-spacing: 0.01em; color: #222; white-space: nowrap; }
.cn-logo b { color: #03c75a; }
.cn-logo em { font-style: normal; font-weight: 700; }
.cn-search {
  flex: 1; max-width: 22rem; background: #f2f4f6; border-radius: 999px;
  padding: 0.4em 1em; font-size: 0.68rem; color: #99a;
}
.cn-tray { margin-left: auto; display: flex; gap: 0.7em; font-size: 0.78rem; }
.cn-tray i { font-style: normal; opacity: 0.55; cursor: pointer; }
.cn-tray i.on { opacity: 1; }
.cn-body { flex: 1; min-height: 0; display: flex; }
.cn-side {
  width: 12.5rem; flex-shrink: 0; border-right: 1px solid #eceef2; overflow-y: auto;
  padding: 0.8em 0.8em 0.6em; display: flex; flex-direction: column; gap: 0.7em; background: #fbfcfd;
}
.cn-side > * { flex-shrink: 0; }
.cn-write {
  display: flex; border-radius: 8px; overflow: hidden; border: 1px solid #03c75a; cursor: pointer;
}
.cn-write b { flex: 1.3; background: #03c75a; color: #fff; text-align: center; padding: 0.55em 0; font-size: 0.74rem; }
.cn-write span { flex: 1; background: #fff; color: #03a04c; text-align: center; padding: 0.55em 0; font-size: 0.74rem; font-weight: 700; }
.cn-counts { display: flex; justify-content: space-between; padding: 0 0.2em; }
.cn-counts span { display: flex; flex-direction: column; align-items: center; gap: 0.1em; font-size: 0.54rem; color: #778; }
.cn-counts b { font-size: 0.72rem; color: #2447b0; }
.cn-folders div, .cn-contacts div {
  display: flex; align-items: center; gap: 0.4em; padding: 0.34em 0.5em; font-size: 0.7rem;
  color: #445; border-radius: 6px; cursor: pointer;
}
.cn-folders div:hover, .cn-contacts div:hover { background: #f0f2f5; }
.cn-folders div.on { background: #e8f1ff; color: #1a52c8; font-weight: 700; }
.cn-folders em, .cn-contacts em { margin-left: auto; font-style: normal; font-size: 0.58rem; color: #99a; }
.cn-side-sec { font-size: 0.6rem; color: #99a; padding: 0.5em 0.5em 0; border-top: 1px solid #eef0f4; }
.cn-quota { margin-top: auto; font-size: 0.56rem; color: #aab; padding: 0.6em 0.5em 0; }
.cn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
.cn-tools {
  display: flex; align-items: center; gap: 0.35em; padding: 0.5em 0.9em;
  border-bottom: 1px solid #eceef2; flex-shrink: 0; flex-wrap: wrap;
}
.cn-tools button {
  background: #fff; border: 1px solid #dfe2e8; border-radius: 6px; font-family: inherit;
  font-size: 0.62rem; color: #445; padding: 0.3em 0.7em; cursor: pointer;
}
.cn-tools button:hover { background: #f4f6f8; }
.cn-tools-r { margin-left: auto; font-size: 0.6rem; color: #99a; }
.cn-chk input { accent-color: #03c75a; }
.cn-list { flex: 1; min-height: 0; overflow-y: auto; }
.cn-row {
  display: flex; align-items: center; gap: 0.55em; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid #f2f3f6; font-family: inherit;
  padding: 0.5em 0.9em; cursor: pointer;
}
.cn-row:hover { background: #f7f9fb; }
.cn-star { color: #ccd; font-size: 0.75rem; }
.cn-env { font-size: 0.7rem; }
.cn-from { width: 9rem; flex-shrink: 0; font-size: 0.7rem; color: #334; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-row.unread .cn-from, .cn-row.unread .cn-subj { font-weight: 700; color: #111; }
.cn-to {
  width: 1.5rem; flex-shrink: 0; font-size: 0.5rem; font-weight: 700; color: #889;
  border: 1px solid #d8dbe2; border-radius: 999px; text-align: center; padding: 0.1em 0;
}
.cn-to.none { border: none; }
.cn-subj { flex: 1; min-width: 0; font-size: 0.72rem; color: #445; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-bang { color: #e03131; font-weight: 900; }
.cn-time { font-size: 0.6rem; color: #99a; flex-shrink: 0; }
.cn-pager { display: flex; justify-content: center; gap: 0.9em; padding: 0.7em 0; font-size: 0.66rem; color: #667; flex-shrink: 0; }
.cn-pager b { color: #fff; background: #333; border-radius: 50%; width: 1.4em; height: 1.4em; display: inline-flex; align-items: center; justify-content: center; }
.cn-pager span { cursor: pointer; }
.cn-read { flex: 1; min-height: 0; overflow-y: auto; padding: 1em 1.4em; }
.cn-read h3 { font-size: 0.95rem; color: #111; line-height: 1.45; }
.cn-read-meta { display: flex; gap: 0.7em; align-items: center; margin: 0.8em 0 1em; padding-bottom: 0.8em; border-bottom: 1px solid #eef0f4; }
.cn-read-av {
  width: 2rem; height: 2rem; border-radius: 50%; background: #03c75a22; color: #03a04c;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.cn-read-meta b { display: block; font-size: 0.74rem; color: #222; }
.cn-read-meta span { font-size: 0.6rem; color: #99a; }
.cn-read-meta em { margin-left: auto; font-size: 0.6rem; color: #99a; font-style: normal; }
.cn-read-body { font-size: 0.76rem; line-height: 1.8; color: #333; }

/* calendar */
.cn-cal-side .cn-cal-write {
  width: 100%; background: #5a6cf0; color: #fff; border: none; border-radius: 8px;
  padding: 0.6em; font-family: inherit; font-weight: 700; font-size: 0.76rem; cursor: pointer;
}
.cn-mini-head { font-size: 0.74rem; font-weight: 700; color: #222; display: flex; justify-content: space-between; padding: 0.2em 0.2em 0; }
.cn-mini-head span { color: #99a; cursor: pointer; }
.cn-mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.cn-mini i {
  font-style: normal; font-size: 0.56rem; text-align: center; padding: 0.32em 0;
  color: #333; border-radius: 4px;
}
.cn-mini i.dim { color: #ccd; }
.cn-mini i.red { color: #e03131; }
.cn-mini i.red.dim { color: #eec; }
.cn-mini i.wk { background: #eef2ff; }
.cn-mini i.today { background: #5a6cf0; color: #fff; font-weight: 700; }
.cn-cal-org { border-top: none; background: #eef2ff; color: #3a4cc0; font-weight: 700; border-radius: 6px; padding: 0.5em; font-size: 0.68rem; }
.cn-cal-head {
  display: flex; align-items: center; gap: 0.7em; padding: 0.55em 1em;
  border-bottom: 1px solid #eceef2; flex-shrink: 0;
}
.cn-cal-head b { font-size: 0.9rem; color: #111; }
.cn-cal-nav { background: #fff; border: 1px solid #dfe2e8; border-radius: 6px; font-family: inherit; font-size: 0.62rem; padding: 0.3em 0.7em; color: #445; cursor: pointer; }
.cn-cal-tabs { margin-left: auto; font-size: 0.62rem; color: #889; display: flex; gap: 0.3em; align-items: center; }
.cn-cal-tabs i {
  font-style: normal; border: 1px solid #e2e5ea; border-radius: 6px; padding: 0.2em 0.6em; cursor: pointer;
}
.cn-cal-tabs i.on { background: #5a6cf0; border-color: #5a6cf0; color: #fff; }
.cn-cal-grid { flex: 1; min-height: 0; overflow-y: auto; position: relative; }
.cn-cal-row { display: flex; border-bottom: 1px solid #eef0f4; min-height: 5.2rem; }
.cn-cal-hrow { min-height: 0; position: sticky; top: 0; background: #fff; z-index: 2; border-bottom: 1px solid #dfe2e8; }
.cn-cal-member {
  width: 8.4rem; flex-shrink: 0; display: flex; gap: 0.5em; align-items: center;
  padding: 0.55em 0.7em; border-right: 1px solid #eef0f4; font-size: 0.62rem; color: #99a;
}
.cn-cal-av {
  width: 1.9rem; height: 1.9rem; border-radius: 50%; color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700;
}
.cn-cal-member b { display: block; font-size: 0.72rem; color: #222; }
.cn-cal-member span { display: block; font-size: 0.54rem; color: #99a; }
.cn-cal-member a { display: block; font-size: 0.54rem; color: #3a4cc0; cursor: pointer; }
.cn-cal-dayhead {
  flex: 1; text-align: center; font-size: 0.64rem; font-weight: 700; color: #445; padding: 0.5em 0.2em;
  border-right: 1px solid #f2f3f6;
}
.cn-cal-dayhead.red { color: #e03131; }
.cn-cal-dayhead.today { background: #eef2ff; color: #3a4cc0; }
.cn-cal-dayhead em { display: block; font-style: normal; font-size: 0.5rem; color: #e03131; font-weight: 400; }
.cn-cal-cell { flex: 1; min-width: 0; border-right: 1px solid #f2f3f6; padding: 0.3em 0.25em; display: flex; flex-direction: column; gap: 0.25em; }
.cn-cal-cell.today { background: #f6f8ff; }
.cn-ev {
  text-align: left; background: #eef2ff; border: none; border-left: 3px solid #5a6cf0;
  border-radius: 4px; font-family: inherit; font-size: 0.55rem; color: #334;
  padding: 0.3em 0.4em; cursor: pointer; line-height: 1.35;
}
.cn-ev b { display: block; font-size: 0.52rem; color: #556; font-weight: 700; }
.cn-ev.mine { background: #e6f6ec; border-left-color: #03a04c; }
.cn-ev.gray { background: #f2f3f6; border-left-color: #c3c8d2; color: #778; cursor: default; }
.cn-ev.all { background: #fdf1e2; border-left-color: #e8912d; }
.cn-ev.cancel { text-decoration: line-through; opacity: 0.6; }
.cn-cal-row.gone { opacity: 0.45; background: #fafbfc; }
.cn-gone-note { font-size: 0.54rem; color: #aab; align-self: center; margin: auto; }
.cn-ev-pop {
  position: absolute; z-index: 5; width: 15rem; background: #fff; border: 1px solid #dfe2e8;
  border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 30, 60, 0.18); padding: 0.7em 0.9em;
  font-size: 0.64rem; color: #445;
}
.cn-ev-pop b { display: block; font-size: 0.74rem; color: #111; margin-bottom: 0.4em; padding-right: 1.2em; }
.cn-ev-pop div { padding: 0.12em 0; }
.cn-ev-pop em { display: block; color: #e03131; font-style: normal; margin-top: 0.3em; }
.cn-ev-pop-x { position: absolute; top: 0.55em; right: 0.7em; color: #99a; cursor: pointer; font-size: 0.66rem; }

/* ── Slack (dark desktop mock) ── */
.os-slack { background: #1a1d21; color: #d1d2d3; font-size: 0.74rem; }
.sl-topbar {
  display: flex; align-items: center; gap: 0.8em; padding: 0.32em 0.9em;
  background: #121016; flex-shrink: 0;
}
.sl-nav-arrows { color: #9a9ba0; font-size: 0.7rem; letter-spacing: 0.25em; }
.sl-searchbar {
  flex: 1; max-width: 34rem; margin: 0 auto; background: #3b3d42; border-radius: 6px;
  color: #b8b9bd; font-size: 0.62rem; padding: 0.28em 0.9em; text-align: center;
}
.sl-help { color: #9a9ba0; border: 1px solid #55565c; border-radius: 50%; width: 1.1rem; height: 1.1rem; display: flex; align-items: center; justify-content: center; font-size: 0.55rem; }
.sl-cols { flex: 1; min-height: 0; display: flex; }
.sl-rail {
  width: 3.2rem; background: #121016; display: flex; flex-direction: column; align-items: center;
  padding: 0.5em 0 0.7em; gap: 0.6em; flex-shrink: 0;
}
.sl-ws-icon {
  width: 2rem; height: 2rem; border-radius: 8px; background: #2bac76; color: #fff;
  font-weight: 900; display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
  margin-bottom: 0.25em; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}
.sl-rail-item { display: flex; flex-direction: column; align-items: center; gap: 0.12em; color: #b8b9bd; cursor: pointer; }
.sl-rail-item i { font-style: normal; font-size: 0.8rem; padding: 0.22em 0.5em; border-radius: 8px; }
.sl-rail-item.on i { background: rgba(255,255,255,0.2); }
.sl-rail-item span { font-size: 0.44rem; }
.sl-rail-spacer { flex: 1; }
.sl-rail-plus {
  width: 1.7rem; height: 1.7rem; border-radius: 50%; background: rgba(255,255,255,0.1);
  color: #d1d2d3; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.sl-rail-me {
  position: relative; width: 1.7rem; height: 1.7rem; border-radius: 8px; background: #3e7ab0;
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.72rem;
}
.sl-rail-me i { position: absolute; right: -2px; bottom: -2px; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #2bac76; border: 2px solid #121016; }
.sl-side {
  width: 13rem; background: #1a1d21; color: #b8b9bd; flex-shrink: 0;
  display: flex; flex-direction: column; overflow-y: auto; padding-bottom: 0.8em;
  border-right: 1px solid #2c2d31;
}
.sl-ws-head {
  display: flex; align-items: center; gap: 0.3em; padding: 0.65em 0.9em; font-size: 0.85rem; color: #fff;
  position: sticky; top: 0; background: #1a1d21; z-index: 2;
}
.sl-caret { font-size: 0.6rem; color: #b8b9bd; }
.sl-compose {
  margin-left: auto; width: 1.55rem; height: 1.55rem; background: #fff; color: #1a1d21;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.66rem; cursor: pointer;
}
.sl-find {
  margin: 0 0.7em 0.5em; background: #26282c; border: 1px solid #35373c; border-radius: 8px;
  padding: 0.4em 0.7em; font-size: 0.64rem; color: #8f9096; cursor: text;
}
.sl-nav { padding: 0.15em 0 0.45em; border-bottom: 1px solid #2c2d31; }
.sl-nav-item { display: flex; align-items: center; gap: 0.45em; padding: 0.26em 0.9em; font-size: 0.7rem; cursor: pointer; border-radius: 6px; }
.sl-nav-item:hover { background: #26282c; }
.sl-badge {
  margin-left: auto; background: #cd2553; color: #fff; font-style: normal; font-size: 0.54rem;
  border-radius: 999px; padding: 0.05em 0.5em; font-weight: 700;
}
.sl-dim { margin-left: auto; font-style: normal; font-size: 0.58rem; color: #8f9096; }
.sl-section { padding: 0.75em 0.9em 0.3em; font-size: 0.66rem; color: #9a9ba0; }
.sl-section i { font-style: normal; font-size: 0.5rem; margin-right: 0.2em; }
.sl-ch {
  display: flex; align-items: center; gap: 0.5em; width: calc(100% - 0.8em); margin: 0 0.4em;
  text-align: left; background: none; border: none; color: #b8b9bd;
  font-family: inherit; font-size: 0.73rem; padding: 0.24em 0.55em; cursor: pointer; border-radius: 6px;
}
.sl-ch:hover { background: #26282c; }
.sl-ch.on { background: #1164a3; color: #fff; }
.sl-hash { opacity: 0.7; font-size: 0.66rem; }
.sl-dm-av {
  position: relative; width: 1.15rem; height: 1.15rem; border-radius: 5px; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.55rem; flex-shrink: 0;
}
.sl-dm-av i { position: absolute; right: -3px; bottom: -3px; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #6a6b70; border: 2px solid #1a1d21; box-sizing: content-box; }
.sl-dm-av i.on { background: #2bac76; }
.sl-add { padding: 0.3em 1.35em; font-size: 0.68rem; color: #8f9096; cursor: pointer; }
.sl-add span { background: #26282c; border-radius: 4px; padding: 0 0.3em; margin-right: 0.25em; }
.sl-moreunread {
  margin: 0.8em auto 0; background: #cd2553; color: #fff; border-radius: 999px;
  font-size: 0.6rem; font-weight: 700; padding: 0.3em 1em; cursor: pointer; width: fit-content;
}
.sl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #1a1d21; }
.sl-head {
  display: flex; align-items: center; padding: 0.5em 1em 0.25em; flex-shrink: 0; gap: 0.8em;
}
.sl-head-l { display: flex; align-items: center; gap: 0.5em; min-width: 0; color: #fff; }
.sl-head-l b { font-size: 0.88rem; white-space: nowrap; }
.sl-star { color: #e8b93c; }
.sl-head-r { margin-left: auto; display: flex; gap: 0.7em; align-items: center; color: #b8b9bd; font-size: 0.72rem; }
.sl-avstack { display: flex; align-items: center; border: 1px solid #35373c; border-radius: 6px; padding: 0.12em 0.45em; gap: 0; }
.sl-avstack i {
  width: 1.05rem; height: 1.05rem; border-radius: 4px; color: #fff; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.5rem;
  margin-left: -0.3rem; border: 1.5px solid #1a1d21;
}
.sl-avstack i:first-child { margin-left: 0; }
.sl-avstack em { font-style: normal; font-size: 0.62rem; margin-left: 0.35em; }
.sl-huddle { border: 1px solid #35373c; border-radius: 6px; padding: 0.12em 0.5em; cursor: pointer; }
.sl-tabs {
  display: flex; gap: 1em; padding: 0.15em 1em 0; border-bottom: 1px solid #2c2d31;
  font-size: 0.64rem; color: #9a9ba0; flex-shrink: 0;
}
.sl-tabs span { padding: 0.35em 0.1em 0.45em; cursor: pointer; }
.sl-tabs span.on { color: #fff; border-bottom: 2px solid #d1d2d3; font-weight: 700; }
.sl-tab-plus { color: #8f9096; }
.sl-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 0.6em 0 0.4em; position: relative; }
.sl-divider { display: flex; align-items: center; margin: 0.7em 0 0.4em; }
.sl-divider::before, .sl-divider::after { content: ''; flex: 1; height: 1px; background: #2c2d31; }
.sl-divider span {
  border: 1px solid #35373c; border-radius: 999px; font-size: 0.6rem; font-weight: 700;
  padding: 0.2em 0.8em; color: #d1d2d3; background: #1a1d21;
}
.sl-newmsgs { display: flex; align-items: center; margin: 0.8em 0 0.2em; }
.sl-newmsgs::before, .sl-newmsgs::after { content: ''; flex: 1; height: 1px; background: #cd2553; }
.sl-newmsgs span {
  background: #cd2553; color: #fff; border-radius: 999px; font-size: 0.58rem; font-weight: 700;
  padding: 0.2em 0.9em;
}
.sl-latest { display: flex; justify-content: center; padding: 0.6em 0 0.2em; }
.sl-latest span {
  background: #26282c; border: 1px solid #35373c; color: #b8b9bd; border-radius: 999px;
  font-size: 0.6rem; padding: 0.25em 1em; cursor: pointer;
}
.sl-msg { display: flex; gap: 0.6em; padding: 0.32em 1em; }
.sl-msg:hover { background: #222529; }
.sl-avatar {
  width: 2rem; height: 2rem; border-radius: 6px; color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700;
}
.sl-body { min-width: 0; flex: 1; }
.sl-byline b { font-size: 0.76rem; color: #fff; }
.sl-byline em { font-size: 0.58rem; color: #8f9096; font-style: normal; margin-left: 0.5em; }
.sl-bot {
  font-style: normal; font-size: 0.5rem; background: #35373c; color: #b8b9bd;
  border-radius: 3px; padding: 0 0.3em; margin-left: 0.4em; vertical-align: 1px;
}
.sl-text { font-size: 0.76rem; line-height: 1.55; color: #d1d2d3; margin-top: 0.1em; }
.sl-mention { font-style: normal; color: #6fa8dc; background: rgba(29, 155, 209, 0.15); border-radius: 3px; padding: 0 0.15em; }
.sl-linkcard { display: flex; margin-top: 0.4em; max-width: 26rem; }
.sl-linkbar { width: 4px; border-radius: 4px; background: #4a5058; flex-shrink: 0; }
.sl-linkbody { padding: 0.2em 0 0.2em 0.7em; min-width: 0; }
.sl-linkbody b { display: block; color: #6fa8dc; font-size: 0.72rem; line-height: 1.4; cursor: pointer; }
.sl-linkbody b:hover { text-decoration: underline; }
.sl-linkbody span { display: block; font-size: 0.66rem; color: #b8b9bd; line-height: 1.5; margin-top: 0.2em; }
.sl-linkimg { margin-top: 0.45em; border-radius: 8px; overflow: hidden; max-width: 22rem; aspect-ratio: 16/9; background: #26282c; }
.sl-linkimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sl-reacts { display: flex; gap: 0.35em; margin-top: 0.35em; flex-wrap: wrap; }
.sl-reacts button {
  background: #26282c; border: 1px solid transparent; border-radius: 999px;
  font-family: inherit; font-size: 0.62rem; padding: 0.12em 0.55em; cursor: pointer; color: #d1d2d3;
}
.sl-reacts button b { color: #6fa8dc; font-size: 0.6rem; }
.sl-reacts button:hover { border-color: #6fa8dc; background: #1a1d21; }
.sl-reacts .sl-react-add { color: #8f9096; background: transparent; }
.sl-reacts .sl-react-add:hover { background: #26282c; border-color: transparent; }
.sl-thread {
  display: flex; align-items: center; gap: 0.5em; margin-top: 0.35em;
  background: none; border: 1px solid transparent; border-radius: 8px; padding: 0.25em 0.5em;
  font-family: inherit; cursor: pointer; max-width: 24rem; width: 100%;
}
.sl-thread:hover { border-color: #35373c; background: #1a1d21; }
.sl-thread-avs { display: flex; gap: 2px; }
.sl-thread-avs i {
  width: 1.1rem; height: 1.1rem; border-radius: 4px; color: #fff; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.5rem;
}
.sl-thread b { color: #6fa8dc; font-size: 0.64rem; }
.sl-thread em { color: #8f9096; font-size: 0.58rem; font-style: normal; }
.sl-composer {
  margin: 0.4em 1em 0.9em; border: 1px solid #4a4d52; border-radius: 10px; flex-shrink: 0;
  overflow: hidden; background: #222529;
}
.sl-tools {
  display: flex; gap: 0.9em; padding: 0.35em 0.8em; background: #1c1f23; color: #8f9096;
  font-size: 0.68rem; border-bottom: 1px solid #2c2d31;
}
.sl-tools s { text-decoration: line-through; }
.sl-input { padding: 0.55em 0.8em; font-size: 0.74rem; color: #8f9096; }
.sl-net { font-size: 0.6rem; color: #e06c5a; }
.sl-actions {
  display: flex; gap: 0.8em; padding: 0.3em 0.8em 0.45em; color: #8f9096; font-size: 0.72rem;
  align-items: center;
}
.sl-plus { background: #35373c; border-radius: 50%; width: 1.2rem; height: 1.2rem; display: inline-flex; align-items: center; justify-content: center; }
.sl-send {
  margin-left: auto; background: #2b2d31; color: #6a6b70; border-radius: 6px;
  padding: 0.15em 0.7em; font-size: 0.66rem;
}

/* ── ASI terminal popup (a Terminal window that opens by itself) ── */
.os-term-popup {
  position: absolute;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  width: min(42rem, 88vw);
  height: min(24rem, 60vh);
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  background: #0d120d;
  border: 1px solid rgba(120, 220, 140, 0.25);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75), 0 0 40px rgba(60, 220, 100, 0.08);
  z-index: 20;
  animation: termPopIn 0.28s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes termPopIn {
  from { opacity: 0; transform: translateX(-50%) scale(0.92) translateY(14px); }
  to { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
}
.os-term-pop-title {
  display: flex; align-items: center; gap: 0.8em;
  background: linear-gradient(#2c2f2c, #212421);
  padding: 0.35em 0.8em; flex-shrink: 0;
  font-family: 'Menlo', 'Courier New', monospace;
  font-size: 0.62rem; color: #9aa39a;
}
.os-term-pop-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 0.8em 1em;
  font-family: 'Menlo', 'Courier New', monospace;
  font-size: 0.76rem; line-height: 1.7;
  color: #4ade6a;
  text-shadow: 0 0 6px rgba(70, 220, 100, 0.25);
  cursor: pointer;
}
.os-term-pop-line { margin-bottom: 0.5em; white-space: pre-wrap; }
.os-term-pop-line.sys { color: rgba(150, 190, 160, 0.6); font-size: 0.66rem; }
.os-term-pop-line.me { color: rgba(220, 235, 255, 0.9); }
.os-term-pop-choices {
  flex-shrink: 0; display: flex; flex-direction: column; gap: 0.4em;
  padding: 0.5em 0.9em 0.8em;
}
.os-term-pop-choices:not(:empty) { border-top: 1px solid rgba(70, 220, 100, 0.15); }
.os-term-pop-choices button {
  text-align: left; background: rgba(70, 220, 100, 0.06);
  border: 1px solid rgba(70, 220, 100, 0.3); border-radius: 5px;
  color: rgba(210, 240, 220, 0.92);
  font-family: 'Menlo', 'Courier New', monospace; font-size: 0.7rem;
  padding: 0.45em 0.8em; cursor: pointer;
}
.os-term-pop-choices button:hover { background: rgba(70, 220, 100, 0.16); }

/* unfinished draft (contact1) */
.os-draft-line {
  border: 1px solid #d8dbe2; border-radius: 8px; background: #fff;
  padding: 0.55em 0.9em; font-size: 0.76rem; color: #333; line-height: 1.6;
}
.os-draft-caret {
  display: inline-block; width: 2px; height: 1em; background: #333;
  vertical-align: text-bottom; margin-left: 1px; animation: cursorBlink 0.9s step-start infinite;
}
.os-draft-hint { font-size: 0.62rem; color: #99a; margin-top: 0.6em; font-style: italic; }

.os-term-pop-dismiss {
  margin-top: 0.8em;
  text-align: center;
  color: rgba(150, 230, 170, 0.8) !important;
  animation: promptPulse 1.6s ease-in-out infinite;
  cursor: pointer;
}

/* click-to-close hint at the end of a terminal conversation (ending) */
.terminal-line.term-dismiss {
  margin-top: 0.8em;
  text-align: center;
  color: rgba(150, 230, 170, 0.8);
  animation: promptPulse 1.6s ease-in-out infinite;
  cursor: pointer;
}

/* game-entry click catcher renders above the pre-shown title card */
#click-to-play { z-index: 150; }


/* ── Laptop-OS apps on phones (must stay after the base sl-/cn- rules) ── */
@media (max-width: 768px) and (orientation: portrait) {
  .sl-rail { display: none; }
  /* Slack: sidebar-first; picking a channel swaps to a full-width chat */
  .sl-side { width: 100%; flex: 1; }
  .os-slack .sl-main { display: none; }
  .os-slack.sl-mobile-chat .sl-side { display: none; }
  .os-slack.sl-mobile-chat .sl-main { display: flex; flex: 1; min-width: 0; }
  .sl-back { display: inline-block; font-size: 1.5rem; line-height: 1; padding: 0 0.35em 0 0.1em; cursor: pointer; }
  .sl-tabs span:nth-child(n+4) { display: none; }
  .sl-head-r .sl-huddle, .sl-head-r span:nth-last-child(-n+2) { display: none; }
  /* Revan mail/calendar: folders hidden, content full width */
  .cn-side { display: none; }
  .cn-main { width: 100%; }
  .cn-tools { overflow-x: auto; white-space: nowrap; }
  .cn-search { display: none; }
  .cn-cal-grid { overflow-x: auto; }
  .cn-cal-head { flex-wrap: wrap; gap: 0.4em; }
  .cn-row .cn-to { display: none; }
  .os-report { padding: 0.8em 0.9em 1.2em; }
}
