:root, .quiz-preview[data-preview-theme="light"] {
  color-scheme: light;
  --bg: #edf2fa;
  --surface: #ffffff;
  --inset: #e1e9f6;
  --ink: #14213b;
  --muted: #475670;
  --line: #c2cde0;
  --control-line: #71819c;
  --accent: #4830a8;
  --selected: #e8e0ff;
  --action: #5431c4;
  --action-hover: #412398;
  --focus: #5734c1;
  --shadow: 0 3px 5px #21365f0c, 0 12px 25px #21365f0b;
  --stage: #161c37;
  --stage-ink: #f8f6ff;
  --stage-muted: #e3ddfa;
  --stage-focus: #a7f4e1;
  --stage-grid: #c8afff56;
  --stage-glow: #6c49d66b;
  --stage-gradient: linear-gradient(123deg, var(--stage) 17%, #28204e 61%, #36216e);
}

:root[data-theme="dark"], .quiz-preview[data-preview-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1020;
  --surface: #172238;
  --inset: #10192c;
  --ink: #f5f7ff;
  --muted: #bcc9e2;
  --line: #435575;
  --control-line: #65799b;
  --accent: #d0bfff;
  --selected: #382b60;
  --action: #6d4adb;
  --action-hover: #5d37d4;
  --focus: #c6b0ff;
  --shadow: 0 3px 7px #03061242, 0 13px 28px #0306123a;
  --stage: #141731;
  --stage-glow: #7351df58;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.wrap { margin-inline: clamp(16px, 2.5vw, 64px); }
.bar.wrap { margin-inline: clamp(16px, 2vw, 48px); }
.site-header {
  --surface: #1c2842;
  --ink: #f5f7ff;
  --muted: #c7d3eb;
  --line: #536482;
  --accent: #dccfff;
  --selected: #382b60;
  --focus: #d9c8ff;
  background: #111b32;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  box-shadow: 0 3px 14px #080e2440;
}
.bar { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 22px; line-height: 1.1; font-weight: 800; }
.brand small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; margin-bottom: 5px; }
.brand-mark { display: block; flex: none; width: 42px; height: 42px; object-fit: contain; }
.controls { display: flex; gap: 8px; }
.language-picker { position: relative; }
.language-picker summary, .header-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: .86rem;
  font-weight: 750;
  cursor: pointer;
}
.language-picker summary { list-style: none; }
.language-picker summary::-webkit-details-marker { display: none; }
.language-picker summary:hover, .language-picker[open] summary, .header-theme:hover {
  border-color: var(--accent);
  background: var(--selected);
}
.language-picker summary svg:first-child { width: 19px; height: 19px; color: var(--accent); }
.language-picker summary svg:last-child { width: 14px; height: 14px; color: var(--muted); }
.language-picker[open] summary svg:last-child { transform: rotate(180deg); }
.language-menu {
  position: absolute;
  z-index: 5;
  inset: calc(100% + 7px) 0 auto auto;
  display: grid;
  gap: 4px;
  min-width: min(195px, calc(100vw - 28px));
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #172238;
  box-shadow: 0 12px 28px #04081b85;
}
.language-menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 650;
}
.language-menu a:hover, .language-menu a[aria-current="page"] { background: var(--selected); color: var(--accent); }
.language-menu a:focus-visible { outline-offset: -2px; }
.language-menu a svg { margin-inline-start: auto; width: 16px; height: 16px; }
.language-code { padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: .72rem; font-weight: 750; }
.header-theme { padding: 0 10px; }
.header-theme .edutest-icon { color: var(--accent); }

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr);
  align-items: center;
  min-height: 350px;
  overflow: hidden;
  margin-block: clamp(18px, 2.9vw, 38px) clamp(28px, 3.5vw, 48px);
  padding: clamp(28px, 4.2vw, 72px);
  border-radius: 26px;
  border: 1px solid #6752a785;
  background: radial-gradient(ellipse at 80% 50%, var(--stage-glow), transparent 49%), var(--stage-gradient);
  color: var(--stage-ink);
  box-shadow: var(--shadow);
}
.hero-content { max-width: 770px; }
.eyebrow { margin: 0 0 12px; font-weight: 750; font-size: .83rem; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3 { font-weight: 790; line-height: 1.08; letter-spacing: -.035em; margin: 0; }
h1 { font-size: clamp(2.35rem, 5.5vw, 4.3rem); overflow-wrap: anywhere; }
.hero h1 { font-size: clamp(2.45rem, 4.7vw, 5.1rem); line-height: 1.02; letter-spacing: -.055em; text-wrap: balance; }
.hero p { max-width: 45ch; margin: 16px 0 22px; color: var(--stage-muted); font-size: clamp(1rem, 1.5vw, 1.18rem); }
.hero-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-radius: 11px;
  background: #bfeee4;
  color: #112c34;
  font-weight: 720;
}
.hero-link:hover { background: #d5fbf1; }
.hero-link:focus-visible { outline-color: var(--stage-focus); }
.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 240px;
}
.hero-art::before {
  position: absolute;
  z-index: -1;
  inset: -100px -100px -100px -10%;
  content: "";
  background: radial-gradient(circle, var(--stage-grid) 1.5px, transparent 1.8px) 0 0 / 17px 17px;
  mask-image: linear-gradient(90deg, transparent, #000 25%);
}
.hero-sheet {
  --paper-line: #b5a4e8;
  display: grid;
  gap: 17px;
  width: clamp(205px, 20vw, 306px);
  padding: clamp(20px, 2.4vw, 34px);
  border: 1px solid #e1d4ff;
  border-radius: 14px;
  color: #523aa4;
  background: linear-gradient(153deg, #fff 10%, #e8dcff 88%);
  box-shadow: 10px 11px 0 #9677de, 21px 22px 0 #5138a5, 28px 32px 28px #0c092c7a;
  transform: perspective(740px) rotateY(-12deg) rotateX(11deg) rotateZ(-11deg);
}
.hero-sheet-head, .hero-sheet-row { display: grid; align-items: center; gap: 10px; }
.hero-sheet-head { grid-template-columns: auto 1fr; }
.hero-sheet-head b { font: 700 clamp(30px, 3.4vw, 52px)/1 Georgia, serif; }
.hero-sheet-head span, .hero-sheet-row span { height: 4px; width: 73%; border-radius: 6px; background: var(--paper-line); }
.hero-sheet-row { grid-template-columns: 1fr repeat(3, auto); }
.hero-sheet-row i { height: clamp(12px, 1.15vw, 18px); aspect-ratio: 1; border: 2px solid var(--paper-line); border-radius: 50%; }
.hero-sheet-row:nth-child(2) i:nth-child(2),
.hero-sheet-row:nth-child(3) i:nth-child(3),
.hero-sheet-row:nth-child(4) i:nth-child(4) { background: #6849bf; border-color: #6849bf; }
.hero-stamp {
  position: absolute;
  right: calc(50% - clamp(102px, 11vw, 167px));
  bottom: 10%;
  display: grid;
  place-items: center;
  width: clamp(52px, 5vw, 76px);
  aspect-ratio: 1;
  border: 3px solid #d5fff5;
  border-radius: 18px;
  background: linear-gradient(145deg, #b7f5e8, #66c5bb);
  color: #143a42;
  box-shadow: 0 8px 18px #0e142d63;
  font-size: clamp(23px, 3vw, 36px);
  transform: rotate(11deg);
}
.catalog { padding-bottom: 64px; scroll-margin-top: 16px; }
.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 28px; margin-bottom: 22px; }
.section-header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); }
.preview { display: inline-block; background: var(--selected); color: var(--accent); border-radius: 999px; padding: 5px 12px; font-size: .81rem; font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; align-items: start; gap: 10px; }
.filter-picker { position: relative; width: 168px; min-width: 0; }
.filter-picker[open] { z-index: 2; }
.filter-picker summary, .filters button {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 15px;
  cursor: pointer;
}
.filter-picker summary {
  justify-content: space-between;
  gap: 14px;
  list-style: none;
  background: var(--surface);
  border-color: var(--control-line);
  font-weight: 650;
}
.filter-picker summary::-webkit-details-marker { display: none; }
.filter-picker[open] summary, .filter-picker summary:hover { border-color: var(--accent); }
.filter-chevron {
  width: 8px;
  height: 8px;
  flex: none;
  margin: -4px 3px 0 0;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.filter-picker[open] .filter-chevron { transform: rotate(225deg); margin-top: 4px; }
.filter-options {
  position: absolute;
  inset: calc(100% + 6px) 0 auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgb(0 0 0 / 18%);
}
.filter-options label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.filter-options label:hover, .filter-options label:has(input:checked) {
  background: var(--selected);
  color: var(--accent);
}
.filter-options label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.filter-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filter-check { visibility: hidden; font-weight: 800; }
.filter-options input:checked ~ .filter-check { visibility: visible; }
.filters button {
  justify-content: center;
  background: var(--action);
  border-color: var(--action);
  color: #fff;
  font-weight: 700;
}
.filters button:hover { background: var(--action-hover); border-color: var(--action-hover); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card {
  --subject-tint: #eee8ff;
  --subject-ink: #4e35a2;
  --subject-edge: #8055d2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(16px, 2vw, 26px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--subject-edge);
  border-radius: 17px;
  box-shadow: var(--shadow);
}
.card.english { --subject-tint: #dff3ea; --subject-ink: #195940; --subject-edge: #318667; }
.card.physics { --subject-tint: #fbe9db; --subject-ink: #7d411c; --subject-edge: #b96628; }
[data-theme="dark"] .card { --subject-tint: #352953; --subject-ink: #d5c2fc; --subject-edge: #a284f1; }
[data-theme="dark"] .card.english { --subject-tint: #223e35; --subject-ink: #a4e4cc; --subject-edge: #63c6a0; }
[data-theme="dark"] .card.physics { --subject-tint: #4b332b; --subject-ink: #ffc7a6; --subject-edge: #e29861; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-symbol {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 15px;
  background: var(--subject-tint);
  color: var(--subject-ink);
  font: 700 29px/1 Georgia, serif;
}
.card-price { padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink); background: var(--inset); font-size: .81rem; font-weight: 700; }
.card-body { margin-block: 15px 17px; }
.card-subject { color: var(--subject-ink); font-size: .85rem; font-weight: 750; }
h3 { margin-block: 5px 13px; font-size: clamp(1.15rem, 1.65vw, 1.45rem); overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 15px; color: var(--muted); font-size: .88rem; }
.card-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 11px; margin-top: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--selected); color: var(--accent); font-weight: 720; }
.card-link:hover, .back:hover { text-decoration: underline; }
.notice, .detail-panel { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); padding: clamp(20px, 5vw, 56px); }
.detail { padding-block: 44px 72px; }
.back { color: var(--accent); display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 12px; }
.detail-panel .eyebrow { color: var(--accent); }
.detail-panel .meta { margin-block: 22px; }
@media (min-width: 2000px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 930px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { min-height: 290px; grid-template-columns: minmax(0, 1.6fr) minmax(210px, 1fr); }
  .hero-art { min-height: 210px; }
}
@media (max-width: 570px) {
  .filter-picker { flex: 1 1 165px; }
  .bar { min-height: 68px; gap: 8px; }
  .brand { gap: 7px; font-size: 19px; }
  .brand-mark { width: 34px; height: 34px; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; border-radius: 18px; }
  .hero h1 { text-wrap: pretty; }
  .hero-art { display: none; }
  .filters { width: 100%; }
  .filters button { flex: 1 0 auto; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }

}
@media (max-width: 360px) {
  .bar { flex-wrap: wrap; padding-block: 8px; }
  .brand { font-size: 17px; gap: 6px; }
  .brand-mark { width: 28px; height: 32px; }
  .controls { gap: 4px; }
}

.site-header .bar { flex-wrap: wrap; justify-content: flex-start; }
.site-header .controls { margin-inline-start: auto; }
.account-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.account-nav span { overflow-wrap: anywhere; }
.account-nav a, .account-nav button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--accent);
  font-weight: 700;
}
.account-nav button, .account-register { border: 1px solid var(--line); background: var(--selected); cursor: pointer; }
.site-header .account-register { background: #bfeee4; border-color: #bfeee4; color: #112c34; }
.site-header .account-register:hover { background: #d5fbf1; }
.auth-main { padding-block: clamp(24px, 6vw, 80px); }
.auth-panel {
  margin-inline: auto;
  width: min(100%, 520px);
  padding: clamp(20px, 5vw, 44px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}
.auth-panel h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.auth-form { display: grid; gap: 16px; margin-top: 24px; }
.auth-form label { display: grid; gap: 6px; min-width: 0; font-weight: 650; }
.auth-form input {
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--control-line);
  border-radius: 10px;
  background: var(--inset);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
.auth-names { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 12px; }
.auth-submit { min-height: 48px; padding: 10px 16px; border: 0; border-radius: 10px; background: var(--action); color: white; font-weight: 750; cursor: pointer; }
.auth-submit:hover { background: var(--action-hover); }
.auth-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; color: var(--accent); }
.auth-links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; }
.auth-error, .auth-status { padding: 10px 12px; border-radius: 10px; background: var(--selected); }
.auth-error { border-inline-start: 3px solid #e36767; }
@media (max-width: 570px) {
  .site-header .bar { padding-block: 8px; }
  .account-nav { width: 100%; }
}

/* Account pages */
.auth-layout {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(360px, 1fr);
  max-width: 960px;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-illustration {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 44px;
  min-height: 420px;
  padding: 38px;
  color: #f3f0ff;
  background: radial-gradient(circle, var(--stage-grid) 1px, transparent 1.5px) 0 0 / 19px 19px, var(--stage-gradient);
}
.auth-illustration a { padding: 10px 15px; border-radius: 10px; background: #342279; font-weight: 700; }
.auth-illustration a span { margin-inline-start: 6px; }
.auth-illustration a:focus-visible { outline-color: white; }
.auth-paper {
  display: grid;
  gap: 16px;
  width: clamp(195px, 20vw, 260px);
  padding: 24px;
  border-radius: 16px 20px 22px 16px;
  background: linear-gradient(153deg, #fff, #e5d8ff);
  box-shadow: 12px 12px 0 #9579dc, 24px 24px 0 #533b9b, 28px 29px 26px #0c092c7a;
  color: #3c2a8e;
  transform: rotate(-8deg);
}
.auth-paper-heading, .auth-paper i { display: grid; align-items: center; gap: 10px; }
.auth-paper-heading { grid-template-columns: 38px 1fr; }
.auth-paper-heading b { font: 700 32px Georgia, serif; }
.auth-paper-heading span { height: 5px; width: 75%; border-radius: 6px; background: #a895e3; }
.auth-paper i { grid-template-columns: 1fr repeat(3, 1fr); font: normal .82rem system-ui, sans-serif; }
.auth-paper i span { width: 15px; height: 15px; border: 2px solid #a895e3; border-radius: 50%; }
.auth-paper i:nth-child(2) span:nth-child(2),
.auth-paper i:nth-child(3) span:nth-child(3),
.auth-paper i:nth-child(4) span:nth-child(4) { background: #5740b3; border-color: #5740b3; }
.auth-layout .auth-panel { width: 100%; padding: clamp(22px, 5vw, 54px); border: 0; border-radius: 0; }
.auth-panel h1 { letter-spacing: -.045em; }
.auth-methods { display: flex; gap: 4px; margin-top: 22px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--bg); }
.auth-methods a { flex: 1; display: grid; place-items: center; min-height: 44px; border-radius: 9px; color: var(--muted); font-weight: 700; }
.auth-methods a[aria-current="page"] { color: var(--accent); background: var(--surface); box-shadow: 0 1px 4px #18142922; }
.auth-form input:focus { border-color: var(--accent); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--muted); font-size: .86rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--control-line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.auth-google:hover { border-color: var(--accent); }
.auth-google span { font-weight: 850; color: var(--accent); }
@media (max-width: 730px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); max-width: 500px; border-radius: 20px; }
  .auth-illustration { display: none; }
}

.auth-field { display: grid; gap: 6px; min-width: 0; }
.auth-input-shell {
  display: flex;
  align-items: center;
  min-height: 52px;
  min-width: 0;
  border: 1px solid var(--control-line);
  border-radius: 12px;
  background: var(--inset);
}
.auth-input-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--selected);
}
.auth-form .auth-input-shell input {
  flex: 1 1 0;
  width: 0;
  min-height: 50px;
  border: 0;
  outline: 0;
  background: transparent;
}
.auth-input-shell input::placeholder { color: var(--muted); opacity: .9; }
.auth-phone-prefix {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding-inline: 12px;
  border-inline-end: 1px solid var(--line);
  color: var(--ink);
  font-size: .92rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.auth-uz-flag {
  position: relative;
  width: 25px;
  height: 15px;
  overflow: hidden;
  border-radius: 3px;
  background: linear-gradient(#159ac4 32%, #d72c3b 32% 39%, #fff 39% 61%, #d72c3b 61% 68%, #23a65a 68%);
  box-shadow: 0 0 0 1px #11182720;
}
.auth-uz-flag::before {
  position: absolute;
  inset: 1px auto auto 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  box-shadow: -1px .5px 0 white;
  content: "";
}
.auth-uz-flag::after {
  position: absolute;
  top: 1px;
  left: 6px;
  width: 1px;
  height: 1px;
  border-radius: 50%;
  background: white;
  box-shadow: 2px 0 white, 4px 0 white, -1px 1.5px white, 1px 1.5px white, 3px 1.5px white, 5px 1.5px white, -2px 3px white, 0 3px white, 2px 3px white, 4px 3px white, 6px 3px white;
  content: "";
}
.auth-field-icon { position: relative; flex: none; margin-inline-start: 14px; color: var(--muted); }
.auth-envelope { width: 17px; height: 13px; border: 1.5px solid currentColor; border-radius: 3px; }
.auth-envelope::after {
  position: absolute;
  top: -1px;
  left: 3px;
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  content: "";
}
.auth-lock { width: 15px; height: 11px; margin-top: 5px; border: 1.5px solid currentColor; border-radius: 3px; }
.auth-lock::before {
  position: absolute;
  inset: -7px 2px auto;
  height: 7px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  content: "";
}
.auth-password-toggle {
  flex: none;
  width: 44px;
  height: 44px;
  margin-inline: 0 3px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.auth-password-toggle:not([hidden]) { display: grid; place-items: center; }
.auth-password-toggle:hover, .auth-password-toggle[aria-pressed="true"] { background: var(--selected); color: var(--accent); }
.auth-password-toggle:focus-visible { outline-offset: -2px; }
.auth-eye {
  position: relative;
  display: grid;
  place-items: center;
  width: 18px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 65% 65%;
}
.auth-eye::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.auth-password-toggle[aria-pressed="true"] .auth-eye::after {
  position: absolute;
  width: 21px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(-37deg);
  content: "";
}

.edutest-icon { display: block; width: 20px; height: 20px; flex: none; }
.account-nav .account-logout {
  --logout-bg: #3b222c;
  --logout-hover: #502a39;
  --logout-line: #985869;
  --logout-ink: #ffc1cd;
  gap: 7px;
  border-color: var(--logout-line);
  background: var(--logout-bg);
  color: var(--logout-ink);
}
.account-nav .account-logout:hover { background: var(--logout-hover); }
.account-nav .account-logout .edutest-icon { width: 19px; height: 19px; }

.detail-profile-notice {
  max-width: 62ch;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.detail-profile-notice p { margin: 0 0 6px; color: var(--muted); }
.detail-profile-notice a { color: var(--accent); font-weight: 750; text-decoration: underline; }

.account-nav .account-notifications {
  position: relative;
  justify-content: center;
  width: 44px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}
.account-nav .account-notifications:hover { border-color: var(--accent); background: var(--selected); }
.edutest-count {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 19px;
  min-height: 19px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
}
.account-notifications .edutest-count { position: absolute; top: -5px; right: -6px; box-shadow: 0 0 0 2px var(--surface); }
.edutest-count[hidden] { display: none; }

.market-filters { max-width: 100%; }
.market-search, .market-price-filter {
  min-height: 48px;
  max-width: 100%;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--control-line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.market-search { width: min(100%, 231px); }
.market-search::placeholder { color: var(--muted); }
.market-price-filter { cursor: pointer; }
.market-cover { display: block; width: 100%; aspect-ratio: 16 / 8; object-fit: cover; border-radius: 10px; margin-bottom: 13px; }
.market-paid { color: var(--accent); background: var(--selected); }
.market-summary, .market-byline { margin: 0 0 8px; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.market-byline { font-size: .83rem; }
.market-pages { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 19px; }
.market-pages a { padding: 9px 12px; border-radius: 9px; background: var(--selected); color: var(--accent); font-weight: 700; }
.market-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 290px); align-items: start; gap: 20px; }
.market-detail h1 { font-size: clamp(2rem, 4vw, 3.6rem); }
.market-detail-summary { max-width: 62ch; font-size: 1.12rem; font-weight: 650; }
.market-detail-description { max-width: 70ch; color: var(--muted); overflow-wrap: anywhere; }
.market-purchase { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--inset); }
.market-purchase-price { margin: 0 0 8px; font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 800; overflow-wrap: anywhere; }
.market-purchase-price small { color: var(--muted); font-size: .9rem; }
.market-primary { display: inline-flex; min-height: 44px; align-items: center; padding: 9px 14px; border: 0; border-radius: 9px; background: var(--action); color: #fff; font-weight: 700; cursor: pointer; overflow-wrap: anywhere; }
.market-primary:hover { background: var(--action-hover); }
.market-purchase form, .market-purchase .market-primary { margin-top: 8px; }
.market-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 154px), 1fr)); gap: 8px; }
.market-facts div { min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.market-facts dt { color: var(--muted); font-size: .8rem; }
.market-facts dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.market-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.market-tags li { padding: 3px 9px; border-radius: 99px; background: var(--selected); color: var(--accent); font-size: .82rem; overflow-wrap: anywhere; }
@media (max-width: 650px) {
  .market-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .market-search { width: 100%; }
}
.market-facts dd a { color: var(--accent); text-decoration: underline; }
.market-author { margin-bottom: 20px; }
.market-author h1 { font-size: clamp(2rem, 4vw, 3.6rem); }

.account-nav .account-dashboard {
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.account-nav .account-dashboard:hover { border-color: var(--accent); background: var(--selected); }
.account-nav .account-dashboard .edutest-icon { width: 19px; height: 19px; }
@media (max-width: 570px) {
  .account-nav .account-dashboard { width: 44px; justify-content: center; padding: 0; }
  .account-dashboard > span { display: none; }
}

.auth-form .auth-code-input {
  width: 100%;
  min-height: 64px;
  padding-inline: .8rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--surface);
  color: var(--ink);
  font: 750 clamp(1.45rem, 5vw, 2rem) / 1.2 ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: .35em;
  text-align: center;
}
.auth-form .auth-code-input::placeholder {
  color: var(--muted);
  opacity: .55;
}
.auth-form .auth-code-input:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.auth-recovery {
  display: grid;
  gap: .55rem;
  margin-block: 1.35rem;
}
.auth-recovery h2 {
  margin: 0 0 .3rem;
  font-size: 1rem;
}
.auth-recovery a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--surface);
  color: var(--ink);
}
.auth-recovery a:hover, .auth-recovery a:focus-visible {
  border-color: var(--accent);
  background: var(--selected);
}
.auth-recovery strong, .auth-recovery small { display: block; overflow-wrap: anywhere; }
.auth-recovery small { margin-top: .2rem; color: var(--muted); }
.auth-recovery-icon {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: .65rem;
  background: var(--selected);
  color: var(--accent);
}
.auth-recovery-icon svg { width: 1.1rem; height: 1.1rem; }

.auth-input-shell:has(input[readonly]) {
  background: var(--selected);
}

.header-mobile-menu { display: none; }
@media (max-width: 570px) {
  .site-header .bar.wrap { margin-inline: 12px; min-height: 60px; gap: 5px; padding-block: 6px; flex-wrap: nowrap; }
  .site-header .brand { margin-inline-end: auto; min-width: 0; white-space: nowrap; }
  .site-header .brand-mark { width: 29px; height: 32px; flex: 0 0 auto; }
  .site-header .brand small { font-size: .625rem; }
  .site-header .controls, .site-header .header-desktop-logout, .site-header .account-nav:not(.account-nav-signed-in) { display: none; }
  .site-header .account-nav-signed-in { width: auto; flex: 0 0 auto; flex-wrap: nowrap; gap: 5px; }
  .site-header .account-dashboard, .site-header .account-notifications, .header-mobile-menu > summary {
    display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; padding: 0;
    border: 1px solid var(--line); border-radius: .7rem; color: var(--accent); background: var(--surface);
  }
  .header-mobile-menu { display: block; position: relative; }
  .header-mobile-menu > summary { list-style: none; cursor: pointer; }
  .header-mobile-menu > summary::-webkit-details-marker { display: none; }
  .header-mobile-menu[open] > summary { background: var(--selected); }
  .header-mobile-menu > summary svg, .header-mobile-action svg { width: 1.15rem; height: 1.15rem; }
  .header-mobile-panel {
    position: absolute; z-index: 20; inset-inline-end: 0; top: calc(100% + .4rem);
    display: grid; gap: .4rem; width: min(17rem, calc(100vw - 24px));
    padding: .55rem; border: 1px solid var(--line); border-radius: .85rem;
    background: var(--surface); box-shadow: var(--shadow);
  }
  .header-mobile-languages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem; border-bottom: 1px solid var(--line); padding-bottom: .45rem; }
  .header-mobile-languages a, .header-mobile-action {
    display: flex; align-items: center; min-height: 44px; gap: .55rem; padding: .45rem .55rem;
    border: 0; border-radius: .5rem; background: transparent; color: var(--ink); font: inherit; font-weight: 700;
  }
  .header-mobile-languages a { justify-content: center; padding-inline: .2rem; font-size: .78rem; }
  .header-mobile-languages a[aria-current], .header-mobile-languages a:hover, .header-mobile-action:hover { background: var(--selected); color: var(--accent); }
  .header-mobile-action { width: 100%; cursor: pointer; text-align: start; }
  .header-mobile-action.header-mobile-logout { color: #ffc1cd; background: #3b222c; }
}

.public-market-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 215px), 1fr));
  gap: clamp(8px, 1vw, 15px);
}
.public-market-grid .card { position: relative; padding: 10px; border-radius: 13px; }
.public-market-grid .market-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 2.2;
  object-fit: cover;
  border-radius: 7px;
  margin: 0;
}
.public-market-grid .public-test-with-cover .card-top { position: absolute; inset: 17px 17px auto auto; }
.public-market-grid .public-test-with-cover .card-price { background: var(--surface); }
.public-market-grid .card-symbol { width: 32px; height: 32px; border-radius: 8px; font-size: 1rem; }
.public-market-grid .card-price { padding: 3px 7px; font-size: .72rem; overflow-wrap: anywhere; }
.public-market-grid .card-body { margin: 8px 0; }
.public-market-grid .card-subject { font-size: .76rem; }
.public-market-grid h3 { margin: 3px 0 6px; font-size: clamp(.93rem, 1.25vw, 1.12rem); line-height: 1.2; }
.public-market-grid .market-summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.public-market-grid :is(.market-summary, .market-byline, .meta) { margin-block: 3px; font-size: .75rem; }
.public-market-grid .meta { gap: 2px 8px; }
.public-market-grid .card-link { padding-inline: 7px; font-size: .8rem; gap: 4px; }
.public-market-grid .notice { grid-column: 1 / -1; }
@media (max-width: 480px) {
  .public-market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-market-grid .card { padding: 7px; }
  .public-market-grid .public-test-with-cover .card-top { inset: 12px 12px auto auto; }
  .public-market-grid .market-summary { display: none; }
}

.auth-contact-warning {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: -.25rem 0 0;
  padding: .65rem .75rem;
  border: 1px solid #c9767c;
  border-radius: 9px;
  background: #fff0f1;
  color: #862c3a;
  font-size: .875rem;
  font-weight: 650;
}
.auth-contact-warning .edutest-icon { flex: none; width: 1rem; height: 1rem; margin-top: .15rem; }
.auth-input-shell:has(input[aria-invalid="true"]) { border-color: #c9767c; }
[data-theme="dark"] .auth-contact-warning { background: #452531; color: #ffd7dd; }

.auth-login-links { display: grid; gap: 4px; }
.auth-login-links > a:not(.auth-register-action) { justify-self: center; }
.auth-login-links .auth-register-action {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr) 1.25rem;
  align-items: center;
  gap: .6rem;
  min-height: 48px;
  padding: .65rem .9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--selected);
  color: var(--accent);
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}
.auth-register-action .edutest-icon { width: 1.15rem; height: 1.15rem; }
.auth-login-links .auth-register-action:hover { border-color: var(--accent); background: var(--inset); }
