/* StudentSOS v20.3 — regression fixes + tutor/product polish */

/* Header: never wrap/overlap. The tutor item moves into "More" before space gets tight. */
@media (min-width:861px){
  .s14-header .header-inner{gap:14px!important;min-width:0}
  .desktop-nav.s6-nav{min-width:0!important;flex-wrap:nowrap!important;white-space:nowrap!important;overflow:visible}
  .desktop-nav.s6-nav>a,.desktop-nav.s6-nav button,.desktop-nav.s6-nav summary{white-space:nowrap!important;line-height:1.1!important}
  .header-actions{flex:0 0 auto!important;white-space:nowrap}
}
@media (min-width:861px) and (max-width:1240px){.s202-nav-tutor{display:none!important}.s202-more-tutor{display:block!important}}
@media (min-width:1241px){.s202-more-tutor{display:none!important}}
@media (min-width:861px) and (max-width:1060px){.desktop-nav.s6-nav{gap:1px!important}.desktop-nav.s6-nav>a,.desktop-nav.s6-nav>.s6-mega-wrap>.s6-mega-trigger,.s201-more>summary{padding:7px 5px!important;font-size:11px!important}.s17-brand{margin-right:4px!important}.s17-brand small{display:none!important}}

/* Project workspace: exactly one viewport. Composer is a fixed row of the flex shell, not a page-sticky element. */
body.s18-product-app{height:100dvh!important;min-height:0!important;overflow:hidden!important;padding:0!important}
body.s18-product-app .s18-project{height:100dvh!important;min-height:0!important;max-height:100dvh!important;overflow:hidden!important}
body.s18-product-app .s18-chat-shell{height:100%!important;min-height:0!important;max-height:100%!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}
body.s18-product-app .s18-chat-head{position:relative!important;top:auto!important;flex:0 0 auto!important;z-index:15!important}
body.s18-product-app .s18-doc-studio{flex:0 1 auto!important;max-height:min(55vh,650px)!important;overflow-y:auto!important;overscroll-behavior:contain!important;margin-bottom:0!important}
body.s18-product-app .s18-generation-progress{position:relative!important;top:auto!important;z-index:2!important;box-shadow:none!important}
body.s18-product-app .s18-chat-stream{flex:1 1 0!important;min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain!important;padding:18px 0 14px!important;scroll-padding-bottom:18px!important}
body.s18-product-app .s18-composer-wrap{position:relative!important;inset:auto!important;flex:0 0 auto!important;margin:0!important;padding:7px 12px 8px!important;border-top:1px solid #edf0f4!important;background:#fff!important;z-index:20!important}
body.s18-product-app .s18-composer{margin-bottom:0!important;box-shadow:0 8px 24px rgba(20,32,52,.08)!important}
body.s18-product-app .s18-composer-meta{padding-bottom:0!important;margin-bottom:0!important}
body.s18-product-app .s18-context{top:0!important;max-height:100dvh!important;height:100dvh!important}
body.s18-product-app .s18-context-save{margin-bottom:22px!important}
body.s18-product-app .s18-context-card:last-of-type{margin-bottom:14px!important}
.s18-project.is-long-project .s18-chat-stream:empty{padding-top:4px!important;padding-bottom:4px!important}
.s18-project.is-tutor-project .s18-chat-title small:before{content:'Урок · ';color:#7757ff;font-weight:900}.s203-back-tutor{background:#f1edff!important;color:#6748e8!important;border-color:#e3dbff!important}

@media(max-width:860px){
 body.s18-product-app{padding-top:64px!important;padding-bottom:76px!important;height:100dvh!important}
 body.s18-product-app .s18-project{height:calc(100dvh - 140px)!important;max-height:calc(100dvh - 140px)!important}
 body.s18-product-app .s18-chat-shell{height:100%!important;max-height:100%!important}
 body.s18-product-app .s18-chat-head{top:auto!important;padding:8px 9px!important}
 body.s18-product-app .s18-doc-studio{max-height:42%!important;margin-top:6px!important}
 body.s18-product-app .s18-chat-stream{padding:10px 0 7px!important}
 body.s18-product-app .s18-composer-wrap{padding:5px 7px max(6px,env(safe-area-inset-bottom))!important}
 body.s18-product-app .s18-composer{padding:6px!important;border-radius:16px!important}
 body.s18-product-app .s18-composer textarea{min-height:44px!important;max-height:128px!important;padding:6px 8px!important}
 body.s18-product-app .s18-context{top:64px!important;bottom:76px!important;height:auto!important;max-height:none!important;padding-bottom:22px!important}
 .s18-section-working{position:relative!important;top:auto!important}
}

/* Guest limit wall — real conversion surface, not a system alert. */
.s203-wall-open{overflow:hidden!important}.s203-guest-wall{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;padding:20px}.s203-guest-wall-blur{position:absolute;inset:0;background:rgba(15,23,42,.36);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}.s203-guest-wall-card{position:relative;width:min(620px,100%);background:#fff;border:1px solid rgba(255,255,255,.8);border-radius:28px;box-shadow:0 30px 100px rgba(15,23,42,.28);padding:30px}.s203-guest-wall-card>span{display:block;font-size:11px;font-weight:900;letter-spacing:.09em;color:#ff526f}.s203-guest-wall-card h2{font-size:32px;line-height:1.06;margin:8px 0 10px;color:#111827}.s203-guest-wall-card>p{font-size:16px;line-height:1.55;color:#667085;margin:0 0 18px}.s203-wall-x{position:absolute;right:15px;top:14px;width:38px;height:38px;border:0;border-radius:12px;background:#f3f5f8;font-size:24px;cursor:pointer}.s203-wall-features{display:grid;grid-template-columns:1fr 1fr;gap:9px;padding:16px;background:#f7f9ff;border-radius:18px;margin-bottom:16px}.s203-wall-features b{grid-column:1/-1;font-size:12px;color:#6c56e8}.s203-wall-features i{font-style:normal;font-size:13px;font-weight:750;color:#344054}.s203-wall-main{display:flex;justify-content:center;align-items:center;min-height:52px;border-radius:15px;background:#1769ff;color:#fff;text-decoration:none;font-weight:900;font-size:15px}.s203-guest-wall-card>small{display:block;text-align:center;color:#98a2b3;margin-top:10px}@media(max-width:560px){.s203-guest-wall{padding:12px}.s203-guest-wall-card{padding:24px 18px;border-radius:22px}.s203-guest-wall-card h2{font-size:27px}.s203-wall-features{grid-template-columns:1fr}}

/* Referral sharing: large recognizable targets. OG image itself is fetched by social networks. */
.s201-share-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:10px!important}.s201-share-grid a,.s201-share-grid button{min-height:76px!important;padding:10px 7px!important;border-radius:15px!important}.s201-share-grid b{display:grid;place-items:center;min-width:42px;height:42px;padding:0 7px;border-radius:13px;background:rgba(255,255,255,.18);font-size:13px!important;font-weight:950!important}.s201-share-grid span{font-size:10px!important;font-weight:750;opacity:.95!important}@media(max-width:620px){.s201-share-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}

/* Public share enrichment. */
.s203-share-gallery{margin:22px 0 4px;padding:18px;border:1px solid #e8ebf2;border-radius:20px;background:#fafbfe}.s203-share-gallery>div:first-child span{font-size:10px;font-weight:900;letter-spacing:.08em;color:#667085}.s203-share-gallery h2{font-size:20px;margin:4px 0 14px}.s203-share-gallery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.s203-share-gallery figure{margin:0;border-radius:14px;overflow:hidden;background:#fff;border:1px solid #e7eaf0}.s203-share-gallery img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;background:#eef1f5}.s203-share-gallery figcaption{padding:8px 9px;font-size:10px;line-height:1.35;color:#667085}.s203-share-gallery figcaption a{color:#1769ff}@media(max-width:680px){.s203-share-gallery-grid{grid-template-columns:1fr 1fr}}@media(max-width:440px){.s203-share-gallery-grid{grid-template-columns:1fr}}

/* Profile / subscription. */
.s203-profile-bonus{margin:0 0 14px;padding:12px 14px;border:1px solid #cbeedb;background:#effcf5;color:#17744b;border-radius:14px;font-weight:800}.s8-profile-card h2 small{font-size:10px;color:#7757ff;background:#f1edff;padding:4px 7px;border-radius:99px}.s203-profile-help{font-size:12px!important;color:#667085!important;margin-top:-3px!important}.s202-subscription-manage>summary{cursor:pointer;user-select:none;min-height:42px;display:flex;align-items:center;font-weight:850}.s202-subscription-panel{margin-top:8px}

/* Tutor — real course/progress UI. */
.s203-tutor-main{max-width:1180px!important}.s203-tutor-hero{display:flex;justify-content:space-between;gap:22px;align-items:center;padding:25px;border-radius:24px;background:linear-gradient(135deg,#f3f0ff,#f2f8ff);margin-bottom:14px}.s203-tutor-hero>div>span,.s203-section-head span,.s203-tutor-subject-head>div>span,.s203-next-topic span{font-size:10px;font-weight:950;letter-spacing:.08em;color:#6e54e8}.s203-tutor-hero h1{font-size:31px;line-height:1.08;margin:5px 0 8px}.s203-tutor-hero p{max-width:720px;color:#667085;line-height:1.55}.s203-tutor-hero .sos-mascot{width:74px;height:74px}.s203-tutor-overview{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:22px}.s203-tutor-overview article{padding:15px;border:1px solid #e6eaf0;border-radius:16px;background:#fff}.s203-tutor-overview b,.s203-tutor-overview span{display:block}.s203-tutor-overview b{font-size:23px}.s203-tutor-overview span{font-size:11px;color:#7a8495}.s203-section-head{display:flex;justify-content:space-between;gap:18px;align-items:end;margin:18px 0 11px}.s203-section-head h2{margin:3px 0 0}.s203-section-head p{max-width:520px;color:#7a8495;font-size:12px}.s203-subject-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.s203-subject-grid>a{display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:11px;padding:14px;border:1px solid #e5e9f0;border-radius:17px;background:#fff;text-decoration:none;color:#253147;transition:.18s}.s203-subject-grid>a:hover{transform:translateY(-2px);box-shadow:0 12px 28px rgba(31,44,67,.08);border-color:#cfd9ee}.s203-subject-grid i{width:42px;height:42px;border-radius:13px;background:#f1edff;color:#7556ef;display:grid;place-items:center}.s203-subject-grid i svg{width:21px}.s203-subject-grid b,.s203-subject-grid span{display:block}.s203-subject-grid b{font-size:13px}.s203-subject-grid span{font-size:10px;color:#8a93a2;margin-top:3px}.s203-subject-grid em{display:block;height:5px;background:#eef1f5;border-radius:99px;margin-top:8px;overflow:hidden}.s203-subject-grid em u{display:block;height:100%;background:#7556ef}.s203-subject-grid strong{font-size:12px;color:#7556ef}.s203-tutor-method{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin-top:24px}.s203-tutor-method article{padding:15px;border-radius:16px;background:#f8fafc}.s203-tutor-method article>b{display:grid;place-items:center;width:26px;height:26px;border-radius:9px;background:#172033;color:#fff}.s203-tutor-method h3{font-size:13px;margin:9px 0 4px}.s203-tutor-method p{font-size:10px;color:#7a8495;line-height:1.5}.s203-tutor-subject-head{display:grid;grid-template-columns:minmax(0,1fr) 150px;gap:16px;align-items:end}.s203-tutor-subject-head>a{grid-column:1/-1;color:#65738a;font-size:11px;text-decoration:none}.s203-tutor-subject-head h1{font-size:30px;margin:4px 0}.s203-tutor-subject-head p{color:#7a8495}.s203-subject-progress b{font-size:27px;color:#7556ef}.s203-subject-progress span{display:block;font-size:10px;color:#7a8495}.s203-subject-progress em{height:6px;background:#edf0f5;border-radius:99px;display:block;overflow:hidden;margin-top:8px}.s203-subject-progress u{height:100%;display:block;background:#7556ef}.s203-next-topic{display:flex;justify-content:space-between;gap:16px;align-items:center;margin:18px 0;padding:17px 18px;border:1px solid #ded6ff;background:#f7f5ff;border-radius:18px}.s203-next-topic h2{font-size:18px;margin:4px 0}.s203-next-topic p{font-size:11px;color:#6c7280}.s203-next-topic button{border:0;border-radius:12px;background:#7556ef;color:#fff;padding:11px 14px;font-weight:850;cursor:pointer;white-space:nowrap}.s203-level-tabs{display:flex;gap:7px;overflow:auto;margin:16px 0 4px}.s203-level-tabs a{white-space:nowrap;text-decoration:none;border:1px solid #e4e8ee;border-radius:11px;padding:8px 11px;color:#667085;font-size:11px;font-weight:800}.s203-level-tabs a.active{background:#172033;color:#fff;border-color:#172033}.s203-topic-list{display:grid;gap:8px}.s203-topic-list article{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px;border:1px solid #e6eaf0;border-radius:15px;background:#fff}.s203-topic-list article.recommended{border-color:#bdb0ff;box-shadow:0 0 0 3px #f2efff}.s203-topic-num{font-size:10px;color:#98a2b3;font-weight:900}.s203-topic-list b,.s203-topic-list small{display:block}.s203-topic-list b{font-size:12px}.s203-topic-list small{font-size:9px;color:#98a2b3;margin-top:3px}.s203-topic-actions{display:flex;gap:6px}.s203-topic-actions button{border:1px solid #e3e7ed;background:#fff;border-radius:10px;padding:8px 9px;font-size:10px;font-weight:800;cursor:pointer}.s203-topic-actions .primary{background:#1769ff;color:#fff;border-color:#1769ff}@media(max-width:1000px){.s203-subject-grid{grid-template-columns:1fr 1fr}.s203-tutor-method{grid-template-columns:1fr 1fr}}@media(max-width:620px){.s203-tutor-hero{padding:18px}.s203-tutor-hero .sos-mascot{display:none}.s203-tutor-hero h1{font-size:25px}.s203-tutor-overview{grid-template-columns:1fr 1fr}.s203-subject-grid{grid-template-columns:1fr}.s203-tutor-method{grid-template-columns:1fr 1fr}.s203-tutor-subject-head{grid-template-columns:1fr}.s203-next-topic{align-items:flex-start;display:grid}.s203-topic-list article{grid-template-columns:28px minmax(0,1fr)}.s203-topic-actions{grid-column:2;justify-content:flex-start}}

/* Admin spacing/regression guard. */
.admin-v6-main{padding-bottom:40px!important}.admin-v6-section{margin-bottom:18px!important}.admin-v6-section-head{margin-bottom:15px!important}.admin-v6-card{padding:17px!important}.admin-v6-card label{display:grid;gap:6px;margin-bottom:12px!important;line-height:1.35}.admin-v6-card input,.admin-v6-card select,.admin-v6-card textarea{min-height:42px!important;padding:9px 10px!important}.admin-v6-card textarea{min-height:90px!important}.admin-v6-grid{gap:14px!important}.admin-v6-section .btn{margin-top:8px}
