:root {
  /* Açık, göz yormayan tema: koyu kırık beyaz zemin + pastel kırmızı vurgu */
  --bg: #F1E9E4;
  --surface: #FAF5F2;
  --surface-2: #EADFD9;
  --line: #E0D1C9;
  --text: #3A2A28;
  --muted: #86706B;
  --accent: #D98C8C;      /* pastel kırmızı */
  --accent-strong: #C46F70;
  --accent-soft: #F3D9D6;
  --accent-ink: #3B1F1F;
  --ok: #5F9C7E;
  --warn: #D9A55A;
  --bad: #C25C57;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--text); }
/* iPhone: sayfanın kendisi kaymasın/esnemesin; yalnızca #app içi kayar */
html, body { position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.45;
  overscroll-behavior: none;
}
#app {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  display: flex; flex-direction: column;
}

/* ---------- genel ekran ---------- */
.screen {
  flex: 1 0 auto; display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + 20px) 22px calc(var(--safe-bottom) + 22px);
  gap: 18px;
}
.screen.center { justify-content: center; text-align: center; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.brand { font-weight: 650; letter-spacing: .2px; font-size: 17px; }
.brand span { color: var(--accent); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button { background: none; border: 0; color: var(--muted); padding: 6px 12px; font-size: 13px; font-weight: 600; }
.lang button.on { background: var(--surface-2); color: var(--text); }

h1 { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.4px; }
h2 { font-size: 22px; line-height: 1.2; font-weight: 680; letter-spacing: -.2px; }
p.lead { color: var(--muted); font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }

.btn {
  appearance: none; border: 0; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 17px; font-weight: 650; padding: 16px 18px; width: 100%;
}
.btn:active { transform: scale(.985); }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.ghost { background: none; color: var(--muted); padding: 10px; font-weight: 500; }
.btn:disabled { opacity: .45; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

/* ---------- başlangıç ---------- */
.hero-mark {
  width: 120px; height: 150px; margin: 0 auto 8px; border-radius: 50%;
  border: 3px dashed var(--accent); opacity: .9;
}

/* ---------- rehber ---------- */
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--accent); }
.guide-ill { font-size: 64px; text-align: center; margin: 18px 0 4px; }
.tips { display: flex; flex-direction: column; gap: 10px; }
.tip { display: flex; gap: 12px; align-items: flex-start; }
.tip b { color: var(--accent); min-width: 22px; }

/* ---------- ana ekran ---------- */
.session { display: flex; flex-direction: column; gap: 10px; }
.session-head { display: flex; justify-content: space-between; align-items: baseline; }
.badge { font-size: 12px; font-weight: 650; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 2px 8px; }
.badge.warn { background: var(--warn); }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.thumbs img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.thumbs figure { position: relative; }
.thumbs figcaption { position: absolute; left: 6px; bottom: 6px; font-size: 11px; background: rgba(58,42,40,.6); color: #fff; padding: 1px 6px; border-radius: 6px; }
.list { display: flex; flex-direction: column; gap: 12px; }
.row-actions { display: flex; gap: 8px; }
.row-actions .btn { padding: 10px; font-size: 14px; }

/* ---------- çekim ---------- */
.capture { position: fixed; inset: 0; background: #000; display: flex; flex-direction: column;
  /* kamera ekranı koyu kalır */
  --text: #f4efe9; --muted: #b9b0aa; --ok: #7fd1a6; --accent-ink: #2a1b14; }
.capture video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scaleX(-1); /* ayna görüntü – kayıt ayna değil */
}
.oval {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%);
  width: 66vw; height: 88vw; max-width: 360px; max-height: 480px;
  border: 3px dashed rgba(255,255,255,.55); border-radius: 50%;
  transition: border-color .2s, box-shadow .2s;
  pointer-events: none;
}
.oval.ready { border-style: solid; border-color: var(--ok); box-shadow: 0 0 0 9999px rgba(0,0,0,.25); }
.cap-top {
  position: relative; z-index: 2;
  padding: calc(var(--safe-top) + 12px) 16px 0;
  display: flex; justify-content: space-between; align-items: center;
}
.chips { display: flex; gap: 6px; }
.chip { font-size: 12px; font-weight: 650; padding: 5px 10px; border-radius: 999px; background: rgba(23,27,34,.75); color: var(--muted); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.chip.now { color: var(--text); outline: 1px solid var(--accent); }
.chip.done { color: var(--accent-ink); background: var(--ok); }
.close { background: rgba(23,27,34,.75); color: var(--text); border: 0; border-radius: 999px; width: 36px; height: 36px; font-size: 18px; }
.cap-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 16px 16px calc(var(--safe-bottom) + 18px);
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
  text-align: center;
}
.say { font-size: 22px; font-weight: 680; letter-spacing: -.2px; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.say-sub { margin-top: 6px; font-size: 14px; color: #d9d4cc; min-height: 20px; }
.hold-bar { margin: 12px auto 0; width: 60%; height: 4px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; }
.hold-bar i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .1s linear; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 3; }
.flash.on { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .85 } 100% { opacity: 0 } }
.loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 4; background: #000; color: var(--muted); }

/* ---------- debug ---------- */
#debug-hotspot { position: fixed; top: 0; left: 0; width: 56px; height: 56px; z-index: 50; }
.debug {
  --line: #2a303b;
  position: fixed; left: 8px; right: 8px; top: calc(var(--safe-top) + 56px); z-index: 60;
  max-height: 70vh; overflow: auto;
  background: rgba(10,12,16,.92); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; font: 12px/1.4 ui-monospace, Menlo, monospace; color: #cfd6e0;
}
.debug h3 { font: 600 13px -apple-system, sans-serif; margin: 6px 0; color: var(--accent); }
.debug .live { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin-bottom: 8px; }
.debug label { display: grid; grid-template-columns: 1fr 70px; gap: 8px; align-items: center; margin: 4px 0; }
.debug input[type=number] { width: 70px; background: #111; color: #fff; border: 1px solid #333; border-radius: 6px; padding: 4px; font: inherit; }
.debug .btn { padding: 8px; font-size: 13px; margin-top: 8px; }
.ok { color: var(--ok); } .bad { color: var(--bad); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 24px); transform: translateX(-50%);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 12px; z-index: 80; font-size: 14px; max-width: 90vw; text-align: center;
}

/* ---------- Faz 2 ---------- */
.input {
  width: 100%; font-size: 20px; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); outline: none;
  letter-spacing: .5px;
}
.input:focus { border-color: var(--accent); }
.comment { font-size: 22px; line-height: 1.35; font-weight: 600; letter-spacing: -.2px; }
.comment-small { font-size: 14px; line-height: 1.4; color: var(--text); }
.arrows { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px; }
.arrows.compact { padding: 2px 10px; border-radius: 12px; }
.arrows.compact .arrow-row { padding: 6px 0; font-size: 13px; }
.arrow-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.arrow-row:last-child { border-bottom: 0; }
.arrow { font-weight: 650; }
.arrow.improved { color: var(--ok); }
.arrow.same { color: var(--muted); }
.arrow.worse { color: var(--bad); }
.note { border-left: 3px solid var(--line); padding-left: 10px; }
.pulse { width: 110px; height: 140px; margin: 0 auto 18px; border-radius: 50%; border: 3px solid var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(.94); opacity: .55 } 50% { transform: scale(1.04); opacity: 1 } }

/* ---------- faz2-0.3 ---------- */
.screen.top { justify-content: flex-start; }
.obs { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.obs h3 { font-size: 14px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.obs-item { display: flex; gap: 10px; font-size: 15px; line-height: 1.4; }
.obs-item b { min-width: 96px; color: var(--accent); font-weight: 600; }
.obs-item.change b { color: var(--ok); }
.comment-small { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Faz 3 ---------- */
.card { box-shadow: 0 1px 2px rgba(90,50,45,.05); }
.card h2 { font-size: 19px; }
.card h3 { font-size: 15px; font-weight: 650; margin-bottom: 8px; }
.card.hero { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.sm { padding: 11px 14px; font-size: 15px; width: auto; }
.badge { color: #fff; background: var(--accent-strong); }
.badge.warn { color: var(--accent-ink); }
.lang button.on { background: var(--accent-soft); color: var(--accent-ink); }
.input.sm { font-size: 16px; padding: 11px 12px; letter-spacing: 0; }
.input.area { font-size: 16px; letter-spacing: 0; resize: none; min-height: 76px; font-family: inherit; line-height: 1.4; }
.comment.md { font-size: 19px; }

.screen.has-tabs { padding-bottom: calc(var(--safe-bottom) + 92px); }
.tabbar[hidden] { display: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: rgba(250,245,242,.94); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 6px 12px calc(var(--safe-bottom) + 6px);
}
.tabbar button {
  flex: 1; background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px;
}
.tabbar .ti { font-size: 20px; line-height: 1; }
.tabbar button.on { color: var(--accent-strong); background: var(--accent-soft); }

.products { display: flex; flex-direction: column; gap: 10px; }
.plist { display: flex; flex-direction: column; gap: 8px; }
.prod { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg); border-radius: 12px; }
.prod > div { display: flex; flex-direction: column; min-width: 0; }
.prod b { font-weight: 600; overflow-wrap: anywhere; }
.prod.past { opacity: .8; margin-top: 6px; }
.chipbtn { border: 1px solid var(--accent); color: var(--accent-strong); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chipbtn.ghost { border-color: var(--line); color: var(--muted); }
.addrow { display: flex; gap: 8px; }
.addrow .input { flex: 1; min-width: 0; }
details.past summary { color: var(--muted); font-size: 14px; cursor: pointer; padding: 4px 0; }

.weekly { display: flex; flex-direction: column; gap: 8px; }
.wsum { font-size: 16px; line-height: 1.5; }
.hl { padding-left: 18px; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.hl li::marker { color: var(--accent-strong); }
.prog { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.prog i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.wold { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }

.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cal-head strong { text-transform: capitalize; }
.navbtn { background: var(--surface-2); border: 0; color: var(--text); width: 36px; height: 36px; border-radius: 999px; font-size: 22px; line-height: 1; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.grid.wd span { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; padding-bottom: 2px; }
.cell { aspect-ratio: 1; border: 0; background: none; border-radius: 10px; color: var(--text); font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative; }
.cell.empty { pointer-events: none; }
.cell.shot { background: var(--accent-soft); font-weight: 650; }
.cell.ref { background: var(--accent); color: #fff; }
.cell.today { outline: 2px solid var(--accent-strong); outline-offset: -2px; }
.cell em { display: flex; gap: 2px; height: 6px; }
.mk { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.mk.start { background: var(--ok); }
.mk.stop { background: var(--bad); }
.dot.shot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent-soft); border: 1px solid var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

.settings { display: flex; flex-direction: column; gap: 10px; }
.notebox { display: flex; flex-direction: column; gap: 8px; }
.notebox .btn { align-self: flex-end; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 9px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.select { font-size: 15px; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); max-width: 60vw; }
.cmp { display: flex; flex-direction: column; gap: 10px; }
.cmp-ctrl { display: flex; flex-direction: column; gap: 8px; }
.ba { position: relative; width: 100%; aspect-ratio: 3/4; border-radius: 16px; overflow: hidden; background: var(--surface-2); touch-action: pan-y; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-top { position: absolute; inset: 0; }
.ba-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid #fff; pointer-events: none; }
.ba-line i { position: absolute; top: 50%; left: -16px; width: 30px; height: 30px; margin-top: -15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
.ba-tag { position: absolute; top: 10px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(58,42,40,.6); padding: 2px 8px; border-radius: 8px; pointer-events: none; }
.ba-tag.l { left: 10px; } .ba-tag.r { right: 10px; }

.toast { box-shadow: 0 4px 16px rgba(60,30,30,.15); }

/* ---------- faz3-0.2 ---------- */
.addbox { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.addbox > .btn { align-self: flex-end; }
.types { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 600; }
.tchip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.sugwrap { position: relative; }
.sug { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(60,30,30,.14); max-height: 280px; overflow-y: auto; }
.sug button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; color: var(--text); font-size: 15px; }
.sug button:last-child { border-bottom: 0; }
.sug button span { font-size: 12px; color: var(--muted); }
.sug button:active { background: var(--accent-soft); }
.ptag { display: inline-block; font-size: 11px; font-weight: 650; color: var(--accent-strong); background: var(--accent-soft); border-radius: 6px; padding: 1px 6px; margin-right: 6px; }

/* #11: yükseklik JS ile ölçülür (--app-h; ana ekran uygulamasında gerçek ekran yüksekliği) */
html, body { bottom: auto; height: var(--app-h, 100%); }
#app { bottom: auto; height: var(--app-h, 100%); }
.capture { bottom: auto; height: var(--app-h, 100%); }
.tabbar { bottom: auto; top: var(--app-h, 100%); transform: translateY(-100%); }

/* faz3-0.4 (#12): öneri listesi sayfanın içinde açılır, klavye açıkken alt menü gizlenir */
.sug { position: static; margin-top: 6px; max-height: none; overflow: visible; box-shadow: 0 4px 14px rgba(60,30,30,.10); }
body.typing .tabbar { display: none; }
body.typing .screen.has-tabs { padding-bottom: 70vh; }

/* faz3-0.5: daha yakın çekim → oval büyüdü (yüz yüksekliği ≈ %50–80 kare) */
.oval { top: 46%; width: min(86vw, 46vh); height: min(115vw, 62vh); max-width: none; max-height: none; }
.card.notice { background: var(--accent-soft); border-color: var(--accent); display: flex; flex-direction: column; gap: 8px; }
.card.notice .btn { align-self: flex-start; }
/* faz4 */
a.linkbtn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
input[type=time].input { min-width: 0; }
