/* FlipFinder · "Snap" design system. Canvas: https://claude.ai/artifact/19dw8vTiwKo7fGdYdn7hnv */

:root {
    color-scheme: light;
    --bg: #FFF6EA;
    --surface: #FFFFFF;
    --surface-soft: #FFFBF4;
    --sand: #F3E6D3;
    --sand-2: #EFE3D1;
    --photo: #EADBC4;
    --ink: #1B1A1F;
    --muted: #5E5A52;
    --tomato: #FF5A36;
    --sun: #FFD84D;
    --link: #C2410C;
    --link-hover: #9A3412;
    --danger: #B42318;
    --line: 2px solid var(--ink);
    --r-card: 24px;
    --r-field: 14px;
    --r-sticker: 16px;
    --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --tabbar-h: 76px;
    --sidebar-w: 232px;
    --list-w: 560px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; }
img { display: block; }
.disp { font-family: var(--font-display); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

/* ---------- App shell ---------- */
.shell { min-height: 100dvh; }
.shell-main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
.sidebar { display: none; }

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: var(--line);
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
}
.tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    border-radius: 14px; color: var(--ink); text-decoration: none; font-size: 12px; font-weight: 600;
}
.tabbar a.active { background: var(--sun); font-weight: 700; }

@media (min-width: 1024px) {
    .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
    .shell-main { padding-bottom: 0; min-width: 0; }
    .tabbar { display: none; }
    .sidebar {
        display: flex; flex-direction: column; justify-content: space-between;
        position: sticky; top: 0; height: 100dvh; padding: 24px 16px;
        background: var(--surface); border-right: var(--line);
    }
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--tomato); border: var(--line); display: flex; align-items: center; justify-content: center; }
.brand-name { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 28px; }
.side-nav a {
    height: 44px; padding: 0 14px; border-radius: 14px; border: 2px solid transparent;
    color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.side-nav a.active { background: var(--sun); border-color: var(--ink); font-weight: 700; }
.side-nav a:hover:not(.active) { background: var(--bg); }
.side-foot { display: flex; flex-direction: column; gap: 10px; }
.side-status { background: var(--bg); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }

/* ---------- Page chrome ---------- */
.page { padding: 20px 16px 24px; max-width: 720px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 4px 12px; }
.page-title { font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.page-kicker { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---------- Buttons ---------- */
.btn {
    height: 48px; padding: 0 24px; border-radius: 999px; border: var(--line);
    background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    text-decoration: none; white-space: nowrap; transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { color: var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.btn:active { box-shadow: none; transform: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-primary { background: var(--ink); color: #FFFFFF; }
.btn-primary:hover { color: #FFFFFF; }
.btn-accent { background: var(--sun); }
.btn-lg { height: 52px; font-size: 16px; }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--link); }
.btn-ghost:hover { color: var(--link-hover); box-shadow: none; transform: none; }
.btn-danger-text { border-color: transparent; background: transparent; color: var(--danger); height: 44px; }
.btn-danger-text:hover { color: var(--danger); box-shadow: none; transform: none; text-decoration: underline; }
.icon-btn {
    width: 44px; height: 44px; flex-shrink: 0; border-radius: 22px; border: var(--line); background: var(--surface);
    color: var(--ink); display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.icon-btn:hover { color: var(--ink); background: var(--sand); }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ---------- Chips (pipeline tabs, filters, statuses) ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 4px; margin: 0 -4px; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip {
    height: 38px; padding: 0 16px; border-radius: 19px; border: 2px solid transparent; flex-shrink: 0;
    background: var(--sand); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip .count { color: var(--muted); }
.chip.active { background: var(--ink); color: #FFFFFF; }
.chip.active .count { color: #FFFFFF; opacity: .75; }
.chip-outline { background: var(--surface); border-color: var(--ink); }
.chip-outline[aria-pressed="true"] { background: var(--sun); }
.chip-select { position: relative; display: inline-flex; flex-shrink: 0; white-space: nowrap; }
.chip-select select {
    appearance: none; height: 38px; padding: 0 38px 0 16px; border-radius: 19px; border: var(--line);
    background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer;
}
.chip-select svg { position: absolute; right: 14px; top: 11px; pointer-events: none; }
.status-chip {
    height: 40px; padding: 0 16px; border-radius: 20px; border: var(--line); background: var(--surface);
    font-size: 14px; font-weight: 600; white-space: nowrap;
}
.status-chip[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; font-weight: 700; }

/* ---------- Cards & sections ---------- */
.card { background: var(--surface); border: var(--line); border-radius: var(--r-card); }
.section { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.section-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------- Deal sticker ---------- */
.sticker {
    border: var(--line); border-radius: var(--r-sticker); padding: 8px 12px;
    display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--ink);
}
.sticker-value { font-family: var(--font-display); font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sticker-label { font-size: 12px; font-weight: 700; white-space: nowrap; }
.sticker-sm { padding: 6px 10px; border-radius: 14px; min-width: 76px; }
.sticker-sm .sticker-value { font-size: 22px; }
.sticker-sm .sticker-label { font-size: 11px; }
.deal-great { background: var(--tomato); }
.deal-good { background: var(--sun); }
.deal-thin { background: var(--surface); }
.deal-loss { background: var(--ink); color: #FFFFFF; }
.deal-unknown { background: var(--sand); }

/* ---------- Lead card (big photo on phones, compact row on desktop) ---------- */
.lead-list { display: flex; flex-direction: column; gap: 16px; }
.lead-card { background: var(--surface); border: var(--line); border-radius: var(--r-card); overflow: hidden; }
.lead-photo {
    position: relative; display: block; height: 176px; background: var(--photo); text-decoration: none;
}
.lead-photo img { width: 100%; height: 100%; object-fit: cover; }
.lead-photo .no-photo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #8C7A5E; }
.lead-source {
    position: absolute; left: 12px; top: 12px; height: 28px; padding: 0 10px; border-radius: 14px;
    background: var(--surface); font-size: 12px; font-weight: 700; color: var(--ink); display: flex; align-items: center;
}
.lead-photo .sticker { position: absolute; right: 12px; bottom: 12px; }
.lead-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.lead-title {
    font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--ink); text-decoration: none;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lead-title:hover { color: var(--ink); text-decoration: underline; }
.lead-meta { font-size: 14px; color: var(--muted); }
.lead-meta b { color: var(--ink); }
.lead-row-sticker { display: none; }

@media (min-width: 1024px) {
    .lead-list { gap: 10px; }
    .lead-card {
        display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 20px; background: var(--surface-soft);
        position: relative;
    }
    .lead-card.selected { background: var(--surface); box-shadow: 4px 4px 0 var(--ink); }
    .lead-card:hover { background: var(--surface); }
    .lead-photo { width: 96px; height: 80px; flex-shrink: 0; border-radius: 12px; overflow: hidden; }
    .lead-photo .lead-source, .lead-photo .sticker, .lead-photo .no-photo span { display: none; }
    .lead-body { padding: 0; gap: 4px; flex-grow: 1; min-width: 0; }
    .lead-title { font-size: 17px; -webkit-line-clamp: 1; }
    .lead-title::after { content: ''; position: absolute; inset: 0; } /* whole row clickable */
    .lead-meta { font-size: 13px; }
    .lead-actions { display: none; }
    .lead-row-sticker { display: inline-flex; flex-shrink: 0; }
    .lead-source-inline { display: inline !important; }
}
.lead-source-inline { display: none; }

/* ---------- Leads page: list + detail ---------- */
.leads-shell { display: block; }
.leads-list { padding: 20px 16px 24px; }
.leads-detail { display: none; }
.leads-shell.has-lead .leads-list { display: none; }
.leads-shell.has-lead .leads-detail { display: block; }
.filters { display: flex; flex-direction: column; gap: 10px; padding: 0 4px 14px; }
.list-search { display: none; width: 200px; }
.empty { border: 2px dashed var(--ink); border-radius: var(--r-card); padding: 28px 20px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; }

@media (min-width: 1024px) {
    .leads-shell { display: grid; grid-template-columns: var(--list-w) minmax(0, 1fr); height: 100dvh; }
    .leads-list { display: block !important; border-right: var(--line); overflow-y: auto; padding: 24px; }
    .leads-detail { display: block; overflow-y: auto; }
    .list-search { display: flex; }
    .detail-back { display: none !important; }
}
.detail-empty { height: 100%; display: flex; align-items: center; justify-content: center; padding: 40px; }

/* ---------- Lead detail ---------- */
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; height: 300px; background: var(--photo); border-bottom: var(--line); scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { height: 100%; min-width: 100%; object-fit: cover; scroll-snap-align: start; }
.gallery-wrap { position: relative; }
.gallery-top { position: absolute; left: 16px; right: 16px; top: 16px; display: flex; justify-content: space-between; gap: 8px; }
.gallery-count { position: absolute; right: 16px; bottom: 14px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--surface); border: var(--line); font-size: 12px; font-weight: 700; display: flex; align-items: center; }
.no-gallery { height: 180px; display: flex; align-items: center; justify-content: center; color: #8C7A5E; background: var(--photo); border-bottom: var(--line); }
.detail-top { display: flex; flex-direction: column; gap: 16px; }
.detail { padding: 20px 20px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.detail-kicker { font-size: 13px; font-weight: 700; color: var(--muted); }
.detail-title { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.detail-ask { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.deal-banner { border: var(--line); border-radius: var(--r-card); padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.deal-banner-label { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.deal-banner-value { font-family: var(--font-display); font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.deal-banner-sub { font-size: 14px; font-weight: 600; }
.deal-badge { width: 72px; height: 72px; flex-shrink: 0; border-radius: 36px; background: var(--ink); color: #FFFFFF; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.deal-badge b { font-family: var(--font-display); font-size: 22px; line-height: 1; }
.deal-badge span { font-size: 11px; font-weight: 600; }
.deal-loss .deal-badge { background: var(--sun); color: var(--ink); }
.math { display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.math-row { display: flex; justify-content: space-between; gap: 12px; }
.math-rule { height: 2px; background: var(--ink); }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--bg); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.stat-value { font-family: var(--font-display); font-size: clamp(16px, 4.8vw, 20px); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sales { list-style: none; margin: 0; padding: 0; }
.sale { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--sand-2); }
.sale-thumb { width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px; background: var(--sand-2); object-fit: cover; }
.sale-text { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; font-size: 14px; }
.sale-text:hover { color: var(--ink); }
.sale-text > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sale.excluded .sale-text > span:first-child, .sale.excluded .sale-price { text-decoration: line-through; color: var(--muted); }
.sale-note { font-size: 12px; color: var(--muted); }
.sale-price { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.history li { display: flex; gap: 10px; align-items: baseline; }
.history-dot { width: 10px; height: 10px; border-radius: 5px; border: var(--line); flex-shrink: 0; background: var(--surface); }
.history li:first-child .history-dot { background: var(--tomato); }
.description { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.pending-note { display: flex; align-items: center; gap: 10px; font-size: 14px; background: var(--bg); border-radius: 14px; padding: 12px; }

@media (min-width: 1024px) {
    .gallery { height: 250px; }
    .gallery img { min-width: 34%; }
    .detail { padding: 20px 28px 40px; }
    .detail-top { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: stretch; }
    .deal-banner { flex-direction: column; align-items: flex-start; }
    .deal-banner-value { font-size: 52px; }
    .deal-badge { display: none; }
    .mobile-only { display: none !important; }
}
@media (max-width: 1023.98px) { .desktop-only { display: none !important; } }

/* ---------- Messages ---------- */
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bubble-row { display: flex; flex-direction: column; gap: 4px; max-width: 85%; }
.bubble-row.out { align-self: flex-end; align-items: flex-end; }
.bubble-row.in { align-self: flex-start; }
.bubble { padding: 12px 14px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.out .bubble { background: var(--ink); color: #FFFFFF; border-radius: 20px 20px 6px 20px; }
.in .bubble { background: var(--surface); border: var(--line); border-radius: 20px 20px 20px 6px; }
.out .bubble.failed { background: var(--surface); color: var(--ink); border: 2px dashed var(--danger); }
.bubble-meta { font-size: 12px; color: var(--muted); }
.suggestion { background: var(--sun); border: var(--line); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.suggestion-label { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.reply-badge {
    display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 14px;
    background: var(--sun); border: var(--line); font-size: 12px; font-weight: 800; color: var(--ink); white-space: nowrap;
}
.lead-photo .reply-badge { position: absolute; right: 12px; top: 12px; }
.nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--tomato); border: 2px solid var(--ink); color: var(--ink); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.tabbar a { position: relative; }
.tabbar .nav-badge { position: absolute; top: 2px; right: calc(50% - 24px); }

.template { border: var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
code { font-family: ui-monospace, 'Cascadia Mono', monospace; font-size: .9em; background: var(--sand); padding: 1px 5px; border-radius: 6px; }

.tabbar.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.budget { background: var(--surface); border: var(--line); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.meter { height: 10px; border-radius: 5px; background: var(--sand); overflow: hidden; }
.meter > div { height: 100%; background: var(--ink); border-radius: 5px; }
select.inp { appearance: none; cursor: pointer; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.fieldset { margin: 0; border: var(--line); border-radius: var(--r-card); background: var(--surface); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.fieldset legend { font-family: var(--font-display); font-size: 17px; font-weight: 700; padding: 0 6px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .lbl { font-size: 13px; font-weight: 700; }
.field label.section-title { font-size: 18px; }
.inp {
    height: 48px; width: 100%; padding: 0 14px; border-radius: var(--r-field); border: var(--line);
    background: var(--surface); font-size: 16px; color: var(--ink);
}
.inp.soft { background: var(--bg); }
textarea.inp { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.4; }
.inp-affix { position: relative; display: flex; align-items: center; }
.inp-affix .inp { padding-left: 28px; }
.inp-affix .affix { position: absolute; left: 14px; font-size: 16px; color: var(--muted); pointer-events: none; }
.inp-affix.suffix .inp { padding-left: 14px; padding-right: 44px; }
.inp-affix.suffix .affix { left: auto; right: 14px; }
.hint { font-size: 13px; color: var(--muted); }
.field-error { font-size: 13px; font-weight: 600; color: var(--danger); }
.inp.invalid { border-color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.seg { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 6px; background: var(--sand); padding: 4px; border-radius: 16px; }
.seg button { height: 40px; padding: 0 8px; white-space: nowrap; border-radius: 12px; border: 2px solid transparent; background: transparent; font-size: 14px; font-weight: 600; }
.seg button[aria-checked="true"] { border-color: var(--ink); background: var(--surface); font-weight: 700; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; }
.switch { position: relative; width: 52px; height: 32px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--sand); border: var(--line); transition: background .15s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 11px; background: var(--surface); border: var(--line); transition: transform .15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--sun); }
.switch input:focus-visible + span { outline: 3px solid var(--link); outline-offset: 2px; }
.toggle-chip { height: 40px; padding: 0 16px; white-space: nowrap; border-radius: 20px; border: var(--line); background: var(--surface); font-size: 14px; font-weight: 600; }
.toggle-chip[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; font-weight: 700; }
.label-chip { display: inline-flex; align-self: flex-start; height: 28px; padding: 0 12px; border-radius: 14px; border: var(--line); font-size: 13px; font-weight: 800; align-items: center; }
.alert { border: var(--line); border-radius: 16px; padding: 12px 14px; font-size: 14px; background: #FFE4DC; }

/* ---------- Tables / lists (runs, searches) ---------- */
.stack { display: flex; flex-direction: column; gap: 12px; }
.row-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.row-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.row-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; line-height: 1.2; }
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 12px; font-size: 12px; font-weight: 700; border: var(--line); white-space: nowrap; }
.pill-ok { background: var(--surface); }
.pill-fail { background: var(--tomato); }
.pill-run { background: var(--sun); }
.pill-off { background: var(--sand); border-color: transparent; }
.kv { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.kv b { color: var(--ink); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
    pointer-events: auto; width: 100%; max-width: 420px; background: var(--ink); color: #FFFFFF; border-radius: 16px;
    padding: 12px 12px 12px 16px; display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500;
    box-shadow: 4px 4px 0 var(--tomato); animation: toast-in .18s ease-out;
}
.toast-text { flex-grow: 1; min-width: 0; }
.toast button { height: 36px; padding: 0 16px; border-radius: 18px; border: 2px solid #FFFFFF; background: transparent; color: #FFFFFF; font-weight: 700; flex-shrink: 0; }
.toast.error { box-shadow: 4px 4px 0 var(--sun); }
@media (min-width: 1024px) { .toasts { bottom: 24px; left: auto; right: 24px; width: 420px; } }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Loading ---------- */
.skeleton { background: linear-gradient(90deg, var(--sand) 25%, var(--sand-2) 50%, var(--sand) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-card); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border: 3px solid var(--sand); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; padding: 28px 24px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- Blazor boot + error UI ---------- */
.boot { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.boot-mark { width: 56px; height: 56px; border-radius: 16px; background: var(--tomato); border: var(--line); animation: boot 1s ease-in-out infinite alternate; }
.boot-text { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.boot-text::after { content: var(--blazor-load-percentage-text, ""); margin-left: 6px; color: var(--muted); }
@keyframes boot { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
#blazor-error-ui {
    display: none; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100; background: var(--sun); border: var(--line);
    border-radius: 16px; padding: 12px 16px; font-weight: 600;
}
#blazor-error-ui .reload { margin-left: 8px; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }
