﻿:root {
  --bg: #0a0b10;
  --bg-2: #121520;
  --card: #141826;
  --line: #23283b;
  --accent: #64f2b8;
  --accent-2: #f7c66c;
  --text: #f0f4ff;
  --muted: #9aa6be;
  --shadow: 0 28px 60px rgba(5, 7, 14, 0.6);
}
:root[data-theme='amber'],
body[data-theme='amber'] {
  --bg: #120d08;
  --bg-2: #1a130b;
  --card: #1c160f;
  --line: #3a2d1c;
  --accent: #f7c66c;
  --accent-2: #ff9b77;
  --text: #fff7ea;
  --muted: #c5b39b;
  --shadow: 0 28px 60px rgba(12, 6, 2, 0.55);
}

:root[data-theme='ice'],
body[data-theme='ice'] {
  --bg: #0b1016;
  --bg-2: #121a24;
  --card: #141f2c;
  --line: #233447;
  --accent: #7cd4ff;
  --accent-2: #9ff0d3;
  --text: #eef6ff;
  --muted: #9bb0c7;
  --shadow: 0 28px 60px rgba(5, 10, 16, 0.6);
}

:root[data-theme='neon'],
body[data-theme='neon'] {
  --bg: #0a0a14;
  --bg-2: #141427;
  --card: #17172c;
  --line: #2c2c4a;
  --accent: #9b8bff;
  --accent-2: #5ef9d6;
  --text: #f4f1ff;
  --muted: #b5b0d6;
  --shadow: 0 28px 60px rgba(6, 5, 18, 0.6);
}

:root[data-theme='forest'],
body[data-theme='forest'] {
  --bg: #0b120f;
  --bg-2: #121b16;
  --card: #15211b;
  --line: #25342b;
  --accent: #7be495;
  --accent-2: #f9c784;
  --text: #eaf7f0;
  --muted: #a6c2b2;
  --shadow: 0 28px 60px rgba(5, 12, 9, 0.6);
}

:root[data-theme='sunset'],
body[data-theme='sunset'] {
  --bg: #120c0a;
  --bg-2: #1c1210;
  --card: #211513;
  --line: #3b2522;
  --accent: #ff9a7a;
  --accent-2: #ffd56a;
  --text: #fff2ea;
  --muted: #d8b8ab;
  --shadow: 0 28px 60px rgba(12, 6, 4, 0.6);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background:
    linear-gradient(120deg, rgba(100, 242, 184, 0.08), transparent 55%),
    linear-gradient(230deg, rgba(247, 198, 108, 0.08), transparent 50%),
    var(--bg);
  overflow: hidden;
}

body.auth-page {
  overflow: auto;
}

body.editor-open {
  overflow: auto;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.25;
  pointer-events: none;
}

.page {
  min-height: 100vh;
  height: 100vh;
  padding: 3rem 5vw 2.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

body.editor-open .page {
  height: auto;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: flex-end;
  position: relative;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.7rem;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0 0 0.5rem;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
}

.identity {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.identity .avatar {
  cursor: pointer;
}

.status-card {
  background: rgba(20, 24, 38, 0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem 1.6rem;
  min-width: 220px;
  box-shadow: var(--shadow);
}

.status-label {
  margin: 0 0 0.6rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.65rem;
}

.status-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.pulse {
  position: relative;
  padding-left: 1.1rem;
}

.pulse::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
  box-shadow: 0 0 0 rgba(100, 242, 184, 0.6);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(100, 242, 184, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(100, 242, 184, 0); }
  100% { box-shadow: 0 0 0 0 rgba(100, 242, 184, 0); }
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.8fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "terminal right";
  gap: 2rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.terminal {
  grid-area: terminal;
  align-self: stretch;
  justify-self: stretch;
}

.right-panel {
  grid-area: right;
  display: flex;
  flex-direction: column;
  min-height: 0;
  align-self: stretch;
  justify-self: stretch;
  overflow: hidden;
}

.editor-panel {
  grid-area: editor;
  align-self: stretch;
  justify-self: stretch;
}

body.editor-open .workspace {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(360px, 68vh) auto;
  grid-template-areas:
    "terminal editor"
    "right right";
}

body.editor-open .terminal,
body.editor-open .editor-panel,
body.editor-open .editor-shell {
  max-height: 68vh;
}

body.editor-open .right-panel {
  overflow: hidden;
}
body.editor-open .right-panel {
  min-height: 320px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
body.editor-open .right-panel::-webkit-scrollbar {
  height: 0;
}

.terminal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.4rem;
  background: rgba(10, 12, 20, 0.85);
  border-bottom: 1px solid var(--line);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red { background: #ff6f6f; }
.dot-amber { background: #f5c05f; }
.dot-green { background: #69f1a5; }

.terminal-title {
  margin-left: 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.terminal-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  position: relative;
}

.terminal-output {
  padding: 1.6rem;
  flex: 1;
  overflow-y: auto;
  font-size: 0.95rem;
  scrollbar-width: none;
}

.terminal-output::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(10px);
  animation: reveal 320ms ease forwards;
}

.line.media .tag {
  color: var(--accent-2);
}

.media-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1rem;
  padding: 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(100, 242, 184, 0.08), transparent 55%);
  position: relative;
  overflow: hidden;
}

.media-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.08) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 2.2s infinite;
  pointer-events: none;
}

.media-card.ready::after,
.media-card.error::after {
  animation: none;
}

.media-preview {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background-color: #0d111b;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
}

.media-meta {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.media-meta strong {
  color: var(--text);
  font-size: 0.95rem;
}

.media-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.7;
  animation: progress 1.2s linear infinite;
}

.media-card.ready .media-progress,
.media-card.error .media-progress {
  display: none;
}


.media-card.generated {
  box-shadow: 0 0 0 1px rgba(124, 212, 255, 0.2), 0 0 20px rgba(124, 212, 255, 0.25);
}
.media-card.error {
  border-color: rgba(255, 140, 140, 0.6);
  background: rgba(255, 140, 140, 0.08);
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes progress {
  0% { transform: translateX(-30%); }
  100% { transform: translateX(30%); }
}

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

.line .tag {
  color: var(--accent);
  font-weight: 600;
}

.line.system .tag {
  color: var(--accent-2);
}

.line.error .tag {
  color: #ff8c8c;
}

.line .content {
  white-space: pre-wrap;
  color: var(--text);
  display: block;
}

.line .content.markdown {
  white-space: normal;
}

.line .content.markdown p {
  margin: 0 0 0.75rem;
}

.line .content.markdown p:last-child {
  margin-bottom: 0;
}

.line .content.markdown h1,
.line .content.markdown h2,
.line .content.markdown h3 {
  margin: 0.4rem 0 0.6rem;
  font-family: 'Space Grotesk', sans-serif;
}

.line .content.markdown ul,
.line .content.markdown ol {
  margin: 0 0 0.8rem 1.2rem;
  padding: 0;
}

.line .content.markdown code {
  background: rgba(100, 242, 184, 0.12);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

.line .content.markdown pre {
  background: #0d111b;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  overflow: auto;
  scrollbar-width: none;
}

.line .content.markdown pre::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.line .content.markdown pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  display: block;
}

.line .content.scrollable {
  max-height: 220px;
  overflow: auto;
  scrollbar-width: none;
}

.line .content.scrollable::-webkit-scrollbar {
  width: 0;
  height: 0;
}


.thinking-text {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.thinking-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  animation: pulse-dot 1.2s infinite;
}

.thinking-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.thinking-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse-dot {
  0% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-4px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.3; }
}

.terminal-input {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.6rem 1.4rem;
  border-top: 1px solid var(--line);
  background: rgba(10, 12, 20, 0.9);
}

.suggestions {
  position: absolute;
  left: 1.6rem;
  right: 1.6rem;
  bottom: 4.4rem;
  background: rgba(12, 16, 26, 0.96);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.6rem;
  display: none;
  z-index: 5;
}

.suggestions.is-visible {
  display: grid;
  gap: 0.4rem;
}

.suggestion {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
}

.suggestion strong {
  color: var(--text);
}

.suggestion.is-active {
  background: rgba(100, 242, 184, 0.12);
  color: var(--text);
}

.prompt {
  color: var(--accent);
  font-weight: 600;
}

#command-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.cursor {
  width: 10px;
  height: 20px;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow: auto;
  scrollbar-width: none;
  min-height: 0;
  flex: 1;
}

.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.editor-panel {
  display: none;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

body.editor-open .editor-panel {
  display: block;
}

body.editor-open .editor-panel .panel {
  height: 100%;
}

body.editor-open .terminal {
  height: 100%;
}

body.editor-open .sidebar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 1.5rem;
  overflow: visible;
  padding-bottom: 0.4rem;
  height: 100%;
  width: max-content;
}

body.editor-open #editor-toggle {
  border-color: rgba(100, 242, 184, 0.7);
  color: var(--accent);
}

.editor-panel .panel {
  height: 100%;
  min-height: 0;
}

.editor-shell {
  display: grid;
  gap: 1rem;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.editor-actions {
  display: flex;
  gap: 0.6rem;
}

.editor-actions-main {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.editor-actions-compact {
  display: none;
  position: relative;
}

.editor-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  background: rgba(12, 16, 26, 0.98);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.4rem;
  display: none;
  grid-auto-rows: minmax(0, auto);
  gap: 0.4rem;
  min-width: 180px;
  box-shadow: var(--shadow);
  z-index: 10;
}

.editor-actions-menu.is-visible {
  display: grid;
}

.editor-actions-menu button {
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.editor-actions-menu button:hover {
  background: rgba(100, 242, 184, 0.12);
  color: var(--accent);
}

.editor-body {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(0, 2fr);
  gap: 1rem;
  min-height: 0;
  overflow: hidden;
}

.file-tree-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.6rem;
  min-height: 0;
  overflow: hidden;
  min-width: 0;
  padding-right: 0.2rem;
  min-width: 280px;
}

.file-tree-search {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
}

.file-tree-search input {
  flex: 1 1 100%;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f1422;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
}

.file-tree-search .button {
  flex: 1 1 100%;
  white-space: nowrap;
  justify-content: center;
}

.file-tree-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(100, 242, 184, 0.2);
  outline: none;
}

.file-search-results {
  display: none;
  gap: 0.4rem;
  max-height: 360px;
  min-height: 120px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0.5rem;
  background: rgba(12, 16, 26, 0.7);
  font-size: 0.8rem;
  scrollbar-width: none;
  width: 100%;
  min-width: 0;
}

.file-search-results.is-visible {
  display: grid;
}

.file-search-results::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.file-search-item {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.file-search-item strong {
  color: var(--text);
  font-weight: 500;
}

.file-search-item:hover {
  border-color: rgba(100, 242, 184, 0.5);
  color: var(--text);
}

.editor-body {
  position: relative;
  z-index: 1;
}

.file-tree {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.6rem;
  background: rgba(12, 16, 26, 0.7);
  overflow: auto;
  font-size: 0.85rem;
  min-height: 200px;
  height: 100%;
}

.tree-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 0.3rem;
  align-items: center;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
}

.tree-item:hover {
  background: rgba(100, 242, 184, 0.08);
  color: var(--text);
}

.tree-children {
  margin-left: 0.8rem;
  margin-top: 0.3rem;
  display: none;
}

.tree-item.is-open > .tree-children {
  display: block;
}

.tree-item.dir {
  font-weight: 600;
}

.tree-item.is-dragging {
  opacity: 0.4;
}

.tree-item.is-drop-target {
  border: 1px dashed rgba(100, 242, 184, 0.6);
  background: rgba(100, 242, 184, 0.08);
}

.tree-context {
  position: fixed;
  z-index: 50;
  background: rgba(12, 16, 26, 0.98);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.4rem;
  display: none;
  min-width: 180px;
  box-shadow: var(--shadow);
}

.tree-context.is-visible {
  display: grid;
  gap: 0.3rem;
}

.tree-context button {
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.tree-context button:hover {
  background: rgba(100, 242, 184, 0.12);
  color: var(--accent);
}

.tree-empty {
  color: var(--muted);
  padding: 0.6rem;
}

.editor-main {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 0;
  gap: 0.5rem;
  overflow: hidden;
}

.editor-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.editor-tab {
  border: 1px solid var(--line);
  background: rgba(15, 20, 34, 0.6);
  color: var(--text);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
}

.editor-tab.is-active {
  border-color: rgba(100, 242, 184, 0.6);
  color: var(--accent);
}

.tab-close {
  font-size: 0.85rem;
  opacity: 0.7;
}

.editor-status {
  color: var(--muted);
  font-size: 0.8rem;
}

.editor-container {
  border-radius: 14px;
  border: 1px solid var(--line);
  overflow: hidden;
  min-height: 320px;
  height: 100%;
}

body.editor-open .editor-body {
  min-height: 280px;
  overflow: hidden;
}

body.editor-open .file-tree {
  min-height: 280px;
  height: 100%;
}

body.editor-open .editor-container {
  min-height: 280px;
  height: 100%;
}

body.editor-open .sidebar .panel {
  overflow: visible;
}

.settings-inline {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.editor-settings-modal {
  width: min(540px, 92vw);
}

.editor-create-modal {
  width: min(480px, 92vw);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.modal-body label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.modal-body input {
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f1422;
  color: var(--text);
  font-family: inherit;
}

.modal-body input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(100, 242, 184, 0.2);
  outline: none;
}

.panel {
  background: rgba(18, 22, 34, 0.9);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 0.9rem;
  font-size: 1rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.panel-header h2 {
  margin: 0;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0e14;
}

.button.small {
  padding: 0.35rem 0.8rem;
  font-size: 0.75rem;
}

.button.large {
  padding: 0.65rem 1.4rem;
  font-size: 0.9rem;
}

.topbar-logout {
  position: absolute;
  top: 0;
  right: 0;
}

.topbar-admin {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.topbar-admin .avatar {
  cursor: pointer;
}

.button.danger {
  border-color: rgba(255, 120, 120, 0.6);
  color: #ffb3b3;
}

.button.danger:hover {
  border-color: #ff8c8c;
  color: #ff8c8c;
}

.admin-page {
  gap: 1.5rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1rem 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(18, 22, 34, 0.9);
  display: grid;
  gap: 0.4rem;
  box-shadow: var(--shadow);
}

.stat-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

.stat-card strong {
  font-size: 1.5rem;
}

.admin-panel {
  padding: 1.2rem;
}

.admin-chat-panel {
  display: grid;
  gap: 0.8rem;
  position: fixed;
  left: 1.6rem;
  bottom: 5.6rem;
  width: min(420px, 92vw);
  max-height: min(70vh, 520px);
  z-index: 25;
  transition: opacity 180ms ease, transform 180ms ease;
  background: linear-gradient(160deg, rgba(20, 26, 40, 0.96), rgba(15, 20, 32, 0.92));
  border: 1px solid rgba(100, 242, 184, 0.2);
}

.admin-chat-panel.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
}

.admin-chat-fab {
  position: fixed;
  left: 1.6rem;
  bottom: 1.6rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(100, 242, 184, 0.6);
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 55%), var(--accent);
  color: #0b0e14;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 14px 30px rgba(5, 7, 14, 0.35);
  cursor: pointer;
  z-index: 24;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.admin-chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(5, 7, 14, 0.4);
}

.chat-meta {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.chat-window {
  min-height: 220px;
  max-height: 320px;
  overflow: auto;
  padding: 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 14, 24, 0.65);
  display: grid;
  gap: 0.6rem;
  scrollbar-width: none;
}

.chat-window::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.chat-line {
  display: grid;
  justify-items: start;
  gap: 0.4rem;
}

.chat-line.user {
  justify-items: end;
}

.chat-bubble {
  padding: 0.5rem 0.8rem;
  border-radius: 12px;
  background: rgba(20, 24, 38, 0.9);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.85rem;
  max-width: 100%;
  line-height: 1.5;
}

.chat-line.user .chat-bubble {
  background: rgba(100, 242, 184, 0.1);
  border-color: rgba(100, 242, 184, 0.3);
}

.chat-bubble.markdown p {
  margin: 0 0 0.6rem;
}

.chat-bubble.markdown p:last-child {
  margin-bottom: 0;
}

.chat-bubble.markdown ul,
.chat-bubble.markdown ol {
  margin: 0 0 0.6rem 1.2rem;
  padding: 0;
}

.chat-bubble.markdown code {
  background: rgba(100, 242, 184, 0.12);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

.chat-bubble.markdown pre {
  background: #0d111b;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  overflow: auto;
  scrollbar-width: none;
}

.chat-bubble.markdown pre::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.chat-bubble.markdown pre code {
  background: transparent;
  padding: 0;
}

.chat-attachment {
  width: 180px;
  height: 120px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center;
  box-shadow: 0 8px 18px rgba(5, 7, 14, 0.35);
}

.chat-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chat-input {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}

.chat-input input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f1422;
  color: var(--text);
  font-family: inherit;
  height: 44px;
}

.admin-chat-send {
  height: 44px;
  border-radius: 10px;
  padding: 0 1.2rem;
}

.wizard {
  display: grid;
  gap: 1.5rem;
}

.wizard-form {
  display: grid;
  gap: 1.5rem;
}

.wizard-steps {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.step {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.step.is-active {
  border-color: rgba(100, 242, 184, 0.8);
  color: var(--text);
  box-shadow: 0 0 12px rgba(100, 242, 184, 0.2);
}

.wizard-panel {
  display: none;
  gap: 1rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(12, 16, 26, 0.7);
  min-height: 220px;
}

.wizard-panel.is-active {
  display: grid;
}

.wizard-panel h2 {
  margin: 0;
  font-size: 1.1rem;
}

.wizard-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.checkbox {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.wizard-panel input,
.wizard-panel select {
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f1422;
  color: var(--text);
  font-family: inherit;
}

.wizard-panel input:disabled {
  opacity: 0.6;
}

.wizard-panel label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.wizard-panel input:focus,
.wizard-panel select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(100, 242, 184, 0.2);
  outline: none;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.admin-search {
  display: flex;
  gap: 0.6rem;
  width: 100%;
  max-width: 420px;
}

.admin-search input {
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f1422;
  color: var(--text);
  font-family: inherit;
  flex: 1;
}

.admin-table {
  display: grid;
  gap: 0.8rem;
}

.admin-row {
  display: grid;
  grid-template-columns: 2fr 0.8fr 0.9fr 1fr 2.4fr;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(12, 16, 26, 0.7);
}

.admin-row.admin-head {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 0.6rem;
}

.admin-email {
  display: grid;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: var(--muted);
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 0.8rem;
}

.admin-email strong {
  color: var(--text);
  font-size: 0.95rem;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #0f1422;
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 600;
}

.avatar.small {
  width: 42px;
  height: 42px;
  font-size: 0.85rem;
}

.detail-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-row {
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease;
}

.admin-row:hover {
  transform: translateY(-1px);
  border-color: rgba(100, 242, 184, 0.4);
}

.admin-actions button {
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.7);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 40;
}

.modal.is-visible {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  width: min(520px, 92vw);
  background: #141826;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.avatar-modal {
  width: min(760px, 92vw);
}

.avatar-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.avatar-preview {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(12, 16, 26, 0.7);
  padding: 1rem;
  min-height: 320px;
  display: grid;
  place-items: center;
}

.avatar-preview::before {
  content: 'Drop a photo or upload to preview';
  color: var(--muted);
  font-size: 0.85rem;
}

.avatar-preview.has-image::before {
  content: '';
}

.avatar-preview img {
  max-width: 100%;
  max-height: 320px;
  display: block;
}

.avatar-image.hidden {
  display: none;
}

.file-input {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.file-input input[type='file'] {
  display: none;
}

.file-button {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(15, 20, 34, 0.6);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  margin: 0;
}

.file-button:hover {
  border-color: rgba(100, 242, 184, 0.6);
  color: var(--accent);
}

.avatar-menu {
  position: relative;
}

.avatar-dropdown {
  position: absolute;
  right: 0;
  top: 56px;
  background: rgba(12, 16, 26, 0.98);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.6rem;
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 180px;
  box-shadow: var(--shadow);
  z-index: 6;
}

.avatar-dropdown.is-open {
  display: flex;
}

.avatar-controls {
  display: grid;
  gap: 0.8rem;
}

.avatar-controls label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.avatar-controls input[type='range'],
.avatar-controls input[type='file'] {
  accent-color: var(--accent);
}

.avatar-buttons {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

@media (max-width: 960px) {
  .avatar-body {
    grid-template-columns: 1fr;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-body {
  display: grid;
  gap: 0.6rem;
}

.alert-modal {
  width: min(460px, 92vw);
}

.alert-modal p {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(12, 16, 26, 0.7);
  font-size: 0.85rem;
  color: var(--muted);
}

.detail-row strong {
  color: var(--text);
}

.detail-row strong img {
  display: block;
}
.admin-actions form {
  margin: 0;
}

.button.action {
  background: rgba(15, 20, 34, 0.6);
  border: 1px solid rgba(42, 52, 69, 0.9);
  color: var(--text);
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  border-radius: 10px;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.button.action.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button.action.disabled:hover {
  border-color: rgba(42, 52, 69, 0.9);
  color: var(--text);
}

.button.action:hover {
  transform: translateY(-1px);
  border-color: rgba(100, 242, 184, 0.6);
  box-shadow: 0 6px 16px rgba(5, 7, 14, 0.25);
}

.button.action.danger {
  border-color: rgba(255, 120, 120, 0.5);
  color: #ffb3b3;
}

.button.action.danger:hover {
  border-color: rgba(255, 120, 120, 0.9);
  box-shadow: 0 6px 16px rgba(255, 120, 120, 0.2);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
}

.pill-success {
  border-color: rgba(100, 242, 184, 0.4);
  color: #c8ffea;
}

.pill-danger {
  border-color: rgba(255, 140, 140, 0.5);
  color: #ffb3b3;
}

.pill-accent {
  border-color: rgba(124, 212, 255, 0.4);
  color: #cfeaff;
}
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2rem;
  padding: 4rem 8vw;
}

.auth::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(800px 500px at 10% 20%, rgba(100, 242, 184, 0.12), transparent 60%),
              radial-gradient(900px 600px at 85% 10%, rgba(247, 198, 108, 0.12), transparent 60%);
  opacity: 0.7;
  pointer-events: none;
}

.auth-card {
  background: rgba(18, 22, 34, 0.9);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 2.4rem;
  display: grid;
  gap: 1.8rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.auth-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 300px at 20% 0%, rgba(124, 212, 255, 0.16), transparent 65%);
  pointer-events: none;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.auth-form input {
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f1422;
  color: var(--text);
  font-family: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(100, 242, 184, 0.2);
}

.auth-form input.is-match {
  border-color: rgba(100, 242, 184, 0.8);
}

.password-meter {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.password-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff8c8c, #f7c66c, #64f2b8);
  transition: width 160ms ease;
}

.password-rules {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.password-rules li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.password-rules li::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.password-rules li.is-met {
  color: #c8ffea;
}

.password-rules li.is-met::before {
  background: var(--accent);
}

.auth-links {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
}

.auth-links a {
  color: var(--accent);
  text-decoration: none;
}

.input-row {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
}

.input-row input {
  flex: 1;
}

.toggle {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 0 0.9rem;
  font-size: 0.75rem;
  cursor: pointer;
  height: 100%;
}

.toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.input-hint {
  display: inline-block;
  margin-top: 0.3rem;
  color: #f7c66c;
  font-size: 0.75rem;
}

.input-hint[hidden] {
  display: none;
}

.auth-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.auth-aside {
  position: relative;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(124, 212, 255, 0.12), rgba(100, 242, 184, 0.08));
  padding: 2.6rem;
  display: grid;
  gap: 1rem;
  align-content: start;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.auth-glow {
  position: absolute;
  inset: -40% 20% 60% -20%;
  background: radial-gradient(circle, rgba(124, 212, 255, 0.35), transparent 70%);
  opacity: 0.7;
}

.auth-aside::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transform: translateX(-100%);
  animation: auth-scan 5s linear infinite;
  pointer-events: none;
}

@keyframes auth-scan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.alert {
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  font-size: 0.85rem;
}

.alert-error {
  border: 1px solid rgba(255, 120, 120, 0.6);
  background: rgba(255, 120, 120, 0.12);
  color: #ffb3b3;
}

.alert-error.is-live {
  animation: alert-pop 200ms ease;
}

.alert-success.is-live {
  animation: alert-pop 200ms ease;
}

@keyframes alert-pop {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.alert-success {
  border: 1px solid rgba(100, 242, 184, 0.6);
  background: rgba(100, 242, 184, 0.12);
  color: #c8ffea;
}

@media (max-width: 960px) {
  .auth {
    grid-template-columns: 1fr;
    padding: 3rem 6vw;
  }
}
.select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #101420;
  color: var(--text);
  font-family: inherit;
}

.settings {
  display: grid;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.settings label {
  display: grid;
  gap: 0.45rem;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 0.6rem;
  align-items: center;
}

.settings input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}

.settings input[type='number'] {
  width: 100%;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0f1422;
  color: var(--text);
  font-family: inherit;
}

.button {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hint {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.command-list {
  display: grid;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.command-run {
  display: none;
}

body.editor-open .command-run {
  display: flex;
}

.command-list div {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.command-list span:first-child {
  color: var(--text);
}

.panel ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.upload-queue {
  display: grid;
  gap: 0.8rem;
}

.queue-item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.6rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(12, 16, 26, 0.7);
}

.queue-thumb {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
}

.queue-meta {
  display: grid;
  gap: 0.2rem;
  font-size: 0.82rem;
  color: var(--muted);
  word-break: break-word;
}

.queue-meta strong {
  color: var(--text);
  font-size: 0.9rem;
}

.queue-actions {
  display: grid;
  gap: 0.3rem;
}

.queue-actions button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 0.25rem 0.4rem;
  cursor: pointer;
  font-size: 0.75rem;
}

.queue-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.dropzone {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 16, 0.6);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 20;
}

.dropzone.is-visible {
  opacity: 1;
  pointer-events: all;
}

.dropzone-inner {
  padding: 2rem 3rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(12, 16, 26, 0.9);
  box-shadow: var(--shadow);
  text-align: center;
}

.dropzone-inner p {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
}

.dropzone-inner span {
  color: var(--muted);
  font-size: 0.9rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.8);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 30;
}

.lightbox.is-visible {
  opacity: 1;
  pointer-events: all;
}

.lightbox img {
  max-width: min(90vw, 960px);
  max-height: 85vh;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  border: 1px solid var(--line);
  background: rgba(12, 16, 26, 0.8);
  color: var(--text);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
}

@media (max-width: 960px) {
  body {
    overflow: auto;
  }

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

  .page {
    padding: 2rem 6vw 2.2rem;
    gap: 1.6rem;
    height: auto;
  }

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

  .topbar-admin {
    position: static;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .status-card {
    width: 100%;
    min-width: 0;
  }

  .terminal {
    min-height: 520px;
  }

  .right-panel {
    min-height: 0;
  }

  .editor-body {
    grid-template-columns: 1fr;
  }

  .file-tree-panel {
    min-width: 0;
  }

  .editor-container {
    min-height: 260px;
  }

  body.editor-open .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "terminal"
      "editor"
      "right";
  }

  body.editor-open .terminal,
  body.editor-open .editor-panel,
  body.editor-open .editor-shell {
    max-height: none;
  }

  body.editor-open .right-panel {
    overflow-x: auto;
  }

  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .admin-search {
    width: 100%;
    max-width: none;
  }

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

  .admin-row.admin-head {
    display: none;
  }

  .admin-row {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .admin-row > div {
    display: grid;
    gap: 0.35rem;
  }

  .admin-row > div::before {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    content: 'Field';
  }

  .admin-row > div:nth-child(1)::before { content: 'Email'; }
  .admin-row > div:nth-child(2)::before { content: 'Role'; }
  .admin-row > div:nth-child(3)::before { content: 'Status'; }
  .admin-row > div:nth-child(4)::before { content: 'Last login'; }
  .admin-row > div:nth-child(5)::before { content: 'Actions'; }

  .admin-actions {
    gap: 0.6rem;
  }
}

@media (max-width: 640px) {
  .terminal-input {
    flex-wrap: wrap;
  }

  .prompt {
    width: 100%;
  }

  h1 {
    font-size: clamp(1.6rem, 8vw, 2.4rem);
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .topbar-admin .button {
    width: 100%;
    justify-content: center;
  }

  .terminal-body {
    font-size: 0.9rem;
  }

  .terminal-output {
    padding: 1.2rem;
  }

  .editor-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .editor-actions-main {
    display: none;
  }

  .editor-actions-compact {
    display: flex;
  }

  .file-tree-search {
    gap: 0.5rem;
  }

  .file-search-results {
    max-height: 280px;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-chat-panel {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(92vw, 420px);
    bottom: 6rem;
  }
}

@media (max-width: 640px) {
  .auth-links {
    flex-direction: column;
  }
}

.error-page {
  overflow: auto;
}

.error-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 2rem;
  padding: 4rem 8vw;
  align-items: center;
}

.error-card {
  background: rgba(18, 22, 34, 0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 2.6rem;
  display: grid;
  gap: 1.4rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.error-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 240px at 10% 0%, rgba(124, 212, 255, 0.18), transparent 70%);
  pointer-events: none;
}

.error-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.error-art {
  position: relative;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(14, 18, 30, 0.9);
  min-height: 320px;
  display: grid;
  place-items: center;
  padding: 2rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.error-grid {
  position: absolute;
  inset: 1.5rem;
  border-radius: 20px;
  border: 1px dashed rgba(100, 242, 184, 0.18);
}

.error-code {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(3rem, 10vw, 7rem);
  letter-spacing: 0.1em;
  color: var(--accent);
  text-shadow: 0 0 30px rgba(100, 242, 184, 0.3);
  animation: error-float 3s ease-in-out infinite;
}

.error-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@keyframes error-float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

@media (max-width: 960px) {
  .error-shell {
    grid-template-columns: 1fr;
    padding: 3rem 6vw;
  }
}



