* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}
header {
    background: #4e54c8;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-decoration: none;
    color: white;
}
.logo span {
    color: #ffd700; /* Золотой акцент */
}
nav ul {
    display: flex;
    list-style: none;
}
nav ul li {
    margin-left: 1.5rem;
}
nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}
nav ul li a:hover {
    color: #ffd700;
}
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
}
.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}
.btn {
    display: inline-block;
    background: #ffd700;
    color: #333;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn:hover {
    background: #ffed4a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}
.btn-secondary:hover {
    background: white;
    color: #333;
}
.section {
    padding: 4rem 0;
}
.section h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: #4e54c8;
}
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.card:hover {
    transform: translateY(-5px);
}
.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.card-content {
    padding: 1.5rem;
}
.card h3 {
    margin-bottom: 0.5rem;
    color: #4e54c8;
}
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}
.social-links {
    margin-bottom: 1rem;
}
.social-links a {
    color: white;
    margin: 0 10px;
    font-size: 1.5rem;
    text-decoration: none;
}
.filters {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}
.filter-group {
    margin-bottom: 1rem;
}
.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}
.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}
.tutor-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}
.tutor-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.tutor-card:hover {
    transform: translateY(-5px);
}
.tutor-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}
.tutor-info {
    padding: 1.5rem;
}
.tutor-info h3 {
    margin-bottom: 0.5rem;
    color: #4e54c8;
}
.tutor-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.rating {
    color: #ffd700;
    margin-bottom: 1rem;
}
.auth-container {
    max-width: 500px;
    margin: 2rem auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}
.auth-tabs {
    display: flex;
}
.auth-tab {
    flex: 1;
    padding: 1rem;
    text-align: center;
    background: #f1f1f1;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}
.auth-tab.active {
    background: white;
    color: #4e54c8;
}
.auth-form {
    padding: 2rem;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.checkbox-group {
    display: flex;
    align-items: center;
}
.checkbox-group input {
    margin-right: 0.5rem;
}
.forgot-password {
    color: #4e54c8;
    text-decoration: none;
}
.forgot-password:hover {
    text-decoration: underline;
}
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    nav ul {
        display: none;
        width: 100%;
        flex-direction: column;
        margin-top: 1rem;
    }
    nav ul.show {
        display: flex;
    }
    nav ul li {
        margin: 0.5rem 0;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .auth-tabs {
        flex-direction: column;
    }
}.alert-err,.alert-ok{padding:10px 12px;border-radius:8px;margin-bottom:20px}.alert-err{background:#ffebee;color:#c62828}.alert-ok{background:#e8f5e8;color:#2e7d32}.empty{text-align:center;padding:40px;color:#666}
/* ═════ v3: шапка, меню, подвал, главная, уведомления, адаптивность ═════ */
:root{--brand:#4e54c8;--brand2:#8f94fb;--text:#333;--muted:#777}
img{max-width:100%;height:auto}
.muted{color:var(--muted)}
.btn-sm{padding:6px 14px;font-size:.9rem}
.site-header{background:linear-gradient(90deg,var(--brand),var(--brand2));color:#fff;position:sticky;top:0;z-index:500;box-shadow:0 2px 8px rgba(0,0,0,.15)}
.header-row{display:flex;align-items:center;gap:15px;min-height:62px}
.site-header .logo{color:#fff;text-decoration:none;font-size:1.5rem;font-weight:bold;white-space:nowrap}
.main-nav{display:flex;align-items:center;gap:4px;margin-left:auto;flex-wrap:wrap}
.main-nav>a,.dd-toggle,.nav-icons a{color:#fff;text-decoration:none;padding:8px 10px;border-radius:8px;font-weight:500;background:none;border:0;font:inherit;cursor:pointer;white-space:nowrap}
.main-nav>a:hover,.dd-toggle:hover,.nav-icons a:hover,.main-nav>a.active{background:rgba(255,255,255,.18)}
.main-nav>a.btn{background:#ffd700;color:#333}
.nav-icons{display:flex;gap:2px}
.nav-icons a{position:relative;font-size:1.1rem}
.nav-icons .badge{position:absolute;top:0;right:-2px}
.badge{display:inline-block;min-width:18px;padding:1px 6px;border-radius:10px;background:#e91e63;color:#fff;font-size:.7rem;font-weight:bold;text-align:center;line-height:16px}
.badge[hidden]{display:none}
.dropdown{position:relative}
.dd-menu{display:none;position:absolute;top:100%;left:0;background:#fff;min-width:240px;border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.18);padding:6px 0;z-index:600}
.dd-right .dd-menu{left:auto;right:0}
.dd-menu a{display:block;padding:9px 16px;color:#333;text-decoration:none;font-size:.92rem}
.dd-menu a:hover{background:#f3f4fb;color:var(--brand)}
.dropdown.open .dd-menu{display:block}
@media (hover:hover) and (min-width:961px){.dropdown:hover .dd-menu{display:block}}
.menu-toggle{display:none;margin-left:auto;background:none;border:0;color:#fff;font-size:1.5rem;cursor:pointer}
/* Всплывающие уведомления */
#toasts{position:fixed;right:15px;bottom:15px;z-index:9999;display:flex;flex-direction:column;gap:8px;max-width:340px}
.toast{display:block;background:#323a4f;color:#fff;padding:12px 14px;border-radius:10px;box-shadow:0 6px 20px rgba(0,0,0,.25);text-decoration:none;transition:opacity .5s;animation:slidein .3s}
.toast strong{display:block;margin-bottom:3px}.toast span{font-size:.85rem;opacity:.9}.toast.hide{opacity:0}
@keyframes slidein{from{transform:translateY(20px);opacity:0}to{transform:none;opacity:1}}
/* Чат */
.bubble{max-width:75%;background:#f1f3f9;color:#333;padding:10px 14px;border-radius:12px;word-wrap:break-word}
.bubble.mine{background:var(--brand);color:#fff}
.bubble-meta{font-size:.75rem;opacity:.8;margin-bottom:3px}
/* Главная */
.hero{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;padding:70px 0 60px;text-align:center}
.hero h1{font-size:2.4rem;margin-bottom:15px}
.hero p{max-width:720px;margin:0 auto 25px;font-size:1.1rem;opacity:.95}
.hero-search{display:flex;max-width:620px;margin:0 auto;background:#fff;border-radius:12px;padding:6px;gap:6px;box-shadow:0 8px 24px rgba(0,0,0,.15)}
.hero-search input{flex:1;border:0;padding:12px;font-size:1rem;border-radius:8px;outline:none;min-width:0}
.chips{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:18px}
.chip{background:rgba(255,255,255,.18);color:#fff;padding:6px 14px;border-radius:20px;text-decoration:none;font-size:.9rem}
.chip:hover{background:rgba(255,255,255,.3)}
.stats-row{display:grid;grid-template-columns:repeat(4,1fr);gap:15px;text-align:center}
.stats-row div{background:#fff;border-radius:12px;padding:20px;box-shadow:0 2px 10px rgba(0,0,0,.06)}
.stats-row strong{display:block;font-size:1.8rem;color:var(--brand)}.stats-row span{color:var(--muted)}
.section-alt{background:#f3f4fb}
.tutor-mini{text-decoration:none;color:inherit}
.tutor-mini img{height:220px;object-fit:cover;width:100%}
.features{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:20px;text-align:center;font-size:2rem}
.features h3{font-size:1.1rem;margin:8px 0}.features p{font-size:.95rem;color:var(--muted)}
.cta{text-align:center;background:linear-gradient(135deg,#ffd700,#ffb300)}
.cta .btn{margin:5px}
.doc{max-width:860px;background:#fff;padding:30px;border-radius:12px;box-shadow:0 2px 10px rgba(0,0,0,.05);line-height:1.7}
.doc h2{font-size:1.2rem;margin:22px 0 8px;text-align:left}
.doc p{margin-bottom:8px}
/* Звёзды выбора оценки */
.stars-input{display:inline-flex;flex-direction:row-reverse;font-size:2rem}
.stars-input input{display:none}.stars-input label{color:#ddd;cursor:pointer;padding:0 2px}
.stars-input input:checked~label,.stars-input label:hover,.stars-input label:hover~label{color:#ffb300}
/* Подвал */
.site-footer{background:#23263a;color:#ccd;padding:40px 0 0;margin-top:40px}
.footer-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1.3fr;gap:25px}
.site-footer h4{color:#fff;margin-bottom:10px}
.site-footer a{color:#ccd;text-decoration:none;display:block;margin-bottom:6px}
.site-footer a:hover{color:#ffd700}
.site-footer .logo{color:#fff;font-size:1.4rem;font-weight:bold;display:inline-block}
.site-footer .social-links{display:flex;gap:12px;margin-top:12px}
.site-footer .social-links a{font-size:1.4rem;display:inline-block}
.footer-bottom{border-top:1px solid #3a3e57;margin-top:25px;padding:15px 0;text-align:center;font-size:.85rem}
/* ═════ Адаптивность ═════ */
@media (max-width:960px){
  .menu-toggle{display:block}
  .header-row{flex-wrap:wrap}
  .main-nav{display:none;width:100%;flex-direction:column;align-items:stretch;padding-bottom:12px}
  .main-nav.show{display:flex}
  .main-nav>a,.dd-toggle{text-align:left;width:100%}
  .nav-icons{justify-content:flex-start;padding:4px 0}
  .dd-menu{position:static;box-shadow:none;background:rgba(255,255,255,.95);margin:4px 0}
  .footer-grid{grid-template-columns:1fr 1fr}
  .stats-row{grid-template-columns:repeat(2,1fr)}
  /* Сетки с фиксированной левой колонкой (inline-стили) — в одну колонку */
  [style*="grid-template-columns:300px"],[style*="grid-template-columns: 300px"],[style*="grid-template-columns:1fr 1fr"],[style*="grid-template-columns: 1fr 1fr"]{grid-template-columns:1fr!important}
}
@media (max-width:600px){
  .container{width:100%;padding:0 12px}
  .hero{padding:40px 0}.hero h1{font-size:1.6rem}.hero p{font-size:1rem}
  .hero-search{flex-direction:column}
  .footer-grid{grid-template-columns:1fr}
  h1{font-size:1.5rem}
  .section{padding:30px 0}
  table{display:block;overflow-x:auto;white-space:nowrap}
  .card-content{padding:14px}
  .doc{padding:18px}
  [style*="max-width:75%"],.bubble{max-width:90%!important}
  .btn{padding:9px 14px}
  form[style*="display:flex"]{flex-wrap:wrap}
  input,select,textarea{max-width:100%}
}
.site-header{padding:0}.site-footer{text-align:left;padding-bottom:0}
/* ═════ Каталог ═════ */
.filters-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}
.filters-grid label{display:flex;flex-direction:column;gap:4px;font-size:.88rem;color:#555}
.filters-grid input,.filters-grid select{padding:9px;border:2px solid #e0e0e0;border-radius:8px;font-size:.95rem;width:100%}
.filters-grid .range{display:flex;gap:6px}
.catalog-bar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;margin:18px 0 12px}
.catalog-controls{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.catalog-controls select{padding:7px;border:2px solid #e0e0e0;border-radius:8px}
.view-btn{display:inline-block;padding:5px 10px;border:2px solid #e0e0e0;border-radius:8px;text-decoration:none;color:#555;font-size:1.1rem}
.view-btn.on{border-color:var(--brand);color:var(--brand)}
.tutors-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:18px}
.tutors-list{display:flex;flex-direction:column;gap:14px}
.tcard{background:#fff;border-radius:14px;box-shadow:0 2px 12px rgba(0,0,0,.07);overflow:hidden;display:flex;flex-direction:column;transition:transform .15s}
.tcard:hover{transform:translateY(-3px)}
.tutors-list .tcard{flex-direction:row}
.tcard-photo img{width:100%;height:200px;object-fit:cover;display:block}
.tutors-list .tcard-photo{flex:0 0 180px}.tutors-list .tcard-photo img{height:100%;min-height:180px}
.tcard-body{padding:14px 16px;display:flex;flex-direction:column;gap:7px;flex:1}
.tcard-head{display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.tcard-name{font-weight:bold;font-size:1.1rem;color:#333;text-decoration:none}
.tcard-rating{white-space:nowrap;color:#e6a100;font-weight:bold}
.tcard-subj{color:#444;font-size:.92rem}
.tcard-meta{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:.84rem;color:#777}
.tcard-desc{color:#555;font-size:.9rem;margin:0}
.tcard-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-top:auto;padding-top:6px}
.tcard-price{font-size:1.15rem;font-weight:bold;color:var(--brand)}
.fmt{display:inline-block;font-size:.78rem;padding:2px 8px;border-radius:10px;margin:1px 0}
.fmt-online{background:#e3f2fd;color:#1565c0}.fmt-offline{background:#e8f5e9;color:#2e7d32}
.pager{display:flex;justify-content:center;gap:6px;margin-top:25px;flex-wrap:wrap}
.pager a,.pager span{padding:7px 12px;border-radius:8px;background:#fff;text-decoration:none;color:#333;box-shadow:0 1px 4px rgba(0,0,0,.08)}
.pager a.on{background:var(--brand);color:#fff}
@media (max-width:600px){.tutors-list .tcard{flex-direction:column}.tutors-list .tcard-photo{flex:none}.tutors-list .tcard-photo img{height:200px}}
/* Модерация */
.ublk{display:inline-block;font-size:.72rem;padding:1px 7px;border-radius:10px;background:#ffebee;color:#c62828;font-weight:bold;vertical-align:middle}
.ublk.ban{background:#212121;color:#fff}
.report-btn{background:none;border:0;cursor:pointer;font-size:.8rem;opacity:.5;padding:0 2px}
.report-btn:hover{opacity:1}
.verify-bar{background:#fff3e0;color:#e65100;text-align:center;padding:8px 12px;font-size:.92rem}
.verify-bar a{color:#e65100;font-weight:bold}
.fav-btn{background:none;border:0;cursor:pointer;font-size:1.1rem;padding:0 2px;vertical-align:middle;transition:transform .15s}
.fav-btn:hover{transform:scale(1.25)}
/* ═════ Тёмная тема (палитра, а не инверсия). Светлые inline-фоны страниц перекрашиваются селекторами по атрибуту style ═════ */
html[data-theme="dark"]{--bg:#14161f;--surface:#1e2130;--surface2:#262a3b;--line:#33384d;--text:#e4e6ef;--muted:#9aa0b5;color-scheme:dark}
html[data-theme="dark"] body{background:var(--bg);color:var(--text)}
html[data-theme="dark"] .card,html[data-theme="dark"] .tcard,html[data-theme="dark"] .doc,html[data-theme="dark"] .stats-row div,
html[data-theme="dark"] .pager a,html[data-theme="dark"] .pager span,html[data-theme="dark"] .auth-container,html[data-theme="dark"] .tutor-card,
html[data-theme="dark"] .dd-menu,html[data-theme="dark"] .filters{background:var(--surface)!important;color:var(--text);box-shadow:0 2px 10px rgba(0,0,0,.35)}
html[data-theme="dark"] .section-alt{background:#181b27}
html[data-theme="dark"] .site-header{background:linear-gradient(90deg,#2b2f6b,#3c3f8f)}
html[data-theme="dark"] .hero{background:linear-gradient(135deg,#2b2f6b,#4a3f8f)}
html[data-theme="dark"] .cta{background:linear-gradient(135deg,#6b5a10,#7a5a00)}
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,html[data-theme="dark"] h4,html[data-theme="dark"] strong,html[data-theme="dark"] b,
html[data-theme="dark"] .tcard-name,html[data-theme="dark"] label,html[data-theme="dark"] .card h3{color:var(--text)!important}
html[data-theme="dark"] .muted,html[data-theme="dark"] small,html[data-theme="dark"] .tcard-meta{color:var(--muted)!important}
html[data-theme="dark"] a{color:#9fa8ff}
html[data-theme="dark"] .btn{color:#fff}
html[data-theme="dark"] .btn-secondary{background:#3a3f55!important;color:#e4e6ef!important}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:var(--surface2)!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-theme="dark"] table{color:var(--text)}
html[data-theme="dark"] th{background:var(--surface2)!important;color:var(--text)!important}
html[data-theme="dark"] td,html[data-theme="dark"] th{border-color:var(--line)!important}
html[data-theme="dark"] tr:nth-child(even) td{background:rgba(255,255,255,.02)}
html[data-theme="dark"] .dd-menu a{color:var(--text)}
html[data-theme="dark"] .dd-menu a:hover{background:var(--surface2)}
html[data-theme="dark"] .bubble{background:var(--surface2);color:var(--text)}
html[data-theme="dark"] .bubble.mine{background:#4e54c8;color:#fff}
html[data-theme="dark"] .alert-ok{background:#1d3324!important;color:#9be2a9!important}
html[data-theme="dark"] .alert-err{background:#3a1f22!important;color:#ffb4b4!important}
html[data-theme="dark"] .verify-bar{background:#3a2e17;color:#ffcf87}
html[data-theme="dark"] .chip{background:rgba(255,255,255,.12)}
html[data-theme="dark"] .fmt-online{background:#1c2f45;color:#90c4ff}
html[data-theme="dark"] .fmt-offline{background:#1d3324;color:#9be2a9}
html[data-theme="dark"] .ublk{background:#3a1f22;color:#ffb4b4}
html[data-theme="dark"] .view-btn{border-color:var(--line);color:var(--muted)}
/* Частые светлые inline-фоны → тёмные поверхности, тёмный inline-текст → светлый */
html[data-theme="dark"] [style*="background:#fff;"],html[data-theme="dark"] [style*="background: #fff;"],html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: white"],html[data-theme="dark"] [style*="background:#f8f9fa"],html[data-theme="dark"] [style*="background: #f8f9fa"],
html[data-theme="dark"] [style*="background:#f1f3f9"],html[data-theme="dark"] [style*="background:#f5f5f5"],html[data-theme="dark"] [style*="background: #f5f5f5"],
html[data-theme="dark"] [style*="background:#e8eaf6"],html[data-theme="dark"] [style*="background:#f3f4fb"],html[data-theme="dark"] [style*="background:#fafafa"]{background:var(--surface2)!important;color:var(--text)!important}
html[data-theme="dark"] [style*="background:#fff3e0"],html[data-theme="dark"] [style*="background: #fff3e0"],html[data-theme="dark"] [style*="background:#fffaf0"],
html[data-theme="dark"] [style*="background:#fff8e1"]{background:#3a2e17!important;color:#ffd79a!important}
html[data-theme="dark"] [style*="background:#e8f5e8"],html[data-theme="dark"] [style*="background: #e8f5e8"],html[data-theme="dark"] [style*="background:#f1f8e9"],
html[data-theme="dark"] [style*="background:#e8f5e9"]{background:#1d3324!important;color:#9be2a9!important}
html[data-theme="dark"] [style*="background:#ffebee"],html[data-theme="dark"] [style*="background: #ffebee"]{background:#3a1f22!important;color:#ffb4b4!important}
html[data-theme="dark"] [style*="background:#e3f2fd"],html[data-theme="dark"] [style*="background:#f3e5f5"]{background:#232845!important;color:#c5cae9!important}
html[data-theme="dark"] [style*="color:#333"],html[data-theme="dark"] [style*="color: #333"],html[data-theme="dark"] [style*="color:#444"],
html[data-theme="dark"] [style*="color:#555"],html[data-theme="dark"] [style*="color: #555"]{color:var(--text)!important}
html[data-theme="dark"] [style*="color:#666"],html[data-theme="dark"] [style*="color: #666"],html[data-theme="dark"] [style*="color:#888"],
html[data-theme="dark"] [style*="color: #888"],html[data-theme="dark"] [style*="color:#999"]{color:var(--muted)!important}
html[data-theme="dark"] [style*="border:1px solid #e0e0e0"],html[data-theme="dark"] [style*="border: 1px solid #ddd"],html[data-theme="dark"] [style*="border-bottom:1px solid #eee"],
html[data-theme="dark"] [style*="border:2px solid #e0e0e0"]{border-color:var(--line)!important}
.theme-btn{background:none;border:0;color:#fff;font-size:1.1rem;cursor:pointer;padding:8px}
.chat-img{max-width:260px;max-height:260px;border-radius:8px;margin:4px 0;display:inline-block}
.chat-file{display:inline-block;background:rgba(0,0,0,.06);padding:6px 10px;border-radius:8px;margin:4px 0;color:inherit;text-decoration:none}
.bubble.mine .chat-file{background:rgba(255,255,255,.18);color:#fff}
.attach-btn{cursor:pointer;font-size:1.4rem;padding:6px;border-radius:8px;opacity:.6}
.attach-btn.has{opacity:1;background:#e8eaf6}
.attach-preview{display:flex;align-items:center;gap:10px;background:#f1f3f9;border:2px dashed #c5cae9;border-radius:10px;padding:8px 12px;margin-top:8px}
.attach-preview img{width:56px;height:56px;object-fit:cover;border-radius:6px}
.attach-preview .ap-icon{font-size:1.8rem}
.attach-preview .ap-name{font-weight:bold;word-break:break-all}
.attach-preview .ap-size{color:#777;font-size:.85rem}.attach-preview .ap-big{color:#c62828;font-weight:bold}
.attach-preview .ap-del{margin-left:auto;background:none;border:0;font-size:1.1rem;cursor:pointer;color:#c62828}
.card.drop{outline:3px dashed #4e54c8;outline-offset:-6px}
html[data-theme="dark"] .attach-preview{background:var(--surface2);border-color:var(--line)}
/* Таблицы на страницах сайта: воздух и зебра */
main table{width:100%;border-collapse:collapse;font-size:.95rem}
main th,main td{padding:10px 12px;border-bottom:1px solid #e8e8ef;text-align:left;vertical-align:middle}
main th{background:#f5f6fb;font-weight:600;color:#444;white-space:nowrap}
main tr:nth-child(even) td{background:#fafbfe}
main tr:hover td{background:#f1f3fb}
html[data-theme="dark"] main tr:hover td{background:#262a3b}
/* Кабинет преподавателя */
.quick-actions{display:flex;flex-wrap:wrap;gap:8px;margin:15px 0}
.quick-actions a{background:#fff;border:2px solid #e3e5f3;border-radius:10px;padding:8px 14px;text-decoration:none;color:#333;font-weight:500;transition:.15s}
.quick-actions a:hover{border-color:var(--brand);color:var(--brand)}
.stats-row a{display:block;background:#fff;border-radius:12px;padding:16px;box-shadow:0 2px 10px rgba(0,0,0,.06);text-decoration:none;color:inherit;text-align:center}
.stats-row a strong{display:block;font-size:1.5rem;color:var(--brand)}.stats-row a span{color:var(--muted);font-size:.9rem}
.tabs{display:flex;gap:4px;flex-wrap:wrap;border-bottom:2px solid #eee}
.tabs a{padding:8px 14px;text-decoration:none;color:#666;border-bottom:3px solid transparent;margin-bottom:-2px}
.tabs a.on{color:var(--brand);border-bottom-color:var(--brand);font-weight:bold}
.lesson-row{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 14px;border:1px solid #eceef6;border-left:5px solid #ccc;border-radius:10px;margin-bottom:10px}
.lr-main{flex:1;min-width:240px;display:flex;flex-direction:column;gap:4px}
.lr-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
html[data-theme="dark"] .quick-actions a,html[data-theme="dark"] .stats-row a{background:var(--surface);border-color:var(--line);color:var(--text)}
html[data-theme="dark"] .lesson-row{border-color:var(--line)}
html[data-theme="dark"] .tabs{border-color:var(--line)}
@media (max-width:960px){[style*="grid-template-columns:2fr 1fr"]{grid-template-columns:1fr!important}}

[hidden]{display:none!important}
/* ═════ v7: статус «в сети» ═════ */
.online-badge{display:inline-flex;align-items:center;gap:5px;color:#888;font-size:.85em;white-space:nowrap;vertical-align:middle}
.online-badge.on{color:#2e7d32;font-weight:600}
.online-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:#bdbdbd;flex:none}
.online-dot.on{background:#43a047;box-shadow:0 0 0 2px rgba(67,160,71,.25)}
.online-badge.only-dot .online-dot{width:11px;height:11px;border:2px solid #fff;box-shadow:none}
.online-badge.only-dot.on .online-dot{box-shadow:0 0 0 1px rgba(67,160,71,.4)}
.avatar-wrap{position:relative;display:inline-block;flex:none;line-height:0}
.avatar-wrap .online-badge{position:absolute;right:1px;bottom:1px}
.tcard-photo{position:relative;display:block}
.tcard-photo .online-badge{position:absolute;left:8px;bottom:8px;background:rgba(255,255,255,.92);padding:2px 8px;border-radius:12px;font-size:.75rem;box-shadow:0 1px 4px rgba(0,0,0,.15)}
.tcard-photo .online-badge:not(.on){display:none}   /* на карточке каталога показываем только «в сети» */
html[data-theme="dark"] .tcard-photo .online-badge{background:rgba(30,32,48,.9)}
html[data-theme="dark"] .online-badge.only-dot .online-dot{border-color:var(--surface,#1e2030)}
/* ═════ v7: мобильная шапка — меню прокручивается внутри себя ═════ */
body{overflow-x:clip}
@media (max-width:960px){
  .site-header .main-nav.show{max-height:calc(100vh - 62px);max-height:calc(100dvh - 62px);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-bottom:16px}
  body.nav-open{overflow:hidden}
  .dropdown{width:100%}
  .dd-menu{min-width:0;width:100%;border-radius:8px}
  .dd-menu a{padding:11px 16px;font-size:1rem}
  .nav-icons a{font-size:1.25rem;padding:8px 12px}
  .theme-btn{align-self:flex-start}
  .tp-head{flex-wrap:wrap}
  .tp-head>div:first-child{margin:0 auto}
}
/* ═════ v7: фильтры каталога на телефоне ═════ */
.filters-grid select{appearance:none;-webkit-appearance:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23777' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 10px center;padding-right:30px;color:#333;min-height:42px}
.filters-grid input{min-height:42px}
html[data-theme="dark"] .filters-grid select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23aab' stroke-width='2'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:right 10px center!important}
@media (max-width:600px){
  .filters-grid{grid-template-columns:1fr 1fr;gap:10px}
  .filters-grid label:first-child,.filters-grid label.wide{grid-column:1/-1}
  .filters-grid input,.filters-grid select{font-size:16px}   /* 16px — iOS не увеличивает страницу при фокусе */
  .filters-toggle{display:flex!important}
  .filters-card.collapsed .filters-body{display:none}
}
.filters-toggle{display:none;justify-content:space-between;align-items:center;width:100%;background:none;border:0;font:inherit;font-weight:600;padding:2px 0 10px;cursor:pointer;color:inherit}
/* Всплывающие формы в строке урока (срыв, возврат) */
.lr-pop{position:relative;display:inline-block}
.lr-pop>summary{list-style:none;cursor:pointer}
.lr-pop>summary::-webkit-details-marker{display:none}
.lr-pop>form{position:absolute;right:0;top:calc(100% + 6px);z-index:30;width:min(340px,86vw);background:var(--surface,#fff);border:1px solid var(--line,#e0e3ef);border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.15);padding:12px;display:grid;gap:8px;font-size:.9rem}
.lr-pop label{display:block}
.lr-pop textarea,.lr-pop input[type=number]{width:100%;padding:8px;border:2px solid #e0e0e0;border-radius:8px;box-sizing:border-box}
.lr-pop .muted{font-size:.8rem;margin:0}
@media(max-width:600px){.lr-pop>form{position:fixed;left:50%;top:50%;right:auto;transform:translate(-50%,-50%)}}
