/* ===== Ойқадам — «Тесттер» бөлімі ===== */
.t-body { background: var(--bg-soft); min-height: 100vh; display: flex; flex-direction: column; }
.t-main { flex: 1; padding-top: 28px; padding-bottom: 64px; }
.t-header { position: sticky; top: 0; z-index: 50; }
.t-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.t-nav { display: flex; gap: 18px; }
.t-nav a { text-decoration: none; font-weight: 600; font-size: 15px; }
.t-nav a:hover, .t-nav a[aria-current="page"] { color: var(--brand); }

.t-eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--brand); }
.t-hero { max-width: 700px; margin-bottom: 24px; }
.t-hero h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.2; margin: 6px 0 10px; }
.t-hero p { color: var(--muted); }

.t-chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--brand); color: #fff; }
.t-chip.soft { background: #e0e7ff; color: #4338ca; }

/* Тесттер тізімі */
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.t-card { background: #fff; border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }
.t-card-top { display: flex; gap: 6px; flex-wrap: wrap; }
.t-card h2 { font-size: 20px; }
.t-card p { color: #334155; font-size: 15px; }
.t-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.t-meta li { background: var(--bg-soft); border-radius: 999px; padding: 4px 10px; font-size: 13px; color: #334155; }
.t-meta.big li { font-size: 15px; padding: 6px 14px; }
.t-best { background: #f0fdf4; color: #166534; border-radius: 8px; padding: 6px 10px; font-size: 14px; }
.t-go { align-self: flex-start; margin-top: auto; }
.t-hero .t-meta { margin-top: 14px; }
.t-grid-tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.t-tile { position: relative; padding: 18px; gap: 8px; min-height: 150px; }
.t-tile h2 { font-size: 18px; }
.t-vnum { position: absolute; top: 12px; right: 14px; font-size: 34px; font-weight: 900; color: #e2e8f0; line-height: 1; }
.t-tile.tried { border: 2px solid #99f6e4; }
.t-off { opacity: .55; box-shadow: none; border: 2px dashed #cbd5e1; background: transparent; }
.t-tile .t-best { font-size: 13px; padding: 4px 8px; }
.t-tile .t-route-link { font-size: 12px; padding: 6px 8px; }
.t-route-link { display: block; background: #f0fdfa; border: 1px solid #99f6e4; color: #0f766e; font-weight: 700; font-size: 14px; border-radius: 8px; padding: 8px 10px; text-decoration: none; }
.t-route-link:hover { background: #ccfbf1; }
.t-soon { opacity: .7; border: 2px dashed #cbd5e1; box-shadow: none; background: transparent; }
.t-soon code { background: #e2e8f0; padding: 1px 6px; border-radius: 4px; font-size: 13px; }

/* Панель */
.t-panel { background: #fff; border-radius: 16px; padding: 26px; box-shadow: 0 1px 3px rgba(15, 23, 42, .08); margin-bottom: 20px; }
.t-intro { max-width: 720px; margin: 0 auto; }
.t-intro h1 { font-size: clamp(26px, 3.5vw, 34px); margin: 6px 0 14px; }
.t-intro h3 { margin: 22px 0 8px; }
.t-rules { padding-left: 20px; display: grid; gap: 6px; color: #334155; }
kbd { background: var(--bg-soft); border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 4px; padding: 0 6px; font-size: 13px; font-family: inherit; }
.t-start { margin-top: 22px; }
.btn { cursor: pointer; font-family: inherit; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }

/* Жоғарғы жолақ */
.t-bar {
  position: sticky; top: 72px; z-index: 40; display: flex; align-items: center; gap: 16px;
  background: var(--hero-dark); color: #fff; border-radius: 12px; padding: 10px 16px; margin-bottom: 16px;
}
.t-bar-title { flex: 1; font-weight: 600; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-timer { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 800; background: rgba(255, 255, 255, .12); padding: 2px 12px; border-radius: 8px; }
.t-timer.warn { background: #dc2626; animation: t-pulse 1s infinite; }
@keyframes t-pulse { 50% { opacity: .65; } }
.t-finish { background: #fff; color: var(--ink); border-color: #fff; padding: 6px 16px; }

/* Сұрақ + карта */
.t-layout { display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: start; }
.t-qhead { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.t-qnum { font-weight: 800; font-size: 18px; }
.t-flag { margin-left: auto; border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.t-flag.on { border-color: #f59e0b; background: #fffbeb; color: #b45309; }
.t-q { font-size: clamp(17px, 2vw, 20px); line-height: 1.7; margin-bottom: 18px; }
.t-q sup, .t-rv-q sup, .t-explain sup { font-size: .7em; }
.t-opts { display: grid; gap: 10px; }
.t-opt {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 16px;
  font: inherit; font-size: 17px; cursor: pointer; transition: border-color .15s, background .15s; line-height: 1.6;
}
.t-opt:hover { border-color: #94a3b8; }
.t-opt.on { border-color: var(--brand); background: #f0fdfa; }
.t-letter {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: var(--bg-soft); font-weight: 800; font-size: 15px;
}
.t-opt.on .t-letter { background: var(--brand); color: #fff; }
.t-nav-btns { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }

.t-map { position: sticky; top: 140px; padding: 18px; }
.t-map h3 { font-size: 15px; margin-bottom: 12px; }
.t-grid-nums { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.t-n {
  aspect-ratio: 1; border: 2px solid var(--line); background: #fff; border-radius: 8px;
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; position: relative;
}
.t-n.ans { background: var(--brand); border-color: var(--brand); color: #fff; }
.t-n.flag::after { content: ""; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; border: 2px solid #fff; }
.t-n.cur { outline: 3px solid var(--ink); outline-offset: 1px; }
.t-legend { list-style: none; margin-top: 14px; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.t-legend li { display: flex; align-items: center; gap: 8px; }
.sw { width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--line); background: #fff; }
.sw.ans { background: var(--brand); border-color: var(--brand); }
.sw.flag { background: #f59e0b; border-color: #f59e0b; border-radius: 50%; }
.t-count { margin-top: 12px; font-weight: 600; font-size: 14px; }

/* Аяқтау терезесі */
.t-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: grid; place-items: center; z-index: 100; padding: 16px; }
.t-modal[hidden] { display: none; }
.t-dialog { background: #fff; border-radius: 16px; padding: 24px; max-width: 420px; width: 100%; }
.t-dialog h3 { font-size: 20px; margin-bottom: 8px; }
.t-dialog-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* Нәтиже */
.t-timeup { background: #fef2f2; color: #991b1b; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; font-weight: 600; }
.t-score { display: flex; align-items: center; gap: 28px; margin: 14px 0; flex-wrap: wrap; }
.t-score h1 { font-size: clamp(24px, 3vw, 32px); }
.t-big { font-size: 20px; margin: 4px 0; }
.t-ring {
  --c: var(--brand);
  width: 130px; height: 130px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0);
}
.t-ring span { width: 100px; height: 100px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 800; }
.t-result.great .t-ring { --c: #16a34a; }
.t-result.good .t-ring { --c: var(--brand); }
.t-result.mid .t-ring { --c: #f59e0b; }
.t-result.low .t-ring { --c: #dc2626; }
.t-weak { background: #fffbeb; border-left: 4px solid #f59e0b; padding: 10px 14px; border-radius: 6px; margin: 10px 0; }
.t-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }

.t-filter { display: flex; gap: 8px; margin: 10px 0 16px; }
.t-fb { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.t-fb.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.t-review { list-style: none; display: grid; gap: 14px; }
.t-review.only-bad .t-rv.ok { display: none; }
.t-rv { border: 1px solid var(--line); border-left: 5px solid; border-radius: 10px; padding: 14px 16px; }
.t-rv.ok { border-left-color: #16a34a; }
.t-rv.bad { border-left-color: #dc2626; }
.t-rv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.t-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.t-tag.ok { background: #dcfce7; color: #166534; }
.t-tag.bad { background: #fee2e2; color: #991b1b; }
.t-rv-q { margin-bottom: 8px; line-height: 1.7; }
.t-rv-opts { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.t-rv-opts li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--bg-soft); line-height: 1.6; }
.t-rv-opts .t-letter { width: 24px; height: 24px; font-size: 12px; background: #fff; }
.t-rv-opts li.right { background: #dcfce7; font-weight: 600; }
.t-rv-opts li.wrong { background: #fee2e2; text-decoration: line-through; }
.t-explain { margin-top: 10px; background: #fffbeb; border-radius: 8px; padding: 8px 12px; font-size: 15px; line-height: 1.8; }

/* ===== Қатемен жұмыс маршруты ===== */
.r-cta {
  display: flex; align-items: center; gap: 14px; margin: 16px 0 4px; padding: 16px 18px; border-radius: 14px;
  background: linear-gradient(135deg, #0d9488, #0f766e); color: #fff; text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.r-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(13, 148, 136, .35); }
.r-cta-icon { font-size: 30px; }
.r-cta b { display: block; font-size: 17px; }
.r-cta small { display: block; opacity: .9; font-size: 14px; margin-top: 2px; }
.r-cta-go { margin-left: auto; font-weight: 800; white-space: nowrap; background: #fff; color: #0f766e; padding: 8px 14px; border-radius: 8px; }
.r-title { font-size: clamp(24px, 3vw, 32px); margin: 6px 0 10px; }
.r-progress { height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 16px 0 6px; }
.r-progress > div { height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }
.r-progress-label { font-size: 14px; margin-bottom: 14px; }
.r-ready { display: grid; gap: 6px; background: #f0fdf4; border: 1px solid #86efac; border-radius: 12px; padding: 14px 16px; justify-items: start; }
.r-ready b { font-size: 17px; }
.r-list { list-style: none; display: grid; gap: 10px; margin-top: 10px; }
.r-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; flex-wrap: wrap; }
.r-item.done { background: #f0fdf4; border-color: #bbf7d0; }
.r-num { width: 34px; height: 34px; border-radius: 9px; background: #fee2e2; color: #991b1b; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.r-item.done .r-num { background: #dcfce7; color: #166534; }
.r-body { display: grid; flex: 1; min-width: 180px; }
.r-foot { margin-top: 12px; }
.r-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.r-why { background: #fef2f2; border-left: 4px solid #dc2626; border-radius: 8px; padding: 10px 14px; margin-top: 12px; line-height: 1.7; }
.r-why-inline { margin: 6px 0; }
.r-sol { margin-top: 12px; }
.r-sol summary { cursor: pointer; font-weight: 700; }
.t-opt.right { border-color: #16a34a; background: #dcfce7; }
.t-opt.right .t-letter { background: #16a34a; color: #fff; }
.t-opt.wrong { border-color: #dc2626; background: #fee2e2; }
.t-opt.wrong .t-letter { background: #dc2626; color: #fff; }
.t-opt:disabled { cursor: default; }
.r-radio input { position: absolute; opacity: 0; pointer-events: none; }
.r-radio { position: relative; }
.r-radio.on { border-color: var(--brand); background: #f0fdfa; }
.r-radio.on .t-letter { background: var(--brand); color: #fff; }
.r-compare { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 14px 0; }
.r-compare > div:not(.arrow) { display: grid; background: var(--bg-soft); border-radius: 12px; padding: 10px 16px; }
.r-compare span { font-size: 13px; color: var(--muted); }
.r-compare b { font-size: 24px; }
.r-compare .after { background: #dcfce7; }
.r-compare .after b { color: #166534; }
.r-compare .arrow { font-size: 24px; color: var(--muted); }
.r-final-res.great { border: 2px solid #16a34a; }
.btn-row.left { justify-content: flex-start; }

/* Жалпы элементтер (app.css-тегідей) */
.back { display: inline-block; margin-bottom: 16px; color: var(--brand-dark); text-decoration: none; font-weight: 600; }
.back:hover { text-decoration: underline; }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.streak { display: inline-flex; gap: 6px; }
.streak span { width: 14px; height: 14px; border-radius: 50%; background: var(--line); transition: background .3s; }
.streak span.on { background: var(--brand); }
.feedback { border-radius: 10px; padding: 14px 16px; margin: 16px 0 12px; line-height: 1.8; }
.feedback.ok { background: #dcfce7; color: #14532d; }
.feedback.bad { background: #fee2e2; color: #7f1d1d; }
.feedback.mastery { background: #f0fdfa; border: 2px solid var(--brand); text-align: center; padding: 24px; color: var(--ink); }
.feedback.mastery h3 { font-size: 21px; margin-bottom: 6px; }
.big-emoji { font-size: 44px; }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.error { color: #dc2626; font-size: 14px; margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Бөлек жолдағы өрнек және сызба */
.t-formula { text-align: center; font-size: 1.15em; margin: 12px 0 4px; line-height: 2; font-family: "Cambria Math", "Times New Roman", Georgia, serif; overflow-x: auto; max-width: 100%; }
.t-layout > * { min-width: 0; }
.nw { white-space: nowrap; display: inline-block; }
.t-nav a { white-space: nowrap; }
.t-rv-q .t-formula { font-size: 1.05em; margin: 6px 0; }
.t-fig { display: flex; justify-content: center; margin: 12px 0 4px; color: var(--ink); }
.t-fig svg { width: 100%; max-width: 280px; height: auto; }
.t-rv-q .t-fig svg { max-width: 200px; }

/* Бөлшек */
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .82em; margin: 0 .12em; line-height: 1.15; }
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 .2em; }

@media (max-width: 860px) {
  .t-layout { grid-template-columns: 1fr; }
  .t-map { position: static; }
  .t-grid-nums { grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); gap: 5px; }
  .t-n { aspect-ratio: auto; height: 32px; font-size: 13px; }
  .t-legend { display: none; }
}
@media (max-width: 600px) {
  .t-panel { padding: 18px 16px; }
  .t-bar { top: 66px; gap: 10px; }
  .t-bar-title { display: none; }
  .t-rv-opts { grid-template-columns: 1fr; }
  .t-nav a:not(:first-child) { display: none; }
  .t-nav-btns .btn { padding: 10px 14px; }
}
@media (max-width: 420px) {
  .t-header .logo-text { font-size: 18px; }
  .t-header .logo-mark { width: 32px; height: 32px; font-size: 15px; }
  .t-nav a { font-size: 13px; }
  .t-opt { padding: 10px 12px; font-size: 16px; gap: 10px; }
  .t-nav-btns .btn { padding: 9px 10px; font-size: 12px; }
}
