/* Güvenli alan: env() yeni Android WebView'larda, --safe-area-inset-* Capacitor'ın eski sürümler için verdiği değer. */
.top {
  position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line);
  padding-top: max(env(safe-area-inset-top), var(--safe-area-inset-top, 0px));
}
.top .wrap { min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--text); text-decoration: none; }
main { padding-bottom: calc(48px + max(env(safe-area-inset-bottom), var(--safe-area-inset-bottom, 0px))); }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick .btn.big { font-size: 1rem; }

.child-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 4px; }
.child-tabs a { white-space: nowrap; text-decoration: none; }
.child-tabs a.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.quota { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.quota > div { height: 100%; background: var(--brand); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.thumbs figure { margin: 0; position: relative; }
.thumbs img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumbs button {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; cursor: pointer;
}

.upload-item { display: block; color: inherit; text-decoration: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); display: inline-block; }

.q-card .crop { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; background: #fff; }
.q-card .answers { display: flex; gap: 16px; flex-wrap: wrap; font-size: .95rem; }
.q-card .mistake { color: var(--bad); }
.q-card .howto { background: var(--ok-bg); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.q-card .solution { font-size: .9rem; margin-top: 6px; }
.q-card.doubt { border-color: var(--warn); }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.summary .n { font-size: 1.8rem; font-weight: 800; }
.summary .correct .n { color: var(--ok); }
.summary .wrong .n { color: var(--bad); }
.summary .blank .n { color: var(--blank); }

.spinner {
  width: 36px; height: 36px; border-radius: 50%; margin: 24px auto;
  border: 4px solid var(--line); border-top-color: var(--brand); animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.correct-list { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { text-align: center; padding: 32px 0; }

/* Profil menüsü */
.menu-wrap { position: relative; }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; font: inherit; font-weight: 800;
  background: var(--brand); color: var(--brand-ink); letter-spacing: .02em; }
.menu { position: absolute; right: 0; top: 48px; min-width: 230px; z-index: 20; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(16,24,40,.16); padding: 6px; }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 11px 12px; border-radius: 10px;
  color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--bg); }
.menu .danger { color: var(--bad); }
details.quiet { box-shadow: none; background: transparent; }

/* Durum: grafik renkleri renk körlüğü denetiminden geçti (dataviz validate_palette, açık ve koyu). */
:root { --c-correct: #0e8f86; --c-wrong: #ef6a28; --c-blank: #7389cf; }
@media (prefers-color-scheme: dark) { :root { --c-correct: #159a8f; --c-wrong: #e56d2a; --c-blank: #7389cf; } }

.week { display: block; color: inherit; text-decoration: none; }
.link { color: var(--brand); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.tiles.four { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .tiles.four { grid-template-columns: repeat(4, 1fr); } }
.tiles.four .tile { background: var(--surface); border: 1px solid var(--line); }
.tile { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.tile-n { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.delta { display: inline-block; font-size: .8rem; font-weight: 700; margin-top: 2px; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.nudge { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-weight: 600; font-size: .92rem; }
.insights ul { margin: 0; padding-left: 20px; } .insights li { margin: 4px 0; }

.legend { display: flex; gap: 14px; margin: 4px 0 6px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.correct, .seg.correct { background: var(--c-correct); fill: var(--c-correct); }
.sw.wrong, .seg.wrong { background: var(--c-wrong); fill: var(--c-wrong); }
.sw.blank, .seg.blank { background: var(--c-blank); fill: var(--c-blank); }
.daychart { width: 100%; height: auto; display: block; }
.daychart .baseline { stroke: var(--line); }
.daychart .axis { font-size: 10px; fill: var(--muted); }
.daychart .axis.today { font-weight: 800; fill: var(--text); }
.daychart .hit { fill: transparent; cursor: pointer; outline: none; }
.daychart .hit:focus { fill: color-mix(in srgb, var(--brand) 8%, transparent); }
.readout { min-height: 1.4em; margin: 6px 0 0; }

.hbars { display: grid; gap: 12px; margin-top: 8px; }
.hbar-label { font-size: .95rem; margin-bottom: 4px; }
.hbar-row { display: flex; align-items: center; gap: 10px; }
.hbar-track { flex: 1; height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 0 5px 5px 0; }
.hbar-fill.wrong { background: var(--c-wrong); } .hbar-fill.correct { background: var(--c-correct); }
.hbar-fill.accent { background: var(--brand); }
.hbar-n { min-width: 42px; text-align: right; font-weight: 700; font-size: .9rem; }
