/* DM Sans (variable weight 400-700), same family as the Jampack reference design; served from /fonts so it works offline. */
@font-face {
  font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/dmsans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/dmsans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #262b2e;
  --muted: #6b7377;
  --line: #ebeded;
  --accent: #007d88;
  --accent-soft: #f0f6f6;
  --accent-ink: #ffffff;
  --ok: #00d67f;
  --warn: #8a5d00;
  --warn-soft: #fff3cc;
  --danger: #c40000;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(20, 30, 35, 0.05);
  --nav-h: 64px;
  --side-w: 244px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121414;
    --card: #121414;
    --ink: #eceeef;
    --muted: #9ea6aa;
    --line: #272b2d;
    --accent: #2bb5c1;
    --accent-soft: #162a2e;
    --accent-ink: #04181b;
    --warn: #ffc400;
    --warn-soft: #3a3000;
    --danger: #ff6b6b;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { font-size: 14.5px; }
html, body { margin: 0; overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.5 "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
#app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }
#app.plain { padding-bottom: 32px; }
.loading { padding: 32px 0; color: var(--muted); }

/* ---------- header ---------- */
header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 18px 0 10px;
}
header.top h1 { font-size: 1.45rem; line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.avatar {
  flex: 0 0 auto; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; border: none;
  color: #fff; font-weight: 600; font-size: 0.95rem; display: grid; place-items: center;
}
.me { display: flex; align-items: center; gap: 8px; border: none; background: none; padding: 0; min-height: 44px; color: var(--muted); font-size: 0.85rem; }

/* ---------- controls ---------- */
button, select, input, textarea { font: inherit; color: inherit; }
button {
  min-height: 44px; padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--card); cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
button:active { transform: scale(0.98); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
button.link { border: none; background: none; color: var(--accent); text-decoration: underline; padding: 8px 4px; }
button.back { border: none; background: none; color: var(--accent); font-weight: 600; padding: 8px 4px; display: inline-flex; align-items: center; gap: 6px; }

input[type="search"], input[type="text"], input[type="number"], input[type="url"], input[type="date"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--card);
}
textarea { min-height: 88px; resize: vertical; }

.banner {
  margin: 8px 0; padding: 12px 14px; border-radius: var(--radius-sm);
  background: #fde8e8; color: #7a1f1f; border: 1px solid #f3b9b9;
}
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 90px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow);
  font-size: 0.95rem; z-index: 30; animation: pop 0.2s ease;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- summary and filters ---------- */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 12px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 8px; text-align: center; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 1.55rem; line-height: 1.1; font-weight: 600; }
.stat span { color: var(--muted); font-size: 0.82rem; }
.stat.buy b { color: var(--warn); }

.seg { display: flex; gap: 4px; padding: 4px; background: var(--accent-soft); border-radius: 14px; margin-bottom: 10px; }
.seg button { flex: 1 1 0; min-height: 44px; padding: 6px 4px; border: none; background: transparent; border-radius: 10px; font-size: 0.92rem; }
.seg button[aria-pressed="true"] { background: var(--card); box-shadow: var(--shadow); font-weight: 600; }

.section-title {
  margin: 20px 0 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.empty { color: var(--muted); padding: 28px 8px; text-align: center; }
.empty .big { display: grid; place-items: center; margin-bottom: 10px; color: var(--muted); opacity: 0.7; }

/* ---------- item cards ---------- */
ul.items { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 64px; text-align: left; padding: 10px 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.row .ico {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.row .body { flex: 1 1 auto; min-width: 0; }
.row .name { font-weight: 500; font-size: 1rem; overflow-wrap: anywhere; }
.row .meta { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.chip {
  flex: 0 0 auto; max-width: 42%; padding: 4px 10px; border-radius: 999px; font-size: 0.82rem;
  background: var(--accent-soft); color: var(--accent); overflow-wrap: anywhere; text-align: center; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.chip.buy { background: var(--warn-soft); color: var(--warn); }

.fab {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  width: min(528px, calc(100% - 32px)); min-height: 52px; border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28); z-index: 10;
}
.fab:active { transform: translateX(-50%) scale(0.98); }

/* ---------- bottom nav ---------- */
nav.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.bottom .inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); }
nav.bottom button {
  min-height: var(--nav-h); border: none; border-radius: 0; background: transparent; color: var(--muted);
  display: grid; justify-items: center; align-content: center; gap: 2px; font-size: 0.78rem; padding: 6px;
}
nav.bottom button .ni { display: grid; place-items: center; line-height: 1; }
nav.bottom button[aria-current="page"] { color: var(--accent); font-weight: 700; }

/* ---------- edit form ---------- */
form.edit { display: grid; gap: 14px; padding-top: 4px; }
form.edit fieldset {
  border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 14px;
  margin: 0; display: grid; gap: 12px; min-width: 0;
}
form.edit legend { padding: 0 6px; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
form.edit label { display: grid; gap: 4px; font-size: 0.9rem; color: var(--muted); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice button { min-height: 52px; font-weight: 600; }
.choice button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.choice button.buy[aria-pressed="true"] { background: var(--warn); border-color: var(--warn); color: var(--accent-ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions > button { flex: 1 1 140px; }
a.ext { color: var(--accent); overflow-wrap: anywhere; }

/* ---------- history timeline ---------- */
.day { margin: 18px 0 6px; font-weight: 700; }
ol.history { list-style: none; margin: 6px 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: grid; gap: 10px; }
ol.history li { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; overflow-wrap: anywhere; }
ol.history li::before {
  content: ""; position: absolute; left: -25px; top: 16px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}
ol.history .when { color: var(--muted); font-size: 0.8rem; }

/* ---------- identity picker ---------- */
.picker { display: grid; gap: 10px; padding-top: 12px; }
.picker button {
  min-height: 68px; display: flex; align-items: center; gap: 14px; font-size: 1.1rem; font-weight: 600;
  padding: 10px 16px; box-shadow: var(--shadow); border-radius: var(--radius); text-align: left;
}
.picker .avatar { width: 44px; height: 44px; }
.hello { color: var(--muted); margin: 0 0 6px; }

/* ---------- camp screen ---------- */
.camp-head { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 6px 0 12px; }
.camp-head h2 { margin: 0 0 2px; font-size: 1.2rem; overflow-wrap: anywhere; }
.camp-head .sub { color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.countdown { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.9rem; }
.progress { margin-top: 14px; }
.progress .label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.bar { height: 10px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s ease; }
.camp-form { display: grid; gap: 10px; margin-top: 12px; }
.camp-form label { display: grid; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.camp-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.who-head { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; font-weight: 700; }
.who-head .avatar { width: 32px; height: 32px; min-height: 32px; font-size: 0.85rem; }
.who-head small { margin-left: auto; color: var(--muted); font-weight: 400; }
.todo {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 12px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.todo .box {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--line);
  display: grid; place-items: center; font-weight: 800; color: transparent;
}
.todo[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.todo[aria-pressed="true"] .tname { color: var(--muted); }
.todo[aria-pressed="true"] .nm { text-decoration: line-through; }
.camp-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.camp-top h2 { min-width: 0; }
button.pill { flex: 0 0 auto; min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--accent); font-size: 0.85rem; }
.todo .tico { flex: 0 0 auto; display: grid; place-items: center; color: var(--muted); }
.todo .tname { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.todo small { display: block; color: var(--muted); font-weight: 400; }
.todo-line { display: flex; gap: 6px; align-items: stretch; }
.todo-line .todo { flex: 1 1 auto; }
.todo-line .del { flex: 0 0 44px; padding: 0; color: var(--muted); display: grid; place-items: center; }
.add-line { display: grid; grid-template-columns: 1fr; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-top: 16px; }
.add-line .pair { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- toast action, me button, camp filters ---------- */
.toast { display: flex; align-items: center; gap: 12px; }
.toast-action { min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit; font-weight: 700; }
.me .who { font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.mine { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 14px; margin: 4px 0 12px; font-size: 0.9rem; color: var(--ink); overflow-wrap: anywhere; }
.mine b { color: var(--accent); }
.archive-row { display: block; width: 100%; text-align: left; margin-bottom: 8px; padding: 12px 14px; }
.archive-row small { display: block; color: var(--muted); }
.readonly-note { color: var(--muted); font-size: 0.9rem; margin: 4px 0 8px; }

/* ---------- shell: side menu on wide screens (Jampack "classic" look), bottom tabs on phones ---------- */
.side, .brand-top { display: none; }
.bell-slot { display: flex; align-items: center; gap: 4px; }
.top-actions { display: flex; align-items: center; gap: 6px; }

@media (min-width: 992px) {
  #app { max-width: none; padding: 0; }
  .shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
  .side {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
    padding: 20px 14px; background: var(--card); border-right: 1px solid var(--line);
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 1.15rem; }
  .brand .logo { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
  .side .side-label { padding: 10px 12px 4px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
  .side button.nav-item {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 12px; border: none;
    background: transparent; color: var(--ink); border-radius: var(--radius-sm); text-align: left; font-weight: 500;
  }
  .side .ni { font-size: 1.2rem; width: 24px; text-align: center; }
  .side button.nav-item:hover { background: var(--accent-soft); }
  .side button.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
  .side .grow { flex: 1 1 auto; }
  .shell-main { padding: 0 32px 100px; max-width: 980px; width: 100%; }
  nav.bottom { display: none; }
  .fab { left: auto; right: 32px; bottom: 28px; transform: none; width: auto; padding: 8px 24px; }
  .fab:active { transform: scale(0.98); }
  .toast { bottom: 32px; }
  #app.plain { max-width: 560px; margin: 0 auto; padding: 0 16px 32px; }
}

/* ---------- login ---------- */
.login-wrap { min-height: 80vh; display: grid; place-items: center; }
form.login { width: 100%; max-width: 340px; display: grid; gap: 12px; padding: 24px 0; }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.3rem; }
.brand .logo { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
form.login input { text-align: center; letter-spacing: 0.3em; font-size: 1.3rem; min-height: 56px; width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); }
.login-error { margin: 0; min-height: 1.4em; color: var(--danger); font-weight: 600; text-align: center; }

/* ---------- notification bell ---------- */
.bell-wrap { position: relative; }
.bell-btn { position: relative; min-width: 44px; padding: 0 10px; border-radius: 999px; border: none; background: transparent; color: var(--muted); display: inline-grid; place-items: center; }
.bell-btn:hover { color: var(--ink); background: var(--accent-soft); }
.bell-count {
  position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 0.72rem; font-weight: 700; display: grid; place-items: center;
}
.bell-panel {
  position: absolute; right: 0; top: 50px; width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; z-index: 40;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}
.bell-list { list-style: none; margin: 0; padding: 0; }
.bell-list li { padding: 10px 14px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.bell-list li:last-child { border-bottom: none; }
.bell-list li.unread { background: var(--accent-soft); }
.bell-list small { display: block; color: var(--muted); }
@media (max-width: 600px) {
  .bell-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
}

/* ---------- icons ---------- */
svg.i { flex: 0 0 auto; display: block; }
.meta svg.i { display: inline-block; margin-left: 6px; vertical-align: -2px; }
.chip svg.i { margin-top: -1px; }
.section-title svg.i { color: var(--accent); }
@media (max-width: 991px) {
  input, select, textarea { font-size: 16px; } /* 16px stops iOS Safari from zooming into a focused field */
}

/* ---------- minimal skin: flat surfaces, hairline dividers, colour only where it carries meaning ---------- */
.row, .stat, .camp-head, .todo, .add-line, form.edit fieldset, .mine { box-shadow: none; }
ul.items { gap: 0; margin: 4px 0; }
.row { border: none; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 12px 4px; min-height: 60px; }
.row:hover { background: var(--accent-soft); }
.row .ico { background: transparent; width: 28px; height: 28px; color: var(--muted); }
.chip, .chip.buy { background: transparent; padding: 0; font-weight: 400; color: var(--muted); max-width: 45%; }
.chip.buy { color: var(--warn); }
.summary { display: flex; gap: 32px; margin: 6px 0 16px; }
.stat { background: transparent; border: none; padding: 0; text-align: left; }
.seg { background: transparent; padding: 0; border-radius: 0; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.seg button { border-radius: 0; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.seg button[aria-pressed="true"] { background: transparent; box-shadow: none; color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.todo { border: none; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.camp-head { border: none; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 8px 0 18px; }
.add-line { background: transparent; }
form.edit fieldset { background: transparent; }
ol.history li { border: none; background: transparent; padding: 4px 0; }
.mine { background: var(--accent-soft); }
.section-title svg.i { color: var(--muted); }
.section-title { margin: 22px 0 4px; }
.fab { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14); }
.side button.nav-item[aria-current="page"] { background: var(--accent-soft); }
.todo-line .del { border: none; background: transparent; }
.todo-line .del:hover { color: var(--danger); background: var(--accent-soft); }
.todo .box { border-radius: 6px; }
.pill { border-color: var(--line); }

/* ---------- "Aldım" button beside shopping-list rows ---------- */
li.rowline { display: flex; align-items: stretch; gap: 8px; border-bottom: 1px solid var(--line); }
li.rowline .row { flex: 1 1 auto; border-bottom: none; min-width: 0; }
button.bought {
  flex: 0 0 auto; align-self: center; min-height: 36px; padding: 4px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--accent); background: transparent; color: var(--accent); font-weight: 600; font-size: 0.9rem;
}
button.bought:hover { background: var(--accent-soft); }
small.hint { color: var(--muted); font-size: 0.8rem; }

/* ---------- install card ---------- */
.install-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.install-text { flex: 1 1 200px; color: var(--ink); font-size: 0.92rem; }
.install-btn { min-height: 38px; padding: 0 14px; }
.install-x { border: none; background: transparent; color: var(--muted); min-width: 32px; min-height: 32px; display: grid; place-items: center; padding: 0; }
