/* Unit engine u24 (bucket list, 30-day challenge, bingo): tabs, toast, icon buttons, celebration dots, print sheet. */

/* Segmented tabs */
.tool .u24-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px rgb(var(--ink) / .06); }
.tool .u24-tabs button {
  flex: 1 1 0; min-height: 44px; padding: 0 8px; border-radius: 16px; font-size: 15px; font-weight: 800; color: rgb(var(--ink) / .72);
  background: transparent; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease, color .2s ease, transform .16s var(--ease-out);
}
.tool .u24-tabs button:focus-visible { outline: 3px solid rgb(var(--accent) / .6); outline-offset: 1px; }
.tool .u24-tabs button[aria-selected="true"] { background: rgb(var(--ink)); color: var(--surface); }
.tool .u24-tabs button:active { transform: scale(.96); }
.tool .u24-tabs button span { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Small icon + label buttons for secondary actions */
.tool .u24-ib {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 22px;
  background: var(--surface); color: rgb(var(--ink) / .8); font-size: 14px; font-weight: 800;
  box-shadow: inset 0 0 0 1px rgb(var(--ink) / .08); touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform .16s var(--ease-out), background-color .2s ease;
}
.tool .u24-ib .tool-icon { width: 18px; height: 18px; flex: none; }
.tool .u24-ib:active { transform: scale(.96); }
@media (hover: hover) { .tool .u24-ib:hover { background: var(--surface-2); } }
.tool .u24-bar { display: flex; flex-wrap: wrap; gap: 8px; }

/* Live status line: fixed at the bottom edge, out of the flow, so it never moves or covers tool controls. */
.tool .u24-toast {
  position: fixed; z-index: 50; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); translate: -50% 0; width: max-content; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 22px;
  background: rgb(var(--ink)); color: var(--surface); font-size: 14px; line-height: 20px; font-weight: 750; box-shadow: 0 8px 24px rgb(0 0 0 / .25);
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s ease, transform .3s var(--ease-out);
}
.tool .u24-toast.is-on { opacity: 1; transform: none; pointer-events: auto; }
.tool .u24-toast button { min-height: 28px; font-size: 14px; font-weight: 900; color: inherit; text-decoration: underline; text-underline-offset: 3px; background: none; }
.tool .u24-toast span { color: inherit; }

/* Celebration dots */
.u24-burst { position: fixed; z-index: 60; width: 0; height: 0; pointer-events: none; }
.u24-burst i {
  position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--accent));
  animation: u24-burst .7s var(--ease-out) both;
}
.u24-burst i:nth-child(3n) { background: #FF6FB5; width: 6px; height: 6px; }
.u24-burst i:nth-child(4n) { background: #FFC94D; }
@keyframes u24-burst { from { transform: translate(0, 0) scale(.6); opacity: 1; } to { transform: translate(var(--x), var(--y)) scale(1); opacity: 0; } }

/* Print: only the sheet prints. */
.u24-sheet { display: none; }
@media print {
  body.u24-printing > :not(.u24-sheet) { display: none !important; }
  body.u24-printing { background: #fff !important; }
  body.u24-printing .u24-sheet { display: block; color: #000; font-family: 'Google Sans Flex Rounded', ui-rounded, system-ui, sans-serif; }
  .u24-sheet h1 { font-size: 28pt; line-height: 1.1; margin: 0 0 4pt; font-weight: 900; letter-spacing: -.01em; }
  .u24-sheet .u24-sheet-sub { font-size: 11pt; margin: 0 0 14pt; color: #555; font-weight: 600; }
  .u24-sheet .u24-sheet-foot { margin-top: 14pt; font-size: 9pt; color: #777; text-align: center; }
  @page { margin: 12mm; }
}

/* Dark mode: --surface is close to the tinted tool panel, so unit cards get a raised surface and a hairline. */
@media (prefers-color-scheme: dark) {
  .tool .u24-tabs { background: var(--surface-2); box-shadow: inset 0 0 0 1px rgb(var(--ink) / .14); }
  .tool .u24-tabs button[aria-selected="true"] { background: #7A2FD0; color: #fff; }
  .tool .tool-chips button { background: var(--surface-2); color: rgb(var(--ink) / .88); box-shadow: inset 0 0 0 1px rgb(var(--ink) / .3); }
  .tool .tool-chips button[aria-pressed="true"] { background: #7A2FD0; color: #fff; box-shadow: none; }
  .tool .u24-ib { background: var(--surface-2); box-shadow: inset 0 0 0 1px rgb(var(--ink) / .16); }
  .tool .u24-toast { box-shadow: 0 8px 24px rgb(0 0 0 / .5); }
}
