/*
 * KUR Wallet — static design system
 *
 * Source of truth for UI styles. Loaded from /css/app.css.
 * There is no Vite, npm, or Tailwind JIT step.
 *
 * Sections:
 *  1. CSS variables
 *  2. Base
 *  3. Typography
 *  4. Layout
 *  5. Buttons
 *  6. Forms
 *  7. Cards
 *  8. Navigation
 *  9. Overlays (modals, sheets, dropdowns)
 * 10. Toasts & alerts
 * 11. Feedback (empty, loading, skeleton)
 * 12. Utilities
 * 13. Responsive
 */

/* -------------------------------------------------------------------------- */
/* 1. CSS variables                                                            */
/* -------------------------------------------------------------------------- */

:root {
    --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

    --color-primary: #583722;
    --color-primary-hover: #452b1b;
    --color-primary-soft: rgba(88, 55, 34, 0.12);
    --color-primary-text: #fff8f2;

    --color-secondary: #bdd7de;
    --color-secondary-hover: #a9c8d1;
    --color-secondary-text: #583722;

    --color-background: #f4eee6;
    --color-canvas: var(--color-background);
    --color-surface: #fffaf4;
    --color-surface-muted: #ebe3d8;

    --color-text: #1f1712;
    --color-muted: #6f6258;
    --color-text-muted: var(--color-muted);

    --color-border: rgba(88, 55, 34, 0.12);

    --color-success: #2f6b4f;
    --color-success-soft: rgba(47, 107, 79, 0.14);
    --color-warning: #b45309;
    --color-warning-soft: rgba(180, 83, 9, 0.14);
    --color-danger: #b42318;
    --color-danger-soft: rgba(180, 35, 24, 0.12);
    --color-info: #2b6a8a;
    --color-info-soft: rgba(43, 106, 138, 0.14);

    --color-accent: var(--color-primary);
    --color-accent-soft: var(--color-primary-soft);
    --color-accent-text: var(--color-primary-text);

    --shadow-card: 0 16px 40px rgba(88, 55, 34, 0.08);
    --shadow-nav: 0 -10px 30px rgba(88, 55, 34, 0.06);
    --shadow-overlay: 0 24px 80px rgba(31, 23, 18, 0.22);

    --radius-sm: 0.75rem;
    --radius-md: 1.15rem;
    --radius-lg: 1.6rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;

    --nav-height: 4.5rem;
    --sidebar-width: 16.5rem;
    --space: 0.25rem;
    --header-height: 4rem;
}

html.dark {
    --color-primary: #d4b496;
    --color-primary-hover: #e2c6ad;
    --color-primary-soft: rgba(212, 180, 150, 0.14);
    --color-primary-text: #1c140f;

    --color-secondary: #bdd7de;
    --color-secondary-hover: #d2e6eb;
    --color-secondary-text: #16110e;

    --color-background: #16110e;
    --color-canvas: var(--color-background);
    --color-surface: #231c18;
    --color-surface-muted: #2e2621;

    --color-text: #f4ede6;
    --color-muted: #b3a49a;

    --color-border: rgba(244, 237, 230, 0.1);

    --color-success: #7dcea0;
    --color-success-soft: rgba(125, 206, 160, 0.14);
    --color-warning: #f0b562;
    --color-warning-soft: rgba(240, 181, 98, 0.14);
    --color-danger: #f08a80;
    --color-danger-soft: rgba(240, 138, 128, 0.14);
    --color-info: #9ec9d6;
    --color-info-soft: rgba(189, 215, 222, 0.16);

    --shadow-card: 0 16px 40px rgba(0, 0, 0, 0.35);
    --shadow-nav: 0 -10px 30px rgba(0, 0, 0, 0.28);
    --shadow-overlay: 0 24px 80px rgba(0, 0, 0, 0.5);
}

/* -------------------------------------------------------------------------- */
/* 2. Base                                                                     */
/* -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
    border-color: var(--color-border);
}

html {
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--color-background);
    color: var(--color-text);
    overflow-x: hidden;
}

body {
    min-height: 100dvh;
}

img,
svg {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

[x-cloak] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.icon {
    display: inline-block;
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-lg {
    width: 1.5rem;
    height: 1.5rem;
}

.icon-xl {
    width: 2rem;
    height: 2rem;
}

/* -------------------------------------------------------------------------- */
/* 3. Typography                                                               */
/* -------------------------------------------------------------------------- */

.kicker,
.label-strong {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.page-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.section-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.money {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.money-md {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.meta {
    font-size: 0.8125rem;
    color: var(--color-muted);
    line-height: 1.45;
}

.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; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.tracking-tight { letter-spacing: -0.03em; }
.leading-relaxed { line-height: 1.65; }
.uppercase { text-transform: uppercase; }
.text-center { text-align: center; }
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

.text-primary { color: var(--color-text); }
.text-muted { color: var(--color-muted); }
.text-accent { color: var(--color-primary); }
.text-on-accent { color: var(--color-primary-text); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }

.link {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.link.is-disabled,
.link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: none;
}

/* -------------------------------------------------------------------------- */
/* 4. Layout                                                                   */
/* -------------------------------------------------------------------------- */

.min-h-dvh { min-height: 100dvh; }
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.max-w-app { width: 100%; max-width: 26.5rem; }
.max-w-desktop { width: 100%; max-width: 42rem; }
.h-11 { height: 2.75rem; }
.h-12 { height: 3rem; }
.mx-auto { margin-inline: auto; }
.relative { position: relative; }

.block { display: block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.grow { flex-grow: 1; }
.shrink-0 { flex-shrink: 0; }

.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-8 { gap: 2rem; }

.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-inline: 1rem; }
.px-5 { padding-inline: 1.25rem; }
.px-6 { padding-inline: 1.5rem; }
.py-2 { padding-block: 0.5rem; }
.py-3 { padding-block: 0.75rem; }
.py-4 { padding-block: 1rem; }
.py-8 { padding-block: 2rem; }
.py-10 { padding-block: 2.5rem; }
.pt-4 { padding-top: 1rem; }
.pb-8 { padding-bottom: 2rem; }
.pb-10 { padding-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-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stack-sm { display: flex; flex-direction: column; gap: 0.65rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.5rem; }

.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.safe-pad {
    padding-top: max(1.25rem, env(safe-area-inset-top));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

.safe-pad-x {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

.wallet-page {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    padding-bottom: 0.5rem;
}

.guest-page {
    min-height: 100dvh;
    background:
        radial-gradient(1200px 420px at 80% -10%, rgba(189, 215, 222, 0.45), transparent 60%),
        var(--color-background);
}

html.dark .guest-page {
    background:
        radial-gradient(1000px 380px at 80% -10%, rgba(189, 215, 222, 0.08), transparent 55%),
        var(--color-background);
}

.guest-page-inner {
    width: 100%;
    max-width: 26.5rem;
    margin-inline: auto;
}

.divider {
    height: 1px;
    background: var(--color-border);
    border: 0;
    margin: 0;
}

/* -------------------------------------------------------------------------- */
/* 5. Buttons                                                                  */
/* -------------------------------------------------------------------------- */

.btn,
.wallet-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.85rem;
    padding: 0.75rem 1.1rem;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    font-weight: 700;
    line-height: 1;
    touch-action: manipulation;
    transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.btn:active,
.wallet-button:active {
    transform: scale(0.98);
}

.btn-sm { min-height: 2.25rem; padding: 0.45rem 0.85rem; font-size: 0.8125rem; }
.btn-md { min-height: 2.85rem; }
.btn-lg { min-height: 3.25rem; padding: 0.9rem 1.25rem; font-size: 1.05rem; }

.btn-block,
.wallet-button-block { width: 100%; }

.btn-primary,
.wallet-button-primary {
    background: var(--color-primary);
    color: var(--color-primary-text);
}

.btn-primary:hover,
.wallet-button-primary:hover {
    background: var(--color-primary-hover);
}

.btn-secondary,
.wallet-button-secondary {
    background: var(--color-secondary);
    color: var(--color-secondary-text);
}

.btn-success { background: var(--color-success); color: #fff; }
.btn-danger,
.wallet-button-danger { background: var(--color-danger); color: #fff; }

.btn-ghost,
.wallet-button-ghost {
    background: var(--color-surface-muted);
    color: var(--color-text);
}

.btn-outline,
.wallet-button-outline {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn:disabled,
.wallet-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-full);
    background: var(--color-surface-muted);
    color: var(--color-text);
    touch-action: manipulation;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-muted);
    font-size: 0.8125rem;
    font-weight: 700;
}

.chip.is-active {
    background: var(--color-primary);
    color: var(--color-primary-text);
}

/* -------------------------------------------------------------------------- */
/* 6. Forms                                                                    */
/* -------------------------------------------------------------------------- */

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 700;
}

.form-input,
.wallet-input,
.form-select,
.form-textarea {
    width: 100%;
    min-height: 3.1rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 1.05rem;
    background: var(--color-surface);
    color: var(--color-text);
    appearance: none;
}

.form-textarea {
    min-height: 7rem;
    resize: vertical;
    line-height: 1.5;
}

.form-select {
    background-image: linear-gradient(45deg, transparent 50%, var(--color-muted) 50%), linear-gradient(135deg, var(--color-muted) 50%, transparent 50%);
    background-position: calc(100% - 1.15rem) 1.35rem, calc(100% - 0.85rem) 1.35rem;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2.4rem;
}

.form-input.has-toggle {
    padding-right: 4.4rem;
}

.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
    border-color: var(--color-danger);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-error {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--color-danger);
}

.password-field { position: relative; }

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    transform: translateY(-50%);
    min-height: 2.25rem;
    padding: 0 0.7rem;
    border-radius: var(--radius-full);
    color: var(--color-muted);
    font-size: 0.8125rem;
    font-weight: 700;
}

.remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.5rem;
    font-size: 0.9375rem;
}

.form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.form-checkbox {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--color-primary);
}

/* -------------------------------------------------------------------------- */
/* 7. Cards                                                                    */
/* -------------------------------------------------------------------------- */

.card,
.wallet-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.wallet-metric {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.15rem 1.2rem 1.2rem;
}

.wallet-metric-hero {
    padding: 1.3rem 1.3rem 1.4rem;
    background:
        linear-gradient(160deg, var(--color-primary) 0%, #6d4a33 100%);
    color: var(--color-primary-text);
    border: 0;
}

html.dark .wallet-metric-hero {
    background: linear-gradient(160deg, #3b2a20 0%, #583722 100%);
    color: var(--color-text);
}

.wallet-metric-hero .kicker,
.wallet-metric-hero .meta {
    color: inherit;
    opacity: 0.78;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 0;
}

.list-item + .list-item {
    border-top: 1px solid var(--color-border);
}

.transaction-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background: var(--color-secondary);
    color: var(--color-secondary-text);
    font-weight: 800;
    font-size: 0.9rem;
    overflow: hidden;
}

.avatar-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
.avatar-lg { width: 3rem; height: 3rem; font-size: 1.05rem; }

.badge,
.wallet-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 1.5rem;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    background: var(--color-surface-muted);
    color: var(--color-text);
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-success { background: var(--color-success-soft); color: var(--color-success); }
.badge-warning { background: var(--color-warning-soft); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-soft); color: var(--color-danger); }
.badge-info { background: var(--color-info-soft); color: var(--color-info); }

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    flex-shrink: 0;
}

.bg-canvas { background-color: var(--color-background); }
.bg-surface { background-color: var(--color-surface); }
.bg-surface-muted { background-color: var(--color-surface-muted); }
.bg-accent { background-color: var(--color-primary); }
.bg-accent-soft { background-color: var(--color-primary-soft); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }
.border { border-width: 1px; border-style: solid; }
.border-subtle { border-color: var(--color-border); }
.shadow-card { box-shadow: var(--shadow-card); }

/* -------------------------------------------------------------------------- */
/* 8. Navigation                                                               */
/* -------------------------------------------------------------------------- */

.wallet-app {
    min-height: 100dvh;
    background: var(--color-background);
}

.wallet-sidebar {
    display: none;
}

.wallet-stage {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.wallet-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding-top: env(safe-area-inset-top);
    background: color-mix(in srgb, var(--color-background) 88%, transparent);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
}

.wallet-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: var(--header-height);
    max-width: 46rem;
    margin-inline: auto;
}

.wallet-main {
    flex: 1 1 auto;
    width: 100%;
    max-width: 46rem;
    margin-inline: auto;
    padding-top: 1.1rem;
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 1rem);
}

.wallet-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    min-height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom));
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: var(--shadow-nav);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 3.1rem;
    color: var(--color-muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.nav-item.is-active {
    color: var(--color-primary);
}

.nav-item.is-disabled {
    opacity: 0.55;
}

.nav-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.35rem;
    height: 3.35rem;
    margin: -0.85rem auto 0;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--color-primary-text);
    box-shadow: 0 10px 24px rgba(88, 55, 34, 0.28);
}

.nav-add:focus-visible {
    outline-offset: 3px;
}

.sidebar-brand,
.sidebar-nav,
.sidebar-footer {
    display: flex;
    flex-direction: column;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.7rem;
    padding: 0.45rem 0.8rem;
    border-radius: 1rem;
    color: var(--color-muted);
    font-weight: 600;
    font-size: 0.95rem;
}

.sidebar-link.is-active {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.sidebar-link.is-disabled {
    opacity: 0.5;
    cursor: default;
}

/* -------------------------------------------------------------------------- */
/* 9. Overlays                                                                 */
/* -------------------------------------------------------------------------- */

.overlay-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(22, 17, 14, 0.46);
}

.bottom-sheet,
.modal-card {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-overlay);
}

.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    max-height: min(86dvh, 40rem);
    overflow: auto;
    padding: 0.65rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom));
    border-radius: 1.5rem 1.5rem 0 0;
}

.sheet-handle {
    width: 3rem;
    height: 0.28rem;
    margin: 0.2rem auto 0.9rem;
    border-radius: var(--radius-full);
    background: var(--color-border);
}

.modal-wrap {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.modal-card {
    width: min(100%, 28rem);
    max-height: min(86dvh, 40rem);
    overflow: auto;
    border-radius: var(--radius-xl);
    padding: 1.25rem;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    min-height: 3.4rem;
    padding: 0.7rem 0.2rem;
    text-align: left;
    border-radius: 1rem;
}

.quick-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 1rem;
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.45rem);
    z-index: 40;
    min-width: 12.5rem;
    padding: 0.4rem;
    border-radius: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 2.5rem;
    padding: 0.4rem 0.65rem;
    border-radius: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--color-surface-muted);
}

/* -------------------------------------------------------------------------- */
/* 10. Toasts & alerts                                                         */
/* -------------------------------------------------------------------------- */

.toast-host {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 0.75rem);
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 0.9rem 1rem;
    border-radius: 1.1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    font-weight: 600;
}

.toast-success { border-color: var(--color-success); }
.toast-error { border-color: var(--color-danger); }
.toast-warning { border-color: var(--color-warning); }
.toast-info { border-color: var(--color-info); }

.alert {
    display: flex;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 1.1rem;
    background: var(--color-surface-muted);
}

.alert-success { background: var(--color-success-soft); color: var(--color-success); }
.alert-warning { background: var(--color-warning-soft); color: var(--color-warning); }
.alert-danger { background: var(--color-danger-soft); color: var(--color-danger); }
.alert-info { background: var(--color-info-soft); color: var(--color-info); }

/* -------------------------------------------------------------------------- */
/* 11. Feedback                                                                */
/* -------------------------------------------------------------------------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.55rem;
    padding: 1.6rem 1.1rem;
}

.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.4rem;
    height: 3.4rem;
    margin-bottom: 0.3rem;
    border-radius: 1.15rem;
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.spinner {
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: var(--radius-full);
    animation: spin 0.7s linear infinite;
}

.skeleton {
    display: block;
    height: 0.9rem;
    border-radius: 0.6rem;
    background: linear-gradient(90deg, var(--color-surface-muted) 25%, var(--color-surface) 50%, var(--color-surface-muted) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    to { background-position: -200% 0; }
}

/* -------------------------------------------------------------------------- */
/* 12. Utilities                                                               */
/* -------------------------------------------------------------------------- */

.overflow-hidden { overflow: hidden; }
.select-none { user-select: none; }
.touch-manipulation { touch-action: manipulation; }
.transition {
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* -------------------------------------------------------------------------- */
/* 13. Inventory                                                               */
/* -------------------------------------------------------------------------- */

.page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.search-field {
    position: relative;
}

.search-field .icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
    pointer-events: none;
}

.search-field .form-input {
    padding-left: 2.85rem;
}

.chip {
    cursor: pointer;
    border: 1px solid var(--color-border);
    white-space: nowrap;
}

.chip-row {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.1rem;
}

.chip-row::-webkit-scrollbar {
    display: none;
}

.inventory-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.inventory-list.is-dimmed {
    opacity: 0.55;
}

a.inventory-card {
    display: block;
    padding: 1.15rem 1.15rem 1.2rem;
    color: inherit;
    text-decoration: none;
}

a.inventory-card:hover {
    border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-border));
}

.inventory-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.inventory-card-status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-muted);
}

.variant-row,
.location-row,
.variant-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
}

.variant-row span,
.location-row span,
.variant-meta span {
    overflow-wrap: anywhere;
}

.inventory-value {
    padding-top: 0.85rem;
    border-top: 1px solid var(--color-border);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* -------------------------------------------------------------------------- */
/* 14. Responsive                                                              */
/* -------------------------------------------------------------------------- */

@media (min-width: 768px) {
    .md\:max-w-desktop { max-width: 42rem; }
    .md\:p-8 { padding: 2rem; }
    .md\:py-10 { padding-block: 2.5rem; }
    .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .md\:flex-row { flex-direction: row; }
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:grid-4 { grid-template-columns: repeat(4, 1fr); }

    .page-title { font-size: 2rem; }
    .money { font-size: 2.35rem; }

    .bottom-sheet {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        transform: translate(-50%, -50%);
        width: min(28rem, calc(100% - 2rem));
        border-radius: var(--radius-xl);
        padding: 1.25rem;
    }

    .sheet-handle { display: none; }

    .toast-host {
        left: auto;
        right: 1.25rem;
        bottom: 1.25rem;
        width: 22rem;
    }
}

@media (min-width: 1024px) {
    .lg\:hidden { display: none; }
    .lg\:flex { display: flex; }

    .wallet-app {
        display: grid;
        grid-template-columns: var(--sidebar-width) 1fr;
    }

    .wallet-sidebar {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
        position: sticky;
        top: 0;
        height: 100dvh;
        padding: 1.25rem 1rem;
        background: var(--color-surface);
        border-right: 1px solid var(--color-border);
    }

    .wallet-bottom-nav {
        display: none;
    }

    .wallet-main {
        max-width: 52rem;
        padding-bottom: 2rem;
    }

    .wallet-header {
        background: var(--color-background);
    }
}
