:root {
  color-scheme: light;
  --navy: #001d4d;
  --blue: #2e5dac;
  --blue-dark: #1c488f;
  --ink: #202024;
  --muted: #596b8c;
  --line: #dfe3e9;
  --line-dark: #ccd3dd;
  --soft: #f4f6f8;
  --pale-blue: #edf3fb;
  --white: #fff;
  /* Role-based aliases. They resolve to the colour tokens above in light mode,
     so light mode is unchanged; the dark theme (end of file) overrides them.
     --heading: text that is navy in light mode (titles, strong copy)
     --surface: panel/card/input backgrounds that are white in light mode
     --link:    link / accent text that is blue in light mode */
  --heading: var(--navy);
  --surface: var(--white);
  --link: var(--blue);
  --link-dark: var(--blue-dark);
  --container: 1180px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-reading: "Aptos", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

main {
  flex: 1 0 auto;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-dark);
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header,
.site-footer,
.brand,
.main-nav,
.auth-widget,
.auth-page-card__brand,
.auth-google-button,
.subject-card,
.subject-card__status,
.subject-card__action,
.download-icon-link,
.start-link,
.primary-button,
.secondary-button,
.link-button,
.practice-exam-row__actions,
.solver-header__toolbar,
.solver-header__identity,
.solver-header__downloads,
.solver-summary,
.solver-sticky-footer,
.task-navigation,
.question-quickselect,
.physics-quickselect,
.audio-track-button,
.audio-player__rate,
.croatian-completion-popover__heading button {
  -webkit-user-select: none;
  user-select: none;
}

.brand__mark,
.footer-brand__mark,
.subject-symbol,
.solver-header__subject-symbol,
.solver-sticky-footer__status-icon,
.download-icon-link svg,
.footer-github svg,
.topbar svg {
  -webkit-user-drag: none;
}

.container {
  width: min(calc(100% - 40px), var(--container));
  margin: 0 auto;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--heading);
  background: var(--surface);
  border: 2px solid var(--navy);
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.site-header {
  color: var(--white);
  background: var(--navy);
}

.topbar {
  color: #d1dbee;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.topbar__inner,
.masthead,
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar__inner {
  min-height: 34px;
  gap: 24px;
}

.topbar__label,
.topbar__inner > span {
  min-width: 0;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--white);
}

.topbar svg,
.source-note svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.topbar__theme-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #d1dbee;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.topbar__theme-toggle:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.topbar__theme-toggle:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.topbar__theme-toggle svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

/* Show the icon for the action the tap performs: moon while light (tap -> dark),
   sun while dark (tap -> light). analytics.js sets data-theme before first paint,
   so the correct icon shows without a flash. */
.topbar__theme-toggle .topbar__theme-icon--sun {
  display: none;
}

html[data-theme="dark"] .topbar__theme-toggle .topbar__theme-icon--moon {
  display: none;
}

html[data-theme="dark"] .topbar__theme-toggle .topbar__theme-icon--sun {
  display: block;
}

.site-notice[hidden] {
  display: none;
}

.site-notice {
  color: #13213c;
  background: #f2c75c;
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);
}

.site-notice--announcement {
  color: #0b2c52;
  background: #bfe0fb;
  border-bottom-color: rgba(11, 44, 82, 0.16);
}

.site-notice__inner {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 0;
}

.site-notice__icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.site-notice__icon-svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.site-notice__message {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.masthead {
  gap: 28px;
  min-height: 72px;
}

.masthead__actions {
  align-self: stretch;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--white);
}

.brand:hover {
  color: var(--white);
  text-decoration: none;
}

.brand__mark,
.source-note__mark,
.footer-brand__mark {
  flex: 0 0 auto;
  object-fit: contain;
}

.brand__mark {
  width: 42px;
  height: 42px;
}

.brand strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: #ccd8ec;
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.main-nav {
  align-self: stretch;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.main-nav__link {
  display: flex;
  align-items: center;
  padding: 0 20px;
  color: #dbe5f3;
  border-bottom: 4px solid transparent;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.main-nav__link:hover {
  color: var(--white);
  text-decoration: none;
}

.profile-plus-logo {
  display: block;
  width: 140px;
  height: auto;
}

html[data-theme="dark"] .profile-plus-logo {
  filter: brightness(0) invert(1);
}

.main-nav__link--active {
  color: var(--white);
  border-bottom-color: var(--white);
}

.auth-widget {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.auth-widget__button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  color: var(--heading);
  background: var(--surface);
  border: 1px solid var(--white);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.topbar .auth-widget__button {
  color: var(--heading);
}

.auth-widget__button:hover {
  color: var(--heading);
  background: #e8eef8;
  text-decoration: none;
}

.auth-widget__status,
.auth-widget__user {
  display: inline-block;
  max-width: 210px;
  overflow: hidden;
  color: #dbe5f3;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-widget__user:hover {
  color: var(--white);
  text-decoration: underline;
}

.auth-widget__logout {
  padding: 0;
  color: #dbe5f3;
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 700;
}

.auth-widget__logout:hover {
  color: var(--white);
  text-decoration: underline;
}

.auth-page-card__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin-bottom: 14px;
}

.auth-page-card__logo {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.auth-page-card__intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-page-card__message {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line-dark);
  font-size: 13px;
}

.auth-page-card__message[data-tone="error"] {
  color: #8a2432;
  background: #fff1f3;
  border-color: #e8b3bd;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(34px, 7vw, 72px) 0;
  background: #edf4fc;
}

.auth-page__inner {
  display: grid;
  place-items: center;
}

.auth-page-card {
  width: min(100%, 460px);
  padding: 30px;
  background: var(--surface);
  border: 1px solid #c9d8ee;
  border-top: 4px solid var(--navy);
}

.auth-page-card h1 {
  margin: 2px 0 0;
  font-size: 30px;
  line-height: 1.08;
}

.auth-page-card__logo {
  width: 56px;
  height: 56px;
}

.auth-page-card__note {
  margin: 20px 0 0;
  padding-top: 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
}

.auth-page-card__user {
  overflow: hidden;
  margin: 16px 0 0;
  padding: 11px 12px;
  color: var(--heading);
  background: #f1f6fd;
  border: 1px solid #cddcf1;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-page-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.auth-page-card__google-action {
  margin-top: 18px;
}

.auth-google-button {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 12px;
  color: #1f1f1f;
  background: var(--surface);
  border: 1px solid #747775;
  border-radius: 4px;
  font-family: Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.auth-google-button:hover {
  color: #1f1f1f;
  background: #f8faff;
  border-color: #5f6368;
  text-decoration: none;
}

.auth-google-button__mark {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  background: var(--surface);
  object-fit: contain;
}

.profile-heading .lead {
  max-width: 760px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.profile-panel {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-top: 4px solid var(--navy);
}

.profile-plus-panel {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px 32px;
  padding-block: 16px;
}

.profile-plus-panel .profile-section-heading {
  margin: 0;
}

.profile-plus-panel .profile-muted {
  margin-top: 5px;
  font-size: 13px;
}

.profile-plus-panel [data-billing] {
  display: contents;
}

.profile-plus-panel [data-billing] [role="status"] {
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0;
  line-height: 1.4;
}

.profile-plus-panel [data-billing] [role="status"]::after {
  content: "×";
  display: none;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  margin-left: 9px;
  border: 1px solid #adb5bf;
  border-radius: 50%;
  background: #eef0f2;
  color: #596473;
  font-family: Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.profile-plus-panel[data-billing-active] [role="status"]::after {
  display: inline-flex;
}

.profile-plus-panel[data-billing-active="true"] [role="status"]::after {
  content: "✓";
  border-color: #9bc6a8;
  background: #e9f6ed;
  color: #23643c;
  font-size: 15px;
}

.profile-plus-panel .billing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 18px;
}

.profile-plus-panel .billing-history-link {
  margin: 0;
}

html[data-theme="dark"] .profile-plus-panel[data-billing-active="false"] [role="status"]::after {
  border-color: #69717c;
  background: #30363e;
  color: #c6cbd2;
}

html[data-theme="dark"] .profile-plus-panel[data-billing-active="true"] [role="status"]::after {
  border-color: #4b8a65;
  background: #1d3c2c;
  color: #a3e5b6;
}

@media (max-width: 900px) {
  .profile-plus-panel {
    display: block;
  }

  .profile-plus-panel .profile-section-heading,
  .profile-plus-panel [data-billing] [role="status"] {
    margin-bottom: 12px;
  }

  .profile-plus-panel [data-billing] {
    display: block;
  }

  .profile-plus-panel .billing-actions {
    justify-content: flex-start;
  }
}

.profile-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 22px;
  align-items: start;
}

.profile-summary h2,
.profile-section-heading h2 {
  margin: 2px 0 0;
  color: var(--heading);
  font-size: 26px;
  line-height: 1.1;
}

.profile-muted {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.profile-stats {
  display: grid;
  gap: 10px;
  margin: 0;
}

.profile-stats > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.profile-stats > div:first-child {
  padding-top: 0;
}

.profile-stats > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.profile-stats dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.profile-stats dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  text-align: right;
}

.profile-answered-statistic {
  position: relative;
}

.profile-answered-statistic__button {
  padding: 0 2px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 4px;
}

.profile-answered-statistic__button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.profile-answered-breakdown {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  min-width: 230px;
  max-width: min(340px, calc(100vw - 48px));
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line-dark);
  box-shadow: 0 8px 24px rgb(0 0 0 / 14%);
  text-align: left;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.profile-answered-statistic:hover .profile-answered-breakdown,
.profile-answered-statistic.is-open .profile-answered-breakdown,
.profile-answered-statistic__button:focus-visible + .profile-answered-breakdown {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.profile-answered-breakdown__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-answered-breakdown__list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 0;
  font-size: 13px;
  font-weight: 400;
}

.profile-answered-breakdown__subject {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.profile-answered-breakdown .subject-symbol {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.profile-answered-breakdown__empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.profile-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.profile-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

.profile-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
  font-size: 14px;
}

.profile-table th,
.profile-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.profile-table th {
  color: var(--heading);
  background: var(--soft);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-table tr:last-child td {
  border-bottom: 0;
}

.profile-table td strong,
.profile-table td small {
  display: block;
}

.profile-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.profile-percentage,
.subject-best-score {
  font-weight: 700;
}

.profile-percentage--excellent,
.subject-best-score--excellent {
  color: #0b5d2a;
}

.profile-percentage--good,
.subject-best-score--good {
  color: #3f7f1f;
}

.profile-percentage--medium,
.subject-best-score--medium {
  color: #8a6d00;
}

.profile-percentage--low,
.subject-best-score--low {
  color: #b45309;
}

.profile-percentage--poor,
.subject-best-score--poor {
  color: #8f1d1d;
}

.profile-table-more {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.profile-empty {
  padding: 20px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.profile-empty h3 {
  margin: 0;
  color: var(--heading);
  font-size: 18px;
}

.profile-empty p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.page-heading {
  padding: 30px 0 42px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.breadcrumbs,
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breadcrumbs span {
  padding: 0 6px;
  color: #9aa6b8;
}

.page-heading__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 80px;
  align-items: end;
  margin-top: 42px;
}

.home-heading .page-heading__grid {
  margin-top: 0;
}

.home-heading {
  padding: 16px 0 18px;
}

.is-app-subpage .home-heading {
  display: none;
}

.home-heading .page-heading__grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 40px;
  align-items: center;
}

.home-heading h1 {
  max-width: 520px;
  margin-bottom: 6px;
  font-size: 30px;
  line-height: 1.08;
}

.home-heading .lead {
  max-width: 620px;
  font-size: 14px;
  line-height: 1.45;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 14px;
  color: var(--heading);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.02;
}

h2 {
  margin-bottom: 0;
  color: var(--heading);
  font-size: 27px;
  letter-spacing: 0;
  line-height: 1.18;
}

.lead {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
}

.source-note {
  padding-left: 18px;
  border-left: 3px solid var(--blue);
  color: var(--muted);
  font-size: 14px;
}

.source-note__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.source-note__mark {
  width: 54px;
  height: 54px;
}

.source-note strong {
  color: var(--heading);
  line-height: 1.15;
}

.source-note p {
  margin: 5px 0 8px;
}

.source-note a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

.source-note__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: baseline;
  margin-top: 10px;
}

.source-note__contact span {
  color: var(--heading);
  font-weight: 700;
}

.source-note__contact-reveal {
  padding: 0;
  color: var(--link);
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 700;
}

.source-note__contact-reveal:hover {
  color: var(--link-dark);
  text-decoration: underline;
}

.source-note__contact-reveal:focus-visible,
.source-note__contact-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.home-heading .source-note {
  padding-left: 14px;
  border-left-width: 2px;
  font-size: 13px;
  line-height: 1.4;
}

.home-heading .source-note p {
  margin: 0 0 5px;
}

.home-heading .source-note__contact {
  margin-top: 6px;
}

.workspace-section {
  padding: 32px 0 72px;
}

body:not(.is-app-subpage) .workspace-section {
  padding-bottom: 0;
}

.home-suggestion {
  padding: 32px 0;
}

.is-app-subpage .home-suggestion {
  display: none;
}

.home-news {
  padding: 30px 0 14px;
  background: var(--surface);
}

.is-app-subpage .home-news {
  display: none;
}

.home-news__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.home-news__head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  color: var(--heading);
}

.home-news__head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.home-news__source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--link);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.home-news__source:hover {
  color: var(--link-dark);
}

.home-news__source svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-news__viewport {
  position: relative;
  margin-top: 18px;
}

.home-news__track {
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 8px 2px 20px;
  list-style: none;
  overflow-x: auto;
  /* Carousel se pomiče sam - skrivamo scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.home-news__track::-webkit-scrollbar {
  display: none;
}

.home-news__item {
  flex: 0 0 320px;
}

.home-news__item > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.home-news__item > a:hover {
  border-color: var(--blue);
  box-shadow: 0 10px 24px rgba(0, 29, 77, 0.12);
  transform: translateY(-2px);
}

.home-news__image {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--soft);
  overflow: hidden;
}

.home-news__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-news__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
}

.home-news__date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.home-news__title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--heading);
  font-size: 15.5px;
  line-height: 1.35;
  font-weight: 600;
}

.home-news__nav {
  position: absolute;
  top: 0;
  bottom: 18px;
  margin: auto 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: var(--surface);
  color: var(--heading);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 29, 77, 0.12);
  transition: background 0.15s ease, opacity 0.15s ease;
}

.home-news__nav:hover {
  background: var(--pale-blue);
}

.home-news__nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.home-news__nav svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-news__nav--prev {
  left: clamp(8px, 2vw, 24px);
}

.home-news__nav--next {
  right: clamp(8px, 2vw, 24px);
}

@media (max-width: 700px) {
  .home-news__item {
    flex-basis: 260px;
  }

  .home-news__nav {
    display: none;
  }
}

.home-information {
  padding: 32px 0 36px;
  background: var(--soft);
  border-top: 1px solid var(--line);
}

.is-app-subpage .home-information {
  display: none;
}

.home-information__intro {
  display: grid;
  gap: 5px;
}

.home-information__intro h2 {
  max-width: none;
  font-size: 24px;
  line-height: 1.15;
}

.home-information__intro p:last-child {
  max-width: none;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.home-information__topics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line-dark);
}

.home-information__topics article {
  padding-left: 12px;
  border-left: 2px solid var(--blue);
}

.home-information__topics h3 {
  margin: 0 0 5px;
  color: var(--heading);
  font-size: 15px;
  line-height: 1.25;
}

.home-information__topics p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.home-information__source {
  margin: 22px 0 0;
  padding-top: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.home-information__source strong {
  color: var(--heading);
}

.home-feedback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  text-align: center;
}

.home-feedback strong {
  display: block;
  color: var(--heading);
  font-size: 15px;
  line-height: 1.25;
}

.home-feedback p {
  max-width: 760px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.home-feedback .secondary-button {
  flex: 0 0 auto;
  gap: 7px;
}

.home-feedback .secondary-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.feedback-dialog[hidden] {
  display: none;
}

.feedback-dialog-open {
  overflow: hidden;
}

.feedback-dialog {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.feedback-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 29, 77, 0.48);
}

.feedback-dialog__panel {
  position: relative;
  width: min(100%, 560px);
  max-height: min(720px, calc(100dvh - 40px));
  overflow: auto;
  padding: 26px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  box-shadow: 0 18px 54px rgba(0, 29, 77, 0.28);
}

.feedback-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--heading);
  background: var(--soft);
  border: 1px solid var(--line-dark);
  font-size: 14px;
  font-weight: 800;
}

.feedback-dialog__close:hover {
  color: var(--link-dark);
  border-color: var(--blue-dark);
}

.feedback-dialog__form {
  display: grid;
  gap: 12px;
}

.feedback-dialog__form h2 {
  margin: 4px 38px 6px 0;
  color: var(--heading);
  font-size: 24px;
  line-height: 1.2;
}

.feedback-dialog__form p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.feedback-dialog__form label {
  color: var(--heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.feedback-dialog__form textarea,
.feedback-dialog__form input {
  width: 100%;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-radius: 0;
  font: inherit;
  font-size: 14px;
}

.feedback-dialog__form textarea {
  min-height: 150px;
  resize: vertical;
  padding: 10px;
  line-height: 1.5;
}

.feedback-dialog__form input {
  height: 40px;
  padding: 8px 10px;
}

.feedback-dialog__form textarea:focus,
.feedback-dialog__form input:focus {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: 2px;
}

.feedback-dialog__website {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.feedback-dialog__status {
  min-height: 22px;
  color: var(--muted);
}

.feedback-dialog__status[data-state="success"] {
  color: #1c6138;
  font-weight: 700;
}

.feedback-dialog__status[data-state="error"] {
  color: #9f2430;
  font-weight: 700;
}

.feedback-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.home-workspace {
  display: grid;
  gap: 22px;
}

.home-toolbar,
.subject-title-row,
.practice-detail__heading,
.exam-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-toolbar {
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-dark);
}

.home-toolbar .eyebrow {
  margin-bottom: 6px;
}

.subject-group {
  display: grid;
  gap: 12px;
}

.subject-group + .subject-group {
  margin-top: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.subject-group__heading h3 {
  margin: 0;
  color: var(--heading);
  font-size: 18px;
  line-height: 1.2;
}

.subject-group__note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
}

.subject-grid--mandatory {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#subject-list {
  container-type: inline-size;
}

.subject-grid--admission {
  display: flex;
  justify-content: center;
}

.subject-grid--admission .subject-card {
  width: 100%;
}

/* Match the 340px minimum columns and 12px gaps of the subject grid. */
@container (min-width: 692px) {
  .subject-grid--admission .subject-card {
    width: calc((100% - 12px) / 2);
  }
}

@container (min-width: 1044px) {
  .subject-grid--admission .subject-card {
    width: calc((100% - 24px) / 3);
  }
}

.subject-card {
  position: relative;
  display: grid;
  min-height: 86px;
  grid-template-columns: 30px minmax(0, 1fr) 36px;
  gap: 12px;
  align-items: center;
  padding: 14px 14px 14px 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-left: 4px solid var(--subject-color, var(--navy));
  box-shadow: 0 1px 2px rgba(0, 29, 77, 0.06);
  isolation: isolate;
  overflow: hidden;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.subject-card::before {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: -1;
  width: 68%;
  background-image: var(--subject-image, none);
  background-position: center;
  background-size: cover;
  content: "";
  opacity: 0.18;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 72%);
  mask-image: linear-gradient(to right, transparent 0%, #000 72%);
  transition: opacity 160ms ease;
}

.subject-card:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--subject-color, var(--navy)) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--subject-color, var(--navy)) 52%, var(--line-dark));
  box-shadow: 0 6px 14px rgba(0, 29, 77, 0.1);
  text-decoration: none;
  transform: translateY(-1px);
}

.subject-card:hover::before {
  opacity: 0.25;
}

.subject-card--unavailable {
  color: #657082;
  background: #f6f7f9;
  border-color: #d5dae2;
  border-left-color: #a7b0bd;
  box-shadow: none;
  cursor: default;
}

.subject-card--unavailable::before {
  filter: grayscale(1);
  opacity: 0.08;
}

.subject-card--unavailable:hover {
  color: #657082;
  background: #f6f7f9;
  border-color: #d5dae2;
  border-left-color: #a7b0bd;
  box-shadow: none;
  transform: none;
}

.subject-card--unavailable:hover::before {
  opacity: 0.08;
}

.subject-card .subject-symbol,
.practice-detail__heading .subject-symbol {
  width: 26px;
  height: 26px;
  background: transparent;
}

.subject-card .subject-symbol {
  color: var(--subject-color, var(--navy));
}

.subject-card--unavailable .subject-symbol {
  color: #7d8794;
}

.subject-card__body {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.subject-card__body strong {
  color: var(--heading);
  font-size: 16px;
  line-height: 1.18;
}

.subject-card--unavailable .subject-card__body strong {
  color: #525c6d;
}

.subject-card__status {
  display: block;
  color: #1f7a3a;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.subject-card__views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.subject-card__views[hidden] {
  display: none;
}

.subject-card__views-icon {
  width: 13px;
  height: 13px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.subject-card__status--unavailable {
  color: #6f7784;
}

.subject-card__action {
  display: grid;
  width: 34px;
  height: 34px;
  justify-self: end;
  place-items: center;
  color: var(--white);
  background: var(--subject-color, var(--blue));
  border: 1px solid var(--subject-color, var(--blue));
}

.subject-card:hover .subject-card__action {
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
}

.subject-card--unavailable .subject-card__action,
.subject-card--unavailable:hover .subject-card__action {
  color: #707987;
  background: #eef1f4;
  border-color: #cbd2dc;
}

.subject-card__action-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.subject-card .progress-meter {
  height: 7px;
}

.subject-grid__empty {
  grid-column: 1 / -1;
}

.progress-meter {
  height: 8px;
  overflow: hidden;
  background: #e8edf4;
  border: 1px solid #d3dbe6;
}

.progress-meter span {
  display: block;
  height: 100%;
  background: var(--subject-color, var(--blue));
}

.subject-page__intro {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 42px;
  align-items: end;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-dark);
}

.subject-page__intro--with-catalog {
  grid-template-columns: 270px minmax(0, 1fr) auto;
}

.subject-page__intro .back-link {
  margin-bottom: 0;
}

.subject-catalog-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: center;
  padding: 8px 13px;
  color: var(--link);
  background: var(--surface);
  border: 1px solid var(--blue);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.subject-catalog-link:hover {
  color: var(--white);
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  text-decoration: none;
}

.subject-catalog-link svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  flex: 0 0 auto;
}

.subject-catalog-link__label--short {
  display: none;
}

.subject-page__intro .subject-title-row {
  min-width: 0;
  justify-content: center;
}

.subject-page__intro .subject-symbol {
  width: 68px;
  height: 30px;
  background: transparent;
}

.subject-page__intro .subject-symbol__icon {
  width: 26px;
  height: 26px;
}

.subject-title-row {
  justify-content: flex-start;
  gap: 10px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--link);
  font-size: 13px;
  font-weight: 700;
}

.back-link__icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.back-link__icon--mobile {
  display: none;
}

.practice-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 42px;
  align-items: start;
}

.practice-filters {
  top: 20px;
}

.practice-filters .grade-thresholds {
  flex-shrink: 0;
}

.subject-results {
  min-width: 0;
}

.subject-page.medicine-admission .subject-page__intro {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  margin-bottom: 28px;
}

.medicine-admission .subject-page__intro .back-link {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.medicine-admission .subject-page__intro .subject-title-row {
  justify-content: center;
}

.medicine-admission__content {
  width: min(100%, 1100px);
  margin-inline: auto;
}

.medicine-admission__notice {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 12px;
}

.medicine-admission__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 28px;
  align-items: start;
}

.medicine-admission__choices {
  min-width: 0;
}

.medicine-admission__guide {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-top: 4px solid var(--subject-color, var(--navy));
  font-size: 12px;
  line-height: 1.55;
}

.medicine-admission__guide h3,
.medicine-admission__guide h4 {
  margin: 0 0 9px;
  color: var(--heading);
  font-size: 15px;
}

.medicine-admission__guide h4 {
  margin-top: 18px;
}

.medicine-admission__guide p {
  margin: 0 0 10px;
  color: var(--muted);
}

.medicine-admission__guide p:last-child {
  margin-bottom: 0;
}

.medicine-admission__guide strong {
  color: var(--heading);
}

.medicine-admission__materials + .medicine-admission__materials {
  margin-top: 42px;
}

.medicine-admission__section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px 32px;
}

.medicine-admission__section-heading .eyebrow {
  margin: 0 0 4px;
}

.medicine-admission__section-heading h3 {
  margin: 0;
  color: var(--heading);
  font-size: 22px;
}

.medicine-admission__section-heading > p {
  max-width: 490px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.medicine-admission .practice-exam-selection {
  margin-top: 14px;
}

.medicine-admission .practice-exam-row {
  grid-template-columns: minmax(180px, 1fr) 140px auto;
}

.medicine-admission .practice-exam-row--collection {
  grid-template-columns: minmax(180px, 1fr) auto;
}

@media (max-width: 1000px) {
  .medicine-admission__layout {
    grid-template-columns: 1fr;
  }
}

.subject-exam-table-wrap {
  border-top: 0;
}

.subject-exam-table {
  min-width: 720px;
}

.subject-exam-table__col-term {
  width: 28%;
}

.subject-exam-table__col-progress {
  width: 180px;
}

.subject-exam-table__col-best {
  width: 130px;
}

.subject-exam-table__col-actions {
  width: 150px;
}

.subject-exam-table td:first-child small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.subject-exam-table__exam-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.subject-exam-table__plus-label {
  display: inline-grid;
  flex: 0 0 auto;
  width: 30px;
  height: 24px;
  margin: 0;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, #3074ba, #1d5599);
  border: 1px solid #8ab8e8;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%);
}

.subject-exam-table__plus-label svg {
  display: block;
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
}

/* The row anchors the veil across progress, results, and materials. */
.subject-exam-table tr[data-unavailable] {
  position: relative;
}

.subject-exam-table tr[data-unavailable] .exam-progress,
.subject-exam-table tr[data-unavailable] .subject-best-scores,
.subject-exam-table tr[data-unavailable] .exam-actions .primary-button {
  filter: grayscale(1);
}

.subject-exam-table__unavailable-label {
  position: absolute;
  z-index: 1;
  inset: 0 0 0 28%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555e6c;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
}

.subject-exam-table__unavailable-label::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  background:
    radial-gradient(ellipse at 32% 10%, rgb(243 245 248 / 85%), transparent 65%),
    radial-gradient(ellipse at 65% 90%, rgb(237 240 244 / 90%), transparent 75%),
    rgb(243 245 248 / 48%);
  -webkit-mask-image: linear-gradient(to right, transparent, #0000000a 3%, #00000040 8%, #000000ad 17%, #000000ed 29%, #000 42%);
  mask-image: linear-gradient(to right, transparent, #0000000a 3%, #00000040 8%, #000000ad 17%, #000000ed 29%, #000 42%);
}

@media (max-width: 860px) {
  .subject-exam-table__unavailable-label {
    inset: 42px 0 0;
  }
}

.subject-exam-table__progress-cell {
  min-width: 160px;
}

.subject-exam-table th:nth-last-child(2),
.subject-exam-table__best-cell {
  color: var(--muted);
  text-align: center;
}

.subject-best-scores {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.subject-best-scores__separator {
  color: #8a93a3;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.exam-progress {
  min-width: 0;
}

.exam-progress__meter-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: max-content;
}

.exam-progress .progress-meter {
  flex: 0 0 120px;
  width: 120px;
  min-width: 0;
}

.exam-progress__percent {
  order: -1;
  flex: 0 0 38px;
  color: var(--heading);
  font-size: 13px;
  line-height: 1;
  text-align: left;
}

.subject-best-score {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  background: var(--surface);
  border: 2px solid currentColor;
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.78),
    0 0 0 3px rgba(0, 29, 77, 0.05);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.subject-best-score--excellent {
  background: #edf8f0;
}

.subject-best-score--good {
  background: #f1f8e8;
}

.subject-best-score--medium {
  background: #fff8db;
}

.subject-best-score--low {
  background: #fff0df;
}

.subject-best-score--poor {
  background: #fff0f0;
}

.subject-best-score--empty {
  color: #8a93a3;
  background: #f8fafc;
  font-weight: 700;
}

.exam-actions {
  justify-content: flex-end;
  gap: 8px;
}

.exam-actions .primary-button {
  min-height: 34px;
  padding: 7px 12px;
}

.download-icon-link {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--link);
  background: var(--surface);
  border: 1px solid var(--blue);
}

.download-icon-link:hover {
  color: var(--white);
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  text-decoration: none;
}

.download-icon-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.practice-detail {
  max-width: 980px;
}

.practice-detail__heading {
  justify-content: flex-start;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-dark);
}

.practice-detail__heading h2 {
  margin: 0;
  font-size: 32px;
}

.practice-detail__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.practice-detail__title-row p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.practice-detail__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.exam-selection-dialog {
  width: min(980px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-top: 4px solid var(--subject-color, var(--navy));
  box-shadow: 0 18px 60px rgba(0, 20, 52, 0.3);
}

.exam-selection-dialog::backdrop {
  background: rgba(0, 20, 52, 0.68);
}

.exam-selection-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--line-dark);
}

.exam-selection-dialog__header .eyebrow {
  margin: 0 0 5px;
}

.exam-selection-dialog__header h2 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.2;
}

.exam-selection-dialog__header p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.exam-selection-dialog__close {
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--heading);
  background: var(--soft);
  border: 1px solid var(--line-dark);
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.exam-selection-dialog__close:hover {
  background: var(--pale-blue);
}

.exam-selection-dialog__body {
  padding: 0 24px 24px;
}

.exam-selection-dialog .practice-exam-selection {
  margin-top: 20px;
}

@media (max-width: 560px) {
  .exam-selection-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }

  .exam-selection-dialog__header {
    padding: 16px;
  }

  .exam-selection-dialog__body {
    padding: 0 16px 16px;
  }
}

.grade-thresholds {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-top: 4px solid var(--subject-color, var(--navy));
}

.grade-thresholds__heading {
  padding: 11px 12px 9px;
  border-bottom: 1px solid var(--line);
}

.grade-thresholds__heading h3 {
  margin: 0;
  color: var(--heading);
  font-size: 16px;
  line-height: 1.2;
}

.grade-thresholds__heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.grade-thresholds__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.grade-thresholds__table th,
.grade-thresholds__table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.grade-thresholds__table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.grade-thresholds__table td:last-child {
  color: var(--heading);
  font-weight: 700;
  white-space: nowrap;
}

.grade-thresholds__table tr:last-child td {
  border-bottom: 0;
}

.grade-thresholds__table td strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  color: var(--white);
  background: var(--navy);
  font-size: 11px;
}

.grade-thresholds__table td span {
  color: var(--muted);
}

.grade-thresholds__note {
  margin: 0;
  padding: 10px 14px 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.35;
}

.exam-statistics {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-left: 4px solid var(--subject-color, var(--navy));
  font-size: 13px;
}

.exam-statistics__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 11px 14px;
}

.exam-statistics__summary p {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0;
  color: var(--muted);
}

.exam-statistics strong {
  color: var(--heading);
  font-size: 15px;
}

.exam-statistics__summary a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  white-space: nowrap;
}

.exam-statistics__link-icon {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.exam-grade-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
}

.exam-grade-chart__item {
  display: grid;
  grid-template-rows: 24px 12px;
  align-items: end;
  justify-items: center;
  gap: 3px;
  min-width: 0;
}

.exam-grade-chart__track {
  position: relative;
  display: block;
  width: 9px;
  height: 24px;
  overflow: hidden;
  border-radius: 1px;
  background: color-mix(in srgb, var(--line) 65%, transparent);
}

.exam-grade-chart__bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 1px;
}

.exam-grade-chart__item > strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.exam-grade-chart__item--poor .exam-grade-chart__bar {
  background: #8f1d1d;
}

.exam-grade-chart__item--low .exam-grade-chart__bar {
  background: #b45309;
}

.exam-grade-chart__item--medium .exam-grade-chart__bar {
  background: #8a6d00;
}

.exam-grade-chart__item--good .exam-grade-chart__bar {
  background: #3f7f1f;
}

.exam-grade-chart__item--excellent .exam-grade-chart__bar {
  background: #0b5d2a;
}

.practice-interactive-card {
  margin-top: 22px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-top: 4px solid var(--subject-color, var(--navy));
}

.practice-interactive-card__heading {
  margin-bottom: 14px;
}

.practice-interactive-card p {
  color: var(--muted);
}

.practice-interactive-card h3 {
  margin: 4px 0 0;
  color: var(--heading);
  font-size: 22px;
  line-height: 1.2;
}

.practice-interactive-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.practice-exam-selection {
  margin-top: 22px;
  border-top: 4px solid var(--subject-color, var(--navy));
}

.practice-exam-list {
  border: 1px solid var(--line-dark);
  border-top: 0;
}

.practice-exam-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 110px auto;
  gap: 14px;
  align-items: center;
  min-height: 62px;
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.practice-exam-row:last-child {
  border-bottom: 0;
}

.practice-exam-row--active {
  background: var(--pale-blue);
}

.practice-exam-row__name strong {
  color: var(--heading);
  line-height: 1.2;
}

.practice-exam-row__name {
  display: grid;
  gap: 3px;
}

.practice-exam-row__status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.practice-exam-row__duration {
  color: var(--heading);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.practice-exam-row__actions {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
}

.practice-exam-row__actions .primary-button,
.practice-exam-row__actions .secondary-button {
  min-width: 150px;
}

.simulation-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.simulation-note strong {
  color: var(--heading);
}

.archive-section {
  padding: 32px 0 72px;
}

.archive-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 42px;
  align-items: start;
}

.filters {
  position: sticky;
  top: 20px;
  display: flex;
  max-height: calc(100vh - 40px);
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
  background: var(--soft);
  border-top: 4px solid var(--navy);
}

.filters__heading,
.results-heading,
.year-heading,
.subject-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filters__heading {
  gap: 14px;
  margin-bottom: 22px;
}

.filters h2 {
  color: var(--heading);
  font-size: 18px;
}

.year-jump-list {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 3px;
  overflow-y: auto;
}

.year-jump-link {
  display: block;
  width: 100%;
  padding: 7px 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
  text-align: left;
}

.year-jump-link:hover {
  color: var(--link-dark);
  text-decoration: underline;
}

.year-jump-link--active {
  color: var(--heading);
  font-weight: 700;
}

.link-button {
  padding: 0;
  color: var(--link);
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 700;
}

.link-button:hover {
  text-decoration: underline;
}

.field {
  display: block;
  margin-bottom: 18px;
}

.field > span:first-child {
  display: block;
  margin-bottom: 6px;
  color: var(--heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  height: 40px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-radius: 0;
  font-size: 14px;
}

input {
  padding: 8px 10px 8px 36px;
}

select {
  padding: 0 9px;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: 2px;
}

.subject-symbol__icon {
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.results-heading {
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-dark);
}

.results-heading .eyebrow {
  margin-bottom: 6px;
}

#results-count {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.year-block + .year-block {
  margin-top: 18px;
}

.practice-year-row-start {
  scroll-margin-top: 20px;
}

.year-heading {
  min-height: 34px;
  gap: 16px;
  padding: 5px 12px;
  color: var(--white);
  background: color-mix(in srgb, var(--navy) 76%, transparent);
}

.year-heading h3,
.year-heading p {
  margin: 0;
}

.year-heading h3 {
  font-size: 16px;
  line-height: 1.25;
}

.year-heading p {
  color: #ccd8ec;
  font-size: 11px;
  letter-spacing: 0.05em;
  line-height: 1.25;
  text-transform: uppercase;
}

.exam-table {
  width: 100%;
  border-collapse: collapse;
}

.exam-table th {
  padding: 10px 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-dark);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
}

.exam-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}

.exam-table th:last-child,
.exam-table td:last-child {
  text-align: right;
}

.subject-row {
  justify-content: flex-start;
  gap: 9px;
}

.subject-symbol {
  display: grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--subject-color, var(--navy));
}

.subject-symbol__icon {
  width: 21px;
  height: 21px;
  stroke-width: 1.85;
}

.level-badge {
  display: inline-block;
  min-width: 25px;
  padding: 2px 5px;
  color: var(--heading);
  background: var(--pale-blue);
  border: 1px solid #cfdaea;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.level-badge--a {
  background: #cbdcf3;
  border-color: #9db9dd;
}

.level-badge--empty {
  color: #9ca8b7;
  background: transparent;
  border-color: transparent;
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: var(--white);
  background: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.download-link:hover {
  color: var(--white);
  background: var(--blue-dark);
  text-decoration: none;
}

.download-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.material-actions {
  display: inline-flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
}

.practice-link {
  color: var(--link);
  font-size: 12px;
  font-weight: 700;
}

.practice-link:hover {
  color: var(--link-dark);
}

.empty-state {
  padding: 42px 20px;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 5px;
  color: var(--heading);
  font-size: 18px;
}

.empty-state p {
  margin: 0;
}

.site-footer {
  padding: 25px 0;
  color: #d4deed;
  background: var(--navy);
  font-size: 13px;
}

.site-footer strong {
  display: block;
  color: var(--white);
  font-size: 18px;
  line-height: 1.1;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.footer-brand__copy {
  min-width: 0;
}

.footer-brand__mark {
  width: 40px;
  height: 40px;
}

.footer-meta {
  margin-left: auto;
  text-align: right;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: 18px;
}

.footer-github {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.footer-github svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.site-footer .footer-github:hover {
  color: var(--white);
  text-decoration: none;
}

.site-footer p {
  margin: 3px 0 0;
}

.site-footer .footer-brand p {
  margin-top: 1px;
  line-height: 1.25;
}

.site-footer a {
  color: var(--white);
  text-decoration: underline;
}

.site-footer .footer-github {
  text-decoration: none;
}

.practice-page-heading {
  padding-bottom: 34px;
}

.subpage-context {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subpage-context a {
  color: var(--link);
}

.subpage-context span {
  color: var(--heading);
}

.practice-section {
  min-height: 520px;
  padding: 30px 0 72px;
}

.solver-page .practice-section {
  padding-top: 0;
}

.practice-container {
  width: min(calc(100% - 40px), 1440px);
}

.practice-overview__heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  gap: 48px;
  align-items: end;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-dark);
}

.practice-overview__heading .eyebrow {
  margin-bottom: 6px;
}

.practice-overview__heading p:last-child {
  margin: 0;
  color: var(--muted);
}

.practice-filter-bar {
  display: flex;
  gap: 16px;
  padding: 18px 0 4px;
}

.practice-filter-bar .field {
  width: 190px;
  margin-bottom: 12px;
}

.practice-table-wrap {
  overflow-x: auto;
  border-top: 4px solid var(--navy);
}

.practice-exam-table {
  width: 100%;
  border-collapse: collapse;
}

.practice-exam-table th {
  padding: 10px 12px;
  color: var(--muted);
  background: var(--soft);
  border-bottom: 1px solid var(--line-dark);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.practice-exam-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  white-space: nowrap;
}

.practice-exam-table th:last-child,
.practice-exam-table td:last-child {
  text-align: right;
}

.status-badge {
  display: inline-block;
  padding: 2px 6px;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line-dark);
  font-size: 11px;
  font-weight: 700;
}

.status-badge--available {
  color: #1c6138;
  background: #edf8f0;
  border-color: #b7d8c1;
}

.start-link,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid var(--blue);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.start-link,
.primary-button {
  color: var(--white);
  background: var(--blue);
}

.start-link:hover,
.primary-button:hover {
  color: var(--white);
  background: var(--blue-dark);
  text-decoration: none;
}

.primary-button--muted {
  color: var(--link);
  background: var(--surface);
  border-color: var(--line-dark);
}

.primary-button--muted:hover {
  color: var(--link-dark);
  background: var(--soft);
  border-color: var(--blue-dark);
}

.secondary-button {
  color: var(--link);
  background: var(--surface);
}

.secondary-button:hover {
  color: var(--link-dark);
  border-color: var(--blue-dark);
}

.primary-button:disabled,
.secondary-button:disabled {
  color: #8d99a9;
  background: var(--soft);
  border-color: var(--line-dark);
  cursor: not-allowed;
  opacity: 0.72;
}

.empty-state .start-link {
  margin-top: 16px;
}

.solver-header__toolbar,
.solver-header__main,
.panel-heading,
.answer-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.solver-header {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-top: 4px solid var(--subject-color, var(--navy));
}

.solver-page .solver-header,
.physics-solver-active .solver-header,
.croatian-solver-active .solver-header {
  width: 100vw;
  margin-right: calc(50% - 50vw);
  margin-left: calc(50% - 50vw);
  border-right: 0;
  border-left: 0;
}

.solver-page .simulation-mode-notice,
.physics-solver-active .simulation-mode-notice,
.croatian-solver-active .simulation-mode-notice {
  width: min(100%, 1440px);
  margin-right: auto;
  margin-left: auto;
}

.solver-page .solver-header__toolbar,
.solver-page .solver-header__main,
.solver-page .solver-header__footer,
.physics-solver-active .solver-header__toolbar,
.physics-solver-active .solver-header__main,
.physics-solver-active .solver-header__footer,
.croatian-solver-active .solver-header__toolbar,
.croatian-solver-active .solver-header__main,
.croatian-solver-active .solver-header__footer {
  width: min(calc(100% - 40px), 1440px);
  margin-right: auto;
  margin-left: auto;
  padding-right: 0;
  padding-left: 0;
}

.solver-page .solver-header__toolbar,
.physics-solver-active .solver-header__toolbar,
.croatian-solver-active .solver-header__toolbar {
  border-bottom: 0;
}

.solver-header__toolbar {
  gap: 18px;
  padding: 12px 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}

.solver-header__back,
.solver-header__downloads a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--blue);
}

.solver-header__back:hover,
.solver-header__downloads a:hover {
  color: var(--white);
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  text-decoration: none;
}

.solver-header__downloads {
  display: inline-flex;
  gap: 8px;
}

.solver-header__main {
  gap: 24px;
  padding: 15px 16px 10px;
  color: var(--ink);
  background: var(--surface);
}

.solver-header__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.solver-header__subject-symbol {
  width: 34px;
  height: 34px;
  color: var(--subject-color, var(--navy));
}

.solver-header__subject-symbol .subject-symbol__icon {
  width: 27px;
  height: 27px;
}

.solver-header__main h2 {
  margin: 0;
  color: var(--heading);
}

.solver-header__main p {
  margin: 0;
  color: var(--muted);
}

.solver-header__main .eyebrow {
  margin-bottom: 4px;
  color: var(--subject-color, var(--blue));
}

.solver-header__main h2 {
  font-size: 22px;
}

.solver-header__main p:last-child {
  margin-top: 4px;
  font-size: 12px;
}

.solver-header__footer {
  margin: 0;
  padding: 0 16px 15px;
  color: var(--muted);
  background: transparent;
  border-top: 0;
  font-size: 13px;
  font-weight: 600;
}

.solver-header__footer .task-navigation {
  padding: 0;
}

.solver-header__footer .task-navigation:empty {
  display: none;
}

.solver-header__task-navigation {
  max-width: 100%;
}

.solver-page .solver-header__footer,
.physics-solver-active .solver-header__footer,
.croatian-solver-active .solver-header__footer {
  padding-left: var(--solver-header-title-offset, 0);
}

.solver-summary {
  flex: 0 0 auto;
  color: var(--heading);
  text-align: right;
}

.solver-summary strong,
.solver-summary span {
  display: block;
  font-size: 13px;
}

.solver-summary span {
  min-height: 18px;
  color: var(--link);
}

.simulation-timer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.simulation-timer__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--link);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.simulation-timer > span,
.simulation-timer > span > span,
.simulation-timer strong {
  display: block;
}

.simulation-timer > span > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.simulation-timer strong {
  margin-top: 2px;
  color: var(--heading);
  font-size: 15px;
}

.simulation-mode-notice strong {
  color: var(--heading);
}

.simulation-start-dialog-open {
  overflow: hidden;
}

.simulation-start-dialog {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 20px;
}

.simulation-start-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 20, 52, 0.64);
}

.simulation-start-dialog__panel {
  position: relative;
  width: min(100%, 470px);
  padding: 28px;
  background: var(--surface);
  border-top: 4px solid var(--navy);
  box-shadow: 0 18px 60px rgba(0, 29, 77, 0.28);
}

.simulation-start-dialog__panel h2 {
  margin: 0;
  color: var(--heading);
}

.simulation-start-dialog__panel > p:last-of-type {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.simulation-start-dialog__details {
  display: grid;
  gap: 9px;
  margin: 20px 0 0;
  padding: 16px 16px 16px 34px;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line-dark);
  font-size: 14px;
  line-height: 1.45;
}

.simulation-start-dialog__details strong {
  color: var(--heading);
}

.simulation-start-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

.simulation-start-dialog__actions .primary-button,
.simulation-start-dialog__actions .secondary-button {
  min-height: 38px;
}

.essay-practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  max-width: 1040px;
  margin: 18px auto 0;
}

.essay-task-panel,
.essay-writing-panel {
  background: var(--surface);
  border: 1px solid var(--line-dark);
}

.essay-task-panel {
  padding: 18px;
}

.essay-task-panel h3,
.essay-writing-panel h3 {
  margin: 0;
  color: var(--heading);
  font-size: 20px;
}

.essay-task-text {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--ink);
  line-height: 1.55;
}

.essay-task-text p {
  margin: 0;
}

.essay-task-source.pdf-source-list {
  margin-top: 14px;
  padding: 0;
}

.essay-task-source .pdf-source-crop {
  width: min(100%, 1000px);
}

.essay-instructions {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.essay-instructions ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.essay-rubric {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.essay-rubric > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 0;
  color: var(--heading);
  cursor: pointer;
  font-weight: 800;
}

.essay-rubric > summary small {
  color: var(--link);
  font-size: 12px;
  white-space: nowrap;
}

.essay-rubric__body {
  margin-top: 14px;
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.essay-rubric__score-note {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.essay-rubric__criteria {
  margin-top: 12px;
  border-top: 1px solid var(--line-dark);
}

.essay-rubric__criterion {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-dark);
}

.essay-rubric__criterion h4 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--heading);
  font-size: 14px;
}

.essay-rubric__criterion h4 small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.essay-rubric__criterion ul,
.essay-rubric__rules ul {
  display: grid;
  gap: 6px;
  margin: 9px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.essay-rubric__criterion li strong {
  color: var(--ink);
}

.essay-rubric__criterion li span {
  margin-left: 4px;
}

.essay-rubric__rules {
  margin-top: 14px;
}

.essay-rubric__rules h4 {
  margin: 0;
  color: var(--heading);
  font-size: 14px;
}

.essay-rubric__source {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.essay-rubric__source a {
  color: var(--link);
}

.essay-writing-panel {
  padding: 16px;
}

.essay-writing-panel__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.essay-writing-panel__heading > div {
  display: grid;
  gap: 5px;
}

.essay-word-pill {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.essay-word-pill[data-state="ok"] {
  color: #1c6138;
}

.essay-word-pill[data-state="warn"] {
  color: #7a4b00;
}

.essay-textarea-field {
  display: block;
}

.essay-textarea-field textarea {
  width: 100%;
  min-height: 610px;
  padding: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-dark);
  font: inherit;
  font-size: 18px;
  line-height: 1.65;
  resize: vertical;
}

.essay-textarea-field textarea::placeholder {
  color: #8796ad;
  font-style: italic;
}

.essay-textarea-field textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(42, 91, 153, 0.16);
}

.essay-writing-panel--scratch .essay-textarea-field textarea {
  min-height: 340px;
}

.essay-photo-upload__button {
  position: relative;
  gap: 7px;
  overflow: hidden;
  flex: 0 0 auto;
  cursor: pointer;
}

.essay-photo-upload__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.essay-photo-upload__button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.essay-ocr-status {
  min-height: 0;
}

.essay-ocr-message {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.essay-ocr-message--error {
  color: #7a1d1d;
}

.essay-photo-preview {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
}

.essay-photo-preview img {
  width: 120px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line-dark);
}

.essay-photo-preview div {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.essay-photo-preview strong {
  color: var(--heading);
  word-break: break-word;
}

.essay-photo-preview span {
  color: var(--muted);
  font-size: 12px;
}

.essay-grading-panel {
  margin-top: 14px;
}

.practice-notice--error {
  color: #7a1d1d;
  background: #fff1f1;
  border-color: #e4b7b7;
}

.solver-summary__actions {
  display: flex;
  gap: 8px;
  margin-top: 7px;
}

body.solver-page {
  padding-bottom: var(--solver-sticky-footer-height, 0px);
}

.solver-sticky-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.98);
  border-top: 2px solid var(--blue);
}

.solver-sticky-footer__inner {
  display: flex;
  width: min(calc(100% - 48px), 1440px);
  align-items: center;
  gap: 16px;
  margin: 0 auto;
  padding: 9px 0 calc(9px + env(safe-area-inset-bottom));
}

.solver-sticky-footer .task-navigation {
  flex: 1;
  min-width: 0;
  padding: 0;
}

.solver-sticky-footer .task-navigation:empty {
  display: none;
}

.solver-sticky-footer .task-button {
  min-width: 160px;
}

.solver-sticky-footer__controls,
.solver-sticky-footer__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.solver-sticky-footer__controls {
  flex: 0 0 auto;
}

.solver-sticky-footer__status {
  display: grid;
  min-width: 128px;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
  color: var(--heading);
  text-align: left;
}

.solver-sticky-footer__status-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.solver-sticky-footer__status-copy strong,
.solver-sticky-footer__status-copy span {
  display: block;
  line-height: 1.25;
}

.solver-sticky-footer__status-copy strong {
  font-size: 14px;
}

.solver-sticky-footer__status-copy span {
  color: var(--link);
  font-size: 12px;
}

.solver-sticky-footer__status-copy span:empty {
  display: none;
}

.solver-sticky-footer__actions .primary-button {
  gap: 6px;
}

.solver-sticky-footer__action-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.solver-sticky-footer--essay .solver-sticky-footer__inner,
.solver-sticky-footer--essay .solver-sticky-footer__controls {
  justify-content: center;
  justify-items: center;
}

.solver-sticky-footer--essay .solver-sticky-footer__status {
  display: block;
  min-width: 0;
  text-align: center;
}

.exam-results-dialog-open {
  overflow: hidden;
}

.exam-results-dialog[hidden] {
  display: none;
}

.exam-results-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.exam-results-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 20, 52, 0.58);
}

.exam-results-dialog__panel {
  position: relative;
  width: min(100%, 430px);
  padding: 28px;
  background: var(--surface);
  border-top: 4px solid var(--navy);
  box-shadow: 0 18px 60px rgba(0, 29, 77, 0.28);
  text-align: center;
}

.exam-results-dialog__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--heading);
  background: var(--soft);
  border: 1px solid var(--line-dark);
  font-size: 24px;
  line-height: 1;
}

.exam-results-dialog__check {
  width: 76px;
  height: 76px;
  margin-bottom: 12px;
  fill: none;
  stroke: #1c6138;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  animation: exam-results-check-pop 420ms ease-out both;
}

.exam-results-dialog__clock {
  width: 76px;
  height: 76px;
  margin-bottom: 12px;
  fill: none;
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  animation: exam-results-check-pop 240ms ease-out both;
}

.exam-results-dialog__clock-hand {
  transform-origin: 32px 32px;
  animation: exam-results-clock-tick 1200ms linear infinite;
}

.exam-results-dialog:not([data-state="grading"]) .exam-results-dialog__clock,
.exam-results-dialog[data-state="grading"] .exam-results-dialog__check,
.exam-results-dialog[data-state="grading"] .exam-results-dialog__metrics,
.exam-results-dialog[data-state="grading"] .exam-results-dialog__criteria,
.exam-results-dialog[data-state="grading"] .exam-results-dialog__comment {
  display: none;
}

.exam-results-dialog[data-state="grading"] .exam-results-dialog__panel .eyebrow {
  color: var(--link);
}

.exam-results-dialog__check circle {
  stroke-dasharray: 176;
  stroke-dashoffset: 176;
  animation: exam-results-check-draw 520ms 120ms ease-out forwards;
}

.exam-results-dialog__check path {
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: exam-results-check-draw 300ms 500ms ease-out forwards;
}

.exam-results-dialog__panel .eyebrow {
  margin-bottom: 6px;
  color: #1c6138;
}

.exam-results-dialog__panel h2 {
  margin: 0;
  color: var(--heading);
}

.exam-results-dialog__panel > p:last-child {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.exam-results-dialog__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 22px;
  background: var(--line-dark);
  border: 1px solid var(--line-dark);
}

.exam-results-dialog__metrics div {
  padding: 15px 10px;
  background: var(--soft);
}

.exam-results-dialog__metrics strong,
.exam-results-dialog__metrics span {
  display: block;
}

.exam-results-dialog__metrics strong {
  color: var(--heading);
  font-size: 26px;
}

.exam-results-dialog__metrics span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.exam-results-dialog__criteria {
  margin-top: 14px;
  text-align: left;
}

.exam-results-dialog__criteria > strong {
  display: block;
  color: var(--heading);
  font-size: 13px;
}

.exam-results-dialog__criteria dl {
  display: grid;
  gap: 1px;
  margin: 8px 0 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.exam-results-dialog__criteria div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  background: var(--surface);
}

.exam-results-dialog__criteria dt,
.exam-results-dialog__criteria dd {
  margin: 0;
}

.exam-results-dialog__criteria dt {
  color: #344766;
  font-size: 13px;
}

.exam-results-dialog__criteria dd {
  color: var(--heading);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.exam-results-dialog__comment {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.exam-results-dialog__comment summary {
  padding: 10px 0;
  color: var(--heading);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.exam-results-dialog__comment summary:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.22);
  outline-offset: 2px;
}

.exam-results-dialog__comment p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

@keyframes exam-results-check-pop {
  from {
    opacity: 0;
    transform: scale(0.72);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes exam-results-check-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes exam-results-clock-tick {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .exam-results-dialog__check,
  .exam-results-dialog__check circle,
  .exam-results-dialog__check path,
  .exam-results-dialog__clock,
  .exam-results-dialog__clock-hand {
    animation-duration: 1ms;
    animation-delay: 0ms;
  }
}

@media (max-width: 560px) {
  .simulation-start-dialog {
    padding: 12px;
  }

  .simulation-start-dialog__panel {
    padding: 22px 18px 18px;
  }

  .simulation-start-dialog__actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.task-navigation {
  display: flex;
  gap: 8px;
  padding: 16px 0;
  overflow-x: auto;
}

.task-button {
  display: flex;
  min-width: 136px;
  align-items: baseline;
  gap: 7px;
  justify-content: center;
  padding: 8px 10px;
  color: var(--heading);
  background: var(--soft);
  border: 1px solid var(--line-dark);
  text-align: center;
  white-space: nowrap;
}

.task-button:hover,
.task-button--active {
  color: var(--link);
  background: var(--pale-blue);
  border-color: #afc5e6;
  text-decoration: none;
}

.task-button strong,
.task-button small,
.task-button__grading {
  display: inline;
}

.task-button strong {
  font-weight: 400;
}

.task-button small {
  color: var(--heading);
  font-size: inherit;
  font-weight: 700;
}

.task-button__grading {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  font-weight: 400;
}

.task-type-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
}

.task-type-pager__button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 48%;
  padding: 10px 14px;
  color: var(--heading);
  background: var(--soft);
  border: 1px solid var(--line-dark);
  cursor: pointer;
  text-align: left;
}

.task-type-pager__button--next {
  text-align: right;
}

.task-type-pager__button:hover {
  color: var(--link);
  background: var(--pale-blue);
  border-color: #afc5e6;
}

.task-type-pager__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.task-type-pager__copy small {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0.7;
}

.task-type-pager__copy strong {
  overflow: hidden;
  font-weight: 400;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.task-type-pager__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.solver-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 18px;
  align-items: start;
}

.croatian-practice-layout {
  grid-template-columns: minmax(0, 1fr) 390px;
  margin-top: 0;
}

.croatian-document-panel {
  overflow: hidden;
}

.croatian-pdf-frame {
  height: min(78vh, 920px);
  min-height: 620px;
  background: #f8fafc;
}

.croatian-pdf-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--surface);
  border: 0;
}

.task-content-panel,
.answer-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line-dark);
}

.panel-heading {
  gap: 18px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-heading .eyebrow {
  margin-bottom: 3px;
}

.panel-heading h3 {
  margin: 0;
  color: var(--heading);
  font-size: 18px;
}

.panel-heading a {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
}

.panel-heading small {
  color: var(--muted);
}

.task-source {
  padding: 24px 26px 30px;
  color: var(--ink);
  font-family: var(--font-reading);
  font-size: 16px;
  line-height: 1.65;
}

.task-source > * {
  margin: 0;
}

.task-source > * + * {
  margin-top: 15px;
}

.pdf-source-list {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.pdf-source-figure {
  display: grid;
  justify-items: center;
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.pdf-source-crop {
  position: relative;
  width: min(100%, var(--crop-natural, 100%)) !important;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
}

.pdf-source-crop img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  max-width: none;
  height: auto;
}

.english-reading-responses {
  border-top: 1px solid var(--line-dark);
}

.english-reading-responses__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--heading);
  border-bottom: 1px solid var(--line);
}

.english-reading-responses__heading strong {
  font-size: 16px;
}

.english-reading-responses__heading small {
  color: var(--muted);
}

.english-reading-responses .response-list {
  padding: 5px 14px 10px;
}

.english-reading-responses .answer-choice span {
  width: 32px;
  height: 32px;
}

.english-reading-source {
  display: grid;
  gap: 20px;
}

.english-reading-source > * + * {
  margin-top: 0;
}

.english-reading-question-list {
  display: grid;
  gap: 22px;
}

.english-source-question {
  grid-template-columns: 38px minmax(0, 1fr);
}

.english-source-question .physics-inline-response {
  grid-column: 1 / -1;
}

.english-source-question__body .source-options {
  margin-top: 12px;
}

.english-inline-text-response__field {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.english-inline-text-response input {
  box-sizing: border-box;
  width: min(100%, 340px);
  height: 34px;
  padding: 5px 8px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  font: inherit;
}

.english-inline-text-response input:focus {
  outline: 3px solid rgba(46, 93, 172, 0.22);
  outline-offset: 1px;
}

.english-inline-gap-crop {
  isolation: isolate;
}

.english-text-blank {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  min-width: 0;
  padding: 1px 5px 2px;
  color: #20242a;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #7fa4d6;
  border-bottom: 2px solid var(--blue);
  border-radius: 2px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.05;
}

.english-text-blank:focus {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: 2px;
}

.english-text-blank:disabled {
  color: var(--muted);
  background: rgba(248, 250, 252, 0.96);
  border-color: var(--line-dark);
}

.english-text-blank--answered {
  background: rgba(255, 255, 255, 0.98);
  border-color: var(--blue);
}

.english-text-blank--correct {
  color: #15552e;
  background: #e4f6e8;
  border-color: #74b486;
}

.english-text-blank--wrong {
  color: #8a2020;
  background: #fbe7e7;
  border-color: #d69494;
}

.english-choice-blank {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  box-sizing: border-box;
  min-width: 0;
  padding: 1px 4px 2px;
  color: #20242a;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #7fa4d6;
  border-bottom: 2px solid var(--blue);
  border-radius: 2px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.05;
  text-align: left;
  cursor: pointer;
}

.english-choice-blank:hover {
  background: #f8fbff;
  border-color: var(--blue);
}

.english-choice-blank:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: 2px;
}

.english-choice-blank:disabled {
  color: var(--muted);
  background: rgba(248, 250, 252, 0.96);
  border-color: var(--line-dark);
  cursor: not-allowed;
}

.english-choice-blank--answered {
  background: rgba(255, 255, 255, 0.98);
  border-color: var(--blue);
}

.english-choice-blank--correct {
  color: #15552e;
  background: #e4f6e8;
  border-color: #74b486;
}

.english-choice-blank--wrong {
  color: #8a2020;
  background: #fbe7e7;
  border-color: #d69494;
}

.english-choice-blank span:first-child {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.english-choice-blank__chevron {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-top: 3px solid currentColor;
  border-right: 3px solid transparent;
  border-left: 3px solid transparent;
  opacity: 0.68;
}

.english-choice-popover {
  position: fixed;
  z-index: 60;
  width: min(420px, calc(100vw - 24px));
  max-height: min(540px, calc(100vh - 24px));
  overflow: auto;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  box-shadow: 0 14px 38px rgba(16, 35, 63, 0.22);
}

.english-choice-popover__heading {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  color: var(--white);
  background: var(--navy);
}

.english-choice-popover__heading strong {
  font-size: 13px;
}

.english-choice-popover__heading button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.english-choice-popover__heading button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.english-choice-popover__options {
  display: grid;
}

.english-choice-popover__option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-top: 1px solid var(--line);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.english-choice-popover__option:hover,
.english-choice-popover__option:focus-visible {
  background: var(--pale-blue);
}

.english-choice-popover__option:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: -3px;
}

.english-choice-popover__option strong {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--heading);
  background: var(--soft);
  border: 1px solid var(--line-dark);
  font-size: 12px;
}

.english-choice-popover__option span {
  min-width: 0;
  font-size: 14px;
}

.english-choice-popover__option--selected {
  background: #edf3f8;
}

.english-choice-popover__option--selected strong {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.english-choice-popover__option--used {
  color: var(--muted);
  background: #f7f9fc;
}

.english-choice-popover__option--used strong {
  color: var(--muted);
  background: #eef2f6;
  border-color: var(--line-dark);
}

.english-choice-popover__option--used span {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.english-inline-check-list {
  display: grid;
  gap: 8px;
  padding: 0 18px 18px;
}

.english-inline-check-list--group {
  gap: 10px;
}

.english-inline-group-check-button.inline-check-button {
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-left: 0;
  font-size: 14px;
}

.english-inline-group-results {
  display: grid;
  gap: 6px;
}

.english-inline-group-result {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
}

.english-inline-group-result > strong {
  min-width: 32px;
  color: var(--heading);
}

.english-inline-group-result .response-feedback {
  margin: 0;
}

.english-inline-group-result--correct {
  background: #f0f8f1;
  border-color: #b9d9c2;
}

.english-inline-group-result--wrong {
  background: #fff3f3;
  border-color: #edc2c2;
}

.english-inline-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
}

.english-inline-check-row > strong {
  min-width: 32px;
  color: var(--heading);
}

.source-instructions {
  padding: 13px 15px;
  color: #344766;
  background: var(--pale-blue);
  border-left: 4px solid var(--blue);
  font-size: 14px;
  font-weight: 600;
}

.source-title {
  margin-top: 22px;
  color: var(--heading);
  font-size: 23px;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: center;
}

.source-subheading {
  margin-top: 18px;
  color: var(--heading);
  font-size: 16px;
}

.source-section-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  color: var(--heading);
  font-size: 17px;
}

.source-section-label span,
.source-options__item strong,
.source-questions__item strong {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  color: var(--white);
  background: var(--navy);
  font-size: 13px;
  line-height: 1;
}

.source-options,
.source-questions {
  display: grid;
  gap: 8px;
}

.source-options__item,
.source-questions__item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.source-options__item {
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.source-questions__item {
  padding: 10px 0 11px;
  border-bottom: 1px solid var(--line);
}

.source-questions__item strong {
  background: var(--blue);
}

.source-options__item span,
.source-questions__item span {
  padding-top: 2px;
}

.source-gap,
.source-example {
  padding: 1px 5px 2px;
  border-radius: 0;
  font-weight: 700;
}

.source-gap {
  color: #743e00;
  background: #fff1c7;
}

.source-example {
  color: #1c6138;
  background: #e4f6e8;
}

.practice-notice {
  margin: 14px 0 0;
  padding: 11px 14px;
  color: #344766;
  background: var(--pale-blue);
  border-left: 4px solid var(--blue);
  font-size: 13px;
  font-weight: 600;
}

.solver-question-layout,
.physics-practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 980px) 176px;
  justify-content: center;
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.solver-question-main {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.solver-question-layout--workspace {
  grid-template-columns: minmax(0, 1fr) 176px;
  justify-content: stretch;
}

.solver-question-layout--single {
  grid-template-columns: minmax(0, 1fr);
}

.english-listening-layout {
  width: min(100%, 980px);
  margin-right: auto;
  margin-left: auto;
}

.question-quickselect,
.physics-quickselect {
  --quickselect-list-max-height: calc(100vh - 172px);
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 118px);
  padding: 11px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-dark);
}

.question-quickselect--with-action {
  --quickselect-list-max-height: calc(100vh - 216px);
}

.question-quickselect__tools {
  margin-top: 10px;
}

.question-jump {
  display: none;
}

.question-quickselect__heading,
.physics-quickselect__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 9px;
  color: var(--heading);
  border-bottom: 1px solid var(--line);
}

.question-quickselect__heading small,
.physics-quickselect__heading small {
  color: var(--muted);
  font-size: 11px;
}

.question-quickselect__list,
.physics-quickselect__list {
  display: grid;
  max-height: var(--quickselect-list-max-height);
  grid-template-columns: repeat(4, 31px);
  justify-content: start;
  gap: 5px;
  padding-top: 10px;
  overflow-y: auto;
}

.question-quickselect__link,
.physics-quickselect__link {
  display: grid;
  box-sizing: border-box;
  width: 31px;
  min-height: 30px;
  place-items: center;
  color: var(--heading);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  font-size: 12px;
  font-weight: 700;
}

.question-quickselect__link:hover,
.physics-quickselect__link:hover {
  color: var(--link-dark);
  background: var(--soft);
  border-color: var(--blue);
  text-decoration: none;
}

.question-quickselect__link--answered,
.physics-quickselect__link--answered {
  color: var(--link-dark);
  background: var(--pale-blue);
  border-color: #afc5e6;
}

.question-quickselect__link--excluded {
  color: var(--muted);
  background: #f4f5f7;
  border-color: var(--line);
}

.question-quickselect__link--active,
.question-quickselect__link--active:hover,
.physics-quickselect__link--active,
.physics-quickselect__link--active:hover {
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--white);
}

.question-quickselect__link--correct,
.physics-quickselect__link--correct {
  color: #15552e;
  background: #e4f6e8;
  border-color: #74b486;
}

.question-quickselect__link--wrong,
.physics-quickselect__link--wrong {
  color: #8a2020;
  background: #fbe7e7;
  border-color: #d69494;
}

.question-quickselect__action {
  display: inline-flex;
  box-sizing: border-box;
  width: 100%;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 9px;
  color: var(--heading);
  background: var(--soft);
  border: 1px solid var(--line-dark);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.question-quickselect__action:hover,
.question-quickselect__action:focus-visible {
  color: var(--white);
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  text-decoration: none;
}

.question-quickselect__action-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.task-audio {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 12px 14px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.task-audio__heading {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 10px;
}

.task-audio__heading .eyebrow {
  margin: 0;
}

.task-audio__heading strong {
  color: var(--heading);
}

.task-audio__heading small {
  color: var(--muted);
  text-align: right;
}

.task-audio audio[data-task-audio] {
  display: none;
}

.audio-player {
  display: grid;
  grid-template-columns: 34px minmax(90px, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 12px;
  color: #fff;
  background: #2b2f36;
  border-radius: 8px;
}

.audio-player__button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #cdd3dc;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}

.audio-player__button:hover,
.audio-player__button:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.audio-player__play {
  color: #fff;
  background: #1fb6e8;
}

.audio-player__play:hover,
.audio-player__play:focus-visible {
  background: #38c2ef;
}

.audio-player__icon {
  display: inline-grid;
  place-items: center;
}

.audio-player__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.audio-player__rate {
  min-width: 40px;
  height: 28px;
  padding: 0 9px;
  color: #cdd3dc;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.audio-player__rate:hover,
.audio-player__rate:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
}

.audio-player__rate.is-active {
  color: #08222c;
  background: #1fb6e8;
  border-color: #1fb6e8;
}

.audio-player__volume-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.audio-player__volume {
  flex: 0 0 90px;
}

.audio-player__range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  accent-color: #1fb6e8;
}

.audio-player__range:focus {
  outline: none;
}

.audio-player__range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(31, 182, 232, 0.45);
}

.audio-player__range:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px rgba(31, 182, 232, 0.45);
}

.audio-player__range::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(
    to right,
    #1fb6e8 0 var(--audio-progress, 0%),
    #2f2f2f var(--audio-progress, 0%) 100%
  );
  border-radius: 999px;
}

.audio-player__range::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  background: #fff;
  border: 0;
  border-radius: 50%;
  -webkit-appearance: none;
  appearance: none;
}

.audio-player__range::-moz-range-track {
  height: 4px;
  background: #2f2f2f;
  border-radius: 999px;
}

.audio-player__range::-moz-range-progress {
  height: 4px;
  background: #1fb6e8;
  border-radius: 999px;
}

.audio-player__range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #fff;
  border: 0;
  border-radius: 50%;
}

.audio-player__time {
  color: #e7eaef;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.audio-track-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 14px 14px;
}

.audio-track-list--compact {
  padding: 0;
}

.audio-track-button {
  padding: 6px 9px;
  color: var(--heading);
  background: var(--soft);
  border: 1px solid var(--line-dark);
  font-size: 12px;
  font-weight: 700;
}

.audio-track-button:hover,
.audio-track-button--active {
  color: var(--link);
  background: var(--pale-blue);
  border-color: #afc5e6;
}

.physics-source-list {
  display: grid;
  gap: 22px;
}

.math-open-question-group {
  padding-top: 10px;
  border-top: 2px solid var(--navy);
}

.math-open-question-group__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--heading);
  background: #edf3f8;
  border-left: 4px solid var(--navy);
}

.math-open-question-group__heading span {
  color: #34465f;
  font-size: 12px;
  font-weight: 700;
}

.math-open-question-group__context {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.math-open-question-group__items .physics-source-question {
  padding-top: 16px;
}

.croatian-source-context {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  background: var(--surface);
  border: 1px solid var(--line);
}

.croatian-source-context .eyebrow {
  margin: 0;
  padding-inline: 14px;
  color: var(--heading);
}

.croatian-source-context .physics-source-crop {
  margin-inline: auto;
}

.croatian-solver-page .question-quickselect__list {
  grid-template-columns: repeat(3, minmax(42px, max-content));
}

.croatian-solver-page .question-quickselect__link {
  min-width: 42px;
  padding-inline: 6px;
}

.history-solver-page .question-quickselect__list {
  grid-template-columns: repeat(3, minmax(42px, max-content));
}

.history-solver-page .question-quickselect__link {
  min-width: 42px;
  padding-inline: 6px;
}

.history-task-description {
  margin: 0;
  padding: 10px 14px;
  color: var(--muted);
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.history-answer-list {
  display: grid;
  gap: 0;
  padding: 3px 14px 14px;
}

.history-source-list {
  padding: 18px;
}

.history-source-question .history-open-question {
  margin-top: 10px;
  padding: 11px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.history-source-question .history-open-question--correct,
.history-source-question .history-open-question--reviewed {
  padding-left: 10px;
}

.excluded-task-notice {
  margin: 10px 0 0;
  padding: 10px 12px;
  color: #46566c;
  background: #f4f5f7;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
}

.history-source-context {
  scroll-margin-top: 16px;
}

.history-response-card {
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 16px;
}

.history-response-card:last-child {
  border-bottom: 0;
}

.history-open-question {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 16px;
}

.history-open-question:last-child {
  border-bottom: 0;
}

.history-open-question--correct {
  border-left: 4px solid #74b486;
  padding-left: 10px;
}

.history-open-question--reviewed {
  border-left: 4px solid #d6b36f;
  padding-left: 10px;
}

.history-open-question__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-open-question__heading h4 {
  margin: 0;
  color: var(--heading);
  font-size: 15px;
}

.history-open-question__heading span {
  color: #34465f;
  background: #edf3f8;
  border: 1px solid #cfdae8;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 700;
}

.history-open-question__prompt {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  color: #24354f;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
}

.history-open-question__prompt p {
  margin: 0;
}

.history-open-feedback {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  color: #24354f;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-size: 13px;
}

.history-open-feedback strong {
  color: var(--heading);
}

.history-open-feedback p {
  margin: 0;
}

.history-open-feedback details {
  color: #24354f;
}

.history-open-feedback summary {
  color: var(--heading);
  cursor: pointer;
  font-weight: 700;
}

.history-model-answer {
  max-height: min(420px, 60vh);
  margin-top: 8px;
  overflow: auto;
  padding: 12px 14px;
  color: #24354f;
  background: var(--surface);
  border: 1px solid var(--line);
  line-height: 1.55;
}

.history-model-answer p {
  max-width: 82ch;
  margin: 0 0 10px;
}

.history-model-answer p:last-child,
.history-model-answer ul:last-child {
  margin-bottom: 0;
}

.history-model-answer ul {
  display: grid;
  gap: 5px;
  max-width: 82ch;
  margin: 0 0 10px;
  padding-left: 18px;
}

.history-model-answer--empty {
  max-height: none;
  overflow: visible;
}

.croatian-completion-crop {
  isolation: isolate;
}

.croatian-completion-blank {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 1px 3px 2px 3px;
  color: #20242a;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #7fa4d6;
  border-bottom: 2px solid var(--blue);
  border-radius: 2px;
  box-shadow: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.05;
  text-align: left;
  cursor: pointer;
}

.croatian-completion-blank:hover {
  background: #f8fbff;
  border-color: var(--blue);
}

.croatian-completion-blank:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: 2px;
}

.croatian-completion-blank:disabled {
  color: var(--muted);
  background: rgba(248, 250, 252, 0.96);
  border-color: var(--line-dark);
  cursor: not-allowed;
}

.croatian-completion-blank--answered {
  color: #20242a;
  background: rgba(255, 255, 255, 0.98);
  border-color: var(--blue);
}

.croatian-completion-blank--correct {
  color: #15552e;
  background: #e4f6e8;
  border-color: #74b486;
}

.croatian-completion-blank--wrong {
  color: #8a2020;
  background: #fbe7e7;
  border-color: #d69494;
}

.croatian-completion-blank span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.croatian-completion-blank__chevron {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-top: 4px solid currentColor;
  border-right: 3px solid transparent;
  border-left: 3px solid transparent;
  opacity: 0.68;
}

.croatian-completion-popover {
  position: fixed;
  z-index: 60;
  width: min(360px, calc(100vw - 24px));
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  box-shadow: 0 14px 38px rgba(16, 35, 63, 0.22);
}

.croatian-completion-popover__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  color: var(--white);
  background: var(--navy);
}

.croatian-completion-popover__heading strong {
  font-size: 13px;
}

.croatian-completion-popover__heading button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.croatian-completion-popover__heading button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.croatian-completion-popover__options {
  display: grid;
}

.croatian-completion-popover__option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-top: 1px solid var(--line);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.croatian-completion-popover__option:hover,
.croatian-completion-popover__option:focus-visible {
  background: var(--pale-blue);
}

.croatian-completion-popover__option:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: -3px;
}

.croatian-completion-popover__option strong {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--heading);
  background: var(--soft);
  border: 1px solid var(--line-dark);
  font-size: 12px;
}

.croatian-completion-popover__option span {
  min-width: 0;
  font-size: 14px;
}

.croatian-completion-popover__option--selected {
  background: #edf3f8;
}

.croatian-completion-popover__option--selected strong {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

/* Mobilni prikaz nadopunjavanja (vidi croatian-choice.js). Prikazuje se cijeli
   tekst razlomljen na pune retke; nakon retka s prazninom(ama) idu kontrole.
   Renderira se samo kad JS detektira uski ekran, pa pravila ne diraju desktop. */
.croatian-completion-cards {
  display: grid;
  gap: 0;
}

/* Segment punih redaka teksta + kontrole za praznine u zadnjem retku tog segmenta. */
.croatian-completion-card {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
}

.croatian-completion-card__number {
  font-weight: 700;
  color: var(--heading);
}

.croatian-completion-card__status {
  font-size: 12px;
  color: var(--muted);
}

.croatian-completion-card__status--empty {
  color: var(--muted);
}

.croatian-completion-card__status--correct {
  color: #15552e;
  font-weight: 600;
}

.croatian-completion-card__status--wrong {
  color: #8a2020;
  font-weight: 600;
}

/* Crop punog retka službenog teksta (puna širina, bez horizontalnog scrolla). */
.croatian-completion-band {
  overflow: hidden;
  background: var(--surface);
}

.croatian-completion-band__marker {
  position: absolute;
  z-index: 2;
  background: rgba(46, 93, 172, 0.16);
  border-bottom: 2px solid var(--blue);
  pointer-events: none;
}

/* Blok odgovora za jednu prazninu (dvije u istom retku → dva bloka jedan ispod drugog).
   Uži je od pune širine teksta (uvučen od rubova) da se jasno odvoji kao panel odgovora. */
.croatian-completion-row {
  display: grid;
  gap: 6px;
  margin-inline: 18px;
  padding: 9px 10px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.croatian-completion-row--correct {
  border-color: #74b486;
  background: #f3fbf5;
}

.croatian-completion-row--wrong {
  border-color: #d69494;
  background: #fdf4f4;
}

.croatian-completion-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.croatian-completion-card__options {
  display: grid;
  gap: 5px;
}

.croatian-completion-card__option {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 6px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.croatian-completion-card__option:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: 2px;
}

.croatian-completion-card__option-letter {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--heading);
  background: var(--soft);
  border: 1px solid var(--line-dark);
  font-size: 12px;
  font-weight: 600;
}

.croatian-completion-card__option-text {
  min-width: 0;
  font-size: 14px;
  line-height: 1.25;
}

.croatian-completion-card__option--selected {
  border-color: var(--blue);
  background: #edf3f8;
}

.croatian-completion-card__option--selected .croatian-completion-card__option-letter {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.croatian-completion-card__option--correct {
  border-color: #74b486;
  background: #e4f6e8;
}

.croatian-completion-card__option--correct .croatian-completion-card__option-letter {
  color: var(--white);
  background: #2f9e54;
  border-color: #2f9e54;
}

.croatian-completion-card__option--wrong {
  border-color: #d69494;
  background: #fbe7e7;
}

.croatian-completion-card__option--wrong .croatian-completion-card__option-letter {
  color: var(--white);
  background: #c0392b;
  border-color: #c0392b;
}

/* Mobilni prikaz nadopunjavanja na engleskom (vidi english-reading.js). Cijeli
   tekst razlomljen na pune retke; nakon retka s prazninom(ama) idu kontrole.
   Renderira se samo kad JS detektira uski ekran. */
.english-completion-cards {
  display: grid;
  gap: 0;
}

.english-completion-card {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
}

.english-completion-card__number {
  font-weight: 700;
  color: var(--heading);
}

.english-completion-card__status {
  font-size: 12px;
  color: var(--muted);
}

.english-completion-card__status--empty {
  color: var(--muted);
}

.english-completion-card__status--correct {
  color: #15552e;
  font-weight: 600;
}

.english-completion-card__status--wrong {
  color: #8a2020;
  font-weight: 600;
}

.english-completion-band {
  overflow: hidden;
  background: var(--surface);
}

.english-completion-band__marker {
  position: absolute;
  z-index: 2;
  background: rgba(46, 93, 172, 0.16);
  border-bottom: 2px solid var(--blue);
  pointer-events: none;
}

.english-completion-row {
  display: grid;
  gap: 8px;
  margin-inline: 18px;
  padding: 10px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.english-completion-row--correct {
  border-color: #74b486;
  background: #f3fbf5;
}

.english-completion-row--wrong {
  border-color: #d69494;
  background: #fdf4f4;
}

.english-completion-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.english-completion-card__input {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  font: inherit;
  font-size: 15px;
}

.english-completion-card__input:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: 2px;
  border-color: var(--blue);
}

.english-completion-card__options {
  display: grid;
  gap: 8px;
}

.english-completion-card__option {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.english-completion-card__option:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: 2px;
}

.english-completion-card__option-letter {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--heading);
  background: var(--soft);
  border: 1px solid var(--line-dark);
  font-size: 13px;
  font-weight: 600;
}

.english-completion-card__option-text {
  min-width: 0;
  font-size: 15px;
  line-height: 1.3;
}

.english-completion-card__option-note {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}

.english-completion-card__option--used {
  color: var(--muted);
  background: var(--soft);
}

.english-completion-card__option--selected {
  border-color: var(--blue);
  background: #edf3f8;
}

.english-completion-card__option--selected .english-completion-card__option-letter {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.english-completion-card__option--correct {
  border-color: #74b486;
  background: #e4f6e8;
}

.english-completion-card__option--correct .english-completion-card__option-letter {
  color: var(--white);
  background: #2f9e54;
  border-color: #2f9e54;
}

.english-completion-card__option--wrong {
  border-color: #d69494;
  background: #fbe7e7;
}

.english-completion-card__option--wrong .english-completion-card__option-letter {
  color: var(--white);
  background: #c0392b;
  border-color: #c0392b;
}

/* Dijeljeni bank ponuđenih odgovora (prikazan jednom na vrhu zadatka). */
.english-completion-bank {
  margin: 0 18px 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.english-completion-bank__summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  font-weight: 700;
  color: var(--heading);
  cursor: pointer;
  list-style: none;
}

.english-completion-bank__summary::-webkit-details-marker {
  display: none;
}

.english-completion-bank__summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--muted);
  font-weight: 400;
  transition: transform 0.15s ease;
}

.english-completion-bank[open] .english-completion-bank__summary::after {
  transform: rotate(180deg);
}

.english-completion-bank__range {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.english-completion-bank__list {
  margin: 0;
  padding: 0 12px 8px;
  list-style: none;
  display: grid;
  gap: 2px;
}

.english-completion-bank__item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: start;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.35;
}

.english-completion-bank__item--used {
  color: var(--muted);
}

.english-completion-bank__letter {
  font-weight: 700;
  color: var(--heading);
}

.english-completion-bank__item--used .english-completion-bank__letter {
  color: var(--muted);
}

.english-completion-bank__assign {
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* Uska traka slova ispod svake praznine + odjek odabrane opcije. */
.english-completion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.english-completion-chip {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 6px;
  color: var(--heading);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.english-completion-chip:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: 2px;
}

.english-completion-chip--used {
  color: var(--muted);
  background: var(--soft);
}

.english-completion-chip--selected {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.english-completion-chip--answer {
  color: #1f7a43;
  border-color: #2f9e54;
}

.english-completion-chip--correct {
  color: var(--white);
  background: #2f9e54;
  border-color: #2f9e54;
}

.english-completion-chip--wrong {
  color: var(--white);
  background: #c0392b;
  border-color: #c0392b;
}

.english-completion-pick {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.english-completion-pick--empty {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.english-completion-pick__letter {
  font-weight: 700;
  color: var(--blue);
}

.physics-source-question {
  display: grid;
  grid-template-columns: minmax(34px, max-content) minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 16px;
}

.physics-source-question:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.physics-source-question--image {
  display: block;
}

.physics-source-question h4 {
  display: grid;
  width: max-content;
  min-width: 34px;
  height: 34px;
  place-items: center;
  margin: 0;
  padding-inline: 6px;
  color: var(--white);
  background: var(--navy);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.physics-source-question__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--heading);
  font-size: 14px;
  font-weight: 700;
}

.physics-source-question__meta span {
  padding: 2px 7px;
  color: #34465f;
  background: #edf3f8;
  border: 1px solid #cfdae8;
  font-size: 12px;
  font-weight: 700;
}

.physics-source-question__body {
  min-width: 0;
}

.physics-source-question__body p {
  margin: 0;
}

.physics-inline-response {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
  padding: 11px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.physics-inline-response legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.physics-inline-response .choice-list {
  flex: 0 0 auto;
}

.physics-inline-response .answer-choice span {
  width: 36px;
  height: 34px;
}

.physics-inline-response .response-feedback {
  flex: 1 0 100%;
  padding-left: 0;
  font-weight: 700;
}

.physics-inline-response.response-question--correct {
  border-color: #74b486;
}

.physics-inline-response.response-question--wrong {
  border-color: #d69494;
}

.art-matching-response {
  align-items: stretch;
}

.art-matching-response__grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}

/* Philosophy matching rows pair a single-digit item with a one-letter dropdown,
   so keep them tight and left-aligned instead of stretching across the row. */
.art-matching-response--compact .art-matching-response__grid {
  grid-template-columns: repeat(auto-fit, minmax(74px, 96px));
  justify-content: start;
}

.art-matching-response--compact .art-matching-response__row {
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  padding: 6px;
}

.art-matching-response__row {
  display: grid;
  min-height: 38px;
  grid-template-columns: 30px minmax(58px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.art-matching-response__item {
  color: var(--heading);
  font-weight: 800;
}

.art-matching-response__row select {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 4px 6px;
  color: var(--heading);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  font: inherit;
  font-weight: 700;
}

.art-matching-response__row select:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.22);
  outline-offset: 1px;
}

.art-matching-response__row--correct {
  background: #edf7ef;
  border-color: #8bbf92;
}

.art-matching-response__row--wrong {
  background: #fff1f1;
  border-color: #d68c8c;
}

.art-matching-response__row--unused {
  background: #fff8e5;
  border-color: #d5b96a;
}

.physics-source-figure {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.physics-source-crop {
  position: relative;
  width: 100%;
  max-width: var(--crop-natural, 100%);
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
}

.physics-source-crop img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  max-width: none;
  height: auto;
}

.source-crop--segmented {
  display: flex;
  flex-direction: column;
}

.source-crop-segment {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  overflow: hidden;
}

/* Skeleton placeholder for source-image crops.
   Centralized: every solver renders crops through source-image-viewer.js,
   which adds .source-crop-loaded once the page image paints. The shimmer
   sits behind the (opaque) page image, so if JS never runs the image still
   shows on top — graceful degradation, no per-solver wiring. */
.physics-source-crop,
.pdf-source-crop,
.source-crop-segment {
  background-image: linear-gradient(100deg, #eef1f5 25%, #f6f8fb 50%, #eef1f5 75%);
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: source-crop-shimmer 1.3s ease-in-out infinite;
}

.physics-source-crop.source-crop-loaded,
.pdf-source-crop.source-crop-loaded,
.source-crop-segment.source-crop-loaded {
  background-image: none;
  animation: none;
}

@keyframes source-crop-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .physics-source-crop,
  .pdf-source-crop,
  .source-crop-segment {
    animation: none;
    background-image: none;
    background-color: #eef1f5;
  }

  .physics-source-crop.source-crop-loaded,
  .pdf-source-crop.source-crop-loaded,
  .source-crop-segment.source-crop-loaded {
    background-color: var(--surface);
  }
}

/* Generic content skeleton shown while a route's solver data lazy-loads,
   replacing the readable "Učitavam…" flash on subject/exam selection.
   Reuses the source-crop-shimmer keyframes. */
.skeleton-loading {
  display: grid;
  gap: 14px;
  padding: 8px 0;
}

.skeleton-block {
  background-image: linear-gradient(100deg, #eef1f5 25%, #f6f8fb 50%, #eef1f5 75%);
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: source-crop-shimmer 1.3s ease-in-out infinite;
  border-radius: 8px;
}

.skeleton-block--bar {
  height: 38px;
  max-width: 280px;
}

.skeleton-block--title {
  height: 30px;
  max-width: 360px;
}

.skeleton-block--row {
  height: 64px;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-block {
    animation: none;
    background-image: none;
    background-color: #eef1f5;
  }
}

.physics-source-crop[role="button"],
.pdf-source-crop[role="button"] {
  cursor: zoom-in;
}

.physics-source-crop[role="button"]:focus-visible,
.pdf-source-crop[role="button"]:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: 2px;
}

.source-image-viewer[hidden] {
  display: none;
}

.source-image-viewer {
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(3, 18, 43, 0.82);
}

.source-image-viewer__backdrop {
  position: absolute;
  inset: 0;
}

.source-image-viewer__panel {
  position: relative;
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr);
  color: var(--white);
}

.source-image-viewer__toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  background: rgba(3, 18, 43, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.source-image-viewer__toolbar strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-image-viewer__controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.source-image-viewer__button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.source-image-viewer__button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.5);
}

.source-image-viewer__button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.source-image-viewer__button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.source-image-viewer__icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.source-image-viewer__viewport {
  position: relative;
  overflow: hidden;
  background: #172234;
  cursor: grab;
  outline: 0;
  touch-action: none;
  user-select: none;
}

.source-image-viewer__viewport:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.source-image-viewer__viewport--dragging {
  cursor: grabbing;
}

.source-image-viewer__canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center;
  will-change: transform;
}

.source-image-viewer__crop {
  background: var(--surface);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.source-image-viewer__crop img {
  user-select: none;
  -webkit-user-drag: none;
}

.source-image-viewer-open {
  overflow: hidden;
}

.physics-open-solution {
  margin-top: 10px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.physics-open-solution__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.physics-open-solution__toggle {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 7px 12px;
  color: var(--white);
  background: var(--blue);
  border: 1px solid var(--blue);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.physics-open-solution__toggle:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.physics-open-solution__toggle:disabled {
  color: var(--muted);
  background: var(--soft);
  border-color: var(--line-dark);
  cursor: not-allowed;
}

.physics-open-solution__toggle:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: 2px;
}

.physics-open-score {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  color: var(--heading);
  font-size: 13px;
  font-weight: 700;
  vertical-align: top;
}

.physics-open-score input {
  box-sizing: border-box;
  width: 46px;
  height: 34px;
  padding: 5px 6px;
  color: var(--heading);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  font: inherit;
  text-align: right;
  appearance: textfield;
  -moz-appearance: textfield;
}

.physics-open-score input::-webkit-inner-spin-button,
.physics-open-score input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.physics-open-score input:focus {
  outline: 3px solid rgba(46, 93, 172, 0.22);
  outline-offset: 1px;
}

.physics-open-score input:invalid {
  border-color: #b85d5d;
}

.physics-open-score input:disabled {
  color: var(--muted);
  background: var(--soft);
}

.physics-open-score input.physics-open-score__input--full {
  border-color: #2f9e44;
  box-shadow: 0 0 0 2px rgba(47, 158, 68, 0.4);
}

.physics-open-solution__body {
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.physics-open-solution__missing {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 14px;
}

.inline-check-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin-left: auto;
  padding: 6px 11px;
  color: var(--heading);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.inline-check-button:hover {
  background: #f1f5fb;
  border-color: var(--blue);
}

.inline-check-button:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: 2px;
}

.inline-check-button--active {
  color: var(--link-dark);
  border-color: var(--blue);
}

.inline-check-button:disabled {
  color: var(--muted);
  background: var(--soft);
  border-color: var(--line);
  cursor: not-allowed;
}

.inline-check-button__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.response-question .inline-check-button {
  flex: 0 0 auto;
}

.physics-source-options {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.physics-source-option {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.physics-source-option strong {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--white);
  background: var(--navy);
  font-size: 13px;
  line-height: 1;
}

.physics-source-option span {
  min-width: 0;
  padding-top: 2px;
}

.answer-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.answer-panel__hint {
  margin: 0;
  padding: 10px 14px;
  color: var(--muted);
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.response-list {
  padding: 3px 14px;
}

.response-question {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.response-question legend,
.response-question--text strong {
  float: left;
  width: 28px;
  color: var(--heading);
  font-size: 13px;
}

.croatian-answer-panel .response-question legend {
  width: 42px;
}

.choice-list {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.answer-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
}

.answer-choice span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  -webkit-user-select: none;
  user-select: none;
  color: var(--heading);
  background: var(--surface);
  border: 1px solid var(--line-dark);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.answer-choice input:checked + span {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.answer-choice input:focus-visible + span {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: 2px;
}

.answer-choice--correct span,
.answer-choice--correct input:checked + span {
  color: #15552e;
  background: #e4f6e8;
  border-color: #74b486;
}

.answer-choice--wrong span,
.answer-choice--wrong input:checked + span {
  color: #8a2020;
  background: #fbe7e7;
  border-color: #d69494;
}

.response-feedback {
  flex: 1 0 100%;
  padding-left: 28px;
  color: var(--muted);
}

.croatian-answer-panel .response-feedback {
  padding-left: 42px;
}

.response-question--correct .response-feedback {
  color: #1c6138;
}

.response-question--wrong .response-feedback {
  color: #8a2020;
}

.response-question--text input {
  height: 34px;
  flex: 1;
  padding: 5px 8px;
}

.answer-panel__footer {
  gap: 8px;
  padding: 12px 14px;
}

@media (max-width: 860px) {
  .subject-page .grade-thresholds {
    display: none;
  }

  .subject-page.medicine-admission .grade-thresholds {
    display: block;
  }

  .subject-page.medicine-admission .practice-filters {
    display: block;
  }

  .solver-page .solver-header,
  .physics-solver-active .solver-header,
  .croatian-solver-active .solver-header {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

  .page-heading__grid,
  .archive-layout,
  .practice-layout {
    grid-template-columns: 1fr;
  }

  .home-heading .page-heading__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-heading__grid {
    gap: 26px;
  }

  .home-toolbar {
    display: block;
  }

  .subject-page__intro {
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
  }

  .subject-grid--mandatory {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  .home-information__topics {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .home-feedback {
    align-items: center;
  }

  .home-feedback .secondary-button {
    align-self: center;
  }

  .archive-layout {
    gap: 28px;
  }

  .practice-detail__content {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
    display: block;
    max-height: none;
    overflow: visible;
  }

  .practice-overview__heading {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .subject-exam-table-wrap {
    overflow: visible;
    border-top: 0;
  }

  .subject-exam-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .subject-exam-table colgroup,
  .subject-exam-table thead {
    display: none;
  }

  .subject-exam-table tbody,
  .subject-exam-table td {
    display: block;
    width: 100%;
  }

  .subject-exam-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--line-dark);
    border-top: 4px solid var(--subject-color, var(--navy));
  }

  .subject-exam-table tr + tr {
    margin-top: 8px;
  }

  .subject-exam-table td {
    display: grid;
    grid-template-columns: minmax(82px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    text-align: left;
  }

  .subject-exam-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .subject-exam-table td:first-child {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    padding: 0 0 8px;
    text-align: center;
  }

  .subject-exam-table td:first-child::before {
    display: none;
  }

  .subject-exam-table__exam-label {
    justify-content: center;
  }

  .subject-exam-table td:last-child {
    display: block;
    grid-column: 1 / -1;
    padding: 8px 0 0;
    border-bottom: 0;
    text-align: left;
  }

  .subject-exam-table td:last-child::before {
    display: none;
  }

  .subject-exam-table td.subject-exam-table__progress-cell {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    padding: 6px 10px 6px 0;
    min-width: 0;
  }

  .subject-exam-table td.subject-exam-table__best-cell {
    grid-template-columns: auto auto;
    gap: 8px;
    align-items: center;
    justify-items: end;
    padding: 6px 0;
    width: auto;
    text-align: right;
  }

  .subject-best-scores {
    justify-content: flex-end;
  }

  .subject-best-score {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }

  .exam-progress__meter-row {
    gap: 4px;
    width: 100%;
  }

  .exam-progress .progress-meter {
    width: auto;
    flex: 1 1 auto;
  }

  .exam-progress__percent {
    flex-basis: auto;
    width: auto;
    font-size: 12px;
  }

  .subject-exam-table .exam-actions {
    gap: 6px;
    width: 100%;
    justify-content: stretch;
  }

  .subject-exam-table .exam-actions .primary-button {
    flex: 1 1 auto;
  }

  .solver-workspace {
    grid-template-columns: 1fr;
  }

  .essay-practice-layout {
    grid-template-columns: 1fr;
  }

  .essay-textarea-field textarea {
    min-height: 520px;
  }

  .croatian-practice-layout {
    grid-template-columns: 1fr;
  }

  .croatian-pdf-frame {
    height: 70vh;
    min-height: 460px;
  }

  .solver-question-layout,
  .physics-practice-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .solver-question-layout--workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .question-quickselect,
  .physics-quickselect {
    top: 0;
    z-index: 10;
    display: flex;
    order: -1;
    max-height: none;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    box-shadow: 0 3px 10px rgba(0, 29, 77, 0.1);
  }

  .solver-sticky-footer .task-navigation {
    display: none;
  }

  .question-quickselect__heading,
  .physics-quickselect__heading {
    flex: 0 0 auto;
    padding: 0;
    border-bottom: 0;
  }

  .question-quickselect__heading small,
  .physics-quickselect__heading small {
    display: none;
  }

  .question-quickselect__list,
  .physics-quickselect__list {
    display: flex;
    max-height: none;
    flex: 1;
    gap: 5px;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .question-quickselect__link,
  .physics-quickselect__link {
    width: 32px;
    min-height: 30px;
    flex: 0 0 32px;
  }

  .question-quickselect__action {
    width: auto;
    min-height: 30px;
    flex: 0 0 auto;
    margin-top: 0;
    padding: 6px 8px;
    white-space: nowrap;
  }

  .question-quickselect__action-icon {
    width: 14px;
    height: 14px;
  }

  .solver-header__task-navigation .task-button {
    max-width: min(78vw, 260px);
    min-width: 0;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 2px 7px;
    align-items: center;
    white-space: normal;
  }

  .solver-header__task-navigation .task-button strong {
    min-width: 0;
    line-height: 1.2;
  }

  .solver-header__task-navigation .task-button__grading {
    flex-basis: 100%;
    font-size: 11px;
    line-height: 1.2;
  }

  .croatian-solver-page .question-quickselect__link {
    width: 42px;
    flex-basis: 42px;
  }

  .physics-source-question {
    scroll-margin-top: 60px;
  }

  body.solver-page {
    overflow-x: hidden;
  }

  body.solver-page .practice-container {
    width: 100%;
  }

  body.solver-page .solver-question-layout,
  body.solver-page .physics-practice-layout {
    gap: 8px;
    margin-top: 10px;
  }

  body.solver-page .solver-question-main {
    gap: 10px;
  }

  body.solver-page .task-content-panel {
    border-right: 0;
    border-left: 0;
    overflow-x: clip;
  }

  body.solver-page .panel-heading {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px 10px;
    padding: 10px;
  }

  body.solver-page .panel-heading > div {
    min-width: 0;
  }

  body.solver-page .panel-heading h3 {
    font-size: 17px;
    line-height: 1.18;
  }

  body.solver-page .panel-heading small {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body.solver-page .history-task-description {
    overflow-wrap: anywhere;
  }

  body.solver-page .task-source,
  body.solver-page .physics-source-list,
  body.solver-page .history-source-list,
  body.solver-page .pdf-source-list {
    padding-right: 0;
    padding-left: 0;
  }

  body.solver-page .task-source {
    padding-top: 12px;
    padding-bottom: 18px;
  }

  body.solver-page .pdf-source-list {
    gap: 12px;
  }

  body.solver-page .physics-source-question {
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
  }

  body.solver-page .physics-source-question--image {
    padding-right: 0;
    padding-left: 0;
  }

  body.solver-page .physics-source-question--image .physics-inline-response,
  body.solver-page .physics-source-question--image .physics-open-solution,
  body.solver-page .physics-source-question--image .physics-source-question__meta,
  body.solver-page .physics-source-question--image .history-open-question {
    margin-right: 8px;
    margin-left: 8px;
  }

  body.solver-page .history-open-question {
    min-width: 0;
    max-width: 100%;
  }

  body.solver-page .physics-source-figure,
  body.solver-page .pdf-source-figure {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.solver-page .physics-source-crop,
  body.solver-page .pdf-source-crop {
    width: min(100%, var(--crop-natural, 100%)) !important;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.solver-page .english-source-question {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .answer-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(calc(100% - 28px), var(--container));
  }

  .exam-statistics__summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .exam-statistics__summary p {
    flex-wrap: wrap;
  }

  .exam-statistics__summary a {
    margin-left: auto;
  }

  .topbar {
    font-size: 11px;
  }

  .topbar__inner {
    min-height: 32px;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0;
  }

  .topbar__label,
  .topbar__inner > span {
    flex: 1 1 auto;
    overflow: hidden;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar__label-extra {
    display: none;
  }

  .topbar__actions {
    width: auto;
    min-width: 0;
    flex: 0 1 auto;
    gap: 8px;
    justify-content: flex-end;
  }

  .topbar__actions > a {
    flex: 0 0 auto;
    gap: 3px;
  }

  .auth-widget {
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .auth-page-card {
    padding: 20px;
  }

  .auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 28px 0 42px;
  }

  .auth-page__inner {
    min-height: auto;
  }

  .auth-page-card h1 {
    font-size: 27px;
  }

  .auth-page-card__actions {
    display: grid;
  }

  .profile-panel {
    padding: 18px;
  }

  .profile-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-stats > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .profile-stats dd {
    text-align: left;
  }

  .profile-answered-breakdown {
    right: auto;
    left: 0;
  }

  .profile-section-heading {
    align-items: start;
    flex-direction: column;
  }

  .profile-summary h2,
  .profile-section-heading h2 {
    font-size: 23px;
  }

  /* Predane simulacije: na mobitelu redovi tablice postaju kartice umjesto
     široke tablice koja se vodoravno pomiče i izlazi iz vidljivog područja. */
  .profile-table-wrap {
    overflow-x: visible;
    border: 0;
  }

  .profile-table {
    min-width: 0;
  }

  .profile-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .profile-table,
  .profile-table tbody,
  .profile-table tr,
  .profile-table td {
    display: block;
    width: auto;
  }

  .profile-table tr {
    padding: 14px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--navy);
  }

  .profile-table tr.profile-table-row--collapsed[hidden] {
    display: none;
  }

  .profile-table tr + tr {
    margin-top: 12px;
  }

  .profile-table td {
    display: grid;
    grid-template-columns: minmax(82px, auto) minmax(0, 1fr);
    gap: 14px;
    align-items: baseline;
    padding: 7px 0;
    border-bottom: 0;
    border-top: 1px solid var(--line);
    text-align: left;
  }

  .profile-table td:first-child {
    border-top: 0;
  }

  .profile-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .masthead {
    min-height: auto;
    flex-wrap: wrap;
    gap: 0;
    padding: 6px 0 0;
  }

  .masthead__actions {
    width: 100%;
    flex-direction: row;
    align-self: stretch;
    align-items: center;
    justify-content: flex-start;
  }

  .brand {
    gap: 8px;
    width: 100%;
    padding: 4px 0 8px;
  }

  .brand__mark {
    width: 30px;
    height: 30px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand small {
    margin-top: 3px;
    font-size: 9px;
  }

  .main-nav__link {
    padding: 0 10px;
    font-size: 11px;
  }

  .main-nav {
    flex: 1 1 auto;
    width: 100%;
    min-height: 44px;
    align-self: auto;
    justify-content: space-between;
  }

  .page-heading {
    padding: 22px 0 32px;
  }

  .home-heading {
    padding: 16px 0 18px;
  }

  .auth-widget__button,
  .auth-widget__user,
  .auth-widget__status {
    min-width: 0;
    max-width: 112px;
  }

  @media (max-width: 360px) {
    .topbar__actions > a {
      display: none;
    }
  }

  .page-heading__grid {
    margin-top: 30px;
  }

  .home-heading .page-heading__grid {
    gap: 16px;
  }

  h1 {
    font-size: 38px;
  }

  .home-heading h1 {
    font-size: 22px;
  }

  .home-heading .lead {
    font-size: 14px;
  }

  .home-toolbar {
    padding-bottom: 14px;
  }

  .home-toolbar h2 {
    font-size: 20px;
  }

  .workspace-section {
    padding-bottom: 48px;
  }

  .home-information {
    padding: 18px 0 22px;
  }

  .home-information__intro h2 {
    font-size: 20px;
  }

  .home-information__topics {
    margin-top: 14px;
    padding-top: 14px;
    gap: 14px;
  }

  .home-information__source {
    margin-top: 16px;
    padding-top: 10px;
  }

  .subject-grid {
    grid-template-columns: 1fr;
  }

  .subject-card {
    grid-template-columns: 22px minmax(0, 1fr) 32px;
    gap: 8px;
    min-height: 64px;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .subject-card__action {
    width: 32px;
    height: 30px;
  }

  .subject-card__body strong {
    font-size: 15px;
  }

  .subject-card .subject-symbol {
    width: 22px;
    height: 22px;
  }

  .subject-page .practice-filters {
    display: none;
  }

  .subject-page__intro {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
  }

  .subject-page__intro--with-catalog {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }

  .subject-catalog-link {
    gap: 5px;
    padding: 6px 9px;
    font-size: 11px;
  }

  .subject-catalog-link svg {
    width: 13px;
    height: 13px;
  }

  .subject-catalog-link__label--full {
    display: none;
  }

  .subject-catalog-link__label--short {
    display: inline;
  }

  .subject-page__intro .back-link--home {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
  }

  .subject-page__intro .back-link__label,
  .subject-page__intro .back-link__icon--desktop {
    display: none;
  }

  .subject-page__intro .back-link__icon--mobile {
    display: block;
    width: 18px;
    height: 18px;
  }

  .subject-page__intro .subject-title-row {
    min-width: 0;
    gap: 6px;
    justify-content: flex-start;
  }

  .subject-page__intro .subject-symbol {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
  }

  .subject-page__intro .subject-symbol__icon {
    width: 20px;
    height: 20px;
  }

  .subject-page__intro .subject-title-row h2 {
    min-width: 0;
    font-size: clamp(16px, 5.2vw, 22px);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .practice-detail__heading h2 {
    font-size: 25px;
  }

  .practice-interactive-card {
    padding: 15px;
  }

  .practice-interactive-card__heading {
    display: block;
  }

  .practice-interactive-card__heading .status-badge {
    margin-top: 10px;
  }

  .practice-exam-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .medicine-admission .practice-exam-row {
    grid-template-columns: 1fr;
  }

  .medicine-admission__section-heading {
    display: block;
  }

  .medicine-admission__section-heading > p {
    margin-top: 5px;
  }

  .medicine-admission__materials + .medicine-admission__materials {
    margin-top: 34px;
  }

  .practice-exam-row__duration {
    text-align: left;
  }

  .practice-exam-row__actions {
    justify-content: stretch;
  }

  .practice-exam-row__actions .primary-button,
  .practice-exam-row__actions .secondary-button {
    flex: 1 1 0;
    min-width: 0;
  }

  .essay-task-panel,
  .essay-writing-panel {
    padding: 14px;
  }

  .essay-writing-panel__heading {
    display: grid;
  }

  .essay-photo-upload__button {
    width: 100%;
  }

  .essay-photo-preview {
    grid-template-columns: 1fr;
  }

  .essay-photo-preview img {
    width: 100%;
  }

  .archive-section {
    padding-bottom: 48px;
  }

  .practice-container {
    width: min(calc(100% - 28px), 1440px);
  }

  body.solver-page {
    overflow-x: hidden;
  }

  body.solver-page .practice-container {
    width: 100%;
  }

  .practice-filter-bar {
    display: block;
  }

  .practice-filter-bar .field {
    width: 100%;
  }

  .solver-header__footer .task-navigation {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding: 0;
    overflow: visible;
  }

  .solver-header__task-navigation .task-button {
    display: grid;
    max-width: none;
    min-height: 42px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 3px 12px;
    justify-content: stretch;
    justify-items: start;
    padding: 8px 10px;
    background: #f8fafc;
    border-color: var(--line-dark);
    text-align: left;
    white-space: normal;
  }

  .solver-header__task-navigation .task-button--active {
    color: var(--heading);
    background: var(--pale-blue);
    border-color: #94b4df;
    box-shadow: inset 3px 0 0 var(--blue);
  }

  .solver-header__task-navigation .task-button strong {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
  }

  .solver-header__task-navigation .task-button small {
    justify-self: end;
    padding: 2px 6px;
    background: var(--surface);
    border: 1px solid currentColor;
    font-size: 12px;
    line-height: 1;
  }

  .solver-header__task-navigation .task-button__grading {
    grid-column: 1 / -1;
    justify-self: start;
    flex-basis: auto;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
  }

  .task-type-pager {
    display: grid;
    grid-template-columns: 44px 44px;
    justify-content: space-between;
    gap: 0;
    padding: 0 14px;
  }

  .task-type-pager > span {
    width: 44px;
    height: 44px;
  }

  .task-type-pager__button {
    position: relative;
    width: 44px;
    height: 44px;
    max-width: none;
    min-width: 0;
    justify-content: center;
    gap: 0;
    padding: 0;
    overflow: visible;
    text-align: center;
  }

  .task-type-pager__button--next {
    justify-self: end;
    text-align: center;
  }

  .task-type-pager__copy {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .task-type-pager__icon {
    width: 22px;
    height: 22px;
  }

  .question-quickselect,
  .physics-quickselect {
    position: static;
    display: grid;
    padding: 0;
    background: var(--soft);
    border-color: var(--line-dark);
    box-shadow: none;
  }

  .question-quickselect__heading,
  .physics-quickselect__heading,
  .question-quickselect__list,
  .physics-quickselect__list {
    display: none;
  }

  .question-quickselect__tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 0;
    padding: 8px;
  }

  .question-jump {
    display: grid;
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  .question-jump span {
    color: var(--heading);
    font-size: 13px;
    font-weight: 700;
  }

  .question-jump select {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 5px 28px 5px 8px;
    color: var(--heading);
    background: var(--surface);
    border: 1px solid var(--line-dark);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
  }

  .question-jump select:focus {
    border-color: var(--blue);
    outline: 3px solid rgba(46, 93, 172, 0.18);
    outline-offset: 1px;
  }

  .question-quickselect__action {
    min-width: 0;
    min-height: 34px;
    padding: 6px 9px;
    background: var(--surface);
    font-size: 12px;
  }

  .question-quickselect__action span {
    display: none;
  }

  .question-quickselect__action-icon {
    width: 16px;
    height: 16px;
  }

  .question-quickselect__heading,
  .physics-quickselect__heading {
    align-self: center;
  }

  .question-quickselect__heading strong,
  .physics-quickselect__heading strong {
    font-size: 13px;
    line-height: 1.1;
  }

  .question-quickselect__list,
  .physics-quickselect__list {
    gap: 4px;
    min-width: 0;
    padding: 0;
    scrollbar-width: thin;
  }

  .question-quickselect__link,
  .physics-quickselect__link {
    width: 30px;
    min-height: 30px;
    flex-basis: 30px;
    background: var(--surface);
    font-size: 12px;
  }

  .question-quickselect__action {
    min-width: 0;
    min-height: 30px;
    padding: 6px 8px;
    background: var(--surface);
    font-size: 12px;
  }

  .physics-task-content-panel,
  .task-content-panel,
  .physics-source-list,
  .physics-source-question,
  .physics-source-question__body,
  .physics-source-figure,
  .pdf-source-figure {
    min-width: 0;
  }

  .physics-source-crop,
  .pdf-source-crop {
    max-width: 100%;
    min-width: 0;
  }

  .physics-source-crop img,
  .pdf-source-crop img {
    user-select: none;
  }

  body.solver-page .solver-question-layout,
  body.solver-page .physics-practice-layout {
    gap: 8px;
    margin-top: 10px;
  }

  body.solver-page .solver-question-main {
    gap: 10px;
  }

  body.solver-page .task-content-panel {
    border-right: 0;
    border-left: 0;
    overflow-x: clip;
  }

  body.solver-page .panel-heading {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px 10px;
    padding: 10px;
  }

  body.solver-page .panel-heading > div {
    min-width: 0;
  }

  body.solver-page .panel-heading h3 {
    font-size: 17px;
    line-height: 1.18;
  }

  body.solver-page .panel-heading small {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body.solver-page .task-source,
  body.solver-page .physics-source-list,
  body.solver-page .history-source-list,
  body.solver-page .pdf-source-list {
    padding-right: 0;
    padding-left: 0;
  }

  body.solver-page .task-source {
    padding-top: 12px;
    padding-bottom: 18px;
  }

  body.solver-page .pdf-source-list {
    gap: 12px;
  }

  body.solver-page .physics-source-question {
    padding-right: 8px;
    padding-left: 8px;
  }

  body.solver-page .physics-source-question--image {
    padding-right: 0;
    padding-left: 0;
  }

  body.solver-page .physics-source-question--image .physics-inline-response,
  body.solver-page .physics-source-question--image .physics-open-solution,
  body.solver-page .physics-source-question--image .physics-source-question__meta {
    margin-right: 8px;
    margin-left: 8px;
  }

  body.solver-page .physics-source-figure,
  body.solver-page .pdf-source-figure {
    width: 100%;
    overflow-x: hidden;
  }

  body.solver-page .physics-source-crop,
  body.solver-page .pdf-source-crop {
    width: min(100%, var(--crop-natural, 100%)) !important;
    max-width: 100%;
  }

  body.solver-page .english-source-question {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  body.solver-page {
    padding-bottom: var(--solver-sticky-footer-height, 0px);
  }

  .solver-sticky-footer__inner {
    display: grid;
    width: min(calc(100% - 28px), 1440px);
    gap: 7px;
    padding-top: 7px;
    padding-bottom: calc(7px + env(safe-area-inset-bottom));
  }

  .solver-sticky-footer .task-navigation {
    width: 100%;
    gap: 5px;
  }

  .solver-sticky-footer .task-button {
    min-width: max-content;
    flex: 0 0 auto;
    padding: 6px 7px;
    font-size: 12px;
  }

  .solver-sticky-footer__controls {
    width: 100%;
    justify-content: space-between;
  }

  .solver-sticky-footer__status {
    min-width: 0;
    text-align: left;
  }

  .solver-header__toolbar {
    align-items: center;
    flex-direction: row;
    gap: 4px;
    padding-top: 9px;
    padding-bottom: 9px;
    font-size: clamp(9px, 2.75vw, 12px);
  }

  .solver-header__downloads {
    min-width: 0;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .solver-header__back,
  .solver-header__downloads a {
    min-width: 0;
    min-height: 28px;
    flex: 0 0 auto;
    padding: 5px 6px;
    white-space: nowrap;
  }

  @media (max-width: 360px) {
    .solver-header__toolbar {
      gap: 2px;
      font-size: 8px;
    }

    .solver-header__downloads {
      gap: 2px;
    }

    .solver-header__back,
    .solver-header__downloads a {
      min-height: 26px;
      padding: 4px 3px;
    }
  }

  .solver-header__main {
    display: block;
    padding: 14px;
  }

  .solver-page .solver-header__toolbar,
  .solver-page .solver-header__main,
  .solver-page .solver-header__footer,
  .physics-solver-active .solver-header__toolbar,
  .physics-solver-active .solver-header__main,
  .physics-solver-active .solver-header__footer,
  .croatian-solver-active .solver-header__toolbar,
  .croatian-solver-active .solver-header__main,
  .croatian-solver-active .solver-header__footer {
    width: min(calc(100% - 28px), 1440px);
  }

  .solver-page .solver-header__footer,
  .physics-solver-active .solver-header__footer,
  .croatian-solver-active .solver-header__footer {
    padding-left: 0;
  }

  .solver-header__main h2 {
    font-size: 19px;
  }

  .solver-summary {
    margin-top: 14px;
    text-align: left;
  }

  .solver-summary__actions {
    flex-wrap: wrap;
  }

  .task-audio__heading {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .task-audio__heading small {
    text-align: left;
  }

  .audio-player {
    grid-template-columns: 32px minmax(70px, 1fr) auto auto auto;
    gap: 7px;
    padding: 6px 9px;
  }

  .audio-player__volume {
    display: none;
  }

  .croatian-pdf-frame {
    height: 62vh;
    min-height: 360px;
  }

  .answer-panel__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .results-heading {
    align-items: flex-end;
  }

  .results-heading h2 {
    font-size: 22px;
  }

  .exam-table th:nth-child(2),
  .exam-table td:nth-child(2) {
    display: none;
  }

  .exam-table th,
  .exam-table td {
    padding-right: 7px;
    padding-left: 7px;
  }

  .download-link {
    padding: 7px 8px;
  }

  .download-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .site-footer__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 12px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .site-footer__inner > p,
  .footer-meta {
    margin-top: 16px;
  }

  .footer-meta {
    margin-left: 0;
    text-align: left;
  }

  .footer-actions {
    margin: 16px 0 0;
  }
}

@media (max-width: 340px) {
  .subject-exam-table td.subject-exam-table__best-cell::before {
    display: none;
  }
}

@media (max-width: 420px) {
  .auth-page-card__brand {
    gap: 10px;
  }

  .auth-page-card__logo {
    width: 46px;
    height: 46px;
  }

  .auth-page-card h1 {
    font-size: 24px;
  }

  .subject-card {
    grid-template-columns: 22px minmax(0, 1fr) 32px;
  }

  .subject-card__body strong {
    font-size: 14px;
  }
}

/* AI maturni asistent (beta) */
.solver-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.solver-inline-actions .inline-check-button {
  margin-left: 0;
}

.ai-explain-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-radius: 0;
  cursor: pointer;
}

.ai-explain-button:hover {
  background: var(--pale-blue);
  border-color: var(--blue);
}

.ai-explain-button:focus-visible {
  outline: 3px solid rgba(46, 93, 172, 0.35);
  outline-offset: 2px;
}

.ai-explain-button__logo {
  width: 22px;
  height: 22px;
  display: block;
  border-radius: 0;
}

/* Login modal */
.ai-login-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ai-login-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 29, 77, 0.45);
}

.ai-login-modal__panel {
  position: relative;
  width: min(440px, 100%);
  background: var(--surface);
  border-radius: 8px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 29, 77, 0.28);
}

.ai-login-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.ai-login-modal__logo {
  border-radius: 6px;
  margin-bottom: 12px;
}

.ai-login-modal__panel h2 {
  margin: 0 0 8px;
  color: var(--heading);
  font-size: 20px;
}

.ai-login-modal__panel p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.ai-login-modal__action {
  display: inline-flex;
}

/* Bottom drawer */
.ai-drawer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.ai-drawer[hidden] {
  display: none;
}

.ai-drawer__inner {
  pointer-events: auto;
  width: 100%;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 0;
  box-shadow: 0 -16px 50px rgba(0, 29, 77, 0.26);
  border-top: 3px solid var(--blue);
  animation: ai-drawer-rise 0.22s ease-out;
}

@keyframes ai-drawer-rise {
  from {
    transform: translateY(24px);
    opacity: 0.4;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.ai-drawer__header,
.ai-drawer__body,
.ai-drawer__footer {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
}

.ai-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}

.ai-drawer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-drawer__logo {
  border-radius: 4px;
}

.ai-drawer__heading {
  display: flex;
  flex-direction: column;
}

.ai-drawer__heading strong {
  color: var(--heading);
  font-size: 16px;
}

.ai-drawer__subtitle {
  color: var(--muted);
  font-size: 13px;
}

.ai-drawer__close {
  border: 0;
  background: none;
  font-size: 30px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 6px;
}

.ai-drawer__close:hover {
  color: var(--heading);
}

.ai-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 24px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
}

/* Izdvojene (blokovske) LaTeX jednadžbe smiju vodoravno skrolati na uskim
   ekranima umjesto da razvuku ladicu. Inline formule prate veličinu teksta. */
.ai-drawer__body .katex {
  font-size: 1.05em;
}

.ai-drawer__body .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
  margin: 0.5em 0;
}

.ai-drawer__body strong.ai-correct {
  color: #14743a;
}

.ai-drawer__body strong.ai-wrong {
  color: #a8261c;
}

.ai-drawer__message {
  margin: 0;
}

.ai-drawer__message--error {
  color: #b3261e;
}

.ai-drawer__message--notice {
  color: #555;
}

/* Tri sive točkice koje skakuću dok asistent razmišlja */
.ai-thinking {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  height: 24px;
}

.ai-thinking span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-dark);
  animation: ai-thinking-bounce 1.2s infinite ease-in-out both;
}

.ai-thinking span:nth-child(2) {
  animation-delay: 0.16s;
}

.ai-thinking span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes ai-thinking-bounce {
  0%,
  70%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  35% {
    transform: translateY(-7px);
    opacity: 1;
  }
}

/* "razmišlja Ns" — brojač sekundi uz točkice dok odgovor još ne stiže. */
.ai-thinking-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-thinking__timer {
  color: var(--muted, #6b7280);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.ai-thinking__hint {
  margin: 8px 0 0;
  color: var(--muted, #6b7280);
  font-size: 0.78rem;
  opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
  .ai-thinking span {
    animation: ai-thinking-fade 1.2s infinite ease-in-out both;
  }
  @keyframes ai-thinking-fade {
    0%,
    100% {
      opacity: 0.35;
    }
    50% {
      opacity: 1;
    }
  }
}

.ai-drawer__footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--line);
}

.ai-drawer__disclaimer {
  margin: 0;
  margin-left: auto;
  max-width: 40ch;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.ai-drawer__report {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-dark);
  background: var(--surface);
  color: var(--muted);
  border-radius: 4px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ai-drawer__report-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-drawer__report:hover:not(:disabled) {
  border-color: #b3261e;
  color: #b3261e;
}

.ai-drawer__report:disabled {
  cursor: default;
  opacity: 0.6;
}

.ai-drawer__report-status {
  color: var(--muted);
  font-size: 13px;
}

.ai-drawer__regenerate {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-dark);
  background: var(--surface);
  color: var(--muted);
  border-radius: 4px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ai-drawer__regenerate[hidden] {
  display: none;
}

.ai-drawer__regenerate-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-drawer__regenerate:hover:not(:disabled) {
  border-color: var(--link);
  color: var(--link);
}

.ai-drawer__regenerate:disabled {
  cursor: default;
  opacity: 0.6;
}

@media (max-width: 600px) {
  .ai-drawer__inner {
    max-height: 82vh;
  }

  .ai-drawer__disclaimer {
    margin-left: 0;
    max-width: none;
    flex-basis: 100%;
    text-align: left;
  }
}

/* ==========================================================================
   Dark theme
   Opt-in via the toggle in profile settings; persisted in localStorage and
   applied early by analytics.js (window.AsistentTheme). Light mode is the
   default and is untouched: every rule below is scoped to [data-theme="dark"].
   The colour swaps lean on the role tokens (--surface/--heading/--link) so
   most of the site themes automatically; explicit blocks below cover the
   surfaces that use literal colours.
   ========================================================================== */
html[data-theme="dark"] {
  color-scheme: dark;

  /* text */
  --ink: #e6eaf2;
  --muted: #9aa6bd;
  --heading: #c9d6ef;
  --white: #eef2f8;        /* text that sits on accents (header, buttons…) */

  /* surfaces */
  --surface: #161c26;      /* panels, cards, inputs (was white) */
  --soft: #1e2532;         /* table headers, insets, disabled, empty states */
  --pale-blue: #1a2433;

  /* lines */
  --line: #2b3340;
  --line-dark: #3a4453;

  /* accents */
  --navy: #2c4a86;         /* navy accent: chips + 4px accent strips */
  --blue: #3a67bd;         /* button backgrounds (white text stays AA-readable) */
  --blue-dark: #305aa8;    /* button hover background */
  --link: #7aa2e6;         /* links / accent text */
  --link-dark: #9cbcf2;    /* link hover */

  /* dark-only semantic state tints */
  --d-inset: #1b2330;
  --d-hover: #232d3d;
  --d-ok-bg: #163021;
  --d-ok-text: #82d9a2;
  --d-no-bg: #371c1c;
  --d-no-text: #f0a6a6;
  --d-warn-bg: #34300f;
  --d-warn-text: #e3c071;
}

html[data-theme="dark"] body {
  background: #0f141c;     /* page is a touch darker than panels, for depth */
}

/* Header & footer keep a deep navy (the --navy accent value is too light for
   full-bleed bars), with light text. */
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .site-footer {
  background: #0c1626;
}

/* Neutral inset surfaces that used literal light blues/greys. */
html[data-theme="dark"] :is(
  .croatian-pdf-frame,
  .pdf-source-figure,
  .physics-open-solution__body,
  .physics-quickselect,
  .physics-source-option,
  .source-options__item,
  .solver-header__task-navigation .task-button,
  .croatian-completion-card__option--selected,
  .croatian-completion-popover__option--selected,
  .english-choice-popover__option--selected,
  .english-completion-card__option--selected,
  .english-choice-popover__option--used,
  .english-choice-popover__option--used strong,
  .math-open-question-group__heading,
  .history-open-feedback,
  .history-open-question__prompt,
  .history-open-question__heading span,
  .physics-source-question__meta span,
  .progress-meter,
  .question-quickselect__link--excluded,
  .excluded-task-notice,
  .subject-best-score--empty,
  .auth-page-card__user
) {
  background-color: var(--d-inset);
}

/* Hover/active inset states. */
html[data-theme="dark"] :is(
  .croatian-completion-blank:hover,
  .english-choice-blank:hover,
  .inline-check-button:hover,
  .auth-widget__button:hover,
  .subject-card--unavailable:hover .subject-card__action
) {
  background-color: var(--d-hover);
}

/* Re-light text that was a dark literal on those now-dark insets. */
html[data-theme="dark"] :is(
  .history-open-feedback,
  .history-open-question__prompt,
  .history-open-question__heading span,
  .physics-source-question__meta span
) {
  color: var(--ink);
}
html[data-theme="dark"] :is(
  .excluded-task-notice,
  .subject-best-score--empty,
  .subject-card--unavailable,
  .subject-card--unavailable:hover,
  .subject-card--unavailable:hover .subject-card__action
) {
  color: var(--muted);
}

/* Unavailable subject cards. */
html[data-theme="dark"] :is(
  .subject-card--unavailable,
  .subject-card--unavailable:hover
) {
  background-color: var(--d-inset);
}

/* Correct / green state tints. */
html[data-theme="dark"] :is(
  .answer-choice--correct input:checked + span,
  .croatian-completion-blank--correct,
  .croatian-completion-card__option--correct,
  .croatian-completion-row--correct,
  .english-choice-blank--correct,
  .english-completion-card__option--correct,
  .english-completion-chip--answer,
  .english-completion-row--correct,
  .english-inline-group-result--correct,
  .english-text-blank--correct,
  .physics-quickselect__link--correct,
  .art-matching-response__row--correct,
  .source-example,
  .status-badge--available
) {
  background-color: var(--d-ok-bg);
}
html[data-theme="dark"] :is(
  .answer-choice--correct input:checked + span,
  .croatian-completion-blank--correct,
  .english-choice-blank--correct,
  .english-completion-chip--answer,
  .english-text-blank--correct,
  .physics-quickselect__link--correct,
  .source-example,
  .status-badge--available
) {
  color: var(--d-ok-text);
}

/* Wrong / red state tints. */
html[data-theme="dark"] :is(
  .answer-choice--wrong input:checked + span,
  .croatian-completion-blank--wrong,
  .croatian-completion-card__option--wrong,
  .croatian-completion-row--wrong,
  .english-choice-blank--wrong,
  .english-completion-card__option--wrong,
  .english-completion-row--wrong,
  .english-inline-group-result--wrong,
  .english-text-blank--wrong,
  .physics-quickselect__link--wrong,
  .art-matching-response__row--wrong,
  .auth-page-card__message[data-tone="error"],
  .practice-notice--error
) {
  background-color: var(--d-no-bg);
}
html[data-theme="dark"] :is(
  .answer-choice--wrong input:checked + span,
  .croatian-completion-blank--wrong,
  .english-choice-blank--wrong,
  .english-text-blank--wrong,
  .physics-quickselect__link--wrong,
  .auth-page-card__message[data-tone="error"],
  .practice-notice--error
) {
  color: var(--d-no-text);
}

/* Amber / informational tints. */
html[data-theme="dark"] :is(
  .art-matching-response__row--unused,
  .source-gap
) {
  background-color: var(--d-warn-bg);
}
html[data-theme="dark"] .source-gap {
  color: var(--d-warn-text);
}

/* Keep unavailable exam rows subdued without a bright veil in dark mode. */
html[data-theme="dark"] .subject-exam-table__unavailable-label {
  color: var(--muted);
}

html[data-theme="dark"] .subject-exam-table__unavailable-label::before {
  background: rgb(22 28 38 / 96%);
}

/* Subject best-score badges: keep tint and text contrasting. */
html[data-theme="dark"] .subject-best-score--excellent {
  background-color: var(--d-ok-bg);
}
html[data-theme="dark"] .subject-best-score--good {
  background-color: #21300f;
}
html[data-theme="dark"] .subject-best-score--medium {
  background-color: var(--d-warn-bg);
}
html[data-theme="dark"] .subject-best-score--low {
  background-color: #35260f;
}
html[data-theme="dark"] .subject-best-score--poor {
  background-color: var(--d-no-bg);
}

/* Score / percentage tone text, brightened for dark backgrounds. */
html[data-theme="dark"] :is(.profile-percentage--excellent, .subject-best-score--excellent) {
  color: #4ade80;
}
html[data-theme="dark"] :is(.profile-percentage--good, .subject-best-score--good) {
  color: #9bd35a;
}
html[data-theme="dark"] :is(.profile-percentage--medium, .subject-best-score--medium) {
  color: #e0bf4a;
}
html[data-theme="dark"] :is(.profile-percentage--low, .subject-best-score--low) {
  color: #ef9f5a;
}
html[data-theme="dark"] :is(.profile-percentage--poor, .subject-best-score--poor) {
  color: #ef8a8a;
}

/* Grade distribution bars: brightened to match dark tone text above. */
html[data-theme="dark"] .exam-grade-chart__item--excellent .exam-grade-chart__bar {
  background: #4ade80;
}
html[data-theme="dark"] .exam-grade-chart__item--good .exam-grade-chart__bar {
  background: #9bd35a;
}
html[data-theme="dark"] .exam-grade-chart__item--medium .exam-grade-chart__bar {
  background: #e0bf4a;
}
html[data-theme="dark"] .exam-grade-chart__item--low .exam-grade-chart__bar {
  background: #ef9f5a;
}
html[data-theme="dark"] .exam-grade-chart__item--poor .exam-grade-chart__bar {
  background: #ef8a8a;
}

/* Level badge. */
html[data-theme="dark"] .level-badge--a {
  background-color: #21344f;
  color: var(--white);
}

/* Essay textarea (literal #fff). */
html[data-theme="dark"] .essay-textarea-field textarea {
  background: #12161f;
}

/* Skeleton / source-crop shimmer. */
html[data-theme="dark"] :is(.skeleton-block, .source-crop-segment) {
  background-color: #1d2632;
  background-image: linear-gradient(100deg, #1d2632 25%, #28323f 50%, #1d2632 75%);
}

/* Auth page background. */
html[data-theme="dark"] .auth-page {
  background: #0f141c;
}

/* Google sign-in button stays a light branded button (per Google guidance). */
html[data-theme="dark"] .auth-google-button {
  background: #fff;
  color: #202124;
  border-color: #dadce0;
}
html[data-theme="dark"] .auth-google-button:hover {
  background: #f1f3f4;
  color: #202124;
}
html[data-theme="dark"] .auth-google-button__mark {
  background: #fff;
}

/* ---- Theme toggle control (profile settings) -------------------------- */
.profile-settings__list {
  display: grid;
  gap: 4px;
}
.profile-settings__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.profile-settings__row:first-child {
  padding-top: 0;
}
.profile-settings__row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.profile-settings__label {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-settings__icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  color: var(--muted);
}
.profile-settings__hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.theme-switch {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 26px;
  padding: 0;
  background: var(--soft);
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.theme-switch__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 0.15s ease, background 0.15s ease;
}
.theme-switch[aria-checked="true"] {
  background: var(--blue);
  border-color: var(--blue);
}
.theme-switch[aria-checked="true"] .theme-switch__knob {
  background: #fff;
  transform: translateX(22px);
}
.theme-switch:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Diskretne sporedne akcije na dnu profila (brisanje napretka, odjava). */
.profile-minor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
  padding: 2px 0 6px;
}
.profile-minor__link {
  padding: 2px 0;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.profile-minor__link:hover {
  color: var(--ink);
}
.profile-minor__link--danger {
  color: #8f1d1d;
}
.profile-minor__link--danger:hover {
  color: #6f1414;
}
.profile-minor__link:disabled {
  color: var(--muted);
  text-decoration: none;
  cursor: default;
  opacity: 0.7;
}
.profile-minor__link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}
.profile-minor__sep {
  color: var(--line-dark);
  font-size: 13px;
}
.billing-history-link {
  display: block;
  width: fit-content;
  margin: 11px 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.billing-history-link[hidden] { display: none; }
.billing-actions .secondary-button[hidden] { display: none; }
.billing-history-link:hover { color: var(--ink); }
.billing-history-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
html[data-theme="dark"] .profile-minor__link--danger {
  color: #ef8a8a;
}
html[data-theme="dark"] .profile-minor__link--danger:hover {
  color: #f4a6a6;
}

/* --- Dark-mode solver polish ------------------------------------------- */

/* Sticky footer used a hardcoded near-white background (literal rgba, so the
   --white re-tokenisation didn't reach it). Give it the same deep chrome as
   the header/footer, lifted off the page with an upward shadow. */
html[data-theme="dark"] .solver-sticky-footer {
  background: #0c1626;
  box-shadow: 0 -6px 22px rgba(0, 0, 0, 0.5);
}

/* Active / hovered task tab: replace the hardcoded light-blue border. */
html[data-theme="dark"] :is(
  .task-button:hover,
  .task-button--active,
  .task-type-pager__button:hover
) {
  border-color: var(--blue);
}

/* Official exam crops stay faithful white "paper" (never inverted — it would
   ruin diagrams, scores and colour). Present them as sheets on the dark
   workspace: rounded corners + soft shadow, and a touch less glare. The
   shadow/radius go on the crop container; individual segments of a segmented
   crop must stay seamless, so they aren't framed on their own. */
html[data-theme="dark"] :is(.pdf-source-crop, .physics-source-crop) {
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 28px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] :is(
  .pdf-source-crop,
  .physics-source-crop,
  .source-crop-segment
) img {
  filter: brightness(0.9);
}

/* Administrator crop editor uses the original, full PDF page image. */
.crop-edit-button { margin-top: .4rem; font-size: .8rem; }
.crop-editor { width: min(1100px, 96vw); max-height: 96dvh; padding: 1rem; border: 1px solid #cbd5e1; border-radius: 8px; color: #172b4d; }
.crop-editor::backdrop { background: #0b1933bb; }
.crop-editor p { margin: .5rem 0; font-size: .85rem; }
.crop-editor-toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: .4rem 0; }
.crop-editor-toolbar > :first-child { margin-right: auto; }
.crop-editor button { cursor: pointer; padding: .4rem .7rem; }
.crop-editor-viewport { height: 56dvh; overflow: auto; background: #dce2e9; overscroll-behavior: contain; }
.crop-editor-page { position: relative; }
.crop-editor-page > img { display: block; width: 100%; height: 100%; max-width: none; }
.crop-editor-box { position: absolute; border: 2px solid #1464d2; background: #1464d20c; box-shadow: 0 0 0 9999px #172b4d44; cursor: move; touch-action: none; box-sizing: border-box; }
.crop-editor-page { overflow: hidden; }
.crop-editor-box > span { position: absolute; width: 16px; height: 16px; border: 2px solid white; background: #1464d2; }
.crop-editor-box [data-corner=nw] { left: -5px; top: -5px; cursor: nwse-resize; }
.crop-editor-box [data-corner=ne] { right: -5px; top: -5px; cursor: nesw-resize; }
.crop-editor-box [data-corner=sw] { left: -5px; bottom: -5px; cursor: nesw-resize; }
.crop-editor-box [data-corner=se] { right: -5px; bottom: -5px; cursor: nwse-resize; }
.crop-editor-fields { display: flex; flex-wrap: wrap; gap: .8rem; margin: .6rem 0; }
.crop-editor-fields label { display: grid; font-size: .8rem; gap: .2rem; }
.crop-editor-fields input { width: 6rem; padding: .3rem; }
@media (max-width: 600px) {
  .crop-editor-viewport { height: 38dvh; }
  .crop-editor { padding: .75rem; }
  .crop-editor-fields { gap: .4rem; }
  .crop-editor-fields input { width: 4.1rem; }
}

/* Remembered subject level filters, shared with profile preferences. */
.subject-level-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
#subject-level-label { font-weight: 700; }
.profile-level-preferences { margin-top: 20px; }
.profile-level-preferences h3 { margin: 0 0 6px; }
.profile-level-preferences .profile-settings__row {
  flex-wrap: nowrap;
  gap: 10px;
  padding: 8px 0;
}
.profile-level-preferences .profile-settings__label { font-size: 14px; }
.level-options {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(3, 40px);
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.level-options::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: 40px;
  border-radius: 3px;
  background: var(--blue);
  pointer-events: none;
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.level-options:has(input[value="A"]:checked)::before { transform: translateX(42px); }
.level-options:has(input[value="B"]:checked)::before { transform: translateX(84px); }
.level-option { position: relative; cursor: pointer; }
.level-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.level-option span {
  display: block;
  min-width: 34px;
  padding: 6px 8px;
  border-radius: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.level-option span { transition: color 160ms ease; }
.level-option input:checked + span { color: #fff; }
.level-option input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }

.profile-level-preferences .subject-symbol { width: 24px; height: 24px; }
@media (prefers-reduced-motion: reduce) {
  .level-options::before,
  .level-option span { transition: none; }
}
