/* === Confirm Dialog === */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: tipFade 0.18s ease-out;
}
.confirm-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 26px 22px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--dialog-shadow);
  animation: tipRise 0.22s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.confirm-heading {
  margin-bottom: 8px;
  font-family: "Newsreader", serif;
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.25;
}
.confirm-msg {
  margin-bottom: 22px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-dim);
  text-wrap: pretty;
}
.confirm-quote {
  color: var(--ink);
  font-family: "Newsreader", serif;
  font-style: italic;
  font-size: 1rem;
}
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }
.confirm-keep {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  transition: background-color 0.2s ease;
}
.confirm-keep:hover { background: var(--bg-surface); }
.confirm-delete {
  border: 1px solid var(--error);
  background: var(--error);
  color: var(--on-error);
}
.confirm-delete:hover { opacity: 0.88; }
@media (prefers-reduced-motion: reduce) {
  .confirm-overlay, .confirm-box { animation: none; }
}

/* === Tip Jar === */
.tip-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 10px; border: 1px solid var(--tip-line); border-radius: 100px;
  background: var(--tip-field); color: var(--tip-muted);
  font-family: inherit; font-size: 0.78rem; font-weight: 500; line-height: 1;
  cursor: pointer; transition: color 0.18s ease, border-color 0.18s ease;
}
.tip-pill:hover { color: var(--tip-ink); border-color: var(--tip-muted); }
/* Both graphics are grids of coloured boxes, matching the canvas sun's pixel
   language — deliberately not SVG or an icon font. */
.tip-coin { display: grid; grid-template-columns: repeat(3, 3px); grid-template-rows: repeat(3, 3px); gap: 1px; }
.tip-coin i:nth-child(2n) { background: var(--tip-coin); }
.tip-coin i:nth-child(5) { background: var(--tip-coin-soft); }
.tip-sun-mark {
  display: grid; grid-template-columns: repeat(5, 10px); grid-template-rows: repeat(5, 10px);
  gap: 2px; justify-content: center; margin: 6px auto 20px;
}
.tip-sun-mark i:nth-child(2), .tip-sun-mark i:nth-child(4),
.tip-sun-mark i:nth-child(11), .tip-sun-mark i:nth-child(15),
.tip-sun-mark i:nth-child(22), .tip-sun-mark i:nth-child(24) { background: var(--tip-coin-soft); }
.tip-sun-mark i:nth-child(7), .tip-sun-mark i:nth-child(9),
.tip-sun-mark i:nth-child(17), .tip-sun-mark i:nth-child(19) { background: var(--tip-coin); }
.tip-sun-mark i:nth-child(8), .tip-sun-mark i:nth-child(12),
.tip-sun-mark i:nth-child(14), .tip-sun-mark i:nth-child(18) { background: var(--tip-coin-2); }
.tip-sun-mark i:nth-child(13) { background: var(--tip-coin-3); }

.tip-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: var(--tip-overlay); backdrop-filter: blur(4px);
  animation: tipFade 0.18s ease-out;
}
.tip-sheet {
  width: min(400px, 100%); max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 24px 24px 22px;
  border: 1px solid var(--tip-sheet-border); border-radius: 20px;
  background: var(--tip-sheet-bg); box-shadow: var(--tip-sheet-shadow);
  color: var(--tip-ink);
  animation: tipRise 0.22s cubic-bezier(0.2, 0.7, 0.3, 1);
}
/* The sheet takes focus on open so screen readers announce the dialog; it isn't
   itself an interactive control, so it shouldn't wear a focus ring. */
.tip-sheet:focus { outline: none; }
@keyframes tipFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tipRise {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.tip-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tip-chip {
  font-family: "Press Start 2P", monospace; font-size: 7px; line-height: 1;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 6px 9px; border: 1px solid var(--tip-line); border-radius: 5px;
  background: var(--tip-field); color: var(--tip-muted);
}
.tip-close {
  background: none; border: none; cursor: pointer; color: var(--tip-muted);
  font-size: 1.05rem; line-height: 1; padding: 4px 2px; margin: -2px -2px 0 0;
  transition: color 0.18s ease;
}
.tip-close:hover { color: var(--tip-ink); }
.tip-title { font-family: "Newsreader", serif; font-weight: 600; font-size: 1.4rem; line-height: 1.25; color: var(--tip-ink); margin-bottom: 8px; }
.tip-body { font-size: 0.9rem; line-height: 1.6; color: var(--tip-muted); margin-bottom: 20px; text-wrap: pretty; }
.tip-fine { font-size: 0.74rem; line-height: 1.5; color: var(--tip-faint); }
.tip-reassure { margin: 12px 0 18px; }
.tip-note { margin-top: 12px; text-align: center; font-size: 0.72rem; }
.tip-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tip-amounts button {
  padding: 15px 0; border: 1px solid var(--tip-line); border-radius: 12px;
  background: var(--tip-field); color: var(--tip-ink);
  font-family: "Press Start 2P", monospace; font-size: 11px; letter-spacing: 0.5px;
  cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.tip-amounts button.is-selected { border-color: var(--tip-ink); background: var(--tip-ink); color: var(--tip-sheet-bg); }
.tip-primary {
  width: 100%; padding: 13px; border: none; border-radius: 100px;
  background: var(--tip-ink); color: var(--tip-sheet-bg);
  font-family: inherit; font-size: 0.92rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s ease;
}
.tip-primary:disabled { opacity: 0.35; cursor: default; }
.tip-link {
  display: block; margin: 12px auto 0; padding: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--tip-muted); font-family: inherit; font-size: 0.8rem;
  transition: color 0.18s ease;
}
.tip-link:hover { color: var(--tip-ink); }
.tip-sum {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 15px; border: 1px solid var(--tip-line); border-radius: 12px;
  background: var(--tip-field); margin-bottom: 18px;
}
.tip-sum-label { font-size: 0.85rem; color: var(--tip-muted); }
.tip-sum-right { display: flex; align-items: center; gap: 10px; }
.tip-amount { font-family: "Press Start 2P", monospace; font-size: 11px; color: var(--tip-ink); }
.tip-change {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--tip-muted); font-family: inherit; font-size: 0.78rem;
  text-decoration: underline; transition: color 0.18s ease;
}
.tip-change:hover { color: var(--tip-ink); }
.tip-thanks { text-align: center; padding: 6px 0 2px; }
.tip-thanks .tip-body { margin-bottom: 4px; }
.tip-thanks .tip-fine { margin-bottom: 20px; }
.tip-back {
  width: 100%; padding: 12px; border: 1px solid var(--tip-line); border-radius: 100px;
  background: var(--tip-field); color: var(--tip-ink);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: border-color 0.18s ease;
}
.tip-back:hover { border-color: var(--tip-muted); }
@media (prefers-reduced-motion: reduce) {
  .tip-overlay, .tip-sheet { animation: none; }
}
