:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e2e6ec;
  --accent: #0f4c81;
  --accent-dark: #0b3a63;
  --soft: #eef3f8;
  --warn-bg: #fdf3e3;
  --warn-ink: #8a5a12;
  --ok-bg: #e8f5ee;
  --ok-ink: #1c6b45;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.wrap { width: min(980px, calc(100% - 32px)); margin: 0 auto; }

/* Başlık */
.top { background: var(--accent); color: #fff; }
.top-inner { display: flex; align-items: flex-end; justify-content: space-between; padding: 22px 0 20px; gap: 16px; }
.brand { font-size: 26px; font-weight: 800; letter-spacing: .14em; }
.brand-sub { font-size: 13px; opacity: .82; margin-top: 2px; }
.site { font-size: 13px; opacity: .82; white-space: nowrap; }

/* Paneller */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 18px;
  margin: 18px 0;
}
.panel-head { margin-bottom: 16px; }
.panel-head h2 { margin: 0 0 3px; font-size: 18px; letter-spacing: -.01em; }
.panel-head p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* Alanlar */
.grid { display: grid; gap: 12px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field span { font-size: 12.5px; font-weight: 600; color: #475467; }

input[type="number"], input[type="text"], select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #cfd6df;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 76, 129, .12); }

.more { margin-top: 14px; }
.more summary {
  cursor: pointer;
  font-size: 13.5px;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+"; display: inline-block; width: 18px; }
.more[open] summary::before { content: "−"; }

/* Düğmeler */
.actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.template-save {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
}
.template-save .hint { margin: 0; }
button {
  font: inherit;
  font-size: 14.5px;
  font-weight: 650;
  border-radius: 10px;
  padding: 10px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
button.primary { background: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-dark); }
button.ghost { background: #fff; color: var(--accent); border-color: #c9d5e2; }
button.ghost:hover { background: var(--soft); }
button:disabled { opacity: .55; cursor: default; }

.status { font-size: 13px; color: var(--muted); }
.stats-table th:not([data-nosort]) {
  cursor: pointer;
  user-select: none;
}
.stats-table th:not([data-nosort]):hover { color: var(--accent); }
.stats-table th:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  opacity: .75;
}
.stats-table th[data-nosort] { cursor: default; }
.row-link { color: var(--accent); font-weight: 650; text-decoration: none; }
.row-link:hover { text-decoration: underline; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.metric-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--soft, #f8fafc);
}
.metric-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.metric-value { font-size: 20px; font-weight: 800; color: var(--ink); margin-top: 4px; }
.metric-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.answer-strip { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 12px; }
.strip-cell {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 4px;
  border-radius: 5px; font-size: 10px; font-weight: 700;
}
.strip-dogru { background: var(--ok-bg, #e8f6ee); color: var(--ok-ink, #17643a); }
.strip-yanlis { background: #fdecec; color: #8f2323; }
.strip-bos { background: #eef1f4; color: #5b6470; }
.strip-kapsam_disi { background: transparent; color: #b6bcc4; border: 1px dashed var(--line); }
.bar-track {
  height: 8px; border-radius: 999px; background: var(--line);
  overflow: hidden; min-width: 80px; display: block;
  width: 100%; margin-bottom: 3px;
}
.bar-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.bar-hot { background: #c2410c; }
.plain-list { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink); }
.plain-list li { margin-bottom: 4px; }
.answer-select {
  font: inherit; font-size: 12.5px; padding: 4px 6px;
  border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--ink);
}
@media (max-width: 720px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.progress { margin-top: 14px; }
.progress-head {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12.5px; color: var(--muted); margin-bottom: 6px;
}
.progress-track {
  height: 10px; border-radius: 999px; background: var(--line);
  overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--accent); transition: width .25s ease;
}
.hint { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }
.hint.warn { color: var(--warn-ink); background: var(--warn-bg); padding: 10px 12px; border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* Yükleme alanı */
.drop {
  border: 1.5px dashed #b8c4d2;
  border-radius: 12px;
  background: #fafbfd;
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  outline: none;
}
.drop:hover, .drop:focus, .drop.drag { border-color: var(--accent); background: var(--soft); }
.drop-icon { color: var(--accent); margin-bottom: 6px; }
.drop-title { margin: 0 0 4px; font-weight: 600; }
.drop img { max-width: 100%; max-height: 320px; border-radius: 8px; margin-top: 12px; border: 1px solid var(--line); }

/* Çıktı */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
}
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }

.answers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
}
.ans {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  background: #fff;
}
.ans .no {
  font-size: 11.5px; color: var(--muted); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ans .letter { font-size: 17px; font-weight: 800; color: var(--accent); }
.ans.empty .letter { color: #98a2b3; font-size: 14px; }
.ans.warn { background: var(--warn-bg); border-color: #f0d7ab; }
.ans.warn .letter { color: var(--warn-ink); }

.alert {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fdecec;
  border: 1px solid #f5c2c2;
  color: #8f2323;
  font-size: 14px;
}

.foot { padding: 18px 0 40px; color: var(--muted); font-size: 12.5px; }

@media (max-width: 720px) {
  .grid.three, .grid.two { grid-template-columns: 1fr; }
  .top-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .brand { font-size: 22px; }
  .panel { padding: 18px 16px 14px; }
  .answers { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101418;
    --card: #171d24;
    --ink: #e6eaf0;
    --muted: #9aa5b1;
    --line: #27303a;
    --soft: #1d2731;
    --warn-bg: #322613;
    --warn-ink: #f0c274;
    --ok-bg: #143022;
    --ok-ink: #7fd6a5;
  }
  input[type="number"], input[type="text"], select { background: #111820; border-color: #32404e; }
  button.ghost { background: #171d24; border-color: #32404e; }
  .drop { background: #131a21; }
  .ans { background: #171d24; }
}

/* Çoklu dosya listesi */
.filelist { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fileitem {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; background: #fff;
}
.fileitem .thumb {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 8px; overflow: hidden; background: var(--soft);
  display: flex; align-items: center; justify-content: center;
}
.fileitem .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdf-badge { font-size: 11px; font-weight: 800; color: #b42318; letter-spacing: .05em; }
.fileitem .fname {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fileitem .fmeta { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.fileitem .remove {
  border: 0; background: transparent; color: var(--muted);
  font-size: 22px; line-height: 1; padding: 2px 8px; border-radius: 8px;
}
.fileitem .remove:hover { background: #fdecec; color: #8f2323; }

/* Form başına sonuç kartı */
.form-results { display: flex; flex-direction: column; gap: 16px; }
.form-card {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; background: #fbfcfd;
}
.form-card-head {
  display: flex; justify-content: space-between; gap: 12px;
  align-items: flex-start; margin-bottom: 10px; flex-wrap: wrap;
}
.form-card-title { min-width: 0; }
.form-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; word-break: break-word; }
.form-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* Dosya bazlı hatalar */
.errors { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.error-item {
  font-size: 13.5px; color: #8f2323;
  background: #fdecec; border: 1px solid #f5c2c2;
  border-radius: 8px; padding: 8px 10px;
}

@media (prefers-color-scheme: dark) {
  .fileitem { background: #171d24; }
  .form-card { background: #131a21; }
  .fileitem .remove:hover { background: #3a1d1d; color: #f0a3a3; }
  .error-item { background: #3a1d1d; border-color: #5c2a2a; color: #f0a3a3; }
}

/* Üst bar eylemleri */
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top-actions form { margin: 0; }
.ghost-link { color: #fff; opacity: .88; text-decoration: none; font-size: 13.5px; font-weight: 600; }
.ghost-link:hover { opacity: 1; text-decoration: underline; }
button.small, .button.small { padding: 7px 12px; font-size: 13px; }
button.danger { color: #b42318; border-color: #f0c2c2; background: #fff; }
button.danger:hover { background: #fdecec; }

/* Bağlantı görünümlü düğmeler */
a.button {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; font-weight: 650; border-radius: 10px;
  padding: 10px 16px; border: 1px solid transparent; font-size: 14.5px;
}
a.button.primary { background: var(--accent); color: #fff; }
a.button.primary:hover { background: var(--accent-dark); }
a.button.ghost { background: #fff; color: var(--accent); border-color: #c9d5e2; }
a.button.ghost:hover { background: var(--soft); }
a.button.small { padding: 7px 12px; font-size: 13px; }

/* Bildirimler */
.flash { margin: 18px 0 0; padding: 11px 14px; border-radius: 10px; font-size: 14px; }
.flash.success { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid #bfe3cf; }
.flash.error { background: #fdecec; color: #8f2323; border: 1px solid #f5c2c2; }

/* Sınav listesi */
.exam-list { display: flex; flex-direction: column; gap: 10px; }
.exam-card {
  display: flex; gap: 14px; justify-content: space-between; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  background: #fbfcfd; flex-wrap: wrap;
}
.exam-card-main { min-width: 0; flex: 1; }
.exam-title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.exam-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--muted); align-items: center; }
.exam-note { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.exam-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.exam-actions form { margin: 0; }
.ok-text { color: var(--ok-ink); }
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--soft); color: var(--accent);
  padding: 2px 8px; border-radius: 6px; font-weight: 700; letter-spacing: .06em;
}
.new-exam { margin-top: 16px; }
.new-exam summary { cursor: pointer; font-weight: 700; color: var(--accent); font-size: 14px; }
.exam-form { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cfd6df; border-radius: 10px;
  font: inherit; font-size: 14.5px; background: #fff; color: var(--ink);
  resize: vertical; outline: none;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 76, 129, .12); }
.download-form { border-top: 1px solid var(--line); padding-top: 12px; }
.exam-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.form-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.chip.score { background: #eef3f8; color: var(--accent); font-size: 14px; }

/* Puan renkleri */
.ans.correct { background: var(--ok-bg); border-color: #bfe3cf; }
.ans.correct .letter { color: var(--ok-ink); }
.ans.wrong { background: #fdecec; border-color: #f5c2c2; }
.ans.wrong .letter { color: #8f2323; }
.ans .key { font-size: 11px; color: var(--muted); font-weight: 700; }
.ans .key::before { content: "→ "; }

/* Giriş / şifre ekranı */
.auth-body {
  background: var(--bg); min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.auth-wrap { width: min(420px, 100%); }
.auth-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); padding: 28px 26px;
}
.auth-brand { font-size: 24px; font-weight: 800; letter-spacing: .14em; color: var(--accent); }
.auth-sub { font-size: 12.5px; color: var(--muted); margin: 2px 0 18px; }
.auth-card h1 { font-size: 20px; margin: 0 0 6px; }
.auth-card .muted { font-size: 13.5px; margin: 0 0 18px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.auth-field span { font-size: 12.5px; font-weight: 600; color: #475467; }
.auth-field input {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid #cfd6df;
  border-radius: 10px; font: inherit; font-size: 15px;
  background: #fff; color: var(--ink); outline: none;
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 76, 129, .12); }
.auth-submit { width: 100%; margin-top: 6px; }
.auth-alert { margin: 14px 0 0; }
.notice { padding: 10px 12px; border-radius: 8px; font-size: 13.5px; margin-bottom: 14px; }
.notice.ok { background: var(--ok-bg); color: var(--ok-ink); }
.auth-link { margin: 16px 0 0; font-size: 13.5px; text-align: center; }
.auth-link a { color: var(--accent); }

@media (prefers-color-scheme: dark) {
  .exam-card { background: #131a21; }
  a.button.ghost { background: #171d24; border-color: #32404e; }
  button.danger { color: #f0a3a3; border-color: #5c2a2a; background: #171d24; }
  button.danger:hover { background: #3a1d1d; }
  .auth-field input, textarea { background: #111820; border-color: #32404e; }
  .ans.correct { background: #143022; border-color: #20503a; }
  .ans.wrong { background: #3a1d1d; border-color: #5c2a2a; }
  .chip.score { background: #1d2731; }
}

/* Sınıflar ve öğrenciler */
.class-list { display: flex; flex-direction: column; gap: 10px; }
.class-card {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: #fbfcfd; flex-wrap: wrap;
}
.class-card-main { min-width: 0; }
.class-title { font-weight: 700; font-size: 15px; }
.student-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.student-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fff;
}
.student-name { font-weight: 600; font-size: 14px; }
.student-item form { margin: 0; }

@media (prefers-color-scheme: dark) {
  .class-card { background: #131a21; }
  .student-item { background: #171d24; }
}

/* İstatistik tabloları */
.stats-block { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.stats-block:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.stats-head { margin-bottom: 10px; }
.stats-block h3 { font-size: 13.5px; margin: 16px 0 8px; }
.table-wrap { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats-table th, .stats-table td {
  text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.stats-table th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700;
}
.stats-table tr:last-child td { border-bottom: 0; }
.rate { font-weight: 700; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.rate.low { background: #fdecec; color: #8f2323; }
.rate.mid { background: var(--warn-bg); color: var(--warn-ink); }
.rate.high { background: var(--ok-bg); color: var(--ok-ink); }

/* Soru türleri / konuları */
.topics { margin-top: 6px; }
.topics summary { cursor: pointer; font-weight: 700; color: var(--accent); font-size: 14px; margin-bottom: 4px; }
.topic-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px;
  margin-top: 10px; max-height: 520px; overflow: auto; padding-right: 4px;
}
.topic-row { display: flex; align-items: center; gap: 8px; }
.topic-no { flex: 0 0 30px; text-align: right; font-size: 12px; color: var(--muted); font-weight: 600; }
.topic-row input { height: 34px; font-size: 13.5px; }

@media (max-width: 720px) {
  .topic-grid { grid-template-columns: 1fr; max-height: none; }
}

@media (prefers-color-scheme: dark) {
  .rate.low { background: #3a1d1d; color: #f0a3a3; }
}

/* Konu kataloğu */
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--soft); color: var(--accent);
  border-radius: 999px; padding: 4px 6px 4px 12px;
  font-size: 12.5px; font-weight: 600;
}
.topic-chip form { margin: 0; }
.chip-x {
  border: 0; background: transparent; color: inherit;
  font-size: 16px; line-height: 1; padding: 0 6px;
  border-radius: 999px; cursor: pointer;
}
.chip-x:hover { background: #fdecec; color: #8f2323; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 200px; height: 40px; }

@media (prefers-color-scheme: dark) {
  .chip-x:hover { background: #3a1d1d; color: #f0a3a3; }
}

/* QR okunamazsa elle atama */
.assign-box {
  margin-top: 12px; padding: 10px 12px;
  border: 1px dashed #c9d5e2; border-radius: 10px; background: #fafbfd;
}
.assign-title { font-size: 12.5px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.assign-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.assign-row select { flex: 1; min-width: 160px; height: 36px; font-size: 13px; }
.assign-status { font-size: 12.5px; color: var(--muted); }

@media (prefers-color-scheme: dark) {
  .assign-box { background: #131a21; border-color: #32404e; }
}

/* LLM konu önerileri ve onay */
.ok-hint { background: var(--ok-bg); color: var(--ok-ink); padding: 8px 10px; border-radius: 8px; }
.review-list {
  max-height: 620px; overflow: auto;
  border: 1px solid var(--line); border-radius: 10px; margin-top: 10px;
}
.review-row {
  display: flex; gap: 12px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); align-items: flex-start;
}
.review-row:last-child { border-bottom: 0; }
.review-no {
  flex: 0 0 76px; text-align: left; font-weight: 700;
  font-size: 11.5px; color: var(--muted); padding-top: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.review-main { flex: 1; min-width: 0; }
.review-text { font-size: 12.5px; color: var(--ink); line-height: 1.4; }
.review-reason { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.review-sug { font-size: 11.5px; color: var(--accent); margin-top: 3px; }
.review-topic { flex: 0 0 260px; display: flex; flex-direction: column; gap: 4px; }
.review-topic input { height: 34px; font-size: 13px; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; width: fit-content;
}
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.info { background: var(--soft); color: var(--accent); }
.badge.muted { background: #f3f4f6; color: var(--muted); }

@media (max-width: 720px) {
  .review-row { flex-wrap: wrap; }
  .review-topic { flex: 1 1 100%; }
}

@media (prefers-color-scheme: dark) {
  .badge.muted { background: #1d2731; }
}

/* Form şablonları */
.preset-list { display: flex; flex-direction: column; gap: 10px; }
.preset-card {
  display: flex; gap: 14px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; background: #fbfcfd; flex-wrap: wrap;
}
.preset-thumbs { display: flex; gap: 8px; align-items: center; min-width: 80px; }
.preset-thumbs img {
  max-width: 80px; max-height: 50px; object-fit: contain;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.preset-main { flex: 1; min-width: 0; }
.preset-name { font-weight: 700; font-size: 15px; }
.preset-upload {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; background: #fbfcfd;
}
.preset-preview {
  max-width: 100%; max-height: 120px; object-fit: contain;
  margin: 8px 0; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; padding: 4px;
}
.check {
  display: flex; gap: 6px; align-items: center;
  font-size: 12.5px; color: var(--muted); margin: 6px 0;
}
.preset-upload input[type="file"] { width: 100%; font-size: 13px; }

@media (prefers-color-scheme: dark) {
  .preset-card, .preset-upload { background: #131a21; }
  .preset-thumbs img, .preset-preview { background: #fff; }
}

/* Dizayn paneli önizlemesi */
.design-panel { margin-top: 18px; }
.form-mock {
  position: relative; width: 100%; max-width: 420px;
  aspect-ratio: 210 / 297; margin: 14px auto;
  background: #fff; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden;
}
.mock-mark { position: absolute; width: 4%; height: 2.8%; background: #111; }
.mock-mark.tl { left: 2%; top: 2%; }
.mock-mark.tr { right: 2%; top: 2%; }
.mock-mark.bl { left: 2%; bottom: 2%; }
.mock-mark.br { right: 2%; bottom: 2%; }
.mock-qr {
  position: absolute; right: 4%; top: 8%; width: 16%; aspect-ratio: 1;
  border: 2px solid #111;
  background: repeating-conic-gradient(#111 0% 25%, #fff 0% 50%) 0 0 / 25% 25%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 9px; font-weight: 700;
}
.mock-grid {
  position: absolute; left: 6%; right: 6%; top: 34%; bottom: 8%;
  border: 1px dashed #9aa5b1; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #9aa5b1; font-size: 11px;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 18px, #eef0f3 18px, #eef0f3 19px
  );
}
.mock-logo {
  position: absolute; top: 3%; height: 9%;
  background-size: contain; background-repeat: no-repeat;
  background-position: center; border: 1px dashed #9aa5b1;
  border-radius: 4px; color: #9aa5b1; font-size: 9px;
  display: flex; align-items: center; justify-content: center;
}
.mock-title {
  position: absolute; top: 13.5%; font-weight: 700; color: #1f2937;
  white-space: nowrap; max-width: 84%; overflow: hidden;
  text-overflow: ellipsis;
}
.mock-watermark {
  position: absolute; top: 5%; background-size: contain;
  background-repeat: no-repeat; background-position: center;
  border: 1px dashed #c9d5e2; color: #9aa5b1; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}
.mock-legend { text-align: center; font-size: 12px; color: var(--muted); }

/* Derin analiz */
.histogram {
  display: flex; align-items: flex-end; gap: 8px;
  height: 190px; margin-top: 14px;
}
.hist-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; height: 100%; justify-content: flex-end;
}
.hist-value { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.hist-track {
  flex: 1; width: 100%; display: flex; align-items: flex-end;
  background: var(--soft); border-radius: 7px; overflow: hidden;
}
.hist-bar {
  width: 100%; min-height: 2px; background: var(--accent);
  border-radius: 7px 7px 0 0;
}
.hist-label { font-size: 10px; color: var(--muted); margin-top: 5px; }
.matrix-wrap { max-height: 70vh; overflow: auto; }
.matrix-table { font-size: 10.5px; }
.matrix-table th, .matrix-table td { padding: 3px 4px; text-align: center; }
.matrix-name {
  position: sticky; left: 0; z-index: 1;
  background: var(--card); text-align: left !important;
  min-width: 150px;
}
.matrix-cell { width: 18px; }
.hm-wrong { background: #fdecec; color: #b42318; font-weight: 800; }
.hm-blank { background: #eef1f4; color: #6b7280; }
.hm-correct { background: #eefaf2; }
.hm-out { background: transparent; color: #cbd2da; }
@media (max-width: 720px) {
  .histogram { height: 140px; gap: 3px; }
  .hist-label { font-size: 8.5px; }
}
