/* Mobil görünüm (deneme) — yalnızca <html class="m2"> ve dar ekranda geçerli (m2.js açar). */

@media (max-width: 899px) {
  /* Üst çubuk: tek satır başlık, daha ince desen şeridi */
  /* telefonda başlık kısa: "YDS365" (tam ad ekran okuyucuda kalır) */
  html.m2 .brand h1 { font-size: 0; white-space: nowrap; }
  html.m2 .brand h1::after { content: "YDS365"; font-size: 1.15rem; letter-spacing: 0.01em; }
  html.m2 .topbar { padding-bottom: 10px; gap: 8px 6px; }
  html.m2 .kilim-strip--top { height: 14px; }

  /* Ana sayfa bölümlerinin sırası ve görünürlüğü admin panelindeki "Sayfa düzeni"nden gelir (app.js applyLayout);
     burada sıra verilmez. Yalnızca YDS/YÖKDİL düğmesi (panelde yok) en üstte. */
  html.m2 #view-home.active { gap: 12px; }
  html.m2 #view-home > #homeExamSwitch { order: -9; }

  html.m2 .home-hero { padding: 16px 16px; }
  html.m2 .home-title { font-size: 1.2rem; }
  html.m2 .home-sub { margin-bottom: 12px; }

  html.m2 .home-cd { padding: 8px 12px; grid-template-columns: auto 1fr; grid-template-areas: "name name" "num unit"; }
  html.m2 .home-cd-num { font-size: 1.6rem; animation: none; }
  html.m2 .home-cd-date { display: none; }

  /* Kartlar: daha büyük kart, kısa düğme yazıları, cümle sıklığı ayarı Quiz ekranında kalır */
  html.m2 #view-flashcards .flashcard { height: clamp(300px, 52vh, 460px); touch-action: pan-y; }
  html.m2 #view-flashcards .sentence-rate-row { display: none; }
  html.m2 .fc-actions .btn { min-height: 52px; }
  html.m2 .flashcard.is-swipe-right { box-shadow: 0 0 0 3px var(--success); }
  html.m2 .flashcard.is-swipe-left { box-shadow: 0 0 0 3px var(--gold); }

  /* Uygulama bandı alt sekme çubuğunun üstünde durur */
  html.has-app-banner .content { padding-bottom: 78px; }
}

/* ---------- Android: uygulama bandı ---------- */

.app-banner {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--gold);
  border-radius: 18px;
  background: var(--cobalt);
  color: var(--side-text);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
}

.app-banner-icon { width: 42px; height: 42px; flex-shrink: 0; border-radius: 22%; object-fit: cover; }
.app-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.app-banner-text strong { font-size: 0.9rem; }
.app-banner-text span { font-size: 0.76rem; line-height: 1.3; color: var(--side-muted); }

.app-banner-go {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--side-text);
  color: var(--cobalt);
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
}

.app-banner-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(251, 247, 238, 0.12);
  color: var(--side-text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

@media (min-width: 900px) {
  .app-banner { left: auto; right: 24px; bottom: 24px; max-width: 380px; }
}

/* ---------- Quiz: Android'de uygulamaya yönlendirme ---------- */

.quiz-app-hint { display: none; margin: 8px 0 0; font-size: 0.85rem; }
html.m2.is-android .quiz-gate:not(.hidden) .quiz-app-hint { display: block; }
.quiz-app-hint a { font-weight: 700; color: var(--primary-text); }

/* ---------- Ana sayfa: liste kutuları (hub.js) — uygulamadaki Liste ekranı gibi ---------- */

html:not(.m2) .m2-only { display: none !important; }
.home-hub:empty { display: none; }
.home-hub { display: flex; flex-direction: column; gap: 10px; }
.hub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 4px 2px 0; }
.hub-title { margin: 0; font-family: var(--font-display); font-size: 1.25rem; color: var(--heading); }
.hub-count { font-size: 0.8rem; font-weight: 700; color: var(--primary-text); }
.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.hub-tile {
  --t: var(--primary);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 104px;
  padding: 12px;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  background: color-mix(in srgb, var(--t) 16%, var(--surface));
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s;
}
.hub-tile:active { transform: scale(0.98); }
.hub-tile.is-active { box-shadow: 0 0 0 2.5px var(--t); }
.hub-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hub-tile-ico {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; background: color-mix(in srgb, var(--t) 24%, var(--surface)); color: var(--t);
}
.hub-lv { font-size: 0.82rem; font-weight: 800; color: var(--t); }
.hub-ring { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.hub-ring .stats-ring-svg { display: block; width: 44px; height: 44px; }
.hub-ring .stats-ring-track { fill: none; stroke: color-mix(in srgb, var(--t) 22%, var(--surface)); }
.hub-ring .stats-ring-bar { fill: none; stroke: var(--t); stroke-linecap: round; }
.hub-ring-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.66rem; font-weight: 800; color: var(--heading); font-variant-numeric: tabular-nums;
}
.hub-tile-name { font-size: 0.95rem; font-weight: 800; line-height: 1.2; color: var(--heading); }
.hub-tile-sub { font-size: 0.75rem; color: var(--text-subtle); }

.hub-saved {
  display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 14px;
  border: 1.5px dashed var(--border); border-radius: 18px; background: none; color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.hub-saved-ico { display: inline-flex; color: var(--gold); }
.hub-saved-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hub-saved-text strong { font-size: 0.92rem; color: var(--heading); }
.hub-saved-text span { font-size: 0.76rem; color: var(--text-subtle); }
.hub-saved-count { flex-shrink: 0; font-size: 0.8rem; font-weight: 700; color: var(--text-subtle); }

@media (min-width: 900px) {
  .hub-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Liste sayfası: adımlar (hubsteps.js) ---------- */

#view-liste.active { display: flex; flex-direction: column; gap: 10px; }
.hub-list-top { display: flex; align-items: center; gap: 12px; }
.hub-back {
  flex-shrink: 0; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer;
}
.hub-list-title { margin: 0; font-family: var(--font-display); font-size: 1.45rem; color: var(--heading); }
.hub-list-sub { margin: 0; font-size: 0.9rem; font-weight: 700; color: var(--primary-text); }
.hub-list-rule { margin: 0; font-size: 0.82rem; line-height: 1.45; color: var(--text-subtle); }
.hub-steps { display: flex; flex-direction: column; gap: 10px; }
.hub-group { padding: 8px 2px 0; }
.hub-group-name { font-size: 0.95rem; font-weight: 800; color: var(--heading); }

.hub-step { border: 1px solid var(--border); border-radius: 20px; background: var(--surface); overflow: hidden; }
.hub-step.is-open { border: 2px solid var(--primary); }
.hub-step.is-done { border-color: color-mix(in srgb, var(--success) 50%, var(--border)); }
.hub-step-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.hub-step-num {
  flex-shrink: 0; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--primary-soft); color: var(--primary-text); font-weight: 800;
}
.hub-step.is-done .hub-step-num { background: color-mix(in srgb, var(--success) 18%, var(--surface)); color: var(--success-text); }
.hub-step-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hub-step-name { font-size: 0.98rem; font-weight: 800; color: var(--heading); }
.hub-step-meta { font-size: 0.8rem; color: var(--text-subtle); }
.hub-step-bar { height: 5px; border-radius: 999px; background: var(--border); overflow: hidden; }
.hub-step-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.hub-step-count { flex-shrink: 0; font-size: 0.85rem; font-weight: 800; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.hub-step-body { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 14px; }
.hub-step-go { width: 100%; min-height: 48px; }
.hub-word-pos { font-size: 0.8rem; font-style: italic; color: var(--text-subtle); }
.hub-word-ex { margin: 6px 0 0; font-size: 0.88rem; color: var(--text); }
.hub-word-ex-tr { margin: 2px 0 0; font-size: 0.82rem; font-style: italic; color: var(--text-subtle); }

/* ---------- liste kutuları: kilit, geniş kutu ---------- */
.hub-tile.is-wide { min-height: 0; border: 1px solid color-mix(in srgb, var(--t) 55%, var(--border)); }
.hub-tile.is-locked .hub-tile-name, .hub-tile.is-locked .hub-tile-ico { opacity: 0.6; }
.hub-ring-num svg { color: var(--text-subtle); }
.hub-tile-sub { font-size: 0.76rem; color: var(--text-subtle); }

/* ---------- adımlar: kilit, sınav ---------- */
.hub-step.is-locked .hub-step-num { background: var(--border); color: var(--text-subtle); }
.hub-step.is-locked .hub-step-row { opacity: 0.75; }
.hub-step.is-ready { border-color: var(--gold); }
.hub-step-exam { background: var(--gold); border-color: var(--gold); color: #1b2430; }
.hub-step-note { margin: 0; font-size: 0.8rem; color: var(--text-subtle); }
.hub-card-exam { display: block; width: 100%; max-width: 460px; min-height: 50px; margin: 12px auto 0; background: var(--gold); border-color: var(--gold); color: #1b2430; }

.hub-exam {
  position: fixed; inset: 0; z-index: 130; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(8, 20, 33, 0.72); overflow-y: auto;
}
body.hub-exam-open { overflow: hidden; }
.hub-exam-card {
  width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 10px; padding: 18px;
  border: 1px solid var(--gold); border-radius: 22px; background: var(--surface); color: var(--text);
}
.hub-exam-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hub-exam-kicker { font-size: 0.76rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-text); }
.hub-exam-close { width: 40px; height: 40px; border: 0; border-radius: 999px; background: var(--primary-soft); color: var(--text); font-size: 1.3rem; cursor: pointer; }
.hub-exam-progress { font-size: 0.85rem; font-weight: 700; color: var(--text-subtle); }
.hub-exam-timer { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.hub-exam-timer > span { display: block; height: 100%; background: var(--primary); transition: width 0.25s linear; }
.hub-exam-label { margin-top: 6px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; color: var(--text-subtle); }
.hub-exam-word { font-family: var(--font-display); font-size: 2rem; font-weight: 600; line-height: 1.15; color: var(--heading); overflow-wrap: anywhere; }
.hub-exam-options { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.hub-exam-opt {
  min-height: 52px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg);
  color: var(--text); font: inherit; font-size: 0.95rem; text-align: left; cursor: pointer;
}
.hub-exam-opt.is-right { border-color: var(--success); background: color-mix(in srgb, var(--success) 16%, var(--surface)); }
.hub-exam-opt.is-wrong { border-color: var(--error); background: color-mix(in srgb, var(--error) 14%, var(--surface)); }
.hub-exam-result { align-items: center; text-align: center; }
.hub-exam-big { font-family: var(--font-display); font-size: 3rem; font-weight: 600; color: var(--heading); }
.hub-exam-result.is-pass .hub-exam-big { color: var(--success-text); }
.hub-exam-msg { margin: 0; font-size: 0.95rem; line-height: 1.45; }
.hub-exam-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 6px; }
.hub-exam-actions .btn { width: 100%; min-height: 48px; }

/* ---------- YDS'de çıkanlar: uygulamaya kalan adımlar ---------- */
.hub-step.is-app { border-style: dashed; }
.hub-step.is-app .hub-step-num { background: color-mix(in srgb, var(--gold) 20%, var(--surface)); color: var(--gold-text); }
.hub-app-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 14px;
  border: 1px solid var(--gold); border-radius: 18px; background: color-mix(in srgb, var(--gold) 10%, var(--surface));
}
.hub-app-icon { width: 44px; height: 44px; border-radius: 22%; object-fit: cover; flex-shrink: 0; }
.hub-app-text { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.hub-app-text strong { font-size: 0.95rem; color: var(--heading); }
.hub-app-text span { font-size: 0.82rem; line-height: 1.4; color: var(--text-subtle); }
.hub-app-go { width: 100%; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* ---------- YDS'de çıkanlar: seviye kutuları ---------- */
.hub-title-yds { display: inline-flex; align-items: center; gap: 7px; }
.hub-title-yds svg { color: var(--gold); flex-shrink: 0; }
.hub-count-link { border: 0; background: none; padding: 6px 0; font: inherit; font-size: 0.8rem; font-weight: 700; color: var(--primary); cursor: pointer; }
.hub-tile.is-app { border-style: dashed; }
.hub-tile.is-app .hub-tile-sub { color: var(--gold-text); }

/* ---------- uygulama içeriği açıkken "YDS'de Çıkanlar" girişleri ---------- */
/* sınav eşleşmesi kapalı olsa da görünür (YÖKDİL modunda yokdil.css yine gizler) */
body.has-app-yds .home-exam-banner.exam-only { display: flex !important; }
@media (min-width: 900px) {
  body.has-app-yds .tab-btn.exam-only { display: flex !important; }
}

/* ---------- liste sayfası: adım kutucukları ---------- */
.hub-step-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hub-tile.hub-step { min-height: 0; gap: 6px; padding: 10px; border: 0; border-radius: 16px; overflow: visible; background: color-mix(in srgb, var(--t) 16%, var(--surface)); }
.hub-step-grid .hub-tile-ico { width: 30px; height: 30px; border-radius: 10px; }
.hub-step-grid .hub-ring, .hub-step-grid .hub-ring .stats-ring-svg { width: 38px; height: 38px; }
.hub-step-grid .hub-ring-num { font-size: 0.6rem; }
.hub-step-grid .hub-tile-name { font-size: 0.86rem; }
.hub-step-grid .hub-tile-sub { font-size: 0.7rem; line-height: 1.25; }
.hub-tile.hub-step.is-open { border: 0; box-shadow: 0 0 0 2.5px var(--t); }
.hub-tile.hub-step.is-ready { box-shadow: 0 0 0 2.5px var(--gold); }
.hub-tile.hub-step.is-ready .hub-tile-sub { color: var(--gold-text); font-weight: 700; }
.hub-tile.hub-step.is-done .hub-tile-sub { color: var(--success-text); }
.hub-tile.is-app { border: 1.5px dashed color-mix(in srgb, var(--gold) 65%, transparent); }

.hub-step-panel.hub-step-body {
  gap: 10px; padding: 12px; border: 2px solid var(--t); border-radius: 18px; background: var(--surface);
}
.hub-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hub-panel-title { font-size: 0.98rem; color: var(--heading); }
.hub-panel-count { font-size: 0.78rem; font-weight: 700; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.hub-panel-actions { display: flex; gap: 8px; }
.hub-panel-actions .hub-step-go { flex: 1; width: auto; min-height: 44px; }
.hub-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.hub-chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; max-width: 100%;
  min-height: 44px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg); color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.hub-chip-en { font-size: 0.88rem; font-weight: 800; color: var(--heading); }
.hub-chip-tr { font-size: 0.72rem; color: var(--text-subtle); overflow-wrap: anywhere; }
.hub-chip.is-known { border-color: var(--success); background: color-mix(in srgb, var(--success) 14%, var(--surface)); }
.hub-chip.is-known .hub-chip-en::before { content: "✓ "; color: var(--success-text); }
@media (min-width: 900px) {
  .hub-step-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
