:root {
  --bg: #FFF7F2;
  --surface: #FFFFFF;
  --surface-2: #FFF1EA;
  --text: #22181C;
  --muted: #7A6A70;
  --line: #F1E2DA;
  --brand: #FF7A59;
  --brand-2: #FFB347;
  --brand-ink: #FFFFFF;
  --furkan: #3B82F6;
  --ozge: #F43F5E;
  --ok: #16A34A;
  --warn: #F59E0B;
  --danger: #DC2626;
  --radius: 20px;
  --shadow: 0 6px 24px rgba(80, 30, 20, .08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17120F;
    --surface: #221B18;
    --surface-2: #2C2320;
    --text: #F7EDE8;
    --muted: #B3A39C;
    --line: #3A2F2B;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { max-width: 100%; display: block; }
a { color: var(--brand); }
.hidden { display: none !important; }

/* ---------- iskelet */
.app { min-height: 100%; padding: calc(var(--safe-top) + 8px) 16px calc(var(--safe-bottom) + 96px); max-width: 720px; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 6px 0 14px; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 75%, transparent); }
.topbar h1 { font-size: 26px; margin: 0; letter-spacing: -.5px; flex: 1; }
.topbar h1 small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); font-size: 18px; }
.badge { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--surface); color: var(--muted); box-shadow: var(--shadow); white-space: nowrap; }
.badge.on { color: var(--ok); }
.badge.off { color: var(--muted); }
.badge.warn { color: var(--warn); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 24px calc(var(--safe-bottom) + 8px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); min-width: 72px; padding: 4px 0; }
.tab .ic { font-size: 22px; }
.tab.active { color: var(--brand); font-weight: 600; }
.fab {
  width: 64px; height: 64px; border-radius: 50%; margin-top: -30px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 34px; font-weight: 300; line-height: 1;
  box-shadow: 0 10px 30px rgba(255, 122, 89, .45);
  display: grid; place-items: center;
}
.fab:active { transform: scale(.94); }

/* ---------- bölümler & kartlar */
.section { margin: 18px 0 8px; display: flex; align-items: baseline; gap: 8px; }
.section h2 { font-size: 15px; margin: 0; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); flex: 1; }
.section .count { font-size: 13px; color: var(--muted); }
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 10px; position: relative; overflow: hidden;
}
.card.tap { cursor: pointer; }
.card.tap:active { transform: scale(.99); }
.card.attn { outline: 2px solid var(--brand); }
.card .kicker { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.card h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.card p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.who-furkan { color: var(--furkan); }
.who-ozge { color: var(--ozge); }
.bg-furkan { background: var(--furkan); }
.bg-ozge { background: var(--ozge); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); font-size: 12px; color: var(--muted); }
.pill.brand { background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand); }
.pill.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.empty { text-align: center; color: var(--muted); padding: 22px 10px; font-size: 14px; }
.empty .big { font-size: 40px; display: block; margin-bottom: 6px; }

.opts-preview { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.result { margin-top: 8px; font-weight: 600; color: var(--ok); }

/* ---------- butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 16px;
  background: var(--surface-2); font-weight: 600;
}
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 12px; }
.btn:disabled { opacity: .5; }
.btn:active:not(:disabled) { transform: scale(.98); }

.choice {
  width: 100%; min-height: 64px; border-radius: 18px; padding: 10px 16px; margin-bottom: 10px;
  background: var(--surface-2); font-size: 18px; font-weight: 600; text-align: left;
  display: flex; align-items: center; gap: 12px;
}
.choice img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; flex: none; }
.choice.win { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); outline: 2px solid var(--ok); }
.choice:active { transform: scale(.98); }

/* ---------- liste */
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.check {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); flex: none;
  display: grid; place-items: center; font-size: 15px; color: #fff;
}
.check.on { background: var(--ok); border-color: var(--ok); }
.list-item.done .txt { text-decoration: line-through; color: var(--muted); }
.list-item .meta { font-size: 11px; color: var(--muted); }
.quick-add { display: flex; gap: 8px; margin-top: 8px; }

/* ---------- form */
.field { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px; outline: none; }
.field:focus { border-color: var(--brand); }
textarea.field { resize: none; min-height: 110px; }
.label { font-size: 13px; color: var(--muted); margin: 14px 0 6px; display: block; font-weight: 600; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 4px; }
.seg button { flex: 1; padding: 10px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-row .thumb { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; font-size: 20px; }
.opt-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.radio { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); flex: none; font-size: 12px; display: grid; place-items: center; }
.radio.on { border-color: var(--brand); background: var(--brand); color: #fff; }

/* ---------- sayfa (sheet) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20, 10, 5, .4); z-index: 40; animation: fade .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 94dvh; overflow-y: auto;
  background: var(--bg); border-radius: 26px 26px 0 0; padding: 10px 18px calc(var(--safe-bottom) + 20px);
  animation: up .25s cubic-bezier(.2, .8, .2, 1); max-width: 720px; margin: 0 auto;
  -webkit-overflow-scrolling: touch;
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; font-size: 21px; flex: 1; }
.sheet-actions { display: flex; gap: 8px; margin-top: 16px; position: sticky; bottom: 0; padding-top: 8px; background: linear-gradient(transparent, var(--bg) 30%); }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- kasa ızgarası */
.grid { columns: 2; column-gap: 10px; }
.tile { break-inside: avoid; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden; cursor: pointer; }
.tile img { width: 100%; max-height: 260px; object-fit: cover; background: var(--surface-2); }
.tile .tb { padding: 10px 12px 12px; }
.tile .tb b { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile .tb .s { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.tile.note { background: color-mix(in srgb, var(--brand-2) 14%, var(--surface)); }
.tile .note-body { padding: 12px; font-size: 14px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.search { position: relative; margin-bottom: 10px; }
.search input { padding-left: 38px; }
.search::before { content: "🔎"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: .6; }

/* ---------- detay */
.hero-img { width: 100%; max-height: 340px; object-fit: cover; border-radius: 18px; margin-bottom: 12px; background: var(--surface-2); }
.kv { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.recipe ul, .recipe ol { padding-left: 20px; margin: 6px 0; }
.recipe li { margin: 4px 0; }
.ing { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.comments { margin-top: 16px; }
.comment { display: flex; gap: 8px; margin-bottom: 8px; }
.comment .bubble { background: var(--surface); border-radius: 16px; padding: 8px 12px; box-shadow: var(--shadow); font-size: 15px; }
.comment.mine { flex-direction: row-reverse; }
.comment.mine .bubble { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.comment .t { font-size: 11px; color: var(--muted); margin-top: 2px; }
.countdown { font-variant-numeric: tabular-nums; }

/* ---------- eşleşme / temizlik kaydırma */
.swipe-stage { position: relative; height: 380px; margin: 10px 0 16px; }
.swipe-card {
  position: absolute; inset: 0; background: var(--surface); border-radius: 26px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; touch-action: none; user-select: none;
  transition: transform .25s ease, opacity .25s ease;
}
.swipe-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.swipe-card .cap { position: relative; padding: 18px; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; }
.swipe-card .cap.plain { background: none; color: var(--text); }
.swipe-card .cap h3 { margin: 0; font-size: 26px; }
.swipe-card .stamp { position: absolute; top: 24px; font-size: 28px; font-weight: 800; padding: 4px 12px; border: 4px solid; border-radius: 12px; opacity: 0; transform: rotate(-12deg); }
.swipe-card .stamp.yes { left: 20px; color: var(--ok); }
.swipe-card .stamp.no { right: 20px; color: var(--danger); transform: rotate(12deg); }
.swipe-btns { display: flex; justify-content: center; gap: 28px; }
.swipe-btns button { width: 72px; height: 72px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); font-size: 30px; }

/* ---------- çark */
.wheel-wrap { position: relative; width: 280px; height: 280px; margin: 10px auto 18px; }
.wheel { width: 100%; height: 100%; border-radius: 50%; transition: transform 4s cubic-bezier(.12, .8, .1, 1); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.wheel span { position: absolute; left: 50%; top: 50%; transform-origin: 0 0; font-weight: 700; font-size: 14px; color: #fff; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.wheel-pin { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); font-size: 30px; z-index: 2; }

/* ---------- toast & konfeti */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(var(--safe-bottom) + 112px); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 16px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; font-size: 15px; animation: up .2s; max-width: 92vw; }
.toast button { color: var(--brand-2); font-weight: 700; }
.confetti { position: fixed; top: -40px; z-index: 70; font-size: 26px; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* ---------- giriş / kurulum */
.center-screen { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 12px; }
.center-screen img { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--shadow); }
.center-screen h1 { margin: 6px 0 0; }
.center-screen p { color: var(--muted); max-width: 340px; margin: 0; }
.steps { text-align: left; background: var(--surface); border-radius: 18px; padding: 14px 18px; box-shadow: var(--shadow); max-width: 360px; }
.steps li { margin: 8px 0; }
.banner { background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 12px; display: flex; gap: 10px; align-items: center; font-size: 14px; }
.banner.brand { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
.offline-strip { background: var(--warn); color: #000; text-align: center; font-size: 13px; padding: 4px; border-radius: 10px; margin-bottom: 8px; }
.mic-btn { width: 56px; height: 56px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); font-size: 24px; flex: none; }
.mic-btn.rec { background: var(--danger); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(220, 38, 38, .2); } }
.preview-card { border: 1px dashed var(--line); border-radius: 16px; padding: 12px; margin-bottom: 8px; display: flex; gap: 10px; align-items: flex-start; }
.spinner { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
code.tok { display: block; word-break: break-all; background: var(--surface-2); padding: 10px; border-radius: 10px; font-size: 12px; user-select: all; }
