:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-soft: #f0f4f2;
  --ink: #17211c;
  --muted: #69756f;
  --line: #e2e8e4;
  --green: #35a85b;
  --green-dark: #19763b;
  --green-soft: #e7f7ec;
  --violet: #7667ee;
  --blue: #4389f5;
  --orange: #ec9a3d;
  --red: #e85d62;
  --shadow-sm: 0 4px 14px rgba(26, 47, 36, .06);
  --shadow-md: 0 18px 50px rgba(26, 47, 36, .10);
  --shadow-lg: 0 32px 80px rgba(16, 45, 29, .14);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
  --header-height: 82px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button { border: 0; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  gap: 18px;
  background: #f8faf9;
  text-align: center;
  transition: opacity .35s ease, visibility .35s ease;
}

.loading-screen.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.loading-brand { display: flex; align-items: center; justify-content: center; gap: 16px; }
.loading-screen p { margin: 0; color: var(--muted); font-size: 14px; }

.loading-dots { display: flex; gap: 5px; }
.loading-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: loading 1s ease-in-out infinite;
}
.loading-dots i:nth-child(2) { animation-delay: .12s; }
.loading-dots i:nth-child(3) { animation-delay: .24s; }

@keyframes loading {
  0%, 70%, 100% { opacity: .25; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-5px); }
}

.brand-symbol {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: linear-gradient(145deg, #48bd69, #238d48);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: -.4px;
  box-shadow: 0 8px 18px rgba(35, 141, 72, .22), inset 0 1px rgba(255,255,255,.22);
}

.brand-symbol-large {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 16px;
}

.welcome-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 47%) 1fr;
  background: var(--surface);
}

.welcome-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: clamp(28px, 5vw, 68px) clamp(28px, 6vw, 92px);
  background: var(--surface);
}

.welcome-brand { display: flex; align-items: center; gap: 12px; }
.product-label { font-weight: 760; letter-spacing: -.3px; }

.welcome-content {
  width: min(100%, 530px);
  margin: auto 0;
  padding: 64px 0;
}

.eyebrow {
  display: block;
  margin-bottom: 12px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.welcome-content h1 {
  max-width: 500px;
  margin: 0;
  font-size: clamp(44px, 5.2vw, 72px);
  line-height: .98;
  letter-spacing: -3.7px;
}

.welcome-content > p {
  max-width: 450px;
  margin: 24px 0 34px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.welcome-form { width: min(100%, 420px); }

.field {
  display: grid;
  gap: 9px;
}

.field span {
  font-size: 13px;
  font-weight: 720;
}

.field input,
.search-field input {
  width: 100%;
  border: 1.5px solid var(--line);
  outline: none;
  background: #fbfcfb;
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.field input {
  height: 58px;
  padding: 0 17px;
  border-radius: 16px;
}

.field input:hover,
.search-field:hover input { border-color: #c7d2cc; background: #fff; }

.field input:focus,
.search-field input:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(53, 168, 91, .12);
}

.field input::placeholder,
.search-field input::placeholder { color: #9aa39f; }

.field-error {
  min-height: 18px;
  margin: 7px 0 3px;
  color: var(--red);
  font-size: 12px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 20px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 760;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease;
}

.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:focus-visible,
.nav-button:focus-visible,
.ticket-card:focus-visible,
.icon-button:focus-visible,
.mobile-nav button:focus-visible,
.answer-option:focus-visible {
  outline: 3px solid rgba(53, 168, 91, .25);
  outline-offset: 2px;
}

.button-primary {
  background: linear-gradient(180deg, #3cb562, #2f9f54);
  color: #fff;
  box-shadow: 0 10px 24px rgba(46, 157, 83, .22), inset 0 1px rgba(255,255,255,.2);
}

.button-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #42bc68, #2c984f);
  box-shadow: 0 14px 30px rgba(46, 157, 83, .28), inset 0 1px rgba(255,255,255,.2);
}

.button-primary:disabled {
  background: #d5ddd8;
  color: #8e9993;
  box-shadow: none;
  cursor: not-allowed;
}

.button-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.button-large { width: 100%; min-height: 58px; }

.welcome-note {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.welcome-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 28%, rgba(118, 103, 238, .20), transparent 28%),
    radial-gradient(circle at 32% 72%, rgba(53, 168, 91, .24), transparent 32%),
    linear-gradient(140deg, #163927 0%, #245c3d 45%, #19402d 100%);
}

.visual-grid {
  position: absolute;
  inset: 0;
  opacity: .13;
  background-image:
    linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
}

.visual-card {
  position: absolute;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}

.visual-card-main {
  top: 50%;
  left: 50%;
  width: min(430px, 68%);
  padding: 32px;
  border-radius: 28px;
  transform: translate(-55%, -50%) rotate(-3deg);
  animation: float 5s ease-in-out infinite;
}

.mini-label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 1.2px; }
.visual-score { margin: 18px 0; font-size: clamp(60px, 8vw, 96px); font-weight: 820; letter-spacing: -6px; }
.visual-score span { color: var(--green); font-size: .42em; letter-spacing: -1px; }
.visual-progress { height: 11px; overflow: hidden; border-radius: 10px; background: #e4eae6; }
.visual-progress i { display: block; width: 84%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #72cf83); }
.visual-row { display: flex; justify-content: space-between; margin-top: 18px; color: var(--muted); font-size: 13px; }
.visual-row strong { color: var(--ink); }

.visual-card-small {
  right: 7%;
  top: 23%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  animation: float-small 4s ease-in-out infinite;
}

.visual-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 900;
}

.visual-card-small strong,
.visual-card-small small { display: block; }
.visual-card-small strong { font-size: 13px; }
.visual-card-small small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.visual-orbit {
  position: absolute;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
}
.orbit-one { width: 520px; height: 520px; right: -190px; bottom: -150px; }
.orbit-two { width: 250px; height: 250px; left: -100px; top: -60px; }

@keyframes float {
  0%, 100% { transform: translate(-55%, -50%) rotate(-3deg) translateY(0); }
  50% { transform: translate(-55%, -50%) rotate(-2deg) translateY(-12px); }
}
@keyframes float-small {
  0%, 100% { transform: translateY(0) rotate(2deg); }
  50% { transform: translateY(10px) rotate(1deg); }
}

.product-shell { min-height: 100vh; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(22px, 4vw, 58px);
  border-bottom: 1px solid rgba(226, 232, 228, .8);
  background: rgba(255,255,255,.87);
  backdrop-filter: blur(18px);
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  color: var(--ink);
  text-decoration: none;
}

.brand-copy strong,
.brand-copy small,
.profile-copy strong,
.profile-copy small { display: block; }
.brand-copy strong { font-size: 14px; }
.brand-copy small,
.profile-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.desktop-nav {
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f5f7f6;
}

.nav-button {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  transition: .2s ease;
}

.nav-button:hover { color: var(--ink); }
.nav-button.active { background: #fff; color: var(--ink); box-shadow: 0 3px 10px rgba(25, 49, 37, .08); }

.profile-menu {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #eae7ff;
  color: #5a4ed0;
  font-size: 12px;
  font-weight: 850;
}

.profile-copy strong { max-width: 130px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: .18s ease;
}
.icon-button:hover { color: var(--ink); box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.main-content {
  width: min(1440px, 100%);
  min-height: calc(100vh - var(--header-height));
  margin: 0 auto;
  padding: 48px clamp(22px, 4vw, 58px) 80px;
}

.app-view { display: none; animation: view-in .28s ease-out; }
.app-view.active { display: block; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.page-heading h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -2.2px;
}

.page-heading h2 span { color: var(--green-dark); }
.page-heading p { margin: 12px 0 0; color: var(--muted); font-size: 15px; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 38px;
}
.category-card {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr auto;
  align-items: center;
  gap: 22px;
  min-height: 210px;
  padding: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: .2s ease;
}
.category-card::after {
  content: "";
  position: absolute;
  right: -55px;
  bottom: -75px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: var(--category-tint);
  opacity: .7;
}
.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--category-color);
  box-shadow: var(--shadow-md);
}
.category-b { --category-color: #5969d8; --category-tint: #e8ebff; }
.category-c { --category-color: var(--green); --category-tint: var(--green-soft); }
.category-letter {
  display: grid;
  place-items: center;
  width: 90px;
  height: 90px;
  border-radius: 25px;
  background: var(--category-tint);
  color: var(--category-color);
  font-size: 42px;
  font-weight: 900;
}
.category-copy small,
.category-copy strong,
.category-copy em { display: block; }
.category-copy small { color: var(--category-color); font-size: 10px; font-weight: 850; letter-spacing: .7px; }
.category-copy strong { margin: 8px 0 7px; font-size: 27px; letter-spacing: -1px; }
.category-copy em { color: var(--muted); font-size: 12px; font-style: normal; }
.category-arrow { position: relative; z-index: 1; font-size: 24px; font-weight: 800; }

.summary-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 170px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.summary-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--green-soft); color: var(--green-dark); font-size: 22px; }
.summary-chip small,
.summary-chip strong { display: block; }
.summary-chip small { color: var(--muted); font-size: 10px; }
.summary-chip strong { margin-top: 1px; font-size: 17px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 38px 0 22px;
}

.search-field {
  position: relative;
  width: min(360px, 100%);
}
.search-field > span { position: absolute; left: 16px; top: 50%; z-index: 1; color: var(--muted); font-size: 22px; transform: translateY(-52%); }
.search-field input { height: 48px; padding: 0 16px 0 45px; border-radius: 14px; }

.view-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.view-status span { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px #fff2df; }

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.ticket-card {
  position: relative;
  min-height: 146px;
  overflow: hidden;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(24, 47, 35, .02);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.ticket-card::after {
  content: "";
  position: absolute;
  right: -25px;
  bottom: -36px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--ticket-tint, #e9f7ed);
  transition: transform .25s ease;
}

.ticket-card:hover {
  z-index: 2;
  border-color: #c9d8cf;
  box-shadow: 0 15px 36px rgba(26, 47, 36, .10);
  transform: translateY(-5px);
}
.ticket-card:hover::after { transform: scale(1.17); }

.ticket-card-number { color: var(--ticket-color, var(--green-dark)); font-size: 11px; font-weight: 850; letter-spacing: 1.3px; }
.ticket-card h3 { position: relative; z-index: 1; margin: 30px 0 6px; font-size: 19px; letter-spacing: -.5px; }
.ticket-card p { position: relative; z-index: 1; margin: 0; color: var(--muted); font-size: 11px; }
.ticket-arrow {
  position: absolute;
  right: 17px;
  bottom: 15px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ticket-color, var(--green-dark));
  box-shadow: var(--shadow-sm);
}

.no-search-results { padding: 60px 20px; color: var(--muted); text-align: center; }

.exam-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(35px, 7vw, 90px);
  margin-top: 38px;
  overflow: hidden;
  padding: clamp(30px, 5vw, 64px);
  border: 1px solid #dbe5df;
  border-radius: 28px;
  background:
    radial-gradient(circle at 95% 5%, rgba(118, 103, 238, .13), transparent 34%),
    linear-gradient(145deg, #ffffff, #f1f7f3);
  box-shadow: var(--shadow-md);
}

.exam-card::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(53, 168, 91, .14);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(53, 168, 91, .04);
  pointer-events: none;
}

.exam-copy,
.exam-rules { position: relative; z-index: 1; }
.exam-label { color: var(--green-dark); font-size: 11px; font-weight: 850; letter-spacing: 1.4px; }
.exam-copy h3 { max-width: 530px; margin: 16px 0 13px; font-size: clamp(32px, 4vw, 52px); line-height: 1.02; letter-spacing: -2.4px; }
.exam-copy p { max-width: 500px; margin: 0 0 27px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.exam-copy .button { min-width: 180px; }
.exam-rules { display: grid; gap: 10px; }
.exam-rules > div { display: flex; align-items: center; gap: 14px; padding: 17px; border: 1px solid rgba(226, 232, 228, .9); border-radius: 17px; background: rgba(255,255,255,.76); backdrop-filter: blur(8px); }
.exam-rules > div > span { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; background: var(--green-soft); color: var(--green-dark); font-size: 11px; font-weight: 850; }
.exam-rules p { margin: 0; }
.exam-rules strong,
.exam-rules small { display: block; }
.exam-rules strong { font-size: 13px; }
.exam-rules small { margin-top: 4px; color: var(--muted); font-size: 10px; }

.quiz-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.back-button { padding: 8px 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.back-button:hover { color: var(--ink); }
.quiz-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; font-weight: 700; }
.timer-chip { padding: 7px 10px; border-radius: 10px; background: #fff3df; color: #9b610d; font-variant-numeric: tabular-nums; }
.timer-chip.warning { background: #fee9ea; color: #b7333a; }
.quiz-progress { height: 7px; margin: 20px 0 28px; overflow: hidden; border-radius: 10px; background: #e1e8e4; }
.quiz-progress i { display: block; width: 12.5%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #70cf82); transition: width .35s ease; }

.question-layout {
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(420px, 1.06fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.question-media {
  position: relative;
  min-height: 620px;
  background: #e9eeeb;
}
.question-media img { width: 100%; height: 100%; display: none; object-fit: cover; }
.question-media.has-image img { display: block; }
.question-media.has-image .media-placeholder { display: none; }
.media-placeholder { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; color: #718078; text-align: center; background: radial-gradient(circle at 50% 40%, #fff, #e5ece8); }
.placeholder-icon { margin: 0 auto 8px; font-size: 50px; color: #9eaca4; }
.media-placeholder strong { font-size: 15px; }
.media-placeholder small { font-size: 11px; }
.ticket-badge { position: absolute; top: 20px; left: 20px; padding: 8px 11px; border-radius: 10px; background: rgba(20, 32, 26, .78); color: #fff; font-size: 11px; font-weight: 800; backdrop-filter: blur(10px); }

.question-panel { padding: clamp(30px, 5vw, 66px); }
.question-panel h2 { margin: 0; font-size: clamp(27px, 3vw, 39px); line-height: 1.18; letter-spacing: -1.4px; }
.question-translation { margin: 14px 0 30px; color: var(--muted); font-size: 17px; line-height: 1.5; }
.answer-grid { display: grid; gap: 11px; }

.answer-option {
  min-height: 64px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 13px;
  padding: 11px 16px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: .18s ease;
}
.answer-option:hover { border-color: #bcd3c3; background: #fbfdfb; transform: translateX(3px); }
.answer-option.selected { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 3px rgba(53, 168, 91, .09); }
.answer-grid.is-locked .answer-option { cursor: default; transform: none; }
.answer-option.is-correct { border-color: #2f9c54; background: #e8f8ed; box-shadow: 0 0 0 3px rgba(47, 156, 84, .1); }
.answer-option.is-wrong { border-color: #d95660; background: #fff0f1; box-shadow: 0 0 0 3px rgba(217, 86, 96, .1); }
.answer-option.is-unconfigured { border-color: #d29a3f; background: #fff7e8; }
.answer-option.is-correct .answer-index { background: #2f9c54; color: #fff; }
.answer-option.is-wrong .answer-index { background: #d95660; color: #fff; }
.answer-index { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 850; }
.answer-option.selected .answer-index { background: var(--green); color: #fff; }
.answer-copy strong,
.answer-copy small { display: block; }
.answer-copy strong { font-size: 14px; }
.answer-copy small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.answer-feedback { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 13px 15px; border-radius: 14px; }
.answer-feedback strong { font-size: 16px; }
.answer-feedback span { font-size: 12px; font-weight: 750; }
.answer-feedback.correct { color: #176c35; background: #e8f8ed; }
.answer-feedback.wrong { color: #a52d38; background: #fff0f1; }
.answer-feedback.unconfigured { color: #8a5a0e; background: #fff7e8; }
.button-next { width: 100%; margin-top: 18px; }

.owner-entry { align-self: center; margin-top: 4px; padding: 9px 14px; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 760; transition: .18s ease; }
.owner-entry:hover { color: var(--ink); background: var(--surface-soft); }
.owner-header-button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 800; }
.owner-header-button:hover { color: var(--green-dark); border-color: #bad4c2; }

.owner-heading { align-items: center; }
.owner-actions { display: flex; align-items: center; gap: 10px; }
.save-status { color: var(--muted); font-size: 11px; font-weight: 700; }
.save-status.dirty { color: #a46616; }
.owner-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 28px 0 20px; }
.owner-filters { display: flex; gap: 7px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow-x: auto; }
.owner-filters button,
.owner-back { flex: 0 0 auto; padding: 9px 12px; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 800; }
.owner-filters button.active { background: var(--green-soft); color: var(--green-dark); }
.owner-back { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.owner-ticket-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.owner-ticket-card { display: grid; gap: 16px; min-height: 142px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; box-shadow: var(--shadow-sm); transition: .18s ease; }
.owner-ticket-card:hover { transform: translateY(-2px); border-color: #bdd2c3; box-shadow: var(--shadow-md); }
.owner-ticket-card.ready { border-color: #b9dbc3; }
.owner-ticket-top,
.owner-ticket-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.owner-ticket-top strong { font-size: 15px; }
.owner-ticket-top em { color: var(--muted); font-size: 10px; font-style: normal; }
.owner-ticket-progress { height: 6px; overflow: hidden; border-radius: 99px; background: #edf1ee; }
.owner-ticket-progress i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.owner-ticket-meta { color: var(--muted); font-size: 10px; font-weight: 700; }
.owner-editor { display: grid; gap: 16px; }
.owner-editor-heading { display: flex; align-items: center; justify-content: space-between; padding: 18px 2px 6px; }
.owner-editor-heading h3 { margin: 5px 0 0; font-size: 24px; }
.owner-editor-heading > span { color: var(--muted); font-size: 11px; font-weight: 750; }
.owner-question-card { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); }
.owner-question-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.owner-question-number,
.owner-key-state { font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .45px; }
.owner-question-number { color: var(--green-dark); }
.owner-key-state { color: #a46616; }
.owner-key-state.configured { color: var(--green-dark); }
.owner-question-body { display: grid; grid-template-columns: 220px 1fr; gap: 22px; }
.owner-question-image { display: grid; place-items: center; min-height: 150px; overflow: hidden; border-radius: 15px; background: var(--surface-soft); color: var(--muted); font-size: 11px; }
.owner-question-image img { width: 100%; height: 100%; object-fit: cover; }
.owner-question-card h4 { margin: 0; font-size: 20px; line-height: 1.45; }
.owner-question-card p { margin: 7px 0 15px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.owner-answer-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.owner-answer { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 10px; min-height: 62px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.owner-answer:hover { border-color: #b9d4c1; }
.owner-answer.selected { border-color: var(--green); background: var(--green-soft); }
.owner-answer > span:first-child { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 850; }
.owner-answer.selected > span:first-child { background: var(--green); color: #fff; }
.owner-answer strong,
.owner-answer small { display: block; }
.owner-answer strong { font-size: 12px; }
.owner-answer small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.owner-login-modal { text-align: left; }
.owner-login-modal .modal-icon,
.owner-login-modal h2,
.owner-login-modal > p { text-align: center; }

.result-card {
  width: min(720px, 100%);
  margin: 30px auto;
  padding: clamp(34px, 6vw, 70px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow-md);
}
.result-icon { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 24px; border-radius: 24px; background: var(--green-soft); color: var(--green-dark); font-size: 34px; font-weight: 900; }
.result-card h2 { margin: 0; font-size: 38px; letter-spacing: -1.7px; }
.result-card > p { margin: 9px 0 28px; color: var(--muted); }
.result-score { width: 160px; height: 160px; display: grid; place-content: center; margin: 0 auto 30px; border: 12px solid var(--green); border-radius: 50%; background: #fbfdfb; }
.result-score strong { font-size: 40px; line-height: 1; }
.result-score span { margin-top: 6px; color: var(--muted); font-size: 11px; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.result-stat { display: flex; align-items: center; gap: 11px; padding: 16px; border-radius: 16px; background: var(--surface-soft); text-align: left; }
.result-stat > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; font-weight: 900; }
.result-stat small,
.result-stat strong { display: block; }
.result-stat small { color: var(--muted); font-size: 10px; }
.result-stat strong { margin-top: 3px; font-size: 20px; }
.result-correct > span { background: var(--green-soft); color: var(--green-dark); }
.result-wrong > span { background: #fdebed; color: #bd3a42; }
.result-time > span { background: #fff0dc; color: #a46511; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 24px; }

.admin-heading { align-items: center; }
.demo-badge { padding: 8px 12px; border-radius: 999px; background: #eeebff; color: #5c4ed1; font-size: 11px; font-weight: 800; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 34px; }
.metric-card { display: flex; align-items: flex-start; gap: 14px; min-height: 150px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm); }
.metric-icon { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 13px; font-weight: 850; }
.metric-blue { background: #e7f0ff; color: #3270ce; }
.metric-violet { background: #eeebff; color: #5c4ed1; }
.metric-green { background: var(--green-soft); color: var(--green-dark); }
.metric-orange { background: #fff0dc; color: #a46511; }
.metric-card small,
.metric-card strong,
.metric-card em { display: block; }
.metric-card small { color: var(--muted); font-size: 11px; font-style: normal; }
.metric-card strong { margin: 8px 0 7px; font-size: 29px; letter-spacing: -1px; }
.metric-card em { color: #929b96; font-size: 10px; font-style: normal; }

.table-card { margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-sm); }
.table-heading { display: flex; align-items: center; justify-content: space-between; padding: 23px 25px; border-bottom: 1px solid var(--line); }
.table-heading h3 { margin: 0; font-size: 17px; }
.table-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.table-count { padding: 7px 10px; border-radius: 9px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 800; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 25px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); background: #fbfcfb; font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
td { font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-table-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #eae7ff; color: #5a4ed0; font-size: 10px; font-weight: 850; }
.score-tag { display: inline-flex; padding: 5px 8px; border-radius: 8px; background: var(--green-soft); color: var(--green-dark); font-weight: 800; }
.empty-table td { padding: 48px 25px; color: var(--muted); text-align: center; }

.mobile-nav { display: none; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 28, 20, .52);
  backdrop-filter: blur(8px);
  animation: modal-bg .2s ease;
}
.modal { position: relative; width: min(440px, 100%); padding: 34px; border: 1px solid rgba(255,255,255,.55); border-radius: 25px; background: var(--surface); text-align: center; box-shadow: var(--shadow-lg); animation: modal-in .24s ease-out; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-soft); color: var(--muted); cursor: pointer; font-size: 20px; }
.modal-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 20px; background: var(--green-soft); color: var(--green-dark); font-size: 30px; }
.modal h2 { margin: 0; font-size: 25px; letter-spacing: -1px; }
.modal p { margin: 13px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.modal code { padding: 2px 5px; border-radius: 5px; background: var(--surface-soft); color: var(--ink); font-size: 11px; }
.modal .button { width: 100%; }

@keyframes modal-bg { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 110;
  max-width: 380px;
  padding: 13px 16px;
  border-radius: 13px;
  background: #1f2b24;
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: .24s ease;
}
.toast.visible { opacity: 1; transform: none; }

@media (max-width: 1180px) {
  .ticket-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .question-layout { grid-template-columns: .82fr 1.18fr; }
  .owner-ticket-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .welcome-screen { grid-template-columns: 1fr; }
  .welcome-panel { min-height: 100vh; }
  .welcome-visual { display: none; }
  .desktop-nav { display: none; }
  .app-header { grid-template-columns: 1fr auto; }
  .profile-menu { grid-column: 2; }
  .ticket-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .question-layout { grid-template-columns: 1fr; }
  .exam-card { grid-template-columns: 1fr; }
  .question-media { min-height: 370px; }
  .owner-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
  .owner-question-body { grid-template-columns: 1fr; }
  .owner-question-image { max-height: 320px; }
  .mobile-nav {
    position: fixed;
    left: 50%;
    bottom: 14px;
    z-index: 40;
    display: flex;
    gap: 5px;
    padding: 6px;
    border: 1px solid rgba(226,232,228,.9);
    border-radius: 18px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 14px 42px rgba(25, 49, 37, .18);
    backdrop-filter: blur(18px);
    transform: translateX(-50%);
  }
  .mobile-nav button { min-width: 100px; min-height: 45px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 7px; border-radius: 13px; background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; font-weight: 760; line-height: 1.2; }
  body[data-role="admin"] .mobile-nav button { min-width: 78px; }
  .mobile-nav button.active { background: var(--green-soft); color: var(--green-dark); }
}

@media (max-width: 680px) {
  :root { --header-height: 70px; }
  .app-header { padding: 0 16px; }
  .brand-copy small,
  .profile-copy,
  .icon-button { display: none; }
  .main-content { padding: 30px 16px 95px; }
  .page-heading { align-items: flex-start; }
  .page-heading h2 { font-size: 34px; letter-spacing: -1.5px; }
  .summary-chip { min-width: auto; padding: 10px; }
  .summary-chip span:last-child { display: none; }
  .toolbar { align-items: stretch; flex-direction: column; margin-top: 27px; }
  .category-grid { grid-template-columns: 1fr; margin-top: 26px; }
  .category-card { grid-template-columns: 70px 1fr auto; min-height: 150px; padding: 21px; gap: 16px; border-radius: 20px; }
  .category-letter { width: 68px; height: 68px; border-radius: 20px; font-size: 31px; }
  .category-copy strong { font-size: 22px; }
  .search-field { width: 100%; }
  .ticket-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ticket-card { min-height: 132px; padding: 16px; border-radius: 17px; }
  .ticket-card h3 { margin-top: 25px; font-size: 17px; }
  .question-media { min-height: 270px; }
  .exam-card { margin-top: 26px; padding: 28px 20px; border-radius: 22px; }
  .exam-copy h3 { font-size: 36px; }
  .exam-copy .button { width: 100%; }
  .question-panel { padding: 25px 18px; }
  .question-panel h2 { font-size: 26px; }
  .question-translation { font-size: 15px; }
  .result-card { margin-top: 0; padding: 30px 18px; border-radius: 23px; }
  .result-stats { grid-template-columns: 1fr; }
  .result-actions { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: auto; }
  .admin-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .owner-actions { width: 100%; flex-wrap: wrap; }
  .owner-actions .save-status { width: 100%; }
  .owner-actions .button { flex: 1; }
  .owner-toolbar { align-items: stretch; flex-direction: column; }
  .owner-ticket-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owner-answer-list { grid-template-columns: 1fr; }
  .toast { right: 16px; bottom: 82px; left: 16px; max-width: none; }
}

@media (max-width: 430px) {
  .welcome-panel { padding: 24px 20px; }
  .welcome-content { padding: 45px 0; }
  .welcome-content h1 { font-size: 43px; letter-spacing: -2.8px; }
  .welcome-content > p { margin: 19px 0 28px; font-size: 15px; }
  .ticket-grid { grid-template-columns: 1fr 1fr; }
  .quiz-topbar { align-items: flex-start; }
  .back-button span { display: none; }
  .quiz-meta { gap: 8px; }
  .question-media { min-height: 230px; }
  .answer-option { min-height: 60px; padding: 9px 12px; }
  .owner-header-button { display: none; }
  .owner-ticket-grid { grid-template-columns: 1fr; }
  .owner-question-card { padding: 17px; }
  .modal { padding: 30px 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
