@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Prata&display=swap');

:root {
  --ink: #181a17;
  --ink-2: #252821;
  --paper: #f2efe6;
  --paper-2: #e8e3d8;
  --white: #fffdf7;
  --muted: #6d7068;
  --line: rgba(24, 26, 23, .14);
  --gold: #d1a73f;
  --gold-bright: #f3ce6e;
  --gold-soft: #f6ead0;
  --gold-dark: #82621d;
  --blue: #4f6572;
  --serif: 'Prata', Georgia, serif;
  --sans: 'Manrope', system-ui, sans-serif;
  --shadow: 0 18px 55px rgba(19, 21, 18, .12);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); min-width: 320px; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.skip-link { position: fixed; z-index: 1000; left: 16px; top: -60px; padding: 12px 16px; color: var(--white); background: var(--ink); border-radius: 10px; }
.skip-link:focus { top: 12px; }
.app-shell { min-height: 100vh; }
.topbar { position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; color: var(--white); background: rgba(21, 23, 19, .97); border-bottom: 1px solid rgba(255,255,255,.1); }
.brand { min-height: 48px; display: flex; align-items: center; gap: 12px; }
.brand img { width: 114px; height: 40px; object-fit: cover; object-position: center 53%; mix-blend-mode: screen; transform: scale(1.45); transform-origin: center; }
.brand span { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.2); display: grid; line-height: 1; }
.brand strong { font: 17px/1 var(--serif); }
.brand small { margin-top: 5px; color: rgba(255,255,255,.58); font-size: 9px; letter-spacing: .2em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button, .profile-button { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; color: var(--white); background: transparent; cursor: pointer; }
.profile-button { color: var(--ink); background: var(--gold-bright); border-color: var(--gold-bright); font-weight: 800; }
.side-nav { position: fixed; z-index: 40; top: 78px; left: 0; bottom: 0; width: 220px; padding: 30px 18px; display: flex; flex-direction: column; color: var(--white); background: var(--ink); border-right: 1px solid rgba(255,255,255,.08); }
.side-nav nav { display: grid; gap: 7px; }
.nav-link { min-height: 52px; padding: 0 14px; display: flex; align-items: center; gap: 13px; color: rgba(255,255,255,.6); border-radius: 12px; font-size: 14px; font-weight: 600; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--white); background: rgba(255,255,255,.08); }
.nav-link[aria-current="page"]::after { content: ''; width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: var(--gold-bright); }
.side-mark { margin: auto auto 0; width: 128px; height: 128px; overflow: hidden; border-radius: 50%; opacity: .22; }
.side-mark img { width: 100%; height: 100%; object-fit: cover; }
.bottom-nav { display: none; }
#app-main { min-height: 100vh; margin-left: 220px; padding-top: 78px; }
.page { padding: 48px clamp(28px, 5vw, 80px) 80px; max-width: 1480px; margin: auto; }

.overline { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.page-head { max-width: 780px; margin-bottom: 38px; }
.page-head h1 { margin: 10px 0 14px; font: clamp(38px, 5vw, 70px)/1.02 var(--serif); letter-spacing: -.03em; }
.page-head p { max-width: 650px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.section-block { padding: 54px clamp(28px, 5vw, 80px); max-width: 1480px; margin: auto; }
.section-head { margin-bottom: 24px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-head h2 { margin: 7px 0 0; font: clamp(28px, 3vw, 42px)/1.12 var(--serif); letter-spacing: -.025em; }
.section-head > a { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.button { min-height: 50px; padding: 0 20px; border: 0; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; background: var(--ink); color: var(--white); font-size: 13px; font-weight: 700; }
.button.light { color: var(--ink); background: var(--white); }
.button.gold { color: var(--ink); background: var(--gold-bright); }
.button.ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.button:disabled { opacity: .45; cursor: not-allowed; }

.home-hero { position: relative; min-height: min(690px, calc(100vh - 78px)); overflow: hidden; color: var(--white); background: var(--ink); }
.home-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: rgba(10,11,9,.48); }
.hero-content { position: relative; min-height: inherit; max-width: 760px; padding: clamp(72px, 9vw, 132px) clamp(28px, 6vw, 90px) 65px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.hero-kicker { display: flex; align-items: center; gap: 12px; color: var(--gold-bright); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.hero-kicker::before { content: ''; width: 30px; height: 1px; background: currentColor; }
.home-hero h1 { max-width: 710px; margin: 22px 0 20px; font: clamp(46px, 6.4vw, 94px)/.98 var(--serif); letter-spacing: -.045em; }
.home-hero p { max-width: 540px; margin: 0 0 34px; color: rgba(255,255,255,.74); font-size: 17px; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-lesson { position: absolute; right: clamp(24px, 4vw, 70px); bottom: 48px; width: 122px; height: 122px; display: grid; place-items: center; text-align: center; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; backdrop-filter: blur(8px); }
.hero-lesson strong { display: block; font: 35px/1 var(--serif); }
.hero-lesson small { color: rgba(255,255,255,.6); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }

.meeting-band { min-height: 104px; margin: -1px 0 0; padding: 18px clamp(28px, 5vw, 80px); display: grid; grid-template-columns: auto 1fr auto auto; gap: 22px; align-items: center; color: var(--ink); background: var(--gold-bright); }
.meeting-band > .icon-wrap { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid rgba(24,26,23,.25); border-radius: 50%; }
.meeting-band .copy { display: grid; gap: 3px; }
.meeting-band .copy small { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.meeting-band .copy strong { font: 23px/1.2 var(--serif); }
.meeting-band .meta { display: flex; gap: 26px; font-size: 13px; }
.meeting-band .meta span { display: flex; align-items: center; gap: 7px; }
.meeting-band button { min-height: 48px; padding: 0 16px; color: var(--ink); background: transparent; border: 1px solid rgba(24,26,23,.3); border-radius: 4px; cursor: pointer; font-weight: 700; }

.course-grid, .course-rail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.course-card { min-width: 0; display: flex; flex-direction: column; background: var(--white); box-shadow: 0 0 0 1px var(--line); }
.course-cover { position: relative; aspect-ratio: 1.5; overflow: hidden; background: var(--ink); }
.course-cover > img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.course-card:hover .course-cover > img { transform: scale(1.025); }
.course-cover::after { content: ''; position: absolute; inset: 0; background: rgba(8,9,7,.16); }
.course-number { position: absolute; z-index: 2; left: 18px; top: 16px; color: rgba(255,255,255,.8); font: 22px/1 var(--serif); }
.status-tag { position: absolute; z-index: 2; right: 14px; top: 14px; padding: 8px 10px; color: var(--ink); background: var(--paper); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.status-tag.current { background: var(--gold-bright); }
.course-body { flex: 1; padding: 22px; display: flex; flex-direction: column; }
.course-body h2 { margin: 9px 0 11px; font: clamp(22px, 2vw, 30px)/1.16 var(--serif); letter-spacing: -.02em; }
.course-body p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.course-meta { margin-top: auto; padding-top: 23px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 11px; font-weight: 700; }
.course-meta .arrow-circle { width: 42px; height: 42px; display: grid; place-items: center; color: var(--ink); border: 1px solid var(--line); border-radius: 50%; }

.kovcheg-hero { position: relative; min-height: 560px; margin: 12px 0; overflow: hidden; color: var(--white); background: var(--ink); }
.kovcheg-hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 58%; }
.kovcheg-hero-shade { position: absolute; inset: 0; background: rgba(8,9,7,.56); }
.kovcheg-hero-mark { position: absolute; right: clamp(24px, 6vw, 96px); top: 50%; width: clamp(180px, 25vw, 360px); aspect-ratio: 1; object-fit: cover; border-radius: 50%; opacity: .34; transform: translateY(-50%); }
.kovcheg-hero-copy { position: relative; min-height: 560px; max-width: 760px; padding: 70px clamp(28px, 7vw, 100px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.kovcheg-hero-copy h2 { margin: 20px 0 30px; font: clamp(42px, 6vw, 78px)/1.02 var(--serif); letter-spacing: -.04em; }

.filter-row { margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.filter-row button { min-height: 44px; padding: 0 16px; color: var(--muted); background: transparent; border: 1px solid var(--line); cursor: pointer; }
.filter-row button.active { color: var(--white); background: var(--ink); }
.editor-note { margin-top: 30px; padding: 22px; display: flex; gap: 14px; color: var(--muted); background: rgba(255,255,255,.52); border: 1px solid var(--line); }
.editor-note strong { display: block; margin-bottom: 5px; color: var(--ink); }
.editor-note p { margin: 0; font-size: 13px; line-height: 1.6; }

.course-hero { position: relative; min-height: 520px; overflow: hidden; color: var(--white); background: var(--ink); }
.course-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.course-hero::after { content: ''; position: absolute; inset: 0; background: rgba(8,9,7,.56); }
.course-hero-content { position: relative; z-index: 1; min-height: 520px; max-width: 800px; padding: 75px clamp(28px, 6vw, 90px); display: flex; flex-direction: column; justify-content: end; }
.course-hero-content .status-tag { position: static; align-self: flex-start; }
.course-hero h1 { margin: 18px 0 14px; font: clamp(42px, 6vw, 80px)/1.01 var(--serif); letter-spacing: -.045em; }
.course-hero p { max-width: 650px; margin: 0; color: rgba(255,255,255,.72); line-height: 1.65; }
.course-stats { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 24px; }
.course-stats span { display: grid; gap: 3px; color: rgba(255,255,255,.58); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.course-stats strong { color: var(--white); font: 25px/1 var(--serif); }
.back-link { min-height: 48px; padding: 0 clamp(28px, 5vw, 80px); display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.course-layout { padding: 46px clamp(28px, 5vw, 80px) 80px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 35px; max-width: 1480px; margin: auto; }
.lesson-list { background: var(--white); border-top: 1px solid var(--line); }
.lesson-row { min-height: 94px; padding: 16px 20px; display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); }
.lesson-row:hover { background: rgba(209,167,63,.08); }
.lesson-row.current { box-shadow: inset 4px 0 var(--gold); background: rgba(209,167,63,.1); }
.lesson-number { color: var(--muted); font: 20px/1 var(--serif); }
.lesson-title { display: grid; gap: 3px; }
.lesson-title small, .lesson-title em { color: var(--muted); font-size: 10px; font-style: normal; }
.lesson-title strong { font: 17px/1.25 var(--serif); }
.lesson-state { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.manual-card { position: sticky; top: 104px; padding: 22px; color: var(--white); background: var(--ink); }
.manual-card img { width: 74px; height: 74px; margin-bottom: 28px; object-fit: cover; border-radius: 50%; opacity: .7; }
.manual-card h3 { margin: 8px 0; font: 24px/1.2 var(--serif); }
.manual-card p { margin: 0 0 20px; color: rgba(255,255,255,.6); font-size: 12px; line-height: 1.6; }
.manual-card .button { width: 100%; }

.lesson-page { max-width: 1220px; }
.lesson-head { margin-bottom: 30px; }
.lesson-head h1 { max-width: 900px; margin: 10px 0 16px; font: clamp(38px, 5vw, 68px)/1.05 var(--serif); letter-spacing: -.04em; }
.lesson-head p { color: var(--muted); }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 30px; align-items: start; }
.video-frame { aspect-ratio: 16/9; overflow: hidden; background: #090a08; }
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.video-empty { min-height: 390px; padding: 45px; display: flex; flex-direction: column; justify-content: end; color: var(--white); background: var(--ink) url('public/covers/prayer.png') center/cover; position: relative; }
.video-empty::before { content: ''; position: absolute; inset: 0; background: rgba(9,10,8,.64); }
.video-empty > * { position: relative; }
.video-empty h2 { max-width: 540px; margin: 10px 0; font: 34px/1.15 var(--serif); }
.material-panel { padding: 22px; background: var(--white); border: 1px solid var(--line); }
.material-panel h3 { margin: 8px 0 18px; font: 24px/1.2 var(--serif); }
.material-panel .button { width: 100%; margin-top: 8px; }
.material-panel ul { padding: 0; margin: 20px 0; list-style: none; display: grid; gap: 12px; }
.material-panel li { padding-top: 12px; display: flex; gap: 9px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; }
.lesson-notes { margin-top: 28px; padding: 26px; background: rgba(255,255,255,.45); border: 1px solid var(--line); }
.lesson-notes h2 { margin: 0 0 10px; font: 27px/1.2 var(--serif); }
.lesson-notes p { margin: 0; color: var(--muted); line-height: 1.7; }

.library-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.manual-tile { min-height: 430px; padding: 25px; display: flex; flex-direction: column; color: var(--white); background: var(--ink); position: relative; overflow: hidden; }
.manual-tile::before { content: ''; position: absolute; inset: 0; background: var(--cover) center/cover; opacity: .25; filter: saturate(.7); }
.manual-tile > * { position: relative; }
.manual-tile .manual-no { color: var(--gold-bright); font: 46px/1 var(--serif); }
.manual-tile h2 { margin: auto 0 13px; font: 30px/1.15 var(--serif); }
.manual-tile p { margin: 0 0 22px; color: rgba(255,255,255,.62); font-size: 12px; }
.manual-actions { display: flex; gap: 8px; }

.meeting-hero { display: grid; grid-template-columns: 1fr 1fr; min-height: 520px; color: var(--white); background: var(--ink); }
.meeting-copy { padding: clamp(35px, 6vw, 80px); display: flex; flex-direction: column; justify-content: center; }
.meeting-copy h1 { margin: 13px 0 18px; font: clamp(48px, 7vw, 96px)/.95 var(--serif); }
.meeting-copy p { max-width: 490px; color: rgba(255,255,255,.65); line-height: 1.65; }
.meeting-visual { min-height: 420px; background: url('public/brand/kovcheg-building.jpg') center/cover; }
.meeting-facts { margin: 28px 0; display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid rgba(255,255,255,.18); }
.meeting-facts span { min-height: 82px; padding: 15px; display: grid; place-content: center; gap: 3px; border-right: 1px solid rgba(255,255,255,.18); }
.meeting-facts span:last-child { border: 0; }
.meeting-facts small { color: rgba(255,255,255,.5); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.prep-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.prep-grid article { min-height: 230px; padding: 24px; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); }
.prep-grid span { color: var(--gold); font: 34px/1 var(--serif); }
.prep-grid h3 { margin: auto 0 8px; font: 23px/1.2 var(--serif); }
.prep-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .75fr); gap: 22px; }
.profile-card { min-height: 260px; padding: 32px; display: flex; flex-direction: column; justify-content: end; color: var(--white); background: var(--ink); position: relative; overflow: hidden; }
.profile-card::after { content: ''; position: absolute; right: -45px; top: -65px; width: 250px; height: 250px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 35px rgba(255,255,255,.03), 0 0 0 75px rgba(255,255,255,.02); }
.profile-card h2 { margin: 8px 0; font: 38px/1.1 var(--serif); }
.profile-card p { margin: 0; color: rgba(255,255,255,.58); }
.profile-card-mark { position: absolute; top: 24px; right: 24px; width: 76px; height: 76px; border-radius: 22px; box-shadow: 0 16px 38px rgba(0,0,0,.24); }
.profile-admin-button { align-self: flex-start; margin-top: 20px; position: relative; z-index: 1; }
.setting-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.button.compact { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.install-brand { display: flex; align-items: center; gap: 14px; margin: 20px 0; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.install-brand img { width: 64px; height: 64px; border-radius: 17px; }
.install-brand strong, .install-brand small { display: block; }
.install-brand strong { font-size: 18px; }
.install-brand small { margin-top: 4px; color: var(--muted); }

.admin-page { --admin-radius: 22px; }
.admin-toolbar, .admin-panel, .admin-video-card, .admin-empty { border: 1px solid var(--line); background: var(--white); }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 26px; border-radius: var(--admin-radius); }
.admin-toolbar h2, .admin-panel h2 { margin: 6px 0 8px; font: 30px/1.12 var(--serif); }
.admin-toolbar p, .admin-panel p { margin: 0; color: var(--muted); }
.admin-message { margin: 0 0 18px; padding: 13px 16px; border-radius: 14px; background: var(--gold-soft); color: var(--ink); font-weight: 700; }
.admin-video-list { display: grid; gap: 18px; margin-bottom: 24px; }
.admin-video-card { display: grid; grid-template-columns: minmax(220px,.72fr) minmax(0,1.28fr); overflow: hidden; border-radius: var(--admin-radius); }
.admin-video-card > img { width: 100%; height: 100%; min-height: 340px; object-fit: cover; background: var(--ink); }
.admin-video-copy { padding: 24px; }
.admin-video-copy h3 { margin: 6px 0 8px; font: 27px/1.14 var(--serif); }
.admin-video-copy > p { color: var(--muted); white-space: pre-line; }
.admin-video-copy > small { display: inline-block; margin-top: 10px; color: var(--gold-dark); font-weight: 800; }
.admin-empty { padding: 34px; border-radius: var(--admin-radius); text-align: center; }
.admin-empty strong { font: 25px var(--serif); }
.admin-empty p { margin: 8px 0 0; color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.admin-panel { padding: 26px; border-radius: var(--admin-radius); }
.admin-form { display: grid; gap: 14px; margin-top: 20px; }
.admin-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 800; color: var(--ink); }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--paper); font: inherit; font-weight: 500; }
.admin-form textarea { resize: vertical; }
.admin-form label > small { color: var(--muted); font-weight: 500; }
.admin-form .check-row { display: flex; grid-template-columns: none; align-items: center; gap: 9px; }
.admin-form .check-row input { width: 18px; height: 18px; accent-color: var(--gold-dark); }
.compact-form { padding-top: 16px; border-top: 1px solid var(--line); }
.admin-reminder { margin-top: 12px; width: 100%; }
.admin-meeting-panel { margin-top: 18px; }
.admin-meeting-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
.admin-meeting-form label:nth-child(5), .admin-meeting-form .check-row, .admin-meeting-form button { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .admin-toolbar { align-items: flex-start; flex-direction: column; }
  .admin-toolbar .button { width: 100%; }
  .admin-grid, .admin-video-card, .admin-meeting-form { grid-template-columns: 1fr; }
  .admin-video-card > img { min-height: 200px; max-height: 260px; }
  .admin-meeting-form label, .admin-meeting-form .check-row, .admin-meeting-form button { grid-column: auto; }
  .profile-card-mark { width: 62px; height: 62px; top: 18px; right: 18px; }
}
.settings-card { padding: 25px; background: var(--white); border: 1px solid var(--line); }
.setting-row { min-height: 68px; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border: 0; }
.setting-row .setting-icon { width: 42px; height: 42px; display: grid; place-items: center; background: var(--paper); border-radius: 50%; }
.setting-row strong { display: block; font-size: 13px; }
.setting-row small { color: var(--muted); font-size: 10px; }
.switch { width: 50px; height: 28px; padding: 3px; border: 0; border-radius: 20px; background: #c5c6c0; cursor: pointer; }
.switch::after { content: ''; display: block; width: 22px; height: 22px; border-radius: 50%; background: white; transition: transform .2s; }
.switch.on { background: var(--gold); }
.switch.on::after { transform: translateX(22px); }
.progress-cards { margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.progress-cards article { min-height: 145px; padding: 22px; background: var(--white); border: 1px solid var(--line); }
.progress-cards strong { display: block; margin-top: 25px; font: 36px/1 var(--serif); }
.progress-cards small { color: var(--muted); }

.modal-root { position: fixed; z-index: 200; inset: 0; padding: 20px; display: grid; place-items: center; background: rgba(8,9,7,.76); }
.modal-root[hidden] { display: none; }
.modal { width: min(540px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 28px; background: var(--white); box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; gap: 20px; }
.modal-head h2 { margin: 7px 0 14px; font: 31px/1.15 var(--serif); }
.modal-close { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.modal p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.modal-steps { margin: 20px 0; display: grid; gap: 10px; }
.modal-step { min-height: 58px; padding: 11px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); }
.modal-step span { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; color: var(--ink); background: var(--gold-bright); border-radius: 50%; font-weight: 800; }
.modal-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.auth-form input { min-height: 48px; padding: 0 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 0; }
.auth-error { color: #a33b2e !important; }
.toast { position: fixed; z-index: 300; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 13px 18px; color: var(--white); background: var(--ink); box-shadow: var(--shadow); font-size: 12px; }
.offline-banner { padding: 9px 20px; color: var(--white); background: #754a36; text-align: center; font-size: 11px; }

@media (max-width: 1000px) {
  .side-nav { width: 82px; padding-inline: 12px; }
  .side-nav .nav-link { justify-content: center; padding: 0; }
  .side-nav .nav-link span, .side-nav .nav-link::after, .side-mark { display: none; }
  #app-main { margin-left: 82px; }
  .course-grid, .course-rail { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .course-layout, .lesson-layout { grid-template-columns: 1fr; }
  .manual-card { position: static; }
  .library-grid { grid-template-columns: 1fr 1fr; }
  .meeting-hero { grid-template-columns: 1.2fr .8fr; }
  .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .topbar { height: 64px; padding: 0 16px; padding-top: env(safe-area-inset-top); }
  .brand img { width: 88px; height: 34px; }
  .brand span { display: none; }
  .icon-button, .profile-button { width: 42px; height: 42px; }
  .side-nav { display: none; }
  #app-main { margin-left: 0; padding-top: calc(64px + env(safe-area-inset-top)); }
  .bottom-nav { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; min-height: calc(66px + env(safe-area-inset-bottom)); padding: 7px 7px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); color: rgba(255,255,255,.52); background: rgba(21,23,19,.98); border-top: 1px solid rgba(255,255,255,.1); }
  .bottom-nav .nav-link { min-height: 54px; padding: 4px 2px; display: flex; flex-direction: column; justify-content: center; gap: 4px; border-radius: 8px; font-size: 9px; }
  .bottom-nav .nav-link[aria-current="page"] { color: var(--gold-bright); background: transparent; }
  .bottom-nav .nav-link::after { display: none; }
  .bottom-nav .icon { width: 21px; height: 21px; }
  .page, .section-block { padding: 30px 16px 48px; }
  .page-head { margin-bottom: 26px; }
  .page-head h1 { font-size: 40px; }
  .section-head { align-items: start; }
  .section-head h2 { font-size: 30px; }
  .home-hero { min-height: 620px; }
  .home-hero > img { object-position: 68% center; }
  .hero-shade { background: rgba(8,9,7,.56); }
  .hero-content { min-height: 620px; padding: 120px 20px 34px; justify-content: end; }
  .home-hero h1 { margin: 17px 0 15px; font-size: clamp(43px, 13vw, 62px); }
  .home-hero p { margin-bottom: 23px; font-size: 14px; }
  .hero-actions { width: 100%; }
  .hero-actions .button { flex: 1; }
  .hero-lesson { right: 18px; top: 28px; bottom: auto; width: 88px; height: 88px; }
  .hero-lesson strong { font-size: 27px; }
  .meeting-band { min-height: auto; padding: 18px 16px; grid-template-columns: auto 1fr auto; gap: 12px; }
  .meeting-band > .icon-wrap { width: 44px; height: 44px; }
  .meeting-band .copy strong { font-size: 18px; }
  .meeting-band .meta { grid-column: 2 / 4; flex-wrap: wrap; gap: 9px 18px; font-size: 11px; }
  .meeting-band button { grid-column: 1 / 4; width: 100%; }
  .course-grid, .course-rail, .library-grid, .prep-grid, .progress-cards { grid-template-columns: 1fr; }
  .course-rail { display: flex; margin-inline: -16px; padding: 0 16px 6px; overflow-x: auto; scroll-snap-type: x mandatory; }
  .course-rail .course-card { min-width: 84vw; scroll-snap-align: start; }
  .kovcheg-hero, .kovcheg-hero-copy { min-height: 520px; }
  .kovcheg-hero-photo { object-position: 58% center; }
  .kovcheg-hero-shade { background: rgba(8,9,7,.64); }
  .kovcheg-hero-mark { right: -45px; top: 18px; width: 210px; transform: none; opacity: .24; }
  .kovcheg-hero-copy { padding: 90px 20px 38px; justify-content: end; }
  .kovcheg-hero-copy h2 { font-size: 46px; }
  .course-hero, .course-hero-content { min-height: 510px; }
  .course-hero > img { object-position: 66% center; }
  .course-hero::after { background: rgba(8,9,7,.6); }
  .course-hero-content { padding: 35px 18px; }
  .course-hero h1 { font-size: 43px; }
  .course-layout { padding: 28px 16px 55px; }
  .lesson-row { min-height: 88px; padding: 13px 12px; grid-template-columns: 38px 1fr 38px; gap: 8px; }
  .lesson-title strong { font-size: 15px; }
  .lesson-state { width: 38px; height: 38px; }
  .lesson-layout { gap: 18px; }
  .video-empty { min-height: 310px; padding: 24px; }
  .meeting-hero { grid-template-columns: 1fr; }
  .meeting-copy { padding: 38px 20px; }
  .meeting-copy h1 { font-size: 61px; }
  .meeting-visual { min-height: 280px; order: -1; }
  .meeting-facts { grid-template-columns: 1fr; }
  .meeting-facts span { min-height: 65px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.18); }
  .profile-card, .settings-card { padding: 22px; }
  .modal-root { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 86vh; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
