/* OurBoard styles - mobile first, EN/HE, light/dark */

:root {
  --bg: #f2f5f7;
  --card: #ffffff;
  --ink: #17222b;
  --muted: #5f7280;
  --line: #e3e9ee;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --danger: #e0564f;
  --radius: 16px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
html.dark {
  --bg: #0c1116;
  --card: #161d26;
  --ink: #e8eef4;
  --muted: #8ba1b3;
  --line: #232d38;
  --accent: #14b8a6;
  --accent-ink: #06201d;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100dvh;
  transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; }

@keyframes pop {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; letter-spacing: -0.2px; }
.brandIc { width: 20px; height: 20px; color: var(--accent); }
.pill svg { width: 16px; height: 16px; display: block; }
.tab svg { width: 17px; height: 17px; flex: 0 0 auto; }
.emojiIc { font-size: 15px; }
.actions { display: flex; gap: 8px; }
.pill {
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-weight: 600; font-size: 14px;
  transition: transform 160ms var(--ease-out);
}
.pill:active { transform: scale(0.95); }

/* Board tabs */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform 160ms var(--ease-out), background 200ms var(--ease-out);
}
.tab:active { transform: scale(0.96); }
.tab.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.tabCount {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11.5px; font-weight: 800; line-height: 1;
}
.tab.on .tabCount { background: var(--accent-ink); color: var(--accent); }
.tab.add { width: 40px; padding: 0; justify-content: center; font-size: 20px; font-weight: 700; }

/* New board inline form */
.boardForm { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 12px; animation: pop 200ms var(--ease-out) both; }
.boardForm[hidden] { display: none; }
.bfRow { display: flex; gap: 8px; align-items: center; }
.iconPick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.iconPick::-webkit-scrollbar { display: none; }
.iconPick button {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center; color: var(--muted);
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), background 160ms var(--ease-out);
}
.iconPick button.on { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.iconPick button:active { transform: scale(0.92); }
.iconPick svg { width: 22px; height: 22px; }
.boardForm .bName {
  flex: 1; min-width: 0; height: 48px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); padding: 0 14px; font-size: 16px; outline: none;
}
.boardForm .bName:focus { border-color: var(--accent); }
.boardForm .bSave, .boardForm .bCancel { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-weight: 700; font-size: 18px; transition: transform 160ms var(--ease-out); }
.boardForm .bSave { background: var(--accent); color: var(--accent-ink); }
.boardForm .bCancel { background: var(--card); border: 1px solid var(--line); }
.boardForm .bSave:active, .boardForm .bCancel:active { transform: scale(0.93); }

/* Item list */
.list { padding: 2px 16px 175px; display: flex; flex-direction: column; gap: 8px; }
.item, .gotItem {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
  animation: pop 240ms var(--ease-out) both;
}
.item.flash { animation: flash 900ms var(--ease-out); }
@keyframes flash {
  0%, 60% { background: color-mix(in srgb, var(--accent) 20%, var(--card)); }
  100% { background: var(--card); }
}
.item.removing { opacity: 0; transform: scale(0.97); transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
.item.seen, .gotItem.seen { animation: none; }

.check {
  width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid var(--muted); position: relative;
  transition: background 200ms var(--ease-out), border-color 200ms var(--ease-out), transform 160ms var(--ease-out);
}
.check:active { transform: scale(0.88); }
.check.done { background: var(--accent); border-color: var(--accent); }
.check.done::after {
  content: '✓'; color: var(--accent-ink); position: absolute; inset: 0;
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
}
.itemMain { flex: 1; min-width: 0; }
.itemName { font-weight: 600; overflow-wrap: anywhere; }
.qty { color: var(--muted); font-weight: 500; font-size: 14px; }
.cap { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.del {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px;
  color: var(--muted); opacity: 0.5; font-size: 14px;
  transition: opacity 160ms var(--ease-out), background 160ms var(--ease-out);
}
.del:active { opacity: 1; background: var(--line); }

.gotTitle {
  margin-top: 14px; padding-inline: 2px;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--muted);
}
.gotItem { padding-block: 10px; opacity: 0.78; }
.gotItem .itemName { text-decoration: line-through; text-decoration-color: var(--muted); font-weight: 500; }
.gotItem .check { background: var(--accent); border-color: var(--accent); }

.empty { text-align: center; padding: 48px 0 24px; color: var(--muted); animation: pop 240ms var(--ease-out) both; }
.emptySvg { width: 46px; height: 46px; color: var(--accent); opacity: 0.9; margin-bottom: 6px; }
.emptyTitle { font-weight: 700; color: var(--ink); }
.emptySub { font-size: 14px; margin-top: 2px; }

/* Bottom add bar */
.barWrap {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 6;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips[hidden] { display: none; }
.chip {
  flex: 0 0 auto; min-height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600;
  transition: transform 160ms var(--ease-out);
}
.chip:active { transform: scale(0.95); }
.chipN { color: var(--muted); font-weight: 500; font-size: 12px; }
.bar { display: flex; gap: 8px; }
.bar input {
  flex: 1; min-width: 0; height: 48px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card);
  padding: 0 16px; font-size: 16px; outline: none;
  transition: border-color 200ms var(--ease-out);
}
.bar input:focus { border-color: var(--accent); }
.addBtn {
  width: 48px; height: 48px; flex: 0 0 auto; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 26px; font-weight: 700; display: grid; place-items: center;
  transition: transform 160ms var(--ease-out);
}
.addBtn:active { transform: scale(0.93); }
.qtyBtn {
  flex: 0 0 auto; min-width: 44px; height: 48px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card);
  font-weight: 700; font-size: 14px; color: var(--muted);
  transition: transform 160ms var(--ease-out), background 200ms var(--ease-out), color 200ms var(--ease-out);
}
.qtyBtn.active { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.qtyBtn:active { transform: scale(0.95); }
.qtyBadge {
  flex: 0 0 auto; min-width: 36px; height: 26px; padding: 0 8px;
  border-radius: 999px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  font-weight: 700; font-size: 13px;
  transition: transform 160ms var(--ease-out);
}
.qtyBadge:active { transform: scale(0.9); }

/* Suggestions dropdown */
.suggest {
  position: fixed; inset-inline: 12px; bottom: 150px; z-index: 7;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  max-height: 42vh; overflow-y: auto; padding: 6px;
  animation: pop 200ms var(--ease-out) both;
}
.suggest[hidden] { display: none; }
.sug {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; padding: 12px; border-radius: 12px;
  text-align: start; font-weight: 600;
}
.sug:active { background: var(--line); }
.sugN { color: var(--muted); font-size: 13px; font-weight: 500; flex: 0 0 auto; }
.sugNone { padding: 14px; color: var(--muted); font-size: 14px; text-align: center; }

/* Auth screens */
.authWrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; padding-top: calc(24px + env(safe-area-inset-top)); }
.authCard {
  width: 100%; max-width: 380px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 24px;
  animation: pop 240ms var(--ease-out) both;
}
.authLogo { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 8px; display: block; }
.authTitle { font-size: 20px; font-weight: 800; margin: 0 0 4px; }
.authSub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.acctBlock { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.acctLabel { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.field { margin-bottom: 10px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field input {
  width: 100%; height: 46px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg);
  padding: 0 14px; font-size: 16px; outline: none;
  transition: border-color 200ms var(--ease-out);
}
.field input:focus { border-color: var(--accent); }
.primary {
  width: 100%; height: 48px; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 16px; margin-top: 6px;
  transition: transform 160ms var(--ease-out);
}
.primary:active { transform: scale(0.98); }
.err { color: var(--danger); font-size: 14px; margin-top: 10px; min-height: 18px; }
