/* Xpense static stylesheet — hand-maintained, no build step
   HTMX: 1.9.12 | Alpine.js: 3.14.1
   Add new utilities to utilities-used.txt when adding here. */

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Space Grotesk', sans-serif; }
select, input, button, textarea { font-family: 'Space Grotesk', sans-serif; }
select { -webkit-appearance: none; appearance: none; }
::-webkit-scrollbar { width: 0; height: 0; }

/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --bg: #F3F4EF;
  --surface: #FFFFFF;
  --border: #1D1D1D;
  --accent: #F9BD2B;
  --text: #1D1D1D;
  --muted: #6B7280;
  --input-bg: #FAFAF6;
  --sh: 3px 3px 0 #1D1D1D;
  --surface2: #F7F6F0;
}
.dk {
  --bg: #151515;
  --surface: #242424;
  --border: #3C3C3C;
  --text: #EEEEE7;
  --muted: #888888;
  --input-bg: #2C2C2C;
  --sh: 3px 3px 0 rgba(0,0,0,0.8);
  --surface2: #1E1E1E;
}

/* ── Keyframes ──────────────────────────────────────────────────────────── */
@keyframes slideLeft {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
@keyframes fadeOver {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes popIn {
  from { transform: translateY(8px) scale(0.985); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ── Display ────────────────────────────────────────────────────────────── */
.block         { display: block; }
.inline-block  { display: inline-block; }
.inline-flex   { display: inline-flex; }
.flex          { display: flex; }
.grid          { display: grid; }
.hidden        { display: none; }

/* ── Flex ───────────────────────────────────────────────────────────────── */
.flex-col       { flex-direction: column; }
.flex-row       { flex-direction: row; }
.flex-wrap      { flex-wrap: wrap; }
.flex-1         { flex: 1 1 0%; }
.flex-shrink-0  { flex-shrink: 0; }
.flex-grow      { flex-grow: 1; }
.items-start    { align-items: flex-start; }
.items-center   { align-items: center; }
.items-end      { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.justify-start  { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end    { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.self-start     { align-self: flex-start; }
.self-end       { align-self: flex-end; }

/* ── Grid ───────────────────────────────────────────────────────────────── */
.grid-cols-3  { grid-template-columns: repeat(3, 1fr); }
.col-span-3   { grid-column: span 3; }

/* ── Gap ────────────────────────────────────────────────────────────────── */
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-5  { gap: 1.25rem; }
.gap-6  { gap: 1.5rem; }
.gap-7  { gap: 1.75rem; }
.gap-8  { gap: 2rem; }
.gap-9  { gap: 2.25rem; }
.gap-10 { gap: 2.5rem; }

/* ── Position ───────────────────────────────────────────────────────────── */
.static   { position: static; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }
.inset-0  { top: 0; right: 0; bottom: 0; left: 0; }
.inset-x-0 { left: 0; right: 0; }
.top-0    { top: 0; }
.top-2    { top: 0.5rem; }
.top-4    { top: 1rem; }
.left-0   { left: 0; }
.left-4   { left: 1rem; }
.right-0  { right: 0; }
.right-4  { right: 1rem; }
.bottom-0 { bottom: 0; }
.bottom-4 { bottom: 1rem; }
.bottom-5 { bottom: 1.25rem; }

/* ── Z-index ────────────────────────────────────────────────────────────── */
.z-0   { z-index: 0; }
.z-10  { z-index: 10; }
.z-20  { z-index: 20; }
.z-50  { z-index: 50; }
.z-100 { z-index: 100; }
.z-200 { z-index: 200; }

/* ── Overflow ───────────────────────────────────────────────────────────── */
.overflow-hidden  { overflow: hidden; }
.overflow-visible { overflow: visible; }
.overflow-y-auto  { overflow-y: auto; }
.overflow-x-auto  { overflow-x: auto; }
.overflow-x-hidden { overflow-x: hidden; }
.truncate         { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.min-w-0          { min-width: 0; }

/* ── Width ──────────────────────────────────────────────────────────────── */
.w-full    { width: 100%; }
.w-auto    { width: auto; }
.w-4       { width: 1rem; }
.w-5       { width: 1.25rem; }
.w-6       { width: 1.5rem; }
.w-8       { width: 2rem; }
.w-9       { width: 2.25rem; }
.w-10      { width: 2.5rem; }
.w-11      { width: 2.75rem; }
.w-12      { width: 3rem; }
.w-13      { width: 3.25rem; }
.w-14      { width: 3.5rem; }
.w-16      { width: 4rem; }
.w-36      { width: 9rem; }
.w-52      { width: 13rem; }
.w-64      { width: 16rem; }
.max-w-sm  { max-width: 24rem; }

/* ── Height ─────────────────────────────────────────────────────────────── */
.h-full    { height: 100%; }
.h-auto    { height: auto; }
.h-2       { height: 0.5rem; }
.h-4       { height: 1rem; }
.h-5       { height: 1.25rem; }
.h-6       { height: 1.5rem; }
.h-7       { height: 1.75rem; }
.h-8       { height: 2rem; }
.h-9       { height: 2.25rem; }
.h-10      { height: 2.5rem; }
.h-11      { height: 2.75rem; }
.h-12      { height: 3rem; }
.h-13      { height: 3.25rem; }
.h-14      { height: 3.5rem; }
.h-16      { height: 4rem; }
.h-screen  { height: 100vh; }
.min-h-screen { min-height: 100vh; }
.min-h-12  { min-height: 3rem; }
.min-h-14  { min-height: 3.5rem; }

/* ── Padding ────────────────────────────────────────────────────────────── */
.p-0    { padding: 0; }
.p-1    { padding: 0.25rem; }
.p-2    { padding: 0.5rem; }
.p-3    { padding: 0.75rem; }
.p-4    { padding: 1rem; }
.p-5    { padding: 1.25rem; }
.p-6    { padding: 1.5rem; }
.p-7    { padding: 1.75rem; }
.p-8    { padding: 2rem; }
.px-1   { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2   { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3   { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4   { padding-left: 1rem; padding-right: 1rem; }
.px-5   { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6   { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1   { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2   { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3   { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4   { padding-top: 1rem; padding-bottom: 1rem; }
.py-5   { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6   { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-7   { padding-top: 1.75rem; padding-bottom: 1.75rem; }
.pt-2   { padding-top: 0.5rem; }
.pt-3   { padding-top: 0.75rem; }
.pt-4   { padding-top: 1rem; }
.pt-9   { padding-top: 2.25rem; }
.pb-4   { padding-bottom: 1rem; }
.pb-5   { padding-bottom: 1.25rem; }
.pb-6   { padding-bottom: 1.5rem; }
.pb-8   { padding-bottom: 2rem; }
.pb-20  { padding-bottom: 5rem; }
.pb-24  { padding-bottom: 6rem; }
.pl-3   { padding-left: 0.75rem; }
.pr-3   { padding-right: 0.75rem; }
.pr-8   { padding-right: 2rem; }

/* ── Margin ─────────────────────────────────────────────────────────────── */
.m-0    { margin: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-1   { margin-bottom: 0.25rem; }
.mb-2   { margin-bottom: 0.5rem; }
.mb-3   { margin-bottom: 0.75rem; }
.mb-4   { margin-bottom: 1rem; }
.mb-5   { margin-bottom: 1.25rem; }
.mb-6   { margin-bottom: 1.5rem; }
.mb-7   { margin-bottom: 1.75rem; }
.mb-8   { margin-bottom: 2rem; }
.mb-10  { margin-bottom: 2.5rem; }
.mt-1   { margin-top: 0.25rem; }
.mt-2   { margin-top: 0.5rem; }
.mt-3   { margin-top: 0.75rem; }
.mt-4   { margin-top: 1rem; }
.mt-5   { margin-top: 1.25rem; }
.mr-1   { margin-right: 0.25rem; }
.mr-2   { margin-right: 0.5rem; }
.ml-auto { margin-left: auto; }

/* ── Typography ─────────────────────────────────────────────────────────── */
.text-xs    { font-size: 0.75rem;  line-height: 1rem; }
.text-sm    { font-size: 0.875rem; line-height: 1.25rem; }
.text-base  { font-size: 1rem;    line-height: 1.5rem; }
.text-lg    { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl    { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl   { font-size: 1.5rem;  line-height: 2rem; }
.text-3xl   { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl   { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl   { font-size: 3rem;    line-height: 1; }

.font-normal    { font-weight: 400; }
.font-medium    { font-weight: 500; }
.font-semibold  { font-weight: 600; }
.font-bold      { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.leading-none   { line-height: 1; }
.leading-tight  { line-height: 1.25; }
.leading-snug   { line-height: 1.375; }
.leading-normal { line-height: 1.5; }

.tracking-tight    { letter-spacing: -0.05em; }
.tracking-normal   { letter-spacing: 0; }
.tracking-wide     { letter-spacing: 0.025em; }
.tracking-wider    { letter-spacing: 0.05em; }
.tracking-widest   { letter-spacing: 0.1em; }

.uppercase     { text-transform: uppercase; }
.lowercase     { text-transform: lowercase; }
.capitalize    { text-transform: capitalize; }
.normal-case   { text-transform: none; }

.text-left    { text-align: left; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }

.whitespace-nowrap  { white-space: nowrap; }
.whitespace-normal  { white-space: normal; }
.break-words        { word-break: break-word; }
.text-wrap-pretty   { text-wrap: pretty; }

.underline     { text-decoration: underline; }
.no-underline  { text-decoration: none; }

/* ── Text colors (design-token-based) ──────────────────────────────────── */
.text-token      { color: var(--text); }
.text-muted      { color: var(--muted); }
.text-accent     { color: var(--accent); }
.text-border     { color: var(--border); }
.text-black      { color: #1D1D1D; }
.text-white      { color: #EEEEE7; }
.text-red        { color: #E54B4B; }
.text-gray-400   { color: #9CA3AF; }
.text-gray-500   { color: #6B7280; }
.text-opacity-45 { color: rgba(0,0,0,0.45); }
.text-opacity-42 { color: rgba(0,0,0,0.42); }
.text-opacity-60 { color: rgba(0,0,0,0.6); }

/* ── Background colors ──────────────────────────────────────────────────── */
.bg-bg        { background-color: var(--bg); }
.bg-surface   { background-color: var(--surface); }
.bg-surface2  { background-color: var(--surface2); }
.bg-accent    { background-color: var(--accent); }
.bg-input     { background-color: var(--input-bg); }
.bg-black     { background-color: #0E0E0E; }
.bg-dark      { background-color: #1A1A1A; }
.bg-frame     { background-color: #D5D6CF; }
.bg-overlay   { background-color: rgba(0,0,0,0.55); }
.bg-transparent { background-color: transparent; }

/* ── Border ─────────────────────────────────────────────────────────────── */
.border       { border: 1px solid var(--border); }
.border-2     { border: 2px solid var(--border); }
.border-t-2   { border-top: 2px solid var(--border); }
.border-b-2   { border-bottom: 2px solid var(--border); }
.border-none  { border: none; }
.border-red   { border-color: #E54B4B; }
.border-1-5   { border-width: 1.5px; }

/* ── Border radius ──────────────────────────────────────────────────────── */
.rounded-none   { border-radius: 0; }
.rounded        { border-radius: 0.25rem; }
.rounded-md     { border-radius: 0.375rem; }
.rounded-lg     { border-radius: 0.5rem; }
.rounded-xl     { border-radius: 0.75rem; }
.rounded-2xl    { border-radius: 1rem; }
.rounded-3xl    { border-radius: 1.5rem; }
.rounded-full   { border-radius: 9999px; }
.rounded-t-lg   { border-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem; }

/* ── Box shadow (design-token-based) ────────────────────────────────────── */
.shadow-token  { box-shadow: var(--sh); }
.shadow-sm     { box-shadow: 2px 2px 0 var(--border); }
.shadow-fab    { box-shadow: 4px 4px 0 var(--border); }
.shadow-none   { box-shadow: none; }
.shadow-phone  { box-shadow: 0 36px 90px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.07); }

/* ── Transition ─────────────────────────────────────────────────────────── */
.transition        { transition: all 0.15s ease; }
.transition-bg     { transition: background-color 0.25s; }
.transition-colors { transition: color 0.25s, background-color 0.25s, border-color 0.25s; }
.transition-all    { transition: all 0.25s; }
.duration-100      { transition-duration: 100ms; }
.duration-120      { transition-duration: 120ms; }
.duration-250      { transition-duration: 250ms; }
.duration-700      { transition-duration: 700ms; }
.ease-out          { transition-timing-function: ease-out; }

/* ── Animation ──────────────────────────────────────────────────────────── */
.animate-pop-in     { animation: popIn 0.25s ease; }
.animate-pop-in-lg  { animation: popIn 0.3s ease; }
.animate-slide-left { animation: slideLeft 0.22s cubic-bezier(0.25,0,0.1,1); }
.animate-fade-over  { animation: fadeOver 0.18s ease; }

/* ── Pointer / cursor ───────────────────────────────────────────────────── */
.cursor-pointer     { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.pointer-events-none { pointer-events: none; }

/* ── Opacity ────────────────────────────────────────────────────────────── */
.opacity-0   { opacity: 0; }
.opacity-50  { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* ── Active press states ────────────────────────────────────────────────── */
.active\:shadow-none:active { box-shadow: none; }
.active\:translate-y-px:active { transform: translateY(1px); }
.active\:translate-y-3px:active { transform: translateY(3px); }
.active\:translate-xy-2px:active { transform: translate(2px, 2px); }
.active\:translate-xy-4px:active { transform: translate(4px, 4px); }

/* ── Disabled state ─────────────────────────────────────────────────────── */
.disabled\:opacity-50:disabled { opacity: 0.5; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }

/* ── Outline ────────────────────────────────────────────────────────────── */
.outline-none  { outline: none; }

/* ── Object fit ─────────────────────────────────────────────────────────── */
.object-cover  { object-fit: cover; }

/* ── App layout ─────────────────────────────────────────────────────────── */

/* Body: fills the viewport, inherits bg so dark mode works everywhere */
body {
  min-height: 100vh;
  background: var(--bg);
  transition: background 0.25s;
}

/* Centred column, max 480 px — looks native on phone, clean on desktop */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
  transition: background 0.25s;
}

/* On desktop, add a subtle frame around the column */
@media (min-width: 481px) {
  body { background: #E8E9E3; }
  html.dk body { background: #0A0A0A; }
  .app-container {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: 0 0 40px rgba(0,0,0,0.08);
  }
}

/* Each screen: normal flow, flex column, fills at least the viewport */
.screen-root {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 57px); /* 57 px ≈ sticky header height */
  background: var(--bg);
  transition: background 0.25s;
  animation: popIn 0.25s ease;
}

/* Add-entry screen: must not scroll so numpad always stays visible.
   svh = small viewport height (browser chrome fully visible, incl. tab bar).
   This is the correct unit for fixed-height layouts — dvh includes the tab bar
   coverage area which breaks layout on smaller phones. */
.screen-root-fixed {
  display: flex;
  flex-direction: column;
  height: calc(100svh - 57px - env(safe-area-inset-top, 0px));
  overflow: hidden;
  background: var(--bg);
  transition: background 0.25s;
  animation: popIn 0.25s ease;
}

/* ── App header ─────────────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(9px + env(safe-area-inset-top, 0)) 16px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  transition: background 0.25s, border-color 0.25s;
}

/* ── FAB ────────────────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  /* Aligned to the right edge of the 480px container on all screen widths */
  bottom: calc(24px + env(safe-area-inset-bottom, 0));
  right: max(16px, calc((100vw - 480px) / 2 + 16px));
  width: 52px;
  height: 52px;
  background: var(--accent);
  border: 2px solid var(--border);
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  color: var(--border);
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  text-decoration: none;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.fab:active { transform: translate(4px, 4px); box-shadow: none; }

/* ── Drawer ─────────────────────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  animation: fadeOver 0.18s;
  z-index: 100;
}
.drawer-panel {
  position: fixed;
  top: 0;
  /* Flush with the left edge of the 480px container; 0 on mobile */
  left: max(0px, calc((100vw - 480px) / 2));
  bottom: 0;
  width: 268px;
  background: #1A1A1A;
  /* slideLeft only uses transform — no conflict with left-based positioning */
  animation: slideLeft 0.22s cubic-bezier(0.25,0,0.1,1);
  display: flex;
  flex-direction: column;
  padding: calc(36px + env(safe-area-inset-top, 0)) 18px calc(28px + env(safe-area-inset-bottom, 0));
  z-index: 101;
}
.drawer-nav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 9px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.1s;
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--sh);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card-sm {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: 2px 2px 0 var(--border);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

/* ── Input / select ─────────────────────────────────────────────────────── */
.field-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 11px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  box-shadow: var(--sh);
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.field-input.error {
  border-color: #E54B4B;
}
.field-input-sm {
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 9px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

/* ── Scroll wheel picker ─────────────────────────────────────────────────── */
.wheel-scroll { overflow-y: scroll; scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch; overscroll-behavior: none; scrollbar-width: none; }
.wheel-scroll::-webkit-scrollbar { display: none; }
.wheel-item { height: 44px; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; user-select: none; transition: font-size 0.1s, color 0.1s, font-weight 0.1s; }

/* ── Entry form fields (category wrapper + date input share this) ───────── */
.entry-field {
  display: block;
  width: 100%;
  padding: 11px 13px;
  border: 2px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 2px 2px 0 var(--border);
  outline: none;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, color 0.25s;
}
/* Transparent inner select — visual styling lives on the .entry-field wrapper */
.entry-select {
  display: block;
  width: 100%;
  padding: 11px 13px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
/* Smaller variant for the edit sheet */
.entry-field-sm {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 2px 2px 0 var(--border);
  outline: none;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, color 0.25s;
}
.entry-select-sm {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/* ── Button base ────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  border: 2px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--sh);
  font-size: 15px;
  font-weight: 800;
  color: #1D1D1D;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.btn-primary:active { transform: translateY(3px); box-shadow: none; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary:disabled:active { transform: none; box-shadow: var(--sh); }

.btn-sm {
  padding: 10px 16px;
  background: var(--accent);
  border: 2px solid var(--border);
  border-radius: 9px;
  box-shadow: 2px 2px 0 var(--border);
  font-size: 13px;
  font-weight: 700;
  color: #1D1D1D;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.btn-sm:active { transform: translate(2px, 2px); box-shadow: none; }

.btn-danger {
  padding: 12px;
  border-radius: 9px;
  border: 2px solid #E54B4B;
  background: transparent;
  color: #E54B4B;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.1s;
}
.btn-danger:active { opacity: 0.65; }

.btn-ghost {
  background: transparent;
  border: 2px solid var(--border);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, opacity 0.1s;
}
.btn-ghost:active { opacity: 0.6; }

.drawer-nav-btn:active { opacity: 0.7; }
.filter-pill:active:not(.active) { opacity: 0.7; }
.card-sm[hx-get]:active { opacity: 0.85; }

.hamburger-btn {
  width: 36px;
  height: 36px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 var(--border);
  padding: 0;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.hamburger-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.hamburger-line {
  width: 15px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: background 0.25s;
}

/* ── Filter pills ───────────────────────────────────────────────────────── */
.filter-pill {
  flex: 1;
  padding: 8px 0;
  border-radius: 9999px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
  text-align: center;
}
.filter-pill.active {
  background: var(--accent);
  color: #1D1D1D;
  border-color: #1D1D1D;
}

/* ── Date pill in header ────────────────────────────────────────────────── */
.date-pill {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 9999px;
  padding: 4px 13px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

/* ── Category icon tile ─────────────────────────────────────────────────── */
.icon-tile {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: border-color 0.25s;
}
.icon-tile-sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: border-color 0.25s;
}

/* ── Numpad ─────────────────────────────────────────────────────────────── */
.numpad-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
  margin-bottom: 9px;
}
.numpad-key {
  min-height: 0;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 11px;
  box-shadow: 2px 2px 0 var(--border);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.numpad-key:active { transform: translate(2px, 2px); box-shadow: none; }
.numpad-key-accent {
  background: var(--accent);
  color: #1D1D1D;
}

/* ── Progress bar ───────────────────────────────────────────────────────── */
.progress-track {
  height: 8px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  overflow: hidden;
  transition: background 0.25s, border-color 0.25s;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 9999px;
  transition: width 0.7s cubic-bezier(0.16,1,0.3,1);
}

/* ── Bottom sheet ───────────────────────────────────────────────────────── */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  background: var(--surface);
  border-top: 2px solid var(--border);
  padding: 12px 16px calc(26px + env(safe-area-inset-bottom, 0));
  animation: popIn 0.18s ease;
  z-index: 30;
  transition: background 0.25s, border-color 0.25s;
}

/* ── Error text ─────────────────────────────────────────────────────────── */
.error-text {
  font-size: 11px;
  color: #E54B4B;
  margin-top: 4px;
}
.error-banner {
  background: #FEE2E2;
  border: 2px solid #E54B4B;
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #991B1B;
  margin-bottom: 12px;
}

/* ── Section label ──────────────────────────────────────────────────────── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
  margin-bottom: 10px;
  transition: color 0.25s;
}

/* ── Scrollable area with FAB clearance ─────────────────────────────────── */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px calc(84px + env(safe-area-inset-bottom, 0));
  animation: popIn 0.25s ease;
}
