:root {
  --bg: #0e0f12;
  --panel: rgba(18, 20, 26, 0.88);
  --ink: #eef1f6;
  --muted: #8b93a7;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #6ea8ff;
  --accent-2: #d7e6ff;
  --warm: #e8b86d;
  --danger: #ef7b74;
  --ok: #79c48c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html, body, #app {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

.auth {
  min-height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(110, 168, 255, 0.16), transparent 50%),
    radial-gradient(700px 400px at 90% 110%, rgba(232, 184, 109, 0.08), transparent 46%),
    var(--bg);
}

.auth-card {
  width: min(440px, calc(100vw - 32px));
  background: #151820;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.auth-card h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: 0.06em; }
.auth-card p { margin: 0 0 26px; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.field span { color: var(--muted); font-size: 13px; }
.field span i { font-style: normal; opacity: 0.7; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  background: #0e0f12;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
.field input:focus, .field textarea:focus { border-color: rgba(110, 168, 255, 0.7); }

.primary, .ghost, .danger, .tiny {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
}

.primary { background: var(--accent); color: #081018; font-weight: 700; }
.primary:disabled { opacity: 0.5; cursor: wait; }
.ghost { background: transparent; color: var(--ink); }
.danger { background: rgba(239, 123, 116, 0.14); color: #ffd2ce; }
.tiny {
  padding: 6px 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.tiny.on {
  background: rgba(110, 168, 255, 0.16);
  color: var(--accent-2);
}

.agent-toggle {
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #160818;
  background: linear-gradient(135deg, #ff4fd8 0%, #8a5cff 48%, #2ee6ff 100%);
  box-shadow: 0 0 0 1px rgba(255, 79, 216, 0.45), 0 8px 20px rgba(138, 92, 255, 0.5);
}
.agent-toggle:hover {
  filter: brightness(1.08);
}
.agent-toggle.on {
  color: #fff;
  background: linear-gradient(135deg, #ff2ec8 0%, #6a3dff 50%, #14d4ff 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 10px 24px rgba(255, 46, 200, 0.55);
}

.agent-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.agent-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff4fd8;
  box-shadow: 0 0 0 3px rgba(255, 79, 216, 0.22), 0 0 12px #ff4fd8;
}
.agent-head b { color: #ff9ae8; }

.error { color: var(--danger); min-height: 20px; font-size: 13px; }
.switch { margin-top: 12px; color: var(--muted); font-size: 14px; }
.switch a { color: var(--accent-2); }

.shell { height: 100%; display: flex; flex-direction: column; }

.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 15, 18, 0.9);
  backdrop-filter: blur(16px);
  z-index: 8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  font-size: 14px;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.brand-copy b {
  font-size: 12px;
  letter-spacing: 0.16em;
  line-height: 1.1;
}
.brand-copy span {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-arrow {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.back-arrow:hover {
  border-color: rgba(110, 168, 255, 0.45);
  background: rgba(110, 168, 255, 0.08);
}

.mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #6ea8ff 0%, #8fd3ff 48%, #e8b86d 100%);
}

.top-actions, .tool-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.credits {
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(232, 184, 109, 0.12);
  color: var(--warm);
  font-size: 12px;
}

.pay-switch { position: relative; }
.pay-chip {
  border: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 6px 12px;
  line-height: 1.2;
  border-radius: 14px;
}
.pay-chip b { font-size: 12px; font-weight: 700; }
.pay-chip span {
  font-size: 10px;
  opacity: 0.82;
  font-weight: 500;
}
.pay-chip.api {
  background: rgba(110, 168, 255, 0.14);
  color: var(--accent-2);
}
.pay-chip.open {
  box-shadow: 0 0 0 1px rgba(232, 184, 109, 0.45);
}
.pay-hint {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: max-content;
  max-width: min(240px, calc(100vw - 24px));
  padding: 8px 12px;
  border-radius: 12px;
  background: #e8b86d;
  color: #1a1408;
  font-size: 12px;
  font-weight: 700;
  z-index: 41;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.pay-hint::after {
  content: "";
  position: absolute;
  right: 22px;
  top: -6px;
  border: 6px solid transparent;
  border-bottom-color: #e8b86d;
  border-top-width: 0;
}
.pay-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.pay-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(320px, calc(100vw - 24px));
  background: #151820;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  z-index: 40;
  box-shadow: var(--shadow);
}
.pay-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.pay-choice {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0e0f12;
  text-align: left;
}
.pay-choice b { font-size: 13px; }
.pay-choice span { color: var(--muted); font-size: 11px; }
.pay-choice.active {
  border-color: var(--warm);
  background: rgba(232, 184, 109, 0.1);
}
.pay-menu .field { margin-top: 10px; }
.pay-error {
  color: var(--danger);
  font-size: 12px;
  margin: 8px 0 0;
}
.pay-menu .primary {
  width: 100%;
  margin-top: 10px;
}

.workspace {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 268px 1fr auto;
}

.rail, .inspector {
  background: rgba(16, 18, 24, 0.94);
  border-right: 1px solid var(--line);
  overflow: auto;
  z-index: 4;
}

.side-panel {
  position: relative;
  width: 300px;
  height: 100%;
  overflow: hidden;
  z-index: 4;
  transition: width 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.workspace.agent-on .side-panel {
  width: 360px;
}

.inspector {
  position: absolute;
  inset: 0;
  border-right: 0;
  border-left: 1px solid var(--line);
  padding: 16px;
  transform-origin: left center;
  transition: opacity 0.24s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.agent {
  position: absolute;
  inset: 0;
  border-left: 1px solid var(--line);
  background: rgba(16, 18, 24, 0.96);
  display: flex;
  flex-direction: column;
  min-height: 0;
  transform-origin: right center;
  transform: translateX(16%) scale(0.86);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.workspace.agent-on .inspector {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}

.workspace.agent-on .agent {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.workspace.agent-on .guide:not(.expand-panel) {
  opacity: 0;
  pointer-events: none;
}

.stage-banner {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 8;
  background: #151820;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 28px;
  font-size: 16px;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.agent-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.agent-head b { display: block; font-size: 15px; }
.agent-head span { color: var(--muted); font-size: 12px; }
.agent-head-actions { display: flex; gap: 6px; }

.agent-settings {
  padding: 12px 14px 4px;
  border-bottom: 1px solid var(--line);
}

.agent-notice {
  margin: 0 0 10px;
  color: var(--warm);
  font-size: 12px;
  line-height: 1.4;
}

.agent-send-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 168px;
  flex-shrink: 0;
}

.agent-model-count {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.agent-select {
  position: relative;
}

.agent-select-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  background: #0e0f12;
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
}

.agent-select-btn em {
  font-style: normal;
  color: var(--muted);
}

.agent-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  max-height: 240px;
  overflow: auto;
  background: #151820;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 8;
}

.agent-menu button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 0;
}

.agent-menu button:hover,
.agent-menu button.active {
  background: rgba(110, 168, 255, 0.12);
  color: var(--accent-2);
}

.agent-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bubble {
  max-width: 92%;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.bubble.user {
  align-self: flex-end;
  background: rgba(110, 168, 255, 0.16);
}

.bubble.assistant {
  align-self: flex-start;
  background: #171a22;
  border: 1px solid var(--line);
}

.bubble.pending { color: var(--muted); }

.agent-input {
  border-top: 1px solid var(--line);
  padding: 10px 12px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.agent-input textarea {
  flex: 1;
  min-height: 72px;
  max-height: 140px;
  resize: none;
  border: 1px solid var(--line);
  background: #0e0f12;
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}

.rail {
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}
.rail-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}
.rail-head-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail-head-copy em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.rail-head-copy b { font-size: 16px; letter-spacing: 0.04em; }
.task-new {
  border: 0;
  background: var(--accent);
  color: #081018;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
}
.task-new:disabled { opacity: 0.45; cursor: wait; }
.rail-projects {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}
.project-card {
  border: 1px solid var(--line);
  background: #14171f;
  border-radius: 14px;
  overflow: hidden;
}
.project-card.active {
  border-color: rgba(110, 168, 255, 0.55);
  box-shadow: inset 3px 0 0 var(--accent);
  background: linear-gradient(180deg, rgba(110, 168, 255, 0.1), #14171f 70%);
}
.project-main {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 8px;
  text-align: left;
}
.project-cover {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: #0e1016;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent-2);
  font-weight: 700;
}
.project-cover img, .project-cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.project-meta b {
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-meta span {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-ops {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  padding: 0 8px 8px;
}
.project-ops button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 8px;
}
.project-ops button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}
.project-assets {
  border-top: 1px solid var(--line);
  padding: 8px 8px 10px;
}
.asset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: start;
}
.rail-label { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; padding: 4px 2px 8px; }
.rail-empty { color: var(--muted); font-size: 12px; padding: 8px 4px; line-height: 1.5; grid-column: 1 / -1; }
.rail-recharge {
  margin-top: 8px;
  width: 100%;
  border: 1px solid rgba(232, 184, 109, 0.35);
  background: rgba(232, 184, 109, 0.1);
  color: var(--warm);
  border-radius: 14px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail-recharge b { font-size: 13px; }
.rail-recharge span { font-size: 10px; opacity: 0.85; }
.thumb {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #171a22;
  padding: 0;
}
.thumb.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.pending { color: var(--muted); font-size: 11px; }

.board-wrap {
  position: relative;
  overflow: hidden;
  background: #0c0d11;
}

.grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.07) 1px, transparent 1.2px);
  background-size: 28px 28px;
}

.board { position: absolute; inset: 0; cursor: grab; touch-action: none; }
.board.panning, .board.dragging-card { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }

.card {
  position: absolute;
  border-radius: 18px;
  background: #161922;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  overflow: hidden;
  user-select: none;
}
.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(110, 168, 255, 0.4), var(--shadow);
}
.card.is-ref {
  box-shadow: 0 0 0 2px rgba(232, 184, 109, 0.85), var(--shadow);
}

.card-media { width: 100%; height: calc(100% - 46px); background: #0b0c10; cursor: grab; }
.card img, .card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}
.card.pending .card-media {
  display: grid;
  place-items: center;
  color: var(--muted);
  background:
    linear-gradient(120deg, #161922 25%, #1d2230 37%, #161922 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.card-meta {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--muted);
}
.card-meta b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  gap: 6px;
}
.card:hover .card-actions, .card.selected .card-actions { display: flex; }

.handle {
  position: absolute;
  right: 8px;
  bottom: 52px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0;
}
.card.selected .handle { opacity: 1; }

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  text-align: center;
  color: var(--muted);
}
.empty h2 { margin: 0 0 8px; color: var(--ink); font-size: 28px; font-weight: 650; }
.empty p { margin: 0; line-height: 1.7; }

.float-tools {
  position: absolute;
  left: 14px;
  top: 14px;
  display: flex;
  gap: 6px;
  z-index: 5;
}

.zoom-read {
  min-width: 54px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
}

.dock {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(820px, calc(100vw - 420px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 12px 14px 12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  z-index: 6;
  transition: opacity 0.24s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.workspace.agent-on .dock {
  opacity: 0;
  transform: translateX(-50%) translateY(20px) scale(0.96);
  pointer-events: none;
}

#batch,
#duration,
#gen-type {
  appearance: none;
  background: #000;
  color: #fff;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  padding: 6px 28px 6px 12px;
  font-size: 12px;
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 14px) 11px, calc(100% - 9px) 11px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

#batch option,
#duration option,
#gen-type option {
  background: #000;
  color: #fff;
}

.modes, .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.model-row { margin: 2px 0 6px; }
.mode {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
}
.mode.active {
  background: rgba(110, 168, 255, 0.12);
  color: var(--accent-2);
  border-color: rgba(110, 168, 255, 0.45);
}

.prompt {
  width: 100%;
  min-height: 68px;
  resize: none;
  border: 0;
  background: transparent;
  outline: none;
  margin: 6px 0 8px;
  line-height: 1.5;
}

.row { justify-content: space-between; }
.ref-chip { color: var(--warm); font-size: 12px; }
.ref-chip.off { color: var(--muted); }

.inspector h3 { margin: 0 0 10px; font-size: 14px; }
.inspector .kv { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 0 0 12px; }
.inspector .kv b { color: var(--ink); font-weight: 550; display: block; margin-bottom: 4px; }
.inspector .stack { display: flex; flex-direction: column; gap: 8px; }

.guide {
  position: absolute;
  right: 318px;
  top: 14px;
  width: 340px;
  max-height: calc(100% - 220px);
  overflow: auto;
  background: #151820;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  z-index: 7;
}
.guide h3 { margin: 0 0 10px; }
.expand-panel { width: 380px; }
.expand-panel textarea {
  min-height: 180px;
  line-height: 1.55;
}
.guide-bill { margin: 0 0 10px; color: var(--warm); font-size: 12px; }
.gap { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.guide-knowns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}
.guide-known {
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 4px 8px;
}
.guide-slot { margin-bottom: 10px; }
.guide-slot span i {
  display: block;
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.guide-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}
.guide-chip:hover { border-color: rgba(110, 168, 255, 0.6); }

.task-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.62);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  z-index: 30;
  padding: 24px;
}
.task-modal {
  width: min(440px, 100%);
  background: #151820;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 24px 20px;
  box-shadow: var(--shadow);
}
.task-modal h3 { margin: 0 0 6px; font-size: 20px; }
.task-modal > p { margin: 0 0 18px; color: var(--muted); line-height: 1.6; font-size: 13px; }
.task-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.rail-recharge { text-align: left; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 6, 10, 0.92);
  display: grid;
  place-items: center;
  padding: 28px;
  cursor: zoom-out;
}
.lightbox img, .lightbox video {
  max-width: min(96vw, 1600px);
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  font-weight: 650;
}

.toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: #1c2230;
  color: var(--accent-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  z-index: 20;
}

.recharge {
  max-width: 720px;
  padding: 36px 28px;
}
.recharge h2 { margin: 0 0 8px; }
.packs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 20px 0 18px; }
.pack {
  border: 1px solid var(--line);
  background: #151820;
  border-radius: 16px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pack b { font-size: 18px; }
.pack span { color: var(--muted); font-size: 12px; }
.pack.active { border-color: var(--warm); background: rgba(232, 184, 109, 0.1); }

.admin { padding: 28px; overflow: auto; }
table { width: 100%; border-collapse: collapse; background: #151820; border-radius: 16px; overflow: hidden; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }

#file-input { display: none; }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .rail, .inspector { display: none; }
  .dock { width: calc(100vw - 20px); }
}
