:root{
--site-width:1304px;
--test-content-width:1000px;
--accent:#4c78a8;
--line:#e6e6e6;
--text:#111;
}

html{
overflow-y:scroll;
}

*{
box-sizing:border-box;
}

body{
margin:0;
font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
color:var(--text);
background:#fff;
}

/* Единый текстовый ритм: без двойных пустых строк после абзацев */
p{
margin-top:0;
margin-bottom:.75em;
}

p:last-child{
margin-bottom:0;
}

p:empty{
display:none;
}

.qText p,
.text p,
.paper p,
.theory-sheet p,
.lesson-sheet p,
.theory-block__body p,
.compact-box p,
.compact-box__body p,
.sheet-body p,
.cardBody p{
margin-top:0!important;
margin-bottom:.68em!important;
}

.qText p:last-child,
.text p:last-child,
.paper p:last-child,
.theory-sheet p:last-child,
.lesson-sheet p:last-child,
.theory-block__body p:last-child,
.compact-box p:last-child,
.compact-box__body p:last-child,
.sheet-body p:last-child,
.cardBody p:last-child{
margin-bottom:0!important;
}

.text br + br,
.paper br + br,
.theory-sheet br + br,
.lesson-sheet br + br,
.theory-block__body br + br,
.compact-box br + br,
.compact-box__body br + br,
.sheet-body br + br{
display:none;
}

.qText p:empty,
.text p:empty,
.paper p:empty,
.theory-sheet p:empty,
.lesson-sheet p:empty,
.theory-block__body p:empty,
.compact-box p:empty,
.compact-box__body p:empty,
.sheet-body p:empty,
.cardBody p:empty{
display:none!important;
}

/* контейнер */

.container{
max-width:var(--site-width);
margin:0 auto;
padding:0;
}



/* HEADER */

.site-header{
position:relative;
top:auto;
z-index:1000;
background:#fff;
border-bottom:1px solid var(--line);
padding:0 16px;
}

.header-inner{
height:64px;
display:flex;
align-items:center;
justify-content:space-between;
}

/* логотип */

.logo{
font-size:20px;
font-weight:700;
text-decoration:none;
color:#111;
}

/* меню */

.nav{
display:flex;
gap:28px;
align-items:center;
}

.nav a{
text-decoration:none;
color:#111;
font-size:15px;
}

/* активный пункт */

.nav a.active{
color:var(--accent);
font-weight:600;
}

/* dropdown */

.dropdown{
position:relative;
}

.dropdown-toggle{
display:flex;
align-items:center;
gap:6px;
cursor:pointer;
}

/* стрелка */

.arrow{
font-size:12px;
}

/* выпадающее меню (desktop) */

.dropdown-menu{
display:none;
position:absolute;
top:100%;
left:0;

flex-direction:column;

background:#fff;
border:1px solid var(--line);
box-shadow:0 8px 20px rgba(0,0,0,.08);

padding:10px 0;
min-width:180px;
}

.dropdown:hover .dropdown-menu{
display:flex;
}

.dropdown-menu a{
padding:8px 16px;
font-size:14px;
white-space:nowrap;
}

.dropdown-menu a:hover{
background:#f5f5f5;
}

/* бургер */

.menu-toggle{
display:none;
font-size:22px;
cursor:pointer;

width:44px;
height:44px;

align-items:center;
justify-content:center;

border-radius:8px;
}

.menu-toggle:active{
background:#f2f2f2;
}

/* MOBILE */

@media (max-width:720px){

.menu-toggle{
display:flex;
}

/* меню */

.nav{
display:none;

position:absolute;
top:64px;
left:0;

width:100%;

background:#fff;

flex-direction:column;
align-items:flex-start;

padding:10px 20px;

border-bottom:1px solid var(--line);
box-shadow:0 10px 30px rgba(0,0,0,.08);

gap:0;
}

.nav.open{
display:flex;
}

/* пункт */

.dropdown{
width:100%;
}

.dropdown-toggle{
display:flex;
justify-content:space-between;
width:100%;

padding:12px 0;

font-size:18px;
font-weight:600;
}

/* подменю */

.dropdown-menu{
display:flex;
flex-direction:column;
gap:12px;

position:static;

border:none;
box-shadow:none;

padding-left:20px;
margin-top:6px;
}

.dropdown:hover .dropdown-menu{
display:flex;
}

.dropdown-menu a{
font-size:16px;
padding:4px 0;
}

.arrow{
display:none;
}

}

/* Поля для одной буквы: сохраняем только нижнее подчёркивание без рамки фокуса. */
input.letter:focus,
input.letter:focus-visible,
input.gap:focus,
input.gap:focus-visible,
input.gap-input:focus,
input.gap-input:focus-visible,
input.practice-input:focus,
input.practice-input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

input.letter:not(.good):not(.bad):not(.correct):not(.incorrect):not(.ok):not(.wrong),
input.gap:not(.good):not(.bad):not(.correct):not(.incorrect):not(.ok):not(.wrong),
input.gap-input:not(.good):not(.bad):not(.correct):not(.incorrect):not(.ok):not(.wrong),
input.practice-input:not(.good):not(.bad):not(.correct):not(.incorrect):not(.ok):not(.wrong) {
  color: var(--accent, #4c78a8) !important;
  caret-color: var(--accent, #4c78a8);
}

/* TEST PAGES */
:root{
  --text:#121212;
  --muted:#5a5a5a;
  --border:#e7e7e7;
  --bg:#fbfbfb;
  --card:#fff;
  --radius:14px;
  --accent:#4c78a8;
  --accent-strong:#335b8a;
  --accent-soft:#f2f6fb;
  --accent-border:#d6e3f2;
  --good:#16a34a;
  --bad:#dc2626;
  --warn:#d97706;
  --shadow:0 10px 30px rgba(0,0,0,.06);
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  color:var(--text);
  background:linear-gradient(180deg,#f7fbff 0%,var(--bg) 42%,#fff 100%);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}

.wrap{
  max-width:var(--site-width);
  margin:0 auto;
  padding:22px 0;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:#fff;
  box-shadow:var(--shadow);
}

.brand .title{
  font-weight:750;
}

.brand .sub{
  margin-top:6px;
  color:var(--muted);
  font-size:13px;
}

.answerSummary{
  width:100%;
  max-width:var(--site-width);
  margin:0 auto;
  padding:14px 16px;
  border:1px solid var(--accent-border);
  border-radius:14px;
  background:#fff;
  color:var(--muted);
  font-size:16px;
  line-height:1.45;
}

.answerSummary b{
  color:var(--text);
  font-weight:800;
}

.toolbar{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}

.btn{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:8px 10px;
  color:#111;
  font:inherit;
  font-size:14px;
  line-height:1.2;
  font-weight:650;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease,color .15s ease,transform .15s ease;
}

.btn:hover{
  border-color:var(--accent-border);
  background:var(--accent-soft);
  color:var(--accent-strong);
}

.btn.primary{
  border-color:var(--accent);
  background:var(--accent);
  color:#fff;
}

.btn.primary:hover{
  border-color:var(--accent-strong);
  background:var(--accent-strong);
  color:#fff;
}

.testBackBtn{
  color:var(--accent-strong);
}

.printPdfBtn{
  border-color:var(--border);
  background:#fff;
  color:#111;
}

.printPdfBtn:hover{
  border-color:var(--accent-border);
  background:var(--accent-soft);
  color:var(--accent-strong);
}

.meta{
  display:grid;
  grid-template-columns:1fr;
  gap:18px 14px;
  margin-top:18px;
  align-items:center;
}

.progress{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  max-width:var(--site-width);
  margin:0 auto;
  padding:10px 12px;
  border:1px solid var(--accent-border);
  border-radius:12px;
  background:var(--accent-soft);
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border:1px solid var(--accent-border);
  border-radius:999px;
  background:#fff;
  color:var(--accent-strong);
  font-size:13px;
}

.dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:#ddd;
}

.dot.good{
  background:var(--good);
}

.dot.bad{
  background:var(--bad);
}

.dot.neutral{
  background:var(--accent);
}

.card{
  margin-top:18px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--card);
  box-shadow:var(--shadow);
  overflow:hidden;
}

#tasks.choice-card-grid{
  margin-top:18px;
  row-gap:18px;
}

#tasks.choice-card-grid .card{
  margin-top:0;
}

.card:focus-within{
  border-color:var(--accent-border);
}

.cardBody{
  padding:16px;
}

.qRow{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  flex-wrap:wrap;
}

.qHead{
  display:flex;
  align-items:center;
  gap:10px;
}

#tasks.choice-card-grid .optionsGrid{
  display:grid;
  gap:6px;
  margin-top:6px;
}

#tasks.choice-card-grid .optionItem{
  display:flex;
  align-items:flex-start;
  gap:6px;
  line-height:1.35;
}

#tasks.choice-card-grid .optionItem input{
  flex:0 0 auto;
  margin:3px 0 0;
}

.qNum{
  font-weight:800;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border:1px solid var(--accent-border);
  border-radius:999px;
  background:var(--accent-soft);
  color:var(--accent-strong);
  font-size:12px;
}

.badge .chip{
  width:10px;
  height:10px;
  border-radius:50%;
}

.status{
  display:block;
  flex:0 0 13px;
  width:13px;
  min-width:13px;
  height:13px;
  min-height:13px;
  margin-top:7px;
  padding:0;
  overflow:hidden;
  border:0;
  border-radius:50%;
  background:#9ca3af;
  color:transparent;
  font-size:0;
  line-height:0;
}

.status.good{
  background:var(--good);
}

.status.bad{
  background:var(--bad);
}

.status.neutral{
  background:#9ca3af;
}

.qText{
  margin-top:12px;
  font-size:16px;
  line-height:1.6;
  text-align:justify;
  text-justify:inter-word;
  hyphens:auto;
}

.option:hover{
  border-color:var(--accent);
}

.option.selected:not(.good):not(.bad):not(.missed){
  border-color:var(--accent);
  background:var(--accent);
  color:#fff;
}

.answerRow{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

.answerInput{
  box-sizing:border-box;
  width:150px;
  max-width:100%;
  min-width:120px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  color:var(--text);
  font-size:15px;
  outline:0;
}

.answerInput:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(76,120,168,.16);
}

.letter{
  box-sizing:border-box;
  display:inline-block;
  width:18px;
  min-width:18px;
  max-width:18px;
  height:26px;
  min-height:26px;
  margin:0 1px;
  padding:0 1px;
  border:0;
  border-bottom:1.5px solid #111;
  border-radius:0;
  background:transparent;
  color:#00aeea;
  font-size:16px;
  font-weight:700;
  line-height:24px;
  text-align:center;
  vertical-align:middle;
  outline:0;
}

.letter.good{
  border-bottom-color:var(--good);
  color:var(--good);
}

.letter.bad{
  border-bottom-color:var(--bad);
  color:var(--bad);
}

.input{
  min-width:120px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  font-size:15px;
}

.input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(76,120,168,.16);
  outline:0;
}

.reveal{
  width:100%;
  margin-top:6px;
  color:var(--muted);
  font-size:13px;
}

.reveal b{
  color:#111;
}

.hidden{
  display:none;
}

#toTopBtn{
  position:fixed;
  right:24px;
  bottom:24px;
  z-index:1000;
  display:none;
  width:42px;
  height:42px;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:50%;
  background:var(--accent);
  color:#fff;
  font-size:18px;
  line-height:1;
  box-shadow:0 4px 12px rgba(0,0,0,.15);
  cursor:pointer;
  transition:opacity .2s ease, transform .2s ease;
}

#toTopBtn:hover{
  background:var(--accent-strong);
  transform:translateY(-2px);
}

#toTopBtn.show{
  display:flex;
}

@media (max-width:720px){
  .wrap{
    padding-top:16px;
    padding-bottom:16px;
  }

  .topbar{
    flex-direction:column;
    align-items:stretch;
    gap:12px;
  }

  .topbar > div:last-child{
    display:flex;
    width:100%;
    gap:10px;
  }

  .toolbar{
    width:100%;
  }

  .btn{
    flex:1;
    text-align:center;
  }

  .progress{
    flex-direction:column;
    align-items:stretch;
    gap:8px;
  }

  .pill{
    width:100%;
    justify-content:space-between;
  }

  #toTopBtn{
    right:16px;
    bottom:16px;
  }
}

/* END TEST PAGES */

/* Единая компактная высота элементов выбора на всём сайте. */
select:not([multiple]):not([size]){
  box-sizing:border-box;
  min-height:42px!important;
}

/* Единое место под горизонтальный бегунок у прокручиваемых таблиц. */
:is(.attendance-table-wrap,.payments-table-wrap,.teacher-link-base-table-wrap,.parent-reports-table-wrap,.analytics-table-wrap,.analytics-topic-table-wrap,.admin-table-scroll,.gradebook-scroll,.compact-table-wrap,.table-wrap,.report-section:has(.report-table),.account-panel:has(>.account-table)){
  box-sizing:border-box;
  padding-bottom:12px;
  scrollbar-gutter:stable;
  -webkit-overflow-scrolling:touch;
}

:is(.attendance-table-wrap,.payments-table-wrap,.teacher-link-base-table-wrap,.parent-reports-table-wrap,.analytics-table-wrap,.analytics-topic-table-wrap,.admin-table-scroll,.gradebook-scroll,.compact-table-wrap,.table-wrap,.report-section:has(.report-table),.account-panel:has(>.account-table))::-webkit-scrollbar{
  height:10px;
}

:is(.attendance-table-wrap,.payments-table-wrap,.teacher-link-base-table-wrap,.parent-reports-table-wrap,.analytics-table-wrap,.analytics-topic-table-wrap,.admin-table-scroll,.gradebook-scroll,.compact-table-wrap,.table-wrap,.report-section:has(.report-table),.account-panel:has(>.account-table))::-webkit-scrollbar-track{
  border-radius:999px;
  background:#eef2f6;
}

:is(.attendance-table-wrap,.payments-table-wrap,.teacher-link-base-table-wrap,.parent-reports-table-wrap,.analytics-table-wrap,.analytics-topic-table-wrap,.admin-table-scroll,.gradebook-scroll,.compact-table-wrap,.table-wrap,.report-section:has(.report-table),.account-panel:has(>.account-table))::-webkit-scrollbar-thumb{
  border:2px solid #eef2f6;
  border-radius:999px;
  background:#9aabba;
}
