/* Экраны подключения, список уроков, раскладка «список + урок». */

/* ---- вход / первый запуск ---- */
.onboard { flex: 1; overflow: auto; display: grid; align-items: center; justify-items: center;
  padding: calc(24px + var(--safe-t)) calc(var(--gutter) + var(--safe-r)) calc(24px + var(--safe-b)) calc(var(--gutter) + var(--safe-l)); }
.onboard-card { width: min(460px, 100%); display: grid; gap: 16px; padding: 28px 24px; background: var(--card); border-radius: 28px; box-shadow: var(--shadow); }
.onboard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.onboard-logo { width: 64px; height: 64px; }
.onboard-logo svg { width: 100%; height: 100%; display: block; }
.onboard-title { font-size: 28px; line-height: 1.15; letter-spacing: -.01em; }
.form { display: grid; gap: 14px; }

/* ---- оболочка: список + урок ---- */
.shell { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); position: relative; }
.pane { min-width: 0; min-height: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; }
.shell[data-view="lesson"] .pane-list { display: none; }
.shell:not([data-view="lesson"]) .pane-lesson { display: none; }
.pane-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); text-align: center; padding: 24px; }
.pane-empty .onboard-logo { opacity: .5; filter: grayscale(.5); }
@media (min-width: 960px) {
  .shell { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); }
  .shell[data-view="lesson"] .pane-list, .shell:not([data-view="lesson"]) .pane-lesson { display: flex; }
  .pane-list { border-right: 1px solid var(--outline); }
  .shell:not([data-view="lesson"]) .pane-lesson { background: var(--bg); }
}

/* ---- список ---- */
.list-head { padding: calc(10px + var(--safe-t)) max(calc(8px + var(--safe-r)), calc((100% - 720px) / 2 - 8px)) 4px max(calc(var(--gutter) + var(--safe-l)), calc((100% - 720px) / 2)); display: flex; align-items: center; gap: 4px; }
.list-title { flex: 1; min-width: 0; }
.list-title h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.01em; }
.banner { margin: 4px max(calc(var(--gutter) + var(--safe-r)), calc((100% - 720px) / 2)) 6px max(calc(var(--gutter) + var(--safe-l)), calc((100% - 720px) / 2)); padding: 10px 14px; border-radius: 14px; background: var(--warn-bg); color: var(--warn-fg);
  border: 1px solid var(--warn-border); display: flex; align-items: center; gap: 10px; font-size: 14px; }
.banner span { flex: 1; }
.banner .btn { min-height: 36px; padding: 0 14px; font-size: 14px; }
.progress-line { height: 3px; background: var(--outline); overflow: hidden; }
.progress-line i { display: block; height: 100%; width: 40%; background: var(--accent); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.list-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px calc(var(--gutter) + var(--safe-r)) calc(24px + var(--safe-b)) calc(var(--gutter) + var(--safe-l)); }
.cards { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 10px; width: 100%; max-width: 720px; }
.empty-state { padding: 48px 16px; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; }

.lcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px; padding: 10px 6px 10px 10px; border-radius: 22px; background: var(--card);
  box-shadow: 0 1px 0 var(--outline); transition: background-color .25s; }
.lcard.is-current { background: var(--accent-soft); }
.lcard-main { display: flex; align-items: center; gap: 14px; min-width: 0; text-align: left; background: none; border: 0; padding: 0; border-radius: 16px; color: inherit; }
button.lcard-main:active { transform: scale(.985); }
.thumb { position: relative; width: 64px; height: 64px; flex: none; border-radius: 16px; overflow: hidden; background: var(--accent-soft); display: grid; place-items: center; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb-ph { font: 700 26px/1 var(--font-ko); color: var(--accent); opacity: .9; }
.lcard-body { display: grid; gap: 3px; min-width: 0; }
.lcard-title { font-weight: 700; font-size: 17px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.lcard-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.lcard-meta .facts { min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; min-height: 22px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--accent-soft); color: var(--fg); }
.chip svg { width: 14px; height: 14px; }
.bar { height: 5px; border-radius: 3px; background: var(--outline); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.mini .bar i { width: 100%; transform: scaleX(0); transform-origin: left center; border-radius: 0; }
.lcard-size { font-variant-numeric: tabular-nums; opacity: .85; }
.lcard-size::before { content: '·'; margin-right: 6px; }
.lcard-actions { display: flex; align-items: center; }
@media (max-width: 380px) { .thumb { width: 54px; height: 54px; } .lcard-main { gap: 10px; } }

/* ---- мини-плеер ---- */
.mini { margin: 0 calc(12px + var(--safe-r)) calc(10px + var(--safe-b)) calc(12px + var(--safe-l)); border-radius: 24px; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--outline); overflow: hidden; flex: none; animation: slide-up .3s ease-out; }
.mini-row { display: flex; align-items: center; gap: 4px; padding: 8px 4px 4px 10px; }
.mini-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; color: inherit; }
.mini .thumb { width: 44px; height: 44px; border-radius: 12px; }
.mini-title { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .bar { height: 3px; border-radius: 0; margin-top: 2px; }

/* ---- выбор языка: маленькое выпадающее меню (флаг + код) ---- */
.lang-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 8px 0 10px; border: 1px solid var(--outline); border-radius: 999px;
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .03em; transition: background-color .15s, color .15s; }
.lang-btn:hover, .lang-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--fg); }
.lang-btn svg { width: 16px; height: 16px; }
.menu.lang-menu { min-width: 190px; max-height: min(420px, 70dvh); overflow: auto; }
.lang-menu .menu-item { min-height: 42px; }

/* ---- сортировка: тихая иконка и крошечное меню ---- */
.sort-btn { width: 36px; height: 36px; opacity: .6; }
.sort-btn:hover, .sort-btn[aria-expanded="true"] { opacity: 1; }
.sort-btn svg { width: 20px; height: 20px; }
.menu.sort-menu { min-width: 0; width: max-content; padding: 4px; border-radius: 14px; }
.sort-menu .menu-item { min-height: 38px; padding: 0 12px; gap: 8px; font-size: 14px; border-radius: 10px; }
.sort-menu .menu-item svg { width: 18px; height: 18px; }
.sort-menu .menu-sep { margin: 3px 6px; }

/* ---- настройки: пользователи ---- */
.set-select { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--outline); border-radius: 14px; background: transparent; text-align: left; font-size: 16px; }
.set-select:hover, .set-select[aria-expanded="true"] { background: var(--accent-soft); }
.set-select-label { flex: 1; color: var(--muted); font-weight: 600; font-size: 14px; }
.set-select-value { font-weight: 600; }
.set-select svg { width: 18px; height: 18px; color: var(--muted); }
.users-panel { display: grid; gap: 8px; }
.users { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.user-row { display: flex; align-items: center; gap: 8px; min-height: 48px; padding-left: 4px; border-bottom: 1px solid var(--outline); }
.user-row:last-child { border-bottom: 0; }
.user-name { font-weight: 600; overflow-wrap: anywhere; }
.user-you { font-size: 13px; }
.user-actions { margin-left: auto; display: flex; flex: none; }
.user-form { display: grid; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.manage-link { text-decoration: none; justify-self: start; }
