/* ---------- sticker cards ---------- */
.card {
  background: var(--c-surface);
  border: var(--bw-sticker) solid var(--c-shadow);
  border-radius: var(--r-wonky);
  box-shadow: var(--shadow-card);
  padding: var(--sp-4);
}
.card + .card { margin-top: var(--sp-4); }
.card--alt { border-radius: var(--r-wonky-2); }
.card--dots { background-color: var(--c-surface); background-image: var(--pattern-dots); }
.card--stars { background-color: var(--c-surface); background-image: var(--pattern-stars); }

/* ---------- chunky buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap-min);
  padding: 0 var(--sp-5);
  background: var(--c-surface);
  color: var(--c-ink);
  border: var(--bw-chunky) solid var(--c-shadow);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-md);
  cursor: pointer;
  user-select: none;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--c-shadow); }
.btn--primary {
  background: var(--c-accent);
  color: var(--c-accent-ink);
  border-color: var(--c-accent-deep);
  box-shadow: 0 3px 0 var(--c-accent-deep);
}
.btn--primary:active { box-shadow: 0 0 0 var(--c-accent-deep); }
.btn--ghost { background: transparent; border-color: var(--c-line); box-shadow: none; }
.btn--danger { background: var(--c-surface); color: var(--c-danger); border-color: var(--c-danger); box-shadow: 0 3px 0 var(--c-danger); }
.btn--small { min-height: 36px; padding: 0 var(--sp-3); font-size: var(--fs-sm); border-width: var(--bw-sticker); }
.btn--icon { width: var(--tap-min); padding: 0; border-radius: var(--r-pill); }
.btn--block { width: 100%; }
.btn--big { min-height: 60px; font-size: var(--fs-lg); border-radius: var(--r-xl); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ---------- chips & badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--c-surface-2);
  border: var(--bw-thin) solid var(--c-line);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-family: var(--font-display);
  color: var(--c-ink-soft);
}
.chip--count { background: var(--c-accent-soft); border-color: var(--c-accent); color: var(--c-accent-deep); }
.chip.on { background: var(--c-accent); border-color: var(--c-accent-deep); color: var(--c-accent-ink); }
button.chip { cursor: pointer; font-size: var(--fs-xs); min-height: 30px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* wish pipeline status chips */
.chip--st { color: #fff; border-width: var(--bw-thin); font-weight: 500; }
.chip--st-new { background: var(--st-new); border-color: var(--pal-sun-deep); color: var(--pal-night); }
.chip--st-planned { background: var(--st-planned); border-color: var(--pal-bolt-deep); }
.chip--st-building { background: var(--st-building); border-color: var(--pal-blast-deep); }
.chip--st-shipped { background: var(--st-shipped); border-color: var(--pal-grass-deep); }
.chip--st-declined { background: var(--st-declined); border-color: var(--pal-graphite-deep); }
.chip--st-building i { animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- avatar frames ---------- */
.avatar {
  --av: 44px;
  width: var(--av);
  height: var(--av);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface-2);
  border: var(--bw-sticker) solid var(--c-shadow);
  border-radius: var(--r-md);
  overflow: hidden;
}
.avatar svg { width: 88%; height: 88%; }
.avatar--adam { background: #E4F4E8; border-color: var(--kid-adam-deep); }
.avatar--beeri { background: #FDEBD9; border-color: var(--kid-beeri-deep); }
.avatar--tom { background: #DDF0F5; border-color: var(--kid-tom-deep); }
.avatar--boss { background: #E6EBF1; border-color: var(--kid-boss-deep); }
.avatar--robodod { background: var(--c-accent-soft); border-color: var(--c-shadow); }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; gap: var(--sp-3); }
.list-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-surface);
  border: var(--bw-sticker) solid var(--c-shadow);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  cursor: pointer;
  min-height: 64px;
  text-align: start;
  width: 100%;
  color: var(--c-ink);
}
.list-item:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--c-shadow); }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title {
  font-family: var(--font-display);
  font-weight: 500;
  display: flex; align-items: center; gap: var(--sp-2);
}
.list-item .li-sub {
  font-size: var(--fs-sm);
  color: var(--c-ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-item .li-side { font-size: var(--fs-xs); color: var(--c-ink-faint); flex: 0 0 auto; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-4); }
.label { font-family: var(--font-display); font-size: var(--fs-sm); color: var(--c-ink-soft); }
.input, .select, .textarea {
  min-height: var(--tap-min);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-surface);
  border: var(--bw-sticker) solid var(--c-line);
  border-radius: var(--r-md);
  font-size: 16px; /* prevents mobile zoom-on-focus */
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--c-accent-deep); outline: none; }

/* ---------- segmented toggle ---------- */
.seg { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.seg button {
  flex: 1;
  min-height: 42px;
  background: var(--c-surface);
  border: var(--bw-sticker) solid var(--c-line);
  border-radius: var(--r-md);
  font-family: var(--font-display);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.seg button.on {
  background: var(--c-accent);
  color: var(--c-accent-ink);
  border-color: var(--c-accent-deep);
  box-shadow: 0 2px 0 var(--c-accent-deep);
}

/* ---------- empty state ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-8) var(--sp-4);
  text-align: center;
  color: var(--c-ink-soft);
}
.empty svg { animation: pop-in var(--t-pop) var(--ease-bounce); }
.empty p { max-width: 280px; margin: 0; }

/* ---------- thinking dots ---------- */
.dots { display: inline-flex; gap: 5px; align-items: center; height: 16px; }
.dots i {
  width: 7px; height: 7px;
  background: var(--c-accent-deep);
  border-radius: 50%;
  animation: bounce-dot 1.1s infinite var(--ease-bounce);
}
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }

/* ---------- toasts ---------- */
#toasts {
  position: fixed;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--sp-3));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  z-index: 60;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-ink);
  color: var(--c-bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-float);
  font-size: var(--fs-sm);
  animation: rise-in var(--t-pop) var(--ease-bounce);
}
.toast--error { background: var(--c-danger); color: #fff; }
.toast--ok { background: var(--c-ok); color: #fff; }

/* ---------- bottom sheet ---------- */
.scrim {
  position: fixed; inset: 0;
  background: var(--c-overlay);
  z-index: 40;
}
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  max-width: var(--content-max);
  margin: 0 auto;
  background: var(--c-surface);
  border: var(--bw-sticker) solid var(--c-shadow);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--sp-4) var(--sp-4) calc(var(--sp-5) + var(--safe-bottom));
  box-shadow: var(--shadow-float);
  animation: rise-in var(--t-pop) var(--ease-bounce);
}
.sheet h3 { margin-bottom: var(--sp-3); display: flex; align-items: center; gap: var(--sp-2); }
.sheet .sheet-actions { display: flex; flex-direction: column; gap: var(--sp-2); }

/* ---------- offline banner ---------- */
.offline-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: var(--c-warn);
  color: #fff;
  font-size: var(--fs-sm);
  padding: 6px var(--sp-3);
}
