:root {
  color-scheme: dark;
  --bg: #050607;
  --panel: #080909;
  --panel-2: #07080a;
  --line: #2b5d48;
  --line-dim: #173326;
  --text: #f2fff9;
  --muted: #8bb29b;
  --green: #45ff78;
  --amber: #c99a45;
  --cyan: #90a9b0;
  --magenta: #b08ca4;
  --red: #e25b5b;
  --blue: #6d86c9;
  --shadow: rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.028) 0 1px, transparent 1px 18px),
    radial-gradient(circle at 50% 0%, rgba(69, 255, 120, 0.14), transparent 36rem),
    radial-gradient(circle at 85% 100%, rgba(109, 134, 201, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: "SFMono-Regular", "Cascadia Mono", "Liberation Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.45;
  overflow: auto;
}

* {
  scrollbar-color: var(--green) #020706;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

*::-webkit-scrollbar-track {
  background: #020706;
  border: 1px solid var(--line-dim);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--green), var(--cyan));
  border: 3px solid #020706;
}

*::-webkit-scrollbar-corner {
  background: #020706;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 45%),
    #070b0c;
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow:
    inset 1px 1px 0 rgba(211, 252, 230, 0.16),
    inset -1px -1px 0 rgba(0, 0, 0, 0.8);
  cursor: pointer;
  min-height: 36px;
  text-transform: uppercase;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

button:hover,
button:focus-visible {
  border-color: var(--green);
  color: #ffffff;
  background:
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.07) 0 4px, transparent 4px 8px),
    #111819;
  outline: none;
}

button:disabled,
button[aria-disabled="true"] {
  color: rgba(139, 178, 155, 0.48);
  border-color: rgba(43, 93, 72, 0.42);
  background:
    repeating-linear-gradient(90deg, rgba(139, 178, 155, 0.035) 0 6px, transparent 6px 12px),
    #050707;
  box-shadow: inset 1px 1px 0 rgba(211, 252, 230, 0.05);
  cursor: not-allowed;
}

button:disabled:hover,
button:disabled:focus-visible,
button[aria-disabled="true"]:hover,
button[aria-disabled="true"]:focus-visible {
  color: rgba(139, 178, 155, 0.48);
  border-color: rgba(43, 93, 72, 0.42);
  background:
    repeating-linear-gradient(90deg, rgba(139, 178, 155, 0.035) 0 6px, transparent 6px 12px),
    #050707;
}

.nav-panel button.active,
.nav-panel button[aria-current="page"] {
  border-color: var(--green);
  color: #ffffff;
  background:
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.12) 0 8px, transparent 8px 16px),
    #0b1410;
  box-shadow:
    inset 1px 1px 0 rgba(242, 255, 249, 0.18),
    inset -1px -1px 0 rgba(0, 0, 0, 0.82),
    0 0 0 1px rgba(69, 255, 120, 0.14);
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    repeating-linear-gradient(135deg, #050505 0 8px, #08090a 8px 16px),
    #030505;
}

.boot-overlay.hidden {
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 700ms ease;
}

.boot-card {
  width: min(960px, 100%);
  border: 1px solid var(--line);
  box-shadow:
    0 24px 80px var(--shadow),
    inset 2px 2px 0 rgba(211, 252, 230, 0.1),
    inset -2px -2px 0 rgba(0, 0, 0, 0.86);
  padding: clamp(18px, 4vw, 34px);
  background:
    linear-gradient(90deg, rgba(69, 255, 120, 0.09), transparent 36%, rgba(109, 134, 201, 0.06) 78%, transparent),
    linear-gradient(180deg, #090b0b, #030404);
}

.boot-logo {
  color: #ffffff;
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(5px, 1.35vw, 14px);
  line-height: 1.03;
  margin: 0 auto 22px;
  text-shadow:
    0 0 10px rgba(69, 255, 120, 0.28),
    0 0 1px rgba(255, 255, 255, 0.55);
  white-space: pre;
}

.boot-kicker {
  color: var(--amber);
  margin: 0 0 18px;
  overflow-wrap: anywhere;
}

.boot-note {
  color: var(--muted);
  margin: 16px 0 0;
  font-size: 13px;
}

.boot-log {
  min-height: 156px;
  margin: 0 0 18px;
  padding: 12px;
  overflow: hidden;
  color: var(--cyan);
  background: #020706;
  border: 1px solid var(--line-dim);
  white-space: pre-wrap;
}

.connect-button {
  width: 100%;
  color: #03100a;
  background: var(--green);
  border-color: var(--green);
  font-weight: 800;
}

.connect-button:hover,
.connect-button:focus-visible {
  color: #001006;
  background: #9effbd;
}

.app-shell {
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  height: 100dvh;
  min-height: 0;
  gap: 4px;
  padding: 8px;
  opacity: 0;
  overflow: hidden;
}

.app-shell.ready {
  opacity: 1;
}

.topbar,
.footer-line,
.command-bar,
.softkeys,
.nav-panel,
.console-panel,
.side-panel {
  border: 1px solid var(--line);
  background: rgba(5, 12, 11, 0.94);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(69, 255, 120, 0.05),
    inset 1px 1px 0 rgba(211, 252, 230, 0.08),
    inset -1px -1px 0 rgba(0, 0, 0, 0.78);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  min-height: 0;
  position: relative;
}

.brand-block {
  display: flex;
  align-items: baseline;
  min-width: 0;
}

.brand {
  color: var(--green);
  display: inline-block;
  font-family: "SFMono-Regular", "Cascadia Mono", "Liberation Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    1px 0 0 rgba(211, 252, 230, 0.28),
    0 0 8px rgba(69, 255, 120, 0.38),
    0 0 1px rgba(211, 252, 230, 0.7);
  text-decoration: none;
}

.brand:hover,
.brand:focus-visible {
  color: #ffffff;
  outline: none;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  color: var(--cyan);
  font-size: 12px;
}

.status-strip span,
.tiny-button {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid var(--line-dim);
  background: #081111;
  box-shadow: inset 1px 1px 0 rgba(85, 217, 255, 0.1);
}

.tiny-button {
  font-size: 12px;
}

.save-file-button {
  color: var(--amber);
  cursor: pointer;
}

.save-file-button:hover,
.save-file-button:focus-visible {
  color: var(--text);
  border-color: var(--green);
  outline: none;
}

.line-monitor-trigger {
  white-space: nowrap;
}

.line-monitor-trigger[aria-expanded="true"] {
  border-color: var(--green);
  color: #ffffff;
  background:
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.11) 0 6px, transparent 6px 12px),
    #0a1411;
}

.line-monitor {
  position: absolute;
  top: calc(100% + 8px);
  right: 10px;
  z-index: 20;
  width: min(760px, calc(100vw - 24px));
  max-height: min(70dvh, 560px);
  color: var(--text);
  border: 1px solid var(--green);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, rgba(69, 255, 120, 0.1), rgba(4, 8, 7, 0.98) 44%, #030404),
    #030706;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(69, 255, 120, 0.14),
    inset 1px 1px 0 rgba(242, 255, 249, 0.1),
    inset -1px -1px 0 rgba(0, 0, 0, 0.86);
}

.line-monitor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  color: var(--amber);
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.08) 0 8px, transparent 8px 16px),
    rgba(2, 7, 6, 0.96);
  font-size: 13px;
  text-transform: uppercase;
}

.line-monitor-head button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.line-monitor-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1.45fr);
  gap: 8px;
  padding: 10px;
  min-height: 0;
}

.line-monitor-list,
.line-spy-detail {
  min-height: 240px;
  max-height: min(52dvh, 430px);
  overflow: auto;
  border: 1px solid var(--line-dim);
  background: rgba(0, 6, 5, 0.86);
}

.line-monitor-list {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 6px;
}

.line-monitor-list button {
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 7px 8px;
  overflow: hidden;
  text-align: left;
  line-height: 1.25;
}

.line-monitor-list button.active {
  border-color: var(--green);
  color: #ffffff;
  background:
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.12) 0 8px, transparent 8px 16px),
    #0b1410;
}

.line-monitor-list .line-row-main {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #ffffff;
}

.line-monitor-list .line-row-main span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-monitor-list .line-row-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-spy-detail {
  margin: 0;
  padding: 10px;
  color: var(--green);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-shadow:
    0 0 8px rgba(69, 255, 120, 0.22),
    0 0 1px rgba(255, 255, 255, 0.18);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(150px, 0.56fr) minmax(420px, 2.25fr) minmax(230px, 0.82fr);
  min-height: 0;
  overflow: hidden;
  gap: 10px;
}

.workspace.chat-workspace {
  grid-template-columns: minmax(150px, 0.42fr) minmax(420px, 2.9fr);
}

.workspace.script-workspace-shell {
  grid-template-columns: minmax(150px, 0.42fr) minmax(420px, 2.9fr);
}

.workspace.subject-workspace {
  grid-template-columns: minmax(150px, 0.42fr) minmax(420px, 2.9fr);
}

.nav-panel {
  display: grid;
  grid-auto-rows: minmax(44px, auto);
  align-content: start;
  gap: 8px;
  padding: 10px;
  min-height: 0;
  overflow: auto;
}

.nav-panel button {
  width: 100%;
  text-align: left;
  padding: 9px 10px;
}

.nav-panel span {
  color: var(--amber);
  margin-right: 6px;
}

.console-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(260px, 1.1fr) auto auto minmax(160px, 0.75fr);
  position: relative;
}

.console-panel.chat-console {
  grid-template-rows: auto minmax(420px, 1fr);
}

.console-panel.script-console {
  grid-template-rows: auto minmax(0, 1fr);
}

.console-panel.games-console {
  grid-template-rows: auto minmax(0, 1fr);
}

.console-panel.subject-console {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.viewport-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  color: #ffffff;
  border-bottom: 1px solid var(--line-dim);
  background:
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.08) 0 8px, transparent 8px 16px),
    #050809;
  font-size: 13px;
  text-transform: uppercase;
}

.viewport-stack {
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.ansi-viewport {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: #f6fff8;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.025) 0 1px, transparent 1px 11px),
    #020303;
  text-shadow:
    0 0 8px rgba(69, 255, 120, 0.18),
    0 0 1px rgba(255, 255, 255, 0.2);
  white-space: pre;
  tab-size: 2;
}

.live-chat-pane {
  display: none;
  margin: 0;
  color: var(--green);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, rgba(69, 255, 120, 0.08), rgba(2, 4, 3, 0.96) 45%),
    #020403;
  border: 1px solid var(--line);
  box-shadow:
    -18px 0 42px rgba(0, 0, 0, 0.58),
    inset 1px 1px 0 rgba(242, 255, 249, 0.08),
    inset -1px -1px 0 rgba(0, 0, 0, 0.82);
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}

.console-panel.live-chat-dock .live-chat-pane {
  display: block;
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: min(760px, 52%);
  padding: 12px;
  font-size: 13px;
  line-height: 1.45;
  z-index: 2;
}

.ansi-viewport.chat-transcript {
  padding: 14px 16px;
  color: #d3fce6;
  line-height: 1.5;
  white-space: pre-wrap;
}

.ansi-viewport.open-screen {
  white-space: pre;
  overflow-wrap: normal;
  line-height: 1.42;
}

.ansi-viewport.weather-screen {
  white-space: normal;
  overflow-wrap: normal;
  color: var(--text);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.025) 0 1px, transparent 1px 11px),
    #010403;
}

.weather-wrap {
  display: grid;
  gap: 10px;
  min-width: 720px;
}

.weather-wire-head,
.weather-ledger-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  color: var(--amber);
  border: 1px solid var(--line-dim);
  background:
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.06) 0 9px, transparent 9px 18px),
    #06100d;
}

.weather-grid-area {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(260px, 0.65fr);
  gap: 10px;
}

.weather-map-card,
.weather-detail,
.weather-ledger {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(3, 9, 7, 0.94);
  box-shadow:
    inset 1px 1px 0 rgba(211, 252, 230, 0.08),
    inset -1px -1px 0 rgba(0, 0, 0, 0.8);
}

.weather-map-title {
  padding: 8px 10px;
  color: var(--green);
  border-bottom: 1px solid var(--line-dim);
}

.weather-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(34px, 1fr));
  grid-template-rows: repeat(8, 34px);
  gap: 5px;
  min-height: 318px;
  padding: 14px;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(72, 255, 135, 0.08), transparent 38%),
    repeating-linear-gradient(0deg, rgba(72, 255, 135, 0.035) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(90deg, rgba(72, 255, 135, 0.035) 0 1px, transparent 1px 12px),
    #020706;
}

.weather-sweep {
  position: absolute;
  inset: -40% 44% -40% auto;
  width: 18%;
  background: linear-gradient(90deg, transparent, rgba(72, 255, 135, 0.14), transparent);
  animation: weatherSweep 6s linear infinite;
  pointer-events: none;
}

@keyframes weatherSweep {
  from {
    transform: translateX(-520%);
  }
  to {
    transform: translateX(620%);
  }
}

.weather-state {
  grid-column: var(--x);
  grid-row: var(--y);
  min-width: 0;
  min-height: 0;
  padding: 0;
  color: var(--text);
  background: #07110f;
  border: 1px solid var(--line-dim);
  border-radius: 2px;
  font-size: 12px;
  line-height: 1;
  text-align: center;
  box-shadow: inset 0 0 14px rgba(72, 255, 135, 0.08);
  cursor: pointer;
}

.weather-state:hover,
.weather-state.active,
.weather-ledger-row:hover,
.weather-ledger-row.active {
  color: #020706;
  background: var(--green);
  border-color: var(--green);
  text-shadow: none;
}

.wx-snow {
  color: #d3fce6;
}

.wx-rain {
  color: #73a9ff;
}

.wx-storm {
  color: #ffca62;
}

.wx-fog {
  color: #91afa1;
}

.wx-clear {
  color: #f6fff8;
}

.wx-cloud {
  color: #8bb29b;
}

.weather-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  color: var(--muted);
  border-top: 1px solid var(--line-dim);
}

.weather-radar {
  border-top: 1px solid var(--line-dim);
  background:
    radial-gradient(circle at 50% 50%, rgba(72, 255, 135, 0.09), transparent 62%),
    #010403;
}

.weather-radar-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  color: var(--amber);
  border-bottom: 1px solid rgba(36, 80, 86, 0.72);
  font-size: 11px;
}

.weather-radar pre {
  margin: 0;
  padding: 10px;
  overflow: auto;
  color: #d3fce6;
  font: inherit;
  font-size: 12px;
  line-height: 1.15;
  white-space: pre;
  text-shadow: 0 0 8px rgba(72, 255, 135, 0.45);
}

.weather-detail {
  position: relative;
  padding: 14px;
  overflow: hidden;
}

.weather-detail::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background:
    radial-gradient(circle at 20% 20%, currentColor, transparent 34%),
    repeating-linear-gradient(0deg, currentColor 0 1px, transparent 1px 9px);
  pointer-events: none;
}

.weather-detail-code {
  color: var(--amber);
  font-size: 32px;
  line-height: 1;
}

.weather-detail h2 {
  margin: 4px 0 0;
  color: #ffffff;
  font-size: 19px;
  line-height: 1.15;
}

.weather-condition {
  margin: 8px 0 12px;
  color: var(--green);
}

.weather-detail dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 12px;
}

.weather-detail dl div,
.weather-forecast {
  padding: 8px;
  border: 1px solid var(--line-dim);
  background: rgba(1, 4, 3, 0.72);
}

.weather-detail dt,
.weather-forecast span {
  color: var(--amber);
  font-size: 10px;
}

.weather-detail dd {
  margin: 2px 0 0;
  color: var(--text);
}

.weather-forecast + .weather-forecast {
  margin-top: 8px;
}

.weather-forecast p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.weather-outlook {
  display: grid;
  gap: 6px;
}

.weather-outlook-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.32;
}

.weather-outlook-row span:first-child {
  color: var(--green);
}

.weather-ledger {
  overflow: hidden;
}

.weather-ledger-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 280px;
  overflow: auto;
}

.weather-ledger-row {
  display: grid;
  grid-template-columns: 34px minmax(96px, 1fr) 48px minmax(110px, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 6px 8px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(36, 80, 86, 0.72);
  border-radius: 0;
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.weather-ledger-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ansi-viewport.news-screen {
  white-space: normal;
  overflow-wrap: normal;
  color: var(--text);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.025) 0 1px, transparent 1px 11px),
    linear-gradient(120deg, rgba(201, 154, 69, 0.08), transparent 46%),
    #010403;
}

.news-wrap {
  display: grid;
  gap: 10px;
  min-width: 720px;
}

.news-wire-head,
.news-panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 8px 10px;
  color: var(--amber);
  border: 1px solid var(--line-dim);
  background:
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.055) 0 9px, transparent 9px 18px),
    #06100d;
}

.news-wire-head span,
.news-panel-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-ticker {
  min-width: 0;
  padding: 8px 10px;
  overflow: hidden;
  color: #f6fff8;
  border: 1px solid var(--line-dim);
  background: #020706;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-ticker span {
  display: inline-block;
  min-width: max-content;
  padding-left: 100%;
  animation: newsTickerScroll 62s linear infinite;
}

@keyframes newsTickerScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

.news-grid-area {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(420px, 1.28fr);
  gap: 10px;
  min-width: 0;
}

.news-list-card,
.news-detail,
.news-map-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(3, 9, 7, 0.94);
  box-shadow:
    inset 1px 1px 0 rgba(211, 252, 230, 0.08),
    inset -1px -1px 0 rgba(0, 0, 0, 0.8);
}

.news-story-list {
  display: grid;
  max-height: 430px;
  overflow: auto;
}

.news-story-button {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: stretch;
  gap: 9px;
  min-width: 0;
  padding: 8px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(36, 80, 86, 0.72);
  border-radius: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.news-story-thumb {
  position: relative;
  display: block;
  min-height: 58px;
  overflow: hidden;
  border: 1px solid rgba(72, 255, 135, 0.42);
  background:
    linear-gradient(180deg, rgba(72, 255, 135, 0.1), rgba(201, 154, 69, 0.05)),
    #020706;
}

.news-story-thumb::after,
.news-wirephoto::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    repeating-linear-gradient(0deg, rgba(246, 255, 248, 0.11) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0 2px, transparent 2px 6px);
  mix-blend-mode: screen;
}

.news-story-thumb img {
  width: 100%;
  height: 100%;
  min-height: 58px;
  object-fit: cover;
  filter: grayscale(1) contrast(1.55) sepia(0.24) hue-rotate(65deg) saturate(1.35);
  image-rendering: pixelated;
}

.news-story-copy {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
}

.news-story-button:hover,
.news-story-button.active {
  color: #020706;
  background: var(--green);
  text-shadow: none;
}

.news-story-kicker,
.news-story-place {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.news-story-button:hover .news-story-kicker,
.news-story-button:hover .news-story-place,
.news-story-button.active .news-story-kicker,
.news-story-button.active .news-story-place {
  color: #020706;
}

.news-story-title {
  color: #f6fff8;
  line-height: 1.24;
}

.news-story-button:hover .news-story-title,
.news-story-button.active .news-story-title {
  color: #020706;
}

.news-story-button:hover .news-story-thumb,
.news-story-button.active .news-story-thumb {
  border-color: #020706;
  background: #081111;
}

.news-story-button:hover .news-story-thumb img,
.news-story-button.active .news-story-thumb img {
  filter: grayscale(1) contrast(1.75) sepia(0.2) hue-rotate(24deg) saturate(1.15);
}

.news-detail {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 8%, rgba(201, 154, 69, 0.16), transparent 32%),
    rgba(3, 9, 7, 0.94);
}

.news-detail-top,
.news-related {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--amber);
  font-size: 12px;
}

.news-detail h2 {
  margin: 0;
  color: #ffffff;
  font-size: 22px;
  line-height: 1.15;
}

.news-place {
  margin: 0;
  color: var(--green);
}

.news-wirephoto {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(72, 255, 135, 0.55);
  background:
    repeating-linear-gradient(90deg, rgba(72, 255, 135, 0.055) 0 8px, transparent 8px 16px),
    #020706;
  box-shadow:
    inset 0 0 0 1px rgba(211, 252, 230, 0.07),
    0 0 22px rgba(72, 255, 135, 0.08);
}

.news-wirephoto a {
  display: block;
  min-height: 180px;
}

.news-wirephoto img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: grayscale(1) contrast(1.65) sepia(0.32) hue-rotate(70deg) saturate(1.45) brightness(0.92);
  image-rendering: pixelated;
}

.news-wirephoto figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  color: var(--muted);
  border-top: 1px solid rgba(36, 80, 86, 0.72);
  background: rgba(1, 4, 3, 0.92);
  font-size: 11px;
  line-height: 1.25;
}

.news-wirephoto figcaption span:first-child {
  color: var(--amber);
}

.news-art-plate {
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: var(--green);
  border: 1px solid rgba(201, 154, 69, 0.58);
  background:
    repeating-linear-gradient(0deg, rgba(72, 255, 135, 0.035) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 20% 20%, rgba(201, 154, 69, 0.12), transparent 36%),
    #010403;
  font: inherit;
  font-size: 12px;
  line-height: 1.12;
  white-space: pre;
  text-shadow: 0 0 8px rgba(72, 255, 135, 0.16);
}

.news-summary {
  margin: 0;
  color: var(--text);
  line-height: 1.4;
}

.news-detail ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.42;
}

.news-related {
  justify-content: flex-start;
  padding-top: 8px;
  border-top: 1px solid var(--line-dim);
}

.news-related button {
  min-height: 28px;
  padding: 4px 8px;
  color: var(--green);
  background: #081111;
}

.news-wire-map {
  margin: 0;
  padding: 10px;
  overflow: auto;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 1.38;
  white-space: pre;
}

.ansi-viewport.images-screen,
.ansi-viewport.weather-screen,
.script-lab {
  animation: signalWarp 8.5s steps(2, end) infinite;
}

.script-lab {
  position: relative;
}

.script-lab::after,
.ansi-viewport.images-screen::after,
.ansi-viewport.weather-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(180deg, transparent 0 46%, rgba(242, 255, 249, 0.1) 47%, transparent 48% 100%),
    repeating-linear-gradient(0deg, rgba(69, 255, 120, 0.04) 0 1px, transparent 1px 5px);
  animation: signalShear 11s steps(1, end) infinite;
}

.ansi-viewport.images-screen,
.ansi-viewport.weather-screen {
  position: relative;
}

.ansi-viewport.images-screen {
  white-space: normal;
  overflow-wrap: normal;
}

.ansi-viewport.help-screen {
  color: var(--text);
  white-space: normal;
  overflow-wrap: normal;
}

.help-room {
  display: grid;
  gap: 10px;
  min-width: 700px;
  line-height: 1.36;
}

.help-frame,
.help-card,
.help-room details,
.help-foot {
  display: block;
  padding: 10px;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.045) 0 10px, transparent 10px 20px),
    #06100d;
  box-shadow:
    inset 1px 1px 0 rgba(211, 252, 230, 0.08),
    inset -1px -1px 0 rgba(0, 0, 0, 0.8);
}

.help-title,
.help-subtitle,
.help-card-title,
.help-copy,
.help-lines,
.help-foot {
  display: block;
}

.help-title {
  color: var(--green);
  font-size: 18px;
}

.help-subtitle,
.help-copy,
.help-lines {
  color: var(--muted);
}

.help-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 10px;
}

.help-card-title,
.help-room summary {
  color: var(--amber);
}

.help-room summary {
  cursor: pointer;
}

.help-route-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--muted);
}

.help-route-table td {
  padding: 3px 6px;
  border-bottom: 1px dotted rgba(36, 80, 86, 0.8);
  vertical-align: top;
}

.help-route-table td:first-child {
  width: 42px;
  color: var(--green);
}

.help-route-table td:nth-child(2) {
  width: 84px;
  color: #ffffff;
}

.help-code {
  margin: 8px 0 0;
  padding: 10px;
  overflow: auto;
  color: var(--green);
  border: 1px solid var(--line-dim);
  background: #020403;
  white-space: pre;
}

@keyframes signalWarp {
  0%,
  88%,
  100% {
    filter: none;
    text-shadow:
      0 0 8px rgba(69, 255, 120, 0.18),
      0 0 1px rgba(255, 255, 255, 0.2);
  }
  89% {
    filter: contrast(1.12) brightness(1.05);
    text-shadow:
      1px 0 0 rgba(201, 154, 69, 0.22),
      -1px 0 0 rgba(69, 255, 120, 0.28),
      0 0 10px rgba(69, 255, 120, 0.24);
  }
  91% {
    filter: none;
  }
}

@keyframes signalShear {
  0%,
  86%,
  100% {
    opacity: 0;
    transform: translateY(0);
  }
  87% {
    opacity: 0.42;
    transform: translateY(-2px);
  }
  88% {
    opacity: 0.12;
    transform: translateY(3px);
  }
}

@media (max-width: 1100px) {
  .console-panel.live-chat-dock .live-chat-pane {
    display: block;
    left: 10px;
    right: 10px;
    top: 44%;
    bottom: 10px;
    width: auto;
    font-size: 12px;
  }
}

.ansi-cyan {
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(144, 169, 176, 0.28);
}

.ansi-magenta {
  color: var(--magenta);
  text-shadow: 0 0 10px rgba(176, 140, 164, 0.24);
}

.ansi-amber {
  color: var(--amber);
  text-shadow: 0 0 10px rgba(201, 154, 69, 0.28);
}

.ansi-green {
  color: var(--green);
  text-shadow: 0 0 10px rgba(72, 255, 135, 0.35);
}

.ansi-red {
  color: var(--red);
  text-shadow: 0 0 10px rgba(255, 77, 109, 0.35);
}

.ansi-blue {
  color: var(--blue);
  text-shadow: 0 0 10px rgba(115, 169, 255, 0.34);
}

.ansi-white {
  color: #ffffff;
  text-shadow:
    0 0 10px rgba(69, 255, 120, 0.14),
    0 0 1px rgba(255, 255, 255, 0.65);
}

.ansi-dim {
  color: #91afa1;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-top: 1px solid var(--line-dim);
  background:
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.045) 0 10px, transparent 10px 20px),
    #050909;
}

.action-grid button {
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  overflow: hidden;
  color: var(--cyan);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.games-lab {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  min-height: 0;
  padding: 8px;
  overflow: hidden;
  color: var(--text);
  background:
    repeating-linear-gradient(0deg, rgba(211, 252, 230, 0.028) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% 42%, rgba(69, 255, 120, 0.09), transparent 42%),
    #020706;
}

.games-lab[hidden] {
  display: none;
}

.games-picker {
  order: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.games-picker button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--text);
  border-color: rgba(72, 255, 135, 0.44);
  background:
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.055) 0 10px, transparent 10px 20px),
    #06100d;
  text-align: left;
}

.games-picker button span {
  color: var(--amber);
  font-size: 18px;
}

.games-picker button strong {
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.games-picker button small {
  display: none;
}

.games-picker button.active,
.games-picker button:hover,
.games-picker button:focus-visible {
  color: #020706;
  border-color: var(--green);
  background: var(--green);
  outline: none;
  text-shadow: none;
}

.games-picker button.active span,
.games-picker button.active strong,
.games-picker button.active small,
.games-picker button:hover span,
.games-picker button:hover strong,
.games-picker button:hover small,
.games-picker button:focus-visible span,
.games-picker button:focus-visible strong,
.games-picker button:focus-visible small {
  color: #020706;
}

.games-status {
  order: 3;
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(160px, 1fr) minmax(110px, 0.6fr) minmax(120px, 0.55fr);
  gap: 6px;
  align-items: center;
}

.games-status span,
.games-status button {
  min-width: 0;
  min-height: 34px;
  padding: 7px 9px;
  overflow: hidden;
  color: var(--text);
  border: 1px solid var(--line-dim);
  background: #081111;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: inset 1px 1px 0 rgba(211, 252, 230, 0.08);
}

.games-status span:first-child {
  color: var(--amber);
}

.games-status button {
  color: var(--cyan);
  cursor: pointer;
}

.games-status button:hover,
.games-status button:focus-visible {
  color: #020706;
  background: var(--green);
  outline: none;
  text-shadow: none;
}

.games-playfield {
  order: 2;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(220px, 0.48fr);
  gap: 8px;
  min-height: 0;
}

.games-lab.war-mode .games-playfield {
  grid-template-columns: 1fr;
}

.bbs-board-shell,
.bbs-war-shell {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(0deg, rgba(242, 255, 249, 0.035) 0 1px, transparent 1px 4px),
    #010403;
  box-shadow:
    inset 1px 1px 0 rgba(242, 255, 249, 0.1),
    inset -1px -1px 0 rgba(0, 0, 0, 0.88);
}

.bbs-board-shell[hidden],
.bbs-war-shell[hidden] {
  display: none;
}

.bbs-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  aspect-ratio: 1 / 1;
  width: min(100%, 68vh);
  max-height: 100%;
  margin: 0 auto;
  padding: 8px;
  gap: 2px;
}

.bbs-square {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(36, 80, 86, 0.72);
  border-radius: 0;
  background: #081111;
  color: var(--text);
  cursor: pointer;
}

.bbs-square.light {
  background: #10211a;
}

.bbs-square.dark {
  background: #020706;
}

.bbs-square.selected {
  border-color: var(--amber);
  box-shadow: inset 0 0 0 2px rgba(201, 154, 69, 0.42);
}

.bbs-square.legal::after {
  content: "";
  position: absolute;
  inset: 38%;
  border: 1px solid var(--green);
  background: rgba(72, 255, 135, 0.22);
}

.bbs-piece {
  position: absolute;
  inset: 13%;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-weight: 900;
  line-height: 1;
  text-shadow: none;
}

.bbs-piece.light {
  color: #d3fce6;
  background: #0b241a;
}

.bbs-piece.dark {
  color: var(--amber);
  background: #211808;
}

.bbs-piece.king::before {
  content: "*";
}

.bbs-board.chess .bbs-piece {
  inset: 8%;
  border-radius: 2px;
  border-width: 1px;
  font-size: clamp(16px, 3vw, 30px);
}

.bbs-war-shell {
  position: relative;
  grid-column: 1;
  min-height: 360px;
  overflow: hidden;
}

.games-lab.war-mode .bbs-war-shell {
  min-height: clamp(300px, calc(100vh - 330px), 760px);
}

#bbsWarCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  background: #000000;
  image-rendering: pixelated;
}

.games-lab.war-mode .games-log {
  display: none;
}

.games-log {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 10px;
  overflow: auto;
  color: var(--muted);
  border: 1px solid var(--line-dim);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 3px),
    #020303;
  white-space: pre-wrap;
}

.public-image-gallery {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(240px, 0.85fr);
  gap: 12px;
  min-width: 680px;
}

.public-image-stage,
.public-image-info,
.public-image-filmstrip {
  display: block;
  min-width: 0;
  border: 1px solid var(--line-dim);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 4px),
    #020706;
  box-shadow: inset 1px 1px 0 rgba(211, 252, 230, 0.08);
}

.public-image-stage {
  position: relative;
  min-height: 420px;
  padding: 10px;
}

.public-image-stage img {
  display: block;
  width: 100%;
  height: min(58vh, 520px);
  object-fit: contain;
  background:
    repeating-linear-gradient(45deg, rgba(69, 255, 120, 0.035) 0 8px, transparent 8px 16px),
    #000000;
  filter: grayscale(0.72) sepia(0.14) contrast(1.32) brightness(0.82);
  mix-blend-mode: screen;
}

.public-image-stage.clean-image img {
  filter: none;
  mix-blend-mode: normal;
}

.public-image-stage::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(242, 255, 249, 0.08) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(72, 255, 135, 0.16), transparent 24%, transparent 76%, rgba(201, 154, 69, 0.11));
  mix-blend-mode: screen;
}

.public-image-stage.clean-image::after {
  display: none;
}

.public-image-info {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 10px;
  white-space: normal;
}

.public-image-title {
  display: block;
  color: #ffffff;
  font-size: clamp(18px, 2.4vw, 26px);
}

.public-image-meta,
.public-image-note {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.public-image-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.public-image-controls button,
.public-image-filmstrip button {
  min-width: 0;
  color: var(--cyan);
  border: 1px solid var(--line-dim);
  background: #081111;
  cursor: pointer;
}

.public-image-controls button:hover,
.public-image-controls button:focus-visible,
.public-image-filmstrip button:hover,
.public-image-filmstrip button:focus-visible,
.public-image-filmstrip button.active {
  color: #020706;
  background: var(--green);
  outline: none;
  text-shadow: none;
}

.public-image-filmstrip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
  padding: 8px;
}

.public-image-filmstrip button {
  display: block;
  padding: 6px 8px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-lab {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  padding: 6px;
  border-top: 1px solid var(--line-dim);
  background: #050909;
  min-height: 0;
  overflow: hidden;
}

.script-lab[hidden] {
  display: none;
}

.script-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 170px);
  gap: 6px;
  min-height: 0;
}

.script-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  grid-auto-rows: minmax(28px, auto);
  gap: 0;
  min-width: 0;
}

.script-lab.spectator-mode textarea[readonly] {
  color: #d3fce6;
  border-color: var(--amber);
  background:
    repeating-linear-gradient(0deg, rgba(255, 202, 98, 0.04) 0 1px, transparent 1px 4px),
    #020706;
  cursor: not-allowed;
}

.script-lab.spectator-mode .script-params input:disabled {
  color: var(--amber);
  border-color: rgba(201, 154, 69, 0.5);
  opacity: 1;
  cursor: not-allowed;
}

.script-lab.spectator-mode #loadPresetButton {
  color: #020706;
  background: var(--green);
  text-shadow: none;
}

.script-preset-control {
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  min-width: 0;
  min-height: 0;
  padding: 4px 6px;
  color: var(--amber);
  background: #081111;
  border: 1px solid var(--line-dim);
  box-shadow: inset 1px 1px 0 rgba(85, 217, 255, 0.1);
}

.script-preset-control select {
  min-width: 0;
  width: 100%;
  color: var(--text);
  background: #020706;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 3px 5px;
  font: inherit;
  font-size: 11px;
}

.mail-lab {
  display: grid;
  grid-template-rows: auto auto minmax(120px, 1fr);
  gap: 8px;
  min-height: 230px;
  padding: 10px;
  border-top: 1px solid var(--line-dim);
  background:
    repeating-linear-gradient(0deg, rgba(69, 255, 120, 0.035) 0 1px, transparent 1px 4px),
    #020706;
}

.mail-lab[hidden] {
  display: none;
}

.mail-toolbar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.mail-toolbar button,
.mail-editor-grid input,
.mail-lab textarea {
  color: var(--text);
  background: #081111;
  border: 1px solid var(--line-dim);
  border-radius: 2px;
  box-shadow: inset 1px 1px 0 rgba(211, 252, 230, 0.08);
  font: inherit;
}

.mail-toolbar button {
  min-height: 36px;
  color: var(--cyan);
  cursor: pointer;
}

.mail-toolbar button:hover,
.mail-toolbar button:focus-visible {
  color: #020706;
  background: var(--green);
  outline: none;
}

.mail-editor-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.5fr) minmax(240px, 1fr);
  gap: 8px;
}

.mail-editor-grid label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--amber);
}

.mail-editor-grid input {
  min-width: 0;
  padding: 7px 8px;
}

.mail-lab textarea {
  width: 100%;
  min-height: 0;
  resize: none;
  padding: 9px 10px;
  line-height: 1.45;
}

.script-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
}

.script-params {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(92px, 0.22fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  color: var(--muted);
  background:
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.055) 0 8px, transparent 8px 16px),
    #030807;
  border: 1px solid var(--line-dim);
  border-radius: 2px;
  box-shadow:
    inset 1px 1px 0 rgba(211, 252, 230, 0.08),
    inset -1px -1px 0 rgba(0, 0, 0, 0.72);
}

.script-params-title {
  margin: 0;
  color: var(--amber);
  font-size: 12px;
  line-height: 1.1;
}

.script-params-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(82px, 1fr));
  gap: 6px;
}

.script-params-grid label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--green);
  font-size: 11px;
}

.script-params-grid input {
  min-width: 0;
  color: var(--text);
  background: #020706;
  border: 1px solid var(--line-dim);
  border-radius: 2px;
  padding: 4px 5px;
  font: inherit;
}

.script-copy-code {
  width: 100%;
  margin: 0;
  min-height: 28px;
  color: var(--cyan);
  background:
    repeating-linear-gradient(90deg, rgba(69, 255, 120, 0.065) 0 9px, transparent 9px 18px),
    #081111;
  border: 1px solid var(--line-dim);
  border-radius: 2px;
  font-size: 11px;
  line-height: 1.25;
  cursor: pointer;
}

.script-copy-code:hover,
.script-copy-code:focus-visible {
  color: #020706;
  background: var(--green);
  outline: none;
  text-shadow: none;
}

.script-workspace textarea {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 280px;
  height: 100%;
  resize: none;
  color: var(--text);
  background: #020706;
  border: 1px solid var(--line-dim);
  border-radius: 6px;
  padding: 10px;
  outline: none;
}

.script-workspace textarea:focus {
  border-color: var(--green);
}

.ascii-output-panel {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 280px;
  height: 100%;
  overflow: auto;
  background: #010403;
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow:
    inset 1px 1px 0 rgba(211, 252, 230, 0.08),
    inset -1px -1px 0 rgba(0, 0, 0, 0.78);
}

.ascii-output {
  min-width: max-content;
  margin: 0;
  padding: 12px;
  color: var(--green);
  background:
    repeating-linear-gradient(0deg, rgba(72, 255, 135, 0.025) 0 1px, transparent 1px 3px),
    #010403;
  font-size: 10px;
  line-height: 10px;
  letter-spacing: 0;
  text-shadow: 0 0 8px rgba(72, 255, 135, 0.2);
  white-space: pre;
}

.script-workspace canvas {
  width: 100%;
  height: 100%;
  min-height: 320px;
  background: #010403;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.feed {
  min-height: 0;
  overflow: auto;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--line-dim);
  background: var(--panel-2);
}

.line {
  margin: 0 0 4px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.line.system {
  color: var(--cyan);
}

.line.warn {
  color: var(--amber);
}

.line.error {
  color: var(--red);
}

.line.chat {
  color: var(--magenta);
}

.line.good {
  color: var(--green);
}

.line.dim {
  color: var(--muted);
}

.side-panel {
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.rail-section {
  border-bottom: 1px solid var(--line-dim);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.rail-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.rail-section h2 {
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 8px;
}

.caller {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dotted rgba(85, 217, 255, 0.18);
}

.caller:last-child {
  border-bottom: 0;
}

.caller .line-id {
  color: var(--cyan);
}

.caller .handle {
  color: var(--green);
}

.caller .where,
.chat-tap p,
.pack-view p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}

.chat-tap {
  display: grid;
  gap: 8px;
}

.chat-tap strong {
  color: var(--magenta);
  font-weight: 700;
}

.chat-tap .chat-tone-g strong {
  color: var(--green);
}

.chat-tap .chat-tone-y strong {
  color: var(--amber);
}

.chat-tap .chat-tone-c strong {
  color: var(--cyan);
}

.chat-tap .chat-tone-m strong {
  color: var(--magenta);
}

.chat-tap .chat-tone-b strong {
  color: var(--blue);
}

.chat-tap .chat-tone-r strong {
  color: var(--red);
}

.chat-tap .chat-tone-w strong {
  color: #ffffff;
}

.chat-tap .chat-tone-d strong {
  color: var(--muted);
}

.cursor-block {
  color: var(--green);
  animation: flicker 1s infinite steps(1, end);
}

.pack-view {
  display: grid;
  gap: 6px;
}

.softkeys {
  display: grid;
  grid-template-columns: repeat(var(--softkey-count, 6), minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  min-height: 0;
}

.softkeys button {
  min-width: 0;
  min-height: 30px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.softkeys button.slideshow-progress {
  border-color: var(--green);
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(69, 255, 120, 0.42) 0 var(--slideshow-progress, 0%), transparent var(--slideshow-progress, 0%) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 45%),
    #070b0c;
  text-shadow:
    0 0 7px rgba(69, 255, 120, 0.45),
    1px 1px 0 #000000;
  box-shadow:
    inset 0 0 10px rgba(69, 255, 120, 0.28),
    0 0 12px rgba(69, 255, 120, 0.18);
  transition:
    background 80ms linear,
    border-color 120ms ease,
    color 120ms ease;
}

.command-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px;
  align-items: center;
  padding: 4px;
  min-height: 0;
}

.command-bar label {
  color: var(--amber);
  white-space: nowrap;
}

.command-bar input {
  min-width: 0;
  min-height: 30px;
  color: var(--text);
  caret-color: var(--green);
  background: #020706;
  border: 1px solid var(--line-dim);
  border-radius: 2px;
  padding: 0 12px;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.68);
}

.command-bar input:focus {
  outline: 1px solid var(--green);
  border-color: var(--green);
}

.command-bar button {
  min-width: 82px;
  min-height: 30px;
}

.footer-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.footer-line a {
  color: var(--amber);
}

.flicker {
  animation: flicker 1.8s infinite steps(1, end);
}

@keyframes flicker {
  0%,
  100% {
    opacity: 1;
  }
  47% {
    opacity: 0.93;
  }
  48% {
    opacity: 0.78;
  }
  49% {
    opacity: 1;
  }
}

@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .side-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .rail-section {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }

  .app-shell {
    padding: 8px;
    grid-template-rows: auto auto auto auto auto;
    overflow: auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .line-monitor {
    left: 8px;
    right: 8px;
    width: auto;
  }

  .line-monitor-grid {
    grid-template-columns: 1fr;
  }

  .line-monitor-list,
  .line-spy-detail {
    min-height: 160px;
    max-height: 32dvh;
  }

  .workspace {
    grid-template-rows: auto auto auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .workspace.chat-workspace {
    grid-template-columns: 1fr;
  }

  .workspace.script-workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace.subject-workspace {
    grid-template-columns: 1fr;
  }

  .weather-wrap {
    min-width: 620px;
  }

  .news-wrap {
    min-width: 620px;
  }

  .games-picker,
  .games-status,
  .games-playfield,
  .public-image-gallery {
    grid-template-columns: 1fr;
  }

  .public-image-gallery {
    min-width: 520px;
  }

  .public-image-filmstrip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weather-grid-area {
    grid-template-columns: 1fr;
  }

  .news-grid-area {
    grid-template-columns: 1fr;
  }

  .weather-ledger-grid {
    grid-template-columns: 1fr;
  }

  .nav-panel {
    display: flex;
    gap: 6px;
    overflow: auto hidden;
    padding: 6px;
  }

  .console-panel {
    min-height: 560px;
    grid-template-rows: auto minmax(260px, 1fr) auto auto minmax(96px, 0.38fr);
  }

  .nav-panel button {
    flex: 0 0 126px;
    min-height: 40px;
  }

  .ansi-viewport {
    padding: 10px;
    font-size: 12px;
    line-height: 1.36;
  }

  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .script-top-row {
    grid-template-columns: 1fr;
  }

  .script-toolbar {
    grid-template-columns: 1fr;
  }

  .script-preset-control {
    grid-column: auto;
  }

  .script-params {
    grid-template-columns: 1fr;
  }

  .script-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .script-params-grid {
    grid-template-columns: 1fr;
  }

  .script-workspace textarea,
  .ascii-output-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .softkeys {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .command-bar {
    grid-template-columns: 1fr;
  }

  .command-bar label {
    white-space: normal;
  }

  .command-bar button {
    width: 100%;
  }

  .footer-line {
    align-items: flex-start;
    flex-direction: column;
  }
}
