/* Sonrix Task — mobil-first, Sonrix tasarım dili (lacivert + turuncu) */
:root {
  --brand: #1e40af; --brand-dark: #1e3a8a; --brand-light: #3b82f6; --brand-soft: #eff6ff;
  --accent: #ea580c; --accent-light: #f97316; --accent-soft: #fff7ed;
  --text: #0f172a; --muted: #475569; --faint: #94a3b8;
  --border: #e5e7eb; --border-soft: #f1f5f9;
  --bg: #f8fafc; --card: #ffffff;
  --green: #16a34a; --red: #dc2626;
  --radius: 1.1rem; --radius-sm: 0.7rem;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.05);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif; }
body { min-height: 100vh; min-height: 100dvh; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }
.loading { padding: 4rem 1rem; text-align: center; color: var(--faint); }

/* ── Login ── */
.login-wrap { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: linear-gradient(160deg, #0b1220 0%, #1e3a8a 100%); }
.login-card { width: 100%; max-width: 360px; background: #fff; border-radius: 1.4rem; padding: 2rem 1.5rem; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.logo { font-weight: 900; letter-spacing: -0.04em; font-size: 1.6rem; color: var(--brand-dark); }
.logo .dot { color: var(--accent); }
.logo-sub { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 1.5rem; }
.field { margin-bottom: .9rem; }
.field label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
.field input, .field select { width: 100%; padding: .75rem .9rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.field input:focus { outline: 2px solid var(--brand-light); border-color: transparent; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .8rem 1.2rem;
  border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 700; transition: transform .12s ease, opacity .15s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%); color: #fff; width: 100%; }
.btn-orange { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%); color: #fff; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-sm { padding: .45rem .8rem; font-size: .85rem; border-radius: .6rem; }
.btn-danger { background: #fef2f2; color: var(--red); border-color: #fecaca; }
.err { color: var(--red); font-size: .85rem; margin: .5rem 0 0; min-height: 1.2em; }

/* ── Kabuk ── */
.shell { max-width: 560px; margin: 0 auto; padding: 0 1rem calc(5.5rem + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0 .6rem; }
.topbar .logo { font-size: 1.25rem; }
.hello { font-size: .85rem; color: var(--muted); }

/* ── Alt sekmeler ── */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-top: 1px solid var(--border-soft);
  display: flex; justify-content: space-around; padding: .45rem .5rem calc(.45rem + env(safe-area-inset-bottom)); }
.tab { display: flex; flex-direction: column; align-items: center; gap: .15rem; border: 0; background: none;
  font-size: .68rem; font-weight: 600; color: var(--faint); padding: .25rem .9rem; border-radius: .8rem; }
.tab .ico { font-size: 1.35rem; line-height: 1; }
.tab.on { color: var(--brand); background: var(--brand-soft); }

/* ── Kartlar ── */
.card { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 1.1rem; margin-bottom: .9rem; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 .75rem; font-size: 1rem; display: flex; align-items: center; gap: .45rem; }
.card h3 .right { margin-left: auto; font-size: .8rem; font-weight: 600; color: var(--faint); }

/* ── Su ── */
.water-row { display: flex; align-items: center; gap: 1rem; }
.water-ring { position: relative; width: 86px; height: 86px; flex-shrink: 0; }
.water-ring svg { transform: rotate(-90deg); }
.water-ring .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .72rem; color: var(--muted); }
.water-ring .mid b { font-size: .95rem; color: var(--text); }
.water-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: .5rem .85rem; font-weight: 700; font-size: .85rem; color: var(--brand-dark); }
.chip:active { background: var(--brand-soft); }

/* ── Liste öğeleri ── */
.item { display: flex; align-items: center; gap: .7rem; padding: .65rem 0; border-bottom: 1px solid var(--border-soft); }
.item:last-child { border-bottom: 0; }
.item .emoji { font-size: 1.3rem; width: 2.1rem; height: 2.1rem; display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); border-radius: .65rem; flex-shrink: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 600; font-size: .95rem; }
.item .s { font-size: .78rem; color: var(--faint); }
.item .done-slot { display: inline-flex; align-items: center; gap: .25rem; margin: .15rem .3rem 0 0;
  font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .25rem .6rem; border: 1px solid var(--border); background: #fff; }
.item .done-slot.ok { background: #f0fdf4; border-color: #bbf7d0; color: var(--green); }
.check { width: 2rem; height: 2rem; border-radius: 999px; border: 2px solid var(--border); background: #fff; font-size: 1rem; color: transparent; flex-shrink: 0; }
.check.ok { background: var(--green); border-color: var(--green); color: #fff; }
.check.ack { color: var(--brand); border-color: var(--brand-light); font-size: .9rem; }
.ack-chip { width: 2rem; height: 2rem; border-radius: 999px; background: #f0fdf4; border: 2px solid #bbf7d0; display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; flex-shrink: 0; }
.empty { color: var(--faint); font-size: .9rem; text-align: center; padding: .8rem 0; }

/* ── FAB ── */
.fab { position: fixed; right: 1.1rem; bottom: calc(5.2rem + env(safe-area-inset-bottom)); z-index: 41;
  width: 3.4rem; height: 3.4rem; border-radius: 999px; border: 0; font-size: 1.6rem; color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  box-shadow: 0 10px 28px rgba(234,88,12,.45); }

/* ── Modal ── */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 560px; border-radius: 1.4rem 1.4rem 0 0; padding: 1.3rem 1.2rem calc(1.3rem + env(safe-area-inset-bottom)); max-height: 88dvh; overflow-y: auto; }
.modal h2 { margin: 0 0 1rem; font-size: 1.15rem; }
.seg { display: flex; gap: .4rem; margin-bottom: 1rem; }
.seg button { flex: 1; padding: .55rem .3rem; border-radius: .7rem; border: 1px solid var(--border); background: #fff; font-size: .8rem; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--brand-soft); border-color: var(--brand-light); color: var(--brand-dark); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.dayspick { display: flex; gap: .3rem; flex-wrap: wrap; }
.dayspick button { width: 2.4rem; height: 2.4rem; border-radius: .6rem; border: 1px solid var(--border); background: #fff; font-size: .75rem; font-weight: 700; color: var(--muted); }
.dayspick button.on { background: var(--brand-soft); border-color: var(--brand-light); color: var(--brand-dark); }
.times-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.times-list .tt { display: inline-flex; align-items: center; gap: .3rem; background: var(--accent-soft); border: 1px solid #fed7aa; color: var(--accent); font-weight: 700; border-radius: 999px; padding: .3rem .7rem; font-size: .85rem; }
.times-list .tt button { border: 0; background: none; color: inherit; font-size: 1rem; padding: 0; }
.modal-actions { display: flex; gap: .6rem; margin-top: 1.2rem; }
.modal-actions .btn { flex: 1; }

/* ── Ayarlar ── */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--border-soft); }
.set-row:last-child { border-bottom: 0; }
.set-row .l { font-weight: 600; font-size: .92rem; }
.set-row .d { font-size: .78rem; color: var(--faint); }
.code { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; background: var(--bg); border: 1px solid var(--border-soft); border-radius: .5rem; padding: .5rem .6rem; word-break: break-all; user-select: all; }
.note { font-size: .8rem; color: var(--muted); line-height: 1.5; }
.note a { color: var(--brand); }
/* ── Partner / atama ── */
.badge-from { display: inline-block; font-size: .68rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); border: 1px solid #fed7aa; border-radius: 999px; padding: .1rem .5rem; vertical-align: middle; }
.badge-shared { color: var(--brand-dark); background: var(--brand-soft); border-color: #c7d7fe; }
.partner-card { border-left: 4px solid var(--accent); }
.p-water { display: flex; align-items: center; gap: .6rem; font-size: .88rem; font-weight: 600; }
.p-bar { flex: 1; height: .55rem; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.p-fill { height: 100%; background: #3b82f6; border-radius: 999px; transition: width .3s; }
.p-fill.low { background: var(--accent); }
.p-pct { color: var(--muted); font-size: .8rem; }

/* ── Paylaş (foto + çizim) ── */
.dot-badge { position: absolute; margin-left: .9rem; margin-top: -.2rem; width: .6rem; height: .6rem; background: var(--red); border-radius: 999px; border: 2px solid #fff; display: inline-block; }
.tab .ico { position: relative; }
.feed { max-height: 58dvh; overflow-y: auto; display: flex; flex-direction: column; gap: .7rem; padding: .2rem; }
.bubble { max-width: 78%; align-self: flex-start; background: #fff; border: 1px solid var(--border-soft); border-radius: 1rem 1rem 1rem .3rem; padding: .4rem; box-shadow: var(--shadow); }
.bubble.mine { align-self: flex-end; background: var(--brand-soft); border-color: #dbeafe; border-radius: 1rem 1rem .3rem 1rem; }
.bubble img { display: block; width: 100%; border-radius: .7rem; }
.bubble .cap { font-size: .88rem; padding: .35rem .3rem 0; }
.bubble .meta { font-size: .7rem; color: var(--faint); padding: .25rem .3rem 0; text-align: right; }
.compose { position: fixed; left: 0; right: 0; bottom: calc(4.4rem + env(safe-area-inset-bottom)); z-index: 39;
  display: flex; gap: .6rem; justify-content: center; padding: .6rem 1rem;
  background: linear-gradient(180deg, transparent, var(--bg) 40%); max-width: 560px; margin: 0 auto; }
.compose .btn { flex: 1; max-width: 200px; }
.draw-tools { display: flex; align-items: center; gap: .45rem; margin-bottom: .7rem; }
.cbtn { width: 1.9rem; height: 1.9rem; border-radius: 999px; border: 3px solid transparent; }
.cbtn.on { border-color: #cbd5e1; transform: scale(1.15); }
.sbtn { border: 1px solid var(--border); background: #fff; border-radius: .5rem; width: 2.2rem; height: 2.2rem; font-size: .8rem; line-height: 1; color: var(--text); }
.sbtn.on { background: var(--brand-soft); border-color: var(--brand-light); }
#dCanvas { display: block; margin: 0 auto; background: #fff; border: 2px solid var(--border); border-radius: 1rem; cursor: crosshair; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(6.5rem + env(safe-area-inset-bottom)); z-index: 60;
  background: #0f172a; color: #fff; padding: .6rem 1.1rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
  opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.show { opacity: 1; }
