:root {
  --bg: #F4F5FA;
  --card: #FFFFFF;
  --ink: #15172B;
  --muted: #555A70;
  --line: #E2E4EE;
  --line-strong: #C9CCDA;
  --accent: #3D4BE0;
  --accent-ink: #2A35B8;
  --accent-soft: #E8EAFD;
  --good: #0F5C3E;
  --good-soft: #DDF3E9;
  --warn: #6B4500;
  --warn-soft: #FCEFD6;
  --bad: #8E231D;
  --bad-line: #C0362F;
  --bad-soft: #FBE1DF;
  --input: #FAFBFD; --bad-ink: #3A1210; --tip-ink: #1E268F; --shine: #EDEFF5;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, sans-serif; }
body { min-height: 100vh; display: flex; justify-content: center; }
[hidden] { display: none !important; }

.phone { width: 100%; max-width: 440px; min-height: 100vh; padding: 24px 20px; }
.screen { min-height: calc(100vh - 48px); display: flex; flex-direction: column; gap: 18px; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.muted { color: var(--muted); }

.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 44px; height: 44px; flex-shrink: 0; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -0.4px; }
.brand-tag { font-size: 13px; color: var(--muted); }

.hero h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -0.8px; }
.hero.small h1 { font-size: 26px; }
.hero p { margin: 0; font-size: 15px; line-height: 1.5; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; }
.field > span, .field legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 4px; }
.field em { font-style: normal; font-weight: 400; }
input[type=text], input[type=password] {
  height: 46px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 14px;
  font: inherit; font-size: 16px; color: var(--ink); background: var(--input);
}
input[type=text]:focus, input[type=password]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px;
  padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--card);
  font: inherit; text-align: left; cursor: pointer; color: var(--ink);
}
.choice.selected { background: var(--accent-soft); border: 2px solid var(--accent); }
.choice .title { font-size: 15px; font-weight: 600; display: block; }
.choice .sub { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; }
.radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #9EA2B5; flex-shrink: 0; }
.choice.selected .radio { border: 6px solid var(--accent); }

.btn {
  display: flex; align-items: center; justify-content: center; height: 56px; border-radius: 16px; border: 0;
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none; width: 100%;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.telegram { background: #229ED9; color: #fff; margin-top: 14px; }
.small-note { font-size: 14px; text-align: center; margin: 8px 0 0; }
.btn.primary:disabled { opacity: .6; cursor: wait; }
.btn.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); height: 50px; }
.btn.disabled { background: var(--line); color: var(--muted); font-size: 15px; font-weight: 600; cursor: default; }
.link { background: none; border: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); min-height: 44px; cursor: pointer; padding: 0; }

.error { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 14px; }
.privacy { display: flex; gap: 10px; font-size: 13px; line-height: 1.45; color: var(--muted); margin: 0; }
.privacy svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: var(--muted); stroke-width: 2; }

/* test */
.topbar { display: flex; align-items: center; justify-content: space-between; }
.counter { font-size: 14px; font-weight: 600; }
.progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 999px; }
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); }

.question { padding: 22px 18px; }
.q-text { font-size: 20px; line-height: 1.6; font-weight: 600; }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 12px 16px; border-radius: 16px;
  border: 1px solid var(--line-strong); background: var(--card); font: inherit; cursor: pointer; color: var(--ink);
  font-size: 22px; font-weight: 700; text-align: left;
}
.option .letter { font-size: 13px; font-weight: 600; color: var(--muted); }
.option:disabled { cursor: default; }
.option.picked { background: var(--accent-soft); border: 2px solid var(--accent); }
.option.right { background: var(--good-soft); border: 2px solid #3FA57A; }
.option.wrong { background: var(--warn-soft); border: 2px solid #D9A441; }

.feedback { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.feedback b { font-size: 13px; }
.feedback.ok { background: var(--good-soft); color: var(--good); }
.feedback.no { background: var(--warn-soft); color: var(--warn); }

/* kesrler */
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; margin: 0 2px; font-size: .9em; }
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 3px 1px; }
.frac > span:last-child { padding: 1px 3px 0; }
.mixed { display: inline-flex; align-items: center; gap: 2px; }

/* xerite */
.root-card { background: var(--bad-soft); border: 2px solid var(--bad-line); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.root-card .label { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--bad); }
.root-card .name { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.root-card p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--bad-ink); }
.good-card { background: var(--good-soft); border: 2px solid #3FA57A; border-radius: 18px; padding: 16px 18px; }
.good-card .name { font-size: 18px; font-weight: 800; color: var(--good); }
.good-card p { margin: 6px 0 0; font-size: 14px; color: var(--good); }
.section-title { font-size: 15px; font-weight: 700; margin: 4px 0 0; }
.concept-list { display: flex; flex-direction: column; gap: 8px; }
.concept { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.concept .c-name { font-size: 15px; font-weight: 600; }
.concept .c-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pill { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.pill.root { background: var(--bad-soft); color: var(--bad); }
.pill.weak { background: var(--warn-soft); color: var(--warn); }
.pill.known { background: var(--good-soft); color: var(--good); }
.pill.unknown { background: var(--line); color: var(--muted); }
.concept.root { border: 2px solid var(--bad-line); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.root { background: var(--bad-line); } .dot.weak { background: #D9A441; } .dot.known { background: #3FA57A; } .dot.unknown { background: #9EA2B5; }

/* plan */
.day { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.day.today { border: 2px solid var(--accent); }
.day-head { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 700; }
.day-head .tag { background: var(--accent); color: #fff; }
.task { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 14px; cursor: pointer; }
.task input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.task.done span { color: var(--muted); text-decoration: line-through; }

/* AI izahi */
.explain { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.explain .ai { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--accent-ink); }
.explain h3 { margin: 0; font-size: 17px; line-height: 1.35; }
.explain p { margin: 0; font-size: 14px; line-height: 1.55; }
.explain .box { background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.55; white-space: pre-line; }
.explain .box b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.explain .tip { background: var(--accent-soft); color: var(--tip-ink); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.explain .src { font-size: 12px; color: var(--muted); }
.skeleton { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--line) 25%, var(--shine) 50%, var(--line) 75%); background-size: 200% 100%; animation: shine 1.2s infinite; }
@keyframes shine { to { background-position: -200% 0; } }
.explain .retry { align-self: flex-start; background: none; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }

/* sual qutusu */
.ask { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.ask label { font-size: 14px; }
.ask-row { display: flex; gap: 8px; }
.ask-row input { flex: 1; min-width: 0; }
.btn.small { height: 46px; width: auto; padding: 0 16px; font-size: 15px; border-radius: 12px; }
.qa { border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.5; }
.qa.q { background: var(--bg); font-weight: 600; }
.qa.a { background: var(--accent-soft); color: var(--tip-ink); }
.qa.blocked { background: var(--warn-soft); color: var(--warn); }
.qa small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; }
/* yoxlanmayib, cetin suala duz cavabdan netice cixarilib */
.pill.implied { background: var(--good-soft); color: var(--good); opacity: .6; }
.dot.implied { background: #3FA57A; opacity: .45; }
.map-more { font-size: 13px; margin: 4px 2px 0; }

/* PWA qurasdirma */
.btn.install { background: var(--card, #fff); color: var(--accent, #3D4BE0); border: 2px solid var(--accent, #3D4BE0); }
.install-hint { font-size: 13px; line-height: 1.45; color: var(--muted); text-align: center; margin: 0; }

/* sesli izah */
.listen { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1.5px solid var(--accent); background: var(--accent-soft, #E8EAFD); color: var(--accent-ink, #2A35B8);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; margin: 4px 0 8px; }
.listen:disabled { opacity: .7; cursor: wait; }
.listen-err { display: block; font-size: 12px; color: var(--bad, #A8302A); margin-bottom: 6px; }

/* kompüterde ekran dar gorunmesin */
@media (min-width: 900px) {
  .phone { max-width: 760px; padding: 40px 32px; }
}
/* kagiz-qelem ipucu */
.paper-tip { font-size: 13px; line-height: 1.45; color: var(--muted); margin: 0; display: flex; gap: 8px; }

/* sinif kodu tesdiqi */
.code-info { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; }
.code-info.ok { color: var(--good, #0F5C3E); }
.code-info.bad { color: var(--bad, #A8302A); }

/* qaranliq tema */
:root[data-theme="dark"] {
  --bg: #11121A; --card: #1A1C27; --ink: #E9EAF2; --muted: #9A9EB5; --line: #2C2F42; --line-strong: #3A3E55;
  --accent: #6E7BFF; --accent-ink: #B4BBFF; --accent-soft: rgba(110,123,255,.16);
  --good: #7FD3AE; --good-soft: rgba(63,165,122,.18); --warn: #F0C674; --warn-soft: rgba(217,164,65,.16);
  --bad: #FF9A92; --bad-line: #E0574F; --bad-soft: rgba(224,87,79,.16);
  --input: #141621; --bad-ink: #FFD1CC; --tip-ink: #C9CEFF; --shine: #2A2D40;
  --c-unknown: #3A3E55;
  color-scheme: dark;
}
/* tema duymesi */
.theme-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
  font-size: 18px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.theme-btn:hover { border-color: var(--accent); }
.theme-btn.floating { position: fixed; top: 14px; right: 14px; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,.08); }

.brand-name .ai { color: var(--accent); }

/* sagird hesabi */
.acct { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 16px; border: 1px dashed var(--line-strong); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.acct.user { border: 1px solid var(--line); border-style: solid; background: var(--card); }
.acct:hover { border-color: var(--accent); }
.acct-ico { font-size: 20px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); }
.acct-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.acct-txt b { font-size: 15px; }
.acct-txt small { font-size: 13px; color: var(--muted); }
.acct-go { color: var(--accent); font-weight: 700; }
.avatar { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 16px; }
.avatar.big { width: 60px; height: 60px; font-size: 26px; }
.login-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin: 8px 0 4px; }
.login-head h1 { margin: 6px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -0.6px; }
.login-head p { margin: 0; font-size: 15px; max-width: 320px; }
.logo.big { width: 64px; height: 64px; }
.me-head { display: flex; align-items: center; gap: 14px; }
.me-head h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.6px; }
.me-head p { margin: 2px 0 0; font-size: 14px; }
.me-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mstat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.mstat b { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.mstat span { font-size: 13px; color: var(--muted); }
.mstat.good b { color: var(--good); }
.mstat.wide { grid-column: 1 / -1; }
.mstat.wide b { font-size: 17px; }
.me-title { margin: 6px 0 0; font-size: 17px; font-weight: 800; }
.me-empty { text-align: center; color: var(--muted); padding: 28px 12px; border: 1px dashed var(--line-strong); border-radius: 16px; line-height: 1.6; }
.hitem { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--bad); border-radius: 14px; padding: 12px 14px; }
.hitem.ok { border-left-color: var(--good); }
.hitem.wip { border-left-color: var(--line-strong); }
.hitem:hover { border-color: var(--accent); }
.hrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hmeta { font-size: 13px; color: var(--muted); }
.hscore { font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.htitle { font-size: 16px; }
.htitle .muted { font-weight: 500; font-size: 14px; }
.hchip { display: inline-block; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--bad-soft); color: var(--bad-ink, var(--bad)); margin: 2px 4px 0 0; }
.hchip.ok { background: var(--good-soft); color: var(--good); }
.hprog { margin: 0; font-size: 14px; color: var(--muted); }
.hprog.ok { color: var(--good); font-weight: 600; }

/* boslugu bagla */
.btn.practice { height: 48px; margin-top: 4px; background: var(--bad); color: var(--card); font-size: 15px; }
.btn.practice:hover { filter: brightness(1.08); }
.closed-card { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.closed-card .label { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--good); }
.concept.closed { border-color: #3FA57A; background: var(--good-soft); }
.pill.closed { background: var(--good); color: #fff; }
.pr-result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 24px 8px; }
.pr-result h2 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.6px; }
.pr-result p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--muted); }
.pr-emoji { font-size: 64px; animation: pop .5s ease-out; }
@keyframes pop { 0% { transform: scale(.3); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.confetti { position: fixed; top: -12px; width: 9px; height: 14px; border-radius: 2px; z-index: 100; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { top: 105vh; transform: rotate(720deg) translateX(40px); } }
.hfix { align-self: flex-start; margin-top: 4px; padding: 9px 14px; border-radius: 12px; background: var(--bad); color: var(--card); font-size: 14px; font-weight: 700; cursor: pointer; }
.hfix:hover { filter: brightness(1.08); }

/* sual metnini secmek / kopyalamaq olmasin */
#screen-test, #screen-practice { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
