:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #555555;
  --card: #f6f7f9;
  --line: #e4e5ea;
  --accent: #111111;
  --ok: #17c964;
  --off: #999999;
  --field-height: 160px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c0f;
    --fg: #f5f7fa;
    --muted: #c7c9d1;
    --card: #12141a;
    --line: #1f2330;
    --accent: #f5f7fa;
  }
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */

header {
  border-bottom: 1px solid var(--line);
  background: #f6f7f9;
}

@media (prefers-color-scheme: dark) {
  header {
    background: #101218;
  }
}

header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
}

.brand-logo {
  width: 26px;
  height: 26px;
}

.brand-tagline {
  font-size: 13px;
  color: var(--muted);
}

/* Top nav */

.nav {
  margin-left: auto;
  font-size: 14px;
}

.nav-root {
  position: relative;
}

.nav-root-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}

.nav-root-btn:hover {
  background: rgba(0, 0, 0, 0.03);
}

.nav-root-caret {
  font-size: 11px;
  opacity: 0.7;
}

.nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: #f6f7f9;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: none;
  z-index: 10;
}

.nav-item {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.nav-menu a.nav-item,
.nav-menu a.nav-item:hover {
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--fg);
}

.nav-item--current {
  font-weight: 600;
  color: var(--fg);
  background: rgba(0, 0, 0, 0.04);
}

.nav-item--current::after {
  content: '•';
  float: right;
  color: var(--accent);
  font-size: 14px;
}

.nav-root--open .nav-menu {
  display: block;
}

@media (prefers-color-scheme: dark) {
  .nav-menu {
    background: #101218;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7);
  }

  .nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  .nav-item--current {
    background: rgba(255, 255, 255, 0.04);
  }
}

/* Main */

main {
  flex: 1;
  padding: 16px 0 20px;
  display: flex;
  align-items: center;
}

main .wrap {
  width: 100%;
}

.main-head {
  margin: 0 auto 20px;
  max-width: 640px;
  text-align: center;
  padding: 14px 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(246, 247, 249, 0.9);
}

.page-title {
  font-size: 26px;
  margin: 0 0 6px;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

@media (prefers-color-scheme: dark) {
  .main-head {
    background: rgba(15, 17, 23, 0.9);
  }
}

/* Grid & cards */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

/* На очень узких экранах (мобилки) складываем в одну колонку */
@media (max-width: 640px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Видео-фон на заднем плане */
.bg-video {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #000000;
}

.bg-video__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* По умолчанию используем широкое видео */
.bg-video--portrait {
  display: none;
}

/* На очень "высоких" экранах переключаемся на вертикальное видео */
@media (max-aspect-ratio: 3/4) {
  .bg-video--landscape {
    display: none;
  }
  .bg-video--portrait {
    display: block;
  }
}

.card {
  background: rgba(246, 247, 249, 0.9);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

@media (prefers-color-scheme: dark) {
  .card {
    background: rgba(15, 17, 23, 0.9);
  }
}

.card {
  display: flex;
  flex-direction: column;
}

.card-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-main--center {
  align-items: center;
  text-align: center;
}

.card-main--center .field {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.card-footer {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.feature-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}

.feature-list li {
  margin-bottom: 4px;
}

.field {
  margin-top: 12px;
}

.field-label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--muted);
}

.file-name {
  font-weight: 600;
  margin: 8px 0 16px;
  word-break: break-all;
}

.text-block {
  white-space: pre-wrap;
  word-wrap: break-word;
  background: #111318;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 8px 0 16px;
}

.text-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.85);
  color: var(--fg);
  font: inherit;
  resize: vertical;
  min-height: var(--field-height);
}

.text-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
}

.code-input {
  width: 190px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--fg);
  font: 18px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  text-align: center;
  letter-spacing: 0.3em;
  -webkit-text-security: disc;
  text-security: disc;
}

.code-input::placeholder {
  letter-spacing: 0.3em;
}

.code-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
}

.code-input--ok {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px #22c55e;
  color: #22c55e;
}

.code-input--error {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px #ef4444;
  color: #ef4444;
}

.error-text {
  margin: 6px 0 0;
  font-size: 13px;
  color: #e5484d;
}

.error-text:empty {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .code-input {
    background: rgba(8, 9, 13, 0.95);
    border-color: rgba(255, 255, 255, 0.25);
  }

  .code-input:focus {
    background: rgba(8, 9, 13, 0.95);
    border-color: var(--accent);
  }

    .code-input--ok {
    border-color: #22c55e;
    box-shadow: 0 0 0 1px #22c55e;
    color: #4ade80;
  }

  .code-input--error {
    border-color: #ef4444;
    box-shadow: 0 0 0 1px #ef4444;
    color: #f87171;
  }
}

.dropzone {
  width: 100%;
  min-height: var(--field-height);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.85);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dropzone--active {
  border-color: var(--accent);
  background-color: #ffffff;
}

.dropzone input[type="file"] {
  display: none;
}

.dropzone-label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
}

textarea {
  padding: 8px 10px;
  min-height: var(--field-height);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  resize: vertical;
  background: rgba(255, 255, 255, 0.85);
  color: var(--fg);
}

@media (prefers-color-scheme: dark) {
  .text-input,
  textarea,
  .dropzone {
    background: rgba(8, 9, 13, 0.95);
    border-color: rgba(255, 255, 255, 0.25);
  }

  .dropzone--active {
    background: rgba(12, 14, 20, 0.98);
  }
  .text-input:focus,
  textarea:focus {
    background: rgba(8, 9, 13, 0.95);
    border-color: var(--accent);
  }
}

/* Блоки с опцииями TTL/пароль — одинаковая сетка для обеих карточек */

.options-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.options-label {
  min-width: 160px;
  font-size: 13px;
  color: var(--muted);
}

.options-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.option-pill input {
  margin: 0;
  accent-color: var(--accent);
}

@media (prefers-color-scheme: dark) {
  .option-pill {
    background: rgba(0, 0, 0, 0.2);
  }
}

@media (max-width: 720px) {
  .options-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .options-label {
    min-width: 0;
  }
}

/* Forms */

label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

input[type="file"],
input[type="number"] {
  width: 100%;
  font: inherit;
}

input[type="file"] {
  margin-top: 4px;
}

input[type="number"] {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
}

input[type="number"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  font: 14px/1.2 inherit;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.05s ease;
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(0, 0, 0, 0.03);
}

.btn:hover {
  text-decoration: none;
}

.btn.primary:hover {
  background: #000000;
  border-color: #000000;
}

.btn:active {
  transform: translateY(0);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* CTA-кнопки на главной */
.cta {
  margin: 24px auto 24px;
  max-width: 640px;          /* выравниваем по ширине main-head */
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Кнопки в CTA выглядят одинаково */
.cta .btn {
  background: rgba(246, 247, 249, 0.95);
  border: 1px solid #000000 !important; /* всё, без вариантов */
  color: var(--fg);
}

@media (prefers-color-scheme: dark) {
  .cta .btn {
    background: rgba(11, 12, 15, 0.96);
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--fg);
  }
}



/* Results */

.result {
  margin-top: 10px;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  word-break: break-all;
}

.result:empty {
  display: none;
}

.upload-progress:empty {
  display: none;
}

/* Helper text */

.muted {
  color: var(--muted);
  font-size: 13px;
}

/* Детальные страницы: метаданные, текст и списки файлов */

.meta-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.meta-list li {
  margin-bottom: 4px;
}

.text-view {
  margin: 12px 0 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #111318;
  color: #f5f7fa;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 320px;
  overflow: auto;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 14px;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.9);
}

.file-main {
  min-width: 0;
}

.file-meta {
  margin-left: 12px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  .text-view {
    background: #090b11;
    color: #f5f7fa;
  }

  .file-item {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(11, 12, 15, 0.98);
  }
}

/* Footer */

footer {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f6f7f9;
  border-top: 1px solid var(--line);
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px 18px;
}

@media (prefers-color-scheme: dark) {
  footer {
    background: #101218;
  }
}

footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

@media (max-width: 600px) {
  footer .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-color-scheme: dark) {
  .btn.primary {
    background: #f5f7fa;
    border-color: #f5f7fa;
    color: #000000;
  }

  .btn.primary:hover {
    background: #e5e7ee;
    border-color: #e5e7ee;
  }
}

/* Login (FAST IT RTC) */

.card--auth {
  max-width: 420px;
  margin: 56px auto 32px;
}

@media (max-width: 600px) {
  .card--auth {
    margin-top: 32px;
  }
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-error {
  margin-top: 4px;
  min-height: 1.2em;
  font-size: 0.875rem;
  color: #fca5a5;
}

/* ==== RTC login tweaks ==== */

/* Поля логина/пароля нормальной высоты */
.card--auth .text-input {
  height: 46px;
  min-height: 46px;   /* перекрываем возможные общие правила */
  padding: 10px 14px;
  line-height: 1.3;
  resize: none;
}

/* Чуть меньше воздуха между полями, чтобы всё было компактнее */
.card--auth .field {
  margin-bottom: 14px;
}

/* Кнопка "Войти" — заметная и не прилипшая к полю */
.card--auth .btn.primary {
  margin-top: 8px;
  width: 100%;        /* растягиваем по ширине формы */
  max-width: 260px;   /* но не во всю карту на десктопе */
}

/* На мобильных — кнопка на всю ширину карты */
@media (max-width: 600px) {
  .card--auth .btn.primary {
    max-width: 100%;
  }
}

.card--auth .auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;          /* чуть меньше расстояние между логином и паролем */
  max-width: 520px;
}

.card--auth .field {
  margin: 0;         /* работаем через gap, а не через margin */
}

.card--auth .auth-submit {
  align-self: center;     /* центрируем кнопку "Войти" */
  width: 100%;
  max-width: 260px;
}

.auth-error {
  font-size: 13px;
  color: #ff6b6b;
  margin-top: 4px;
}

.invite-cta {
  margin-top: 8px;
  align-self: center;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.invite-cta:hover {
  text-decoration: underline;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 20px 22px 18px;
  border-radius: 18px;
  background: rgba(15, 17, 23, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}

.modal-title {
  margin: 0 0 8px;
  font-size: 20px;
}

.modal-text {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
}

.modal-field {
  margin-top: 10px;
  display: flex;
  justify-content: center;   /* центрируем поле кода */
}

.modal-hint {
  margin-top: 6px;
  font-size: 12px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
}

.modal-close:hover {
  color: #ffffff;
}

/* Более специфичное правило, чтобы перебить align-self из .btn.primary */
.card--auth .btn.primary.auth-submit {
  align-self: center;
}

/* Если есть атрибут hidden – реально прячем бэкдроп */
.modal-backdrop[hidden] {
  display: none !important;
}

.modal-title,
.modal-text {
  text-align: center;
}

/* Центрируем заголовок и подзаголовок на странице логина */
.card--auth h1,
.card--auth .card-desc {
  text-align: center;
}

/* Лейблы на логин-странице: выравниваем с текстом в полях */
.card--auth .field-label {
  margin-left: 10px;   /* подобрать число под твой вкус: 8–12 нормально */
}

/* ==== FAST IT RTC: player (обновлённый стиль) ==== */

.player-page {
  background: radial-gradient(140% 180% at 50% 0, #151824 0, #05060b 55%, #020308 100%);
  color: var(--fg);
}

/* Область с видео как большая карточка */
.player-page #wrap {
  position: fixed;
  left: 32px;
  top: 32px;
  bottom: 32px;
  right: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(140% 160% at 50% 0, #05060b 0, #020308 70%);
  border-radius: 26px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

/* Само видео */
.player-page video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  outline: none;
  cursor: default;
  user-select: none;
  background: #000;  /* чтобы при отсутствии потока был просто чёрный фон */
  border-radius: 0;
  box-shadow: none;
}

/* Кнопка открытия панели */
.player-page #panelToggle {
  position: fixed;
  top: 40px;
  right: 40px;
  z-index: 30;
  background: rgba(10, 12, 18, 0.92);
  color: var(--fg);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.75);
}

/* Правая панель управления — карточка, как в остальном UI */
.player-page #panel {
  position: fixed;
  top: 32px;
  right: -340px;             /* скрыта */
  width: 320px;
  height: calc(100% - 64px);
  background: rgba(15, 17, 23, 0.98);
  backdrop-filter: blur(20px);
  color: var(--fg);
  border-radius: 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.9);
  transition: right 0.2s ease-out;
  z-index: 29;
  display: flex;
  flex-direction: column;
}

.player-page #panel.open {
  right: 32px;               /* выехала */
}

/* Заголовок панели */
.player-page .phead {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 600;
  font-size: 14px;
}

/* Секции панели */
.player-page .psec {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.player-page .row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;           /* расстояние от текста до первой строки кнопок */
}

.player-page .psec .row:first-of-type {
  margin-top: 4px;           /* чтобы самый первый row в секции чуть ближе был */
}

/* Кнопки в панели — локальный вариант .btn */
.player-page #panel button {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.player-page #panel button:hover {
  background: rgba(255, 255, 255, 0.10);
}

/* Инпуты панели */
.player-page #panel input[type="text"],
.player-page #panel input[type="file"] {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: var(--fg);
  padding: 6px 10px;
  font-size: 12px;
}

/* Статусбар внизу слева */
.player-page #statusBar {
  position: fixed;
  left: 32px;
  bottom: 32px;
  background: rgba(5, 7, 12, 0.96);
  color: var(--fg);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.75);
  z-index: 31;
}

/* Лог внутри панели */
.player-page #log {
  height: 120px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.35);
  padding: 8px 10px;
  border-radius: 10px;
  font-family: Consolas, Menlo, monospace;
  font-size: 11px;
  white-space: pre-wrap;
  margin-top: 8px;
}

/* ==== Player: фуллскрин без рамки ==== */

body.player-page {
  background: #000;
  color: var(--fg);
  margin: 0;
  padding: 0;
  display: block;          /* перебиваем общий body { display:flex } */
}

body.player-page #wrap {
  position: fixed;
  inset: 0;                /* top:0; right:0; bottom:0; left:0 */
  margin: 0;
  padding: 0;
  border-radius: 0;        /* убираем скругления */
  box-shadow: none;        /* и тени заодно */
  background: #000;
}

body.player-page #v {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;     /* как и раньше: вписываем картинку */
  background: #000;
}

/* ==== Player: строки в правой панели ==== */

.player-page #panel .row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  margin-bottom: 8px;   /* ← вот этого как раз не хватало */
}

/* ---------- выравнивание нового блока агент-инфо ---------- */
.top-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr; /* левая и правая части */
  gap: 16px;
  align-items: start;
}

.agent-info-block h4.agent-title {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#agentAlias {
  color: var(--accent);
  font-weight: 600;
}

.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 10px;
  align-items: center;
}

.quality-toggle:hover {
  text-decoration: underline;
}

/* нижняя сетка */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.sys-block {
  grid-column: span 1;
}

.notes-block textarea {
  width: 100%;
  min-height: 180px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0e1015;
  color: var(--fg);
  resize: vertical;
}

/* ==== QR Generator ==== */

.qr-page {
  --qr-accent: #22c55e;
  --qr-soft: rgba(34, 197, 94, 0.12);
}

body.qr-page {
  background: transparent;
}

body.qr-page main {
  align-items: flex-start;
  padding: 24px 0 40px;
}

body.qr-page .main-head {
  max-width: 760px;
}

body.qr-page:not([data-step="1"]) .qr-hero,
body.qr-page:not([data-step="1"]) .qr-steps-detail {
  display: none;
}

body.qr-page[data-step="1"] .qr-screen .qr-phone-preview {
  display: none !important;
}

body.qr-page[data-step="1"] .qr-screen .qr-empty {
  display: none;
}

body.qr-page[data-step="1"] .qr-type-preview {
  display: block;
}

.qr-steps-bar {
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.qr-steps-bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
}

.qr-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.qr-step-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s ease, opacity 0.2s ease;
}

.qr-step-item.is-active {
  color: var(--fg);
  font-weight: 600;
}

.qr-step-item.is-disabled {
  opacity: 0.45;
}

.qr-step-item.is-done {
  color: var(--qr-accent);
}

.qr-step-item.is-active,
.qr-step-item.is-done {
  cursor: pointer;
}

.qr-step-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #c9ced6;
  color: #ffffff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  position: relative;
}

.qr-step-item.is-active .qr-step-number {
  background: var(--qr-accent);
}

.qr-step-item.is-done .qr-step-number {
  background: var(--qr-accent);
  color: transparent;
}

.qr-step-item.is-done .qr-step-number::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.qr-step-arrow {
  color: var(--muted);
  font-size: 14px;
}

.qr-help {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
}

.qr-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: 20px;
  align-items: start;
}

.qr-left {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.qr-step-section {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.3s ease;
}

.qr-step-section.is-active {
  opacity: 1;
  max-height: 4000px;
  pointer-events: auto;
  transform: translateY(0);
}

.qr-step-title {
  margin: 0;
  font-size: 20px;
}

.qr-step-head {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  text-align: left;
}

.qr-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

body.qr-page[data-step="1"] .qr-type-card-list {
  min-height: 540px;
}

body.qr-page[data-step="2"] .qr-layout,
body.qr-page[data-step="3"] .qr-layout,
body.qr-page[data-step="4"] .qr-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.qr-type-card {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff !important;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  align-items: center;
  cursor: pointer;
  color: #111111 !important;
  transition: transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  opacity: 1;
}

.qr-type-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.qr-type-card.active {
  border-color: #111111;
  box-shadow: 0 0 0 1px #111111;
}

.qr-type-card.is-disabled {
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
}

.qr-type-card.is-disabled:hover {
  transform: none;
}

.qr-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--qr-soft);
  color: var(--qr-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  overflow: hidden;
}

.qr-card-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

.qr-card-title {
  font-size: 13px;
  font-weight: 600;
}

.qr-card-desc {
  font-size: 12px;
  color: #111111 !important;
  display: block;
}

.qr-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qr-accordion-item {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  overflow: hidden;
}

.qr-accordion-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.qr-accordion-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--qr-soft);
  color: var(--qr-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
}

.qr-accordion-icon svg {
  width: 20px;
  height: 20px;
  color: currentColor;
}

.qr-accordion-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.qr-accordion-title {
  font-weight: 600;
  font-size: 17px;
  color: var(--fg);
  line-height: 1.3;
}

.qr-accordion-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.qr-accordion-caret {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.qr-accordion-item.is-open .qr-accordion-caret {
  transform: rotate(180deg);
}

.qr-accordion-body {
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.2s ease;
}

.qr-accordion-item.is-open .qr-accordion-body {
  padding: 0 16px 16px;
  max-height: 1200px;
}

.qr-required {
  color: #e5484d;
  font-weight: 600;
}

.qr-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qr-input,
.qr-textarea,
.qr-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.95);
  color: var(--fg);
  font: inherit;
}

.qr-input:focus,
.qr-textarea:focus,
.qr-select:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
}

.qr-form-error {
  margin: 10px 0 0;
  color: #e5484d;
  font-size: 13px;
  min-height: 1.1em;
}

.qr-password-note {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
}

.qr-password-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--qr-accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.qr-password-field.is-enabled .qr-input {
  border-color: var(--qr-accent);
}

.qr-switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 24px;
  margin-left: auto;
}

.qr-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.qr-switch-slider {
  position: absolute;
  inset: 0;
  background: #d7dbe1;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.qr-switch-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.qr-switch input:checked + .qr-switch-slider {
  background: var(--qr-accent);
}

.qr-switch input:checked + .qr-switch-slider::before {
  transform: translateX(20px);
}

.qr-option-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.qr-option-grid--frame {
  grid-template-columns: repeat(2, 120px);
  gap: 8px;
  justify-content: flex-start;
}

.qr-frame-controls {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.qr-frame-title {
  font-size: 13px;
  font-weight: 600;
  color: #111111;
}

.qr-checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #111111;
}

.qr-checkline input {
  width: 16px;
  height: 16px;
}

.qr-option-tile {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff !important;
  padding: 10px 8px;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
  color: #111111;
  transition: border-color 0.2s ease, transform 0.1s ease;
}

.qr-option-tile--preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  min-height: 88px;
}

.qr-frame-thumb {
  width: 100%;
  border-radius: 8px;
  background: #f5f6f8;
  border: 1px solid #e2e6eb;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
}

.qr-frame-thumb img {
  width: 80%;
  height: auto;
  display: block;
}

.qr-frame-thumb--empty {
  position: relative;
  width: 80%;
}

.qr-frame-thumb--empty::after {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #c7ccd3;
}

.qr-frame-thumb--empty::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 2px;
  background: #c7ccd3;
  transform: rotate(-45deg);
}

.qr-frame-label {
  font-size: 10px;
  font-weight: 600;
  color: #111111;
}

.qr-option-tile--icon {
  padding: 8px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qr-corner-icon {
  width: 22px;
  height: 22px;
  color: #111111;
  display: inline-flex;
}

.qr-corner-icon svg {
  width: 100%;
  height: 100%;
}

.qr-option-tile.is-active {
  border-color: var(--qr-accent);
  box-shadow: 0 0 0 1px var(--qr-accent);
}

.qr-option-tile:hover {
  transform: translateY(-1px);
}

.qr-option-tile[disabled] {
  opacity: 1;
  color: #9aa0a6;
  background: #f2f3f5 !important;
  cursor: not-allowed;
  transform: none;
}

.qr-color-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.qr-corner-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qr-corner-caption {
  font-size: 13px;
  font-weight: 600;
}

.qr-corner-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.qr-corner-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qr-corner-label {
  font-size: 12px;
  color: var(--muted);
}

.qr-corner-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.qr-corner-colors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.qr-color-card {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qr-color-card.is-disabled .qr-color-pair,
.qr-color-card.is-disabled .qr-select {
  opacity: 0.55;
}

.qr-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.qr-color-input {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  background: #ffffff;
}

.qr-color-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.qr-color-input input[type="color"] {
  border: none;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
}

.qr-dropzone {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  color: #111111;
  background: rgba(255, 255, 255, 0.8);
}

.qr-dropzone input {
  display: none;
}

.qr-step-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.qr-step-actions .btn {
  min-width: 140px;
  background: #ffffff;
  border-color: #111111;
  color: #111111;
}

.qr-page .btn.primary {
  background: #ffffff;
  border-color: #111111;
  color: #111111;
}

.qr-page .btn.primary:hover {
  background: #f5f5f5;
  border-color: #111111;
}

.qr-preview-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  align-self: flex-start;
  will-change: transform;
}

body.qr-page[data-step="2"] .qr-preview-tabs,
body.qr-page[data-step="3"] .qr-preview-tabs {
  justify-content: center;
  align-self: flex-start;
  width: auto;
}

.qr-tab {
  border-radius: 999px;
  border: 1px solid #111111;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  background: #ffffff;
  color: #9aa0a6;
  font-weight: 600;
}

.qr-tab.is-active {
  background: #ffffff;
  color: #111111;
  border-color: #111111;
}

.qr-right {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
  justify-content: flex-start;
}

.qr-preview {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  padding: 18px;
}

.qr-preview--phone {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  position: static;
  will-change: transform;
  transition: height 0.45s ease;
}

.qr-preview--phone.is-resizing {
  transition: height 0.45s ease;
}

body.qr-page[data-step="2"] .qr-preview--phone,
body.qr-page[data-step="3"] .qr-preview--phone,
body.qr-page[data-step="4"] .qr-preview--phone {
  position: static;
}

body.qr-page[data-step="1"] .qr-preview--phone {
  position: static;
}
.qr-preview--final {
  display: none;
}

.qr-right[data-stage="4"] .qr-preview--final {
  display: block;
}

.qr-right[data-stage="4"] .qr-preview--phone,
.qr-right[data-stage="4"] #qrMeta {
  display: none;
}

.qr-right[data-stage="4"] .qr-preview-tabs {
  display: none;
}

.qr-right[data-stage="1"] .qr-preview-tabs {
  display: none;
}

body.qr-page[data-step="1"] .qr-right {
  justify-content: flex-start;
}

body.qr-page[data-step="1"] .qr-preview--phone {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
}

body.qr-page[data-step="1"] .qr-preview--phone .qr-phone {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  transform-origin: top center;
}

body.qr-page[data-step="2"] .qr-preview--phone .qr-phone,
body.qr-page[data-step="3"] .qr-preview--phone .qr-phone,
body.qr-page[data-step="4"] .qr-preview--phone .qr-phone {
  transform-origin: top left;
  margin: 0;
  max-width: 360px;
}

body.qr-page[data-step="2"] .qr-preview--phone,
body.qr-page[data-step="3"] .qr-preview--phone,
body.qr-page[data-step="4"] .qr-preview--phone {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.qr-phone {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  background: #0b0c0f;
  border-radius: 36px;
  padding: 18px 16px 20px;
  border: 6px solid #101218;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  transform-origin: top center;
  transition: transform 0.45s ease;
  will-change: transform;
}

.qr-phone-top {
  width: 120px;
  height: 18px;
  border-radius: 999px;
  background: #151720;
  margin: 0 auto 12px;
}

.qr-phone-bottom {
  width: 110px;
  height: 5px;
  border-radius: 999px;
  background: #1f222b;
  margin: 16px auto 0;
}

.qr-screen {
  background: #ffffff;
  border-radius: 24px;
  padding: 8px;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

body.qr-page[data-step="2"] .qr-screen,
body.qr-page[data-step="3"] .qr-screen,
body.qr-page[data-step="4"] .qr-screen {
  min-height: 520px;
}

.qr-type-preview {
  width: 100%;
  max-width: 240px;
  height: auto;
  display: none;
  object-fit: contain;
}

.qr-phone-preview {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.qr-phone-url {
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #ffffff;
  background: #fb923c;
}

#qrPhoneUrl {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-phone-globe {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
}

.qr-phone-hero {
  width: 100%;
  height: 160px;
  border-radius: 18px;
  background: #e5e5e5;
}

.qr-phone-line {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #ededed;
}

.qr-phone-line--short {
  width: 70%;
}

.qr-phone-card {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  background: #e0e0e0;
  margin-top: 12px;
}

.qr-screen .qr-qr-image {
  max-width: 100%;
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: none;
  border: 2px solid #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.qr-screen[data-mode="preview"] .qr-qr-image {
  display: none;
}

.qr-screen[data-mode="preview"] .qr-phone-preview {
  display: flex;
}

.qr-screen[data-mode="qr"] .qr-phone-preview {
  display: none;
}

.qr-screen[data-mode="qr"] .qr-qr-image.is-ready {
  display: block;
}

.qr-empty {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  max-width: 180px;
}

.qr-meta {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  padding: 14px 16px;
}

.qr-meta-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.qr-meta-text {
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.qr-final-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.qr-final-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--qr-accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
}

.qr-final-title {
  font-size: 18px;
  font-weight: 600;
}

.qr-final-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.qr-final-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
}

.qr-final-image img {
  width: 280px;
  height: 280px;
  border-radius: 18px;
  border: 12px solid #ffffff;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
  background: #ffffff;
  display: none;
}

.qr-final-image img.is-ready {
  display: block;
}

.qr-final-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.qr-finish-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qr-finish-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--qr-soft);
  color: var(--qr-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.qr-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.qr-divider::before,
.qr-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.qr-finish-list {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.qr-finish-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qr-steps-detail {
  margin-top: 36px;
  text-align: center;
}

.qr-steps-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 20px;
}

.qr-steps-detail h2 {
  margin-bottom: 20px;
}

.qr-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.qr-step-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 16px;
}

.qr-step-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--qr-soft);
  color: var(--qr-accent);
  font-weight: 700;
}

.qr-step-card h4 {
  margin: 0 0 6px;
}

.qr-step-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .qr-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .qr-option-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.qr-page[data-step="1"] .qr-type-card-list {
    min-height: 480px;
  }
}

@media (max-width: 960px) {
  .qr-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .qr-right {
    position: static;
  }

  body.qr-page[data-step="3"] .qr-preview-tabs {
    position: static;
  }

  .qr-color-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .qr-corner-row,
  .qr-corner-colors {
    grid-template-columns: minmax(0, 1fr);
  }

  .qr-option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.qr-page[data-step="1"] .qr-type-card-list {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .qr-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qr-steps-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-color-scheme: dark) {
  body.qr-page {
    background: #0b0c0f;
  }

  .qr-steps-bar,
  .qr-help {
    background: #101218;
  }

  .qr-type-card,
  .qr-accordion-item,
  .qr-preview,
  .qr-meta,
  .qr-step-card,
  .qr-finish-card,
  .qr-steps-card {
    background: rgba(15, 17, 23, 0.9);
  }

  .qr-step-head {
    background: rgba(15, 17, 23, 0.9);
  }

  .qr-type-card {
    background: #ffffff;
  }

  .qr-preview--phone {
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .qr-input,
  .qr-textarea,
  .qr-select,
  .qr-color-input {
    background: rgba(8, 9, 13, 0.95);
    border-color: rgba(255, 255, 255, 0.18);
  }

  .qr-input:focus,
  .qr-textarea:focus,
  .qr-select:focus {
    border-color: var(--accent);
    background: rgba(8, 9, 13, 0.95);
  }

  .qr-screen {
    background: #0f1117;
  }

  .qr-color-card {
    background: rgba(255, 255, 255, 0.04);
  }

  .qr-option-tile {
    background: #ffffff !important;
    color: #111111;
  }
}
