@font-face {
  font-family: Archivo;
  src: url('/archivo-latin-wght-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Archivo;
  src: url('/archivo-latin-ext-wght-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-024F, U+1E00-1EFF;
}
:root {
  font-family: Archivo, Arial, sans-serif;
  color: #242032;
  background: #f7f5fa;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid #f58220; outline-offset: 3px; }
[hidden] { display: none !important; }
.site-header {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.25rem clamp(1rem, 3vw, 3rem);
  background: #fff1e6; border-bottom: 1px solid #efc9a7;
}
.header-brand { display: flex; align-items: center; gap: clamp(.8rem, 2vw, 1.6rem); min-width: 0; }
.brand-logo { display: block; width: clamp(100px, 12vw, 165px); max-height: 65px; object-fit: contain; flex: none; }
.eyebrow { margin: 0 0 .2rem; color: #89501d; font-size: .8rem; font-weight: 700; }
h1 { margin: 0; color: #35251b; font-size: clamp(1.4rem, 2.5vw, 2rem); line-height: 1.16; }
h2, h3 { line-height: 1.25; }
.layout { display: grid; grid-template-columns: minmax(280px, 350px) minmax(0, 1fr); min-height: calc(100vh - 100px); }
.sidebar { padding: 1.25rem; background: #fff1e6; border-right: 1px solid #efc9a7; min-width: 0; }
.filters { display: grid; gap: .65rem; }
.filters h2 { margin: 0; font-size: 1.1rem; color: #653911; }
.filters label, .zoom-label { display: grid; gap: .25rem; font-size: .85rem; font-weight: 700; }
.filters .graphic-filter { display: flex; align-items: flex-start; gap: .5rem; line-height: 1.35; cursor: pointer; }
.graphic-filter input { width: 1rem; height: 1rem; margin: .1rem 0 0; flex: none; accent-color: #6f499d; }
select {
  width: 100%; min-height: 2.4rem; padding: .35rem .65rem;
  border: 1px solid #a69bb7; border-radius: .5rem; color: #242032; background: #fff;
}
.text-button { justify-self: start; border: 0; background: none; color: #7b420d; font-weight: 700; padding: .4rem 0; text-decoration: underline; }
.empty-results { color: #5d526d; }
.content { min-width: 0; padding: clamp(1rem, 2.4vw, 2.2rem); }
.loading { color: #5d526d; }
.content-toolbar { max-width: 1080px; margin: 0 auto 1.2rem; display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.section-label { margin: 0; color: #6f499d; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.content-toolbar h2 { margin: .15rem 0; color: #352151; font-size: clamp(1.3rem, 2vw, 1.7rem); }
.content-toolbar output { color: #5d526d; font-size: .85rem; }
.task-list { --task-scale: 1; display: grid; gap: 1.3rem; max-width: 1080px; margin: 0 auto; }
.task-card { min-width: 0; }
.task-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.task-meta span { padding: .23rem .55rem; border-radius: 999px; background: #e8e0f0; color: #4e3272; font-size: .78rem; font-weight: 700; }
.task-meta .difficulty { background: #f8e2cb; color: #58330f; }
.zoom-label { min-width: 130px; }
.task-body {
  background: #fff; border: 1px solid #e5e0ed; border-radius: 1rem;
  margin-top: .5rem; padding: clamp(1.2rem, 3vw, 2.1rem); box-shadow: 0 6px 24px #3621480a;
  font-size: calc(1.08rem * var(--task-scale));
}
.task-title { margin: 0 0 .9rem; color: #352151; font-size: 1.35em; }
.statement-box { padding: clamp(.9rem, 2vw, 1.4rem); border: 1px solid #d9c8e9; border-radius: .75rem; background: #f2edf8; }
.blocks { display: grid; gap: .8em; }
.blocks p { margin: 0; }
.blocks .math-block { overflow: auto; padding: .35rem 0; }
.blocks figure { margin: .5em 0; max-width: 780px; }
.blocks figure img { display: block; max-width: 100%; max-height: 50vh; border: 1px solid #e6e0ee; border-radius: .6rem; background: #fff; }
.blocks figcaption { color: #5d526d; font-size: .8em; margin-top: .3rem; }
.blocks .table-wrap { max-width: 100%; overflow-x: auto; }
.blocks table { border-collapse: collapse; min-width: 240px; }
.blocks th, .blocks td { border: 1px solid #a69bb7; padding: .35em .7em; text-align: left; }
.blocks th { background: #f2edf8; }
.primary-button, .secondary-button { border-radius: .6rem; padding: .65rem 1rem; font-weight: 700; }
.primary-button { background: #6f499d; color: #fff; border: 2px solid #6f499d; margin-top: 1.6rem; }
.primary-button:hover { background: #5c387f; }
.secondary-button { background: #fff; color: #573583; border: 1px solid #9786ba; }
.secondary-button:hover:not(:disabled) { background: #f2edf8; }
.solution { margin-top: 1.2rem; padding: 1.2rem; border-left: 5px solid #f58220; background: #fff9f1; border-radius: .4rem; }
.solution h4 { margin: 0 0 .8rem; color: #3e2860; font-size: 1.08em; }
.answer { margin: 1rem 0 0; padding: .6rem .8rem; border-radius: .4rem; background: #f8e2cb; }
.task-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.solved-button {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: .35rem .6rem;
  min-height: 2.7rem; border: 2px solid #9a713d; border-radius: .6rem;
  background: #fffaf3; color: #5c381a; padding: .5rem .75rem; font-weight: 700;
}
.solved-button:hover:not(:disabled) { background: #fff1df; }
.solved-button.is-solved { background: #e5f4e8; border-color: #21784b; color: #145333; }
.solved-button.is-solved:hover:not(:disabled) { background: #d4ead9; }
.solved-label { overflow-wrap: anywhere; }
.solved-icon { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border: 2px solid currentColor; border-radius: 50%; line-height: 1; font-size: .85rem; }
.solved-state { border-left: 1px solid currentColor; padding-left: .6rem; font-size: .85rem; }
.feedback-button { margin-left: auto; }
.task-action-status { margin: .35rem 0 0; color: #5c381a; font-size: .83rem; }
.task-action-status:empty { display: none; }
.feedback-dialog { width: min(92vw, 560px); max-height: min(90vh, 800px); border: 1px solid #d7c6e8; border-radius: 1rem; padding: clamp(1.1rem, 3vw, 1.8rem); box-shadow: 0 18px 60px #20142e55; color: #242032; }
.feedback-dialog::backdrop { background: #1c1423a8; }
.feedback-dialog form { display: grid; gap: .65rem; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.dialog-heading h2 { margin: 0; color: #352151; font-size: 1.4rem; }
.dialog-close { background: transparent; border: 0; color: #573583; font-size: 1.7rem; line-height: 1; padding: .1rem .3rem; }
#feedback-description { margin: 0 0 .5rem; color: #5d526d; }
.feedback-dialog label { font-weight: 700; }
.feedback-dialog textarea { width: 100%; resize: vertical; border: 1px solid #9786ba; border-radius: .6rem; padding: .65rem; color: #242032; background: #fff; }
.field-hint { margin: 0; font-size: .8rem; color: #5d526d; }
.form-error { margin: 0; color: #a02727; font-weight: 700; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: .65rem; margin-top: .5rem; }
.dialog-actions .primary-button { margin-top: 0; }
body.lesson .sidebar { display: none; }
body.lesson .layout { grid-template-columns: minmax(0, 1fr); }
body.lesson .site-header { padding-block: .7rem; }
body.lesson .content { padding-top: 1rem; }
body.lesson .task-list, body.lesson .content-toolbar { max-width: 1160px; }
@media (max-width: 780px) {
  .site-header { align-items: start; flex-direction: column; }
  .header-brand { align-items: start; flex-direction: column; gap: .5rem; }
  .brand-logo { width: 120px; }
  .layout { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid #efc9a7; }
  .content-toolbar { align-items: start; flex-wrap: wrap; }
}
.mode-banner, .ebook-navigation {
  margin: 0;
  padding: 0.7rem 1.5rem;
  background: #fff1e6;
  color: #24212a;
}
.ebook-navigation a { color: #5b2d90; font-weight: 700; }
