@import url('variables.css');

/* ============================================
   TVERDA SOFT — Личный кабинет
   Редизайн по дизайн-системе (handoff).
   Спокойный, плотный рабочий интерфейс.
   Desktop: боковая навигация. Mobile: drawer.
============================================ */

body.cabinet-body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--fill);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

*, *::before, *::after { box-sizing: border-box; }

/* ============================================
   AUTH (login / register)
============================================ */
.cabinet-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-background) 55%);
}

.cabinet-auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-background);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.10);
}

.cabinet-auth-card h1 { margin: 0 0 var(--spacing-sm); font-size: 24px; font-weight: 800; }
.cabinet-auth-card .subtitle { color: var(--muted); margin-bottom: var(--spacing-xl); font-size: 14px; }

.cabinet-form-group { margin-bottom: var(--spacing-md); }
.cabinet-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--spacing-md); }
.cabinet-form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: var(--spacing-xs); color: var(--ink); }
.cabinet-form-group input,
.cabinet-form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
}
.cabinet-form-group input:focus,
.cabinet-form-group select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--focus-ring);
}
.cabinet-error { color: var(--color-error); font-size: 14px; margin-top: var(--spacing-sm); display: none; }
.cabinet-error.visible { display: block; }
.cabinet-success { color: var(--color-success); display: none; font-size: 14px; }
.cabinet-success.visible { display: block; }
.cabinet-auth-footer { margin-top: var(--spacing-lg); text-align: center; font-size: 14px; }
.cabinet-auth-footer a { color: var(--blue); }

/* ============================================
   BUTTONS (cabinet-scoped)
============================================ */
.cab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s var(--ease), box-shadow .18s ease, background .18s ease,
              border-color .18s ease, color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.cab-btn svg { width: 20px; height: 20px; flex: none; }
.cab-btn.lg { height: 52px; padding: 0 26px; font-size: 16px; }
.cab-btn.sm { height: 36px; padding: 0 12px; font-size: 14px; gap: 6px; }
.cab-btn.sm svg { width: 17px; height: 17px; }

.cab-btn-primary {
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.cab-btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-primary-lg); }
.cab-btn-primary:active { transform: translateY(0); }

.cab-btn-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.cab-btn-secondary:hover { border-color: var(--line-soft); color: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.cab-btn-ghost { background: transparent; color: var(--muted); }
.cab-btn-ghost:hover { background: var(--fill); color: var(--ink); }

.cab-btn-danger { background: transparent; border-color: var(--color-error); color: var(--color-error); }
.cab-btn-danger:hover { background: var(--color-error); color: #fff; }

/* ============================================
   LAYOUT SHELL
============================================ */
.cab {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ---------- Sidebar ---------- */
.cab-sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--blue);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: width .4s var(--ease-spring), padding .4s var(--ease-spring);
}

.sb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  flex: none;
  padding: 0 4px;
}
.sb-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.sb-logo .mark {
  flex: none; width: 42px; height: 42px; border-radius: 11px; object-fit: cover;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.20);
}
.sb-logo .word {
  font-weight: 800; font-size: 21px; letter-spacing: -0.01em; color: #fff; line-height: 1;
  white-space: nowrap; overflow: hidden; max-width: 180px; opacity: 1;
  transition: max-width .4s var(--ease-spring), opacity .25s ease .1s;
}
.sb-logo .word .soft { font-weight: 600; opacity: .9; }

.sb-collapse {
  width: 32px; height: 32px; flex: none; border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff; border-radius: 8px;
}
.sb-collapse svg { width: 20px; height: 20px; }
.sb-collapse:hover { background: rgba(255, 255, 255, .14); }

.sb-label {
  flex: none;
  margin: 26px 14px 12px;
  font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: rgba(255, 255, 255, .62); white-space: nowrap; overflow: hidden;
  transition: max-width .4s var(--ease-spring), opacity .25s ease, margin .4s var(--ease-spring);
}

.sb-project {
  flex: none;
  margin: 4px 6px 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .12);
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: #fff;
  overflow: hidden;
}
.sb-project .pj-ico { width: 36px; height: 36px; flex: none; border-radius: 10px; background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center; }
.sb-project .pj-ico svg { width: 20px; height: 20px; }
.sb-project .pj-text { min-width: 0; line-height: 1.25; }
.sb-project .pj-text b { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-project .pj-text span { display: block; font-size: 12px; color: rgba(255,255,255,.7); white-space: nowrap; }

.cab-back {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  margin: 0 6px 8px; padding: 8px 12px; border-radius: 10px;
  color: rgba(255, 255, 255, .85); font-size: 14px; font-weight: 500; text-decoration: none;
  white-space: nowrap; overflow: hidden;
}
.cab-back:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.cab-back svg { width: 18px; height: 18px; flex: none; }

.cab-menu { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px; position: relative; height: auto; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.cab-menu::-webkit-scrollbar { width: 6px; }
.cab-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .3); border-radius: 6px; }
.menu-item {
  flex: none;
  display: flex; align-items: center; gap: 14px;
  height: 48px; padding: 0 14px; border-radius: 12px;
  color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap;
  font-size: 15px; font-weight: 500; position: relative; z-index: 2;
  transition: background .2s ease, color .22s ease;
}
.menu-item svg { flex: none; width: 22px; height: 22px; transition: color .22s ease; }
.menu-item .label {
  overflow: hidden; max-width: 180px; opacity: 1;
  transition: max-width .4s var(--ease-spring), opacity .25s ease .1s;
}
.menu-item:not(.active):hover { background: rgba(255, 255, 255, .12); }

/* active = светлая «пилюля», контрастная к синему сайдбару */
.menu-item.active {
  background: var(--fill);
  color: var(--brand-dark);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .14);
}
.menu-item.active svg { color: var(--blue); }

/* support card */
.sb-support {
  flex: none;
  margin-top: 14px; position: relative;
  background: var(--fill); color: var(--ink);
  border-radius: 16px;
  padding: 16px 16px 14px;
}
.sb-support .heading {
  font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 10px;
  white-space: nowrap; overflow: hidden;
  transition: max-height .4s var(--ease-spring), opacity .25s ease, margin .4s var(--ease-spring);
}
.sb-support .row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); padding: 4px 0; white-space: nowrap; text-decoration: none; }
.sb-support .row svg { flex: none; width: 20px; height: 20px; color: var(--blue); }
.sb-support .row.link { color: var(--blue); font-weight: 600; cursor: pointer; }
.sb-support .row span { overflow: hidden; transition: max-width .4s var(--ease-spring), opacity .25s ease; }
.sb-support .help {
  position: absolute; top: -6px; right: 14px; width: 44px; height: 30px; border-radius: 11px;
  background: #fff; display: flex; align-items: center; justify-content: center;
  color: var(--blue); box-shadow: 0 2px 8px rgba(20, 30, 70, .14);
}
.sb-support .help svg { width: 20px; height: 20px; }

/* ---------- Collapsed (desktop) ---------- */
.cab[data-collapsed="true"] .cab-sidebar { width: var(--sidebar-collapsed-w); padding-left: 8px; padding-right: 8px; }
.cab[data-collapsed="true"] .sb-logo .word,
.cab[data-collapsed="true"] .menu-item .label,
.cab[data-collapsed="true"] .sb-label span,
.cab[data-collapsed="true"] .sb-project .pj-text,
.cab[data-collapsed="true"] .cab-back span,
.cab[data-collapsed="true"] .sb-support .heading,
.cab[data-collapsed="true"] .sb-support .row span,
.cab[data-collapsed="true"] .sb-support .help {
  max-width: 0 !important; opacity: 0 !important; pointer-events: none;
}
.cab[data-collapsed="true"] .sb-label { margin: 18px auto 6px; height: 0; }
/* свёрнуто: логотип скрыт, кнопка-панель встаёт на его место сверху */
.cab[data-collapsed="true"] .sb-logo { display: none; }
.cab[data-collapsed="true"] .sb-top { justify-content: center; padding: 0; }
.cab[data-collapsed="true"] .menu-item { justify-content: center; padding: 0; }
.cab[data-collapsed="true"] .menu-item.active { margin-right: 0; border-radius: 12px; }
.cab[data-collapsed="true"] .menu-item.active::before,
.cab[data-collapsed="true"] .menu-item.active::after { display: none; }
.cab[data-collapsed="true"] .sb-project { justify-content: center; }
.cab[data-collapsed="true"] .cab-back { justify-content: center; }
.cab[data-collapsed="true"] .sb-support { padding: 12px 8px; }
.cab[data-collapsed="true"] .sb-support .row { justify-content: center; }

/* ---------- Main ---------- */
.cab-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--fill); }

.cab-header {
  height: var(--cabinet-header-h);
  flex: none;
  position: sticky; top: 0; z-index: 30;
  background: rgba(248, 250, 252, .85);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 32px;
}
.cab-hamburger {
  display: none; width: 40px; height: 40px; border-radius: 10px; flex: none;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  align-items: center; justify-content: center; cursor: pointer;
}
.cab-hamburger svg { width: 22px; height: 22px; }

.crumbs { display: flex; align-items: center; justify-content: flex-start; height: auto; gap: 6px; font-size: 18px; font-weight: 500; min-width: 0; }
.crumbs a { color: var(--ink); text-decoration: none; }
.crumbs a:hover { color: var(--brand-dark); }
.crumbs .sep { color: var(--muted); font-weight: 400; }
.crumbs .leaf { color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.head-right { display: flex; align-items: center; gap: 24px; flex: none; }
.head-tools { display: flex; gap: 12px; }
.icon-pill {
  width: 40px; height: 40px; border-radius: 12px; background: #fff;
  border: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: center;
  color: var(--ink); cursor: pointer; position: relative; transition: border-color .2s ease, box-shadow .2s ease;
}
.icon-pill:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.icon-pill svg { width: 22px; height: 22px; }
.icon-pill .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-error); border: 2px solid #fff; }

.cab-user { display: flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer; }
.cab-user .avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, #3B82F6, #2563EB); display: flex; align-items: center; justify-content: center; color: #fff;
}
.cab-user .avatar svg { width: 24px; height: 24px; }
.cab-user .who { display: flex; flex-direction: column; line-height: 1.18; }
.cab-user .who b { font-size: 15px; font-weight: 700; color: var(--ink); }
.cab-user .who span { font-size: 13px; color: var(--muted); }
.cab-user .chev { color: var(--ink); display: flex; }
.cab-user .chev svg { width: 20px; height: 20px; }

.cab-body {
  flex: 1; min-height: 0;
  padding: 12px 32px 40px;
  max-width: 1280px;
  width: 100%;
}

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 12px 0 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 32px; font-weight: 800; color: var(--ink); margin: 0 0 6px; letter-spacing: -0.02em; }
.page-head p { font-size: 16px; color: var(--muted); margin: 0; }
.page-head-controls { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* plan widget */
.plan-widget {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 18px; min-width: 280px; box-shadow: var(--shadow-sm);
}
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.plan-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.plan-name .tier { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 6px;
  background: #EFF6FF; color: var(--brand-dark); font-size: 12px; font-weight: 700; letter-spacing: .3px; }
.plan-count { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.plan-count b { color: var(--ink); }
.plan-bar { height: 7px; border-radius: 99px; background: #EDF1F7; overflow: hidden; }
.plan-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3B82F6, #2563EB); transition: width .5s var(--ease); }
.plan-widget.full .plan-fill { background: linear-gradient(90deg, #F59E0B, #DC2626); }

/* ============================================
   PROJECT CARDS (Проекты)
============================================ */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.proj {
  display: flex; flex-direction: column; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 22px 20px; cursor: pointer; font-family: inherit; color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s ease, border-color .22s ease;
}
.proj:hover { transform: translateY(-6px); border-color: var(--line-soft); box-shadow: var(--shadow-lg); }
.proj:hover .proj-ico { transform: scale(1.06); }
.proj:hover .proj-action { background: #EFF6FF; border-color: var(--line-soft); color: var(--brand-dark); }

.proj-top { display: flex; align-items: flex-start; gap: 14px; }
.proj-ico {
  width: 52px; height: 52px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  color: #fff; transition: transform .22s ease; box-shadow: 0 4px 10px rgba(15, 23, 42, .10);
}
.proj-ico svg { width: 27px; height: 27px; }
.proj-ico.tg { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.proj-ico.max { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.proj-head { flex: 1; min-width: 0; padding-top: 1px; }
.proj-name { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.25; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-meta { font-size: 14px; color: var(--muted); }
.proj-kebab {
  width: 30px; height: 30px; flex: none; border: none; background: transparent; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #aeb6c4; margin: -4px -6px 0 0;
}
.proj-kebab:hover { background: var(--fill); color: var(--muted); }
.proj-kebab svg { width: 20px; height: 20px; }

.proj-badges { display: flex; align-items: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 8px;
  font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge svg { width: 15px; height: 15px; }
.badge.tg { background: #EFF6FF; color: #2563EB; }
.badge.max { background: #F3EEFE; color: #7C3AED; }
.badge.type { background: var(--fill); color: var(--ink); border: 1px solid var(--line); }

.status { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600; white-space: nowrap; margin-left: auto; }
.status i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status.ok { background: #ECFDF5; color: #059669; }
.status.ok i { background: var(--emerald); box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.status.warn { background: #FFFBEB; color: #B45309; }
.status.warn i { background: var(--amber); box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }
.status.err { background: #FEF2F2; color: #DC2626; }
.status.err i { background: var(--rose); box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }

.proj-link {
  display: flex; align-items: center; gap: 10px; margin-top: 16px;
  height: 42px; padding: 0 8px 0 14px; border-radius: 10px; background: var(--fill); border: 1px solid var(--line);
}
.proj-link .lk-ico { flex: none; color: var(--muted); display: flex; }
.proj-link .lk-ico svg { width: 17px; height: 17px; }
.proj-link .lk-txt { flex: 1; min-width: 0; font-size: 14px; color: var(--ink); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-link .copy { width: 30px; height: 30px; flex: none; border: none; background: transparent; border-radius: 7px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.proj-link .copy:hover { background: #fff; color: var(--brand-dark); }
.proj-link .copy svg { width: 16px; height: 16px; }

.proj-stats { display: flex; align-items: stretch; margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qs { flex: 1; padding: 11px 14px; display: flex; flex-direction: column; gap: 2px; }
.qs + .qs { border-left: 1px solid var(--line); }
.qs .qn { font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.qs .ql { font-size: 12px; color: var(--muted); }
.proj-draftnote { margin-top: 16px; display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--muted);
  padding: 11px 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--fill); }
.proj-draftnote svg { width: 17px; height: 17px; flex: none; color: var(--amber); }

.proj-action {
  margin-top: 18px; height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--fill);
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 18px;
  font-size: 15px; font-weight: 600; color: var(--ink); transition: all .2s ease;
}
.proj-action svg { width: 19px; height: 19px; }

/* add (ghost) card */
.add-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: transparent; border: 2px dashed #C9D6EA; border-radius: 16px; cursor: pointer;
  color: var(--brand-dark); font-family: inherit; min-height: 240px;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.add-card:hover { border-color: var(--blue); background: #F5F9FF; transform: translateY(-4px); }
.add-ico { width: 58px; height: 58px; border-radius: 16px; background: #EFF6FF; display: flex; align-items: center; justify-content: center; color: var(--brand-dark); }
.add-ico svg { width: 28px; height: 28px; }
.add-card .add-t { font-size: 17px; font-weight: 700; color: var(--ink); }
.add-card .add-s { font-size: 13px; color: var(--muted); }

/* ============================================
   EMPTY STATE
============================================ */
.empty-state { max-width: 560px; margin: 40px auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.empty-art {
  width: 108px; height: 108px; border-radius: 28px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3B82F6, #2563EB); color: #fff; margin-bottom: 30px;
  box-shadow: 0 16px 32px rgba(59, 130, 246, .30); position: relative;
}
.empty-art svg { width: 54px; height: 54px; }
.empty-art .spark { position: absolute; width: 30px; height: 30px; border-radius: 10px; background: #fff;
  display: flex; align-items: center; justify-content: center; color: var(--brand-dark);
  bottom: -10px; right: -10px; box-shadow: 0 6px 14px rgba(15, 23, 42, .18); }
.empty-art .spark svg { width: 18px; height: 18px; }
.empty-state h2 { font-size: 28px; font-weight: 800; color: var(--ink); margin: 0 0 12px; letter-spacing: -0.02em; }
.empty-state p { font-size: 16px; line-height: 1.6; color: var(--muted); margin: 0 0 28px; }
.empty-types { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; justify-content: center; }
.etype { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; box-shadow: var(--shadow-sm); }
.etype .ei { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.etype .ei svg { width: 21px; height: 21px; }
.etype .ei.b { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.etype .ei.a { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.etype b { display: block; font-size: 15px; color: var(--ink); font-weight: 700; }
.etype span { font-size: 13px; color: var(--muted); }
.empty-hint { margin-top: 22px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.empty-hint i { width: 4px; height: 4px; border-radius: 50%; background: #C9D2E0; }

/* ============================================
   GENERIC CONTENT PRIMITIVES (shared by screens)
============================================ */
.cab-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-sm); }
.cab-card + .cab-card { margin-top: 20px; }
.cab-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.cab-card-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); }
.cab-card-head p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

.cab-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.cab-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cab-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* metric tiles */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.metric {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.metric .m-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.metric .m-ico { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.metric .m-ico svg { width: 21px; height: 21px; }
.metric .m-ico.blue { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.metric .m-ico.violet { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.metric .m-ico.emerald { background: linear-gradient(135deg, #10B981, #059669); }
.metric .m-ico.amber { background: linear-gradient(135deg, #F59E0B, #D97706); }
.metric .m-delta { font-size: 13px; font-weight: 600; }
.metric .m-delta.up { color: var(--emerald-dark); }
.metric .m-delta.down { color: var(--rose); }
.metric .m-value { font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; line-height: 1.1; }
.metric .m-label { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* table */
.cab-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.cab-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cab-table th { text-align: left; padding: 14px 18px; font-weight: 600; color: var(--muted); background: var(--fill); border-bottom: 1px solid var(--line); white-space: nowrap; }
.cab-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--ink); }
.cab-table tr:last-child td { border-bottom: none; }
.cab-table tbody tr { transition: background .15s ease; }
.cab-table tbody tr:hover { background: var(--fill); }

.tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.tag.blue { background: #EFF6FF; color: #2563EB; }
.tag.green { background: #ECFDF5; color: #059669; }
.tag.amber { background: #FFFBEB; color: #B45309; }
.tag.gray { background: var(--fill); color: var(--muted); border: 1px solid var(--line); }

/* divider */
.cab-divider { height: 1px; background: var(--line); margin: 24px 0; border: none; }

/* ============================================
   TOAST
============================================ */
#cab-toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px);
  background: var(--ink-deep); color: #fff; border-radius: 12px; padding: 14px 20px;
  display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500;
  box-shadow: 0 16px 40px rgba(8, 12, 30, .45); opacity: 0; pointer-events: none; z-index: 200;
  transition: opacity .26s ease, transform .26s cubic-bezier(.34, 1.2, .4, 1); white-space: nowrap; max-width: calc(100vw - 32px);
}
#cab-toast.show { opacity: 1; transform: translate(-50%, 0); }
#cab-toast .ti { width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, .14); display: flex; align-items: center; justify-content: center; flex: none; }
#cab-toast .ti svg { width: 18px; height: 18px; }
#cab-toast b { font-weight: 700; }

/* view-in animation */
.view-in { animation: viewIn .34s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* mobile scrim */
.cab-scrim { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 39; opacity: 0; transition: opacity .25s ease; }

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 1100px) {
  .proj-grid, .cab-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .cab-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh;
    width: var(--sidebar-w); transform: translateX(-100%);
    transition: transform .32s var(--ease-spring);
    box-shadow: 0 20px 60px rgba(8, 12, 30, .35);
  }
  .cab.nav-open .cab-sidebar { transform: translateX(0); }
  .cab.nav-open .cab-scrim { display: block; opacity: 1; }
  /* collapse control is desktop-only */
  .cab[data-collapsed="true"] .cab-sidebar { width: var(--sidebar-w); padding: 14px 14px 16px; }
  .cab[data-collapsed="true"] .sb-logo .word,
  .cab[data-collapsed="true"] .menu-item .label,
  .cab[data-collapsed="true"] .sb-label span,
  .cab[data-collapsed="true"] .sb-support .heading,
  .cab[data-collapsed="true"] .sb-support .row span,
  .cab[data-collapsed="true"] .sb-support .help,
  .cab[data-collapsed="true"] .sb-project .pj-text,
  .cab[data-collapsed="true"] .cab-back span { max-width: none !important; opacity: 1 !important; pointer-events: auto; }
  .cab[data-collapsed="true"] .menu-item { justify-content: flex-start; padding: 0 14px; }
  .cab[data-collapsed="true"] .sb-top { flex-direction: row; height: 54px; }
  .sb-collapse { display: none; }

  .cab-hamburger { display: flex; }
  .cab-header { padding: 12px 16px; }
  .head-right { gap: 12px; }
  .cab-user .who { display: none; }
  .cab-body { padding: 12px 16px 36px; }
  .page-head h1 { font-size: 26px; }
}

@media (max-width: 720px) {
  .proj-grid, .cab-grid-2, .cab-grid-3, .cab-grid-4 { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .page-head { align-items: flex-start; }
  .page-head-controls { width: 100%; }
  .plan-widget { width: 100%; min-width: 0; }
  .crumbs .c:not(.leaf) { display: none; }
  .crumbs .sep:first-of-type { display: none; }
}

@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
  .head-tools { display: none; }
}

/* ============================================
   CREATE PROJECT WIZARD (Создание проекта)
   Полноэкранный мастер: topbar + rail + pane.
============================================ */
.wiz { min-height: 100vh; display: flex; flex-direction: column; background: var(--fill); }

.wiz-topbar {
  height: 72px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; border-bottom: 1px solid var(--line); background: #fff;
}
.wiz-topbar .brand { display: flex; align-items: center; min-width: 0; }
.wiz-topbar .logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.wiz-topbar .logo .mark { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; box-shadow: 0 2px 8px rgba(15, 23, 42, .16); }
.wiz-topbar .logo .word { font-weight: 800; font-size: 21px; letter-spacing: -0.01em; color: var(--blue); line-height: 1; }
.wiz-topbar .logo .word .soft { color: var(--ink); font-weight: 700; }
.wiz-topbar .crumbs { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; margin-left: 28px; padding-left: 28px; border-left: 1px solid var(--line); }
.wiz-topbar .crumbs .c { color: var(--muted); }
.wiz-topbar .crumbs .sep { color: var(--muted-2); font-weight: 400; }
.wiz-topbar .crumbs .leaf { color: var(--ink); font-weight: 600; }
.wiz-close {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer;
  transition: all .18s var(--ease); text-decoration: none; flex: none;
}
.wiz-close:hover { border-color: #FCA5A5; color: var(--error); background: #FEF2F2; }
.wiz-close svg { width: 22px; height: 22px; }

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

/* left rail */
.wiz .rail {
  width: 420px; flex: none; color: #fff; padding: 48px 44px 40px; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #3B82F6 0%, #2563EB 64%, #1D4ED8 100%);
}
.wiz .rail::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 70%); top: -120px; right: -150px; }
.wiz .rail::before { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, .18), transparent 70%); bottom: -130px; left: -120px; }
.wiz .rail-head { position: relative; z-index: 2; }
.wiz .rail-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255, 255, 255, .66); }
.wiz .rail-title { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.18; margin: 14px 0 0; }
.wiz .rail-sub { font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, .82); margin-top: 16px; max-width: 330px; }

.wiz .steps { position: relative; z-index: 2; margin-top: 48px; display: flex; flex-direction: column; gap: 6px; }
.wiz .step { display: flex; align-items: flex-start; gap: 18px; padding: 14px 16px; border-radius: 14px; transition: background .25s var(--ease); }
.wiz .step.current { background: rgba(255, 255, 255, .13); }
.wiz .step .num {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; border: 2px solid rgba(255, 255, 255, .34); color: rgba(255, 255, 255, .78);
  transition: all .3s var(--ease);
}
.wiz .step .num svg { width: 21px; height: 21px; }
.wiz .step.current .num { background: #fff; color: var(--brand-dark); border-color: #fff; box-shadow: 0 6px 16px rgba(8, 15, 40, .28); }
.wiz .step.done .num { background: rgba(255, 255, 255, .92); color: var(--brand-dark); border-color: transparent; }
.wiz .step .st-txt { padding-top: 3px; }
.wiz .step .st-t { font-size: 17px; font-weight: 700; line-height: 1.2; }
.wiz .step .st-s { font-size: 13.5px; color: rgba(255, 255, 255, .7); margin-top: 3px; line-height: 1.4; }
.wiz .step:not(.current):not(.done) { opacity: .82; }
.wiz .step:not(.current):not(.done) .st-t { font-weight: 600; }

.wiz .rail-foot { position: relative; z-index: 2; margin-top: auto; }
.wiz .rail-help { display: flex; align-items: center; gap: 13px; background: rgba(255, 255, 255, .12); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 15px; padding: 16px 18px; }
.wiz .rail-help .hi { width: 42px; height: 42px; flex: none; border-radius: 12px; background: rgba(255, 255, 255, .16); display: flex; align-items: center; justify-content: center; }
.wiz .rail-help .hi svg { width: 22px; height: 22px; }
.wiz .rail-help .ht { font-size: 14.5px; font-weight: 700; }
.wiz .rail-help .hs { font-size: 13px; color: rgba(255, 255, 255, .74); margin-top: 2px; }
.wiz .rail-tag { font-size: 13px; letter-spacing: .5px; color: rgba(255, 255, 255, .62); margin-top: 22px; font-weight: 600; }

/* content pane */
.wiz .pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
.wiz .pane-body { flex: 1; min-height: 0; overflow-y: auto; padding: 48px 56px 28px; }

.wiz .scr { display: none; }
.wiz .scr.show { display: block; animation: scrIn .4s var(--ease) both; }
@keyframes scrIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.wiz .scr-head { margin-bottom: 32px; max-width: 680px; }
.wiz .scr-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 10px; }
.wiz .scr-head p { font-size: 16px; line-height: 1.6; color: var(--muted); margin: 0; }

/* step 1: type grid */
.wiz .type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 840px; }
.wiz .type-card {
  position: relative; display: flex; align-items: flex-start; gap: 18px; text-align: left;
  background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 22px;
  cursor: pointer; font-family: inherit; transition: all .2s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.wiz .type-card:hover { border-color: var(--line-soft); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 23, 42, .09); }
.wiz .type-card.sel { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, .12), 0 10px 24px rgba(59, 130, 246, .14); }
.wiz .tc-ico { width: 56px; height: 56px; flex: none; border-radius: 15px; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 6px 14px rgba(15, 23, 42, .12); }
.wiz .tc-ico svg { width: 29px; height: 29px; }
.wiz .tc-ico.tg { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.wiz .tc-ico.max { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.wiz .tc-txt { flex: 1; min-width: 0; padding-top: 2px; }
.wiz .tc-name { font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.wiz .tc-plat { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .3px; margin-top: 8px; }
.wiz .tc-plat.tg { background: #EFF6FF; color: #2563EB; }
.wiz .tc-plat.max { background: #F3EEFE; color: #7C3AED; }
.wiz .tc-desc { font-size: 14.5px; line-height: 1.5; color: var(--muted); margin-top: 12px; }
.wiz .tc-check { position: absolute; top: 18px; right: 18px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: #fff; transition: all .2s var(--ease); }
.wiz .tc-check svg { width: 16px; height: 16px; opacity: 0; transition: opacity .15s ease; }
.wiz .type-card.sel .tc-check { background: var(--blue); border-color: var(--blue); }
.wiz .type-card.sel .tc-check svg { opacity: 1; }
.wiz .type-note { display: flex; align-items: center; gap: 10px; margin-top: 24px; font-size: 14.5px; color: var(--muted); max-width: 840px; }
.wiz .type-note svg { width: 19px; height: 19px; flex: none; color: var(--blue); }

/* step 2: forms */
.wiz .form-wrap { max-width: 680px; }
.wiz .ctx-chip { display: inline-flex; align-items: center; gap: 11px; padding: 10px 16px 10px 12px; border-radius: 13px; background: var(--fill); border: 1px solid var(--line); margin-bottom: 28px; }
.wiz .cc-ico { width: 38px; height: 38px; flex: none; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff; }
.wiz .cc-ico svg { width: 21px; height: 21px; }
.wiz .cc-ico.tg { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.wiz .cc-ico.max { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.wiz .ctx-chip b { font-size: 15px; color: var(--ink); font-weight: 700; }
.wiz .ctx-chip span { font-size: 13px; color: var(--muted); display: block; margin-top: 1px; }
.wiz .cc-change { margin-left: 6px; border: none; background: transparent; color: var(--brand-dark); font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 8px 10px; border-radius: 9px; }
.wiz .cc-change:hover { background: #EFF6FF; }

.wiz .field { margin-bottom: 24px; }
.wiz .field .lab { display: block; font-size: 14.5px; font-weight: 700; color: var(--ink); margin-bottom: 9px; }
.wiz .field .lab .req { color: var(--error); font-weight: 700; margin-left: 2px; }
.wiz .field .opt { font-weight: 500; color: var(--muted-2); font-size: 13px; margin-left: 6px; }
.wiz .inp-wrap { position: relative; display: flex; align-items: center; }
.wiz .field input, .wiz .field textarea {
  width: 100%; font-family: inherit; padding: 14px 16px; background: #fff; border: 2px solid var(--line);
  border-radius: 10px; font-size: 16px; color: var(--ink); outline: none; transition: border-color .18s, box-shadow .18s;
}
.wiz .field textarea { resize: none; line-height: 1.5; min-height: 92px; }
.wiz .field input::placeholder, .wiz .field textarea::placeholder { color: var(--muted-2); }
.wiz .field input:focus, .wiz .field textarea:focus { border-color: var(--blue); box-shadow: var(--focus-ring); }
.wiz .field.mono input { font-family: 'Inter', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 15px; padding-right: 50px; }
.wiz .field .vstat { position: absolute; right: 15px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .18s; }
.wiz .field .vstat svg { width: 22px; height: 22px; }
.wiz .field.ok input { border-color: var(--success); }
.wiz .field.ok .vstat { opacity: 1; color: var(--success); }
.wiz .field.err input, .wiz .field.err textarea { border-color: var(--error); box-shadow: 0 0 0 3px rgba(239, 68, 68, .10); }
.wiz .field.err .vstat { opacity: 1; color: var(--error); }
.wiz .field .hint { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.45; display: flex; align-items: center; gap: 7px; }
.wiz .field .hint svg { width: 15px; height: 15px; flex: none; }
.wiz .field .hint.err { color: var(--error); font-weight: 600; }
.wiz .field .counter { font-size: 12.5px; color: var(--muted-2); margin-top: 7px; text-align: right; }

.wiz .token-help { margin-top: -6px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--fill); }
.wiz .th-toggle { width: 100%; display: flex; align-items: center; gap: 11px; padding: 14px 18px; border: none; background: transparent; font-family: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.wiz .th-toggle .qm { width: 30px; height: 30px; flex: none; border-radius: 9px; background: #EFF6FF; color: var(--brand-dark); display: flex; align-items: center; justify-content: center; }
.wiz .th-toggle .qm svg { width: 18px; height: 18px; }
.wiz .th-toggle .chev { margin-left: auto; color: var(--muted); transition: transform .25s var(--ease); }
.wiz .th-toggle .chev svg { width: 20px; height: 20px; }
.wiz .token-help.open .th-toggle .chev { transform: rotate(180deg); }
.wiz .th-body { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); }
.wiz .token-help.open .th-body { max-height: 360px; }
.wiz .th-inner { padding: 4px 22px 22px; }
.wiz .th-steps { list-style: none; margin: 0; padding: 0; counter-reset: ts; }
.wiz .th-steps li { position: relative; padding: 9px 0 9px 40px; font-size: 14.5px; line-height: 1.55; color: var(--muted); counter-increment: ts; }
.wiz .th-steps li::before { content: counter(ts); position: absolute; left: 0; top: 8px; width: 26px; height: 26px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--brand-dark); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.wiz .th-steps li b { color: var(--ink); font-weight: 700; }
.wiz .th-steps code { font-family: ui-monospace, Menlo, monospace; background: #EFF6FF; color: var(--brand-dark); font-size: 13px; padding: 2px 7px; border-radius: 6px; font-weight: 600; }

.wiz .swatches { display: flex; gap: 12px; }
.wiz .sw { width: 46px; height: 46px; border-radius: 13px; cursor: pointer; border: 3px solid transparent; position: relative; transition: transform .15s var(--ease); box-shadow: 0 3px 8px rgba(15, 23, 42, .12); }
.wiz .sw:hover { transform: scale(1.06); }
.wiz .sw.sel { box-shadow: 0 0 0 3px #fff, 0 0 0 5px currentColor; }
.wiz .sw svg { position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; color: #fff; opacity: 0; }
.wiz .sw.sel svg { opacity: 1; }

.wiz .icon-row { display: flex; align-items: center; gap: 18px; }
.wiz .icon-drop { width: 96px; height: 96px; flex: none; border-radius: 20px; border: 2px dashed #C9D6EA;
  background: repeating-linear-gradient(45deg, #F1F5F9, #F1F5F9 9px, #F8FAFC 9px, #F8FAFC 18px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted-2); cursor: pointer; transition: border-color .18s, color .18s; }
.wiz .icon-drop:hover { border-color: var(--blue); color: var(--brand-dark); }
.wiz .icon-drop svg { width: 26px; height: 26px; }
.wiz .icon-drop span { font-size: 11px; font-family: ui-monospace, Menlo, monospace; }
.wiz .icon-meta b { font-size: 14.5px; color: var(--ink); font-weight: 700; }
.wiz .icon-meta p { font-size: 13.5px; color: var(--muted); margin: 5px 0 0; line-height: 1.5; max-width: 300px; }

.wiz .connect-state { display: none; align-items: center; gap: 13px; margin: 6px 0; padding: 13px 18px; border-radius: 12px; font-size: 14.5px; font-weight: 600; }
.wiz .connect-state.show { display: flex; }
.wiz .connect-state.checking { background: #EFF6FF; color: var(--brand-dark); }
.wiz .connect-state.connected { background: #ECFDF5; color: var(--success-dark); }
.wiz .connect-state .spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(37, 99, 235, .25); border-top-color: var(--brand-dark); animation: spin .7s linear infinite; }
.wiz .connect-state svg { width: 20px; height: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* step 3: success */
.wiz .done-wrap { max-width: 620px; }
.wiz .done-art { width: 92px; height: 92px; border-radius: 26px; background: linear-gradient(135deg, #10B981, #059669); display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 16px 32px rgba(16, 185, 129, .32); margin-bottom: 26px; }
.wiz .done-art svg { width: 48px; height: 48px; }
.wiz .done-wrap h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 12px; }
.wiz .done-wrap .lead { font-size: 17px; line-height: 1.6; color: var(--muted); margin: 0 0 28px; }
.wiz .summary { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--fill); margin-bottom: 24px; }
.wiz .sm-ico { width: 56px; height: 56px; flex: none; border-radius: 15px; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 6px 14px rgba(15, 23, 42, .12); }
.wiz .sm-ico svg { width: 29px; height: 29px; }
.wiz .sm-ico.tg { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.wiz .sm-ico.max { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.wiz .sm-t { font-size: 19px; font-weight: 700; color: var(--ink); }
.wiz .sm-s { font-size: 14px; color: var(--muted); margin-top: 3px; }
.wiz .sm-status { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 13px; border-radius: 8px; background: #ECFDF5; color: #059669; font-size: 13.5px; font-weight: 600; }
.wiz .sm-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.wiz .checklist { border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; margin-bottom: 30px; }
.wiz .cl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.wiz .clh-t { font-size: 16px; font-weight: 700; color: var(--ink); }
.wiz .clh-b { margin-left: auto; font-size: 12.5px; color: var(--muted); background: var(--fill); border: 1px solid var(--line); padding: 5px 11px; border-radius: 7px; font-weight: 600; }
.wiz .cl-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; line-height: 1.5; }
.wiz .cl-item { display: flex; align-items: center; gap: 13px; padding: 11px 0; border-top: 1px solid var(--line); }
.wiz .ci-box { width: 24px; height: 24px; flex: none; border-radius: 7px; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted-2); }
.wiz .ci-box svg { width: 14px; height: 14px; }
.wiz .cl-item.first .ci-box { border-color: var(--blue); background: #EFF6FF; color: var(--brand-dark); }
.wiz .ci-t { font-size: 15px; color: var(--ink); font-weight: 600; }
.wiz .ci-s { font-size: 13px; color: var(--muted); margin-top: 1px; }
.wiz .ci-tag { margin-left: auto; font-size: 12px; color: var(--muted-2); }
.wiz .done-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* footer bar */
.wiz .pane-foot { flex: none; min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 56px; border-top: 1px solid var(--line); background: #fff; }
.wiz .foot-meta { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 9px; }
.wiz .foot-meta svg { width: 18px; height: 18px; color: var(--muted-2); }
.wiz .foot-btns { display: flex; align-items: center; gap: 12px; }

/* wizard buttons (scoped) */
.wiz .btn-primary {
  display: inline-flex; align-items: center; gap: 9px; height: 50px; padding: 0 24px; border-radius: 11px;
  background: linear-gradient(135deg, #3B82F6, #2563EB); color: #fff; border: none; cursor: pointer;
  font-family: inherit; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; text-decoration: none;
  box-shadow: var(--shadow-primary); transition: transform .18s var(--ease), box-shadow .18s ease, opacity .2s ease;
}
.wiz .btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-primary-lg); }
.wiz .btn-primary:active { transform: translateY(0); }
.wiz .btn-primary svg { width: 21px; height: 21px; }
.wiz .btn-primary.disabled { opacity: .5; pointer-events: none; box-shadow: none; filter: saturate(.6); }
.wiz .btn-primary.green { background: linear-gradient(135deg, #10B981, #059669); box-shadow: 0 4px 12px rgba(16, 185, 129, .3); }
.wiz .btn-primary.green:hover { box-shadow: 0 6px 20px rgba(16, 185, 129, .42); }
.wiz .btn-ghost {
  display: inline-flex; align-items: center; gap: 9px; height: 50px; padding: 0 22px; border-radius: 11px;
  background: #fff; color: var(--ink); border: 1px solid var(--line); cursor: pointer;
  font-family: inherit; font-size: 16px; font-weight: 600; white-space: nowrap; transition: all .18s var(--ease); text-decoration: none;
}
.wiz .btn-ghost:hover { border-color: var(--muted-2); background: var(--fill); }
.wiz .btn-ghost svg { width: 20px; height: 20px; }

/* ============================================
   PROJECT OVERVIEW (Обзор проекта)  — scoped .ov
============================================ */
.ov .ph-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 4px 0 22px; flex-wrap: wrap; }
.ov .ph-l { min-width: 0; }
.ov .ph-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted-2); margin-bottom: 9px; }
.ov .ph-l h1 { font-size: 30px; font-weight: 800; color: var(--ink); margin: 0; letter-spacing: -0.02em; }
.ov .ph-sub { font-size: 14.5px; color: var(--muted); margin-top: 7px; line-height: 1.5; max-width: 560px; }
.ov .ph-r { display: flex; align-items: center; gap: 11px; flex: none; flex-wrap: wrap; }
.ov .refreshed { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--muted);
  height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-family: inherit; transition: all .18s var(--ease); }
.ov .refreshed svg { width: 16px; height: 16px; color: var(--muted); }
.ov .refreshed:hover { border-color: var(--line-soft); color: var(--brand-dark); }
.ov .refreshed:hover svg { color: var(--brand-dark); }

.ov .btn-primary { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 11px;
  background: linear-gradient(135deg, #3B82F6, #2563EB); color: #fff; border: none; cursor: pointer; font-family: inherit;
  font-size: 15px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow-primary); transition: transform .18s var(--ease), box-shadow .18s ease; }
.ov .btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-primary-lg); }
.ov .btn-primary:active { transform: translateY(0); }
.ov .btn-primary svg { width: 18px; height: 18px; }
.ov .btn-ghost { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 11px;
  background: #fff; color: var(--ink); border: 1px solid var(--line); cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 600; white-space: nowrap; transition: all .18s var(--ease); }
.ov .btn-ghost:hover { border-color: var(--line-soft); background: #EFF6FF; color: var(--brand-dark); }
.ov .btn-ghost svg { width: 18px; height: 18px; }

.ov .stack { display: flex; flex-direction: column; gap: 18px; }

/* connection */
.ov .conn { display: flex; align-items: center; gap: 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; box-shadow: var(--shadow-sm); }
.ov .c-ico { width: 58px; height: 58px; flex: none; border-radius: 16px; display: flex; align-items: center; justify-content: center; position: relative; }
.ov .c-ico svg { width: 28px; height: 28px; }
.ov .c-tx { flex: 1; min-width: 0; }
.ov .c-tx h3 { font-size: 20px; font-weight: 800; color: var(--ink); margin: 0; letter-spacing: -0.01em; display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.ov .c-tx p { font-size: 14px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.ov .c-tx .token { font-family: ui-monospace, 'JetBrains Mono', Menlo, monospace; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--fill); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; }
.ov .c-act { display: flex; align-items: center; gap: 11px; flex: none; flex-wrap: wrap; }
.ov .live-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; border-radius: 20px; height: 28px; padding: 0 13px; }
.ov .live-pill i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ov .live-pill.ok { color: var(--success-dark); background: #ECFDF5; border: 1px solid #A7F3D0; }
.ov .live-pill.ok i { background: var(--success); box-shadow: 0 0 0 3px rgba(16, 185, 129, .22); animation: ovpulse 2.4s infinite; }
.ov .live-pill.err { color: var(--error-dark); background: #FEF2F2; border: 1px solid #FECACA; }
.ov .live-pill.err i { background: var(--error); }
@keyframes ovpulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.ov .conn.ok .c-ico { background: #ECFDF5; color: var(--success-dark); }
.ov .conn.err { border-color: #FBD5D5; background: linear-gradient(180deg, #FEF6F6, #fff 70%); }
.ov .conn.err .c-ico { background: #FEE2E2; color: var(--error); }

/* done strip */
.ov .done-strip { display: flex; align-items: center; gap: 14px; background: #ECFDF5; border: 1px solid #A7F3D0; border-radius: 14px; padding: 15px 18px; }
.ov .ds-ic { width: 38px; height: 38px; flex: none; border-radius: 11px; background: var(--success); color: #fff; display: flex; align-items: center; justify-content: center; }
.ov .ds-ic svg { width: 21px; height: 21px; }
.ov .ds-tx { flex: 1; min-width: 0; }
.ov .ds-tx b { font-size: 15px; font-weight: 700; color: var(--success-dark); }
.ov .ds-tx span { display: block; font-size: 13px; color: #047857; margin-top: 2px; }
.ov .ds-x { width: 32px; height: 32px; border: none; background: transparent; border-radius: 9px; color: #059669; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ov .ds-x:hover { background: rgba(5, 150, 105, .1); }
.ov .ds-x svg { width: 18px; height: 18px; }

/* quick start */
.ov .qs { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px 26px 8px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.ov .qs::before { content: ""; position: absolute; top: -60px; right: -40px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(59, 130, 246, .07), transparent 70%); pointer-events: none; }
.ov .qs-head { display: flex; align-items: center; gap: 16px; position: relative; }
.ov .qs-ico { width: 52px; height: 52px; flex: none; border-radius: 15px; background: linear-gradient(135deg, #3B82F6, #2563EB); color: #fff; display: flex; align-items: center; justify-content: center; }
.ov .qs-ico svg { width: 27px; height: 27px; }
.ov .qs-htx { flex: 1; min-width: 0; }
.ov .qs-htx h3 { font-size: 19px; font-weight: 800; color: var(--ink); margin: 0; letter-spacing: -0.01em; }
.ov .qs-htx p { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.ov .qs-count { font-size: 13px; font-weight: 700; color: var(--brand-dark); background: #EFF6FF; border: 1px solid var(--line-soft); border-radius: 8px; padding: 6px 11px; flex: none; }
.ov .qs-bar { height: 7px; border-radius: 20px; background: var(--line); margin: 20px 0 4px; overflow: hidden; position: relative; }
.ov .qs-bar i { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, #3B82F6, #2563EB); transition: width .5s var(--ease); }
.ov .qs-steps { margin-top: 14px; }
.ov .qs-step { display: flex; align-items: center; gap: 15px; padding: 15px 0; border-top: 1px solid var(--line); }
.ov .qs-step:first-child { border-top: none; }
.ov .qs-mark { width: 30px; height: 30px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.ov .qs-mark svg { width: 17px; height: 17px; }
.ov .qs-step.done .qs-mark { background: var(--success); color: #fff; }
.ov .qs-step.now .qs-mark { background: #EFF6FF; border: 2px solid var(--blue); color: var(--brand-dark); }
.ov .qs-step.todo .qs-mark { background: var(--fill); border: 1.5px solid var(--line); color: var(--muted-2); }
.ov .qs-stx { flex: 1; min-width: 0; }
.ov .qs-stx b { font-size: 15px; font-weight: 600; color: var(--ink); }
.ov .qs-step.done .qs-stx b, .ov .qs-step.todo .qs-stx b { color: var(--muted); }
.ov .qs-stx span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.ov .qs-step.now .qs-stx b { color: var(--ink); }
.ov .qs-saction { flex: none; }
.ov .qs-now-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 10px; border: none; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #3B82F6, #2563EB); box-shadow: var(--shadow-primary); transition: transform .16s var(--ease); }
.ov .qs-now-btn:hover { transform: translateY(-1px); }
.ov .qs-now-btn svg { width: 15px; height: 15px; }
.ov .qs-wait { font-size: 12.5px; font-weight: 600; color: var(--muted-2); white-space: nowrap; }

/* signals */
.ov .sig-label { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted-2); margin: 6px 0 -4px; }
.ov .sig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.ov .sig { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), border-color .2s ease; }
.ov .sig:hover { transform: translateY(-3px); border-color: var(--line-soft); }
.ov .sig-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ov .sig-ic { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #EFF6FF; color: var(--brand-dark); }
.ov .sig-ic svg { width: 21px; height: 21px; }
.ov .sig-ic.warn { background: #FFFBEB; color: var(--warning-dark); }
.ov .sig-ic.err { background: #FEF2F2; color: var(--error); }
.ov .sig-ic.ok { background: #ECFDF5; color: var(--success-dark); }
.ov .sig-tag { font-size: 12px; font-weight: 700; border-radius: 8px; padding: 4px 10px; display: inline-flex; align-items: center; gap: 6px; }
.ov .sig-tag.ok { color: var(--success-dark); background: #ECFDF5; }
.ov .sig-tag.warn { color: var(--warning-dark); background: #FFFBEB; }
.ov .sig-tag.err { color: var(--error-dark); background: #FEF2F2; }
.ov .sig-tag i { width: 7px; height: 7px; border-radius: 50%; }
.ov .sig-tag.ok i { background: var(--success); } .ov .sig-tag.warn i { background: var(--warning); } .ov .sig-tag.err i { background: var(--error); }
.ov .sig-val { font-size: 34px; font-weight: 800; color: var(--ink); line-height: 1; letter-spacing: -0.02em; }
.ov .sig-name { font-size: 14.5px; font-weight: 600; color: var(--ink); margin-top: 9px; }
.ov .sig-meta { font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.45; flex: 1; }
.ov .sig-meta b { font-weight: 600; color: var(--ink); }
.ov .sig-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.ov .sig-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--brand-dark); cursor: pointer; border: none; background: none; font-family: inherit; padding: 0; }
.ov .sig-link svg { width: 15px; height: 15px; transition: transform .16s ease; }
.ov .sig-link:hover svg { transform: translateX(3px); }
.ov .sig-link.err { color: var(--error-dark); }
.ov .bc-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.ov .bc-prog { height: 6px; border-radius: 20px; background: var(--line); margin: 12px 0 7px; overflow: hidden; }
.ov .bc-prog i { display: block; height: 100%; border-radius: 20px; background: var(--success); }
.ov .bc-prog i.err { background: var(--error); }

/* quick actions */
.ov .qa { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; box-shadow: var(--shadow-sm); }
.ov .qa h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0 0 16px; }
.ov .qa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ov .qa-tile { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-radius: 13px; border: 1px solid var(--line); background: var(--fill); color: var(--ink); font-size: 14.5px; font-weight: 600; cursor: pointer; text-align: left; font-family: inherit; transition: all .16s ease; width: 100%; }
.ov .qa-tile:hover { border-color: var(--line-soft); background: #EFF6FF; color: var(--brand-dark); transform: translateY(-2px); }
.ov .qt-ic { width: 38px; height: 38px; flex: none; border-radius: 11px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--brand-dark); }
.ov .qa-tile:hover .qt-ic { border-color: var(--line-soft); }
.ov .qt-ic svg { width: 20px; height: 20px; }
.ov .qt-tx { flex: 1; min-width: 0; }
.ov .qt-tx b { display: block; font-size: 14.5px; font-weight: 600; }
.ov .qt-tx span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.ov .qa-tile:hover .qt-tx span { color: var(--brand-dark); opacity: .7; }

@media (max-width: 720px) {
  .ov .conn { flex-direction: column; align-items: flex-start; }
  .ov .c-act { width: 100%; }
  .ov .qs-saction { display: none; }
}

/* wizard responsive */
@media (max-width: 980px) {
  .wiz .rail { width: 340px; padding: 36px 28px; }
  .wiz .rail-title { font-size: 26px; }
  .wiz .pane-body { padding: 36px 32px 24px; }
  .wiz .pane-foot { padding: 14px 32px; }
}
@media (max-width: 760px) {
  .wiz .rail { display: none; }
  .wiz .type-grid { grid-template-columns: 1fr; }
  .wiz-topbar { padding: 0 16px; }
  .wiz-topbar .crumbs { display: none; }
  .wiz .pane-body { padding: 28px 18px 20px; }
  .wiz .pane-foot { padding: 14px 18px; flex-wrap: wrap; }
  .wiz .foot-meta { display: none; }
  .wiz .foot-btns { width: 100%; }
  .wiz .foot-btns .btn-primary { flex: 1; justify-content: center; }
  .wiz .scr-head h1 { font-size: 24px; }
  .wiz .done-actions { width: 100%; }
  .wiz .done-actions .btn-primary { flex: 1; justify-content: center; }
}

/* ============================================
   PAGE-LEVEL STATES — error · loading · empty
   (shared helpers: cabShowPageError / cabShowPageLoading)
============================================ */

/* ---- skeleton shimmer ---- */
@keyframes cabShimmer {
  from { background-position: -600px 0; }
  to   { background-position:  600px 0; }
}
.cab-sk {
  background: linear-gradient(90deg, var(--line) 25%, #f0f4f8 50%, var(--line) 75%);
  background-size: 600px 100%;
  animation: cabShimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}
.cab-sk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.cab-sk-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.cab-sk-ico  { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px; }
.cab-sk-row  { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cab-sk-ln   { height: 13px; }
.cab-sk-ln.w60 { width: 60%; }
.cab-sk-ln.w40 { width: 40%; }
.cab-sk-ln.w80 { width: 80%; }
.cab-sk-pill { height: 26px; border-radius: 20px; width: 80px; display: inline-block; }
.cab-sk-btn  { height: 46px; border-radius: 12px; margin-top: 14px; }
.cab-sk-cap  {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 22px; color: var(--muted); font-size: 14px; font-weight: 500;
}
.cab-sk-cap .cab-sk-spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(59,130,246,.25);
  border-top-color: var(--brand-dark);
  animation: cabSpin .7s linear infinite;
  flex: none;
}
@keyframes cabSpin { to { transform: rotate(360deg); } }

/* ---- centered full-page state ---- */
.cab-cstate {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 60px 32px; max-width: 540px; margin: 0 auto;
  animation: viewIn .34s cubic-bezier(.22,.61,.36,1) both;
}
.cab-cstate .cs-art {
  width: 88px; height: 88px; border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 26px; color: #fff;
  box-shadow: 0 18px 40px rgba(0,0,0,.16);
}
.cab-cstate .cs-art svg { width: 40px; height: 40px; }
.cab-cstate .cs-art.blue   { background: linear-gradient(135deg,#3B82F6,#2563EB); }
.cab-cstate .cs-art.violet { background: linear-gradient(135deg,#8B5CF6,#7C3AED); }
.cab-cstate .cs-art.red    { background: linear-gradient(135deg,#EF4444,#DC2626); }
.cab-cstate .cs-art.slate  { background: linear-gradient(135deg,#64748B,#475569); }
.cab-cstate .cs-art.amber  { background: linear-gradient(135deg,#F59E0B,#D97706); }
.cab-cstate h2 {
  font-size: 26px; font-weight: 800; color: var(--ink); margin: 0 0 12px; letter-spacing: -0.02em;
}
.cab-cstate > p {
  font-size: 15.5px; color: var(--muted); line-height: 1.6; margin: 0 0 24px; max-width: 440px;
}
.cab-cstate .cs-url {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 20px; text-align: left; width: 100%;
}
.cab-cstate .cs-url-ico {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  background: #EFF6FF; color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
}
.cab-cstate .cs-url-ico svg { width: 18px; height: 18px; }
.cab-cstate .cs-url-tx { min-width: 0; }
.cab-cstate .cs-url-lab { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted-2); }
.cab-cstate .cs-url-val { font-size: 13.5px; color: var(--ink); margin-top: 3px; word-break: break-all; }
.cab-cstate .cs-url-val .pid { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--brand-dark); font-weight: 600; }
.cab-cstate .cs-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.cab-cstate .cs-note {
  display: flex; align-items: center; gap: 8px;
  margin-top: 20px; font-size: 12.5px; color: var(--muted-2);
}
.cab-cstate .cs-note svg { width: 15px; height: 15px; flex: none; }

/* ---- redirect nudge inside cstate ---- */
.cab-redirect {
  display: flex; align-items: center; gap: 10px;
  background: #EFF6FF; border: 1px solid var(--line-soft);
  border-radius: 11px; padding: 12px 16px; margin-bottom: 20px;
  font-size: 13.5px; color: var(--brand-dark); width: 100%;
}
.cab-redirect svg { width: 16px; height: 16px; flex: none; animation: cabSpin .8s linear infinite; color: var(--brand-dark); }

/* ---- permission banner (noperm) ---- */
.cab-perm-banner {
  display: flex; align-items: flex-start; gap: 16px;
  background: #FFFBEB; border: 1px solid #FDE68A;
  border-radius: 16px; padding: 18px 20px; margin-bottom: 22px;
}
.cab-perm-banner .pb-ico {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  background: #fff; color: var(--warning-dark);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(180,130,0,.14);
}
.cab-perm-banner .pb-ico svg { width: 22px; height: 22px; }
.cab-perm-banner .pb-tx { flex: 1; min-width: 0; }
.cab-perm-banner .pb-tx b { font-size: 15px; font-weight: 700; color: var(--ink); display: block; }
.cab-perm-banner .pb-tx span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.cab-perm-banner .pb-act { flex: none; display: flex; align-items: center; }

@media (max-width: 600px) {
  .cab-cstate { padding: 40px 20px; }
  .cab-cstate h2 { font-size: 22px; }
  .cab-cstate .cs-actions { flex-direction: column; width: 100%; }
  .cab-cstate .cs-actions .btn-primary,
  .cab-cstate .cs-actions .btn-line { width: 100%; justify-content: center; }
}
