:root {
    color-scheme: light;
    --app-bg: #f7f8fc;
    --surface: rgba(255, 255, 255, 0.96);
    --surface-soft: #f8fafc;
    --stroke: rgba(148, 163, 184, 0.18);
    --ink: #0f172a;
    --muted: #64748b;
    --primary: #f59e0b;
    --primary-soft: #fff3db;
    --success: #059669;
    --success-soft: #ecfdf5;
    --danger: #dc2626;
    --danger-soft: #fff1f2;
    --shadow-soft: 0 20px 40px -28px rgba(15, 23, 42, 0.18);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #f8fafc;
}

body {
    margin: 0;
    min-height: 100svh;
    background: linear-gradient(180deg, #fcfdff 0%, #f3f6fb 100%);
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

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

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

.app-shell {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.app-card {
    border: 1px solid var(--stroke);
    background: var(--surface);
    border-radius: 26px;
    box-shadow: 0 16px 32px -26px rgba(15, 23, 42, 0.16);
}

.app-card-soft {
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: var(--surface-soft);
    border-radius: 22px;
}

.app-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 50px;
    padding: 0 1rem;
    border: 0;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 160ms ease, opacity 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
    touch-action: manipulation;
    cursor: pointer;
}

.app-button:active {
    transform: scale(0.98);
}

.app-button-primary {
    background: var(--ink);
    color: #fff;
}

.app-button-secondary {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #fff;
    color: var(--ink);
}

.app-button-success {
    background: var(--primary);
    color: var(--ink);
}

.app-button-danger {
    background: var(--danger);
    color: #fff;
}

.app-button-danger-outline {
    border-color: #fecdd3;
    color: #be123c;
}

.app-button-compact {
    min-height: 42px;
    padding: 0 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
}

.app-input,
.app-select,
.app-textarea {
    width: 100%;
    border: 1px solid rgba(203, 213, 225, 0.9);
    background: #fff;
    color: var(--ink);
    border-radius: 18px;
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.app-textarea {
    min-height: 120px;
    resize: vertical;
}

.app-input:focus,
.app-select:focus,
.app-textarea:focus {
    border-color: rgba(245, 158, 11, 0.9);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.app-header-card {
    backdrop-filter: blur(12px);
}

.app-kicker {
    font-size: 0.72rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #94a3b8;
}

.app-hero-title {
    font-size: 1.7rem;
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.app-subtitle {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--muted);
}

.app-header-badge {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 0.8rem;
    border-radius: 999px;
    background: #fff7e6;
    color: #b45309;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

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

.app-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.app-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.app-list-item {
    display: block;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: var(--surface-soft);
    border-radius: 22px;
    padding: 1rem;
    transition: background-color 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.app-list-item:active {
    transform: scale(0.99);
}

.app-empty {
    padding: 1.5rem 1rem;
    text-align: center;
}

.app-metric-value {
    font-size: 1.95rem;
    line-height: 1.05;
    font-weight: 700;
    color: var(--ink);
}

.app-metric-note {
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--muted);
}

.bottom-nav {
    width: min(448px, calc(100% - 24px));
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
}

.bottom-nav-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.safe-bottom {
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
}

.sticky-submit {
    width: min(448px, calc(100% - 24px));
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}

.toast-enter {
    animation: toastIn 220ms ease-out;
}

.app-main-view {
    min-height: 1px;
}

@keyframes toastIn {
    from {
        transform: translateY(14px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hidden { display: none !important; }
.block { display: block; }
.flex { display: flex; }
.grid { display: grid; }
.inline-flex { display: inline-flex; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { inset: 0; }
.inset-x-0 { left: 0; right: 0; }
.top-3 { top: 0.75rem; }
.bottom-3 { bottom: 0.75rem; }
.bottom-\[5\.6rem\] { bottom: 5.6rem; }
.left-1\/2 { left: 50%; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-\[55\] { z-index: 55; }
.z-\[60\] { z-index: 60; }
.z-\[70\] { z-index: 70; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.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; }
.min-h-screen { min-height: 100svh; }
.min-h-\[42px\] { min-height: 42px; }
.min-h-\[62px\] { min-height: 62px; }
.min-w-0 { min-width: 0; }
.min-w-\[42px\] { min-width: 42px; }
.max-w-\[480px\] { max-width: 480px; }
.max-w-\[58\%\] { max-width: 58%; }
.max-w-\[60\%\] { max-width: 60%; }
.w-full { width: 100%; }
.w-\[min\(448px\,calc\(100\%-24px\)\)\] { width: min(448px, calc(100% - 24px)); }
.h-full { height: 100%; }
.h-2 { height: 0.5rem; }
.h-3 { height: 0.75rem; }
.h-14 { height: 3.5rem; }
.h-20 { height: 5rem; }
.h-24 { height: 6rem; }
.h-32 { height: 8rem; }
.size-4 { width: 1rem; height: 1rem; }
.size-5 { width: 1.25rem; height: 1.25rem; }
.size-6 { width: 1.5rem; height: 1.5rem; }
.size-8 { width: 2rem; height: 2rem; }
.size-10 { width: 2.5rem; height: 2.5rem; }
.size-14 { width: 3.5rem; height: 3.5rem; }
.shrink-0 { flex-shrink: 0; }
.overflow-hidden { overflow: hidden; }
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }
.cursor-pointer { cursor: pointer; }
.list-none { list-style: none; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.whitespace-pre-line { white-space: pre-line; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-sans { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-\[10px\] { font-size: 10px; line-height: 1.2; }
.text-\[11px\] { font-size: 11px; line-height: 1.3; }
.text-\[1\.45rem\] { font-size: 1.45rem; line-height: 1.2; }
.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.5rem; }
.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; }
.uppercase { text-transform: uppercase; }
.tracking-tight { letter-spacing: -0.02em; }
.tracking-\[0\.16em\] { letter-spacing: 0.16em; }
.tracking-\[0\.18em\] { letter-spacing: 0.18em; }
.tracking-\[0\.2em\] { letter-spacing: 0.2em; }
.tracking-\[0\.22em\] { letter-spacing: 0.22em; }
.leading-6 { line-height: 1.5rem; }
.text-white { color: #fff; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }
.text-slate-900 { color: #0f172a; }
.text-slate-950 { color: #020617; }
.text-amber-500 { color: #f59e0b; }
.text-amber-700 { color: #b45309; }
.text-amber-800 { color: #92400e; }
.text-amber-900 { color: #78350f; }
.text-emerald-500 { color: #10b981; }
.text-emerald-700 { color: #047857; }
.text-rose-400 { color: #fb7185; }
.text-rose-600 { color: #e11d48; }
.text-rose-700 { color: #be123c; }
.bg-white { background: #fff; }
.bg-white\/70 { background: rgba(255, 255, 255, 0.7); }
.bg-slate-100 { background: #f1f5f9; }
.bg-slate-200 { background: #e2e8f0; }
.bg-slate-900 { background: #0f172a; }
.bg-slate-950\/10 { background: rgba(2, 6, 23, 0.1); }
.bg-amber-50 { background: #fffbeb; }
.bg-amber-100 { background: #fef3c7; }
.bg-amber-200 { background: #fde68a; }
.bg-amber-400 { background: #fbbf24; }
.bg-emerald-50 { background: #ecfdf5; }
.bg-emerald-100 { background: #d1fae5; }
.bg-emerald-500 { background: #10b981; }
.bg-rose-50 { background: #fff1f2; }
.bg-rose-100 { background: #ffe4e6; }
.border { border: 1px solid rgba(148, 163, 184, 0.24); }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-300 { border-color: #cbd5e1; }
.border-emerald-200 { border-color: #a7f3d0; }
.border-rose-200 { border-color: #fecdd3; }
.rounded { border-radius: 0.25rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-\[22px\] { border-radius: 22px; }
.rounded-\[28px\] { border-radius: 28px; }
.rounded-\[32px\] { border-radius: 32px; }
.rounded-full { border-radius: 9999px; }
.shadow-soft { box-shadow: var(--shadow-soft); }
.p-4 { padding: 1rem; }
.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; }
.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-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.pt-4 { padding-top: 1rem; }
.pt-5 { padding-top: 1.25rem; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-\[1\.1fr_0\.9fr\] { grid-template-columns: 1.1fr 0.9fr; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.transition {
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease, transform 160ms ease;
}
.hover\:bg-slate-100:hover { background: #f1f5f9; }
.hover\:text-slate-700:hover { color: #334155; }
.group:hover .group-hover\:bg-slate-200 { background: #e2e8f0; }
.active\:scale-\[0\.97\]:active { transform: scale(0.97); }
.active\:scale-\[0\.99\]:active { transform: scale(0.99); }
.focus\:ring-amber-400:focus {
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.24);
}
.-translate-x-1\/2 {
    transform: translateX(-50%);
}
.-rotate-90 {
    transform: rotate(-90deg);
}

@media (max-width: 360px) {
    .grid-cols-\[1\.1fr_0\.9fr\] {
        grid-template-columns: 1fr;
    }

    .app-grid-2,
    .app-action-grid {
        grid-template-columns: 1fr;
    }

    .bottom-nav-grid {
        gap: 0.125rem;
    }
}
