/* ============ Tokens ============ */
:root {
  --bg: oklch(0.18 0.015 265);
  --bg-2: oklch(0.14 0.018 265);
  --bg-3: oklch(0.22 0.015 265);
  --fg: oklch(0.96 0.005 265);
  --fg-dim: oklch(0.72 0.01 265);
  --fg-faint: oklch(0.52 0.012 265);
  --line: oklch(1 0 0 / 0.08);
  --line-strong: oklch(1 0 0 / 0.14);
  --glass: oklch(0.22 0.02 265 / 0.55);
  --glass-strong: oklch(0.18 0.02 265 / 0.72);
  --glass-contrast: oklch(1 0 0 / 0.04);
  --accent: oklch(0.72 0.17 275);
  --accent-soft: oklch(0.72 0.17 275 / 0.18);
  --good: oklch(0.78 0.15 155);
  --warn: oklch(0.82 0.15 75);
  --bad: oklch(0.68 0.2 25);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-window: 0 30px 80px -20px oklch(0 0 0 / 0.5), 0 0 0 1px oklch(1 0 0 / 0.06);
  --shadow-float: 0 12px 40px -12px oklch(0 0 0 / 0.4);
  --font-ui: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --density-y: 10px;
  --density-x: 12px;
  --icon-size: 40px;
  --dur: 0.22s;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="light"] {
  --bg: oklch(0.96 0.008 265);
  --bg-2: oklch(0.93 0.01 265);
  --bg-3: oklch(0.88 0.012 265);
  --fg: oklch(0.2 0.015 265);
  --fg-dim: oklch(0.42 0.015 265);
  --fg-faint: oklch(0.58 0.012 265);
  --line: oklch(0 0 0 / 0.08);
  --line-strong: oklch(0 0 0 / 0.14);
  --glass: oklch(1 0 0 / 0.55);
  --glass-strong: oklch(1 0 0 / 0.72);
  --glass-contrast: oklch(0 0 0 / 0.03);
  --shadow-window: 0 30px 80px -20px oklch(0 0 0 / 0.25), 0 0 0 1px oklch(0 0 0 / 0.06);
  --shadow-float: 0 12px 40px -12px oklch(0 0 0 / 0.2);
}

[data-density="compact"] {
  --density-y: 6px;
  --density-x: 8px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  color: var(--fg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

/* ============ Desktop ============ */
.desktop {
  position: fixed;
  inset: 0;
  background: var(--bg);
  overflow: hidden;
}
.wallpaper {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 0.6s ease;
}
.wallpaper-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg,
    oklch(0.12 0.05 275 / 0.3),
    oklch(0.08 0.03 265 / 0.5));
  pointer-events: none;
}
[data-theme="light"] .wallpaper-tint {
  background: linear-gradient(160deg,
    oklch(1 0 0 / 0.1),
    oklch(0.9 0.02 265 / 0.15));
}

/* ============ Top bar ============ */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 32px;
  backdrop-filter: blur(30px) saturate(1.6);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  background: var(--glass);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 14px;
  font-size: 12.5px;
  z-index: 100;
}
.topbar .brand {
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 7px;
}
.topbar .brand-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.topbar .menu-item {
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--fg-dim);
}
.topbar .menu-item:hover { background: var(--glass-contrast); color: var(--fg); }
.topbar .spacer { flex: 1; }
.topbar .status-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-dim);
}
.topbar .status-chip:hover { background: var(--glass-contrast); color: var(--fg); }
.topbar .status-chip.mono { font-family: var(--font-mono); font-size: 11.5px; }
.topbar .theme-toggle {
  padding: 3px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar .theme-toggle:hover { background: var(--glass-contrast); }

/* ============ Sidebar (launcher) ============ */
.sidebar {
  position: absolute;
  top: 32px;
  bottom: 0;
  width: 260px;
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  background: var(--glass-strong);
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 80;
  transition: transform var(--dur) var(--ease);
}
.sidebar.pos-bottom { position: absolute; top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 76px; flex-direction: row; padding: 10px 16px; border-right: 0; border-top: 1px solid var(--line); align-items: center; gap: 6px; }
.sidebar.pos-top { position: absolute; top: 32px; left: 0; right: 0; width: 100%; height: 76px; flex-direction: row; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); align-items: center; gap: 6px; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
}
.sidebar.pos-bottom .sidebar-header, .sidebar.pos-top .sidebar-header { display: none; }

.sidebar-add {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
}
.sidebar-add:hover { background: var(--accent); color: white; }

.app-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; flex: 1; }
.sidebar.pos-bottom .app-list, .sidebar.pos-top .app-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; flex: 1; justify-content: center; }

.app-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--density-y) var(--density-x);
  border-radius: 10px;
  cursor: pointer;
  color: var(--fg);
  position: relative;
  transition: background 0.15s;
}
.app-row:hover { background: var(--glass-contrast); }
.app-row.running::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
}
.sidebar.pos-bottom .app-row, .sidebar.pos-top .app-row { flex-direction: column; gap: 2px; padding: 4px 8px; min-width: 64px; }
.sidebar.pos-bottom .app-row.running::before, .sidebar.pos-top .app-row.running::before { left: 50%; top: auto; bottom: 0; transform: translateX(-50%); width: 18px; height: 3px; }

.app-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  border-radius: calc(var(--icon-size) * 0.26);
  display: grid;
  place-items: center;
  font-size: calc(var(--icon-size) * 0.5);
  background: linear-gradient(135deg, var(--accent), oklch(from var(--accent) calc(l - 0.15) c h));
  color: white;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px oklch(0 0 0 / 0.2), inset 0 1px 0 oklch(1 0 0 / 0.2);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-meta .name { font-weight: 500; font-size: 13.5px; letter-spacing: -0.01em; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.app-meta .desc { font-size: 11.5px; color: var(--fg-faint); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.sidebar.pos-bottom .app-meta, .sidebar.pos-top .app-meta { display: none; }

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online { background: var(--good); box-shadow: 0 0 6px oklch(from var(--good) l c h / 0.8); }
.status-dot.offline { background: var(--bad); }
.status-dot.checking { background: var(--warn); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.sidebar-footer {
  padding: 10px 8px 4px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--fg-faint);
  font-family: var(--font-mono);
}
.sidebar.pos-bottom .sidebar-footer, .sidebar.pos-top .sidebar-footer { display: none; }

/* ============ Desktop content area ============ */
.canvas {
  position: absolute;
  top: 32px;
  left: 260px;
  right: 0;
  bottom: 0;
  overflow: hidden;
}
.sidebar.pos-bottom ~ .canvas { left: 0; bottom: 76px; }
.sidebar.pos-top ~ .canvas { left: 0; top: calc(32px + 76px); }

/* ============ Widgets ============ */
.widgets {
  position: absolute;
  top: 32px;
  right: 16px;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  z-index: 50;
  transform-origin: top right;
  transform: translateY(-8px) scale(0.98);
  opacity: 0;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.widgets.open {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.widgets.open > * { pointer-events: auto; }
.widgets:not(.open) { pointer-events: none; }
.widgets:not(.open) > * { pointer-events: none; }

.topbar .widgets-trigger {
  padding: 3px 9px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.topbar .widgets-trigger:hover,
.topbar .widgets-trigger.active { background: var(--glass-contrast); color: var(--fg); }
.topbar .widgets-trigger .spark-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.widget {
  backdrop-filter: blur(30px) saturate(1.6);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  color: var(--fg);
  box-shadow: var(--shadow-float);
}
.widget .wlabel {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.widget .wlabel .tag { font-family: var(--font-mono); text-transform: none; letter-spacing: 0; }

.widget-clock .time {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.widget-clock .date {
  margin-top: 6px;
  color: var(--fg-dim);
  font-size: 13px;
}

.widget-metrics .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.metric { }
.metric .mlabel { font-size: 11px; color: var(--fg-faint); display: flex; justify-content: space-between; }
.metric .mval { font-family: var(--font-mono); font-size: 18px; letter-spacing: -0.02em; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.bar {
  height: 4px;
  background: var(--glass-contrast);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
}
.bar-fill.warn { background: var(--warn); }
.bar-fill.bad { background: var(--bad); }

.widget-net .net-body { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.net-stat .label { font-size: 11px; color: var(--fg-faint); }
.net-stat .val { font-family: var(--font-mono); font-size: 16px; font-variant-numeric: tabular-nums; }
.sparkline { flex: 1; height: 42px; }

.widget-weather .weather-body { display: flex; align-items: center; justify-content: space-between; }
.weather-temp { font-family: var(--font-mono); font-size: 36px; letter-spacing: -0.03em; font-weight: 400; }
.weather-cond { text-align: right; }
.weather-cond .c { font-size: 13px; color: var(--fg-dim); }
.weather-cond .loc { font-size: 11px; color: var(--fg-faint); margin-top: 2px; }

.widget-docker .docker-list { display: flex; flex-direction: column; gap: 6px; }
.docker-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-family: var(--font-mono); }
.docker-row .ring { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.docker-row .ring.up { background: var(--good); box-shadow: 0 0 5px var(--good); }
.docker-row .ring.down { background: var(--fg-faint); }
.docker-row .name { flex: 1; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.docker-row .img { color: var(--fg-faint); font-size: 11px; }

/* ============ Windows ============ */
.window {
  position: absolute;
  background: var(--glass-strong);
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-window);
  overflow: hidden;
  min-width: 360px;
  min-height: 240px;
  transition: box-shadow 0.2s;
}
.window.snapping { animation: snap-in 0.2s ease; }
@keyframes snap-in { from { opacity: 0.7; } to { opacity: 1; } }
.window.minimized { display: none; }
.window.fullscreen { border-radius: 0; }

.window-chrome {
  height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  cursor: grab;
  background: linear-gradient(to bottom, oklch(1 0 0 / 0.03), transparent);
}
.window-chrome:active { cursor: grabbing; }

.traffic { display: flex; gap: 7px; align-items: center; }
.traffic .dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  color: oklch(0 0 0 / 0.5);
  font-weight: 700;
}
.traffic .dot.close { background: oklch(0.68 0.2 25); }
.traffic .dot.min { background: oklch(0.84 0.15 90); }
.traffic .dot.max { background: oklch(0.78 0.15 155); }
.traffic .dot span { opacity: 0; transition: opacity 0.15s; }
.traffic:hover .dot span { opacity: 1; }

.window-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.window-title .wt-icon { width: 16px; height: 16px; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.window-title .wt-icon img { width: 100%; height: 100%; object-fit: cover; }

.window.focused .window-title { color: var(--fg); }
.window.focused .window-chrome { background: linear-gradient(to bottom, oklch(1 0 0 / 0.05), transparent); }
.window:not(.focused) { opacity: 0.92; }
.window:not(.focused) .traffic .dot { background: oklch(0.6 0 0 / 0.35); }

.window-tabs {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  background: var(--glass-contrast);
  overflow-x: auto;
}
.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--fg-dim);
  max-width: 160px;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { background: var(--glass-contrast); color: var(--fg); }
.tab.active { background: var(--glass); color: var(--fg); box-shadow: 0 0 0 1px var(--line); }
.tab .tab-icon { width: 14px; height: 14px; border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.tab .tab-icon img { width: 100%; height: 100%; object-fit: cover; }
.tab .tab-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.tab .tab-close {
  width: 16px; height: 16px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--fg-faint);
  opacity: 0;
}
.tab:hover .tab-close, .tab.active .tab-close { opacity: 1; }
.tab .tab-close:hover { background: var(--line-strong); color: var(--fg); }
.tab-add {
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--fg-faint);
  font-size: 14px;
}
.tab-add:hover { background: var(--glass-contrast); color: var(--fg); }

.window-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
}
.window-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: white;
}
[data-theme="dark"] .window-body iframe { background: var(--bg-2); }

.window-resize {
  position: absolute;
  user-select: none;
}
.resize-e { right: 0; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.resize-s { left: 0; right: 0; bottom: 0; height: 6px; cursor: ns-resize; }
.resize-se { right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; }
.resize-w { left: 0; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.resize-n { left: 0; right: 0; top: 0; height: 6px; cursor: ns-resize; }
.resize-sw { left: 0; bottom: 0; width: 14px; height: 14px; cursor: nesw-resize; }
.resize-ne { right: 0; top: 0; width: 14px; height: 14px; cursor: nesw-resize; }
.resize-nw { left: 0; top: 0; width: 14px; height: 14px; cursor: nwse-resize; }

/* Iframe fallback */
.iframe-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  background:
    repeating-linear-gradient(45deg, transparent 0 24px, oklch(1 0 0 / 0.02) 24px 48px),
    var(--bg-2);
  gap: 14px;
  color: var(--fg-dim);
}
.iframe-fallback .fb-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), oklch(from var(--accent) calc(l - 0.2) c h));
  color: white;
  font-size: 28px;
  font-weight: 600;
  box-shadow: 0 4px 20px oklch(from var(--accent) l c h / 0.3);
  overflow: hidden;
}
.iframe-fallback .fb-icon img { width: 100%; height: 100%; object-fit: cover; }
.iframe-fallback h3 { margin: 0; color: var(--fg); font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.iframe-fallback p { margin: 0; font-size: 13px; max-width: 380px; line-height: 1.5; }
.iframe-fallback code { font-family: var(--font-mono); background: var(--glass-contrast); padding: 2px 6px; border-radius: 4px; font-size: 12px; color: var(--fg); }
.iframe-fallback .fb-btns { display: flex; gap: 8px; margin-top: 6px; }
.iframe-fallback button {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 500;
  transition: opacity 0.15s;
}
.iframe-fallback button:hover { opacity: 0.85; }
.iframe-fallback button.secondary { background: var(--glass-contrast); color: var(--fg); }

/* Loader */
.iframe-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  z-index: 2;
  pointer-events: none;
}
.loader-spin {
  width: 24px; height: 24px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.45);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 1000;
  animation: fade 0.2s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 460px;
  background: var(--glass-strong);
  backdrop-filter: blur(50px) saturate(1.8);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-window);
  animation: pop 0.22s var(--ease);
}
@keyframes pop { from { transform: scale(0.96); opacity: 0.4; } }
.modal h2 { margin: 0 0 4px; font-size: 19px; font-weight: 500; letter-spacing: -0.02em; }
.modal .sub { color: var(--fg-dim); font-size: 13px; margin-bottom: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-faint); }
.field input, .field textarea {
  background: var(--glass-contrast);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  outline: 0;
  transition: border 0.15s;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 60px; font-family: inherit; }
.icon-row { display: flex; gap: 10px; align-items: center; }
.icon-preview {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), oklch(from var(--accent) calc(l - 0.15) c h));
  color: white;
  font-size: 24px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}
.icon-preview img { width: 100%; height: 100%; object-fit: cover; }
.icon-input-stack { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.icon-input-stack input { padding: 7px 10px; font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.btn {
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: var(--glass-contrast); color: var(--fg); }
.btn-ghost:hover { background: var(--line-strong); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: oklch(from var(--bad) l c h / 0.12); }

/* Context menu */
.ctx-menu {
  position: fixed;
  background: var(--glass-strong);
  backdrop-filter: blur(30px) saturate(1.6);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 4px;
  min-width: 160px;
  box-shadow: var(--shadow-float);
  z-index: 999;
  font-size: 13px;
}
.ctx-item {
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.ctx-item:hover { background: var(--accent); color: white; }
.ctx-item.danger { color: var(--bad); }
.ctx-item.danger:hover { background: var(--bad); color: white; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 2px; }

/* Empty state */
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--fg-faint);
  gap: 10px;
  pointer-events: none;
}
.empty-state .e-icon {
  width: 80px; height: 80px;
  border-radius: 24px;
  border: 2px dashed var(--line-strong);
  display: grid; place-items: center;
  font-size: 36px;
  color: var(--fg-faint);
}
.empty-state h2 { margin: 8px 0 0; font-size: 18px; font-weight: 500; color: var(--fg-dim); letter-spacing: -0.01em; }
.empty-state p { margin: 0; font-size: 13px; max-width: 300px; text-align: center; }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-faint); }
