:root {
  --bg: #000000;
  --bg-grid: rgba(255,255,255,0.025);
  --bg-window: #000000;
  --line: rgba(255,255,255,0.18);
  --line-soft: rgba(255,255,255,0.07);
  --text: #c8d0db;
  --text-bright: #e8edf4;
  --text-dim: #5a626d;
  --text-deep: #2e3540;
  --accent: #2a6dff;
  --accent-bright: #5a92ff;
  --accent-glow: rgba(74,141,255,0.55);
  --accent-pale: rgba(42,109,255,0.10);
  --warn: #ff3370;

  --display: "Departure Mono", monospace;
  --pixel-en: "Departure Mono", monospace;
  --pixel-ru: "Departure Mono", monospace;
  --mono: "Departure Mono", monospace;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--pixel-ru);
  font-size: 13px;
  line-height: 1.55;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.os-window {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-rows: 28px 30px 1fr 24px;
  grid-template-columns: 36px 1fr 14px;
  background: var(--bg-window);
  z-index: 1;
}

.titlebar {
  grid-column: 1 / 4;
  grid-row: 1;
  display: flex;
  align-items: stretch;
  background: var(--bg);
  border-bottom: 2px solid rgba(255,255,255,0.2);
  font-family: var(--pixel-en);
  font-size: 8px;
  letter-spacing: 0.5px;
  user-select: none;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.titlebar::-webkit-scrollbar { display: none; }

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-right: 2px solid rgba(255,255,255,0.1);
  color: var(--text-dim);
  cursor: url("../../refs/New-Cursor-Finger.png") 8 1, pointer;
  white-space: nowrap;
  position: relative;
  transition: color .12s, background .12s;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,0.025); }
.tab.active {
  background: var(--bg-window);
  color: var(--accent-bright);
  text-shadow: 0 0 6px var(--accent-glow);
}
.tab.active::after {
  content: '';
  position: absolute;
  inset: 0 0 -1px 0;
  border-bottom: 1px solid var(--bg-window);
  pointer-events: none;
}
.tab .x { color: var(--text-dim); font-size: 10px; opacity: 0.5; font-family: var(--mono); position: relative; z-index: 1; cursor: url("../../refs/New-Cursor-Finger.png") 8 1, pointer; }
.tab.active .x { opacity: 0.9; }
.tab.plus { padding: 0 14px; color: var(--text-dim); font-family: var(--mono); }

.titlebar .spacer { flex: 1; }
.titlebar .lang-switch {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 8px;
  color: var(--text-dim);
  border-left: 2px solid rgba(255,255,255,0.1);
}
.titlebar .lang-switch span { cursor: url("../../refs/New-Cursor-Finger.png") 8 1, pointer; padding: 0 3px; }
.titlebar .lang-switch .active { color: var(--accent-bright); }
.titlebar .version {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--text-dim);
  font-size: 8px;
  border-left: 2px solid rgba(255,255,255,0.1);
}
.titlebar .controls { display: flex; align-items: center; border-left: 2px solid rgba(255,255,255,0.1); }
.titlebar .controls button {
  width: 36px; height: 100%;
  background: transparent; border: none;
  border-left: 2px solid rgba(255,255,255,0.1);
  color: var(--text-dim); cursor: url("../../refs/New-Cursor-Finger.png") 8 1, pointer;
  font-family: var(--mono); font-size: 12px;
}
.titlebar .controls button:first-child { border-left: none; }
.titlebar .controls button:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.titlebar .controls .close:hover { color: var(--warn); background: rgba(255,51,112,0.08); }

.menubar {
  grid-column: 1 / 4;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  background: var(--bg);
  border-bottom: 2px solid rgba(255,255,255,0.2);
  font-family: var(--pixel-en);
  font-size: 8px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  user-select: none;
}
.menubar span { cursor: url("../../refs/New-Cursor.png") 1 1, auto; transition: color .12s; }
.menubar span:hover { color: var(--text); }

.sidebar {
  grid-column: 1;
  grid-row: 3;
  background: var(--bg);
  border-right: 2px solid rgba(255,255,255,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 4px;
  font-family: var(--pixel-en);
}
.stat {
  font-size: 7px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.1;
  padding: 4px 0;
  width: 100%;
  border-bottom: 1px solid var(--line-soft);
  letter-spacing: 0.5px;
}
.stat strong {
  color: var(--accent-bright);
  display: block;
  font-weight: 400;
  margin-top: 2px;
}
.stat.warn strong { color: var(--warn); }
.sidebar .icons { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.icon-btn {
  width: 22px; height: 22px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; cursor: url("../../refs/New-Cursor-Finger.png") 8 1, pointer;
  font-family: var(--mono);
  transition: all .12s;
}
.icon-btn:hover {
  color: var(--accent-bright);
  border-color: var(--accent);
}

#sidebarInlineEditBtn.inline-edit-active {
  color: var(--accent-bright);
  border-color: var(--accent-bright);
  box-shadow: 0 0 10px var(--accent-glow);
}
body.inline-edit-mode [data-edit-key] {
  outline: 1px dashed rgba(114, 247, 255, 0.45);
  outline-offset: 3px;
  border-radius: 2px;
  cursor: url("../../refs/New-input.png") 9 11, text;
}
body.inline-edit-mode a.channel [data-edit-key] {
  cursor: url("../../refs/New-input.png") 9 11, text;
}

/* Inline copy editor (no persistence); above terminal (z-index 20) and admin description overlay (260) */
#inlineEditPanel.inline-edit-panel {
  position: fixed;
  top: 96px;
  right: 32px;
  width: min(520px, calc(100vw - 64px));
  max-height: min(70vh, 560px);
  z-index: 280;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  box-sizing: border-box;
  background: #000;
  border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  font-family: var(--mono);
}
#inlineEditPanel.inline-edit-panel[hidden] {
  display: none !important;
}
.inline-edit-panel-head {
  flex: 0 0 auto;
}
.inline-edit-panel-label {
  font-family: var(--pixel-en);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--accent-bright);
}
.inline-edit-panel-label code {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text);
  word-break: break-all;
}
.inline-edit-rich-input {
  flex: 1 1 auto;
  width: 100%;
  min-height: 120px;
  max-height: min(48vh, 360px);
  box-sizing: border-box;
  padding: 8px 10px;
  margin: 0;
  border: 1px solid var(--line);
  background: rgba(6, 8, 12, 0.92);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-y: auto;
  resize: vertical;
  pointer-events: auto;
  outline: none;
  caret-color: var(--accent-bright);
}
#inlineEditPanel .inline-edit-rich-input span.accent {
  color: var(--accent-bright);
}
#inlineEditPanel .inline-edit-rich-input span.ok {
  color: #56e08d;
}
#inlineEditPanel .inline-edit-rich-input span.bad {
  color: var(--warn);
}
.inline-edit-panel-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
button.inline-edit-panel-btn {
  pointer-events: auto;
}
.inline-edit-toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.inline-color-btn {
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: url("../../refs/New-Cursor-Finger.png") 8 1, pointer;
  flex-shrink: 0;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.inline-color-btn:hover:not(:disabled) {
  border-color: var(--accent-bright);
  box-shadow: 0 0 8px var(--accent-glow);
}
.inline-color-btn:disabled {
  opacity: 0.4;
  cursor: url("../../refs/New-Cursor.png") 1 1, default;
  pointer-events: none;
}
.inline-color-btn--accent {
  background: var(--accent);
}
.inline-color-btn--ok {
  background: #56e08d;
}
.inline-color-btn--bad {
  background: var(--warn);
}
.inline-edit-panel-hint {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}
.inline-edit-panel-hint.is-dim {
  opacity: 0.5;
}

.scrollbar {
  grid-column: 3;
  grid-row: 3;
  background: var(--bg);
  border-left: 2px solid rgba(255,255,255,0.2);
  position: relative;
}
.scrollbar::before, .scrollbar::after {
  content: ''; position: absolute; left: 50%;
  width: 0; height: 0; transform: translateX(-50%);
}
.scrollbar::before {
  top: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid var(--text-dim);
}
.scrollbar::after {
  bottom: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-dim);
}
.scrollbar .thumb {
  position: absolute;
  left: 2px; right: 2px;
  height: 60px;
  background: var(--text-dim);
  opacity: 0.6;
  transition: opacity .15s;
}
.scrollbar .thumb:hover { opacity: 0.9; cursor: url("../../refs/New-Cursor-Finger.png") 8 1, pointer; }

.statusbar {
  grid-column: 1 / 4;
  grid-row: 4;
  background: var(--bg);
  border-top: 2px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 14px;
  font-family: var(--pixel-en);
  font-size: 8px;
  color: var(--text-dim);
  user-select: none;
  letter-spacing: 0.5px;
}
.statusbar .blinker {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent-bright);
  animation: blink 1.2s steps(2) infinite;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0.2; } }

.statusbar .frames { flex: 1; display: flex; justify-content: space-between; }
.statusbar .frames span { font-size: 7px; }
.statusbar .controls-bottom { display: flex; gap: 4px; }
.statusbar .controls-bottom button {
  background: transparent; border: none;
  color: var(--text-dim); font-family: var(--pixel-en);
  cursor: url("../../refs/New-Cursor-Finger.png") 8 1, pointer; font-size: 8px; padding: 0 2px;
}
.statusbar .controls-bottom button:hover { color: var(--text); }

.content {
  grid-column: 2;
  grid-row: 3;
  overflow-y: auto;
  position: relative;
}
.content::-webkit-scrollbar { display: none; }
.content { scrollbar-width: none; }

.view { display: none; min-height: 100%; }
.view.active { display: block; }

.about-view {
  padding: 24px 30px 60px;
  position: relative;
}

/* Hero (tag) above system illusion layer; terminal stays on top via .terminal z-index */
.about-view > .hero {
  z-index: 2;
}

