/* Компоненты ЛК Alpineservice — общие для всех экранов прототипа. */

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

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 23px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- шапка ---------- */
.hdr { background: var(--surface); border-bottom: 1px solid var(--border); }
.hdr-in {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-pad);
}
.brand { display: flex; align-items: center; gap: 12px; min-height: var(--tap); color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.logo {
  width: 28px; height: 28px; flex: none; border-radius: var(--r-control);
  background: var(--accent); color: #fff;
  font-size: 16px; font-weight: 600; line-height: 28px; text-align: center;
}
.brand-name { font-size: 18px; font-weight: 600; line-height: 26px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav-item {
  display: inline-flex; align-items: center; height: var(--tap); padding: 0 12px;
  font-size: 14px; font-weight: 500; line-height: 20px; color: var(--text-secondary);
}
.nav-item[aria-current="page"] { color: var(--accent); font-weight: 600; }
.user-strip {
  height: 44px; display: flex; align-items: center; gap: 8px;
  padding: 0 16px; border-top: 1px solid var(--border);
  font-size: 14px; line-height: 20px; color: var(--text-secondary);
}
.burger {
  width: var(--tap); height: var(--tap); flex: none; border: 1px solid var(--border-strong);
  border-radius: var(--r-control); background: var(--surface); position: relative;
}
.burger::before {
  content: ""; position: absolute; left: 12px; right: 12px; top: 15px; height: 2px;
  background: var(--text); box-shadow: 0 6px 0 var(--text), 0 12px 0 var(--text);
}

/* ---------- каркас страницы ---------- */
.page { padding: 32px var(--page-pad) 0; }
.title { font-size: 28px; font-weight: 600; line-height: 41px; margin: 0 0 8px; }
.sub { margin: 0 0 20px; color: var(--text-secondary); font-size: 16px; line-height: 23px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 40px; box-shadow: var(--shadow-card);
}
.card--dense { padding: 28px; }
.card-title {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 20px;
}
.card-title h2 { font-size: 16px; font-weight: 600; line-height: 23px; margin: 0; }
.card-title h2.big { font-size: 28px; line-height: 41px; }
.card + .card { margin-top: 24px; }
.grid { display: grid; grid-template-columns: var(--col-8) var(--col-4); gap: var(--gutter); align-items: start; }
.grid > .card + .card { margin-top: 0; }
.col { display: grid; gap: var(--gutter); }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.value-big { font-size: 28px; font-weight: 600; line-height: 41px; margin: 0 0 4px; }
.muted { color: var(--text-muted); font-size: 14px; line-height: 20px; margin: 0; }
.secondary-text { color: var(--text-secondary); font-size: 16px; line-height: 23px; margin: 0; }

/* ---------- строки настроек ---------- */
.rows { display: grid; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: var(--tap); padding: 6px 0;
}
.row + .row { border-top: 1px solid var(--border); }
.row-label { font-size: 14px; font-weight: 500; line-height: 20px; color: var(--text-secondary); }
.row-value { font-size: 16px; font-weight: 500; line-height: 23px; text-align: right; }
.row-value .link { margin-left: 12px; }
.row-value .off { color: var(--error); font-weight: 500; }
.stack { display: flex; align-items: center; gap: 12px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--btn-h); padding: 0 20px; border-radius: var(--r-control);
  font-family: inherit; font-size: 16px; font-weight: 600; line-height: 23px;
  border: 1px solid transparent; cursor: default; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); height: 44px; }
.btn-block { width: 100%; }

/* ссылка-действие: тап-таргет 44 */
.link {
  display: inline-flex; align-items: center; min-height: var(--tap);
  font-size: 14px; font-weight: 500; line-height: 20px;
}

/* ---------- поля ---------- */
.field { margin-bottom: 16px; }
.label {
  display: block; margin-bottom: 8px;
  font-size: 14px; font-weight: 500; line-height: 20px; color: var(--text-secondary);
}
.input {
  display: flex; align-items: center; width: 100%; height: var(--field-h);
  padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r-control);
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 16px; line-height: 23px;
}
.input .placeholder { color: var(--text-muted); }
.input::placeholder { color: var(--text-muted); opacity: 1; }
.input.is-error { border-color: var(--error); }
.input.is-readonly { background: var(--bg); color: var(--text-secondary); }
.err-msg { margin: 8px 0 0; font-size: 14px; font-weight: 500; line-height: 20px; color: var(--error); }
.hint { margin: 8px 0 0; font-size: 14px; line-height: 20px; color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-foot { margin-top: 24px; }
.form-note { margin: 12px 0 0; font-size: 14px; line-height: 20px; color: var(--text-muted); }
.actions { margin-top: 20px; }

/* ширина карточек */
.auth { max-width: var(--col-6); margin: 0 auto; }
.auth-wide { max-width: var(--col-8); margin: 0 auto; }

/* плашка приглашения */
.invite-note {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin: 0 0 24px;
  border-radius: var(--r-alert); background: var(--accent-soft);
  color: var(--accent-dark); font-size: 14px; font-weight: 500; line-height: 20px;
}

.section-title { font-size: 16px; font-weight: 600; line-height: 23px; margin: 20px 0 12px; }
.stats-line { margin: 12px 0 0; }
.stats-line + .link { margin-top: 4px; }
.res-table { display: grid; gap: 16px; }

/* ---------- сегмент ---------- */
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-item {
  display: inline-flex; align-items: center; height: var(--btn-h); padding: 0 20px;
  border: 1px solid var(--border-strong); border-radius: var(--r-control);
  background: var(--surface); color: var(--text);
  font-size: 16px; font-weight: 600; line-height: 23px;
}
.seg-item.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg-caption { margin: 12px 0 0; font-size: 14px; line-height: 20px; color: var(--text-muted); }

/* ---------- бейджи, алерты ---------- */
.badge {
  display: inline-flex; align-items: center; height: 28px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: 14px; font-weight: 500; line-height: 20px;
  white-space: nowrap;
}
.badge-warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); }
.badge-soft { background: var(--accent-soft); color: var(--accent-dark); }
.badge-invite {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px;
  border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-dark);
  font-size: 14px; font-weight: 500; line-height: 20px;
}
.alert {
  border-radius: var(--r-alert); padding: 16px; background: var(--warn-bg);
  border: 1px solid var(--warn-border); color: var(--warn-text);
}
.alert h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; line-height: 20px; }
.alert p { margin: 0; font-size: 14px; line-height: 20px; }

/* ---------- ссылка приглашения, QR ---------- */
.invite-line { display: flex; align-items: center; gap: 12px; }
.invite-url {
  flex: 1 1 auto; display: flex; align-items: center; min-height: var(--field-h);
  padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r-control);
  background: var(--bg); color: var(--text); font-size: 16px; line-height: 23px;
  overflow: hidden; white-space: nowrap;
}
.qr {
  width: 176px; height: 176px; border: 1px solid var(--border-strong); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text-muted);
  font-size: 16px; font-weight: 500; line-height: 23px;
}
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ---------- шаги, статистика, история ---------- */
.steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.step { display: flex; align-items: flex-start; gap: 12px; }
.step-num {
  width: 28px; height: 28px; flex: none; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-dark);
  font-size: 14px; font-weight: 600; line-height: 28px; text-align: center;
}
.step-text { margin: 2px 0 0; font-size: 16px; line-height: 23px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.stat-v { font-size: 20px; font-weight: 600; line-height: 28px; }
.stat-k { font-size: 14px; line-height: 20px; color: var(--text-secondary); }
table.history { width: 100%; border-collapse: collapse; }
.history th {
  text-align: left; padding: 0 12px 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 500; line-height: 20px; color: var(--text-secondary);
}
.history td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); font-size: 16px; line-height: 23px; }
.history tr:last-child td { border-bottom: 0; padding-bottom: 0; }
.history .num { white-space: nowrap; }
.badge-state { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: var(--r-pill); font-size: 14px; font-weight: 500; }
.state-ok { background: var(--accent-soft); color: var(--accent-dark); }
.state-wait { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); }
.state-cancel { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ---------- index ---------- */
.index-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.index-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.index-item .route { font-size: 16px; font-weight: 600; line-height: 23px; }
.index-item .what { font-size: 14px; line-height: 20px; color: var(--text-secondary); }

/* ---------- состояния, зависящие от ширины ---------- */
.mobile-only { display: none; }

@media (max-width: 480px) {
  :root { --page-pad: 16px; }
  .mobile-only { display: block; }
  .mobile-only.stats { display: grid; }
  .user-strip.mobile-only { display: flex; }
  .desktop-only { display: none; }

  .hdr-in { height: 60px; }
  .logo { width: 24px; height: 24px; border-radius: 6px; font-size: 14px; line-height: 24px; }
  .brand-name { font-size: 16px; line-height: 23px; }

  .page { padding: 20px 16px 0; }
  .title, .card-title h2.big { font-size: 24px; line-height: 35px; }
  .card { padding: 20px; }
  .card--dense { padding: 16px; }
  .card + .card { margin-top: 12px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .col { gap: 12px; }
  .field { margin-bottom: 16px; }
  .form-row { grid-template-columns: 1fr; gap: 16px; }
  .actions { margin-top: 20px; }
  .invite-line { flex-wrap: wrap; }
  .invite-url { flex-basis: 100%; }
  .btn-secondary { height: var(--btn-h); }
  .qr { width: 144px; height: 144px; }
  .seg { flex-direction: column; gap: 8px; align-items: stretch; }
  .seg-item { width: 100%; }
  .stats { gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat-v { font-size: 20px; line-height: 28px; }
  .row { padding: 2px 0; }
  .row + .row { border-top: 0; }
  .rows { gap: 2px; }
  .history th, .history td { padding-right: 8px; font-size: 14px; line-height: 20px; }
  .history td { padding: 8px 8px 8px 0; }
  .card--dense .card-title { margin-bottom: 12px; }
}

/* мобильный: активный пункт сегмента переключается на «Физическое лицо» */
@media (max-width: 480px) {
  .seg-item.on-d { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
  .seg-item.on-m { background: var(--accent); border-color: var(--accent); color: #fff; }
}

/* карточки реферальной страницы (десктоп) — плотнее остальных */
body.ref .card--dense { padding: 20px 24px; }
body.ref .card + .card { margin-top: 20px; }
body.ref .sub { margin-bottom: 16px; }
body.ref .steps { gap: 10px; }
body.ref .history th { padding: 0 12px 8px 0; }
body.ref .history td { padding: 7px 12px 7px 0; }

/* карточка профиля (десктоп) — плотнее остальных */
body.prof .card { padding: 36px; }
body.prof .section-title { margin: 16px 0 10px; }

/* ---------- уплотнение под кадры 900 (десктоп) и 818 (мобильный) ---------- */
@media (max-width: 480px) {
  /* регистрация: подзаголовок не нужен, карточка и так длинная */
  .auth .sub { display: none; }
  /* строка «поле + кнопка» не переносится */
  .invite-line.keep { flex-wrap: wrap; row-gap: 8px; }
  .invite-line.keep > :first-child { flex-basis: 100%; }
  .invite-line.keep .btn { width: 100%; justify-content: center; padding: 0 12px; }

  /* дашборд: две колонки, явные строки */
  body.dash .grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  body.dash .col { display: contents; }
  body.dash .card { grid-column: span 2; padding: 12px 14px; }
  body.dash .card.half { grid-column: span 1; }
  body.dash .o-tariff { grid-row: 1; }
  body.dash .o-invite { grid-row: 2; }
  body.dash .o-profile { grid-row: 3; }
  body.dash .o-plugins { grid-row: 4; grid-column: 1; }
  body.dash .o-security { grid-row: 4; grid-column: 2; }
  body.dash .card + .card { margin-top: 0; }
  body.dash .card-title { margin-bottom: 6px; }
  body.dash .row { min-height: 30px; padding: 0; gap: 8px; }
  body.dash .title { display: none; }
  body.dash .invite-url { font-size: 14px; min-height: 40px; }
  body.dash .actions { margin-top: 8px; }
  body.dash .stats-line { margin-top: 8px; }
  /* абзац «Раздел появится…» — пояснение, на 360 не помещается */
  body.dash .o-plugins .secondary-text { font-size: 14px; line-height: 20px; }
  /* уплотнение: карточки 10/12, строки 28, кнопка 44 */
  body.dash .page { padding-top: 8px; }
  body.dash .value-big { font-size: 24px; line-height: 35px; }
  body.dash .card { padding: 10px 12px; }
  body.dash .card-title { margin-bottom: 4px; }
  body.dash .row { min-height: 28px; }
  body.dash .btn-secondary { height: var(--tap); }
  /* карточка «Безопасность» — в узкой половине: лейбл над значением */
  body.dash .o-security .row { flex-direction: column; align-items: flex-start; gap: 2px; }
  body.dash .invite-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  body.dash .invite-foot .stats-line { margin: 0; }
  /* уплотнение под кадр 818: карточки 8/12, зазоры 6 — иначе 841 px и обрезка бейджа «скоро» */
  body.dash .grid { gap: 6px; }
  body.dash .card { padding: 8px 12px; }
  body.dash .card-title { margin-bottom: 2px; }
  /* «Плагины» + бейдж «скоро» не влезают в половину карточки — бейдж переносится */
  body.dash .o-plugins .card-title { flex-wrap: wrap; row-gap: 2px; }

  /* приведи друга: компактные карточки, QR 88, порядок строк задан явно */
  body.ref .page { padding-top: 8px; }
  body.ref .grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  body.ref .col { display: contents; }
  body.ref .card { grid-column: span 2; padding: 10px 14px; }
  body.ref .c-link { grid-row: 1; }
  body.ref .c-steps { grid-row: 2; }
  body.ref .c-qr { grid-row: 3; }
  body.ref .c-empty { grid-row: 4; }
  body.ref .c-stats { grid-row: 5; }
  body.ref .card + .card { margin-top: 0; }
  body.ref .c-empty .secondary-text { font-size: 14px; line-height: 20px; }
  body.ref .note { display: none; }
  /* заголовки карточек без заголовка-ключа: на 360 экономим 58 px */
  body.ref .c-link .card-title,
  body.ref .c-stats .card-title { display: none; }
  body.ref .card-title { margin-bottom: 6px; }
  body.ref .invite-url { font-size: 14px; min-height: 44px; }
  body.ref .qr { width: 72px; height: 72px; border-radius: 8px; }
  body.ref .steps { gap: 6px; }
  body.ref .step { gap: 8px; }
  body.ref .step-num { width: 24px; height: 24px; line-height: 24px; }
  body.ref .step-text { margin-top: 0; font-size: 14px; line-height: 20px; }
  body.ref .stats { gap: 6px; }
  body.ref .stat { padding: 6px 10px; }
  body.ref .stat-v { font-size: 18px; line-height: 24px; }
  body.ref .stats-line { margin-top: 8px; }

  /* профиль: карточка 20, сегмент 44, подзаголовок скрыт */
  body.prof .card { padding: 20px; }
  body.prof .sub { display: none; }
  body.prof .seg-item { height: var(--tap); }
  body.prof .seg-caption { margin-top: 8px; }
}

/* ================= v3: внешний вход (Яндекс ID, VK ID) ================= */
.oauth-block { margin: 0 0 20px; }
.oauth-cap {
  margin: 0 0 10px;
  font-size: 14px; font-weight: 500; line-height: 20px; color: var(--text-secondary);
}
.oauth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--btn-h); padding: 0 16px;
  border: 1px solid var(--border-strong); border-radius: var(--r-control);
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 16px; font-weight: 500; line-height: 23px;
  cursor: default; text-align: left;
}
.oauth-ico {
  width: 20px; height: 20px; flex: none; border-radius: 4px; background: var(--border-strong);
}
.oauth-txt { min-width: 0; }
.sep { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.sep::before, .sep::after { content: ""; height: 1px; flex: 1 1 auto; background: var(--border); }
.sep-txt { font-size: 14px; line-height: 20px; color: var(--text-muted); white-space: nowrap; }

/* кнопки в столбик (экран конфликта e-mail) */
.stack-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }

/* ================= v3: способы входа и 2FA ================= */
.mth-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 6px 0; border-top: 1px solid var(--border);
}
.mth-row.mobile-only { display: none; }
.rows > .mth-row:first-child { border-top: 0; }
.mth-main { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.mth-label { font-size: 16px; font-weight: 500; line-height: 23px; }
.mth-status { font-size: 14px; line-height: 20px; color: var(--text-muted); }
.mth-status.on { color: var(--accent-dark); font-weight: 500; }
.btn.is-disabled { background: var(--bg); border-color: var(--border); color: var(--text-muted); }
.mth-note { margin: 6px 0 12px; font-size: 14px; line-height: 20px; color: var(--text-muted); }
.mth-cap { margin: 14px 0 0; font-size: 14px; line-height: 20px; color: var(--text-muted); }
.alert .alert-foot { margin: 8px 0 0; }
.alert .alert-foot .link { color: var(--warn-text); }
.type-mobile { display: none; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-head .label { margin-bottom: 0; }

/* десктоп: блок внешнего входа и форма держат кадр 900 по высоте */
body.reg .page { padding-top: 24px; }
body.reg .card { padding: 26px 40px; }
body.reg .sub { margin-bottom: 14px; }
body.reg .invite-note { margin-bottom: 14px; padding: 8px 14px; }
body.reg .oauth-block { margin-bottom: 14px; }
body.reg .oauth-cap { margin-bottom: 8px; }
body.reg .sep { margin: 14px 0; }
body.reg .field { margin-bottom: 12px; }
body.reg .err-msg { margin-top: 6px; }
body.reg .hint { margin-top: 6px; }
body.reg .actions { margin-top: 16px; }

@media (min-width: 481px) {
  .mth-main { flex-direction: row; align-items: center; gap: 16px; }
  body.prof .grid > .card--dense { padding: 28px; }
}

@media (max-width: 480px) {
  .oauth-row { grid-template-columns: 1fr; gap: 8px; }
  .oauth-btn { min-height: var(--tap); }
  .oauth-cap { margin: 0 0 6px; }
  .sep { margin: 10px 0; }
  .mth-row { min-height: 44px; padding: 4px 0; }
  .mth-row.desktop-only { display: none; }
  .mth-row.mobile-only { display: flex; }
  .mth-row .btn-secondary { height: var(--tap); }
  .mth-label { font-size: 14px; line-height: 20px; }
  .mth-note { margin: 4px 0 10px; }
  .mobile-only.btn { display: inline-flex; }
  .alert-card { display: none; }
  .type-mobile.mobile-only { display: grid; }
  .type-mobile .row { flex-direction: column; align-items: flex-start; gap: 2px; padding: 0; }
  .type-mobile .row .link { min-height: 0; }

  /* профиль на 360: компактная вёрстка под кадр 818 */
  body.prof .page { padding-top: 8px; }
  body.prof .grid { grid-template-columns: minmax(0, 1fr); }
  body.prof .card, body.prof .grid > .card--dense { padding: 12px; }
  body.prof .field .hint { display: none; }
  body.prof .field-head { min-height: var(--tap); }
  body.prof .mth-row { padding: 0; }
  body.prof .mth-note { margin: 2px 0 6px; }
  body.prof .mth-cap { margin-top: 10px; }
  body.prof .actions { margin-top: 6px; }
  body.prof .title { margin-bottom: 6px; }
  body.prof .invite-line { flex-wrap: nowrap; }
  body.prof .invite-line .input { flex: 1 1 auto; width: auto; min-width: 0; }
  body.prof .invite-line .btn { padding: 0 12px; font-size: 14px; height: var(--tap); }
  body.prof .methods-card .card-title { margin-bottom: 6px; }

  /* регистрация на 360: внешний вход + форма в одном кадре */
  body.reg .page { padding-top: 8px; }
  body.reg .card { padding: 16px; }
  body.reg .invite-note { margin-bottom: 12px; padding: 8px 12px; }
  body.reg .label { margin-bottom: 6px; }
  body.reg .field { margin-bottom: 12px; }
  body.reg .err-msg { margin-top: 4px; }
  body.reg .hint { margin-top: 6px; }
  body.reg .oauth-block { margin-bottom: 10px; }
  body.reg .sep { margin: 8px 0; }
  body.reg .actions { margin-top: 10px; }
  /* кадр по приглашению: плашка занимает 60 px, состояния ошибок сняты на /register */
  body.reg-ref .input.is-error { border-color: var(--border-strong); }
  body.reg-ref .err-msg { display: none; }
}

/* ================= v4a: записи, загрузка, оплата ================= */

/* сетка с узкой левой колонкой (детальная запись: плеер слева, расшифровка справа) */
.grid.rev { grid-template-columns: var(--col-4) var(--col-8); }

/* панель фильтров */
.toolbar {
  display: grid; grid-template-columns: minmax(0, 1fr) 190px 200px auto;
  gap: 12px; align-items: center; margin: 0 0 16px;
}
.select {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; height: var(--field-h); padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-control);
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 16px; line-height: 23px;
}
.select .caret {
  width: 10px; height: 6px; flex: none; background: var(--text-muted);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* таблица */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; padding: 0 12px 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 500; line-height: 20px; color: var(--text-secondary);
  white-space: nowrap;
}
.tbl td {
  padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border);
  font-size: 16px; line-height: 23px; vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: 0; padding-bottom: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl .nowrap { white-space: nowrap; }
.tbl .dim { color: var(--text-secondary); }
.tbl .rec-name { font-weight: 500; }
.tbl tr.is-busy .rec-name { color: var(--text-secondary); }
.tbl .cell-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.link.is-off { color: var(--text-muted); }
.prog { height: 4px; border-radius: var(--r-pill); background: var(--border); overflow: hidden; }
.prog > i { display: block; height: 4px; background: var(--warn-text); }
.prog.is-wide { height: 8px; margin-top: 10px; }
.prog.is-wide > i { height: 8px; background: var(--accent); }
.badge-err { background: var(--error-bg); color: var(--error); border: 1px solid var(--error); }
.badge-cell { display: grid; gap: 6px; justify-items: start; }
.badge-cell .prog { width: 92px; }

/* аватары участников */
.avs { display: flex; align-items: center; }
.av {
  width: 30px; height: 30px; flex: none; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-dark);
  font-size: 14px; font-weight: 600; line-height: 30px; text-align: center;
  border: 2px solid var(--surface);
}
.av + .av { margin-left: -8px; }
.av.more { background: var(--bg); color: var(--text-secondary); }

/* кнопка-иконка «…» */
.icon-btn {
  width: var(--tap); height: var(--tap); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: var(--r-control);
  background: var(--surface); color: var(--text-secondary);
  font-family: inherit; font-size: 20px; font-weight: 600; line-height: 1;
}
.icon-btn.is-plain { border: 0; background: transparent; }

/* демонстрация состояния внутри кадра */
.state-demo {
  margin-top: 18px; padding: 12px 14px;
  border: 1px dashed var(--border-strong); border-radius: var(--r-alert); background: var(--bg);
}
.state-cap { margin: 0 0 10px; font-size: 14px; line-height: 20px; color: var(--text-muted); }
.empty-box {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.empty-box p { margin: 0; font-size: 16px; line-height: 23px; }
.empty-box .btn { flex: none; }

/* карточки записей (мобильный) */
.rec-list { display: none; }
.rec-card {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.rec-card + .rec-card { margin-top: 8px; }
.rec-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rec-date { font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.rec-name { margin: 6px 0 4px; font-size: 16px; font-weight: 500; line-height: 23px; }
.rec-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 14px; line-height: 20px; color: var(--text-secondary);
}
.rec-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border);
}

/* плеер-заглушка */
.player { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.pl-top { display: flex; align-items: center; gap: 14px; }
.play {
  width: 56px; height: 56px; flex: none; border-radius: var(--r-pill);
  background: var(--accent); display: flex; align-items: center; justify-content: center;
}
.play i {
  display: block; width: 0; height: 0; border-style: solid;
  border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}
.pl-name { font-size: 16px; font-weight: 500; line-height: 23px; }
.pl-time { font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.timeline { margin-top: 16px; }
.tl-track { height: 6px; border-radius: var(--r-pill); background: var(--border-strong); overflow: hidden; }
.tl-track > i { display: block; height: 6px; background: var(--accent); }
.tl-scale {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-size: 14px; line-height: 20px; color: var(--text-muted);
}

/* вкладки (мобильный) */
.tabs { display: none; border-bottom: 1px solid var(--border); margin: 14px 0 12px; }
.tab {
  display: inline-flex; align-items: center; justify-content: center; flex: 1 1 0;
  min-height: var(--tap); padding: 0 6px; margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-size: 14px; font-weight: 500; line-height: 20px; color: var(--text-secondary);
}
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* расшифровка */
.trs { display: grid; gap: 12px; }
.tr { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: start; }
.tr-time {
  display: flex; align-items: flex-start; min-height: var(--tap);
  font-size: 14px; font-weight: 500; line-height: 23px;
}
.tr-sp { margin: 0; font-size: 14px; font-weight: 600; line-height: 23px; color: var(--text-secondary); }
.tr-tx { margin: 2px 0 0; font-size: 16px; line-height: 23px; }

/* участники и метаданные */
.ppl { display: grid; }
.ppl-row { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; line-height: 23px; }
.ppl-role { margin-left: auto; font-size: 14px; line-height: 20px; color: var(--text-muted); }
.meta { display: grid; gap: 8px; }
.meta-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.meta-row .k { font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.meta-row .v { font-size: 16px; font-weight: 500; line-height: 23px; }

/* драг-н-дроп */
.drop {
  padding: 24px 20px; border: 2px dashed var(--border-strong); border-radius: 12px;
  background: var(--bg); text-align: center;
}
.drop-ico {
  width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-dark);
  font-size: 24px; line-height: 48px; text-align: center;
}
.drop-title { margin: 0 0 4px; font-size: 16px; font-weight: 500; line-height: 23px; }
.drop-cap { margin: 0 0 14px; font-size: 14px; line-height: 20px; color: var(--text-muted); }
.file-chip {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.file-ico {
  width: 36px; height: 36px; flex: none; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-dark);
  font-size: 14px; font-weight: 600; line-height: 36px; text-align: center;
}
.file-main { flex: 1 1 auto; min-width: 0; }
.file-name { font-size: 16px; font-weight: 500; line-height: 23px; }
.file-meta { font-size: 14px; line-height: 20px; color: var(--text-muted); }
.up-line { display: flex; align-items: center; gap: 12px; }
.up-line .prog { flex: 1 1 auto; height: 8px; }
.up-line .prog > i { height: 8px; background: var(--accent); }
.up-cap { font-size: 14px; font-weight: 500; line-height: 20px; white-space: nowrap; }

/* чекбокс: сам чекбокс 20, тап-таргет — вся строка 44 */
.check { display: flex; align-items: flex-start; gap: 10px; min-height: var(--tap); font-size: 16px; line-height: 23px; }
.check input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
.check + .check { margin-top: 4px; }
.check-cap { margin: 2px 0 0 30px; font-size: 14px; line-height: 20px; color: var(--text-muted); }

/* сводка заказа */
.sum { display: grid; gap: 10px; }
.sum-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.sum-row .k { font-size: 16px; line-height: 23px; color: var(--text-secondary); }
.sum-row .v { font-size: 16px; font-weight: 500; line-height: 23px; text-align: right; }
.sum-total {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 20px; font-weight: 600; line-height: 28px;
}

/* алерты v4 */
.alert.alert-error { background: var(--error-bg); border-color: var(--error); color: var(--error); }
.alert-error .alert-foot { margin: 12px 0 0; }
.alert-error .alert-foot .btn { color: var(--text); }
.alert-warn .alert-foot { margin: 12px 0 0; }
.alert-warn .alert-foot .btn { color: var(--text); }

/* способ оплаты */
.pay-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg);
}
.card-plate { width: 44px; height: 30px; flex: none; border-radius: 6px; background: var(--border-strong); }
.pay-main { flex: 1 1 auto; min-width: 0; }
.pay-num { font-size: 16px; font-weight: 500; line-height: 23px; }
.pay-exp { font-size: 14px; line-height: 20px; color: var(--text-muted); }

/* документы карточками (мобильный) */
.doc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: var(--tap); padding: 8px 0; border-top: 1px solid var(--border);
}
.doc-row:first-child { border-top: 0; }
.doc-main { min-width: 0; }
.doc-date { font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.doc-num { font-size: 16px; font-weight: 500; line-height: 23px; }
.doc-right { text-align: right; }

/* компактная кнопка-ссылка в строке */
.btn.btn-sm { height: var(--tap); padding: 0 14px; font-size: 14px; }

/* заголовок страницы с действиями справа */
.head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.head-row .title { margin: 0 0 4px; }
.head-row .sub { margin: 0; }
.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* плотность кадров v4 */
body.mtg .card, body.bill .card, body.chk .card, body.upl .card { padding: 28px; }
body.mtg1 .card { padding: 24px; }

@media (max-width: 480px) {
  .grid.rev { grid-template-columns: minmax(0, 1fr); }
  .toolbar { grid-template-columns: 1fr; gap: 8px; margin-bottom: 10px; }
  .tbl-wrap { display: none; }
  .rec-list { display: grid; gap: 8px; }
  .tabs { display: flex; }

  body.mtg .page, body.mtg1 .page, body.upl .page, body.bill .page, body.chk .page { padding-top: 8px; }
  body.mtg .sub, body.upl .sub, body.bill .sub, body.chk .sub { display: none; }
  body.mtg .card, body.bill .card, body.chk .card, body.upl .card { padding: 14px; }
  body.mtg1 .card { padding: 14px; }
  body.mtg .card + .card, body.mtg1 .card + .card,
  body.upl .card + .card, body.bill .card + .card, body.chk .card + .card { margin-top: 10px; }
  body.mtg .title, body.mtg1 .title, body.upl .title, body.bill .title, body.chk .title {
    font-size: 24px; line-height: 35px; margin-bottom: 4px;
  }
  body.mtg .state-demo { margin-top: 10px; padding: 10px 12px; }
  body.mtg .empty-box { flex-direction: column; align-items: stretch; padding: 12px; gap: 10px; }
  body.mtg .empty-box .btn { width: 100%; }
  body.mtg .icon-btn { width: var(--tap); height: var(--tap); }  /* тап-таргет меню действий */
  body.mtg1 .sub { margin: 0 0 10px; font-size: 14px; line-height: 20px; }
  body.mtg1 .title-actions { gap: 8px; margin-bottom: 10px; }
  body.mtg1 .title-actions .btn { height: var(--tap); padding: 0 12px; font-size: 14px; }
  body.mtg1 .player { padding: 12px; }
  body.mtg1 .play { width: 48px; height: 48px; }
  body.mtg1 .timeline { margin-top: 12px; }
  body.mtg1 .tr { grid-template-columns: 48px minmax(0, 1fr); gap: 8px; }
  body.mtg1 .trs { gap: 8px; }
  body.upl .drop { padding: 18px 14px; }
  body.upl .drop-ico { width: 40px; height: 40px; line-height: 40px; margin-bottom: 10px; }
  body.bill .card--dense, body.chk .card--dense { padding: 14px; }
  body.bill .value-big, body.chk .value-big { font-size: 24px; line-height: 35px; }
  body.bill .alert, body.chk .alert { padding: 12px; }
  body.chk .form-row, body.bill .form-row { grid-template-columns: 1fr; gap: 10px; }
  body.chk .field, body.bill .field { margin-bottom: 10px; }
}


/* ---------- v4a-dense: чекбокс 44 и плотность кадров ---------- */
.check { position: relative; }
.check input[type="checkbox"] {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; margin: 0; opacity: 0; cursor: pointer;
}
.check .cbox {
  width: 20px; height: 20px; flex: none; border: 1.5px solid var(--border-strong);
  border-radius: 4px; background: var(--surface);
}
.check input[type="checkbox"]:checked + .cbox { background: var(--accent); border-color: var(--accent); position: relative; }
.check input[type="checkbox"]:checked + .cbox::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 5px; height: 10px; margin: -7px 0 0 -3px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.check input[type="checkbox"]:focus-visible + .cbox { outline: 2px solid var(--accent); outline-offset: 2px; }

body.bill .card, body.chk .card { padding: 22px; }
body.chk .field { margin-bottom: 12px; }
body.bill .card-title, body.chk .card-title { margin-bottom: 14px; }

@media (max-width: 480px) {
  body.mtg .toolbar { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
  body.mtg .toolbar .input, body.mtg .toolbar .btn { grid-column: 1 / -1; }
  body.mtg .rec-top { flex-wrap: wrap; row-gap: 4px; }
  body.mtg .rec-card { padding: 10px 12px; }
  body.mtg .rec-name { margin: 4px 0 2px; }
  body.mtg .card--dense { padding: 12px; }
  body.mtg .state-demo { display: none; }

  body.mtg1 .head-row { margin-bottom: 6px; }
  body.mtg1 .card { padding: 12px; }
  body.mtg1 .card > .card-title { display: none; }
  body.mtg1 .tabs { margin: 0 0 8px; }
  body.mtg1 .state-demo { margin-top: 6px; padding: 10px; }
  body.mtg1 .alert { padding: 10px 12px; }
  body.mtg1 .alert p + p, body.mtg1 .alert .alert-foot { margin: 8px 0 0; }

  body.upl .card { padding: 12px; }

  body.bill .card, body.chk .card { padding: 12px; }
  body.bill .card + .card, body.chk .card + .card { margin-top: 8px; }
  body.bill .grid, body.chk .grid, body.bill .col, body.chk .col { gap: 8px; }
  body.bill .divider { display: none; }
  body.bill .value-big { font-size: 24px; line-height: 30px; margin: 0; }
  body.bill .muted { margin: 0 0 4px; }
  body.bill .rows { gap: 0; }
  body.bill .row { padding: 1px 0; }
  body.bill .stack { gap: 8px; }
  body.bill .stack .btn { font-size: 14px; padding: 0 12px; }
  body.bill .doc-row { padding: 2px 0; min-height: 48px; }
  body.bill .doc-date, body.bill .doc-num { font-size: 14px; line-height: 18px; }
  body.bill .alert, body.chk .alert { padding: 10px 12px; }
  body.bill .mth-cap { margin: 4px 0 0; }
  body.bill .alert .alert-foot, body.chk .alert .alert-foot { margin: 8px 0 0; }

  body.chk .head-row { margin-bottom: 6px; }
  body.chk .field { margin-bottom: 8px; }
  body.chk .form-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  body.chk .hint { margin: 0; }
  body.chk .actions { margin-top: 10px; }
  body.chk .check + .check { margin-top: 2px; }
  body.chk .sum { gap: 4px; }
  body.chk .sum-row .k, body.chk .sum-row .v { font-size: 15px; line-height: 20px; }
  body.chk .sum-total { font-size: 18px; line-height: 24px; padding-top: 8px; }
}


/* ---------- v4a-dense-2 ---------- */
@media (max-width: 480px) {
  body.bill .title, body.chk .title, body.mtg .title, body.mtg1 .title {
    font-size: 22px; line-height: 30px; margin-bottom: 2px;
  }
  body.bill .head-row, body.chk .head-row, body.mtg .head-row, body.mtg1 .head-row {
    margin-bottom: 4px;
  }
  body.bill .card-title { margin-bottom: 6px; }
  body.bill .row { min-height: 26px; padding: 0; }
  body.bill .row-label, body.bill .row-value { font-size: 15px; line-height: 22px; }
  body.bill .alert { padding: 8px 10px; }
  body.bill .alert .alert-foot { margin: 6px 0 0; }
  body.bill .muted { font-size: 14px; line-height: 18px; }

  body.chk .field { margin-bottom: 6px; }
  body.chk .label { margin-bottom: 4px; }
  body.chk .hint { line-height: 18px; }
  body.chk .alert { padding: 8px 10px; }
  body.chk .alert .alert-foot { margin: 6px 0 0; }
  body.chk .actions { margin-top: 8px; }
  body.chk .sum { gap: 2px; }

  body.mtg .rec-list { gap: 6px; }
  body.mtg .toolbar { margin-bottom: 6px; }
  body.mtg1 .trs { gap: 6px; }
  body.mtg1 .player { padding: 10px; }
}


/* ---------- v4a-dense-3 ---------- */
@media (max-width: 480px) {
  body.mtg .toolbar { gap: 6px; margin-bottom: 6px; }
  body.mtg .toolbar .input, body.mtg .toolbar .select, body.mtg .toolbar .btn { height: 44px; }
  body.mtg .card--dense { padding: 10px 12px; }
  body.mtg .rec-list { gap: 6px; }
  body.mtg .rec-card { padding: 8px 10px; }
  body.mtg .rec-top { row-gap: 2px; }

  body.mtg1 .head-row { margin-bottom: 4px; }
  body.mtg1 .title { font-size: 22px; line-height: 30px; }
  body.mtg1 .sub { font-size: 14px; line-height: 18px; margin: 0 0 6px; }
  body.mtg1 .card { padding: 10px 12px; }
  body.mtg1 .player { padding: 10px; }
  body.mtg1 .tabs { margin: 0 0 6px; }
  body.mtg1 .trs { gap: 6px; }
  body.mtg1 .tr-sp { font-size: 14px; line-height: 20px; }
  body.mtg1 .tr-tx { font-size: 15px; line-height: 21px; }
  body.mtg1 .state-demo { padding: 8px 10px; margin-top: 4px; }
  body.mtg1 .state-demo .state-cap { display: none; }
  body.mtg1 .alert { padding: 8px 10px; }
  body.mtg1 .alert .alert-foot { margin: 6px 0 0; }

  body.bill .card--dense { padding: 10px 12px; }
  body.bill .pay-card { padding: 8px 10px; }
  body.bill .pay-exp { line-height: 18px; }
  body.bill .grid, body.bill .col { gap: 6px; }
  body.bill .alert { padding: 6px 10px; }
  body.bill .alert p + p { margin: 6px 0 0; }
  body.bill .stack { margin-top: 8px; }

  body.chk .card--dense { padding: 10px 12px; }
  body.chk .field { margin-bottom: 4px; }
  body.chk .label { margin-bottom: 3px; }
  body.chk .alert { padding: 6px 10px; }
  body.chk .alert p + p { margin: 6px 0 0; }
  body.chk .grid, body.chk .col { gap: 6px; }
}


/* ---------- v4a-dense-4 ---------- */
@media (max-width: 480px) {
  body.bill .card--dense { padding: 8px 12px; }
  body.bill .grid, body.bill .col { gap: 6px; }
  body.bill .alert { padding: 4px 10px; }
  body.bill .alert p { line-height: 19px; }
  body.bill .row { min-height: 24px; }
  body.bill .stack { margin-top: 6px; }

  body.chk .title { font-size: 20px; line-height: 26px; }
  body.chk .head-row { margin-bottom: 2px; }
  body.chk .card-title { display: none; }
  body.chk .card--dense { padding: 8px 12px; }
  body.chk .grid, body.chk .col { gap: 6px; }
  body.chk .field { margin-bottom: 3px; }
  body.chk .label { margin-bottom: 2px; }
  body.chk .hint { font-size: 14px; line-height: 16px; }
  body.chk .alert { padding: 4px 10px; }
  body.chk .alert p { line-height: 19px; }
  body.chk .sum { gap: 0; }
  body.chk .sum-row .k, body.chk .sum-row .v { font-size: 15px; line-height: 18px; }
  body.chk .sum-total { font-size: 17px; line-height: 22px; padding-top: 6px; }
  body.chk .actions { margin-top: 6px; }

  body.mtg1 .card { padding: 8px 12px; }
  body.mtg1 .player { padding: 8px; }
  body.mtg1 .trs { gap: 4px; }
  body.mtg1 .tr-tx { line-height: 20px; }
  body.mtg1 .state-demo { padding: 6px 10px; margin-top: 4px; }
  body.mtg1 .alert { padding: 6px 10px; }
  body.mtg1 .alert .alert-foot { margin: 4px 0 0; }
}


/* ---------- v4a-dense-5 ---------- */
@media (max-width: 480px) {
  body.chk .label { line-height: 16px; }
  body.chk .field { margin-bottom: 2px; }
  body.chk .card--dense { padding: 6px 12px; }
  body.chk .grid, body.chk .col { gap: 4px; }
  body.chk .sum-row .k, body.chk .sum-row .v { line-height: 16px; }
  body.chk .sum-total { padding-top: 4px; }
  body.chk .hint { line-height: 15px; }
  body.chk .actions { margin-top: 4px; }
  body.chk .alert { padding: 4px 10px; }
  body.chk .alert .alert-foot { margin: 4px 0 0; }
}


/* ---------- v4a-dense-6: десктоп ---------- */
@media (min-width: 481px) {
  body.chk .field { margin-bottom: 10px; }
  body.chk .actions { margin-top: 16px; }
  body.bill .card-title, body.chk .card-title { margin-bottom: 12px; }
}


/* ---------- v4a-dense-7: /upload на 360 ---------- */
@media (max-width: 480px) {
  body.upl .title { font-size: 22px; line-height: 28px; margin-bottom: 2px; }
  body.upl .sub { font-size: 14px; line-height: 18px; margin: 0 0 8px; }
  body.upl .grid { gap: 8px; }
  body.upl .card { padding: 12px; }
  body.upl .drop { padding: 12px; gap: 8px; }
  body.upl .drop-ico, body.upl .drop-cap { display: none; }
  body.upl .drop-title { font-size: 15px; line-height: 20px; }
  body.upl .file-chip { padding: 8px 10px; gap: 8px; }
  body.upl .file-main { font-size: 14px; line-height: 18px; }
  body.upl .err-msg { margin: 8px 0 0; font-size: 14px; line-height: 18px; }
  body.upl .field { margin-bottom: 10px; }
  body.upl .actions { margin-top: 8px; }
  body.upl .hint { font-size: 14px; line-height: 18px; }
  body.upl .card-title { margin-bottom: 10px; }
}


/* ---------- v4a-dense-8: /upload @<=480 ---------- */
@media (max-width: 480px) {
  body.upl .grid { gap: 6px; }
  body.upl .card { padding: 10px; }
  body.upl .drop { padding: 10px; }
  body.upl .file-chip { padding: 6px 10px; }
  body.upl .err-msg { margin: 4px 0 0; line-height: 16px; }
  body.upl .field { margin-bottom: 6px; }
  body.upl .actions { margin-top: 4px; }
  body.upl .hint { line-height: 16px; }
  body.upl .card-title { margin-bottom: 6px; }
}
