:root {
    --bg: #eef3f8;
    --bg-2: #f7fafc;
    --card: #ffffff;
    --ink: #101828;
    --ink-soft: #344054;
    --line: #d0d5dd;
    --blue: #1d4e89;
    --blue-dark: #163a66;
    --blue-soft: #e8eef6;
    --orange: #38BDF8;
    --orange-dark: #0284C7;
    --ok: #027a48;
    --alert: #b42318;
    --warn: #b54708;
    --shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
    --radius: 16px;
    --font: "Segoe UI", "Avenir Next", "Trebuchet MS", sans-serif;
    --serif: "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
img { max-width: 100%; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.demo-banner {
    background: var(--blue-dark);
    color: #fff;
    font-size: 0.85rem;
    text-align: center;
    padding: 0.65rem 1rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.legal-flag {
    display: inline-block;
    margin: 0.4rem 0 1rem;
    padding: 0.2rem 0.55rem;
    border: 1px dashed var(--orange);
    color: var(--orange-dark);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.site-header, .site-footer {
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.site-footer { border-top: 1px solid var(--line); border-bottom: 0; margin-top: 3rem; padding: 2rem 0; }
.header-row, .footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    flex-wrap: wrap;
}
.header-tools {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    min-width: 0;
}
.lang-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
}
.lang-switch__form { display: inline; margin: 0; }
.lang-switch a,
.lang-switch button {
    background: none;
    border: 0;
    padding: 0.12rem 0.2rem;
    font: inherit;
    font-weight: 700;
    color: var(--ink-soft);
    cursor: pointer;
}
.lang-switch a.is-active,
.lang-switch a:hover,
.lang-switch button.is-active,
.lang-switch button:hover { color: var(--ink); }
.panel-sidebar .lang-switch a,
.panel-sidebar .lang-switch button { color: #d5deea; }
.panel-sidebar .lang-switch a.is-active,
.panel-sidebar .lang-switch button.is-active { color: #fff; }
.nav { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.nav a { font-size: 0.95rem; color: var(--ink-soft); font-weight: 600; }
.nav a:hover, .nav a.is-active { color: var(--ink); }

.brand-mark {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--ink);
    min-width: 0;
}
.brand-mark img {
    display: block;
    height: 2.15rem;
    width: auto;
    max-width: 100%;
}
.brand-mark__mono { height: 2.15rem; }
.brand-mark__logo { height: 2rem; max-width: min(220px, 52vw); }
.footer-brand { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }
.footer-brand img { height: 1.7rem; width: auto; max-width: min(240px, 70vw); }

.btn, button.btn, input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 0.72rem 1.15rem;
    background: var(--orange);
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
}
.btn:hover, button.btn:hover { background: var(--orange-dark); color: #fff; }
.btn-secondary {
    background: var(--blue);
    color: #fff;
}
.btn-secondary:hover { background: var(--blue-dark); color: #fff; }
.btn-ghost {
    background: transparent;
    color: var(--orange-dark);
    border: 1px solid var(--orange);
}
.btn-ghost:hover { background: #e0f2fe; color: var(--ink); }
.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.3rem; align-items: stretch; }
.btn-row input { min-width: 0; flex: 1 1 180px; }

.a2hs {
    margin-top: 1rem;
    max-width: min(420px, 100%);
}
.a2hs[hidden] { display: none !important; }
.a2hs__btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 18px;
    padding: 0.95rem 1.15rem;
    cursor: pointer;
    text-align: left;
    color: #f8fafc;
    background:
        linear-gradient(135deg, #0c4a6e 0%, #0284C7 48%, #38BDF8 100%);
    box-shadow:
        0 10px 28px rgba(2, 132, 199, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.a2hs__btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow:
        0 14px 32px rgba(2, 132, 199, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.42);
}
.a2hs__btn:focus-visible {
    outline: 3px solid rgba(56, 189, 248, 0.65);
    outline-offset: 3px;
}
.a2hs__btn.is-installed {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    cursor: default;
}
.a2hs__shine {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        110deg,
        transparent 35%,
        rgba(241, 245, 249, 0.08) 45%,
        rgba(226, 232, 240, 0.55) 50%,
        rgba(241, 245, 249, 0.08) 55%,
        transparent 65%
    );
    transform: translateX(-120%);
    animation: a2hs-shine 4.8s ease-in-out infinite;
}
.a2hs__icon {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 14px;
    color: #0c4a6e;
    background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 4px 10px rgba(15, 23, 42, 0.18);
}
.a2hs__copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
}
.a2hs__title {
    font-size: clamp(0.95rem, 2.6vw, 1.12rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(12, 74, 110, 0.35);
}
.a2hs__sub {
    font-size: 0.86rem;
    font-weight: 600;
    color: rgba(248, 250, 252, 0.92);
    line-height: 1.35;
}
.a2hs-dialog {
    border: 0;
    border-radius: 18px;
    padding: 0;
    width: min(420px, calc(100% - 2rem));
    background: transparent;
}
.a2hs-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}
.a2hs-dialog__panel {
    margin: 0;
    padding: 1.25rem 1.3rem 1.15rem;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.a2hs-dialog__title {
    margin: 0 0 0.55rem;
    font-size: 1.15rem;
    color: var(--ink);
}
.a2hs-dialog__body {
    margin: 0 0 0.65rem;
    color: var(--ink-soft);
}
.a2hs-dialog__hint { margin: 0 0 1rem; font-size: 0.86rem; }
.a2hs-dialog__close { width: 100%; }

@keyframes a2hs-shine {
    0%, 28% { transform: translateX(-120%); }
    55% { transform: translateX(120%); }
    100% { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
    .a2hs__shine { animation: none; display: none; }
    .a2hs__btn,
    .a2hs__btn:hover { transform: none; transition: none; }
}

.hero {
    padding: 3.6rem 0 2.6rem;
    background:
        radial-gradient(circle at 8% 10%, rgba(56, 189, 248, 0.18), transparent 32%),
        linear-gradient(180deg, #f7fafc, var(--bg));
}
.kicker {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.74rem;
    color: var(--blue);
    font-weight: 700;
    margin-bottom: 0.8rem;
}
.hero h1, .page-title h1, .panel-main h1 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(1.7rem, 4vw, 3rem);
    line-height: 1.15;
    margin: 0 0 1rem;
    color: var(--ink);
}
.lead { max-width: 62ch; color: var(--ink-soft); font-size: 1.05rem; }
.notice {
    margin-top: 1.4rem;
    padding: 1rem 1.1rem;
    background: var(--blue-soft);
    border-left: 4px solid var(--blue);
    max-width: 70ch;
    color: var(--ink);
}

.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.section { padding: 2.2rem 0; }
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem;
    box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; font-family: var(--serif); font-weight: 600; color: var(--ink); }
.badge {
    display: inline-block;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--blue-soft);
    color: var(--blue-dark);
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
}
.badge-warn { background: #e0f2fe; color: var(--orange-dark); }
.muted { color: var(--ink-soft); }
.page-title { padding: 2rem 0 1rem; }

.number-card .e164, .e164 { font-family: var(--serif); font-size: 1.35rem; margin: 0.4rem 0; color: var(--ink); }
.meta { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.6rem 0; }
.price { font-weight: 700; color: var(--ink); }

.table-wrap { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; background: var(--card); min-width: 520px; }
th, td { text-align: left; padding: 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink); }
th { font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }

.auth-card { width: min(460px, calc(100% - 32px)); margin: 2.5rem auto; }
label { display: block; font-size: 0.9rem; margin: 0.9rem 0 0.3rem; color: var(--ink); font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
    width: 100%;
    padding: 0.75rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    color: var(--ink);
}
textarea { min-height: 140px; resize: vertical; }
.errors { color: var(--alert); font-size: 0.9rem; }
.flash {
    background: #e7f6ee;
    color: var(--ok);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.checkbox { display: flex; gap: 0.55rem; align-items: flex-start; margin: 1rem 0; font-weight: 500; }
.checkbox input { margin-top: 0.3rem; }

.panel-shell { min-height: calc(100vh - 48px); display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.panel-main, .card, .auth-card { min-width: 0; }
.panel-toolbar .panel-sidebar { display: none; }
.panel-sidebar {
    background: #12233a;
    color: #e8eef6;
    padding: 1.1rem 0.85rem;
}
.panel-sidebar a {
    color: #d5deea;
    display: block;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    font-weight: 600;
    white-space: normal;
    overflow-wrap: anywhere;
}
.panel-sidebar a:hover, .panel-sidebar a.is-active { background: rgba(255,255,255,0.08); color: #fff; }
.panel-sidebar .brand-mark { color: #fff; margin-bottom: 1rem; flex-wrap: wrap; }
.panel-sidebar .brand-mark img { height: 1.85rem; }
.panel-main { padding: 1.2rem; background: var(--bg); }
.panel-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.1rem;
    position: relative;
}
.menu-toggle {
    display: none;
    background: var(--blue);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    font-weight: 700;
    cursor: pointer;
}
.thread { display: grid; gap: 0.8rem; }
.bubble { padding: 0.9rem 1rem; border-radius: 14px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.bubble.staff { background: var(--blue-soft); }

@media (max-width: 860px) {
    .wrap { width: min(1120px, calc(100% - 20px)); }
    .demo-banner { font-size: 0.78rem; padding: 0.55rem 0.75rem; }
    .panel-shell { grid-template-columns: 1fr; }
    .panel-shell > .panel-sidebar { display: none; }
    .menu-toggle { display: inline-flex; white-space: nowrap; grid-column: 1; grid-row: 1; }
    .panel-toolbar {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.55rem 0.7rem;
    }
    .panel-toolbar .lang-switch {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    .panel-toolbar > div {
        min-width: 0;
        grid-column: 2;
        grid-row: 1;
    }
    .panel-toolbar > div strong,
    .panel-toolbar > div .muted {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }
    .panel-toolbar form { grid-column: 3; grid-row: 1; justify-self: end; }
    .panel-toolbar .btn { white-space: nowrap; padding: 0.5rem 0.85rem; }
    .panel-toolbar .panel-sidebar {
        display: none;
        position: static;
        grid-column: 1 / -1;
        grid-row: 3;
        max-height: 46vh;
        overflow: auto;
        border-radius: 12px;
        margin: 0;
    }
    .panel-toolbar.is-open .panel-sidebar { display: block; }
    .hero { padding-top: 2rem; }
    .header-row { align-items: stretch; flex-direction: column; }
    .header-tools { align-items: stretch; width: 100%; }
    .nav { width: 100%; }
    .site-header .nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.45rem 0.7rem;
        align-items: center;
    }
    .site-header .nav a { white-space: nowrap; }
    .site-header .nav .btn {
        white-space: nowrap;
        margin-left: 0;
    }
    .checkbox { white-space: normal; overflow-wrap: anywhere; }
}

@media (max-width: 480px) {
    .site-header .nav .btn { width: auto; }
}

@media (max-width: 400px) {
    .hero h1 { font-size: 1.7rem; }
    .brand-mark__logo { height: 1.55rem; max-width: min(150px, 46vw); }
    .brand-mark__mono { height: 1.7rem; }
    .site-header .brand-mark__logo { display: none; }
    .lang-switch { justify-content: flex-start; }
    .btn-row { flex-direction: column; }
    .btn-row input, .btn-row button { width: 100%; flex: none; }
    .a2hs { max-width: none; }
    .a2hs__btn { width: 100%; }
}

/* Catalog — premium service chips */
.service-chip-row {
    margin: 0.85rem 0 1.1rem;
    overflow: hidden;
}
.service-chip-track {
    display: flex;
    gap: 0.7rem;
    overflow-x: auto;
    padding: 0.35rem 0.15rem 0.65rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.service-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 5.6rem;
    width: 5.6rem;
    padding: 0.85rem 0.55rem 0.7rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.service-chip:hover {
    border-color: rgba(2, 132, 199, 0.35);
    color: inherit;
    transform: translateY(-1px);
}
.service-chip.is-active {
    border-color: #0284C7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.18), 0 8px 20px rgba(2, 132, 199, 0.12);
}
.service-chip__logo {
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.service-chip__logo img {
    width: 28px;
    height: 28px;
    display: block;
    object-fit: contain;
}
.service-chip__name {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;
    line-height: 1.2;
    color: #0f172a;
}
@media (min-width: 900px) {
    .service-chip-track {
        flex-wrap: wrap;
        overflow: visible;
        scroll-snap-type: none;
    }
}

/* Catalog — country-first storefront */
.catalog-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem 1rem;
    align-items: end;
    margin: 1.2rem 0 0.5rem;
}
.catalog-filters .btn { align-self: end; }
.catalog-search input { width: 100%; }
.catalog-country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.85rem;
    padding-bottom: 2.5rem;
}
a.catalog-country-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 0.9rem;
    box-shadow: var(--shadow);
    color: inherit;
    text-decoration: none;
    min-height: 9.5rem;
    overflow: hidden;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
a.catalog-country-card:hover {
    border-color: var(--blue);
    color: inherit;
    transform: translateY(-1px);
}
.catalog-country-card h2 {
    margin: 0;
    font-size: 1.05rem;
    font-family: var(--serif);
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.catalog-flag { font-size: 1.6rem; line-height: 1; }
.catalog-flag--lg { font-size: 2.4rem; }
.country-flag {
    display: inline-block;
    vertical-align: middle;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
    flex-shrink: 0;
}
.country-flag--sm { width: 18px; height: 13px; }
.country-flag--md { width: 24px; height: 18px; }
.country-flag--lg { width: 36px; height: 27px; }
.country-flag--fallback { font-size: 1.35rem; line-height: 1; box-shadow: none; }
.badge .country-flag { margin-right: 0.35rem; }
.catalog-dial { font-size: 0.85rem; margin: 0; }
.catalog-country-detail { padding-bottom: 2.5rem; }
.catalog-country-head--detail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.1rem;
    margin-bottom: 1.2rem;
}
.catalog-country-head--detail h2 { margin: 0; font-family: var(--serif); }
.catalog-service-list { display: grid; gap: 0.75rem; }
.catalog-offer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.85rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}
.catalog-offer--exhausted { opacity: 0.85; }
.catalog-offer-main { display: flex; align-items: center; gap: 0.75rem; min-width: 0; flex: 1 1 200px; }
.catalog-offer-main h3 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.catalog-offer-buy { display: flex; flex-direction: column; align-items: flex-end; gap: 0.45rem; flex: 0 0 auto; }
.service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--blue-dark);
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.service-icon--logo img {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
}
.catalog-empty-country .btn { margin-top: 0.75rem; display: inline-flex; }
@media (min-width: 900px) {
    .catalog-country-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; }
    .service-chip { min-width: 6rem; width: 6rem; }
}
@media (max-width: 899px) and (min-width: 641px) {
    .catalog-country-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .catalog-country-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
    .country-flag--lg { width: 32px; height: 24px; }
    a.catalog-country-card { min-height: 8.5rem; padding: 0.85rem 0.75rem; }
    .catalog-offer-buy { width: 100%; align-items: stretch; }
    .catalog-offer-buy .btn { width: 100%; text-align: center; }
    .service-chip-track { gap: 0.55rem; }
    .service-chip { min-width: 5.2rem; width: 5.2rem; padding: 0.75rem 0.45rem 0.65rem; }
}
