/* css/select-controls.css */
/* Unified select controls are loaded after page-specific styles on purpose. */
select {
  color-scheme: light;
}

select:not([multiple]) {
  min-height: var(--control-height, 44px);
  padding: 10px 45px 10px 13px;
  border: 1px solid var(--ui-border,#aeb9c9);
  border-radius: var(--control-radius, 8px);
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--ui-surface,#fff);
  background-image:
    var(--ui-select-arrow, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10' fill='none'%3E%3Cpath d='M2 2L8 8L14 2' stroke='%23244A7C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")),
    linear-gradient(to left, var(--ui-info-soft,#edf2f8) 0, var(--ui-info-soft,#edf2f8) 42px, transparent 42px);
  background-repeat: no-repeat, no-repeat;
  background-position: right 13px center, 0 0;
  background-size: 16px 10px, 100% 100%;
  box-shadow: 0 1px 2px rgba(24, 34, 56, .04);
  color: var(--ink);
  cursor: pointer;
  line-height: 1.35;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}

select:not([multiple]):hover:not(:disabled) {
  border-color: var(--ui-border,#8798b0);
  background-image:
    var(--ui-select-arrow, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10' fill='none'%3E%3Cpath d='M2 2L8 8L14 2' stroke='%23183B63' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")),
    linear-gradient(to left, var(--ui-info-soft,#e3eaf4) 0, var(--ui-info-soft,#e3eaf4) 42px, transparent 42px);
}

select:not([multiple]):focus,
select:not([multiple]):focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 74, 124, .12);
  outline: 0;
}

select:not([multiple]):disabled {
  border-color: var(--ui-border,#d5dbe4);
  background-color: var(--ui-info-soft,#f3f5f8);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10' fill='none'%3E%3Cpath d='M2 2L8 8L14 2' stroke='%23808A9A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    linear-gradient(to left, var(--ui-info-soft,#e8ebf0) 0, var(--ui-info-soft,#e8ebf0) 42px, transparent 42px);
  color: var(--ui-muted,#707989);
  cursor: not-allowed;
}

select:not([multiple])[aria-invalid="true"] {
  border-color: var(--danger, #963247);
  box-shadow: 0 0 0 3px rgba(150, 50, 71, .1);
}

select:not([multiple]) option,
select:not([multiple]) optgroup {
  background: var(--ui-surface,#fff);
  color: var(--ink);
  font: inherit;
}

select[multiple] {
  min-height: 150px;
  padding: 6px;
  border: 1px solid var(--ui-border,#aeb9c9);
  border-radius: var(--control-radius, 8px);
  background: var(--ui-surface,#fff);
  box-shadow: inset 0 1px 2px rgba(24, 34, 56, .035);
  color: var(--ink);
}

select[multiple]:hover:not(:disabled) {
  border-color: var(--ui-border,#8798b0);
}

select[multiple]:focus,
select[multiple]:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 74, 124, .12);
  outline: 0;
}

select[multiple] option {
  margin: 2px 0;
  padding: 9px 10px;
  border-radius: 6px;
}

select[multiple] option:checked {
  background: linear-gradient(var(--accent-soft), var(--accent-soft));
  color: var(--accent);
  font-weight: 700;
}

@supports selector(select:has(option[value=""]:checked)) {
  select:not([multiple]):has(option[value=""]:checked) {
    color: var(--muted);
  }
}

@media (max-width: 600px) {
  select:not([multiple]) {
    min-height: 48px;
    padding-top: 11px;
    padding-bottom: 11px;
    font-size: 16px;
  }
}

/* Enhanced dropdown. The native select stays in the form and owns its value. */
.custom-select {
  position: relative;
  display: inline-grid;
  max-width: 100%;
  min-width: 0;
  vertical-align: middle;
}

/* A wrapped select must still fill the same column as a text input. */
:is(.auth-form, .lesson-form-control, .analytics-filter, .teacher-filter-bar,
    .draft-sidebar, .draft-settings, .library-filter, .se-filters, .field-group) .custom-select {
  display: grid;
  width: 100%;
}

.custom-select__native,
.custom-select__trigger {
  grid-area: 1 / 1;
}

.custom-select__native {
  opacity: 0;
  pointer-events: none;
  /* WebKit can include the invisible option text in the page's scroll width. */
  overflow: hidden;
}

.custom-select__trigger,
button.custom-select__trigger {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: var(--control-height, 44px);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 0 13px;
  overflow: hidden;
  border: 1px solid var(--ui-border,#aeb9c9);
  border-radius: var(--control-radius, 8px);
  background: var(--ui-surface,#fff);
  box-shadow: 0 1px 2px rgba(24, 34, 56, .04);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.custom-select__trigger:hover:not(:disabled) {
  border-color: var(--ui-border,#8798b0);
  background: var(--ui-surface,#fff);
}

.custom-select__trigger:focus,
.custom-select__trigger:focus-visible,
.custom-select.is-open .custom-select__trigger {
  border-color: var(--accent);
  background: var(--ui-surface,#fff);
  box-shadow: 0 0 0 3px rgba(36, 74, 124, .12);
  outline: 0;
}

.custom-select__trigger:disabled {
  border-color: var(--ui-border,#d5dbe4);
  background: var(--ui-info-soft,#f3f5f8);
  color: var(--ui-muted,#707989);
  cursor: not-allowed;
  opacity: 1;
}

.custom-select.is-invalid .custom-select__trigger {
  border-color: var(--danger, #963247);
  box-shadow: 0 0 0 3px rgba(150, 50, 71, .1);
}

.custom-select__value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select__trigger.is-placeholder .custom-select__value {
  color: var(--muted);
}

.custom-select__chevron {
  position: relative;
  display: grid;
  width: 42px;
  min-width: 42px;
  min-height: calc(var(--control-height, 44px) - 2px);
  align-self: stretch;
  place-items: center;
  background: var(--ui-info-soft,#edf2f8);
}

.custom-select__chevron::before {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  content: "";
  transform: translateY(-2px) rotate(45deg);
  transition: transform .16s;
}

.custom-select.is-open .custom-select__chevron {
  background: var(--accent-soft);
}

.custom-select.is-open .custom-select__chevron::before {
  transform: translateY(2px) rotate(225deg);
}

.custom-select__trigger:disabled .custom-select__chevron {
  background: var(--ui-info-soft,#e8ebf0);
}

.custom-select__trigger:disabled .custom-select__chevron::before {
  border-color: var(--ui-border,#808a9a);
}

.custom-select__menu {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 7px);
  left: 0;
  width: max(100%, min(320px, calc(100vw - 32px)));
  max-width: min(720px, calc(100vw - 32px));
  padding: 7px;
  border: 1px solid var(--ui-border,#b7c2d1);
  border-radius: 11px;
  background: var(--ui-surface,#fff);
  box-shadow: 0 18px 45px rgba(24, 34, 56, .18), 0 4px 12px rgba(24, 34, 56, .08);
}

.custom-select.align-right .custom-select__menu {
  right: 0;
  left: auto;
}

.custom-select__menu[hidden] {
  display: none;
}

.custom-select.is-open {
  z-index: 200;
}

.custom-select__search {
  display: block;
  padding: 2px 2px 7px;
}

.custom-select__search input {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px 8px 36px;
  border-color: var(--ui-border,#c3ccd9);
  border-radius: 7px;
  background-color: var(--ui-info-soft,#f8fafd);
  background-image:
    linear-gradient(45deg, transparent 48%, var(--muted) 49%, var(--muted) 54%, transparent 55%),
    radial-gradient(circle, transparent 44%, var(--muted) 46%, var(--muted) 55%, transparent 57%);
  background-position: 19px 20px, 13px 13px;
  background-repeat: no-repeat;
  background-size: 8px 8px, 12px 12px;
}

.custom-select__list {
  display: grid;
  max-height: min(310px, 48vh);
  gap: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #b6c1d0 transparent;
  scrollbar-width: thin;
}

.custom-select__list.is-empty::after {
  padding: 17px 12px;
  color: var(--muted);
  content: "Ничего не найдено";
  font-size: 13px;
  text-align: center;
}

.custom-select__option,
button.custom-select__option {
  display: flex;
  width: 100%;
  min-height: 39px;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 9px 36px 9px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  cursor: pointer;
}

.custom-select__option:hover:not(:disabled),
.custom-select__option:focus-visible {
  background: var(--ui-info-soft,#f0f4f9);
  color: var(--accent);
  outline: 0;
}

.custom-select__option.is-selected {
  position: relative;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 750;
}

.custom-select__option.is-selected::after {
  position: absolute;
  right: 13px;
  color: var(--accent);
  content: "✓";
  font-size: 15px;
  font-weight: 800;
}

.custom-select__option.is-placeholder {
  color: var(--muted);
}

.custom-select__option:disabled {
  color: var(--ui-muted,#929aa7);
  cursor: not-allowed;
  opacity: .68;
}

@media (max-width: 600px) {
  .custom-select__trigger,
  button.custom-select__trigger {
    min-height: 48px;
    font-size: 16px;
  }

  .custom-select__chevron {
    min-height: 46px;
  }

  .custom-select__menu {
    width: max(100%, min(300px, calc(100vw - 24px)));
    max-width: calc(100vw - 24px);
  }

  .custom-select__option,
  button.custom-select__option {
    min-height: 44px;
    font-size: 15px;
  }
}

/* css/mobile.css */
html{overflow-x:clip}body{min-width:0;overflow-wrap:break-word}img,svg,video,canvas{max-width:100%;height:auto}pre,code{max-width:100%}table{max-width:100%}.mobile-nav-toggle{display:none!important}

/* Compact navigation must activate before a tablet-width header wraps. */
@media(max-width:1100px){.mobile-nav-toggle{display:inline-flex!important}}

@media(max-width:760px){
  .mobile-nav-toggle{display:inline-flex!important}
  :root{--control-height:48px}
  main{min-width:0;width:100%;padding:24px max(14px,env(safe-area-inset-right)) max(38px,calc(24px + env(safe-area-inset-bottom))) max(14px,env(safe-area-inset-left));overflow:visible}
  h1{font-size:clamp(31px,9vw,40px);line-height:1.08;margin-bottom:20px}
  h1,h2,h3{overflow-wrap:break-word}
  input:not([type=checkbox]):not([type=radio]),select,textarea{max-width:100%;font-size:16px}
  .messages{margin:0 0 18px}.message{padding:12px 14px}
  .hero{margin-bottom:28px}.welcome{min-height:0}.welcome-copy>p:not(.eyebrow){font-size:17px}.welcome-actions{display:grid;grid-template-columns:1fr;margin-top:24px}.welcome-actions>*{width:100%;text-align:center}.welcome-panel{padding:21px}.welcome-panel strong{font-size:34px}.feature-grid article{padding:21px}
  .auth-card{width:100%;margin:0;padding:22px 17px}.auth-card h1{font-size:34px}.auth-form p{margin:15px 0}
  .profile-summary{padding:22px}.profile-avatar{width:64px;height:64px}.profile-content>h2{font-size:32px}.profile-form,.security-card{padding:18px}
  .problem-detail{width:100%;padding:20px 16px;border-radius:10px}.problem-detail h1{font-size:27px}.problem-detail section{margin:24px 0}.reveal{padding:8px 15px}.reveal>summary,.problem-report-box>summary,.draft-sidebar details>summary,.group-settings-panel>summary,.vector-meta-form details>summary,.vector-canvas-settings>summary{display:flex;min-height:44px;align-items:center}.problem-meta{align-items:flex-start}.catalog-add-form button{width:100%;margin-top:12px}
  .search{display:grid;grid-template-columns:1fr}.search button{width:100%}
  .catalog-mobile-filter-toggle{position:sticky;top:calc(57px + env(safe-area-inset-top));z-index:9;min-height:48px;box-shadow:0 6px 18px rgba(24,34,56,.13)}.catalog-sidebar>.subject-group>summary{display:flex;min-height:44px;align-items:center}
  .pagination{display:grid;grid-template-columns:1fr auto 1fr;gap:8px}.pagination a:last-child{text-align:right}.pagination span{text-align:center}
  .empty,.tests-empty,.lesson-empty,.groups-empty{padding:25px 17px}
  :is(.groups-heading,.lessons-heading,.tests-heading,.draft-heading,.generated-test-title-row,.group-detail-heading,.report-admin-heading,.report-detail-heading):not(.page-heading){align-items:stretch!important;flex-direction:column!important;gap:16px!important}
  .groups-heading>.primary-link,.lesson-heading-actions,.tests-heading>.test-card-actions,.group-heading-actions{width:100%}.groups-heading>.primary-link{text-align:center}
  .group-card-grid,.test-library-grid,.lesson-grid{grid-template-columns:1fr!important}.group-card,.test-library-card{padding:18px}.group-card-top,.test-library-card-heading{gap:9px;flex-direction:column;align-items:flex-start}.group-card-actions{width:100%}.group-card-actions a{flex:1;text-align:center}
  .lesson-dashboard{grid-template-columns:1fr 1fr!important}.lesson-dashboard .lesson-nearest{grid-column:1/-1}.lesson-toolbar{align-items:stretch;flex-direction:column}.lesson-group-filter{display:grid!important;grid-template-columns:1fr!important}.lesson-group-filter button{width:100%}.lesson-periods{display:grid!important;grid-template-columns:repeat(3,1fr);width:100%}.lesson-periods a{text-align:center}.lesson-card{grid-template-columns:76px minmax(0,1fr)!important}.lesson-card-body{padding:16px!important}.lesson-card-footer{align-items:stretch!important}.lesson-card-actions{display:grid!important;grid-template-columns:1fr 1fr}.lesson-card-actions a{text-align:center}
  .lesson-facts{grid-template-columns:1fr!important}.lesson-content-card{padding:18px!important}.lesson-confirmations li{align-items:flex-start}.lesson-confirmations li b{text-align:right}.lesson-test-attachment{align-items:stretch!important;flex-direction:column!important}.lesson-test-attachment a{text-align:center}
  .group-members-grid,.group-bulk-grid{grid-template-columns:1fr!important}.group-composition-form,.group-management,.group-invitations{min-width:0}.group-member-card,.group-bulk-card,.group-settings-panel{padding:17px!important}.group-composition-actions{align-items:stretch!important;flex-direction:column!important}.group-composition-actions button{width:100%}.invitation-list article{align-items:stretch!important;flex-direction:column!important}.invitation-link{display:grid!important;grid-template-columns:minmax(0,1fr)!important}.invitation-link button{width:100%}
  .test-library-card .test-card-actions,.generated-test-title-row .test-card-actions{display:grid!important;grid-template-columns:1fr;width:100%}.test-library-card .test-card-actions a,.test-library-card .test-card-actions form,.test-library-card .test-card-actions button,.generated-test-title-row .test-card-actions>*{width:100%;min-height:44px;text-align:center}.test-card-meta{align-items:flex-start;flex-direction:column}.test-problem-row{grid-template-columns:1fr!important}.draft-settings{grid-template-columns:1fr!important;padding:16px}.draft-item{grid-template-columns:1fr!important}.draft-position{flex-direction:row!important;border-right:0!important;border-bottom:1px solid var(--line)}.draft-position button{width:44px!important;height:44px!important}
  .analytics-summary{grid-template-columns:1fr 1fr!important}.analytics-filter{grid-template-columns:1fr!important}.analytics-table-wrap{margin-right:-14px;padding-right:14px;overflow-x:auto;-webkit-overflow-scrolling:touch}.analytics-table-wrap table{min-width:620px}
  .report-tabs{display:grid!important;width:100%;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible!important}.report-tabs a{display:flex;min-width:0;min-height:44px;align-items:center;justify-content:center;white-space:normal;text-align:center}.report-message,.report-correction{padding:18px}.report-message pre,.report-correction pre,.format-help pre{font-size:12px}
  .upload-card{padding:18px}.drop-zone{min-height:170px;padding:18px}.import-history-card,.subject-card{padding:18px!important}
  .test-workflow-grid{gap:12px!important;margin-bottom:32px!important}.test-workflow-card,.test-workflow-card.compact{min-height:0!important;padding:20px!important}.test-workflow-card>a{width:100%;margin-top:18px!important;text-align:center}
  .test-form-actions{padding-bottom:max(14px,env(safe-area-inset-bottom))}
  .back{margin-bottom:18px}
}
@media(max-width:760px) {
  .lesson-detail-page details > summary,
  .award-paper > summary,
  .sp-problem details > summary,
  .sp-report > summary,
  .sp-reveal > summary,
  .problem-report-box > summary { min-height:44px; padding-top:10px; padding-bottom:10px; }
}

@media(max-width:390px){
  main{padding-right:max(11px,env(safe-area-inset-right));padding-left:max(11px,env(safe-area-inset-left))}
  .draft-heading h1,.tests-heading h1,.generated-test-heading h1,.test-create-page h1,.author-problem-heading h1,.catalog-hero h1{font-size:32px}
  .report-message,.report-correction{padding:14px}
  .lesson-dashboard,.analytics-summary{grid-template-columns:1fr!important}.lesson-dashboard .lesson-nearest{grid-column:auto}
  .pagination{grid-template-columns:1fr 1fr}.pagination span{grid-column:1/-1;grid-row:1}.problem-thumbnail{width:70px!important;flex-basis:70px!important}
}

/* css/site-page-theme.css */
@font-face{font-family:SiteLiterata;src:url('../fonts/literata/Literata-Regular.ttf') format('truetype');font-style:normal;font-weight:400;font-display:swap}
@font-face{font-family:SiteLiterata;src:url('../fonts/literata/Literata-Bold.ttf') format('truetype');font-style:normal;font-weight:700 900;font-display:swap}
.site-page-notice{margin:0 0 22px;padding:15px 18px;border:1px solid var(--line);border-left:4px solid var(--accent);border-radius:10px;background:var(--accent-soft);color:var(--ink);overflow-wrap:anywhere}

