@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@700&display=swap');
/* Detailo design system: bright + friendly. White cards on a cool light ground, one confident "gloss blue",
   a sunny accent for highlights, mint for money/success. Mobile-first: everything works one-handed at 375px,
   bottom tab bar on phones, side rail on desktop. Use the tokens; don't hardcode colors in pages. */
:root {
  --bg: #F4F7FB;
  --bg-deep: #E9EFF7;
  --card: #FFFFFF;
  --ink: #0F1B2D;
  --ink-2: #44526A;
  --ink-3: #5E6A7F;
  --line: #E1E8F1;
  --line-2: #CFD9E6;
  --brand: #1D6CF2;
  --brand-press: #1557CC;
  --brand-wash: #E8F0FE;
  --brand-ink: #0F4AB8;
  --sun: #FFB020;
  --sun-wash: #FFF4DB;
  --sun-ink: #8A5300;
  --mint: #0FA77A;
  --mint-wash: #E1F7EF;
  --mint-ink: #087357;
  --rose: #E5484D;
  --rose-wash: #FDECEC;
  --rose-ink: #B4232A;
  --violet: #7C5CFF;
  --violet-wash: #F0ECFF;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 4px 16px rgba(15, 27, 45, .05);
  --shadow-lift: 0 10px 40px rgba(15, 27, 45, .14);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --tabs-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.015em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ---------- layout: app shell ---------- */
.shell { min-height: 100dvh; }
.rail { display: none; }
.main { padding: 16px 16px calc(var(--tabs-h) + var(--safe-b) + 24px); max-width: 860px; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.topbar h1 { font-size: 26px; font-weight: 800; }
.topbar .sub { color: var(--ink-3); font-size: 14px; margin-top: 2px; }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; }
.back { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font-size: 20px; flex: none; }

.tabs { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(var(--tabs-h) + var(--safe-b)); padding: 6px 8px var(--safe-b); background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--ink-3); font-size: 11.5px; font-weight: 700; border-radius: 14px; }
.tabs a i { font-size: 24px; }
.tabs a[aria-current="page"] { color: var(--brand); }
.tabs a[aria-current="page"] i::before { font-family: 'Phosphor-Fill' !important; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 236px 1fr; }
  .tabs { display: none; }
  .rail { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--card); }
  .rail .brand { margin: 0 8px 18px; }
  .rail a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
  .rail a i { font-size: 21px; }
  .rail a:hover { background: var(--bg); color: var(--ink); }
  .rail a[aria-current="page"] { background: var(--brand-wash); color: var(--brand-ink); }
  .rail .spacer { flex: 1; }
  .main { padding: 28px 32px 48px; }
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.brand .mark { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(140deg, #3B8BFF, var(--brand) 55%, #0E4FC7); display: grid; place-items: center; color: #fff; font-size: 18px; box-shadow: 0 4px 12px rgba(29, 108, 242, .35); }

/* ---------- surfaces ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 18px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.section-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 22px 4px 10px; }
.h2 { font-size: 19px; font-weight: 800; }
.muted { color: var(--ink-3); }
.small { font-size: 13.5px; }
.big-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.divider { height: 1px; background: var(--line); margin: 6px 0; }

/* stat tiles */
.stat { padding: 16px; }
.stat .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; margin-bottom: 10px; }
.stat b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.ic.blue { background: var(--brand-wash); color: var(--brand-ink); }
.ic.sun { background: var(--sun-wash); color: var(--sun-ink); }
.ic.mint { background: var(--mint-wash); color: var(--mint-ink); }
.ic.rose { background: var(--rose-wash); color: var(--rose-ink); }
.ic.violet { background: var(--violet-wash); color: var(--violet); }

/* lists */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: inherit; border-top: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; cursor: pointer; }
.item:first-child { border-top: 0; }
.item:hover { background: #FAFCFF; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meta { font-size: 13.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .chev { color: var(--ink-3); font-size: 18px; }
.avatar { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; background: var(--brand-wash); color: var(--brand-ink); flex: none; font-size: 16px; }
.time-box { width: 54px; flex: none; text-align: center; border-radius: 12px; padding: 6px 0; background: var(--bg); }
.time-box b { display: block; font-size: 15px; font-weight: 800; }
.time-box span { font-size: 11px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; }

/* badges / chips */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--bg-deep); color: var(--ink-2); white-space: nowrap; }
.badge.blue { background: var(--brand-wash); color: var(--brand-ink); }
.badge.mint { background: var(--mint-wash); color: var(--mint-ink); }
.badge.sun { background: var(--sun-wash); color: var(--sun-ink); }
.badge.rose { background: var(--rose-wash); color: var(--rose-ink); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--card); font-weight: 700; font-size: 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"], .chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 14px; border: 0; background: var(--brand); color: #fff; font-weight: 800; font-size: 15.5px; text-decoration: none; cursor: pointer; transition: transform .12s var(--ease), background .15s; -webkit-tap-highlight-color: transparent; white-space: nowrap; }
.btn:hover { background: var(--brand-press); }
.btn:active { transform: scale(.98); }
.btn i { font-size: 19px; }
.btn.block { width: 100%; }
.btn.sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn.ghost:hover { background: var(--bg); }
.btn.soft { background: var(--brand-wash); color: var(--brand-ink); }
.btn.soft:hover { background: #DCE8FD; }
.btn.mint { background: var(--mint); }
.btn.mint:hover { background: #0B9169; }
.btn.danger { background: var(--rose-wash); color: var(--rose-ink); }
.btn.danger:hover { background: #FAD9D9; }
.btn.dark { background: var(--ink); }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.btn.busy::after { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 20px; color: var(--ink); cursor: pointer; text-decoration: none; }
.fab { position: fixed; right: 18px; bottom: calc(var(--tabs-h) + var(--safe-b) + 16px); z-index: 30; width: 58px; height: 58px; border-radius: 20px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 26px; box-shadow: 0 10px 28px rgba(29, 108, 242, .45); border: 0; cursor: pointer; text-decoration: none; }
@media (min-width: 900px) { .fab { bottom: 28px; right: 32px; } }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 13px; border: 1.5px solid var(--line-2); background: var(--card); font-size: 16px; transition: border-color .15s, box-shadow .15s; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-wash); }
.input-money { position: relative; }
.input-money::before { content: '$'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 700; }
.input-money .input { padding-left: 28px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--mint); }
.switch input:checked + span::after { transform: translateX(20px); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg-deep); border-radius: 13px; padding: 4px; gap: 4px; }
.seg button { height: 40px; border: 0; border-radius: 10px; background: none; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* banners + empty states */
.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--brand-wash); color: var(--brand-ink); font-weight: 600; font-size: 14.5px; }
.banner i { font-size: 22px; flex: none; }
.banner .btn { margin-left: auto; }
.banner.sun { background: var(--sun-wash); color: var(--sun-ink); }
.banner.mint { background: var(--mint-wash); color: var(--mint-ink); }
.banner.rose { background: var(--rose-wash); color: var(--rose-ink); }
.empty { text-align: center; padding: 36px 20px; color: var(--ink-3); }
.empty > i { font-size: 44px; color: var(--line-2); display: block; margin: 0 auto 10px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.skeleton { background: linear-gradient(90deg, var(--bg-deep), #F3F6FA, var(--bg-deep)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; min-height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }
body:has(.test-ribbon) .topbar { padding-top: 20px; }
.test-ribbon { position: fixed; top: 10px; right: 10px; z-index: 90; background: var(--sun); color: #3B2600; font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px; letter-spacing: .04em; pointer-events: none; }

/* bottom sheet / modal */
.sheet-bg { position: fixed; inset: 0; z-index: 80; background: rgba(15, 27, 45, .42); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 10px 18px calc(22px + var(--safe-b)); animation: up .28s var(--ease); }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line-2); margin: 0 auto 14px; }
.sheet h3 { font-size: 20px; font-weight: 800; margin-bottom: 14px; }
@media (min-width: 640px) { .sheet-bg { align-items: center; } .sheet { border-radius: 24px; } .sheet .grab { display: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }

/* toast */
.toasts { position: fixed; z-index: 95; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + var(--safe-b) + 14px); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 13px 16px; border-radius: 14px; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-lift); display: flex; gap: 10px; align-items: center; animation: up .25s var(--ease); }
.toast.bad { background: var(--rose-ink); }
.toast.good { background: var(--mint-ink); }
@media (min-width: 900px) { .toasts { bottom: 24px; } }

/* page enter */
.view-in { animation: viewin .3s var(--ease); }
@keyframes viewin { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* boot loader */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot .mark { width: 54px; height: 54px; border-radius: 17px; background: linear-gradient(140deg, #3B8BFF, var(--brand) 55%, #0E4FC7); display: grid; place-items: center; color: #fff; font-size: 28px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .75; } }

/* ---------- Detailo brand (10/4: Jacob picked the glossy "o": black ball, gold reflection, white app icon) ---------- */
.wordmark { display: inline-flex; align-items: center; font-family: 'Space Grotesk', var(--font); font-weight: 700; font-size: 24px; letter-spacing: -.045em; color: var(--ink); line-height: 1; }
.wordmark .ball, .ball { display: inline-block; width: .7em; height: .7em; margin-left: .035em; margin-top: .08em; flex: none; background: url('/img/ball.svg') center / contain no-repeat; }
.rail .wordmark { font-size: 26px; }
/* app-icon style squares (boot loader + mock notifications on login/landing): white tile with the ball */
.boot .mark { background: #fff; box-shadow: 0 6px 24px rgba(15,27,45,.12); }
.boot .mark i, .app-ic i.ph-drop, .toastcard .ai i.ph-drop { display: none; }
.boot .mark::after, .app-ic::after, .toastcard .ai::after { content: ''; width: 66%; height: 66%; background: url('/img/ball.svg') center / contain no-repeat; }
.app-ic, .toastcard .ai { background: #fff !important; color: inherit !important; display: grid !important; place-items: center; box-shadow: inset 0 0 0 1px var(--line); }
