/* Bizim Ev — ortak tasarım (giriş, Bizim Ev, yönetim paneli, oyun) */
:root {
  --bg: #f6efe6;
  --bg-2: #efe5d8;
  --card: #fffdf9;
  --line: #e6d9c8;
  --line-2: #d8c7b2;
  --text: #2f2721;
  --muted: #85766a;
  --accent: #c2603a;
  --accent-2: #a94f2c;
  --accent-soft: #f6dfd2;
  --honey: #e3a33b;
  --honey-soft: #fbedd2;
  --sage: #5b8a64;
  --sage-soft: #e1eedf;
  --danger: #c0443a;
  --danger-soft: #f8dcd8;
  --warn: #a8701a;
  --radius: 18px;
  --shadow: 0 1px 2px #6b4a2a14, 0 6px 20px #6b4a2a12;
  --tap: 48px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  min-height: 100vh;
}
a { color: var(--accent-2); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; margin: 16px 0 6px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.sub { margin: 4px 0 0; }
.m0 { margin: 0; }
.pre { white-space: pre-wrap; margin-top: 10px; }
[hidden] { display: none !important; }

/* ---------- düğmeler & alanlar ---------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 10px 18px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: center;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: #fff6ec; border-color: #c9b39a; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--danger); border-color: #e9c2bc; }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: 14px; border-radius: 11px; }
.btn.big { min-height: 54px; font-size: 17px; }
.icon-btn {
  appearance: none; border: 0; background: transparent; color: var(--text); font-size: 22px; line-height: 1;
  min-width: var(--tap); min-height: var(--tap); border-radius: 12px; cursor: pointer; display: inline-grid; place-items: center;
}
.icon-btn:hover { background: var(--bg-2); }
.link-btn { appearance: none; border: 0; background: none; color: var(--accent-2); font: inherit; font-weight: 600; padding: 8px 2px; cursor: pointer; }
.link-btn.danger { color: var(--danger); font-size: 13px; padding: 0 4px; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: #fff; border: 1px solid var(--line-2);
  border-radius: 12px; padding: 11px 13px; width: 100%; min-height: var(--tap);
}
textarea { resize: vertical; min-height: 0; }
input:focus, select:focus, textarea:focus { outline: 3px solid #c2603a33; border-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--accent); }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.lbl { display: block; font-size: 14px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.error { color: var(--danger); font-size: 15px; font-weight: 600; margin-top: 10px; }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; }

/* ---------- giriş ---------- */
body.auth { display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(900px 500px at 20% -10%, #f3d3bf 0, transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 32px 26px; box-shadow: var(--shadow); }
.auth-card form { display: grid; gap: 16px; margin-top: 26px; }
.auth-card .btn { width: 100%; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand h1 { font-size: 24px; }
.brand p { margin-top: 2px; font-size: 14px; }
.logo { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: linear-gradient(140deg, var(--honey), var(--accent)); color: #fff; font-size: 24px; font-weight: 800; flex: none; }

/* ---------- yönetim & oyun sayfalarının üst çubuğu ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px; background: #f6efe6ee; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand-sm { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 17px; }
.brand-sm .logo { width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); padding: 7px 12px; border-radius: 10px; font-weight: 600; }
.topbar nav a:hover, .topbar nav a.active { color: var(--text); background: var(--bg-2); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.who b { color: var(--text); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h3 { margin-bottom: 12px; }

/* ---------- Bizim Ev iskeleti ---------- */
body.ev { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
.side { display: none; }
.appbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px 16px; background: #f6efe6f0; backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.appbar h1 { font-size: 19px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar #back { margin-left: -8px; font-size: 30px; }
.live { width: 9px; height: 9px; border-radius: 50%; background: #cdbfae; margin: 0 6px; flex: none; }
.live.on { background: var(--sage); box-shadow: 0 0 0 4px #5b8a6422; }
.view { max-width: 780px; margin: 0 auto; padding: 16px 16px 32px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fffdf9f5; backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a, .tabbar button {
  appearance: none; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted);
  display: grid; justify-items: center; gap: 2px; padding: 8px 2px 9px; min-height: 60px; cursor: pointer;
}
.tabbar span { font-size: 22px; line-height: 1.1; filter: grayscale(.4); }
.tabbar .active { color: var(--accent-2); }
.tabbar .active span { filter: none; }

@media (min-width: 960px) {
  body.ev { padding-bottom: 0; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
  .tabbar { display: none; }
  .side {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 20px 14px; border-right: 1px solid var(--line); background: #f3eadf;
  }
  .side-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); padding: 4px 10px 14px; }
  .side-brand .logo { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; }
  .appbar { padding: 14px 28px; }
  .appbar h1 { font-size: 22px; }
  .view { padding: 24px 28px 48px; max-width: 980px; margin: 0; }
}
#side-nav a, .menu-body a, .nav-btn {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text); font-weight: 600;
  min-height: var(--tap); width: 100%; appearance: none; border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; text-align: left;
}
#side-nav a span, .menu-body a span, .nav-btn span { font-size: 20px; width: 26px; text-align: center; }
#side-nav a:hover, .menu-body a:hover, .nav-btn:hover { background: var(--bg-2); }
#side-nav a.active, .menu-body a.active { background: var(--accent-soft); color: var(--accent-2); }
.nav-btn small { margin-left: auto; color: var(--muted); }
.nav-grp { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 14px 12px 4px; }

/* ---------- ana sayfa ---------- */
.hello { font-size: 18px; color: var(--muted); margin: 2px 2px 14px; }
.hello b { color: var(--text); }
.quick { display: grid; gap: 12px; margin-bottom: 22px; }
.quick-btn {
  appearance: none; border: 0; font: inherit; text-align: left; cursor: pointer; color: var(--text);
  display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 22px; min-height: 84px; box-shadow: var(--shadow);
}
.quick-btn .qi { font-size: 30px; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: #ffffffa8; flex: none; }
.quick-btn b { display: block; font-size: 19px; }
.quick-btn small { color: #6d5b4d; font-size: 14px; }
.q-add { background: linear-gradient(135deg, #f4c9b2, #efb090); }
.q-search { background: linear-gradient(135deg, #f9e2b5, #f2cf86); }
.q-today { background: linear-gradient(135deg, #d6e8d3, #b9d6b6); }
.quick-btn:active { transform: scale(.99); }
@media (min-width: 700px) { .quick { grid-template-columns: repeat(3, 1fr); } .quick-btn { flex-direction: column; align-items: flex-start; min-height: 150px; } }
.summary { display: grid; gap: 12px; }
@media (min-width: 700px) { .summary { grid-template-columns: 1fr 1fr; } }
.sum-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--text); box-shadow: var(--shadow); }
.sum-card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 16px; }
.sum-card h3 a { color: var(--text); }
.count { background: var(--accent); color: #fff; border-radius: 999px; font-size: 13px; padding: 1px 9px; }
.mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mini a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--text); }
.mini a:hover { background: var(--bg); }
.mini small { display: block; color: var(--muted); font-size: 13px; }
.mini .when { text-align: right; white-space: nowrap; font-weight: 600; font-size: 14px; }
.mini li.late .when { color: var(--danger); }
.mini li.soon .when { color: var(--warn); }
.calm { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 17px; }

/* ---------- listeler ---------- */
.list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.row {
  appearance: none; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 10px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.row:hover { border-color: var(--line-2); }
.ricon { font-size: 24px; width: 42px; height: 42px; flex: none; display: grid; place-items: center; background: var(--bg); border-radius: 12px; }
.rbody { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rbody b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rbody b.wrap { white-space: normal; font-weight: 600; }
.rbody small, .si-body small { color: var(--muted); font-size: 14px; }
.path { color: var(--text) !important; }
.arr { color: var(--accent); font-weight: 700; padding: 0 2px; }
.thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; border: 1px solid var(--line); }
.badge { flex: none; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--bg-2); color: var(--muted); white-space: nowrap; }
.badge.late, .badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.soon, .badge.warn { background: var(--honey-soft); color: var(--warn); }
.badge.near, .badge.info { background: #e9e1f3; color: #6a4f8f; }
.badge.ok { background: var(--sage-soft); color: var(--sage); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty span { font-size: 40px; display: block; margin-bottom: 8px; }
.grp { font-size: 15px; margin: 18px 2px 8px; color: var(--muted); }
.grp.late { color: var(--danger); }
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; align-items: center; }
.toolbar.end { justify-content: flex-end; }
.toolbar .search { flex: 1; margin: 0; }
.search { margin-bottom: 12px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2385766a' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center; padding-left: 40px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.card .section-head { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin-left: -2px; }
.chips.scroll-x::-webkit-scrollbar { display: none; }
.chip {
  appearance: none; font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--text);
  background: var(--card); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 13px; min-height: 38px; cursor: pointer;
}
span.chip { cursor: default; min-height: 0; padding: 5px 11px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.more { color: var(--muted); }
.chip.miss { background: var(--danger-soft); border-color: #eec2bb; color: #8f3029; }
.chip small { color: var(--muted); font-weight: 500; }
.pill { display: inline-block; font-size: 13px; padding: 2px 9px; border-radius: 999px; background: var(--bg-2); color: #6d5b4d; margin: 2px 4px 2px 0; white-space: nowrap; }
.pill.ok { background: var(--sage-soft); color: var(--sage); }
.pills { display: block; }
.tag { color: var(--accent-2); font-size: 14px; font-weight: 600; }

/* ---------- alışveriş ---------- */
.add-row { display: flex; gap: 8px; margin-bottom: 8px; }
.add-row input { flex: 1; font-size: 17px; }
.sticky-add { position: sticky; top: calc(57px + env(safe-area-inset-top, 0px)); z-index: 5; background: var(--bg); padding: 4px 0; }
@media (min-width: 960px) { .sticky-add { top: 66px; } }
.shop-item { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px 10px 4px 4px; transition: opacity .25s, transform .25s; }
.shop-item.leaving { opacity: 0; transform: translateX(30px); }
.check {
  appearance: none; flex: none; width: 52px; height: 52px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; border-radius: 14px;
}
.check::before { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--line-2); background: #fff; transition: all .15s; }
.check:hover::before { border-color: var(--accent); }
.check.on::before { background: var(--sage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/16px no-repeat; border-color: var(--sage); }
.si-body { appearance: none; flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--text); text-align: left; padding: 10px 4px; cursor: pointer; display: grid; gap: 1px; }
.si-body b { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.shop-item.done b, .surp.bought b { text-decoration: line-through; color: var(--muted); }
.done-box { margin-top: 18px; }
.done-box summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 10px 2px; min-height: var(--tap); }
.qa-added { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 4px; }
.qa-freq { margin-top: 8px; }
.surp { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px 10px 4px 4px; }
.lock { background: var(--honey-soft); color: #7a5413; border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px; }

/* ---------- öneri kartları ---------- */
.stack { display: grid; gap: 14px; }
.suggest { list-style: none; margin: 16px 0 12px; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.sug-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 8px; counter-increment: s; }
.sug-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sug-top b { font-size: 18px; }
.sug-top b::before { content: counter(s) ". "; color: var(--accent); }
.sug-link { color: var(--text); display: grid; gap: 6px; }
.sug-card .chips { margin: 0; }
.sug-card .btn { justify-self: start; }
.ok-line { color: var(--sage); font-weight: 600; }
.cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; background: linear-gradient(135deg, #d6e8d3, #b9d6b6); color: var(--text); font-weight: 700; font-size: 17px; padding: 16px 18px; border-radius: 18px; margin-bottom: 14px; }
.cta span { font-weight: 500; font-size: 14px; color: #4a5f4c; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opt { display: inline-flex; color: var(--text); font-weight: 600; cursor: pointer; }
.chip-opt input { position: absolute; opacity: 0; pointer-events: none; }
.chip-opt span { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 15px; min-height: 40px; display: inline-flex; align-items: center; }
.chip-opt input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-opt input:focus-visible + span { outline: 3px solid #c2603a55; }
.check-row { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 16px; font-weight: 500; min-height: var(--tap); cursor: pointer; }
.check-row input { width: 22px; height: 22px; }

/* ---------- ayrıntı ---------- */
.detail h2 { font-size: 22px; margin: 2px 0 8px; }
.kind { color: var(--muted); font-weight: 600; font-size: 14px; }
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 18px; margin: 14px 0 0; }
.dl dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.dl dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.photo { display: block; width: 100%; max-height: 360px; object-fit: contain; background: var(--bg); border-radius: 14px; margin-top: 14px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); display: grid; gap: 10px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -22px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.related { background: var(--honey-soft); border-radius: 14px; padding: 12px 14px; margin-top: 14px; }
.related ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.related .lbl { color: #7a5413; margin-bottom: 6px; }
.review { background: var(--sage-soft); border-radius: 14px; padding: 12px 14px; margin-top: 14px; }
.review b { color: var(--honey); font-size: 18px; letter-spacing: 2px; }
.orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.order-btn { appearance: none; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; display: grid; gap: 4px; }
.order-btn .when { font-size: 13px; color: var(--muted); font-weight: 600; }
.place h3 a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); }

/* ---------- masraflar ---------- */
.exp { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line-2); border-radius: 16px; padding: 10px 12px; }
.exp.late { border-left-color: var(--danger); background: #fff7f5; }
.exp.soon { border-left-color: var(--honey); background: #fffaf0; }
.exp.near { border-left-color: #b9a4d4; }
.exp-body { appearance: none; flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; display: grid; gap: 2px; padding: 4px 0; }
.exp-body b { font-size: 17px; }
.exp-body small { color: var(--muted); font-size: 14px; }
.exp.late .rel { color: var(--danger); font-weight: 700; }
.exp.soon .rel { color: var(--warn); font-weight: 700; }
.remind { color: #7a5413 !important; }
.exp-side { display: grid; justify-items: end; gap: 4px; flex: none; }
.hist-side { display: flex; align-items: center; gap: 6px; flex: none; }
.amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hist li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.hist small { display: block; color: var(--muted); font-size: 13px; }

/* ---------- alt pencere (sheet) ---------- */
dialog.sheet {
  border: 0; padding: 0; background: var(--card); color: var(--text); box-shadow: 0 -10px 40px #3b291a33;
  width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 22px 22px 0 0;
}
dialog.sheet.tall { height: 92vh; }
dialog.sheet::backdrop { background: #2b1e1466; }
dialog.sheet[open] { animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
@media (min-width: 700px) {
  dialog.sheet { margin: auto; max-width: 580px; border-radius: 22px; max-height: 88vh; }
  dialog.sheet.tall { height: 80vh; }
  dialog.sheet.small { max-width: 420px; }
}
.sheet-form { display: flex; flex-direction: column; max-height: inherit; height: 100%; }
dialog.sheet:not(.tall) .sheet-form { max-height: 92vh; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 10px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; font-size: 19px; }
.search-head { padding-left: 12px; }
.search-big { font-size: 17px; }
.sheet-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.sheet-body h2 { margin-bottom: 6px; }
.sheet-actions { display: flex; gap: 10px; align-items: center; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--card); }
.sheet-actions .grow { flex: 1; }
.sheet-actions .btn.primary { min-width: 120px; }
.fields { display: flex; flex-wrap: wrap; gap: 14px 12px; }
.field { flex: 1 1 100%; min-width: 0; }
.field.half { flex: 1 1 calc(50% - 6px); min-width: 140px; }
.field > label { margin-bottom: 0; }
.field .hint { display: block; margin-top: 4px; }
.tag-sugg { margin: 8px 0 0; }
.tag-sugg .chip { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.photo-field { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.photo-prev img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; }
.photo-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.photo-btns label { color: var(--text); display: inline-flex; }
.menu-body { padding-top: 4px; }

/* ---------- bildirim ---------- */
dialog .toasts { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
@media (min-width: 960px) { .toasts { bottom: 24px; left: auto; right: 24px; justify-items: end; } }
.toast, body:not(.ev) .toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px; max-width: 440px; padding: 12px 14px 12px 16px; border-radius: 14px;
  background: #3a2e26; color: #fff; box-shadow: 0 10px 30px #0004; font-size: 15px; animation: up .2s ease-out;
}
.toast.err { background: var(--danger); }
.toast button { appearance: none; border: 0; background: #ffffff26; color: #fff; font: inherit; font-weight: 700; padding: 8px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
body:not(.ev) .toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; }

/* ---------- yönetim paneli ---------- */
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 10px 14px; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.new-user { display: grid; grid-template-columns: 1fr 1fr 150px auto; gap: 12px; align-items: end; }
@media (max-width: 760px) { .new-user { grid-template-columns: 1fr; } }
.pw-row { display: flex; gap: 6px; }
.pw-row .btn { white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--bg-2); }
tr:last-child td { border-bottom: 0; }
td.actions { display: flex; gap: 6px; }
td select { width: auto; padding: 5px 8px; min-height: 36px; border-radius: 9px; }
.wrap dialog { border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--text); padding: 24px; width: min(420px, calc(100vw - 32px)); }
.wrap ~ dialog, body > dialog:not(.sheet) { border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--text); padding: 24px; width: min(420px, calc(100vw - 32px)); }
body > dialog:not(.sheet)::backdrop { background: #2b1e1466; }
body > dialog:not(.sheet) form { display: grid; gap: 14px; }
body > dialog:not(.sheet) .row { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Kare Kare oyunu (/oyun) ---------- */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .game-layout { grid-template-columns: minmax(0, 1fr); } }
.game-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.game-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.stats { display: flex; gap: 18px; color: var(--muted); }
.stats b { color: var(--text); font-variant-numeric: tabular-nums; font-size: 18px; margin-left: 4px; }
.board-wrap { position: relative; width: 100%; max-width: 520px; margin: 0 auto; aspect-ratio: 1; }
#board { width: 100%; height: 100%; display: block; border-radius: 12px; touch-action: none; }
.overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; background: #0d1117c4; color: #fff; border-radius: 12px; }
.overlay .muted { color: #d8cfc5; }
#ov-title { font-size: 26px; font-weight: 800; }
.overlay .btn { margin-top: 12px; min-width: 140px; }
.pad { display: none; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 8px; justify-content: center; margin: 16px 0 4px; }
.pad .btn { padding: 0; font-size: 20px; }
.pad [data-dir="up"] { grid-column: 2; }
.pad [data-dir="left"] { grid-column: 1; grid-row: 2; }
.pad [data-dir="down"] { grid-column: 2; grid-row: 2; }
.pad [data-dir="right"] { grid-column: 3; grid-row: 2; }
@media (pointer: coarse) { .pad { display: grid; } }
.game-card .hint { text-align: center; margin-top: 12px; }
.leader { margin: 0; padding: 0; list-style: none; counter-reset: r; display: grid; gap: 6px; }
.leader li { counter-increment: r; display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.leader li::before { content: counter(r) "."; color: var(--muted); width: 22px; }
.leader li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader li.me { outline: 2px solid #c2603a55; }
.leader .empty { justify-content: center; color: var(--muted); padding: 8px; }
.leader .empty::before { content: none; }

/* ---------- bildirimler ---------- */
.steps { margin: 0 0 10px; padding-left: 22px; display: grid; gap: 8px; line-height: 1.45; }
.ok-line { color: var(--sage, #4f7a55); font-weight: 600; margin-bottom: 10px; }
.check-row small { font-weight: 400; font-size: 13px; line-height: 1.4; }
.check-row input { flex: none; align-self: flex-start; margin-top: 2px; }

.kk-wrap { display: flex; justify-content: center; min-width: 0; overflow: hidden; }
.kk-inner { position: relative; width: 100%; max-width: 480px; min-width: 0; }
#kk { display: block; margin: 0 auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab; }
.kk-overlay { inset: 0 0 auto 0; border-radius: 16px; background: #1e1814d9; }
.kk-overlay[hidden] { display: none; }
.game-head .stats { align-items: center; flex-wrap: wrap; }
@media (max-width: 520px) {
  .game-page .wrap { padding: 10px 8px 40px; }
  .game-page .topbar nav, .game-page #who { display: none; }
  .game-page .topbar { flex-wrap: nowrap; }
  .game-page .game-card { padding: 12px; }
  .game-page .game-head h2 { font-size: 20px; }
}

/* ---------- ev kurulumu / davet ---------- */
body.no-house .tabbar { display: none; }
.lead { margin: -4px 0 16px; line-height: 1.5; }
.linklike { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.invite-card { display: grid; gap: 10px; justify-items: center; padding: 28px 18px; }
.invite-card .btn { min-width: 200px; }
.big-emoji { font-size: 52px; line-height: 1; }
.warn-box { background: #fff6e5; border: 1px solid #f0d9a8; color: #6b4a12; border-radius: 12px; padding: 12px 14px; text-align: left; }
.code { font-family: ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .08em; }
h4.grp { margin: 18px 0 8px; }

/* ---------- giriş: Google ---------- */
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 50px; background: #fff; border: 1px solid #d6cabb; color: #2b2520; font-weight: 600; text-decoration: none; margin: 18px 0 6px; }
.google-btn:hover { background: #fffaf5; }
.pw-login { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.pw-login summary { cursor: pointer; color: var(--muted); font-size: 14px; text-align: center; list-style: none; }
.pw-login summary::-webkit-details-marker { display: none; }
.pw-login[open] summary { margin-bottom: 12px; }
.notice { background: var(--sage-soft); border-radius: 12px; padding: 10px 12px; margin: 12px 0 0; font-size: 14px; }
.notice.error { background: #fde8e4; color: #8a2f1d; }
.legal { margin-top: 16px; }
.legal a { color: inherit; text-decoration: underline; }
/* herkese açık bilgi sayfaları */
.doc { max-width: 760px; margin: 0 auto; padding: 32px 18px 60px; line-height: 1.6; }
.doc h1 { font-size: 28px; margin-bottom: 4px; }
.doc h2 { font-size: 19px; margin: 28px 0 8px; }
.doc ul { padding-left: 22px; }
.doc .muted { margin-bottom: 18px; }
