:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #14171f;
  --muted: #4b5565;
  --line: #c9ced8;
  --primary: #0b5fff;
  --primary-text: #ffffff;
  --sel-bg: #e3edff;
  --warn-bg: #fff3d6;
  --warn-line: #b27b00;
  --ok-bg: #e2f5e8;
  --danger: #b3261e;
  --radius: 16px;
  --tap: 56px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10131a;
    --card: #1a1f2a;
    --text: #f1f3f8;
    --muted: #b4bccb;
    --line: #3a4252;
    --primary: #6b9bff;
    --primary-text: #0b1020;
    --sel-bg: #1f3361;
    --warn-bg: #3a2f10;
    --warn-line: #d9a53a;
    --ok-bg: #163322;
    --danger: #ff8a80;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
body.no-tabs { padding-bottom: env(safe-area-inset-bottom); }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
main:focus, main:focus-visible { outline: none; }
h1 { font-size: 1.55rem; line-height: 1.25; margin: 8px 0 12px; }
h2 { font-size: 1.2rem; margin: 20px 0 8px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .92rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loading { text-align: center; margin-top: 30vh; }

.demo-strip { background: var(--warn-bg); border-bottom: 2px solid var(--warn-line); padding: 6px 12px; text-align: center; font-size: .82rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.card.today { border: 2px solid var(--primary); }
.card.note { background: var(--warn-bg); border-color: var(--warn-line); }
.card.ok { background: var(--ok-bg); }
.kicker { font-size: .92rem; font-weight: 600; color: var(--muted); margin: 0; }
.badge { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; font-size: .85rem; margin: 4px 4px 4px 0; background: var(--card); }
.badge.strong { border-color: var(--primary); font-weight: 600; }

.btn, .opt {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: var(--tap); padding: 12px 16px; margin: 10px 0;
  font: inherit; font-weight: 600; color: var(--text); background: var(--card);
  border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; text-align: center;
  text-decoration: none;
}
.btn.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.opt { justify-content: flex-start; text-align: start; font-weight: 500; }
.opt.sel { background: var(--sel-bg); border-color: var(--primary); font-weight: 700; }
.opt .tick { font-weight: 800; color: var(--primary); }
.opts.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opts.row .opt { margin: 4px 0; justify-content: center; text-align: center; padding: 8px; }
.days { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.days .opt { margin: 4px 0; }
.days .opt:last-child:nth-child(odd) { grid-column: 1 / -1; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.seg .opt { margin: 0; justify-content: center; min-height: 48px; }
.navrow { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 20px; }
.link { background: none; border: none; color: var(--primary); font: inherit; font-weight: 600; text-decoration: underline; padding: 14px 4px; min-height: 48px; cursor: pointer; display: inline-block; }

.field { display: flex; gap: 12px; align-items: end; margin: 12px 0; }
.field label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 4px; }
input[type=number], input[type=date] {
  direction: ltr; text-align: start;
  font: inherit; font-size: 1.3rem; min-height: var(--tap); width: 100%; padding: 8px 12px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text);
}
.error { color: var(--danger); font-weight: 600; min-height: 1.5em; }
.progress { color: var(--muted); font-size: .9rem; margin: 0; }
.group-title { font-weight: 700; margin: 18px 0 4px; }
.q { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 12px 0; background: var(--card); }
.q p { font-weight: 600; margin: 0 0 6px; }

.lines { margin: 4px 0 8px; padding-inline-start: 1.2em; padding-inline-end: 0; }
.lines li { margin: 4px 0; }
.sec-label { font-weight: 700; margin: 10px 0 0; }
.total { font-weight: 700; margin-top: 8px; }
.day { border-inline-start: 6px solid var(--line); }
.day.training { border-inline-start-color: var(--primary); }
.day.is-today { border: 2px solid var(--primary); border-inline-start-width: 6px; }
.day h3 { margin: 0 0 4px; font-size: 1.05rem; }
.status { font-weight: 700; }
.weeklist a { display: block; text-decoration: none; color: inherit; }
.weeknav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; min-height: 64px; color: var(--muted); text-decoration: none; font-size: .8rem; font-weight: 600; }
.tabs a.active { color: var(--primary); }
.tabs a.active span { text-decoration: underline; }

.run { text-align: center; }
.run .now { font-size: 2.6rem; margin: 12px 0 4px; letter-spacing: .02em; }
.run .speed { font-size: 1.5rem; font-weight: 700; margin: 4px 0; }
.run .remain { font-size: 4.6rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 6px 0; line-height: 1.1; }
.run .next { font-size: 1.2rem; margin: 14px 0; }
.run .rep { font-size: 1.2rem; font-weight: 600; min-height: 1.6em; }
.bar { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 16px 0; }
.bar > div { height: 100%; width: 0; background: var(--primary); transition: width .3s linear; }
.run .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.run .btn { min-height: 72px; font-size: 1.2rem; }

@media (min-width: 700px) {
  html { font-size: 19px; }
  .btn, .opt { max-width: 520px; margin-left: auto; margin-right: auto; }
}
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .bar > div { transition: none; } }

/* Dil seçimi ve sağdan sola (Arapça) düzen */
.lang-prompt { display: block; }
.lang-opt { font-size: 1.15rem; font-weight: 700; justify-content: center; text-align: center; }
:lang(ar) body, html[lang="ar"] body { line-height: 1.7; }
html[dir="rtl"] .field { direction: rtl; }

/* ---------------------------------------------------------------------------------------------
   Kiosk (?kiosk=1): dikey büyük dokunmatik ekran. Yazı boyutu ekran genişliğine göre ölçeklenir.
   --------------------------------------------------------------------------------------------- */
html.kiosk {
  color-scheme: light;
  font-size: clamp(18px, min(2.7vw, 1.5vh), 34px);
  -webkit-user-select: none; user-select: none; overscroll-behavior: none; touch-action: manipulation;
  --bg: #f6f7fb; --card: #ffffff; --text: #14171f; --muted: #4b5565; --line: #c9ced8;
  --primary: #0b5fff; --primary-text: #ffffff; --sel-bg: #e3edff; --warn-bg: #fff3d6;
  --warn-line: #b27b00; --ok-bg: #e2f5e8; --danger: #b3261e; --tap: 3.3rem;
}
html.kiosk main { max-width: 34rem; }
html.kiosk .btn, html.kiosk .opt { max-width: none; }
html.kiosk .tabs a { min-height: 4rem; font-size: .85rem; }

/* Açılış ekranı */
body.is-attract { background: #071a4d; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: 0; }
body.is-attract main { max-width: none; width: 100%; margin: 0; padding: 0; flex: 1; display: flex; }
.attract {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2.5rem;
  padding: 2.5rem 1.5rem 3rem; color: #fff; text-align: center;
  /* Üstte koşucu görseli, altta yazı için koyu lacivert; yazı hep koyu zemin üstüne gelir. */
  background:
    linear-gradient(180deg, rgba(7, 26, 77, 0) 0%, rgba(7, 26, 77, 0) 38%, rgba(7, 26, 77, .78) 62%, #071a4d 82%),
    url(../img/bg-attract.jpg) top center / cover no-repeat,
    #071a4d;
}
.a-stage { display: grid; width: 100%; max-width: 36rem; }
.alt { grid-area: 1 / 1; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.alt.on { opacity: 1; }
.a-title { font-size: 2.6rem; line-height: 1.2; margin: 0 0 .7rem; }
.a-sub { font-size: 1.25rem; margin: 0 auto; max-width: 30rem; opacity: .94; }
.a-chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; padding: 0; margin: 1.4rem 0 0; }
.a-chips li { border: 2px solid rgba(255, 255, 255, .55); border-radius: 999px; padding: .3rem 1rem; font-weight: 600; font-size: 1.05rem; }
.a-actions { width: 100%; max-width: 30rem; }
.btn.big { min-height: 4.2rem; font-size: 1.3rem; flex-wrap: wrap; }
.attract .btn.primary { background: #fff; color: #0b2a7a; border-color: #fff; animation: glow 2.4s ease-in-out infinite; }
.attract .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }
.sep { opacity: .6; margin: 0 .5rem; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .0); } 50% { box-shadow: 0 0 0 .6rem rgba(255, 255, 255, .28); } }
@media (prefers-reduced-motion: reduce) { .attract .btn.primary { animation: none; } .alt { transition: none; } }

/* "Neden bu uygulama" */
.why .lead, .share .lead { font-size: 1.15rem; }
.why-card { display: flex; gap: 1rem; align-items: flex-start; }
.card h2 { margin: 0 0 .25rem; font-size: 1.15rem; }
.why-card .num { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--primary); color: var(--primary-text); display: grid; place-items: center; font-weight: 800; }
.why-privacy { border: 2px solid var(--primary); background: var(--sel-bg); }
.pills { display: flex; gap: .5rem; justify-content: center; margin: .5rem 0 1rem; }
.pill { font: inherit; font-weight: 700; min-height: 2.8rem; padding: .3rem 1.4rem; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.pill.on { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.contact { list-style: none; padding: 0; }

/* QR ekranı */
.share { text-align: center; }
.qr-wrap { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: .6rem; width: min(100%, 22rem); margin: 1rem auto .4rem; }
.qr { display: block; width: 100%; height: auto; }
.qr-host { font-weight: 800; font-size: 1.3rem; margin: .2rem 0 1rem; letter-spacing: .02em; }
.steps { text-align: start; max-width: 26rem; margin: 0 auto 1rem; padding-inline-start: 1.6em; font-size: 1.1rem; }
.steps li { margin: .3rem 0; }

/* Hareketsizlik uyarısı */
.idle-warn { position: fixed; inset: 0; background: rgba(7, 26, 77, .78); display: grid; place-items: center; z-index: 50; padding: 1.5rem; }
.idle-card { background: #fff; color: #14171f; border-radius: var(--radius); padding: 1.5rem; max-width: 28rem; width: 100%; text-align: center; }
.idle-card h2 { margin-top: 0; }

/* Telefonda açılan plan sayfası ve PDF/yazdırma */
.doc { max-width: 46rem; margin: 0 auto; }
.doc-head h1 { margin: .2rem 0; }
.doc-week { margin: 1.2rem 0; }
.doc-week h2 { border-bottom: 2px solid var(--line); padding-bottom: .3rem; break-after: avoid; }
.doc-help { margin: .8rem 0; font-size: .95rem; }
.doc-day { display: grid; grid-template-columns: 6.5rem 1fr; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.doc-day.training .doc-date strong { color: var(--primary); }
.doc-date { display: flex; flex-direction: column; font-size: .95rem; }
.doc-date span { color: var(--muted); }
.doc-body .lines { margin: .2rem 0; }
.doc-body p { margin: .2rem 0; }
.doc-foot { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: .6rem; }
@media print {
  @page { size: A4; margin: 14mm; }
  :root { --bg: #fff; --card: #fff; --text: #000; --muted: #333; --line: #999; --primary: #000; --warn-bg: #fff; --warn-line: #000; }
  html { font-size: 10.5pt; }
  .doc-day { padding: .3rem 0; }
  .doc-week { margin: .8rem 0; }
  .doc-body .lines { margin: .1rem 0; }
  .doc-body .sec-label { margin: .3rem 0 0; }
  body { background: #fff; color: #000; padding: 0; }
  .no-print, .tabs, .demo-strip, .idle-warn { display: none !important; }
  main { max-width: none; padding: 0; }
  .doc-demo { border: 1.5px solid #000; border-radius: 6px; }
  a { color: inherit; text-decoration: none; }
}

/* Özet sayfası */
.sum-list { list-style: none; margin: 1rem 0; padding: 0; }
.sum-row { display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; align-items: baseline; padding: .7rem 0; border-bottom: 1px solid var(--line, #d9dde3); }
.sum-q { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; }
.sum-a { min-width: 0; overflow-wrap: anywhere; }
