/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
/* The UA stylesheet's `[hidden] { display: none }` has the same
   specificity as a single class selector, so any class that sets
   `display` (e.g. `.topbar-user { display: inline-flex }`) wins and
   `hidden` becomes a no-op. Force the attribute to win. */
[hidden] { display: none !important; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
        "Segoe UI Emoji";
    font-size: 16px;
    line-height: 1.5;
    color: #0f172a;
    background: #f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; display: block; }
a { color: #4f46e5; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.92em;
    background: rgba(15, 23, 42, 0.06);
    padding: 0.1em 0.4em;
    border-radius: 4px;
}

/* ---------- Topbar ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    max-width: 1100px;
    margin: 0 auto;
    gap: 16px;
}
.topbar-compact { padding: 14px 20px; max-width: 720px; }
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    background: url('/assets/brand/yadacall-mark.png') center / contain no-repeat;
}
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 15px;
}
.topbar-nav a { color: #475569; }
.topbar-nav a:hover { color: #0f172a; text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.06s ease, background 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: #4f46e5;
    color: #fff;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.35);
}
.btn-primary:hover { background: #4338ca; }
.btn-ghost {
    background: transparent;
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
}
.btn-ghost:hover { background: rgba(15, 23, 42, 0.05); }
.btn-link {
    background: transparent;
    color: #4f46e5;
    padding: 10px 4px;
}
.btn-link:hover { color: #4338ca; text-decoration: underline; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 6px 12px; font-size: 14px; border-radius: 8px; }

/* ---------- Hero ---------- */
.hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 56px;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 64px 28px 80px;
}
.hero-with-phone {
    /* The real phone is taller than the decorative mockup was, so we
       centre the copy vertically against it. */
    align-items: center;
    padding: 48px 28px 56px;
}
.hero-with-phone .hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-with-phone .phone-card {
    width: 100%;
    max-width: 360px;
}
.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.1);
    padding: 6px 12px;
    border-radius: 999px;
    margin: 0 0 20px;
    font-weight: 700;
}
.hero h1 {
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin: 0 0 18px;
    color: #0f172a;
}
.lede {
    font-size: 18px;
    color: #475569;
    margin: 0 0 28px;
    max-width: 52ch;
}
.hero-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.hero-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: #475569;
    font-size: 14px;
}
.hero-points li::before {
    content: "✓";
    color: #16a34a;
    margin-right: 8px;
    font-weight: 700;
}

/* Hero visual: a stylised phone */
.hero-visual { display: flex; justify-content: center; }
.phone-mock {
    width: 280px;
    padding: 14px;
    background: #0f172a;
    border-radius: 36px;
    box-shadow:
        0 30px 60px -20px rgba(15, 23, 42, 0.4),
        0 0 0 6px #1e293b;
    transform: rotate(-4deg);
}
.phone-screen {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-radius: 26px;
    padding: 22px 18px 26px;
    color: #e2e8f0;
    text-align: center;
}
.phone-mock .phone-status {
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.phone-mock .phone-number {
    font-size: 24px;
    margin: 6px 0 18px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}
.phone-mock .phone-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}
.phone-mock .pad-key {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
}
.phone-mock .phone-call {
    width: 56px; height: 56px;
    margin: 0 auto;
    background: #16a34a;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    box-shadow: 0 10px 20px rgba(22, 163, 74, 0.5);
}

/* ---------- Sections ---------- */
.section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 64px 28px;
}
.section-muted { background: #fff; border-radius: 24px; }
.section h2 {
    font-size: 30px;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
}
.section-lede {
    color: #475569;
    margin: 0 0 28px;
    max-width: 60ch;
}
.steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    counter-reset: step;
}
.steps li {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}
.section-muted .steps li { background: #f8fafc; }
.steps h3 {
    margin: 12px 0 6px;
    font-size: 17px;
    letter-spacing: -0.01em;
}
.steps p {
    margin: 0;
    color: #475569;
    font-size: 14.5px;
}
.step-num {
    display: inline-flex;
    width: 28px; height: 28px;
    align-items: center; justify-content: center;
    background: #4f46e5;
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
}

/* ---------- Footer ---------- */
.footer {
    max-width: 1100px;
    margin: 40px auto 32px;
    padding: 0 28px;
    color: #64748b;
    font-size: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.footer-sep { opacity: 0.5; }

/* ---------- Phone page ---------- */
.page-phone {
    background:
        radial-gradient(1200px 600px at 50% -100px, rgba(79, 70, 229, 0.18), transparent 60%),
        #0f172a;
    color: #e2e8f0;
    min-height: 100%;
}
.page-phone .topbar { color: #cbd5e1; }
.page-phone .brand { color: #f8fafc; }
.page-phone .topbar-nav a, .page-phone .topbar a { color: #cbd5e1; }
.page-phone .btn-ghost { color: #f8fafc; border-color: rgba(255,255,255,0.18); }
.page-phone .btn-ghost:hover { background: rgba(255,255,255,0.08); }

/* Topbar user state (landing) */
.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    font-size: 14px;
}
.topbar-email {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
}

.phone-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px 60px;
    min-height: calc(100vh - 70px);
}
.phone-card {
    width: 100%;
    max-width: 380px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-radius: 28px;
    padding: 22px 22px 26px;
    box-shadow:
        0 30px 60px -20px rgba(0,0,0,0.6),
        0 0 0 1px rgba(255,255,255,0.06);
}
.phone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.phone-conn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}
.phone-conn .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
}
.phone-conn[data-state="ready"] .dot,
.phone-conn[data-state="calling"] .dot,
.phone-conn[data-state="incall"] .dot {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}
.phone-time {
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    color: #cbd5e1;
    background: rgba(255,255,255,0.06);
    padding: 4px 10px;
    border-radius: 8px;
}

.phone-display {
    text-align: center;
    padding: 14px 8px 14px;
    border-radius: 18px;
    background: rgba(0,0,0,0.25);
    margin-bottom: 18px;
    position: relative;
}
.phone-number-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px;
}
.phone-number {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 0.03em;
    font-variant-numeric: tabular-nums;
    color: #f8fafc;
    min-height: 1.4em;
    word-break: break-all;
    text-align: center;
    flex: 1;
    min-width: 0;
}

/* Country prefix trigger */
.prefix-wrapper {
    position: relative;
    flex: 0 0 auto;
}
.prefix-trigger {
    appearance: none;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #f8fafc;
    border-radius: 10px;
    padding: 7px 9px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font: inherit;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.prefix-trigger:hover { background: rgba(255,255,255,0.1); }
.prefix-trigger:focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; }
.prefix-flag {
    font-size: 17px;
    line-height: 1;
}
.prefix-code {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.prefix-caret {
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.15s ease;
}
.prefix-trigger[aria-expanded="true"] .prefix-caret {
    transform: rotate(180deg);
}

/* Dropdown menu — real dropdown anchored to the trigger */
.prefix-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    /* Match the trigger width at minimum, but grow up to 280px to fit
       country names; on narrow viewports stay within the card. */
    min-width: 100%;
    width: max-content;
    max-width: min(280px, calc(100vw - 48px));
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow:
        0 10px 30px rgba(0,0,0,0.55),
        0 0 0 1px rgba(0,0,0,0.25);
    z-index: 30;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 240px;
}
/* Without this, `display: flex` above outranks the user-agent
   `[hidden] { display: none }` rule and the menu never actually hides. */
.prefix-menu[hidden] { display: none; }
.prefix-search {
    appearance: none;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.25);
    color: #f8fafc;
    padding: 9px 12px;
    font: inherit;
    font-size: 14px;
    outline: none;
    flex: 0 0 auto;
}
.prefix-search::placeholder { color: #64748b; }
.prefix-search:focus { background: rgba(0,0,0,0.4); }

.prefix-list {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    padding: 3px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.prefix-list::-webkit-scrollbar { width: 6px; }
.prefix-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.18);
    border-radius: 3px;
}

.prefix-section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    padding: 8px 12px 4px;
    font-weight: 700;
}
.prefix-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    cursor: pointer;
    color: #e2e8f0;
    font-size: 13.5px;
    transition: background 0.08s ease;
}
.prefix-option:hover,
.prefix-option:focus-visible {
    background: rgba(255,255,255,0.06);
    outline: none;
}
.prefix-option.is-selected {
    background: rgba(79, 70, 229, 0.25);
    color: #c7d2fe;
}
.prefix-option-flag {
    font-size: 18px;
    line-height: 1;
    width: 22px;
    text-align: center;
    flex: 0 0 auto;
}
.prefix-option-name {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.prefix-option-dial {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #94a3b8;
    font-size: 12.5px;
    flex: 0 0 auto;
}
.prefix-empty {
    padding: 14px 12px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}
.phone-status {
    margin-top: 6px;
    font-size: 13px;
    color: #94a3b8;
    min-height: 1.4em;
}

.phone-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}
.key {
    appearance: none;
    border: 0;
    background: rgba(255,255,255,0.06);
    color: #f8fafc;
    border-radius: 16px;
    padding: 14px 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.1;
    cursor: pointer;
    transition: background 0.1s ease, transform 0.06s ease;
    user-select: none;
}
.key:hover { background: rgba(255,255,255,0.1); }
.key:active { background: rgba(255,255,255,0.18); transform: scale(0.97); }
.key-sub {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.12em;
    margin-top: 2px;
}

.phone-controls {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.ctrl {
    appearance: none;
    border: 0;
    border-radius: 16px;
    padding: 16px 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease, transform 0.06s ease, box-shadow 0.15s ease;
}
.ctrl:active { transform: translateY(1px); }
.ctrl-side {
    background: rgba(255,255,255,0.08);
    color: #f8fafc;
    font-size: 18px;
}
.ctrl-side:hover { background: rgba(255,255,255,0.12); }

/* Voice ↔ numbers mode toggle (replaces the old mute button) */
.ctrl-mode {
    min-width: 56px;
    padding: 16px 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
    color: #f8fafc;
}
.ctrl-mode-label {
    display: inline-block;
    transition: transform 0.15s ease;
}
.ctrl-mode:hover { background: rgba(255,255,255,0.12); }
.ctrl-mode.is-numbers {
    background: #f59e0b;
    color: #0f172a;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4);
}
.ctrl-mode.is-numbers:hover { background: #d97706; }
.ctrl-mode:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 2px;
}
.ctrl-call {
    background: #16a34a;
    color: #fff;
    box-shadow: 0 12px 24px rgba(22, 163, 74, 0.35);
    font-size: 18px;
}
.ctrl-call:hover { background: #15803d; }
.ctrl-call.is-cancel { background: #64748b; box-shadow: none; }
.ctrl-call.is-hangup {
    background: #ef4444;
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.4);
}
.ctrl-call.is-hangup:hover { background: #dc2626; }
.ctrl-call:disabled { opacity: 0.7; cursor: progress; }
.ctrl-icon { font-size: 18px; }

.phone-helper { text-align: center; }
.helper-hint {
    color: #94a3b8;
    font-size: 12.5px;
    margin: 0;
    line-height: 1.5;
}
.helper-hint code { background: rgba(255,255,255,0.08); color: #e2e8f0; }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    background: #0f172a;
    color: #f8fafc;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 50;
    max-width: 90vw;
    text-align: center;
}

/* ---------- Auth modal ---------- */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-modal[hidden] { display: none; }
.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.auth-modal-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    color: #0f172a;
    border-radius: 18px;
    padding: 28px 28px 24px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
    animation: auth-pop 0.18s ease-out;
}
@keyframes auth-pop {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}
.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.12s ease;
}
.auth-modal-close:hover { background: rgba(15,23,42,0.06); color: #0f172a; }

.auth-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}
.auth-tab {
    flex: 1;
    appearance: none;
    border: 0;
    background: transparent;
    color: #475569;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.auth-tab:hover { color: #0f172a; }
.auth-tab.is-active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15,23,42,0.08);
}

.auth-title {
    margin: 0 0 4px;
    font-size: 22px;
    letter-spacing: -0.01em;
}
.auth-subtitle {
    margin: 0 0 20px;
    color: #64748b;
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-field > span {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.auth-field input {
    appearance: none;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-size: 15px;
    padding: 10px 12px;
    border-radius: 9px;
    outline: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.auth-field input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.auth-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 13.5px;
}
.auth-submit {
    margin-top: 4px;
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border-radius: 10px;
}
.auth-submit:disabled { opacity: 0.7; cursor: progress; }
.auth-foot {
    margin: 14px 0 0;
    text-align: center;
    color: #94a3b8;
    font-size: 12.5px;
    line-height: 1.5;
}

/* Lock the page scroll while the modal is open. */
body.auth-modal-open { overflow: hidden; }

/* ---------- Rates page ---------- */
.page-rates {
    background: #f8fafc;
}

.rates-hero {
    max-width: 1100px;
    margin: 0 auto;
    padding: 64px 28px 32px;
    text-align: center;
}
.rates-hero h1 {
    font-size: clamp(32px, 4.5vw, 48px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
}
.rates-hero .lede {
    max-width: 56ch;
    margin: 0 auto;
    color: #475569;
    font-size: 17px;
}

.rates-calculator-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 8px 28px 56px;
}
.rate-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 20px;
    box-shadow: 0 30px 60px -25px rgba(15, 23, 42, 0.18);
    padding: 28px;
    max-width: 760px;
    margin: 0 auto;
}
.rate-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
    align-items: end;
}
.rate-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}
.rate-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Country trigger (same shape as the phone's) */
.rate-picker { position: relative; }
.rate-trigger {
    appearance: none;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    border-radius: 12px;
    padding: 14px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font: inherit;
    width: 100%;
    text-align: left;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.rate-trigger:hover { border-color: #94a3b8; }
.rate-trigger:focus-visible {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}
.rate-flag { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.rate-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rate-code {
    font-variant-numeric: tabular-nums;
    color: #64748b;
    font-weight: 600;
    font-size: 15px;
    flex: 0 0 auto;
}
.rate-caret {
    color: #64748b;
    font-size: 11px;
    transition: transform 0.15s ease;
    flex: 0 0 auto;
}
.rate-trigger[aria-expanded="true"] .rate-caret { transform: rotate(180deg); }

.rate-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 100%;
    width: max-content;
    max-width: min(320px, calc(100vw - 48px));
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(15, 23, 42, 0.04);
    z-index: 30;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 280px;
}
.rate-menu[hidden] { display: none; }
.rate-search {
    appearance: none;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    padding: 10px 14px;
    font: inherit;
    font-size: 15px;
    outline: none;
    flex: 0 0 auto;
}
.rate-search:focus { background: #ffffff; }
.rate-list {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    padding: 3px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(15,23,42,0.2) transparent;
}
.rate-list::-webkit-scrollbar { width: 6px; }
.rate-list::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.2); border-radius: 3px; }
.rate-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    color: #0f172a;
    font-size: 14px;
    transition: background 0.08s ease;
}
.rate-option:hover,
.rate-option:focus-visible {
    background: #f1f5f9;
    outline: none;
}
.rate-option.is-selected { background: rgba(99,102,241,0.12); color: #4338ca; }
.rate-option-flag { font-size: 18px; line-height: 1; width: 24px; text-align: center; flex: 0 0 auto; }
.rate-option-name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rate-option-code { font-variant-numeric: tabular-nums; color: #64748b; font-size: 13px; flex: 0 0 auto; }
.rate-empty { padding: 14px 12px; text-align: center; color: #94a3b8; font-size: 13px; }

/* Segmented control for line type */
.line-type {
    display: flex;
    width: 100%;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    gap: 2px;
}
.line-type-btn {
    flex: 1 1 0;
    appearance: none;
    border: 0;
    background: transparent;
    color: #475569;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.12s ease, color 0.12s ease;
    white-space: nowrap;
    min-width: 0;
}
.line-type-btn:hover { color: #0f172a; }
.line-type-btn.is-active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15,23,42,0.12);
}
.lt-icon { font-size: 15px; line-height: 1; }

/* Rate result */
.rate-result {
    margin-top: 24px;
    padding: 22px 24px;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(236,72,153,0.06));
    border: 1px solid rgba(99,102,241,0.18);
    border-radius: 14px;
    text-align: center;
}
.rate-amount-row {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    color: #0f172a;
}
.rate-amount {
    font-size: 44px;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.rate-unit {
    font-size: 16px;
    font-weight: 600;
    color: #475569;
}
.rate-detail {
    margin: 8px 0 0;
    color: #334155;
    font-size: 14.5px;
}
.rate-foot {
    margin: 10px 0 0;
    color: #94a3b8;
    font-size: 12px;
}

/* FAQ */
.faq {
    display: flex;
    flex-direction: column;
    gap: 28px;
    max-width: 760px;
    margin: 0 auto;
}
.faq-item {
    /* Each Q&A is a single visible block — no accordion, all open. */
}
.faq-q {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.01em;
}
.faq-a {
    margin: 0;
    color: #475569;
    font-size: 15.5px;
    line-height: 1.65;
}

@media (max-width: 720px) {
    .rate-row { grid-template-columns: 1fr; gap: 18px; }
    .rate-amount { font-size: 36px; }
    .rate-trigger { padding: 12px; }
}

.topbar-nav a.is-current { color: #4f46e5; font-weight: 600; }

/* ---------- "Calling from" picker (topbar) ---------- */
.caller-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.caller-prefix {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    font-weight: 600;
}
.caller-trigger {
    appearance: none;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    color: #0f172a;
    border-radius: 9px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.caller-trigger:hover { background: #f8fafc; }
.caller-trigger:focus-visible {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}
.caller-wrap.is-default .caller-trigger {
    border-color: rgba(99,102,241,0.5);
    background: rgba(99,102,241,0.06);
}
.caller-label { white-space: nowrap; }
.caller-caret {
    color: #94a3b8;
    font-size: 10px;
    transition: transform 0.15s ease;
}
.caller-trigger[aria-expanded="true"] .caller-caret { transform: rotate(180deg); }

.caller-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 260px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(15, 23, 42, 0.04);
    z-index: 90;
    overflow: hidden;
}
.caller-menu[hidden] { display: none; }
.caller-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 0;
}
.caller-option {
    appearance: none;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    color: #0f172a;
    font: inherit;
    font-size: 14px;
    transition: background 0.08s ease;
}
.caller-option:hover,
.caller-option:focus-visible {
    background: #f1f5f9;
    outline: none;
}
.caller-option.is-active { background: rgba(99,102,241,0.10); color: #4338ca; }
.caller-option-check {
    width: 16px;
    color: #4f46e5;
    font-weight: 700;
    flex: 0 0 auto;
    text-align: center;
}
.caller-option-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.caller-option-num {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.caller-option-label {
    font-size: 12px;
    color: #64748b;
}
.caller-option-badge {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #eef2ff;
    color: #4338ca;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 700;
    flex: 0 0 auto;
}
.caller-manage {
    display: block;
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    color: #4f46e5;
    font-weight: 600;
    font-size: 13.5px;
    text-align: center;
}
.caller-manage:hover { background: #f8fafc; text-decoration: none; }

/* On the dark phone page, the trigger needs a dark-friendly treatment. */
.page-phone .caller-wrap { color: #cbd5e1; }
.page-phone .caller-prefix { color: #64748b; }
.page-phone .caller-trigger {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.16);
    color: #f8fafc;
}
.page-phone .caller-trigger:hover { background: rgba(255,255,255,0.1); }
.page-phone .caller-wrap.is-default .caller-trigger {
    background: rgba(99,102,241,0.18);
    border-color: rgba(129,140,248,0.6);
}
.page-phone .caller-menu {
    background: #1e293b;
    border-color: rgba(255,255,255,0.1);
    color: #e2e8f0;
}
.page-phone .caller-option { color: #e2e8f0; }
.page-phone .caller-option:hover,
.page-phone .caller-option:focus-visible { background: rgba(255,255,255,0.06); }
.page-phone .caller-option-num { color: #f8fafc; }
.page-phone .caller-option.is-active { background: rgba(99,102,241,0.25); color: #c7d2fe; }
.page-phone .caller-manage {
    color: #a5b4fc;
    border-top-color: rgba(255,255,255,0.08);
}
.page-phone .caller-manage:hover { background: rgba(255,255,255,0.06); }

/* ---------- Settings page ---------- */
.page-settings {
    background: #f8fafc;
    min-height: 100%;
}
.settings-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}
.settings-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 20px 40px -20px rgba(15, 23, 42, 0.12);
}
.settings-card h1 {
    margin: 0 0 8px;
    font-size: 26px;
    letter-spacing: -0.01em;
}
.settings-lede {
    margin: 0 0 24px;
    color: #475569;
    font-size: 14.5px;
    line-height: 1.55;
}

.number-list {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.number-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.number-item.is-default {
    border-color: rgba(99,102,241,0.5);
    background: rgba(99,102,241,0.05);
}
.number-main { flex: 1 1 auto; min-width: 0; }
.number-line {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.number-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.number-digits {
    font-size: 17px;
    font-weight: 600;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}
.number-actions {
    display: inline-flex;
    gap: 4px;
    flex: 0 0 auto;
}
.number-action {
    appearance: none;
    border: 0;
    background: transparent;
    color: #64748b;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, color 0.12s ease;
}
.number-action:hover { background: #f1f5f9; color: #0f172a; }
.number-default { font-size: 19px; }
.number-item.is-default .number-default { color: #f59e0b; }
.number-delete:hover { color: #dc2626; background: #fef2f2; }

.number-empty {
    margin: 0 0 16px;
    padding: 16px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #64748b;
    font-size: 14.5px;
    text-align: center;
}

.number-add {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}
.number-add h2 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}
.number-add-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.number-add .auth-error { margin-bottom: 12px; }
.number-add .btn { width: 100%; padding: 12px; }

@media (max-width: 560px) {
    .settings-card { padding: 22px; }
    .number-add-row { grid-template-columns: 1fr; }
    .caller-wrap { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 40px 20px 56px;
        gap: 40px;
        text-align: left;
    }
    .hero-with-phone { padding: 24px 20px 40px; }
    .hero-with-phone .hero-visual { order: -1; }
    .hero-with-phone .phone-card { max-width: 340px; }
    .phone-mock { transform: rotate(0); }
    .section { padding: 44px 20px; }
    .topbar { padding: 14px 20px; }
    .topbar-nav a:not(.btn) { display: none; }
    .topbar-user { display: none !important; }
    .caller-prefix { display: none; }
}

@media (max-width: 420px) {
    .phone-card { padding: 18px 16px 20px; border-radius: 22px; }
    .phone-number { font-size: 24px; }
    .key { padding: 12px 0; font-size: 20px; border-radius: 14px; }
    .ctrl { padding: 14px 10px; }
}
