:root {
    color-scheme: light;
    --ink: #0b1d33;
    --muted: #667388;
    --surface: #ffffff;
    --background: #f3f5f8;
    --primary: #0b1d33;
    --primary-dark: #061426;
    --accent: #ffd21a;
    --accent-soft: #fff7cc;
    --border: #dce2ea;
    --warning: #6d5300;
    --warning-bg: #fff7cc;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--background); color: var(--ink); }
body { padding-bottom: env(safe-area-inset-bottom); }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; }
.top-bar {
    position: sticky; top: 0; z-index: 10; height: 68px; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(11,29,51,.97); border-bottom: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(255,210,26,.34); }
.brand-copy { color: white; font-weight: 800; font-size: .94rem; letter-spacing: .01em; }
.demo-badge { padding: 6px 9px; border-radius: 999px; background: var(--accent); color: var(--primary-dark); font-size: .72rem; font-weight: 850; }
.main-content { width: min(100%, 980px); margin: 0 auto; padding: 26px 18px 108px; }

.hero { padding: 18px 2px 22px; }
.eyebrow { margin: 0 0 7px; color: #8a6b00; font-size: .78rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 10vw, 4.25rem); line-height: .98; letter-spacing: -.055em; }
.hero > p:last-child, .page-heading > p:last-child { margin: 16px 0 0; max-width: 560px; color: var(--muted); line-height: 1.55; }
.page-heading { margin-bottom: 22px; }
.page-heading h1 { font-size: clamp(2rem, 8vw, 3.4rem); }

.notice { display: flex; flex-direction: column; gap: 3px; margin-bottom: 28px; padding: 14px 16px; border-radius: 14px; font-size: .9rem; }
.demo-notice { background: var(--warning-bg); color: var(--warning); }
.stale-rates-notice { border: 1px solid #e5b800; background: #fff7cc; color: #594500; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 13px; }
.section-heading h2 { margin: 0; font-size: 1.15rem; }
.section-heading span { color: var(--muted); font-size: .83rem; }
.rate-grid { display: grid; gap: 14px; }
.rate-card, .calculator-card, .result-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 10px 35px rgba(11, 29, 51, .07); }
.rate-card { padding: 18px; }
.rate-route { display: flex; gap: 8px; color: var(--muted); font-size: .86rem; font-weight: 750; }
.rate-value { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 10px; }
.rate-value span { color: var(--muted); font-size: .8rem; }
.rate-value strong { color: var(--primary); font-size: 2rem; letter-spacing: -.04em; }
.minimum-note { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.card-action { display: flex; justify-content: space-between; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--primary); font-weight: 800; font-size: .9rem; }
.card-action span { color: #a27c00; }
.card-action.disabled { cursor: not-allowed; opacity: .72; }

.official-section { margin-top: 34px; padding: 22px 18px; border-radius: 22px; background: var(--primary); color: white; box-shadow: 0 16px 40px rgba(11, 29, 51, .16); }
.official-section .section-heading { align-items: flex-end; }
.official-section .section-heading h2 { color: white; }
.official-section .section-heading > span { padding: 5px 9px; border: 1px solid rgba(255,210,26,.4); border-radius: 999px; color: var(--accent); font-weight: 850; }
.official-stale-notice {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 210, 26, .55);
    border-radius: 13px;
    background: rgba(255, 210, 26, .12);
    color: #f3f5f8;
    font-size: .8rem;
    line-height: 1.45;
}
.official-stale-notice strong { color: var(--accent); }
.official-rates-stage { position: relative; min-height: 150px; }
.official-rates-content { transition: filter .2s ease, opacity .2s ease; }
.official-rates-content.is-blocked {
    min-height: 180px;
    filter: blur(5px);
    opacity: .48;
    pointer-events: none;
    user-select: none;
}
.official-rates-overlay {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 24px;
    border: 1px solid rgba(255, 210, 26, .7);
    border-radius: 15px;
    background: rgba(6, 20, 38, .9);
    color: #f3f5f8;
    text-align: center;
    line-height: 1.45;
}
.official-rates-overlay strong { color: var(--accent); font-size: 1rem; }
.official-rates-overlay span { max-width: 520px; font-size: .8rem; }
.section-kicker { margin: 0 0 4px; color: var(--accent); font-size: .69rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.official-grid { display: grid; gap: 10px; }
.official-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid rgba(255,255,255,.11); border-radius: 15px; background: rgba(255,255,255,.07); }
.official-card > div { display: flex; flex-direction: column; gap: 3px; }
.official-name { font-weight: 800; }
.official-conversion { color: #b9c2cf; font-size: .76rem; }
.official-card strong { color: var(--accent); font-size: 1.35rem; white-space: nowrap; }
.official-card-stale { opacity: .86; }
.official-card-action.disabled { cursor: not-allowed; opacity: .78; }
.official-updated { margin: 13px 2px 0; color: #aeb8c6; font-size: .72rem; }

.calculator-card, .result-card { padding: 20px; margin-bottom: 16px; }
.field-label { display: block; margin: 0 0 8px; font-size: .82rem; font-weight: 800; }
.field-control, .amount-input { width: 100%; border: 1px solid var(--border); border-radius: 13px; background: #fbfdfc; }
.field-control { height: 50px; padding: 0 13px; color: var(--ink); }
.amount-input { display: flex; align-items: center; margin-bottom: 8px; }
.amount-input span { padding-left: 14px; color: var(--primary); font-weight: 850; }
.amount-input input { width: 100%; height: 56px; padding: 0 14px 0 8px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1.45rem; font-weight: 750; }
.direction-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 18px 0; padding: 4px; border-radius: 13px; background: var(--background); }
.direction-toggle button { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 750; cursor: pointer; }
.direction-toggle button.active { background: white; color: var(--primary); box-shadow: 0 3px 12px rgba(11, 29, 51, .1); }
.standalone { margin: 9px 0 18px; }
.official-calculator-warning {
    margin: -6px 0 15px;
    padding: 11px 12px;
    border: 1px solid #e5b800;
    border-radius: 11px;
    background: #fff7cc;
    color: #594500;
    font-size: .8rem;
    line-height: 1.45;
}
.primary-button, .secondary-button { min-height: 50px; padding: 0 18px; border-radius: 13px; border: 0; font-weight: 850; cursor: pointer; }
.primary-button:disabled { cursor: not-allowed; opacity: .58; }
.primary-button { background: var(--accent); color: var(--primary-dark); }
.primary-button:hover { background: var(--primary-dark); }
.primary-button:hover { color: white; }
.secondary-button { background: var(--accent-soft); color: var(--primary-dark); }
.quote-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.quote-action-button {
    min-height: 52px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 13px;
    font-weight: 850;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
    transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.quote-action-button:hover { transform: translateY(-1px); }
.quote-action-icon { width: 21px; height: 21px; flex: 0 0 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.copy-quote-button { background: var(--accent); color: var(--primary-dark); box-shadow: 0 7px 18px rgba(255, 210, 26, .2); }
.copy-quote-button:hover { background: #e8bd00; color: var(--primary-dark); }
.whatsapp-quote-button { background: #25d366; color: #071b12; box-shadow: 0 7px 18px rgba(37, 211, 102, .2); }
.whatsapp-quote-button:hover { background: #1fbd59; color: #071b12; }
.quote-action-icon.whatsapp-icon { fill: currentColor; stroke: none; }
.full-width { width: 100%; }
.validation-message { margin: 12px 0 0; color: #b42318; font-size: .85rem; }

.result-card { border-color: #c9d3e0; }
.result-label { margin: 0 0 12px; color: var(--primary); font-size: .8rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.result-line { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 0; }
.result-line span { color: var(--muted); }
.result-line strong { text-align: right; font-size: 1.1rem; }
.result-line.featured { margin: 3px -8px; padding: 14px 8px; border-radius: 12px; background: var(--accent-soft); }
.result-line.featured strong { color: var(--primary-dark); font-size: 1.35rem; }
.result-line.compact { padding-bottom: 17px; font-size: .85rem; }
.tier-warning { margin: 0 0 14px; padding: 11px 12px; border-radius: 10px; background: var(--warning-bg); color: var(--warning); font-size: .8rem; line-height: 1.45; }
.quote-disclaimer {
    margin: 0 0 14px;
    padding: 11px 12px;
    border: 1px solid rgba(11, 29, 51, .14);
    border-radius: 10px;
    background: rgba(243, 245, 248, .82);
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.45;
}

.bottom-nav { position: fixed; z-index: 20; left: 50%; bottom: 0; width: min(100%, 560px); transform: translateX(-50%); display: grid; grid-template-columns: 1fr 1fr; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); border: 1px solid var(--border); border-bottom: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -8px 32px rgba(11, 29, 51, .1); backdrop-filter: blur(14px); }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px; border-radius: 12px; color: var(--muted); font-size: .76rem; font-weight: 750; }
.nav-icon {
    display: block;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nav-item > span { line-height: 1.2; }
.nav-item.active { background: var(--accent-soft); color: var(--primary-dark); }
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state .primary-button { display: inline-flex; align-items: center; margin-top: 20px; }
.loading-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.loading-logo { width: 82px; height: 82px; border-radius: 50%; object-fit: cover; box-shadow: 0 12px 35px rgba(11,29,51,.18); }
#blazor-error-ui { display: none; position: fixed; inset: auto 0 0; z-index: 100; padding: 14px; background: #fee4e2; color: #7a271a; }

@media (min-width: 700px) {
    .main-content { padding-top: 42px; }
    .rate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .official-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero { padding-top: 34px; }
    .calculator-card, .result-card { max-width: 620px; margin-left: auto; margin-right: auto; }
    .page-heading { max-width: 620px; margin-left: auto; margin-right: auto; }
}

@media (max-width: 480px) {
    .quote-actions { grid-template-columns: 1fr; }
}
