@import url("https://fonts.googleapis.com/css2?family=Onest:wght@400..700&family=DM+Mono:wght@400;500&display=swap");
/* ==========================================================================
   Midnight theme — modern dark SaaS.
   Near-black ground with a cool tint, low-contrast surfaces on 1px borders,
   one indigo-violet accent (#6B5CF5) and light primary buttons.
   Colors are RGB triplets without rgb() so opacity works: rgb(var(--x) / 0.5).
   Dark world: -50/-100/-200 are dark accent tints, -600 is the LIGHTER hover
   step and -700 is the lavender used for accent text (AA on every surface).
   ========================================================================== */
:root {
    --network-icon-color: e7e8ee; /* network icons (simpleicons) in one light tone for contrast */
    --brand-icon-color: #e7e8ee; /* network logos (own sprite) in one light tone for contrast */
    color-scheme: dark;

    /* Accent: indigo-violet #6B5CF5 (white text on it passes AA 4.7:1). */
    --color-primary-50: 25 23 50;
    --color-primary-100: 33 30 68;
    --color-primary-200: 64 57 138;
    --color-primary-500: 107 92 245;
    --color-primary-600: 124 110 248;
    --color-primary-700: 170 161 255;
    --color-primary-900: 214 210 255;
    --color-primary-fg: 255 255 255;

    /* Primary action: light button on the dark ground. */
    --color-action: 238 239 245;
    --color-action-hover: 255 255 255;
    --color-action-fg: 9 10 15;

    --color-sidebar: 11 12 17;
    --color-sidebar-fg: 238 239 245;

    --color-page: 8 9 13;
    --color-page-public: 8 9 13;
    --color-band: 11 12 17;

    --color-surface: 16 17 24;
    --color-surface-muted: 24 26 35;
    --color-field: 21 22 31;
    --color-border: 38 40 54;
    --color-border-soft: 28 30 41;
    --color-border-strong: 60 63 82;
    --color-text: 238 239 245;
    --color-text-2: 190 193 206;
    --color-text-soft: 148 152 170;
    --color-text-muted: 130 134 154;

    --color-success: 74 222 128;
    --color-success-bg: 14 38 28;
    --color-danger: 255 125 133;
    --color-danger-bg: 48 18 25;
    --color-warning: 246 192 84;
    --color-warning-bg: 44 34 14;

    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-control: 0.625rem;
    --radius-pill: 9999px;
    --hairline: inset 0 1px 0 rgb(255 255 255 / 0.04);
    --shadow-card: var(--hairline), 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-raised: var(--hairline), 0 0 0 1px rgb(var(--color-border)), 0 30px 60px -24px rgb(0 0 0 / 0.75);
    --shadow-control: none;
    --shadow-menu: 0 0 0 1px rgb(var(--color-border)), 0 18px 40px -12px rgb(0 0 0 / 0.7);
    --focus-ring: 0 0 0 3px rgb(var(--color-primary-500) / 0.35);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    --wrap: 74rem;
    --gutter: 1rem;
    --control-h: 2.75rem;
    --header-h: 3.5rem;
    --sidebar-w: 248px;

    --font-sans: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "DM Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
@media (min-width: 768px) { :root { --gutter: 1.5rem; --header-h: 4rem; } }
@media (min-width: 1024px) { :root { --gutter: 2.5rem; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%;
    scrollbar-color: rgb(var(--color-border)) rgb(var(--color-page));
    interpolate-size: allow-keywords;
}
body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: rgb(var(--color-page-public));
    color: rgb(var(--color-text));
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
body.app--auth {
    flex-direction: row;
    background: rgb(var(--color-page));
}
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
img { max-width: 100%; }
::selection { background: rgb(var(--color-primary-500) / 0.45); color: rgb(var(--color-text)); }
:focus-visible { outline: 2px solid rgb(var(--color-primary-600)); outline-offset: 2px; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(var(--color-border)); border: 3px solid rgb(var(--color-page)); border-radius: 12px; }
::-webkit-scrollbar-thumb:hover { background: rgb(var(--color-border-strong)); }

.hidden { display: none !important; }
[x-cloak] { display: none !important; }

.overlay {
    position: fixed;
    inset: 0;
    background: rgb(3 4 8 / 0.66);
    z-index: 30;
}
@media (min-width: 1024px) { .overlay { display: none; } }

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 40;
    width: var(--sidebar-w);
    max-width: 86vw;
    min-height: 100vh;
    background: rgb(var(--color-sidebar));
    border-inline-end: 1px solid rgb(var(--color-border-soft));
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.sidebar.is-open { transform: translateX(0); box-shadow: 0 12px 32px -12px rgb(0 0 0 / 0.628); }
@media (min-width: 1024px) { .sidebar { transform: translateX(0); } }

.sidebar-logo {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0 1.25rem;
    flex-shrink: 0;
    min-width: 0;
}
.sidebar-logo img { height: 1.75rem; max-width: 7rem; object-fit: contain; }
.sidebar-brand {
    font-size: 16px;
    font-weight: 600;
    color: rgb(var(--color-sidebar-fg));
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav {
    flex: 1;
    padding: 0.5rem 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0 0.625rem;
    border-radius: var(--radius-control);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    color: rgb(var(--color-text-soft));
    transition: background-color 0.15s, color 0.15s;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: start;
}
@media (min-width: 1024px) { .nav-link { min-height: 2.375rem; font-size: 14px; } }
.nav-link:hover { color: rgb(var(--color-text)); background: rgb(255 255 255 / 0.04); }
.nav-link.is-active { color: rgb(var(--color-text)); background: rgb(255 255 255 / 0.07); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.05); }
.nav-link svg, .nav-link i { width: 1.25rem; height: 1.25rem; flex-shrink: 0; color: rgb(var(--color-text-muted)); transition: color 0.15s; }
.nav-link i { display: inline-grid; place-items: center; font-size: 1rem; }
.nav-link:hover svg, .nav-link:hover i { color: rgb(var(--color-text-2)); }
.nav-link.is-active svg, .nav-link.is-active i { color: rgb(var(--color-primary-700)); }

.sidebar-logout { padding: 0.75rem; border-top: 1px solid rgb(var(--color-border-soft)); flex-shrink: 0; }
@media (min-width: 1024px) { .sidebar-logout { display: none; } }

.nav-badge {
    margin-inline-start: auto;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    border-radius: var(--radius-pill);
    background: rgb(var(--color-primary-500));
    color: rgb(var(--color-primary-fg));
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ---------- Main column ---------- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
@media (min-width: 1024px) {
    body.app--auth .main-wrapper { margin-inline-start: var(--sidebar-w); }
}

/* ---------- Headers ---------- */
.header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgb(var(--color-page) / 0.72);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid rgb(var(--color-border-soft));
}
.header--auth {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding-block: 0; padding-inline: 0.375rem 0.5rem;
}
@media (min-width: 768px) { .header--auth { padding: 0 var(--gutter); gap: 0.5rem; } }
.header--public { width: 100%; }
.header-inner {
    max-width: calc(var(--wrap) + 2 * var(--gutter));
    margin: 0 auto;
    width: 100%;
    height: var(--header-h);
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.header-inner > .row { min-width: 0; gap: 0.25rem; }
.header-actions { display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; }
@media (min-width: 768px) { .header-actions { gap: 0.5rem; } }
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    min-height: 2.75rem;
    margin-inline-end: 0.5rem;
    font-weight: 600;
    font-size: 17px;
    color: rgb(var(--color-text));
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
}
.header-brand img { height: 1.75rem; max-width: 7rem; object-fit: contain; }

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgb(var(--color-text));
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    border-radius: var(--radius-control);
    transition: background-color 0.15s;
    padding: 0;
}
.icon-btn:hover { background: rgb(var(--color-surface-muted)); }
.icon-btn svg { width: 1.375rem; height: 1.375rem; }
@media (min-width: 1024px) { .icon-btn--mobile { display: none; } }

/* Store name next to the menu button on phones/tablets. */
.header-mobile-brand {
    display: block;
    min-width: 0;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (min-width: 1024px) { .header-mobile-brand { display: none; } }

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 2.75rem;
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    color: rgb(var(--color-text-2));
    padding: 0 0.5rem;
    border-radius: var(--radius-control);
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
@media (min-width: 768px) {
    .header-btn { height: 2.25rem; padding: 0 0.75rem; border-color: rgb(var(--color-border)); background: rgb(var(--color-surface)); }
}
.header-btn:hover, .header-btn.is-active { color: rgb(var(--color-text)); border-color: rgb(var(--color-border-strong)); background: rgb(var(--color-surface)); }
.header-btn svg { width: 1.125rem; height: 1.125rem; color: rgb(var(--color-text-muted)); flex-shrink: 0; }
.header-btn--balance {
    height: 2.5rem;
    padding-block: 0; padding-inline: 0.625rem 0.75rem;
    border-radius: var(--radius-pill);
    border-color: rgb(var(--color-border));
    background: rgb(var(--color-surface));
    color: rgb(var(--color-text));
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
@media (min-width: 768px) { .header-btn--balance { height: 2.25rem; padding-block: 0; padding-inline: 0.75rem 0.875rem; border-radius: var(--radius-pill); } }
.header-btn--balance svg { color: rgb(var(--color-primary-700)); }
.header-btn--balance:hover { color: rgb(var(--color-text)); }
.header-btn--logout:hover { color: rgb(var(--color-danger)); border-color: rgb(var(--color-danger) / 0.35); background: rgb(var(--color-danger-bg)); }
.header-btn--logout:hover svg { color: rgb(var(--color-danger)); }
/* Phones: language and account show only their icon, currency only its code. */
@media (max-width: 559px) {
    .header-btn--lang { width: 2.75rem; justify-content: center; padding: 0; }
    .header-btn--lang span { display: none; }
    .header-btn--account { width: 2.75rem; justify-content: center; padding: 0; }
    .header-btn--account span { display: none; }
    .header-btn--currency { padding: 0 0.375rem; }
    .header-btn--currency svg { display: none; }
}
.desktop-only { display: none; }
@media (min-width: 1024px) { .desktop-only { display: flex; } }

/* Public navigation */
.pubnav { display: none; align-items: center; gap: 0.25rem; flex: 1; font-size: 14px; font-weight: 500; }
@media (min-width: 768px) { .pubnav { display: flex; } }
.pubnav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 2.25rem;
    padding: 0 0.75rem;
    border-radius: var(--radius-control);
    border: 1px solid transparent;
    color: rgb(var(--color-text-2));
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.pubnav-link:hover { color: rgb(var(--color-text)); background: rgb(var(--color-surface-muted)); }
.pubnav .pubnav-link--signin { order: 10; margin-inline-start: auto; border-color: rgb(var(--color-border)); color: rgb(var(--color-text)); }
.pubnav .pubnav-link--signin:hover { border-color: rgb(var(--color-border-strong)); background: rgb(var(--color-surface)); }
.pubnav .pubnav-link--cta { order: 11; margin-inline-start: 0.25rem; background: rgb(var(--color-action)); color: rgb(var(--color-action-fg)); font-weight: 600; }
.pubnav .pubnav-link--cta:hover { background: rgb(var(--color-action-hover)); color: rgb(var(--color-action-fg)); }
.menu-btn { display: inline-grid; margin-inline-end: -0.5rem; }
@media (min-width: 768px) { .menu-btn { display: none; } }

.pubmenu-mobile {
    border-top: 1px solid rgb(var(--color-border-soft));
    background: rgb(var(--color-surface));
    padding: 0.5rem var(--gutter) 0.75rem;
    position: relative;
    z-index: 50;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 24px -16px rgb(0 0 0 / 0.625);
}
@media (min-width: 768px) { .pubmenu-mobile { display: none; } }
.pubmenu-mobile a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0 0.5rem;
    border-radius: var(--radius-control);
    font-size: 16px;
    font-weight: 500;
    color: rgb(var(--color-text-2));
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}
.pubmenu-mobile a:hover { color: rgb(var(--color-text)); background: rgb(var(--color-surface-muted)); }
.pubmenu-mobile .pubnav-link--cta {
    order: 20;
    margin-top: 0.5rem;
    justify-content: center;
    background: rgb(var(--color-action));
    color: rgb(var(--color-action-fg));
}
.pubmenu-mobile .pubnav-link--cta:hover { background: rgb(var(--color-action-hover)); color: rgb(var(--color-action-fg)); }

/* ---------- Dropdowns ---------- */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    margin-top: 0.375rem;
    background: rgb(var(--color-surface));
    border-radius: var(--radius);
    box-shadow: var(--shadow-menu);
    padding: 0.375rem;
    min-width: 9rem;
    max-height: 20rem;
    overflow-y: auto;
    z-index: 50;
}
.dropdown-menu--right { inset-inline-end: 0; }
.dropdown-menu--left { inset-inline-start: 0; }
.header--auth .dropdown-menu { inset-inline-end: 0; }
.header--public .dropdown-menu { inset-inline-start: 0; }
.dropdown-menu--full { inset-inline-start: 0; inset-inline-end: 0; width: 100%; max-height: 18rem; overflow-y: auto; }
.dropdown-item {
    display: block;
    width: 100%;
    text-align: start;
    min-height: 2.5rem;
    padding: 0.5625rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 14px;
    line-height: 1.4;
    color: rgb(var(--color-text-2));
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}
.dropdown-item:hover { color: rgb(var(--color-text)); background: rgb(var(--color-surface-muted)); }
.dropdown-item.is-selected { background: rgb(var(--color-primary-50)); color: rgb(var(--color-primary-700)); }
.dropdown-item.is-selected .cell-id { color: rgb(var(--color-primary-700)); }

/* ---------- Content ---------- */
.main {
    flex: 1;
    padding: 0.75rem var(--gutter) 2rem;
    overflow-x: clip;
}
body.app--auth .main { padding-top: 1.5rem; }
@media (max-width: 559px) {
    body.app--auth .main { padding: 0.5rem 0.5rem calc(1rem + env(safe-area-inset-bottom)); }
}
.container { max-width: var(--wrap); margin: 0 auto; width: 100%; }
/* #content dims instantly while the next page loads. */
#content { transition: opacity 0.12s; }
#content.htmx-request { opacity: 0.55; }
body.app--auth .container { max-width: 88rem; }

.footer {
    flex-shrink: 0;
    border-top: 1px solid rgb(var(--color-border-soft));
    padding: 1.25rem var(--gutter);
    font-size: 13px;
    color: rgb(var(--color-text-soft));
    text-align: center;
}

/* ---------- Floating chat buttons ---------- */
.chat-fab-stack {
    position: fixed;
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    z-index: 50;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 0.75rem;
}
.chat-fab-stack--left { left: 1.25rem; }
.chat-fab-stack--right { right: 1.25rem; }
.chat-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: var(--radius-pill);
    color: #fff;
    box-shadow: 0 6px 16px -4px rgb(0 0 0 / 0.63);
    transition: transform 0.2s var(--ease), filter 0.15s;
}
.chat-fab:hover { filter: brightness(1.06); transform: translateY(-1px); }
.chat-fab--whatsapp { background: #1fa855; }
.chat-fab--telegram { background: #229ed9; }
.chat-fab--whatsapp svg { width: 1.625rem; height: 1.625rem; }
.chat-fab--telegram svg { width: 2rem; height: 2rem; }

/* ---------- Cards ---------- */
.card {
    background: rgb(var(--color-surface));
    border-radius: var(--radius);
    border: 1px solid rgb(var(--color-border-soft));
    box-shadow: var(--shadow-card);
}
.card--pad { padding: 1rem; }
@media (min-width: 768px) { .card--pad { padding: 1.5rem; } }
.card-title { margin: 0 0 1rem; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: rgb(var(--color-text)); }

/* ---------- Forms ---------- */
.label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgb(var(--color-text-2));
    margin-bottom: 0.375rem;
}
.input, .select, .textarea, .select-trigger {
    width: 100%;
    min-height: var(--control-h);
    border: 1px solid rgb(var(--color-border));
    border-radius: var(--radius-control);
    background: rgb(var(--color-field));
    padding: 0.625rem 0.75rem;
    font-size: 16px;
    line-height: 1.4;
    color: rgb(var(--color-text));
    caret-color: rgb(var(--color-primary-500));
    box-shadow: var(--shadow-control);
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
@media (min-width: 768px) { .input, .select, .textarea, .select-trigger { font-size: 15px; } }
.input::placeholder, .textarea::placeholder { color: rgb(var(--color-text-muted)); }
.input:hover, .select:hover, .textarea:hover, .select-trigger:hover { border-color: rgb(var(--color-border-strong)); }
.input:focus, .select:focus, .textarea:focus, .select-trigger:focus {
    outline: none;
    border-color: rgb(var(--color-primary-500));
    box-shadow: var(--focus-ring);
}
.input:user-invalid, .textarea:user-invalid { border-color: rgb(var(--color-danger)); }
.select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    text-align: start;
    cursor: pointer;
}
.select-trigger > span:first-child {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.5rem;
}
.select-trigger .trigger-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-trigger img { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }
.select-trigger .chevron { width: 1.125rem; height: 1.125rem; flex-shrink: 0; color: rgb(var(--color-text-muted)); transition: transform 0.2s var(--ease); }
.select-trigger .chevron.is-open { transform: rotate(180deg); }

.search-left { position: relative; }
.search-left > svg {
    position: absolute; inset-inline-start: 0.875rem; top: 50%; transform: translateY(-50%);
    width: 1.125rem; height: 1.125rem; color: rgb(var(--color-text-muted)); pointer-events: none;
}
.search-left .input { padding-inline-start: 2.5rem; }
.input:disabled, .select:disabled, .textarea:disabled {
    background: rgb(var(--color-page));
    border-color: rgb(var(--color-border-soft));
    color: rgb(var(--color-text-soft));
    cursor: not-allowed;
}
.textarea { resize: vertical; min-height: 6rem; }
/* Native arrow on purpose; base-select (Chrome/Edge) keeps our border/padding/font. */
.select {
    cursor: pointer;
    appearance: auto;
    appearance: base-select;
}
@supports (appearance: base-select) {
    .select::picker-icon {
        content: "";
        width: 1.125rem;
        height: 1.125rem;
        background: rgb(var(--color-text-muted));
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.17l3.71-3.94a.75.75 0 1 1 1.08 1.04l-4.25 4.5a.75.75 0 0 1-1.08 0l-4.25-4.5a.75.75 0 0 1 .02-1.06z'/%3E%3C/svg%3E") center / contain no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.17l3.71-3.94a.75.75 0 1 1 1.08 1.04l-4.25 4.5a.75.75 0 0 1-1.08 0l-4.25-4.5a.75.75 0 0 1 .02-1.06z'/%3E%3C/svg%3E") center / contain no-repeat;
        transition: rotate 0.2s var(--ease);
    }
    .select:open::picker-icon { rotate: 180deg; }
    .select::picker(select) {
        appearance: base-select;
        border: 0;
        border-radius: var(--radius);
        box-shadow: var(--shadow-menu);
        background: rgb(var(--color-surface));
        padding: 0.375rem;
        margin-top: 0.375rem;
    }
    .select option {
        min-height: 2.5rem;
        padding: 0.5rem 0.625rem;
        border-radius: 0.375rem;
        font-size: 14px;
        color: rgb(var(--color-text-2));
    }
    .select option:hover { background: rgb(var(--color-surface-muted)); color: rgb(var(--color-text)); }
    .select option:checked { background: rgb(var(--color-primary-50)); color: rgb(var(--color-primary-700)); }
    .select option::checkmark { color: rgb(var(--color-primary-700)); }
}
.checkbox {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    margin: 0;
    border-radius: 0.25rem;
    border: 1px solid rgb(var(--color-border));
    accent-color: rgb(var(--color-primary-500));
    cursor: pointer;
}
.field { margin-bottom: 0; }
.help { margin: 0.375rem 0 0; font-size: 13px; color: rgb(var(--color-text-soft)); font-variant-numeric: tabular-nums; }
.error-text { font-size: 13px; color: rgb(var(--color-danger)); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.form-grid--wide { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-actions { grid-column: 1 / -1; padding-top: 0.25rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: var(--control-h);
    padding: 0 1.125rem;
    border-radius: var(--radius-control);
    border: 1px solid transparent;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.2s, transform 0.2s var(--ease);
}
@media (min-width: 768px) { .btn { min-height: 2.5rem; font-size: 14px; } }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--block { width: 100%; min-height: var(--control-h); font-size: 15px; }
.btn--sm { min-height: 2.25rem; padding: 0 0.75rem; font-size: 13px; }
.btn--primary {
    background: rgb(var(--color-action));
    color: rgb(var(--color-action-fg));
    font-weight: 600;
    box-shadow: inset 0 -1px 0 rgb(0 0 0 / 0.12);
}
.btn--primary:hover:not(:disabled) { background: rgb(var(--color-action-hover)); transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgb(var(--color-primary-500) / 0.55); }
.btn--primary:active:not(:disabled) { background: rgb(214 216 226); transform: none; box-shadow: none; }
.btn--primary:disabled { opacity: 1; background: rgb(var(--color-surface-muted)); color: rgb(var(--color-text-soft)); box-shadow: inset 0 0 0 1px rgb(var(--color-border)); }
.btn--outline {
    background: rgb(var(--color-surface));
    color: rgb(var(--color-text));
    border-color: rgb(var(--color-border));
    box-shadow: var(--shadow-control);
}
.btn--outline:hover:not(:disabled) { border-color: rgb(var(--color-border-strong)); background: rgb(var(--color-surface-muted)); }
.btn--icon { padding: 0; width: var(--control-h); gap: 0; }
.btn--icon svg { width: 1.125rem; height: 1.125rem; }
.btn--xs { min-height: 1.75rem; padding: 0 0.5rem; font-size: 12px; border-radius: 0.375rem; }
.btn--success {
    background: rgb(var(--color-success-bg)); color: rgb(var(--color-success)); border-color: rgb(var(--color-success) / 0.3);
}
.btn--success:hover:not(:disabled) { background: rgb(var(--color-success) / 0.12); }
.btn--danger {
    background: rgb(var(--color-danger-bg)); color: rgb(var(--color-danger)); border-color: rgb(var(--color-danger) / 0.28);
}
.btn--danger:hover:not(:disabled) { background: rgb(var(--color-danger) / 0.1); }

.link {
    font: inherit;
    font-weight: 500;
    color: rgb(var(--color-primary-700));
    text-decoration: none;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}
.link:hover { text-decoration: underline; }

/* ---------- Chips (network filter) ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 0.75rem;
    flex-shrink: 0;
    border-radius: var(--radius-control);
    border: 1px solid rgb(var(--color-border));
    background: rgb(var(--color-surface));
    color: rgb(var(--color-text-2));
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
@media (min-width: 1024px) { .chip { height: 2.25rem; } }
.chip:hover { border-color: rgb(var(--color-border-strong)); background: rgb(var(--color-surface-muted)); color: rgb(var(--color-text)); }
.chip img, .chip svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }
.chip svg { color: rgb(var(--color-text-soft)); }
.chip.is-active {
    border-color: rgb(var(--color-primary-500) / 0.75);
    background: rgb(var(--color-primary-50));
    color: rgb(var(--color-primary-900));
    box-shadow: 0 0 0 3px rgb(var(--color-primary-500) / 0.14);
}
.chip.is-active svg { color: rgb(var(--color-primary-700)); }

/* ---------- Read-only values ---------- */
.readout {
    width: 100%;
    min-height: var(--control-h);
    border: 1px solid rgb(var(--color-border-soft));
    border-radius: var(--radius-control);
    background: rgb(var(--color-page));
    padding: 0.625rem 0.75rem;
    font-size: 15px;
    line-height: 1.55;
    color: rgb(var(--color-text-2));
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.readout--value { color: rgb(var(--color-text)); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Rich HTML content: block content, not pre-line. */
.readout--rich { white-space: normal; line-height: 1.55; }
.readout--rich > :first-child { margin-top: 0; }
.readout--rich > :last-child { margin-bottom: 0; }
.readout--rich p, .readout--rich ul, .readout--rich ol, .readout--rich table { margin: 0 0 0.6em; }
.readout--rich ul, .readout--rich ol { padding-inline-start: 1.25rem; }
.readout--rich ul { list-style: disc; }
.readout--rich ol { list-style: decimal; }
.readout--rich h1, .readout--rich h2, .readout--rich h3, .readout--rich h4 {
    margin: 0.6em 0 0.3em; font-weight: 600; color: rgb(var(--color-text)); font-size: 1em;
}
.readout--rich a { color: rgb(var(--color-primary-700)); text-decoration: underline; text-underline-offset: 3px; }
.readout--rich strong { color: rgb(var(--color-text)); }
.readout--rich code {
    font-family: var(--font-mono); font-size: 0.875em;
    padding: 0.1em 0.35em; border-radius: 4px;
    background: rgb(var(--color-surface)); border: 1px solid rgb(var(--color-border-soft));
    color: rgb(var(--color-text)); user-select: all;
}
.readout--rich img { max-width: 100%; height: auto; border-radius: var(--radius-control); display: block; margin: 0.5em 0; }
.readout--rich video, .readout--rich iframe {
    display: block; max-width: 100%; width: 100%; aspect-ratio: 16 / 9; height: auto;
    border: 0; border-radius: var(--radius-control); margin: 0.5em 0; background: #000;
}
.readout--rich table { border-collapse: collapse; width: 100%; font-size: 0.9em; }
.readout--rich th, .readout--rich td { border: 1px solid rgb(var(--color-border-soft)); padding: 0.35em 0.5em; text-align: start; }
.readout--rich th { background: rgb(var(--color-surface)); color: rgb(var(--color-text)); }

/* ---------- Search with button ---------- */
.search { position: relative; width: 100%; }
@media (min-width: 640px) { .search { width: 20rem; } }
.search .input { padding-inline-end: 3.25rem; }
.search-btn {
    position: absolute;
    top: 4px;
    bottom: 4px;
    inset-inline-end: 4px;
    display: grid;
    place-items: center;
    width: 2.375rem;
    padding: 0;
    border: none;
    border-radius: 0.375rem;
    background: rgb(var(--color-action));
    color: rgb(var(--color-action-fg));
    cursor: pointer;
    transition: background-color 0.15s;
}
.search-btn:hover { background: rgb(var(--color-action-hover)); }
.search-btn svg { width: 1.125rem; height: 1.125rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; overscroll-behavior-x: contain; }
.table { width: 100%; text-align: start; font-size: 14px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: start; } /* th centra por defecto si hereda "start" */
.table thead tr { border-bottom: 1px solid rgb(var(--color-border-soft)); }
.table th {
    padding: 0.625rem 0.875rem;
    font-size: 12.5px;
    font-weight: 500;
    color: rgb(var(--color-text-soft));
    white-space: nowrap;
    background: rgb(var(--color-surface-muted) / 0.55);
}
.table td { padding: 0.75rem 0.875rem; vertical-align: top; color: rgb(var(--color-text-2)); }
.table tbody tr { border-top: 1px solid rgb(var(--color-border-soft)); transition: background-color 0.1s; }
.table tbody tr:first-child { border-top: 0; }
.table tbody tr:hover { background: rgb(255 255 255 / 0.025); }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
.table .cell-trunc {
    display: inline-block;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
.table-empty { padding: 2.5rem 1rem; text-align: center; font-size: 14px; color: rgb(var(--color-text-soft)); }
.table tbody tr.row--attention { background: rgb(var(--color-primary-50)); }
.table tbody tr.row--attention:hover { background: rgb(var(--color-primary-100)); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 1.5rem;
    border-radius: var(--radius-pill);
    padding: 0 0.5625rem;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    background: rgb(148 163 184 / 0.12);
    color: rgb(190 197 212);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge--pending     { background: rgb(var(--color-warning-bg)); color: rgb(var(--color-warning)); }
.badge--processing  { background: rgb(var(--color-primary-50)); color: rgb(var(--color-primary-700)); }
.badge--in-progress { background: rgb(56 189 248 / 0.12); color: rgb(125 211 252); }
.badge--completed   { background: rgb(var(--color-success-bg)); color: rgb(var(--color-success)); }
.badge--partial     { background: rgb(251 146 60 / 0.13); color: rgb(253 186 116); }
.badge--canceled    { background: rgb(148 163 184 / 0.12); color: rgb(190 197 212); }
.badge--rejected    { background: rgb(var(--color-danger-bg)); color: rgb(var(--color-danger)); }
.badge--answered    { background: rgb(var(--color-primary-50)); color: rgb(var(--color-primary-700)); }
.badge--closed      { background: rgb(148 163 184 / 0.12); color: rgb(190 197 212); }
.badge--welcome     { background: rgb(192 132 252 / 0.13); color: rgb(216 180 254); }
.badge--neutral     { background: rgb(148 163 184 / 0.12); color: rgb(190 197 212); }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 14px;
    color: rgb(var(--color-text-soft));
    font-variant-numeric: tabular-nums;
}
.pagination-nav { display: flex; align-items: center; gap: 0.5rem; }
.page-btn {
    display: inline-grid;
    place-items: center;
    width: var(--control-h);
    height: var(--control-h);
    border: 1px solid rgb(var(--color-border));
    border-radius: var(--radius-control);
    background: rgb(var(--color-surface));
    /* Buttons do not inherit color: without this the arrows vanish on dark surfaces. */
    color: rgb(var(--color-text-2));
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    box-shadow: var(--shadow-control);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
@media (min-width: 768px) { .page-btn { width: 2.25rem; height: 2.25rem; } }
.page-btn:hover:not(:disabled) { border-color: rgb(var(--color-border-strong)); color: rgb(var(--color-text)); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Loading ---------- */
@keyframes pulse { 50% { opacity: 0.55; } }
.skeleton { background: rgb(var(--color-surface-muted)); border-radius: var(--radius-control); animation: pulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.skeleton-line { height: var(--control-h); }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 1.125rem; height: 1.125rem; animation: spin 0.8s linear infinite; vertical-align: middle; }

/* ---------- Modal (bottom sheet on phones) ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: rgb(3 4 8 / 0.7);
}
.modal-box {
    position: relative;
    width: 100%;
    max-width: 32rem;
    background: rgb(var(--color-surface));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-menu);
    padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
    max-height: 88vh;
    max-height: 88dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
}
@media (min-width: 640px) {
    .modal-backdrop { align-items: center; padding: 1.5rem; }
    .modal-box { border-radius: var(--radius-lg); padding: 1.5rem; max-height: 80vh; }
}
.modal-close {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    margin-block: -0.5rem; margin-inline: 0 -0.5rem;
    flex-shrink: 0;
    background: none;
    border: none;
    border-radius: var(--radius-control);
    cursor: pointer;
    color: rgb(var(--color-text-muted));
    font-size: 1.375rem;
    line-height: 1;
    transition: background-color 0.15s, color 0.15s;
}
.modal-close:hover { color: rgb(var(--color-text)); background: rgb(var(--color-surface-muted)); }

/* ---------- Alerts & toast ---------- */
.alert {
    border-radius: var(--radius-control);
    padding: 0.625rem 0.875rem;
    font-size: 14px;
    line-height: 1.5;
}
.alert--warning { border: 1px solid rgb(var(--color-warning) / 0.3); background: rgb(var(--color-warning-bg)); color: rgb(var(--color-warning)); }

.toast {
    position: fixed;
    top: calc(0.75rem + env(safe-area-inset-top));
    inset-inline-start: 0.75rem;
    inset-inline-end: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    box-shadow: 0 12px 32px -8px rgb(0 0 0 / 0.635);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    z-index: 60;
    color: #fff;
    transition: opacity 0.3s;
}
@media (min-width: 640px) { .toast { inset-inline-start: auto; inset-inline-end: 1.5rem; top: 1.5rem; max-width: 26rem; } }
.toast--ok { background: rgb(var(--color-surface-muted)); color: rgb(var(--color-text)); box-shadow: 0 0 0 1px rgb(var(--color-border-strong)), 0 18px 40px -12px rgb(0 0 0 / 0.75); }
.toast--error { background: rgb(var(--color-danger-bg)); color: rgb(var(--color-danger)); box-shadow: 0 0 0 1px rgb(var(--color-danger) / 0.35), 0 18px 40px -12px rgb(0 0 0 / 0.75); }

/* ---------- Auth pages (signup, reset, verify) ---------- */
.auth-page { display: flex; align-items: flex-start; justify-content: center; padding: 1rem 0 2rem; }
.auth-box { width: 100%; max-width: 420px; }
.auth-card { padding: 1.25rem 1rem; border-radius: var(--radius-lg); border: 0; box-shadow: var(--shadow-raised); }
@media (min-width: 560px) { .auth-card { padding: 2rem; } }
.auth-title { margin: 0 0 1rem; font-size: 21px; line-height: 1.25; font-weight: 600; letter-spacing: -0.025em; color: rgb(var(--color-text)); }
.auth-alt { margin: 0; text-align: center; font-size: 15px; color: rgb(var(--color-text-soft)); padding-top: 0.25rem; }
.auth-alt .link { display: inline-block; padding: 0.625rem 0.125rem; margin: -0.625rem 0; }
.auth-hint { text-align: center; font-size: 14px; color: rgb(var(--color-text-soft)); }
@media (min-width: 768px) {
    .auth-page { align-items: center; padding: 2rem 0; min-height: 70vh; }
}

/* ---------- Money boxes, receipts, code ---------- */
.amount-box {
    text-align: center;
    border-radius: var(--radius-control);
    background: rgb(var(--color-primary-50));
    border: 1px solid rgb(var(--color-primary-200));
    padding: 0.75rem;
    margin-bottom: 1rem;
}
.amount-box--copy { cursor: pointer; transition: border-color 0.15s; }
.amount-box--copy:hover { border-color: rgb(var(--color-primary-500)); }
.amount-box-label {
    font-size: 13px;
    font-weight: 500;
    color: rgb(var(--color-primary-700));
    margin-bottom: 0.125rem;
}
.amount-box-value { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; color: rgb(var(--color-primary-900)); font-variant-numeric: tabular-nums; }

.eyebrow {
    font-size: 13px;
    font-weight: 500;
    color: rgb(var(--color-text-soft));
}

.code-chip {
    border-radius: 0.375rem;
    background: rgb(var(--color-surface-muted));
    padding: 0.125rem 0.375rem;
    font-family: var(--font-mono);
    font-size: 13px;
    color: rgb(var(--color-text));
}

.code-block {
    background: rgb(var(--color-page));
    color: rgb(var(--color-text-2));
    padding: 0.875rem 1rem;
    border-radius: var(--radius-control);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.65;
    border: 1px solid rgb(var(--color-border-soft));
}
/* --dark is the request variant (light despite the name). */
.code-block--dark { background: rgb(var(--color-surface)); color: rgb(var(--color-text)); }

.receipt {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-control);
    background: rgb(var(--color-success-bg));
    border: 1px solid rgb(var(--color-success) / 0.25);
    font-size: 14px;
}
.receipt-title { margin: 0; font-weight: 600; color: rgb(var(--color-success)); }
.receipt-rows { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.25rem; color: rgb(var(--color-text-2)); overflow-wrap: anywhere; }
.receipt-rows span { font-variant-numeric: tabular-nums; color: rgb(var(--color-text)); font-weight: 500; }

/* ---------- Layout helpers ---------- */
/* Alpine <template> siblings are skipped so the first visible child never gets a top gap. */
.stack > :not(template) ~ :not(template) { margin-top: 1rem; }
.form-stack > :not(template) ~ :not(template) { margin-top: 1rem; }
.stack-sm > :not(template) ~ :not(template) { margin-top: 0.5rem; }
.stack-lg > :not(template) ~ :not(template) { margin-top: 1.25rem; }
@media (min-width: 768px) { .stack-lg > :not(template) ~ :not(template) { margin-top: 1.5rem; } }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.375rem; }
.row { display: flex; align-items: center; gap: 0.5rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.grow { flex: 1; }
.muted { color: rgb(var(--color-text-soft)); }
.strong { font-weight: 600; color: rgb(var(--color-text)); }
.center { text-align: center; }
.mono { font-family: var(--font-mono); }
/* Every entity id renders with .cell-id; pair with .muted (plain) or .link (clickable). */
.cell-id {
    font-family: var(--font-mono);
    font-size: 12.5px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.dim { color: rgb(var(--color-text-muted)); }
.nowrap { white-space: nowrap; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 13px; }
.text-2xs { font-size: 12px; }
.row-wrap { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ==========================================================================
   New order (mobile-first)
   ========================================================================== */
.order-card { max-width: 48rem; margin-inline: auto; }
@media (min-width: 768px) { .order-card.card--pad { padding: 1.75rem 2rem 2rem; } }
@media (max-width: 1023px) {
    /* One swipeable row of icon-only chips. */
    .chip-row {
        flex-wrap: nowrap;
        gap: 0.375rem;
        overflow-x: auto;
        margin-inline: -1rem;
        padding-inline: 1rem;
        scrollbar-width: none;
        overscroll-behavior-x: contain;
        scroll-padding-inline: 1rem;
    }
    .chip-row::-webkit-scrollbar { display: none; }
    .chip-row .chip { padding: 0; width: 2.75rem; }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .chip-row { margin-inline: -1.5rem; padding-inline: 1.5rem; }
    .order-card .chip-row { margin-inline: -2rem; padding-inline: 2rem; }
}
@media (max-width: 559px) {
    .order-card.card--pad { padding: 0.875rem 0.875rem 1rem; }
    .order-card.stack-lg > :not(template) ~ :not(template) { margin-top: 0.875rem; }
    .order-card .chip-row { margin-inline: -0.875rem; padding-inline: 0.875rem; }
    .order-card .label { font-size: 13px; margin-bottom: 0.25rem; }
    /* The same submit button, pinned to the bottom of the viewport. */
    .order-submit {
        position: sticky;
        bottom: calc(0.5rem + env(safe-area-inset-bottom));
        z-index: 5;
        min-height: 3rem;
        font-size: 16px;
        box-shadow: 0 6px 16px -4px rgb(0 0 0 / 0.628);
    }
    .order-submit:disabled { opacity: 1; background: rgb(var(--color-surface-muted)); color: rgb(var(--color-text-soft)); box-shadow: 0 0 0 1px rgb(var(--color-border)), 0 6px 16px -4px rgb(0 0 0 / 0.6); }
}

/* ==========================================================================
   Landing (public home: hero + login, then sections)
   ========================================================================== */
.landing { font-size: 16px; line-height: 1.55; }
.landing :where(h1, h2, h3) { margin: 0; font-weight: 600; color: rgb(var(--color-text)); }
.landing :where(p) { margin: 0; }

/* The public header floats over the hero glow. */
body:not(.app--auth) .header--public { background: rgb(var(--color-page) / 0.55); border-bottom-color: rgb(255 255 255 / 0.06); }

/* Full-bleed backgrounds without changing the content column. */
.lp-band { position: relative; isolation: isolate; }
.lp-band::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: calc(50% - 50vw);
    inset-inline-end: calc(50% - 50vw);
    z-index: -1;
    background: rgb(var(--color-band));
    border-block: 1px solid rgb(var(--color-border-soft));
}

/* Hero: one soft indigo glow, reaching up under the translucent header. */
.hero { position: relative; isolation: isolate; padding: 1rem 0 2rem; }
.hero::before {
    content: "";
    position: absolute;
    top: calc(-1 * var(--header-h) - 0.75rem);
    bottom: 0;
    inset-inline-start: calc(50% - 50vw);
    inset-inline-end: calc(50% - 50vw);
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60% 52% at 50% 0%, rgb(var(--color-primary-500) / 0.34), transparent 72%),
        radial-gradient(34% 30% at 78% 18%, rgb(139 92 246 / 0.14), transparent 70%);
}
/* A hairline horizon closes the hero, fading out at both edges. */
.hero::after {
    content: "";
    position: absolute;
    inset-inline-start: calc(50% - 50vw);
    inset-inline-end: calc(50% - 50vw);
    bottom: 0;
    height: 1px;
    z-index: -1;
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.12) 30%, rgb(255 255 255 / 0.12) 70%, transparent);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: center; }
.hero-title {
    font-size: 2.25rem;
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -0.04em;
    max-width: 16ch;
}
.hero-title em { font-style: normal; color: rgb(var(--color-primary-700)); }
.hero-lede { margin-top: 0.625rem; font-size: 16px; color: rgb(var(--color-text-soft)); max-width: 38ch; line-height: 1.5; }
.hero-login { width: 100%; max-width: 460px; }
.hero-login .auth-card {
    padding: 1.125rem 1rem 1rem;
    background: rgb(var(--color-surface));
    box-shadow: var(--shadow-raised);
}
.hero-login .auth-title { font-size: 19px; margin-bottom: 0.875rem; }
.hero-login .form-stack > :not(template) ~ :not(template) { margin-top: 0.75rem; }
.hero-login .link.text-xs { display: inline-block; padding: 0.625rem 0; margin: -0.625rem 0; font-size: 13px; }

/* Sections */
.lp-section { padding: 3.5rem 0; }
.lp-head h2 { font-size: 1.75rem; line-height: 1.08; font-weight: 650; letter-spacing: -0.035em; }
.lp-head p { margin-top: 0.625rem; font-size: 15px; color: rgb(var(--color-text-soft)); max-width: 46ch; }

/* Reasons: bento grid of tiles */
.lp-reasons { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.lp-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
.lp-reason {
    position: relative;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 0.875rem;
    align-items: start;
    padding: 1.125rem;
    border-radius: var(--radius-lg);
    background: rgb(var(--color-surface));
    border: 1px solid rgb(var(--color-border-soft));
    box-shadow: var(--hairline);
    transition: border-color 0.2s, transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.lp-ico { grid-row: span 2; display: block; padding-top: 0.125rem; color: rgb(var(--color-primary-700)); }
.lp-ico svg { display: block; width: 24px; height: 24px; }
.lp-reason h3 { font-size: 16px; letter-spacing: -0.015em; margin: 0.125rem 0 0.25rem; }
.lp-reason p { color: rgb(var(--color-text-soft)); font-size: 15px; line-height: 1.55; }

/* Steps: minimal connected timeline */
.lp-steps {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    max-width: 520px;
    position: relative;
    --fill: 0%;
}
.lp-steps.is-on { --fill: 100%; }
.lp-steps::before {
    content: "";
    position: absolute;
    top: 16px;
    bottom: 36px;
    inset-inline-start: 15.5px;
    width: 1px;
    background: linear-gradient(180deg, rgb(var(--color-primary-500)) 0 0) top / 100% var(--fill) no-repeat, rgb(var(--color-border));
    transition: background-size 1.4s var(--ease);
}
@property --fill { syntax: "<percentage>"; inherits: true; initial-value: 0%; }
.lp-step { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 1rem; padding-bottom: 1.5rem; position: relative; }
.lp-step:last-child { padding-bottom: 0; }
.lp-node {
    position: relative;
    z-index: 1;
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgb(var(--color-band));
    border: 1px solid rgb(var(--color-border-strong));
    box-shadow: 0 0 0 6px rgb(var(--color-band));
    color: rgb(var(--color-text-soft));
    font-weight: 600;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    transition: background-color 0.4s, color 0.4s, border-color 0.4s;
}
.lp-steps.is-on .lp-node { background: rgb(var(--color-primary-500)); color: rgb(var(--color-primary-fg)); border-color: rgb(var(--color-primary-600)); }
.lp-steps.is-on .lp-step:nth-child(2) .lp-node { transition-delay: 0.32s; }
.lp-steps.is-on .lp-step:nth-child(3) .lp-node { transition-delay: 0.64s; }
.lp-steps.is-on .lp-step:nth-child(4) .lp-node { transition-delay: 0.96s; }
.lp-step h3 { font-size: 16px; letter-spacing: -0.015em; margin: 0.3rem 0 0.25rem; }
.lp-step p { font-size: 15px; color: rgb(var(--color-text-soft)); }

/* Testimonials: one swipeable row on phones */
.lp-voices-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 0.5rem 2rem; }
.lp-note { font-size: 13px; color: rgb(var(--color-text-muted)); }
.lp-voices {
    margin: 1.5rem calc(-1 * var(--gutter)) 0;
    padding: 0 var(--gutter) 4px;
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}
.lp-voices::-webkit-scrollbar { display: none; }
.lp-side { display: contents; }
.lp-quote {
    flex: 0 0 84%;
    scroll-snap-align: start;
    margin: 0;
    background: rgb(var(--color-surface));
    border: 1px solid rgb(var(--color-border-soft));
    border-radius: var(--radius-lg);
    box-shadow: var(--hairline);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
}
.lp-quote blockquote { margin: 0; font-size: 15px; line-height: 1.6; color: rgb(var(--color-text-2)); }
.lp-quote--lead {
    background:
        radial-gradient(80% 60% at 0% 0%, rgb(var(--color-primary-500) / 0.12), transparent 70%),
        rgb(var(--color-surface));
}
.lp-quote--lead blockquote { font-size: 17px; line-height: 1.45; letter-spacing: -0.015em; color: rgb(var(--color-text)); font-weight: 500; }
.lp-qmark { display: block; width: 22px; height: 17px; margin-bottom: 0.875rem; color: rgb(var(--color-primary-700) / 0.7); }
.lp-who { display: flex; align-items: center; gap: 0.75rem; font-size: 14px; font-weight: 600; color: rgb(var(--color-text)); }
.lp-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em;
    color: rgb(var(--color-text-2));
    background: rgb(var(--color-surface-muted));
    box-shadow: inset 0 0 0 1px rgb(var(--color-border));
}

/* FAQ accordion */
.lp-faq { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.lp-acc { border-top: 1px solid rgb(var(--color-border-soft)); }
.lp-acc details { border-bottom: 1px solid rgb(var(--color-border-soft)); }
.lp-acc summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    min-height: 3.25rem;
    padding: 0.75rem 0.125rem;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.015em;
    color: rgb(var(--color-text-2));
    transition: color 0.15s;
}
.lp-acc summary::-webkit-details-marker { display: none; }
.lp-acc summary:hover, .lp-acc details[open] summary { color: rgb(var(--color-text)); }
.lp-acc summary:focus-visible { outline-offset: -2px; border-radius: 0.375rem; }
.lp-chev {
    flex: none; width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 50%;
    border: 1px solid rgb(var(--color-border));
    color: rgb(var(--color-text-soft));
    transition: transform 0.35s var(--ease), color 0.2s, border-color 0.2s, background-color 0.2s;
}
.lp-acc summary:hover .lp-chev { border-color: rgb(var(--color-border-strong)); color: rgb(var(--color-text)); }
.lp-acc details[open] .lp-chev { transform: rotate(45deg); color: rgb(var(--color-primary-700)); border-color: rgb(var(--color-primary-500) / 0.5); background: rgb(var(--color-primary-50)); }
.lp-acc details::details-content { block-size: 0; overflow: hidden; transition: block-size 0.35s var(--ease), content-visibility 0.35s allow-discrete; }
.lp-acc details[open]::details-content { block-size: auto; }
.lp-ans { padding-block: 0 1.125rem; padding-inline: 0.125rem 2.5rem; color: rgb(var(--color-text-soft)); font-size: 15px; max-width: 62ch; }

@media (min-width: 560px) {
    .hero { padding: 2.5rem 0 4rem; }
    .hero-title { font-size: clamp(2.75rem, 1.4rem + 4vw, 4.75rem); line-height: 0.98; }
    .hero-lede { margin-top: 1.25rem; font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.3125rem); }
    .hero-login .auth-card { padding: 1.75rem 1.75rem 1.5rem; }
    .hero-login .auth-title { font-size: 21px; margin-bottom: 1.375rem; }
    .hero-login .form-stack > :not(template) ~ :not(template) { margin-top: 1rem; }
    .lp-section { padding: 5rem 0; }
    .lp-head h2 { font-size: clamp(2rem, 1.4rem + 1.8vw, 2.875rem); line-height: 1.04; }
    .lp-head p { margin-top: 0.875rem; font-size: 17px; }
    .lp-panel { grid-template-columns: 1fr 1fr; gap: 1rem; }
    .lp-reason { display: flex; flex-direction: column; justify-content: flex-end; padding: 1.5rem; min-height: 13rem; overflow: hidden; }
    /* The icon sits large and quiet in the tile's corner; the words anchor bottom-left. */
    .lp-ico { position: absolute; top: 1.5rem; inset-inline-end: 1.5rem; padding: 0; color: rgb(var(--color-text-muted) / 0.55); transition: color 0.3s var(--ease); }
    .lp-ico svg { width: 44px; height: 44px; stroke-width: 1.2; }
    .lp-reason:hover .lp-ico { color: rgb(var(--color-primary-700)); }
    .lp-reason h3 { font-size: 19px; margin: 0 0 0.375rem; }
    .lp-reason p { max-width: 36ch; }
    .lp-reason:hover { border-color: rgb(var(--color-border-strong)); transform: translateY(-2px); box-shadow: var(--hairline), 0 18px 36px -20px rgb(0 0 0 / 0.8); }
    .lp-voices { margin: 2.5rem 0 0; padding: 0; overflow: visible; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1rem; }
    .lp-side { display: grid; gap: 1rem; }
    .lp-quote { padding: 1.75rem; gap: 1.5rem; }
    .lp-quote blockquote { font-size: 16px; }
    .lp-quote--lead { grid-row: span 2; padding: 2.5rem; }
    .lp-quote--lead blockquote { font-size: clamp(1.25rem, 1rem + 0.9vw, 1.625rem); line-height: 1.38; letter-spacing: -0.02em; max-width: 30ch; }
    .lp-qmark { width: 28px; height: 22px; margin-bottom: 1.5rem; }
    .lp-acc summary { font-size: 17px; padding: 1.25rem 0.25rem; }
    .lp-ans { padding-block: 0 1.5rem; padding-inline: 0.25rem 3.5rem; font-size: 16px; }
}
@media (min-width: 900px) {
    .hero { padding: 5rem 0 6.5rem; }
    .hero::before {
        background:
            radial-gradient(46% 62% at 30% 8%, rgb(var(--color-primary-500) / 0.36), transparent 72%),
            radial-gradient(30% 40% at 74% 26%, rgb(139 92 246 / 0.13), transparent 70%);
    }
    .hero-grid { grid-template-columns: minmax(0, 1fr) 400px; gap: 3rem; }
    .hero-title { max-width: 12ch; }
    .hero-login { max-width: none; }
    .lp-section { padding: 7rem 0; }
    .lp-reasons .lp-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: end; }
    .lp-reasons .lp-head p { margin: 0; justify-self: end; }
    .lp-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lp-reason { min-height: 15rem; padding: 1.75rem; }
    .lp-reason:nth-child(1), .lp-reason:nth-child(4) { grid-column: span 2; }
    .lp-reason:nth-child(1) h3, .lp-reason:nth-child(4) h3 { font-size: 24px; letter-spacing: -0.025em; }
    .lp-faq { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 4rem; }
    .lp-steps-sec .lp-head { text-align: center; }
    .lp-steps-sec .lp-head p { margin-inline: auto; }
    .lp-steps { margin-top: 3.75rem; max-width: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
    .lp-steps::before {
        top: 15.5px; bottom: auto; inset-inline-start: 12.5%; inset-inline-end: 12.5%; width: auto; height: 1px;
        background: linear-gradient(90deg, rgb(var(--color-primary-500)) 0 0) left / var(--fill) 100% no-repeat, rgb(var(--color-border));
    }
    .lp-step { display: block; text-align: center; padding: 0; }
    .lp-node { margin: 0 auto 1.5rem; }
    .lp-step h3 { font-size: 18px; margin: 0 0 0.5rem; }
    .lp-step p { max-width: 26ch; margin: 0 auto; }
}
@media (min-width: 1100px) {
    .hero-grid { grid-template-columns: minmax(0, 1fr) 420px; gap: 5rem; }
}
/* The public footer sits on the landing's last band edge. */
body:not(.app--auth) .footer { text-align: start; }
body:not(.app--auth) .footer > span { display: block; max-width: var(--wrap); margin: 0 auto; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ==========================================================================
   Dark-world fixes for things the templates draw themselves
   ========================================================================== */
/* Inline error reds in the templates are too dark for this ground. */
[style*="color:#dc2626"] { color: rgb(var(--color-danger)) !important; }
::placeholder { color: rgb(var(--color-text-muted)); }

/* Network chips wrap onto new lines on phones so every network stays visible
   (no sideways scroll). */
@media (max-width: 1023px) {
    .chip-row, .order-card .chip-row, body.app--auth .order-card .chip-row {
        flex-wrap: wrap;
        overflow: visible;
        margin-inline: 0;
        padding-inline: 0;
    }
}

/* ---------- RTL (ar, fa, he, ur) ----------
   Lo direccional ya usa propiedades lógicas; aquí solo lo que estas no cubren. */
@media (max-width: 1023.98px) {
    [dir="rtl"] .sidebar:not(.is-open) { transform: translateX(100%); }
}
[dir="rtl"] .rtl-flip { transform: scaleX(-1); }
/* Código, IDs, claves y URLs se leen siempre de izquierda a derecha. */
[dir="rtl"] :is(code, kbd, samp, span.mono, span.cell-id, button.cell-id) { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] :is(pre, .code-block) { direction: ltr; text-align: left; }
[dir="rtl"] input:is([type="email"], [type="url"], [type="tel"], [type="number"], .mono) { direction: ltr; }
@media (min-width: 900px) {
    [dir="rtl"] .lp-steps::before { background-position: right center, 0 0; }
}

/* Icon library (own sprite, iconHtml / navIcon): an icon takes the text color;
   a network logo its brand color, or --brand-icon-color when the theme forces one tone. */
.icon-slot { display: inline-flex; flex-shrink: 0; }
.icon-slot .icon { display: block; }
.icon--brand, .nav-link .icon--brand { color: var(--brand-icon-color, var(--brand)); }
/* Radar Social Mode */
:root {
    --color-page: 9 9 12;
    --color-page-public: 9 9 12;
    --color-primary-50: 39 15 22;
    --color-primary-100: 59 20 29;
    --color-primary-200: 112 35 54;
    --color-primary-500: 244 55 77;
    --color-primary-600: 255 79 99;
    --color-primary-700: 255 137 150;
    --color-primary-900: 255 209 216;
    --color-action: 255 67 82;
    --color-action-hover: 255 103 119;
    --color-action-fg: 18 4 9;
    --color-surface: 22 18 22;
    --color-field: 29 23 29;
    --color-border: 65 45 54;
    --color-band: 18 14 18;
    --color-sidebar: 16 13 16
}