/* DenemePusula - okul testleri (optik kâğıt, okuma, havuz, föy) */

.pill.st-off { color: var(--off); background: var(--off-bg); border-color: var(--off-line); }
.hero .pill.st-off { color: #e2e8f0; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); }
.hero .pill.st-ok { background: rgba(16, 185, 129, .15); border-color: rgba(16, 185, 129, .4); color: #6ee7b7; }

/* Deneme listesinde tanıtım şeridi */
.qt-banner { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 14px 18px; border-radius: 16px; text-decoration: none;
    background: linear-gradient(90deg, var(--brand-50), #fff); border: 1px solid #c7d2fe; }
.qt-banner b { color: var(--brand-700); white-space: nowrap; }
.qt-banner span { color: var(--ink-soft); font-size: 13px; flex: 1; }
.qt-banner i { font-style: normal; font-weight: 800; color: var(--brand); }
.qt-banner:hover { border-color: var(--brand); }
@media (max-width: 560px) { .qt-banner { flex-wrap: wrap; } }

/* Nasıl çalışır */
.qt-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.qt-step { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.qt-step b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--brand-50); color: var(--brand-700); font-weight: 800; }
.qt-step h3 { margin: 10px 0 4px; font-size: 15px; }
.qt-step p { margin: 0; color: var(--muted); font-size: 13px; }

/* Test sayfası işlem kartları */
.qt-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 20px; }
.qt-action { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; margin: 0; }
.qt-action h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.qt-action h3 span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 12px; }
.qt-action p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.qt-action .field { margin: 0; }
.qt-action form { margin: 0; }
.qt-alt { display: flex; gap: 6px; flex-wrap: wrap; }

.qt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 13px; }
.qt-chip small { color: var(--muted); font-weight: 600; }
.qt-chip.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.qt-flag { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); font-size: 10px; font-weight: 800; vertical-align: middle; }
.qt-missing { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.qt-missing b { min-width: 52px; }
.qt-missing a { color: var(--ink-soft); }

.qt-foy-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-top: 16px; }
.qt-foy-form .field { margin: 0; min-width: 160px; }
.qt-foy-form strong { align-self: center; }
.card.qt-foy-form { margin-top: 0; }

/* Test oluşturma */
.qt-builder .card { margin-bottom: 16px; }
.qt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.qt-subj { display: grid; grid-template-columns: 1fr 110px 36px; gap: 8px; align-items: end; margin-bottom: 8px; }
.qt-subj .field { margin: 0; }
.qt-x { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; color: var(--muted); }
.qt-x:hover { color: var(--bad); border-color: var(--bad-line); }
.qt-keyrow { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.qt-keyrow:first-child { border-top: 0; }
.qt-keyrow h3 { margin: 0 0 6px; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.qt-keyrow h3 small { color: var(--muted); font-weight: 600; }
.qt-keyrow h3 small.ok { color: var(--ok); }
.qt-keyrow h3 small.bad { color: var(--bad); }
.qt-keyinput { width: 100%; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 16px; letter-spacing: .28em; text-transform: uppercase; }
.qt-keycells { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.qt-keycells span { width: 26px; text-align: center; font: 600 11px/1.6 "JetBrains Mono", monospace; border-radius: 6px; background: var(--line-soft); color: var(--muted); }
.qt-keycells span b { display: block; color: var(--ink); font-size: 12px; }
.qt-keycells span.miss { background: var(--bad-bg); }
.qt-outcomes { margin-top: 8px; }
.qt-outcomes summary { cursor: pointer; font-size: 13px; color: var(--brand-700); font-weight: 600; }
.qt-otable { display: grid; grid-template-columns: 46px 1fr; gap: 4px 8px; margin-top: 8px; align-items: center; }
.qt-otable span { font: 600 12px "JetBrains Mono", monospace; color: var(--muted); text-align: right; }
.qt-otable input { padding: 6px 10px; font-size: 13px; }
.qt-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px 16px; margin: 0 -4px;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; }
.qt-savebar .status { margin: 0 auto 0 0; }
.qt-import-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Elle giriş */
.qt-entry-table td { vertical-align: middle; }
.qt-entry-table .qt-in { display: flex; flex-wrap: wrap; gap: 6px; }
.qt-ans { font: 600 14px "JetBrains Mono", ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; padding: 6px 8px; border-radius: 8px; min-width: 0; }
.qt-ans.bad { border-color: var(--bad); background: var(--bad-bg); }
.qt-sublabel { font-size: 10px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 2px; }
.qt-state { font-size: 12px; font-weight: 700; white-space: nowrap; }
.qt-state.saved { color: var(--ok); }
.qt-state.dirty { color: var(--warn); }
.qt-state.err { color: var(--bad); }
.qt-score { font: 600 12px "JetBrains Mono", monospace; white-space: nowrap; color: var(--ink-soft); }

/* Tek öğrenci düzeltme */
.qt-student-grid { display: grid; gap: 16px; }
.qt-student-grid.has-scan { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .qt-student-grid.has-scan { grid-template-columns: 1fr; } }
.qt-scanimg img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.qt-bubbles { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 4px 18px; }
.qt-bsub { grid-column: 1 / -1; margin: 12px 0 4px; font-size: 14px; }
.qt-bq { display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 10px; }
.qt-bq.flag { background: var(--warn-bg); outline: 1px solid var(--warn-line); }
.qt-bq > span { width: 26px; text-align: right; font: 700 12px "JetBrains Mono", monospace; color: var(--muted); margin-right: 4px; }
.qt-bq button { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid #94a3b8; background: #fff; font: 700 12px inherit; color: #64748b; cursor: pointer; padding: 0; }
.qt-bq button.on { background: #1e293b; border-color: #1e293b; color: #fff; }
.qt-bq button.key { box-shadow: 0 0 0 2px var(--ok-line); }
.qt-bq button.on.wrong { background: var(--bad); border-color: var(--bad); }
.qt-bq button.on.right { background: var(--ok); border-color: var(--ok); }
.qt-bq em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--warn); margin-left: 2px; }

/* Tarayıcı */
.qt-scanner { max-width: 760px; margin: 0 auto; }
.qt-scan-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.qt-scan-head h1 { font-size: 24px; }
.qt-scan-head .eyebrow a { color: var(--brand-700); }
.qt-scan-count { text-align: right; }
.qt-scan-count b { font-size: 28px; font-weight: 800; }
.qt-scan-count span { color: var(--muted); font-weight: 600; margin-left: 4px; }
.qt-cam { position: relative; background: #0f172a; border-radius: 18px; overflow: hidden; aspect-ratio: 3 / 4; max-height: 72vh; margin: 0 auto; }
.qt-cam video, .qt-cam canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.qt-cam-guide { position: absolute; inset: 6%; pointer-events: none; }
.qt-cam-guide i { position: absolute; width: 34px; height: 34px; border: 3px solid rgba(255, 255, 255, .55); }
.qt-cam-guide i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.qt-cam-guide i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.qt-cam-guide i:nth-child(3) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.qt-cam-guide i:nth-child(4) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.qt-cam-msg { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: 92%; padding: 8px 14px; border-radius: 999px;
    background: rgba(15, 23, 42, .78); color: #fff; font-weight: 700; font-size: 13px; text-align: center; }
.qt-cam-msg.ok { background: rgba(4, 120, 87, .92); }
.qt-cam-msg.warn { background: rgba(180, 83, 9, .92); }
.qt-scan-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin: 14px 0 6px; }
.qt-scan-ctl label.btn { cursor: pointer; }
.qt-scanner .hint { text-align: center; }
.qt-result { background: var(--surface); border: 2px solid var(--ok-line); border-radius: 16px; padding: 14px 16px; margin: 12px 0; box-shadow: var(--shadow); }
.qt-result.warn { border-color: var(--warn-line); }
.qt-result.err { border-color: var(--bad-line); }
.qt-result h3 { margin: 0; font-size: 17px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.qt-result h3 small { color: var(--muted); font-weight: 600; font-size: 13px; }
.qt-result p { margin: 6px 0 0; font-size: 13px; }
.qt-result .field { margin: 8px 0 0; }
.qt-fix { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.qt-fix .qt-bq { background: var(--warn-bg); }
.qt-log { margin: 0; padding-left: 22px; font-size: 13px; }
.qt-log li { padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.qt-log li span { color: var(--muted); }
.qt-log li.warn span { color: var(--warn); font-weight: 600; }

/* Optik dosya */
.qt-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 14px 0; }
.qt-map .field { margin: 0; }
.qt-raw { font: 12px/1.5 "JetBrains Mono", monospace; background: var(--line-soft); border-radius: 10px; padding: 10px 12px; overflow-x: auto; white-space: pre; max-height: 180px; }
.qt-ruler { color: var(--muted); }
.qt-prev td { font-size: 12px; }
.qt-prev .mono { letter-spacing: .06em; }
.qt-prev tr.nomatch td { background: var(--bad-bg); }
.qt-prev select { padding: 4px 8px; font-size: 12px; }

/* Soru içeriği */
.qt-upl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.qt-upl .qt-action label.btn { cursor: pointer; }
.qt-qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.qt-qcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-height: 140px; }
.qt-qcard header { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; font-weight: 700; }
.qt-qcard header span { color: var(--muted); font-weight: 600; }
.qt-qcard .qt-qbody { flex: 1; font-size: 12px; max-height: 260px; overflow: auto; }
.qt-qcard .qt-qbody img { max-width: 100%; display: block; border-radius: 6px; }
.qt-qcard footer { display: flex; gap: 6px; flex-wrap: wrap; }
.qt-qcard footer label.btn { cursor: pointer; }
.qt-qcard.empty .qt-qbody { color: var(--muted); display: grid; place-items: center; text-align: center; }
.qt-qcard.cut { outline: 2px solid var(--brand); }
.qt-modal { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .6); display: grid; place-items: center; padding: 16px; }
.qt-modal > div { background: #fff; border-radius: 16px; padding: 14px; max-width: min(980px, 100%); max-height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.qt-modal .qt-cropwrap { position: relative; overflow: auto; max-height: 70vh; cursor: crosshair; user-select: none; touch-action: none; }
.qt-modal canvas { display: block; max-width: 100%; }
.qt-modal .qt-sel { position: absolute; border: 2px solid var(--brand); background: rgba(79, 70, 229, .12); pointer-events: none; }
.qt-modal .row-actions { justify-content: flex-end; }

/* Föy ve havuz */
.qt-foy { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.qt-foy-exam { margin: 12px 0 0; font-size: 18px; }
.qt-foy-exam small, .qt-foy-sub small { color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 6px; }
.qt-foy-sub { margin: 4px 0 0; font-size: 15px; color: var(--brand-700); }
.qt-q { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; break-inside: avoid; }
.qt-q header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; font-size: 13px; }
.qt-q header b { font-size: 15px; }
.qt-q header > span:first-of-type { font-weight: 700; }
.qt-q-stat { color: var(--muted); font-size: 12px; font-weight: 600; }
.qt-q-stat.wrong { color: var(--bad); }
.qt-q-stat.blank { color: var(--warn); }
.qt-done { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; color: var(--ok); cursor: pointer; }
.qt-q.is-done { opacity: .55; }
.qt-qimg { max-width: 100%; max-height: 520px; display: block; margin: 4px 0; }
.qt-qtext { font-size: 14px; line-height: 1.6; }
.qt-opts { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 14px; }
.qt-outcome { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.qt-noq { margin: 0; color: var(--muted); font-size: 13px; font-style: italic; }
.qt-key p { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; font-family: "JetBrains Mono", monospace; font-size: 13px; }

@media print {
    .qt-foy { gap: 8px; }
    .qt-q { border-color: #cbd5e1; padding: 8px 10px; }
    .qt-qimg { max-height: 420px; }
    .qt-key { break-before: page; }
    .qt-q.is-done { display: none; }
}

/* Soruyu elle yazma (qt-write.mjs) */
.qt-write-card { border-color: #c7d2fe; background: linear-gradient(180deg, #fff, var(--brand-50)); }
.qt-write-card .btn { align-self: flex-start; }
.qt-qwrite { width: 100%; height: 100%; min-height: 70px; border: 1.5px dashed #c7d2fe; border-radius: 10px; background: var(--brand-50); color: var(--brand-700); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.qt-qwrite:hover { background: #e0e7ff; }
dialog.qw { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 24px 64px rgba(15, 23, 42, .28); color: var(--ink); background: var(--surface); }
dialog.qw::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.qw-form { display: flex; flex-direction: column; max-height: inherit; margin: 0; }
.qw-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.qw-title { flex: 1; display: flex; flex-direction: column; text-align: center; line-height: 1.25; }
.qw-title b { font-size: 16px; }
.qw-title span { font-size: 12px; color: var(--muted); font-weight: 600; }
.qw-x { border: 0; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 8px; }
.qw-x:hover { background: var(--line-soft); color: var(--ink); }
.qw-body { padding: 14px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.qw-tools { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--line-soft); position: sticky; top: -14px; z-index: 1; }
.qw-tools button { min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: var(--surface); font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.qw-tools button:hover { border-color: #c7d2fe; color: var(--brand-700); }
.qw-sep { width: 1px; background: var(--line); margin: 3px 4px; }
.qw-label { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-top: 2px; }
.qw-label small { font-weight: 600; color: var(--muted); margin-left: 6px; }
.qw-edit { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 15px; line-height: 1.6; background: #fff; outline: none; overflow-wrap: anywhere; }
.qw-edit:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.qw-edit:empty::before { content: attr(data-ph); color: #94a3b8; pointer-events: none; }
.qw-stem { min-height: 130px; }
.qw-img figure { margin: 0; display: grid; gap: 6px; }
.qw-img img { max-width: 100%; max-height: 260px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; justify-self: start; }
.qw-img figcaption { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.qw-imgadd { cursor: pointer; }
.qw-opts { display: grid; gap: 6px; }
.qw-opt { display: flex; align-items: flex-start; gap: 8px; }
.qw-key { flex: none; cursor: pointer; }
.qw-key input { position: absolute; opacity: 0; pointer-events: none; }
.qw-key span { display: grid; place-items: center; width: 34px; height: 34px; margin-top: 3px; border-radius: 50%; border: 1.5px solid var(--line); font-weight: 800; color: var(--ink-soft); background: #fff; transition: all .12s; }
.qw-key:hover span { border-color: var(--brand); }
.qw-key input:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; }
.qw-key input:focus-visible + span { box-shadow: 0 0 0 3px rgba(79, 70, 229, .25); }
.qw-optin { flex: 1; padding: 7px 12px; min-height: 40px; }
.qw-nokey { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0 4px; cursor: pointer; justify-self: start; width: auto; }
.qw-nokey input { width: auto; margin: 0; }
.qw-out { margin: 0; }
.qw-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--line-soft); border-radius: 0 0 20px 20px; }
.qw-hint { flex: 1; font-size: 12px; }
@media (max-width: 560px) {
    .qw-hint { display: none; }
    .qw-foot { flex-wrap: wrap; }
    .qw-foot .btn { flex: 1; }
    .qw-body { padding: 12px; }
}

/* Test formu: sorular ızgarası */
.qt-wq-subj + .qt-wq-subj { margin-top: 14px; }
.qt-wq-subj h3 { margin: 0 0 8px; font-size: 14px; }
.qt-wq { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.qt-wqt { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 74px; padding: 8px 10px; border: 1.5px dashed #cbd5e1; border-radius: 12px; background: var(--surface); font: inherit; text-align: left; cursor: pointer; color: var(--muted); transition: border-color .12s, background .12s; }
.qt-wqt:hover { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.qt-wqt b { font-size: 13px; color: var(--ink); }
.qt-wqt span { font-size: 11.5px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qt-wqt.on { border-style: solid; border-color: #c7d2fe; background: var(--brand-50); color: var(--ink-soft); }
.qt-wqt i { position: absolute; top: 7px; right: 8px; font-style: normal; font-weight: 800; font-size: 11px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: #fff; }
.qt-wq-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.qt-wq-actions .hint { margin: 0; flex: 1; min-width: 220px; }

/* Formüller (qt-math.mjs, KaTeX) */
.qw-tools .qw-mathbtn { font-weight: 700; color: var(--brand-700); border-color: #c7d2fe; }
.qw-math { display: grid; gap: 8px; padding: 10px; border: 1px solid #c7d2fe; border-radius: 14px; background: var(--brand-50); }
.qw-math[hidden] { display: none; }
.qw-mtabs { display: flex; flex-wrap: wrap; gap: 4px; }
.qw-mtabs button { border: 0; border-radius: 999px; padding: 4px 12px; background: transparent; font: inherit; font-size: 12px; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.qw-mtabs button[aria-selected="true"] { background: var(--brand); color: #fff; }
.qw-mtpl { display: flex; flex-wrap: wrap; gap: 4px; }
.qw-mtpl button { min-width: 36px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: inherit; font-size: 14px; cursor: pointer; color: var(--ink); }
.qw-mtpl button:hover { border-color: var(--brand); color: var(--brand-700); }
.qw-math textarea { width: 100%; box-sizing: border-box; min-height: 44px; resize: vertical; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #fff; }
.qw-math textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.qw-mprev { min-height: 40px; padding: 6px 10px; border-radius: 10px; background: #fff; border: 1px dashed var(--line); font-size: 17px; overflow-x: auto; display: flex; align-items: center; }
.qw-mprev .katex-display { margin: 0; flex: 1; }
.qw-mprev .muted { font-size: 12px; }
.qw-mfoot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qw-mdisp { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; margin: 0; cursor: pointer; width: auto; }
.qw-mdisp input { width: auto; margin: 0; }
.qw-mhint { font-size: 11px; margin-right: auto; }
.qw-prev { border: 1px dashed var(--line); border-radius: 12px; padding: 8px 12px; background: var(--line-soft); }
.qw-prev[hidden] { display: none; }
.qw-prev-body { font-size: 15px; line-height: 1.6; }
.katex { font-size: 1.08em; }
.katex-display { margin: .4em 0; overflow-x: auto; overflow-y: hidden; }
.katex .katex-error, .katex-error { color: var(--err, #b91c1c) !important; }
.qt-wqt .katex { font-size: 1em; }
.qt-opts .katex-display { display: inline-block; margin: 0; }

/* Görsel formül editörü (MathLive) */
.qw-mf { display: block; width: 100%; box-sizing: border-box; min-height: 52px; padding: 6px 10px; font-size: 22px; border: 1px solid var(--line); border-radius: 10px; background: #fff; --caret-color: var(--brand); --selection-background-color: #e0e7ff; --placeholder-color: #6366f1; --primary: var(--brand); }
.qw-mf:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); outline: none; }
.qw-mf[hidden], .qw-math textarea[hidden], .qw-mprev[hidden], .qw-mtip[hidden], .qw-mload[hidden], .qw-mfoot [hidden] { display: none; }
.qw-mf::part(menu-toggle) { display: none; }
.qw-mf::part(virtual-keyboard-toggle) { display: none; }
.qw-mload { font-size: 13px; padding: 14px 10px; }
.qw-mtip { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.qw-mtip b { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; font-weight: 600; }

/* Soru içeriği: toplu temizleme */
.qt-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--line-soft); }
.qt-bulk-t { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-right: 4px; }
.qt-btn-danger { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-line); }
.qt-btn-danger:hover:not(:disabled) { background: var(--bad); color: #fff; }
.qt-btn-danger:disabled { opacity: .5; cursor: not-allowed; }
.qt-selbar { position: sticky; top: 8px; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--brand); box-shadow: 0 6px 18px rgba(15, 23, 42, .12); }
.qt-selbar .hint { margin: 0; }
.qt-qgrid.is-sel .qt-qcard[data-pick] { cursor: pointer; }
.qt-qgrid.is-sel .qt-qcard:not([data-pick]) { opacity: .45; }
.qt-qcard.picked { outline: 2px solid var(--bad); background: var(--bad-bg); }
.qt-pick { width: 16px; height: 16px; margin: 0 6px 0 0; vertical-align: -3px; accent-color: var(--bad); }
.qt-wqt span:has(img) { display: block; width: 100%; }
.qt-wqt span img { display: block; max-width: 100%; max-height: 64px; object-fit: contain; object-position: left top; border-radius: 4px; background: #fff; }

/* Görsel kırpma (qt-crop.mjs) */
.qt-cropdlg { border: 0; border-radius: 16px; padding: 14px; width: min(1000px, calc(100vw - 24px)); max-height: calc(100vh - 24px); background: #fff; color: var(--ink); box-shadow: 0 20px 60px rgba(15, 23, 42, .35); }
.qt-cropdlg[open] { display: flex; flex-direction: column; gap: 10px; }
.qt-cropdlg::backdrop { background: rgba(15, 23, 42, .6); }
.qt-crophead { display: flex; align-items: center; gap: 10px; }
.qt-crophead b { flex: 1; }
.qt-croptools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.qt-croptools .hint { margin: 0; }
.qt-cropstage { overflow: auto; padding: 10px; border-radius: 10px; background: var(--line-soft); min-height: 120px; }
.qt-cropwrap2 { position: relative; overflow: hidden; width: fit-content; max-width: 100%; margin: 0 auto; touch-action: none; user-select: none; cursor: crosshair; }
.qt-cropwrap2 canvas { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; }
.qt-sel2 { position: absolute; border: 2px solid var(--brand); box-shadow: 0 0 0 9999px rgba(15, 23, 42, .42); pointer-events: none; }
.qt-sel2 i { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid var(--brand); border-radius: 3px; }
.qt-sel2 .h-nw { left: -7px; top: -7px; } .qt-sel2 .h-n { left: calc(50% - 6px); top: -7px; } .qt-sel2 .h-ne { right: -7px; top: -7px; }
.qt-sel2 .h-e { right: -7px; top: calc(50% - 6px); } .qt-sel2 .h-se { right: -7px; bottom: -7px; } .qt-sel2 .h-s { left: calc(50% - 6px); bottom: -7px; }
.qt-sel2 .h-sw { left: -7px; bottom: -7px; } .qt-sel2 .h-w { left: -7px; top: calc(50% - 6px); }
.qt-cropfoot { display: flex; justify-content: flex-end; gap: 8px; }

/* Soru kartında konu */
.qt-qout { align-self: flex-start; max-width: 100%; text-align: left; font: inherit; font-size: 11.5px; line-height: 1.35; color: var(--ink-soft); background: var(--line-soft); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; cursor: pointer; }
.qt-qout:hover { border-color: var(--brand); }
.qt-qout.none { color: var(--brand); background: transparent; border-style: dashed; }
.qt-oform { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.qt-oform input { flex: 1 1 100%; min-width: 0; font: inherit; font-size: 12px; padding: 5px 8px; border: 1.5px solid var(--brand); border-radius: 8px; }
.qt-oform .hint { margin: 0; font-size: 11px; }
.qt-bulk-o { margin: 0 0 0 auto; }
.qt-selo { display: inline-flex; gap: 4px; align-items: center; flex: 1 1 280px; }
.qt-selo input { flex: 1; min-width: 140px; font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; }

/* Konu arşivi */
.pill.st-ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.pill.st-mid { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.pill.st-bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.qt-chips { margin: 0 0 12px; }
.qt-chip { color: var(--ink); background: var(--surface); }
.qt-chip span { color: var(--muted); font-weight: 600; }
.qt-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.qt-chip.on span { color: rgba(255, 255, 255, .8); }
.qt-topic-table tr.qt-topic-unused td { color: var(--muted); }
.qt-topic-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.qt-topic-form .field { margin: 0; min-width: 200px; }
.qt-topic-form .qt-grow, .qt-topic-tools .qt-topic-form .field { flex: 1 1 320px; }
.qt-topic-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.qt-topic-tools > .qt-topic-form { flex: 1 1 420px; }
.qt-arc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; margin-top: 14px; }
.qt-arc-q { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; break-inside: avoid; }
.qt-arc-q header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
.qt-arc-q header a { color: inherit; text-decoration: none; }
.qt-arc-q header a:hover { text-decoration: underline; }
.qt-arc-body .qt-qimg { max-width: 100%; display: block; border-radius: 8px; }
.qt-arc-body { font-size: 14px; }
@media print {
    .qt-arc-grid { display: block; }
    .qt-arc-q { margin: 0 0 12px; border-color: #999; }
}

/* Konu arşivi: karışık test */
.qt-mix-n { width: 64px; padding: 4px 6px; text-align: right; border: 1px solid var(--line, #d0d7e2); border-radius: 6px; font: inherit; }
.qt-mix-fill { flex: 0 0 110px; min-width: 0 !important; }
.qt-mix-fill input { width: 100%; }
.qt-check { display: inline-flex; align-items: center; gap: 6px; padding-bottom: 12px; white-space: nowrap; }
.qt-mix-total { margin-left: auto; }
.qt-mix-total { padding-bottom: 12px; font-weight: 700; }
.qt-mix-total.bad { color: #c62828; }

/* "Soru Yükle" ile gelindiğinde PDF kitapçık butonunu vurgula */
@keyframes qt-attn { 0%, 100% { box-shadow: 0 0 0 0 rgba(0, 88, 190, .55); } 50% { box-shadow: 0 0 0 7px rgba(0, 88, 190, 0); } }
.qt-attn { animation: qt-attn 1.4s ease-in-out 4; }
.qt-attn-hint { font-size: .85rem; font-weight: 600; color: #0058be; white-space: nowrap; }

/* Otomatik test (?otomatik=1) */
.qa-form .card { margin-bottom: 16px; }
.qa-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.qa-mode { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.qa-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--surface); }
.qa-opt input, .qa-topic input { width: auto; flex: none; margin: 0; padding: 0; box-shadow: none; accent-color: var(--brand); }
.qa-opt input { margin-top: 3px; }
.qa-opt span { display: flex; flex-direction: column; gap: 2px; }
.qa-opt small { color: var(--muted); font-size: 12.5px; }
.qa-opt:has(input:checked) { border-color: var(--brand); background: #eff6ff; }
.qa-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.qa-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.qa-list { display: flex; flex-direction: column; gap: 8px; }
.qa-subj { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; background: var(--surface); transition: border-color .15s; }
.qa-subj.on { border-color: #93c5fd; background: #f8fbff; }
.qa-subj-row { display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(60px, 2fr) auto; align-items: center; gap: 14px; }
.qa-subj-name { display: flex; flex-direction: column; }
.qa-subj-name small { color: var(--muted); font-size: 12px; }
.qa-bar { height: 6px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.qa-bar i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .2s; }
.qa-n { display: inline-flex; align-items: center; gap: 6px; }
.qa-n input { width: 72px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-weight: 700; text-align: right; }
.qa-n span { color: var(--muted); font-size: 12.5px; min-width: 42px; }
.qa-topics { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.qa-topics-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12.5px; }
.qa-topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.qa-topic { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13px; }
.qa-topic span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qa-topic small { color: var(--muted); font-weight: 700; }
.qa-topic:has(input:checked) { border-color: var(--brand); background: #eff6ff; }
.qa-topic.qa-none span { font-style: italic; color: var(--ink-soft); }
.qa-submit { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; box-shadow: 0 8px 28px rgba(15, 23, 42, .14); }
.qa-total { font-size: 20px; font-weight: 800; margin-right: 6px; }
.qa-total.bad { color: var(--bad); }
@media (max-width: 640px) {
    .qa-subj-row { grid-template-columns: 1fr auto; }
    .qa-bar { grid-column: 1 / -1; order: 3; }
    .qa-submit { flex-direction: column; align-items: stretch; text-align: center; }
}
.qa-row .qt-grow { flex: 1 1 280px; }
