:root {
  --bg: #f2f2f7; --card: #fff; --card2: #f2f2f7; --label: #000; --label2: rgba(60,60,67,.62); --label3: rgba(60,60,67,.3);
  --sep: rgba(60,60,67,.16); --blue: #007aff; --red: #ff3b30; --green: #34c759; --fill: rgba(120,120,128,.12);
  --bar: rgba(249,249,249,.78); --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --card: #1c1c1e; --card2: #2c2c2e; --label: #fff; --label2: rgba(235,235,245,.6); --label3: rgba(235,235,245,.3);
    --sep: rgba(84,84,88,.6); --blue: #0a84ff; --red: #ff453a; --green: #30d158; --fill: rgba(120,120,128,.24);
    --bar: rgba(29,29,31,.78); --shadow: none; color-scheme: dark; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; font: 17px/1.35 var(--font); color: var(--label); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, p { margin: 0; }

/* навигационная панель */
.nav { position: sticky; top: 0; z-index: 10; background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--sep); }
.nav-in { max-width: 920px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; min-height: 52px; }
.nav .brand { font-weight: 600; font-size: 17px; color: var(--label); display: flex; align-items: center; gap: 8px; }
.nav .brand i { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #5ac8fa, #007aff); display: grid; place-items: center; font-style: normal; font-size: 15px; }
.nav .sp { flex: 1; }
.nav .who { color: var(--label2); font-size: 15px; }
.linkbtn { background: none; border: 0; color: var(--blue); font: inherit; font-size: 17px; cursor: pointer; padding: 6px 0; }
.wrap { max-width: 920px; margin: 0 auto; padding: 8px 20px 60px; }
.large { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 14px 0 4px; }
.sub { color: var(--label2); font-size: 15px; margin-bottom: 18px; }

/* сегментированный контрол */
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; margin: 10px 0 18px; }
.seg a { padding: 6px 22px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--label); }
.seg a.on { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.18); font-weight: 600; }
@media (prefers-color-scheme: dark) { .seg a.on { background: #636366; } }

/* группы-списки как в «Настройках» */
.group-title { color: var(--label2); font-size: 13px; text-transform: uppercase; letter-spacing: .02em; margin: 24px 16px 7px; }
.group { background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 48px; position: relative; color: var(--label); }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
a.row:active { background: var(--fill); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .d { font-size: 13px; color: var(--label2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .chev::after { content: "›"; color: var(--label3); font-size: 24px; line-height: 1; }
.row.field label { width: 120px; flex: none; color: var(--label); }
.row.field input, .row.field textarea { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--label); outline: none; padding: 0; text-align: right; resize: none; }
.row.field textarea { text-align: left; }
.row.field input::placeholder { color: var(--label3); }
.pill { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--fill); color: var(--label2); white-space: nowrap; }
.pill.green { background: rgba(52,199,89,.16); color: #248a3d; } .pill.red { background: rgba(255,59,48,.14); color: var(--red); }
@media (prefers-color-scheme: dark) { .pill.green { color: #30d158; } }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 16px; background: linear-gradient(#a5a5aa, #86868b); }
.avatar.admin { background: linear-gradient(#bf5af2, #8944ab); }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 17px; border: 0; border-radius: 12px;
  padding: 13px 20px; cursor: pointer; background: var(--blue); color: #fff; transition: opacity .15s, transform .1s; }
.btn:active { opacity: .7; transform: scale(.98); }
.btn.block { width: 100%; }
.btn.gray { background: var(--fill); color: var(--blue); }
.btn.danger { background: var(--fill); color: var(--red); }
.btn.small { padding: 7px 14px; font-size: 15px; border-radius: 9px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn-row { margin-top: 18px; }

/* переключатель iOS */
.sw { position: relative; width: 51px; height: 31px; flex: none; }
.sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.sw span { position: absolute; inset: 0; border-radius: 99px; background: rgba(120,120,128,.32); transition: background .2s; }
.sw span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.25); transition: transform .2s; }
.sw input:checked + span { background: var(--green); }
.sw input:checked + span::after { transform: translateX(20px); }
.sw input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--blue) 50%, transparent); }

/* уведомления */
.flash { border-radius: 12px; padding: 12px 16px; margin: 12px 0 0; font-size: 15px; word-break: break-word; }
.flash.ok { background: rgba(52,199,89,.15); color: #1f7a38; } .flash.err { background: rgba(255,59,48,.13); color: var(--red); }
@media (prefers-color-scheme: dark) { .flash.ok { color: #30d158; } }

/* витрина курсов */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 8px; }
.card { background: var(--card); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; color: var(--label); transition: transform .15s; position: relative; }
.card:active { transform: scale(.98); }
.card .ico { width: 64px; height: 64px; border-radius: 15px; display: grid; place-items: center; font-size: 32px; box-shadow: inset 0 0 0 .5px rgba(255,255,255,.3), 0 4px 10px rgba(0,0,0,.18); }
.card h3 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.card p { color: var(--label2); font-size: 15px; flex: 1; }
.card .go { color: var(--blue); font-weight: 600; font-size: 15px; }
.card .pill { position: absolute; top: 18px; right: 18px; }
.empty { text-align: center; color: var(--label2); padding: 70px 20px; }
.empty .big { font-size: 56px; margin-bottom: 10px; }
.c-blue { background: linear-gradient(135deg, #5ac8fa, #007aff); } .c-indigo { background: linear-gradient(135deg, #7d7aff, #5856d6); }
.c-purple { background: linear-gradient(135deg, #da8fff, #af52de); } .c-pink { background: linear-gradient(135deg, #ff8fb1, #ff2d55); }
.c-red { background: linear-gradient(135deg, #ff8a80, #ff3b30); } .c-orange { background: linear-gradient(135deg, #ffcc66, #ff9500); }
.c-green { background: linear-gradient(135deg, #7be495, #28b446); } .c-teal { background: linear-gradient(135deg, #7ee0e8, #30b0c7); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches label { cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px transparent; transition: box-shadow .15s; }
.swatches input:checked + span { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--blue); }
.swatches input:focus-visible + span { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--blue); }

/* вход */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 380px; }
.login .logo { width: 84px; height: 84px; border-radius: 20px; margin: 0 auto 18px; display: grid; place-items: center; font-size: 44px; background: linear-gradient(135deg, #5ac8fa, #007aff); box-shadow: 0 8px 24px rgba(0,122,255,.35); }
.login h1 { text-align: center; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.login .sub { text-align: center; margin: 6px 0 26px; }
.login .row.field input { text-align: left; }
.login .row.field label { width: 80px; }

/* страница курса */
.player { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.player .bar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--sep); min-height: 46px; flex: none; }
.player .bar a { font-size: 17px; display: flex; align-items: center; gap: 2px; }
.player .bar b { font-weight: 600; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 80px; }
.player iframe { flex: 1; border: 0; width: 100%; background: #fff; }

.hint { color: var(--label2); font-size: 13px; margin: 8px 16px 0; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.gen { color: var(--blue); cursor: pointer; font-size: 15px; flex: none; background: none; border: 0; font-family: inherit; }
@media (max-width: 560px) { .large { font-size: 30px; } .row.field label { width: 96px; } .player .bar b { padding-right: 0; } }
.mini { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: 17px; }
.mini.big { width: 44px; height: 44px; border-radius: 10px; font-size: 22px; }
