/* ============================================================
   VU Studio — dark console UI
   ============================================================ */

:root {
  --bg: #0d0d0d;
  --sidebar: #181818;
  --surface: #131313;
  --surface-2: #1c1c1c;
  --surface-3: #232323;
  --hover: #212121;
  --active: #2e2e2e;

  --line: #2a2a2a;
  --line-soft: #202020;

  --text: #f2f2f2;
  --text-2: #b4b4b4;
  --text-3: #8f8f8f;
  --text-4: #6e6e6e;

  --accent: #10a37f;
  --accent-2: #0e8f70;
  --blue: #6a9dff;
  --pink: #f0568f;
  --amber-bg: #3b3208;
  --amber-line: #52470c;
  --amber-btn: #7a6710;
  --amber-btn-h: #8d780f;
  --amber-text: #f3e2a3;
  --danger: #f0565b;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;

  --sidebar-w: 232px;
  --font: "Inter", "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@supports (font-variation-settings: normal) {
  html { font-family: "Inter var", var(--font); }
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0; }
button { font-family: inherit; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a.btn:hover { text-decoration: none; }

.ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.ic.dim { color: var(--text-4); }
.hidden { display: none !important; }

/* ============ LAYOUT ============ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--sidebar);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  padding: 10px 8px 10px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  overflow: hidden;
  transition: width 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 26px 34px 80px;
  max-width: 1180px;
  transition: margin-left 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar .nav-label,
.sidebar .org-name,
.sidebar .search-label,
.sidebar .org-chev,
.sidebar .user-meta,
.sidebar .nav-count,
.search-box kbd {
  transition: opacity 0.14s ease;
  white-space: nowrap;
}

.layout.collapsed .sidebar { width: 56px; }
.layout.collapsed .main { margin-left: 56px; }

.layout.collapsed .nav-label,
.layout.collapsed .org-name,
.layout.collapsed .org-chev,
.layout.collapsed .search-label,
.layout.collapsed .search-box kbd,
.layout.collapsed .nav-count,
.layout.collapsed .user-meta {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.layout.collapsed .promo { display: none; }

/* Без gap и авто-отступов иконка встаёт ровно по центру колонки 56px. */
.layout.collapsed .nav-item,
.layout.collapsed .search-box,
.layout.collapsed .user-row {
  justify-content: center;
  gap: 0;
  padding-left: 0;
  padding-right: 0;
  position: relative;
}
.layout.collapsed .nav-count { margin-left: 0; }
.layout.collapsed .nav-dot {
  position: absolute;
  top: 7px;
  right: 15px;
  margin-left: 0;
  width: 6px;
  height: 6px;
  box-shadow: 0 0 0 2px var(--sidebar);
}
.layout.collapsed .search-box { margin-bottom: 10px; }
.layout.collapsed .sidebar-top { flex-direction: column; gap: 4px; padding-bottom: 8px; }
.layout.collapsed .org-switch { justify-content: center; width: 100%; padding: 0; }
.layout.collapsed .brand-menu { top: 40px; left: 62px; width: 218px; }
.layout.collapsed .nav { scrollbar-width: none; }
.layout.collapsed .nav::-webkit-scrollbar { width: 0; }

/* ============ SIDEBAR ============ */
.sidebar-top {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 2px 10px;
}

.org-switch {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.org-switch:hover { background: var(--hover); }
.org-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.brand-mark {
  width: 22px;
  height: 22px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: linear-gradient(145deg, var(--accent) 0%, #0b6f57 100%);
  color: #fff;
}
.layout.collapsed .brand-mark { margin: 0 auto; }

.icon-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 9px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
}
.search-box:hover { border-color: #383838; color: var(--text-2); }
.search-label { flex: 1; text-align: left; }

kbd {
  font-family: var(--font);
  font-size: 10.5px;
  color: var(--text-4);
  background: var(--surface-3);
  border-radius: 4px;
  padding: 2px 5px;
  line-height: 1;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* overflow-x иначе вычисляется в auto и рисует горизонтальный скроллбар */
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.sidebar:hover .nav::-webkit-scrollbar-thumb { background: var(--surface-3); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 450;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--active); color: #fff; font-weight: 500; }
.nav-item .ic { color: inherit; opacity: 0.9; }

.nav-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
}
.nav-dot {
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e0b341;
  flex: none;
}

/* brand dropdown */
.brand-menu {
  /* fixed, а не absolute: sidebar обрезает содержимое по overflow: hidden */
  position: fixed;
  top: 44px;
  left: 8px;
  width: calc(var(--sidebar-w) - 16px);
  z-index: 60;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  padding: 5px;
  animation: pop 0.14s ease;
}
.brand-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.brand-menu button:hover { background: var(--hover); color: var(--text); }
.brand-menu button kbd { margin-left: auto; }
.brand-menu-sep { height: 1px; background: var(--line); margin: 5px 2px; }

@keyframes pop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.sidebar-bottom { padding-top: 8px; }

.promo {
  position: relative;
  border: 1px solid var(--amber-line);
  background: var(--amber-bg);
  border-radius: var(--r-md);
  padding: 11px 12px 12px;
  margin-bottom: 8px;
}
.promo strong { display: block; font-size: 12.5px; color: #fff; margin-bottom: 3px; }
.promo p { font-size: 11.5px; color: var(--amber-text); margin-bottom: 9px; line-height: 1.4; }
.promo-close {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--amber-text);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.7;
}
.promo-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); }

.user-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  border-top: 1px solid var(--line-soft);
  margin-top: 4px;
  padding-top: 11px;
}
.avatar {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-meta strong { font-size: 12.5px; font-weight: 500; }
.user-meta small { font-size: 11px; color: var(--text-4); }

/* ============ PAGES ============ */
.page { display: none; animation: fade 0.18s ease; }
.page.active { display: block; }

@keyframes fade {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
  min-height: 38px;
}
.page-head h1 { font-size: 30px; letter-spacing: -0.03em; }

.lede { color: var(--text-3); font-size: 13.5px; margin-bottom: 22px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 10px;
}
.section-head h2 { font-size: 15px; font-weight: 600; }
.col-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; }

.dismiss {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--r-sm);
}
.dismiss:hover { background: var(--hover); color: var(--text); }

/* ============ SEGMENTED ============ */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.segmented button {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.segmented button:hover { color: var(--text); }
.segmented button.on { background: var(--active); color: #fff; }

/* ============ GET STARTED ============ */
.getstarted {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.05fr);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  min-height: 132px;
}

.gs-steps { list-style: none; margin: 0; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.gs-steps li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
  color: var(--text);
  padding: 5px 0;
}
.gs-badge {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gs-art {
  position: relative;
  background:
    radial-gradient(120% 130% at 78% 18%, rgba(168, 85, 247, 0.55) 0%, transparent 55%),
    radial-gradient(110% 120% at 100% 60%, rgba(16, 163, 127, 0.5) 0%, transparent 58%),
    radial-gradient(90% 110% at 55% 100%, rgba(240, 86, 143, 0.35) 0%, transparent 60%),
    linear-gradient(120deg, #0d0d0d 8%, #1a1626 45%, #0f2a24 100%);
  display: flex;
  align-items: flex-end;
  padding: 14px;
}
.gs-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }

.gs-card {
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(18, 18, 18, 0.72);
  backdrop-filter: blur(10px);
  border-radius: var(--r-md);
  padding: 10px 12px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.gs-card:hover { background: rgba(28, 28, 28, 0.9); border-color: rgba(255, 255, 255, 0.26); }
.gs-card strong { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; }
.gs-card span { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 3px; line-height: 1.35; }

/* ============ METRICS GRID ============ */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 24px 0;
}

.metric {
  background: var(--bg);
  padding: 15px 18px 16px;
  min-height: 104px;
  display: flex;
  flex-direction: column;
}
.metric.amber { background: var(--amber-bg); }

.metric-top {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-3);
}
.metric.amber .metric-top { color: var(--amber-text); }
.metric-top .ic { opacity: 0.65; }

.metric-value {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-top: 6px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}
.metric.amber .metric-value { color: #fff; }
.metric-value .ic { flex: none; }
.metric-value .ic.ok { color: var(--accent); }
.metric-value .ic.bad { color: var(--danger); }
.metric-value .ic.warn { color: #e0b341; }

.metric-spark { margin-top: auto; padding-top: 14px; }
.metric-act { margin-top: auto; padding-top: 12px; }

.spark { position: relative; height: 11px; }
.spark::before {
  content: "";
  position: absolute;
  left: 0;
  right: 9px;
  top: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--c);
}
.spark i {
  position: absolute;
  right: 0;
  top: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--c);
  box-sizing: border-box;
}
.spark.dashed::before {
  right: 0;
  background: repeating-linear-gradient(90deg, var(--c) 0 22px, transparent 22px 34px);
}
.spark.dashed i { display: none; }
.spark.flat::before { background: var(--c); right: 0; opacity: 0.55; }
.spark.flat i { display: none; }

/* ============ CARDS ============ */
.card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 20px;
  margin-bottom: 18px;
}
.card.no-pad { padding: 0; overflow: hidden; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h3 { font-size: 14px; font-weight: 600; }

.two-col { display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px; margin-top: 28px; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 22px 0 6px;
  text-align: center;
}
.empty p { font-size: 13px; color: var(--text-3); }

.updates { list-style: none; margin: 0; padding: 0; }
.updates li {
  display: flex;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.updates li:last-child { border-bottom: none; }
.updates .u-ic {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}
.updates .u-ic.ok { color: var(--accent); border-color: rgba(16, 163, 127, 0.4); }
.updates .u-ic.bad { color: var(--danger); border-color: rgba(240, 86, 91, 0.4); }
.updates .u-ic.warn { color: #e0b341; border-color: rgba(224, 179, 65, 0.4); }
.updates strong { display: block; font-size: 13px; font-weight: 500; }
.updates small { font-size: 12px; color: var(--text-4); line-height: 1.45; }

/* ============ FORMS ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-2 { grid-column: 1 / -1; }
.form-foot { display: flex; gap: 10px; }

label { display: block; }
.lbl {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
select,
textarea {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color 0.14s, box-shadow 0.14s;
}
textarea {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
  min-height: 190px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #4a4a4a;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238f8f8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

/* switch */
.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  padding-bottom: 9px;
  cursor: pointer;
}
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch {
  width: 34px;
  height: 20px;
  flex: none;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  position: relative;
  transition: background 0.16s, border-color 0.16s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-3);
  transition: transform 0.16s, background 0.16s;
}
.switch-row input:checked + .switch { background: var(--accent); border-color: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(14px); background: #fff; }
.switch-row input:disabled + .switch { opacity: 0.45; }
.switch-text { font-size: 13.5px; color: var(--text); }

/* file */
.file-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.14s, color 0.14s;
}
.file-drop:hover { border-color: #454545; color: var(--text-2); }
.file-drop.has-file { border-style: solid; border-color: rgba(16, 163, 127, 0.5); color: var(--text); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.14s, border-color 0.14s, opacity 0.14s;
}
.btn.primary { background: #fff; color: #0d0d0d; font-weight: 600; }
.btn.primary:hover { background: #dedede; }
.btn.secondary { background: var(--surface-3); color: var(--text); border-color: var(--line); }
.btn.secondary:hover { background: #2c2c2c; }
.btn.ghost { background: transparent; color: var(--text-2); border-color: var(--line); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.amber { background: var(--amber-btn); color: #fff; }
.btn.amber:hover { background: var(--amber-btn-h); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn.tiny { height: 26px; padding: 0 10px; font-size: 11.5px; border-radius: var(--r-sm); }
.btn.lg { height: 40px; padding: 0 22px; font-size: 14px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.row-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }

/* ============ PILLS / BANNERS ============ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.pill.ok { background: rgba(16, 163, 127, 0.14); color: #4ecfa9; border-color: rgba(16, 163, 127, 0.3); }
.pill.pending { background: rgba(224, 179, 65, 0.13); color: #e0b341; border-color: rgba(224, 179, 65, 0.28); }
.pill.processing { background: rgba(106, 157, 255, 0.14); color: var(--blue); border-color: rgba(106, 157, 255, 0.3); }
.pill.failed { background: rgba(240, 86, 91, 0.13); color: #ff7d81; border-color: rgba(240, 86, 91, 0.3); }

.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 18px;
}
.banner.warn { border-color: var(--amber-line); background: rgba(122, 103, 16, 0.14); color: #e8d59a; }
.banner.bad { border-color: rgba(240, 86, 91, 0.35); background: rgba(240, 86, 91, 0.08); color: #ffa2a5; }

/* ============ PROGRESS / TIMELINE ============ */
.track {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  margin-bottom: 16px;
}
.track-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #3ad6ab);
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.track-fill.failed { background: linear-gradient(90deg, #b3403f, var(--danger)); }

.timeline { display: flex; flex-direction: column; }
.tl {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 0 0 16px 22px;
  margin-left: 6px;
  border-left: 1px solid var(--line);
}
.tl:last-child { border-left-color: transparent; padding-bottom: 0; }
.tl::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.tl.done::before { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tl.active::before { background: #e0b341; box-shadow: 0 0 0 1px #e0b341, 0 0 0 5px rgba(224, 179, 65, 0.16); }
.tl.failed::before { background: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.tl-title { font-size: 13px; font-weight: 500; line-height: 1.2; }
.tl-desc { font-size: 12px; color: var(--text-4); margin-top: 3px; }

.note { font-size: 12.5px; color: var(--text-3); }
.mono-id { font-family: var(--mono); font-size: 11.5px; color: var(--text-4); }

.preview {
  margin-top: 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg);
}
.preview img { display: block; max-width: 100%; max-height: 420px; margin: 0 auto; }

/* ============ TABS / CODE ============ */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tab {
  height: 28px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  font-size: 12.5px;
  cursor: pointer;
}
.tab:hover { color: var(--text); background: var(--hover); }
.tab.on { background: var(--surface-3); color: var(--text); border-color: var(--line); }

.code {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 380px;
  overflow: auto;
}

/* ============ TABLE ============ */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-4);
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.table td { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); color: var(--text-2); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.table .td-empty { text-align: center; color: var(--text-4); padding: 30px 0; }

.jobs-cards { display: none; flex-direction: column; gap: 8px; }
.job-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.job-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.job-card-top strong {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-card-meta { font-size: 13px; color: var(--text-3); }
.job-card-empty {
  align-items: center;
  justify-content: center;
  color: var(--text-4);
  cursor: default;
}

.inline-result {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  font-size: 12.5px;
  color: var(--text-2);
}
.inline-result.ok { border-color: rgba(16, 163, 127, 0.4); color: #7fdcc0; }
.inline-result.bad { border-color: rgba(240, 86, 91, 0.4); color: #ffa2a5; }

/* ============ HELP ============ */
.help { list-style: none; margin: 0; padding: 0; }
.help li { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.help li:last-child { border-bottom: none; }
.help strong { font-size: 13px; font-weight: 600; }
.help p { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.help code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--surface-3);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ============ CUSTOM SELECT ============ */
.sel { position: relative; }

.sel-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.sel-btn:hover { border-color: #3d3d3d; }
.sel.open .sel-btn {
  border-color: #4a4a4a;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}
.sel-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.sel-val { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; }
.sel-val-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-val.empty .sel-val-text { color: var(--text-4); }
.sel-chev { color: var(--text-3); flex: none; transition: transform 0.16s; }
.sel-chev svg { transform: rotate(90deg); }
.sel.open .sel-chev { transform: rotate(180deg); }

.sel-pop {
  position: absolute;
  z-index: 70;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: pop 0.14s ease;
}
.sel-pop.up { top: auto; bottom: calc(100% + 5px); }

.sel-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}
.sel-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  padding: 0;
  margin: 0;
}
.sel-search input:focus { outline: none; box-shadow: none; }

.sel-list { max-height: 264px; overflow-y: auto; padding: 5px; }

.sel-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
}
.sel-opt:hover, .sel-opt.cursor { background: var(--hover); color: var(--text); }
.sel-opt.sel-on { background: var(--active); color: #fff; }
.sel-opt-main { flex: 1; min-width: 0; }
.sel-opt-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-opt-hint { font-size: 11.5px; color: var(--text-4); margin-top: 1px; }
.sel-opt .sel-check { color: var(--accent); flex: none; opacity: 0; }
.sel-opt.sel-on .sel-check { opacity: 1; }

.sel-empty { padding: 18px 12px; text-align: center; font-size: 12.5px; color: var(--text-4); }

/* grid variant — background picker */
.sel-list.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  padding: 10px;
  max-height: 320px;
}
.sel-tile {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.14s, transform 0.14s;
}
.sel-tile:hover { border-color: #4a4a4a; transform: translateY(-1px); }
.sel-tile.sel-on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.25); }
.sel-thumb {
  position: relative;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  background: #161616;
}
.sel-thumb.empty {
  color: var(--text-4);
  font-size: 13px;
  font-weight: 600;
  background:
    linear-gradient(180deg, #1c1c1c 0%, #141414 100%);
}
.sel-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sel-tile-cap {
  padding: 5px 7px;
  font-size: 11px;
  color: var(--text-3);
  border-top: 1px solid var(--line-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sel-tile.sel-on .sel-tile-cap { color: var(--text); }

.sel-swatch {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 5px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.sel-swatch img { width: 100%; height: 100%; object-fit: cover; display: block; }

.lbl-hint { color: var(--text-4); font-weight: 400; }

/* ============ CHIPS ============ */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-3);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.chip:hover { background: var(--hover); color: var(--text); }
.chip.on { background: var(--active); color: #fff; border-color: transparent; }
.chip-n {
  font-size: 11px;
  font-weight: 600;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
}
.chip.on .chip-n { background: rgba(0, 0, 0, 0.35); color: #fff; }

/* ============ TOOLTIP ============ */
.tip {
  position: fixed;
  z-index: 200;
  max-width: 250px;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  background: #2c2c2c;
  border: 1px solid #3a3a3a;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.tip.show { opacity: 1; }

/* ============ MODAL ============ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  padding-top: 12vh;
}

.modal {
  width: min(620px, 94vw);
  height: max-content;
  max-height: 74vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
  animation: pop 0.16s ease;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 18px; overflow-y: auto; font-size: 13.5px; color: var(--text-2); }
.modal-body p { margin-bottom: 12px; line-height: 1.6; }
.modal-body .code { margin-bottom: 12px; }
.modal-body ol, .modal-body ul { margin: 0 0 12px; padding-left: 20px; line-height: 1.7; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.modal-foot:empty { display: none; }

.step-list { list-style: none; margin: 0 0 4px; padding: 0; counter-reset: s; }
.step-list li {
  position: relative;
  padding: 0 0 16px 34px;
  counter-increment: s;
}
.step-list li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-list strong { display: block; color: var(--text); margin-bottom: 5px; font-size: 13px; }
.step-list li .row-actions { margin-top: 8px; }

/* collapsible technical block inside modal */
.tech {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  margin-top: 4px;
}
.tech summary {
  padding: 10px 13px;
  font-size: 12.5px;
  color: var(--text-3);
  cursor: pointer;
  list-style: none;
}
.tech summary::-webkit-details-marker { display: none; }
.tech summary:hover { color: var(--text); }
.tech-body { padding: 0 13px 12px; }
.tech-body p { margin: 0 0 8px; font-size: 12.5px; }

/* key-value table in job modal */
.kv { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 4px; }
.kv th {
  text-align: left;
  font-weight: 400;
  color: var(--text-4);
  padding: 7px 12px 7px 0;
  width: 42%;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}
.kv td {
  padding: 7px 0;
  color: var(--text);
  border-bottom: 1px solid var(--line-soft);
  word-break: break-word;
}
.kv tr:last-child th, .kv tr:last-child td { border-bottom: none; }

.sub-title {
  margin: 18px 0 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-4);
}

.job-modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.job-modal-head .note { flex: 1; min-width: 180px; }

/* ============ ACCORDION ============ */
.acc details { border-bottom: 1px solid var(--line-soft); }
.acc details:last-child { border-bottom: none; }
.acc summary {
  padding: 14px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 9px;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.6px solid var(--text-3);
  border-bottom: 1.6px solid var(--text-3);
  transform: rotate(-45deg);
  transition: transform 0.16s;
  flex: none;
  margin-right: 2px;
}
.acc details[open] summary::before { transform: rotate(45deg); }
.acc summary:hover { background: rgba(255, 255, 255, 0.02); }
.acc-body { padding: 0 18px 16px 33px; font-size: 13px; color: var(--text-3); line-height: 1.65; }
.acc-body p { margin-bottom: 10px; }
.acc-body .code { margin: 10px 0; }
.acc-body code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--surface-3);
  padding: 1px 5px;
  border-radius: 4px;
}

.dl { list-style: none; margin: 0; padding: 0; }
.dl li { padding: 5px 0; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.help-flow { margin-bottom: 22px; }
.help-flow .metric-spark { padding-top: 8px; }
.help-flow .note { line-height: 1.5; }

.head-right { display: flex; align-items: center; gap: 12px; }
.refresh-note { font-size: 11.5px; color: var(--text-4); }

.metric.clickable { cursor: pointer; transition: background 0.14s; }
.metric.clickable:hover { background: var(--surface); }
.metric.amber.clickable:hover { background: #453a09; }

/* ============ PALETTE ============ */
.palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  padding-top: 14vh;
}
.palette {
  width: min(520px, 92vw);
  height: max-content;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.palette-input {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.palette-input input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  padding: 0;
}
.palette-input input:focus { outline: none; box-shadow: none; }
.palette-list { margin: 0; padding: 6px; max-height: 340px; overflow-y: auto; }
.palette-group {
  padding: 8px 10px 4px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-4);
}
.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
}
.palette-item:hover, .palette-item.sel { background: var(--active); color: #fff; }
.palette-item .pi-main { flex: 1; min-width: 0; }
.palette-item .pi-hint { font-size: 11.5px; color: var(--text-4); margin-top: 1px; }
.palette-item.sel .pi-hint { color: rgba(255, 255, 255, 0.6); }
.palette-empty { padding: 26px 12px; text-align: center; font-size: 13px; color: var(--text-4); }

/* ============ TOASTS ============ */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  animation: slide 0.2s ease;
}
.toast.ok { border-color: rgba(16, 163, 127, 0.45); }
.toast.bad { border-color: rgba(240, 86, 91, 0.45); }
.toast .ic.ok { color: var(--accent); }
.toast .ic.bad { color: var(--danger); }

@keyframes slide {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding: 6px 6px env(safe-area-inset-bottom, 0px);
  background: rgba(18, 18, 18, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  justify-content: space-around;
  align-items: flex-start;
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--text-4);
  font-size: 10px;
  font-weight: 500;
  padding: 6px 0 0;
  min-width: 0;
  cursor: pointer;
}
.bn-item .ic { color: inherit; }
.bn-item.active { color: var(--text); }
.bn-item.active .ic { color: var(--accent); }

.more-list { display: grid; gap: 8px; }
.more-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}
.more-row:hover { background: var(--hover); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .getstarted { grid-template-columns: 1fr; }
  .gs-art { min-height: 150px; }
}

@media (max-width: 760px) {
  html, body {
    overflow: hidden;
    height: 100%;
    height: 100dvh;
  }
  .layout {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }
  .sidebar { display: none; }
  .main {
    margin-left: 0;
    padding: 16px 16px calc(88px + env(safe-area-inset-bottom, 0px));
    max-width: none;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .page { min-width: 0; max-width: 100%; }
  .page-head {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg);
    padding: 4px 0 12px;
    margin: 0 0 12px;
  }
  .page-head h1 { font-size: 22px; }
  .metrics { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .getstarted { grid-template-columns: 1fr; }
  .gs-art { display: none; }
  .head-right .segmented { display: none; }
  .bottom-nav { display: flex; }
  .jobs-table-wrap { display: none; }
  .jobs-cards { display: flex; }
  .chips { overflow: visible; }
  input, textarea, select { font-size: 16px; }
  .overlay {
    padding-top: 0;
    align-items: stretch;
  }
  .modal {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: none;
  }
  .kv { display: block; }
  .kv tr, .kv th, .kv td {
    display: block;
    width: 100%;
    padding: 6px 0;
  }
  .table { min-width: 0; }
}

html.app-shell, html.app-shell body {
  overflow: hidden;
  height: 100%;
  height: 100dvh;
}
html.app-shell .layout {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
html.app-shell .sidebar { display: none; }
html.app-shell .main {
  margin-left: 0;
  padding: 16px 16px calc(88px + env(safe-area-inset-bottom, 0px));
  max-width: none;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
html.app-shell .bottom-nav { display: flex; }
html.app-shell .jobs-table-wrap { display: none; }
html.app-shell .jobs-cards { display: flex; }
html.app-shell .page-head h1 { font-size: 22px; }
html.app-shell input, html.app-shell textarea, html.app-shell select { font-size: 16px; }
html.app-shell .overlay { padding-top: 0; align-items: stretch; }
html.app-shell .modal {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  border-radius: 0;
  border: none;
}
