/* ============================================================
   VIBE — личный кабинет. Та же оболочка (shell.css).
   Слева меню разделов, справа один экран за раз.
   ============================================================ */

.cab {
  width: 100%; max-width: 1120px; margin: 0 auto;
  padding: clamp(16px, 3vh, 32px) clamp(20px, 5vw, 60px) 90px;
  display: grid; grid-template-columns: 176px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px); align-items: start;
}

/* ---------- Меню разделов ---------- */
.cabnav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 24px; }
.cabnav__item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: Inter, sans-serif; font-size: 14px; color: var(--ink-soft);
  text-decoration: none; padding: 9px 14px; border-radius: 10px;
  transition: color 0.2s, background 0.2s;
}
.cabnav__item:hover { color: var(--ink); background: rgba(0, 0, 0, 0.035); }
.cabnav__item.is-active { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.cabnav__badge {
  font-family: "Space Mono", monospace; font-size: 11px; color: var(--ink-faint);
}

/* ---------- Экран ---------- */
.pane { display: none; }
.pane.is-active { display: block; }

.pane__head { margin-bottom: clamp(24px, 4vh, 36px); }
.pane__eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--ink-faint); margin: 0 0 8px;
}
.pane__title {
  font-family: "Playfair Display", Georgia, serif; font-weight: 400;
  font-size: clamp(30px, 4vw, 42px); line-height: 1.1; margin: 0;
}
.pane__sub { margin: 10px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-soft); max-width: 58ch; }
.pane__section { margin-top: clamp(32px, 5vh, 52px); }
.pane__foot { margin: 28px 0 0; font-size: 13.5px; }
.pane__foot a { color: var(--ink-soft); text-underline-offset: 3px; }
.pane__foot a:hover { color: var(--ink); }

/* ---------- Заголовок секции внутри экрана ---------- */
.sect__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.sect__title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--ink-soft); margin: 0;
}
.sect__count { font-family: "Space Mono", monospace; font-size: 12px; color: var(--ink-faint); }
.sect__more { font-size: 13px; color: var(--ink-soft); text-decoration: none; }
.sect__more:hover { color: var(--ink); }

/* ---------- Баланс ---------- */
.balance {
  display: grid; grid-template-columns: minmax(0, 300px) 1fr;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 20px; overflow: hidden;
}
.balance__now {
  padding: 28px 30px; border-right: 1px solid var(--line-2);
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
}
.balance__label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--ink-soft);
}
.balance__value {
  font-family: "Playfair Display", Georgia, serif; font-size: 64px;
  line-height: 1; margin: 14px 0 0; display: flex; align-items: baseline; gap: 12px;
}
.balance__unit { font-family: Inter, sans-serif; font-size: 15px; color: var(--ink-soft); }
.balance__btn {
  align-self: start; border: none; cursor: pointer; text-decoration: none;
  font-family: Inter, sans-serif; font-weight: 500; font-size: 15px; color: #FFF;
  background: var(--ink); padding: 0 26px; height: 46px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; transition: background 0.2s;
}
.balance__btn:hover { background: #000; }

.balance__sources { display: grid; }
.source { padding: 22px 26px; border-bottom: 1px solid var(--line-2); }
.source:last-child { border-bottom: none; }
.source__title { font-size: 13.5px; font-weight: 500; margin: 0 0 5px; }
.source__note { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); }
.source__num {
  font-family: "Space Mono", monospace; font-size: 12.5px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 1px 6px;
}

/* ---------- Полка разборов ---------- */
.works { display: grid; gap: 10px; }
.work {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto;
  align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 14px; padding: 14px 18px;
  transition: border-color 0.2s var(--ease);
}
.work:hover { border-color: var(--line); }
.work__fav { width: 20px; height: 20px; border-radius: 5px; }
.work__main { min-width: 0; }
.work__name {
  font-family: "Space Mono", monospace; font-size: 14px; color: var(--ink);
  text-decoration: none; display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.work__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.work__meta { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }
.work__swatches { display: flex; gap: 4px; }
.work__swatches i {
  width: 14px; height: 14px; border-radius: 4px;
  border: 1px solid var(--line-2); display: block;
}
.work__acts { display: flex; gap: 14px; }
.work__act {
  font-size: 12.5px; color: var(--ink-soft); text-decoration: none; white-space: nowrap;
  border-bottom: 1px solid var(--line); padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.work__act:hover { color: var(--ink); border-color: var(--ink-soft); }

/* ---------- Журнал ---------- */
.ledger {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 14px; overflow: hidden;
}
.ledger__row {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) 64px;
  align-items: center; gap: 14px; padding: 12px 18px;
  border-bottom: 1px solid var(--line-2); font-size: 13px;
}
.ledger__row:last-child { border-bottom: none; }
.ledger__date { font-family: "Space Mono", monospace; font-size: 12px; color: var(--ink-faint); }
.ledger__what { color: var(--ink-soft); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger__delta { font-family: "Space Mono", monospace; font-size: 13px; text-align: right; color: var(--ink); }
.ledger__delta[data-sign="minus"] { color: var(--ink-faint); }

/* ---------- Пачки ---------- */
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pack {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px;
  padding: 22px 24px; display: flex; flex-direction: column;
}
.pack[data-best="1"] { border-color: var(--ink); }
.pack__n { font-family: "Playfair Display", Georgia, serif; font-size: 34px; line-height: 1; }
.pack__unit { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }
.pack__price { margin-top: 14px; font-size: 15px; }
.pack__each { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.pack__btn {
  margin-top: 18px; text-align: center; text-decoration: none;
  font-size: 14px; color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 10px 0; transition: border-color 0.2s, background 0.2s;
}
.pack__btn:hover { border-color: var(--ink-soft); }
.pack[data-best="1"] .pack__btn { background: var(--ink); color: #FFF; border-color: var(--ink); }

/* ---------- Приглашения ---------- */
.invite {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 20px; padding: 26px 28px;
}
.invite__label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--ink-soft); margin-bottom: 12px;
}
.invite__row { display: flex; gap: 10px; align-items: center; }
.invite__link {
  flex: 1; min-width: 0; font-family: "Space Mono", monospace; font-size: 14px;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  padding: 12px 20px; outline: none;
}
.invite__copy {
  flex: none; border: none; cursor: pointer;
  font-family: Inter, sans-serif; font-size: 14px; font-weight: 500; color: #FFF;
  background: var(--ink); border-radius: var(--r-pill); padding: 0 24px; height: 44px;
  transition: background 0.2s;
}
.invite__copy:hover { background: #000; }
.invite__stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line-2);
}
.invite__stat { display: flex; flex-direction: column; gap: 4px; }
.invite__stat b {
  font-family: "Playfair Display", Georgia, serif; font-weight: 400; font-size: 30px; line-height: 1;
}
.invite__stat span { font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Строки аккаунта ---------- */
.rows { background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; }
.row {
  display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--line-2); font-size: 13.5px;
}
.row:last-child { border-bottom: none; }
.row__k { color: var(--ink-faint); }
.row__v { color: var(--ink); min-width: 0; }
.row__v a { color: var(--ink); text-underline-offset: 3px; }

/* ---------- Баланс в топбаре ---------- */
.topbar__tokens {
  font-family: "Space Mono", monospace; font-size: 13px; text-decoration: none;
  color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 5px 14px; transition: border-color 0.2s;
}
.topbar__tokens:hover { border-color: var(--ink-soft); }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .cab { grid-template-columns: 1fr; gap: 26px; }
  .cabnav {
    position: static; flex-direction: row; gap: 4px;
    overflow-x: auto; padding-bottom: 4px; border-bottom: 1px solid var(--line-2);
  }
  .cabnav__item { white-space: nowrap; border-radius: 10px 10px 0 0; }
  .balance { grid-template-columns: 1fr; }
  .balance__now { border-right: none; border-bottom: 1px solid var(--line-2); }
  .packs { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .work { grid-template-columns: 20px minmax(0, 1fr); }
  .work__swatches, .work__acts { grid-column: 2; }
  .work__acts { margin-top: 4px; }
  .invite__row { flex-wrap: wrap; }
  .invite__copy { width: 100%; }
  .invite__stats { grid-template-columns: 1fr; gap: 16px; }
  .row { grid-template-columns: 1fr; gap: 4px; }
}
