/* ==========================================================================
   Lithium — dark green executor UI
   ========================================================================== */

:root {
  --bg: #000000;
  --bg-deep: #000000;
  --titlebar: #000000;
  --panel: #050505;
  --panel-2: #0a0a0a;
  --panel-3: #101010;
  --border: #1a1a1a;
  --border-soft: #111111;
  --border-strong: #262626;
  --text: #e9e9e9;
  --text-dim: #a0a0a0;
  --text-mute: #6e6e6e;
  --accent: #ffffff;
  --accent-bright: #ffffff;
  --accent-deep: #909090;
  --accent-soft: rgba(255, 255, 255, 0.09);
  --accent-line: rgba(255, 255, 255, 0.28);
  --danger: #e5615a;
  --warn: #e0b354;
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
  color: inherit;
}

input {
  font-family: inherit;
}

::selection {
  background: rgba(255, 255, 255, 0.22);
}

:focus-visible {
  outline: 1px solid var(--accent-line);
  outline-offset: 1px;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #1e1e1e transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #1e1e1e;
  background-clip: content-box;
  border: 2px solid transparent;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2e2e2e;
  background-clip: content-box;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   Shell
   ========================================================================== */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
}

.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
}

.main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  background: var(--bg);
}

/* ==========================================================================
   Title bar
   ========================================================================== */

.titlebar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 34px;
  flex: none;
  background: var(--titlebar);
  border-bottom: 1px solid var(--border-soft);
  user-select: none;
}

.titlebar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.brand-name {
  font-weight: 600;
  color: var(--text-dim);
}

.brand-mark {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.2));
}

.titlebar__title {
  color: var(--text-mute);
  font-size: 12px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.titlebar__dash {
  color: #3a3a3a;
  padding: 0 2px;
}

.window-controls {
  display: flex;
  justify-self: end;
  height: 100%;
}

.wc {
  display: grid;
  place-items: center;
  width: 44px;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-mute);
  cursor: default;
  transition: background 0.12s ease, color 0.12s ease;
}

.wc:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.wc--close:hover {
  background: #b83a34;
  color: #fff;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  flex: none;
  width: 238px;
  background: var(--panel);
  border-right: 1px solid var(--border-soft);
  min-height: 0;
}

.sidebar.is-hidden {
  display: none;
}

.rail {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 34px;
  padding: 0 7px;
  border-bottom: 1px solid var(--border-soft);
  flex: none;
}

.rail-spacer {
  flex: 1;
}

.rail-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text-mute);
  cursor: pointer;
}

.rail-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}

.rail-btn.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* Execute + Inject: plain glyphs, lit up while the action is in flight. */
.rail-btn--run,
.rail-btn--inject {
  color: var(--text-dim);
}

.rail-btn--run:hover,
.rail-btn--inject:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.rail-btn--run:active,
.rail-btn--inject:active {
  transform: translateY(0.5px);
}

.sidebar__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
}

.sidebar__panel[hidden] {
  display: none;
}

/* ==========================================================================
   Script Hub (ScriptBlox)
   ========================================================================== */

.view--hub {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(900px 320px at 82% -14%, rgba(255, 255, 255, 0.04), transparent 70%),
    var(--bg);
}

.hub {
  max-width: 1180px;
  padding: 30px 34px 40px;
}

.hub__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

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

.hub__intro .page-back {
  margin-bottom: 14px;
}

.hub h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f2f2f2;
}

.hub__tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hub__search {
  margin: 0;
  width: 272px;
}

.hub__status {
  margin: 0 0 12px;
  color: var(--text-mute);
  font-size: 12px;
}

.hub__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 10px;
}

.hub-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 13px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  transition: border-color 0.13s ease, background 0.13s ease;
}

.hub-card:hover {
  border-color: var(--border-strong);
  background: var(--panel-2);
}

.hub-card__title {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
}

.hub-card__game {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-mute);
  font-size: 11.5px;
}

.hub-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hub-card__stats {
  display: flex;
  gap: 12px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.hub-card__actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.hub-card__actions .btn {
  flex: 1;
}

.tag {
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-mute);
  font-size: 10.5px;
  line-height: 1.5;
}

.tag--ok {
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
}

.tag--warn {
  border-color: rgba(224, 179, 84, 0.4);
  color: var(--warn);
}

.tag--danger {
  border-color: rgba(229, 97, 90, 0.4);
  color: var(--danger);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 6px 6px 12px;
}

.panel-head__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

.panel-head__actions {
  display: flex;
  gap: 1px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text-mute);
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 27px;
  margin: 0 10px 10px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text-mute);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-field:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.07);
}

.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
  font-size: 12px;
}

.search-field input::placeholder {
  color: #555555;
}

/* Sections */
.section {
  border-top: 1px solid var(--border-soft);
  padding: 3px 0 5px;
}

.section-head {
  display: flex;
  align-items: center;
  padding: 3px 6px 3px 6px;
  border-radius: 4px;
}

.section-head:hover .section-actions {
  opacity: 1;
}

.section-toggle {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  min-width: 0;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.section-toggle:hover {
  color: var(--text);
}

.section-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-chevron {
  color: var(--text-mute);
  transition: transform 0.15s ease;
}

.section.is-collapsed .section-chevron {
  transform: rotate(-90deg);
}

.section.is-collapsed .file-list,
.section.is-collapsed .empty-state {
  display: none;
}

.section-actions {
  display: flex;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.file-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 4px 22px;
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.file-item[hidden] {
  display: none;
}

.file-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.file-item.is-active {
  color: #ffffff;
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

.file-icon {
  color: var(--text-mute);
}

.file-item.is-active .file-icon {
  color: var(--accent);
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 10px 4px 22px;
  font-size: 12px;
  color: var(--text-mute);
}

.empty-state[hidden] {
  display: none;
}

.empty-state__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state__actions {
  display: flex;
  gap: 2px;
  flex: none;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text-mute);
  font-size: 11.5px;
  cursor: pointer;
}

.mini-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   Tabs
   ========================================================================== */

.tabbar {
  display: flex;
  align-items: stretch;
  flex: none;
  height: 37px;
  background: var(--panel);
  border-bottom: 1px solid var(--border-soft);
  padding-right: 8px;
  min-width: 0;
}

.tabs {
  display: flex;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px 0 12px;
  max-width: 210px;
  border-right: 1px solid var(--border-soft);
  color: var(--text-mute);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.tab:hover {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.035);
}

.tab.is-active {
  color: var(--text);
  background: var(--bg);
}

.tab.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.tab.is-active .icon {
  color: var(--accent);
}

.tab__label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.38);
}

.tab__close {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--text-mute);
  opacity: 0;
  cursor: pointer;
  flex: none;
}

.tab:hover .tab__close,
.tab.is-active .tab__close {
  opacity: 1;
}

.tab__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.tab-add {
  display: grid;
  place-items: center;
  width: 30px;
  flex: none;
  border: 0;
  background: none;
  color: var(--text-mute);
  cursor: pointer;
}

.tab-add:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.07);
}

.tabbar__right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding-left: 8px;
  flex: none;
}

/* Live instance state + inject, sitting beside the Run action. */
.instance-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 9px;
  border-radius: 5px;
  color: var(--text-mute);
  font-size: 11.5px;
  white-space: nowrap;
  user-select: none;
}

.instance-pill .dot {
  width: 6px;
  height: 6px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.icon-btn.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}

.btn:hover {
  color: var(--text);
  background: var(--panel-3);
  border-color: #303030;
}

.btn:active {
  transform: translateY(0.5px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn.is-active {
  border-color: var(--accent-line);
  color: var(--accent);
}

.btn--primary {
  border-color: transparent;
  background: linear-gradient(180deg, #f2f2f2, #c9c9c9);
  color: #0a0a0a;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 18px -8px rgba(255, 255, 255, 0.18);
}

.btn--primary:hover {
  background: linear-gradient(180deg, #ffffff, #d6d6d6);
  color: #000000;
  border-color: transparent;
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--border-strong);
  background: var(--panel-2);
}

.btn--sm {
  height: 27px;
  padding: 0 10px;
  font-size: 12px;
}

/* ==========================================================================
   Views
   ========================================================================== */

.views {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

/* Full-window pages: Settings and the Script Hub hide the app chrome. */
.app.is-immersive .sidebar,
.app.is-immersive .tabbar,
.app.is-immersive .terminal,
.app.is-immersive .statusbar {
  display: none;
}

.view--home {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(900px 320px at 18% -14%, rgba(255, 255, 255, 0.04), transparent 70%),
    var(--bg);
}

.home {
  max-width: 1080px;
  padding: 38px 44px 40px;
}

.home__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.home__brand img {
  border-radius: 6px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.14));
}

.home__intro {
  min-width: 0;
}

.home__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}

.home h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f2f2f2;
}

.badge {
  padding: 1px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.sub {
  margin: 7px 0 0;
  color: var(--text-mute);
  font-size: 12.5px;
}

.home__actions {
  display: flex;
  gap: 9px;
  padding-top: 2px;
}

/* Checklist */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
}

.step__rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.step:not(:last-child) .step__rail::after {
  content: "";
  position: absolute;
  top: 26px;
  bottom: -28px;
  left: 9.5px;
  width: 1px;
  background: var(--border-strong);
}

.step__node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.step.is-done .step__node {
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.step.is-done .step__node:hover {
  background: rgba(255, 255, 255, 0.14);
}

.step.is-pending .step__node {
  border: 1.5px solid #2c2c2c;
}

.step.is-pending .step__node:hover {
  border-color: var(--accent-line);
}

.step.is-pending .step__node .icon {
  display: none;
}

.step__title {
  margin: 0 0 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.step.is-pending .step__title {
  color: var(--text-dim);
}

.step.is-pending .step__body {
  padding-bottom: 2px;
}

.step__desc {
  margin: -3px 0 0;
  color: var(--text-mute);
  font-size: 12.5px;
}

.path-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
}

.path-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text-mute);
  cursor: text;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.path-field:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.07);
}

.path-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

/* Chips */
.chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 12px;
  transition: opacity 0.15s ease;
}

.chip .icon {
  color: var(--accent);
}

.chip__ver {
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.chip.is-muted {
  opacity: 0.45;
}

.chip.is-muted .icon {
  color: var(--text-mute);
}

.btn.is-armed {
  border-color: var(--danger);
  color: var(--danger);
}

/* ==========================================================================
   Settings
   ========================================================================== */

.view--settings {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(900px 320px at 18% -14%, rgba(255, 255, 255, 0.04), transparent 70%),
    var(--bg);
}

.settings {
  max-width: 1040px;
  padding: 20px 30px 36px;
}

.settings__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px 0 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}

.page-back .icon {
  color: var(--text-mute);
}

.page-back:hover {
  border-color: var(--border-strong);
  background: var(--panel-2);
  color: var(--text);
}

.page-back:hover .icon {
  color: var(--text);
}

.settings__body {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-nav__search {
  margin: 0;
}

.settings-nav__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}

.settings-nav__item .icon {
  color: var(--text-mute);
}

.settings-nav__item:hover {
  background: var(--panel-2);
  color: var(--text);
}

.settings-nav__item.is-active {
  border-color: var(--border-strong);
  background: var(--panel-2);
  color: #ffffff;
}

.settings-nav__item.is-active .icon {
  color: var(--text);
}

.settings-nav__reset {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 31px;
  margin-top: 2px;
  border: 1px solid rgba(229, 97, 90, 0.32);
  border-radius: 6px;
  background: rgba(229, 97, 90, 0.07);
  color: var(--danger);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.13s ease, border-color 0.13s ease;
}

.settings-nav__reset:hover {
  border-color: rgba(229, 97, 90, 0.6);
  background: rgba(229, 97, 90, 0.14);
}

.settings-panels {
  min-width: 0;
}

.settings-panel[hidden],
.settings-card[hidden],
.setting-row[hidden] {
  display: none;
}

.settings-card {
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
}

.settings-card__head {
  padding: 13px 0 11px;
}

.settings-card__title {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.settings-card__desc {
  margin: 3px 0 0;
  color: var(--text-mute);
  font-size: 11.5px;
}

.settings-card .setting-row {
  padding: 12px 0;
  border-top: 1px solid var(--border-soft);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0;
}

.setting-row__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.setting-row__label {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
}

.setting-row__desc {
  color: var(--text-mute);
  font-size: 11.5px;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.setting-unit {
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Switch */
.switch {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 32px;
  height: 18px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch__track {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--panel-2);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-mute);
  transition: transform 0.15s ease, background 0.15s ease;
}

.switch input:checked + .switch__track {
  border-color: rgba(255, 255, 255, 0.38);
  background: var(--accent-soft);
}

.switch input:checked + .switch__track::after {
  transform: translateX(14px);
  background: var(--accent);
}

.switch input:focus-visible + .switch__track {
  outline: 1px solid var(--accent-line);
  outline-offset: 2px;
}

/* Inputs */
.number-input,
.select {
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.number-input {
  width: 58px;
  padding: 0 8px;
}

.select {
  min-width: 108px;
  padding: 0 8px;
}

.select--wide {
  min-width: 160px;
}

.number-input:focus,
.select:focus {
  border-color: var(--accent-line);
  outline: none;
}

.settings__saved {
  margin-left: auto;
  color: var(--text-mute);
  font-size: 11.5px;
}

@media (max-width: 760px) {
  .settings {
    padding: 16px 18px 28px;
  }

  .settings__body {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .settings-nav {
    position: static;
  }
}

/* ==========================================================================
   Editor
   ========================================================================== */

.view--editor {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.editor {
  display: flex;
  height: 100%;
  background: var(--bg);
  font-family: var(--editor-font-family, var(--font-mono));
  font-size: var(--editor-font-size, 12.5px);
  line-height: var(--editor-line-height, 20px);
}

.gutter {
  flex: none;
  width: 48px;
  padding: 12px 0 12px 0;
  overflow: hidden;
  border-right: 1px solid var(--border-soft);
  background: var(--panel);
  color: #4a4a4a;
  font-size: calc(var(--editor-font-size, 12.5px) - 1px);
  line-height: var(--editor-line-height, 20px);
  text-align: right;
  user-select: none;
}

.gutter__inner {
  padding-right: 10px;
  white-space: pre;
  will-change: transform;
}

.editor__code {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.highlight,
#code {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 12px 16px;
  font: inherit;
  line-height: var(--editor-line-height, 20px);
  white-space: pre;
  tab-size: 4;
  border: 0;
}

.highlight {
  overflow: hidden;
  color: var(--text);
  pointer-events: none;
}

#code {
  overflow: auto;
  resize: none;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: var(--accent);
  -webkit-text-fill-color: transparent;
}

#code::selection {
  background: rgba(255, 255, 255, 0.18);
  -webkit-text-fill-color: transparent;
}

.tok-com {
  color: #5a5a5a;
  font-style: italic;
}

.tok-str {
  color: #a8a8a8;
}

.tok-num {
  color: #d0d0d0;
}

.tok-kw {
  color: var(--accent);
}

.tok-glob {
  color: #b0b0b0;
}

.tok-fn {
  color: #dcdcdc;
}

/* ==========================================================================
   Terminal
   ========================================================================== */

.terminal {
  display: flex;
  flex-direction: column;
  flex: none;
  height: 208px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  min-height: 0;
}

.terminal.is-hidden {
  display: none;
}

.terminal.is-expanded {
  height: 58%;
}

.terminal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 32px;
  flex: none;
  padding: 0 7px 0 12px;
  border-bottom: 1px solid var(--border-soft);
}

.terminal__title {
  display: flex;
  align-items: center;
  gap: 1px;
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}

.terminal__actions {
  display: flex;
  align-items: center;
  gap: 1px;
}

.search-field--xs {
  height: 22px;
  margin: 0 6px 0 0;
  padding: 0 7px;
  border-radius: 4px;
}

.search-field--xs input {
  font-size: 11px;
}

.terminal__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 12px;
  background: var(--bg-deep);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.75;
}

.term-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.term-line[hidden] {
  display: none;
}

.term-line--muted {
  color: var(--text-mute);
}

.term-line--ok {
  color: var(--accent);
}

.term-line--err {
  color: var(--danger);
}

.terminal__input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  flex: none;
  padding: 0 12px;
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
}

.term-prompt {
  color: var(--accent);
  font-size: 11.5px;
  white-space: nowrap;
}

#term-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

#term-input::placeholder {
  color: #4a4a4a;
}

/* ==========================================================================
   Status bar
   ========================================================================== */

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  height: 24px;
  padding: 0 6px;
  border-top: 1px solid var(--border-soft);
  background: var(--panel);
  color: var(--text-mute);
  font-size: 11px;
  user-select: none;
}

.statusbar__left,
.statusbar__right {
  display: flex;
  align-items: center;
  gap: 1px;
}

.sb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 19px;
  padding: 0 7px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: inherit;
  font-size: inherit;
  cursor: default;
}

button.sb-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.sb-item--brand {
  color: var(--accent);
  gap: 5px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(229, 97, 90, 0.12);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.dot--idle {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(224, 179, 84, 0.12);
}

.dot--ok {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .home {
    padding: 30px 26px 30px;
  }

  .sidebar {
    width: 210px;
  }

  .home__head {
    margin-bottom: 26px;
  }
}

@media (max-width: 780px) {
  .sidebar {
    width: 186px;
  }

  .titlebar__title {
    font-size: 11px;
  }

  .search-field--xs {
    display: none;
  }
}

/* ==========================================================================
   Boot / loading screen
   ========================================================================== */

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background:
    radial-gradient(58% 52% at 50% 44%, rgba(124, 92, 255, 0.1), transparent 70%),
    radial-gradient(95% 85% at 50% 42%, #141417 0%, #09090b 58%, #040405 100%);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.boot.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: bootIn 0.9s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.boot__lockup {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 14px);
}

.boot__mark {
  display: block;
  width: clamp(72px, 8.5vw, 108px);
  height: auto;
  filter: drop-shadow(0 0 24px rgba(139, 92, 246, 0.36));
  animation: bootFloat 5.5s ease-in-out infinite;
}

.boot__word {
  font-size: clamp(40px, 4.8vw, 58px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
  background: linear-gradient(100deg, #9a9aa1 0%, #f5f5f7 32%, #ffffff 50%, #f5f5f7 68%, #9a9aa1 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: bootShine 3.2s ease-in-out infinite alternate;
}

.boot__bar {
  position: relative;
  overflow: hidden;
  width: 180px;
  height: 2px;
  margin-top: 30px;
  border-radius: 2px;
  background: #1c1c20;
}

.boot__bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45%;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #f2edff 45%, #b79bff 72%, rgba(255, 255, 255, 0));
  animation: bootSlide 1.3s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.boot__status {
  margin-top: 14px;
  color: #7a7a80;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  animation: bootBreathe 2.4s ease-in-out infinite;
}

@keyframes bootIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

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

@keyframes bootShine {
  from { background-position: 100% 50%; }
  to   { background-position: 0% 50%; }
}

@keyframes bootSlide {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(340%); }
}

@keyframes bootBreathe {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .boot__inner,
  .boot__mark,
  .boot__word,
  .boot__bar span,
  .boot__status {
    animation: none;
  }

  .boot__mark {
    filter: none;
  }

  .boot__bar span {
    width: 100%;
    opacity: 0.35;
  }
}

/* ==========================================================================
   Toast notifications
   ========================================================================== */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 38px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
  max-width: 340px;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--panel-3);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  font-size: 12px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px);
  animation: toastIn 0.18s ease forwards;
}

.toast.is-leaving {
  animation: toastOut 0.2s ease forwards;
}

.toast--ok {
  border-left-color: var(--accent);
}

.toast--warn {
  border-left-color: var(--warn);
}

.toast--err {
  border-left-color: var(--danger);
}

.toast__mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.toast--warn .toast__mark {
  background: rgba(224, 179, 84, 0.14);
  color: var(--warn);
}

.toast--err .toast__mark {
  background: rgba(229, 97, 90, 0.14);
  color: var(--danger);
}

.toast__text {
  flex: 1;
  line-height: 1.35;
}

.toast__close {
  flex: none;
  padding: 2px;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--text-mute);
  cursor: pointer;
}

.toast__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

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

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px); }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-leaving {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Li element-tile logo: flat, no glow */
.brand-mark,.home__brand img,.boot__mark{filter:none!important}
.home__brand img{border-radius:0}
.boot__mark{height:auto}
.boot{background:#000!important}
.boot__bar span{background:#fff!important;box-shadow:none!important}
@media (max-width:760px){html,body{overflow-x:hidden}}
