:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --line: #e2e8f0;
  --primary: #0f172a;
  --green-bg: #f0fdf4;
  --green-line: #86efac;
  --red-bg: #fef2f2;
  --red-line: #fecaca;
  --amber-bg: #fffbeb;
  --amber-line: #fcd34d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, select { font: inherit; }
a { color: inherit; }
.app-shell { max-width: 1080px; margin: 0 auto; padding: 18px; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.brand h1 { margin: 0; font-size: 24px; letter-spacing: -0.03em; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.lang-box { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 9px 12px; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.lang-box select { border: none; background: transparent; outline: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 1px 2px rgba(15,23,42,.04); overflow: hidden; }
.card-pad { padding: 22px; }
.hero { background: #0f172a; color: #fff; padding: 32px; }
.hero h2 { margin: 0; font-size: 32px; letter-spacing: -0.05em; }
.hero p { margin: 8px 0 0; color: #cbd5e1; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.tile { cursor: pointer; transition: .15s ease; }
.tile:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(15,23,42,.08); }
.tile-inner { display: flex; align-items: center; gap: 14px; padding: 18px; }
.icon { width: 44px; height: 44px; border-radius: 16px; background: #f1f5f9; display: grid; place-items: center; font-size: 21px; }
.title { font-weight: 700; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 14px; cursor: pointer; transition: .12s; }
.btn:hover { background: #f8fafc; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.full { width: 100%; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; background: #f1f5f9; padding: 12px; }
td { padding: 12px; border-top: 1px solid var(--line); vertical-align: top; }
.topic { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.question-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.question-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.translation { color: var(--muted); margin: 8px 0 0; }
.option { width: 100%; background: #fff; border: 1px solid var(--line); padding: 15px; border-radius: 16px; text-align: left; cursor: pointer; margin-top: 10px; }
.option:hover { background: #f8fafc; }
.option.correct { background: var(--green-bg); border-color: var(--green-line); }
.option.wrong { background: var(--red-bg); border-color: var(--red-line); }
.explanation { background: #f1f5f9; border-radius: 16px; padding: 15px; margin-top: 16px; }
.badge { display: inline-flex; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 10px; font-size: 13px; margin: 4px; }
.progress { height: 12px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: #0f172a; border-radius: 999px; }
.ad-card { border: 1px dashed #cbd5e1; background: rgba(255,255,255,.7); border-radius: 20px; padding: 16px; margin-top: 16px; }
.legal-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.notice { background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 16px; padding: 14px; }
.footer-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 20px; }
@media (max-width: 760px) {
  .header { align-items: flex-start; flex-direction: column; }
  .grid, .grid-3 { grid-template-columns: 1fr; }
  .question-header { flex-direction: column; }
  .hero h2 { font-size: 26px; }
}

/* Mobile-first fixes for bilingual content */
html, body { max-width: 100%; overflow-x: hidden; }
.mobile-records { display: none; }
.record-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 15px;
  margin-top: 12px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.record-card:first-child { margin-top: 0; }
.record-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.record-card h3 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -.02em;
  margin: 0 0 10px;
}
.record-row {
  display: grid;
  grid-template-columns: minmax(92px, 30%) 1fr;
  gap: 12px;
  align-items: start;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.record-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.badge.compact { padding: 3px 8px; font-size: 11px; vertical-align: middle; }
.seo-footer {
  max-width: 1080px;
  margin: 26px auto 40px;
  padding: 0 18px;
  color: var(--text);
}
.seo-footer h1 { font-size: 22px; line-height: 1.2; letter-spacing: -.03em; }
.seo-footer h2 { font-size: 18px; margin-top: 18px; }
.seo-footer p, .seo-footer li { color: var(--muted); font-size: 14px; line-height: 1.6; }
.seo-footer a { color: #0f172a; font-weight: 700; }

@media (max-width: 760px) {
  .app-shell { padding: 18px 16px; }
  .brand h1 { font-size: 30px; }
  .brand p { font-size: 16px; line-height: 1.35; }
  .lang-box { width: 100%; justify-content: space-between; padding: 14px 16px; border-radius: 20px; }
  .lang-box select { width: 100%; font-size: 18px; }
  .card { border-radius: 20px; }
  .card-pad { padding: 18px; }
  .card-pad h2 { font-size: 26px; line-height: 1.2; }
  .tile-inner { padding: 16px; }
  .icon { width: 42px; height: 42px; flex: 0 0 auto; }
  .title { font-size: 17px; }
  .sub { font-size: 14px; line-height: 1.45; }
  .desktop-table { display: none; }
  .mobile-records { display: block; }
  .btn-row .btn { min-height: 44px; }
  .question-title { font-size: 22px; line-height: 1.25; }
  .translation { font-size: 16px; line-height: 1.55; }
  .option { padding: 16px; line-height: 1.45; }
  .seo-footer { padding: 0 16px 40px; margin-top: 20px; }
  .seo-footer h1 { font-size: 20px; }
}

/* v1.2.1 hard mobile override: prevents bilingual tables on phone even if browser cache is stubborn */
@media (max-width: 900px) {
  .desktop-table, .table-wrap.desktop-table { display: none !important; }
  .mobile-records { display: block !important; }
  table { min-width: 760px; }
}
