:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #ece9e3;
  --line: #ddd8cf;
  --text: #17161a;
  --muted: #6c6873;
  --accent: #ff4f2b;
  --accent-ink: #ffffff;
  --accent-soft: #ffe3db;
  --ok: #1f9d55;
  --err: #d42a2a;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 18, 24, .05), 0 8px 24px rgba(20, 18, 24, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f13; --surface: #17181e; --surface-2: #22232b; --line: #2d2e37;
    --text: #f2f0ec; --muted: #9a97a3; --accent: #ff6a48; --accent-soft: #3a1e18;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f13; --surface: #17181e; --surface-2: #22232b; --line: #2d2e37;
  --text: #f2f0ec; --muted: #9a97a3; --accent: #ff6a48; --accent-soft: #3a1e18;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, "Noto Sans Arabic", "Hiragino Sans", "PingFang SC", "Apple SD Gothic Neo", "Microsoft YaHei", "Malgun Gothic", "Yu Gothic", "Noto Sans CJK SC", "Noto Sans Devanagari", "Nirmala UI", system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.mono { font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: 0; }

.app {
  max-width: 620px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}

.top { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text);
  font: 700 21px/1 "Space Grotesk", sans-serif; letter-spacing: -.02em; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.lang-pick { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: var(--surface); border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.lang-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.lang-pick #langCode { color: var(--text); }
html.i18n-pending .app, html.i18n-pending .sheet { visibility: hidden; }
.plan-pill { border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.plan-pill.pro { background: var(--text); color: var(--bg); border-color: var(--text); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 12px; }
h1.hero { font: 700 clamp(26px, 6vw, 34px)/1.08 "Space Grotesk", sans-serif; letter-spacing: -.03em; margin: 4px 0 8px; }
h2 { font: 700 20px/1.2 "Space Grotesk", sans-serif; margin: 0; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0 0 18px; }
.fine { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }

.tabs { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.tab { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  border: 1.5px dashed var(--line); border-radius: 14px; padding: 30px 16px; cursor: pointer;
  color: var(--muted); transition: border-color .15s, background .15s; }
.drop strong { color: var(--text); font-size: 16px; }
.drop svg { color: var(--accent); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }

.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--bg);
  border-radius: 12px; padding: 12px 14px; outline: none; }
.link-row input:focus { border-color: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 18px;
  font-weight: 600; text-decoration: none; color: var(--text); cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:active { transform: translateY(1px); }
.btn.ghost { background: transparent; }
.btn.big { width: 100%; padding: 15px; font-size: 16px; margin-top: 6px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; font-size: 14px; }

.player-wrap { background: #000; border-radius: 12px; overflow: hidden; display: flex; justify-content: center; }
.player-wrap video, .player-wrap img { width: 100%; max-height: 52vh; display: block; object-fit: contain; }
.player-wrap audio { width: 100%; margin: 14px; }
.meta { color: var(--muted); font-size: 13px; margin-top: 8px; }

.group { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); }
.group.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.group-head { display: flex; justify-content: space-between; font-weight: 600; font-size: 13px;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 7px 13px;
  font-size: 13.5px; font-weight: 600; cursor: pointer; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip i { font-style: normal; font-size: 10px; background: var(--accent); color: #fff; border-radius: 4px; padding: 1px 4px; margin-inline-start: 3px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.range-dual { position: relative; height: 32px; }
.range-dual .track { position: absolute; left: 0; right: 0; top: 13px; height: 6px; background: var(--surface-2); border-radius: 3px; }
.range-dual .fill { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; }
.range-dual input { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.range-dual input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent); cursor: grab; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.range-dual input::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent); cursor: grab; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { display: none; }
.switch .knob { width: 42px; height: 24px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; position: relative; transition: background .15s; }
.switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .knob { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .knob::after { transform: translateX(18px); }

.progress { margin-top: 14px; font-size: 13px; color: var(--muted); }
.progress .bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-bottom: 8px; position: relative; }
.progress .bar::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); background: var(--accent); transition: width .2s; }
.progress .bar.indeterminate::after { width: 35%; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { left: -35%; } to { left: 100%; } }
.usage { text-align: center; color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }

.ad-slot { border: 1px dashed var(--line); border-radius: 12px; min-height: 90px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }

.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 8px 0; }
.foot nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-bottom: 6px; }
.foot a { color: var(--muted); }

.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 14, .55); }
.sheet-body { position: relative; width: 100%; max-width: 480px; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 26px 22px max(22px, env(safe-area-inset-bottom)); text-align: center; animation: up .22s ease-out; }
@media (min-width: 600px) { .sheet { align-items: center; } .sheet-body { border-radius: 22px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-x { position: absolute; inset-inline-end: 14px; top: 10px; border: 0; background: none; font-size: 28px; color: var(--muted); cursor: pointer; }
.pro-badge { display: inline-block; background: var(--accent); color: #fff; font: 700 12px/1 "Space Grotesk"; padding: 6px 10px; border-radius: 6px; letter-spacing: .1em; }
.sheet-body h2 { margin: 12px 0 14px; font-size: 26px; }
.perks { list-style: none; padding: 0; margin: 0 auto 16px; text-align: start; max-width: 280px; }
.perks li { padding-block: 7px; padding-inline: 28px 0; position: relative; }
.perks li::before { content: "✓"; position: absolute; inset-inline-start: 4px; color: var(--accent); font-weight: 700; }
.price { margin-bottom: 8px; } .price b { font: 700 30px "Space Grotesk"; } .price span { color: var(--muted); }
.sheet-body .link-btn { display: block; margin: 12px auto 0; }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-weight: 500; font-size: 14px;
  z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.err { background: var(--err); color: #fff; }

@media (max-width: 420px) { .group.two { grid-template-columns: 1fr; } .card { padding: 16px; } }

[dir="rtl"] .brand, [dir="rtl"] h1.hero, [dir="rtl"] h2 { letter-spacing: 0; }
@media (max-width: 380px) { .lang-pick svg { display: none; } }

/* ---------- pratik oynatıcı ---------- */
.pr-name { margin: -6px 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-stage { position: relative; background: #000; border-radius: 12px; overflow: hidden; display: flex; justify-content: center; touch-action: manipulation; }
/* --ar: videonun en/boy oranı (practice.js yazar). Çerçeve görüntünün tam boyutunu alır, rozetler görüntünün köşesine düşer. */
.pr-frame { position: relative; --ar: 1.7778; width: min(100%, calc(56vh * var(--ar))); aspect-ratio: var(--ar); }
.pr-stage video { display: block; width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.pr-stage video.mirror { transform: scaleX(-1); }
.pr-hud { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; pointer-events: none; }
.pr-hud span { background: rgba(0, 0, 0, .55); color: #fff; font-weight: 700; font-size: 12.5px; border-radius: 999px; padding: 4px 9px; font-variant-numeric: tabular-nums; }
.pr-count { position: absolute; inset: 0; display: grid; place-items: center; font: 700 96px/1 "Space Grotesk", sans-serif; color: #fff; background: rgba(0, 0, 0, .35); pointer-events: none; }
.pr-time { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; margin: 10px 2px 2px; }
.pr-bar { position: relative; height: 36px; cursor: pointer; touch-action: none; border-radius: 8px; }
.pr-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pr-rail { position: absolute; left: 0; right: 0; top: 15px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.pr-fill { height: 100%; background: var(--text); opacity: .35; }
.pr-band { position: absolute; top: 9px; height: 18px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 30%, transparent); border: 2px solid var(--accent); pointer-events: none; }
.pr-band.off { opacity: .4; border-style: dashed; }
.pr-markers i { position: absolute; top: 6px; width: 3px; height: 24px; margin-left: -1.5px; border-radius: 2px; background: #3b82f6; pointer-events: none; }
.pr-head { position: absolute; top: 9px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--surface); border: 3px solid var(--text); pointer-events: none; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.pr-main { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 6px; }
.pr-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.pr-play { width: 62px; height: 62px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; }
.pr-play .i-play { display: none; } .pr-play.paused .i-play { display: block; } .pr-play.paused .i-pause { display: none; }
.pr-range { width: 100%; accent-color: var(--accent); margin: 0 0 10px; }
.chip.toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.practice .chips .link-btn { padding: 7px 6px; }
.pr-marklist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pr-marklist:empty { display: none; }
.pr-mark-wrap { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.pr-mark-wrap .pr-mark { border: 0; background: transparent; padding-inline-end: 4px; }
.pr-mark-x { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 4px 10px 6px 4px; cursor: pointer; }
#prMarkHint { margin-top: 8px; }
.practice .btn.big { margin-top: 18px; }
@media (hover: none) { .pr-keys { display: none; } }

/* ---------- analiz araçları ---------- */
.pr-frame { overflow: hidden; }
.pr-zoom { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.pr-draw { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; touch-action: pan-y; }
.pr-draw.tool { cursor: crosshair; }
.pr-stage.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-items: center; justify-items: center; }
.pr-stage.compare .pr-frame { width: min(100%, calc(46vh * var(--ar))); }
.pr-frame2 { position: relative; --ar: 1.7778; aspect-ratio: var(--ar); width: min(100%, calc(46vh * var(--ar))); }
.pr-frame2 video { display: block; width: 100%; height: 100%; object-fit: contain; }
.pr-frame2 video.mirror { transform: scaleX(-1); }
.pr-tag { position: absolute; left: 8px; top: 8px; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 3px 8px; }
.pr-cmp { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.pr-cmp .group-head { margin-bottom: 6px; }
.pr-cmp-row { display: flex; align-items: center; gap: 8px; }
.pr-cmp-row .pr-range { margin: 0; flex: 1; }
.pr-btn.small { width: 36px; height: 36px; flex: none; }
#prToolHint { margin-top: 8px; }
.pr-stage.compare.stack { grid-template-columns: 1fr; }
.pr-stage.compare.stack .pr-frame { width: min(100%, calc(30vh * var(--ar))); }
