/*
    RoamYX web app styles: the "Night Signal" design of the Android app.
    Colors come from src/RoamYX.Mobile/Resources/Styles/Colors.xaml, sizes from Styles.xaml and the
    screens' XAML. Mobile first (a 390 px wide phone); on wider screens the app stays a phone-width
    column in the middle.
*/

/* ---------- Fonts (SIL Open Font License, see fonts/OFL.txt) ---------- */

@font-face {
    font-family: "Bricolage Grotesque";
    src: url("../fonts/BricolageGrotesque-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Bricolage Grotesque";
    src: url("../fonts/BricolageGrotesque-ExtraBold.ttf") format("truetype");
    font-weight: 800;
    font-display: swap;
}

@font-face {
    font-family: "DM Sans";
    src: url("../fonts/DMSans-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "DM Sans";
    src: url("../fonts/DMSans-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "DM Sans";
    src: url("../fonts/DMSans-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

/* ---------- Colors and sizes ---------- */

:root {
    /* Text and dark surfaces */
    --ink: #0F1B2D;
    /* Buttons and chips sitting on Ink */
    --ink-raised: #1E2F47;
    /* Secondary text on Ink */
    --mist: #B9C2CF;
    /* The accent. Only ever a fill, or text on Ink: lime text on white is unreadable. */
    --signal: #C8F04A;
    /* App background, cards, and lines */
    --paper: #F4F5F0;
    --surface: #FFFFFF;
    --line: #E2E5DD;
    --chip: #E9ECE4;
    /* Borders of the search box and currency button */
    --edge: #D5DAD0;
    /* Secondary text on light backgrounds */
    --slate: #566070;
    --placeholder: #6B7482;
    /* Attention: not installed yet, awaiting payment */
    --amber: #F2A93B;
    /* Errors, e.g. an invalid discount code */
    --danger: #B3261E;

    --heading-font: "Bricolage Grotesque", system-ui, sans-serif;
    --text-font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --column: 560px;
    --gutter: 20px;
    --tabbar-height: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    color-scheme: light;
}

/* ---------- Basics ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--paper);
    color: var(--ink);
    font: 400 15px/1.4 var(--text-font);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p, ul, ol, fieldset {
    margin: 0;
    padding: 0;
}

ul, ol {
    list-style: none;
}

fieldset {
    border: 0;
    min-width: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

img, svg {
    display: block;
}

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

h1:focus {
    outline: none; /* FocusOnNavigate puts the focus on each screen's title */
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- App frame ---------- */

.app {
    position: relative;
    max-width: var(--column);
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

.app--tabs {
    padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom));
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* On a computer: the phone-width column on a slightly darker background. */
@media (min-width: 640px) {
    body {
        background: var(--chip);
    }

    .app {
        box-shadow: 0 0 0 1px var(--line), 0 12px 40px rgba(15, 27, 45, 0.08);
    }
}

.content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px var(--gutter) 24px;
    flex: 1;
}

.section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ---------- Text ---------- */

/* Big screen titles, e.g. "Where to next?" */
.display {
    font: 700 34px/1.05 var(--heading-font);
    letter-spacing: -0.018em;
}

.display--small {
    font-size: 28px;
}

.display--on-ink {
    color: var(--paper);
    font-size: 30px;
}

.display--amount {
    font-size: 36px;
}

/* Card titles and plan sizes */
.title {
    font: 700 19px/1.2 var(--heading-font);
}

.title--small {
    font-size: 18px;
}

.title--reference {
    font-size: 24px;
    letter-spacing: 0.01em;
}

.price {
    font: 700 18px/1.2 var(--heading-font);
    white-space: nowrap;
}

.price--large {
    font-size: 22px;
}

.caption {
    font-size: 13px;
    color: var(--slate);
}

.caption--large {
    font-size: 15px;
}

/* Small uppercase section headings, e.g. "ALL REGIONS" */
.overline {
    font: 600 13px/1.3 var(--text-font);
    color: var(--slate);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.strong {
    font-weight: 600;
}

.small {
    font-size: 13px;
}

.slate {
    color: var(--slate);
}

.ink {
    color: var(--ink);
}

.centered {
    text-align: center;
}

.break-all {
    word-break: break-all;
}

.pre-line {
    white-space: pre-line;
    line-height: 1.35;
}

.danger-text {
    font-size: 13px;
    color: var(--danger);
}

.inline-icon {
    display: inline-block;
    vertical-align: -3px;
}

/* ---------- Buttons ---------- */

/* The lime primary button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 24px;
    border: 0;
    border-radius: 16px;
    background: var(--signal);
    color: var(--ink);
    font: 700 17px/1.2 var(--text-font);
    text-align: center;
}

.btn:disabled {
    background: var(--line);
    color: var(--slate);
    cursor: default;
}

.btn--full {
    width: 100%;
}

.btn--narrow {
    align-self: center;
    min-width: 160px;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 16px;
    border: 1.5px solid var(--ink);
    border-radius: 16px;
    background: transparent;
    color: var(--ink);
    font: 600 16px/1.2 var(--text-font);
    text-align: center;
}

.btn-outline:disabled {
    border-color: var(--edge);
    color: var(--slate);
    cursor: default;
}

.btn-outline.is-on {
    background: var(--ink);
    color: var(--paper);
}

/* Small square buttons, e.g. the − / + day stepper */
.btn-step {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--chip);
    color: var(--ink);
    font: 600 22px/1 var(--text-font);
}

.btn-step:disabled {
    opacity: 0.45;
    cursor: default;
}

.btn-step--ink {
    background: var(--ink);
    color: var(--paper);
}

.btn-step--wide {
    width: auto;
    min-width: 72px;
    padding: 0 14px;
    font-size: 15px;
}

/* Text-only buttons, e.g. "Remove", "How to check" */
.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 8px;
    margin: 0 -8px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: 700 13px/1.2 var(--text-font);
    align-self: flex-start;
}

.btn-text--slate {
    color: var(--slate);
    font-size: 14px;
    font-weight: 600;
}

/* Round back button */
.round-button {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    color: var(--paper);
    align-self: flex-start;
}

.round-button--ink {
    background: var(--ink);
}

.round-button--raised {
    background: var(--ink-raised);
}

/* Square light button, e.g. Purchases on My eSIMs */
.square-button {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--edge);
    border-radius: 12px;
    background: var(--surface);
}

/* Cart, with how many eSIMs are in it */
.cart-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px 0 12px;
    border-radius: 12px;
    background: var(--ink);
    color: var(--paper);
}

.cart-button--raised {
    background: var(--ink-raised);
    border-radius: 22px;
    padding-right: 16px;
}

.cart-button__count {
    color: var(--signal);
    font: 700 16px/1 var(--text-font);
}

.button-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Two-way switch, e.g. Total data / Daily */
.segment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: var(--chip);
}

.segment__option {
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font: 600 15px/1 var(--text-font);
}

.segment__option.is-on {
    background: var(--ink);
    color: var(--paper);
}

/* ---------- Cards and lists ---------- */

.card {
    display: block;
    padding: 14px 16px;
    border-radius: 20px;
    background: var(--surface);
}

.card--roomy {
    padding: 16px 18px;
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-list--tight {
    gap: 8px;
}

a.card {
    transition: transform 0.12s ease;
}

a.card:active {
    transform: scale(0.985);
}

.chevron {
    flex: none;
    color: var(--slate);
}

/* A short explanation with an icon, e.g. when the plan starts */
.note {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    font-size: 13px;
    line-height: 1.35;
}

/* Colored message boxes */
.notice {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 13px;
}

.notice strong {
    font-size: 14px;
}

.notice--amber {
    background: var(--amber);
}

.notice--danger {
    background: #FBE9E7;
    color: var(--danger);
}

/* Status labels, e.g. "Ready to install" */
.pill {
    flex: none;
    align-self: flex-start;
    padding: 5px 10px;
    border-radius: 12px;
    font: 700 12px/1.2 var(--text-font);
    white-space: nowrap;
}

.pill--amber { background: var(--amber); }
.pill--chip { background: var(--chip); }
.pill--signal { background: var(--signal); }

.chip {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    border-radius: 16px;
    font-size: 13px;
    white-space: nowrap;
}

.chip--on-ink {
    background: var(--ink-raised);
    color: var(--paper);
}

.chip--removable {
    align-self: flex-start;
    height: 40px;
    padding: 0 2px 0 14px;
    border-radius: 20px;
    background: var(--chip);
    font-size: 15px;
    font-weight: 600;
}

.chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
}

/* Empty, error and sign-in-needed states */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 12px;
    text-align: center;
}

.empty-state--full {
    flex: 1;
    justify-content: center;
    padding: 32px;
}

.empty-state .btn {
    margin-top: 8px;
}

.empty-state__icon {
    color: var(--ink);
}

/* ---------- Loading ---------- */

.spinner-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.spinner-box--full {
    flex: 1;
    display: flex;
    min-height: 40vh;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--line);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner--small {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

.btn .spinner {
    border-color: rgba(15, 27, 45, 0.2);
    border-top-color: var(--ink);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Ink header (Region, Install, Pay, Purchases) ---------- */

.ink-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px var(--gutter) 22px;
    border-radius: 0 0 28px 28px;
    background: var(--ink);
    color: var(--paper);
}

.ink-header--tall {
    gap: 16px;
    padding-bottom: 26px;
}

.ink-header__bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
}

.ink-header__titles {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ink-header__titles .display {
    font-size: 32px;
}

.ink-header__subtitle {
    font-size: 14px;
    color: var(--mist);
}

.ink-header__lead {
    font-size: 15px;
    color: var(--mist);
}

.check-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--signal);
    color: var(--ink);
}

/* Country chips that scroll sideways */
.chip-scroller {
    display: flex;
    gap: 6px;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
}

.chip-scroller::-webkit-scrollbar {
    display: none;
}

.chip-scroller__more {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    height: 36px;
    color: var(--signal);
    font: 700 13px/1 var(--text-font);
    white-space: nowrap;
}

/* ---------- Bottom bar (Region, Cart) ---------- */

.bottom-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px var(--gutter) calc(16px + var(--safe-bottom));
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.bottom-bar__summary,
.bottom-bar__line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.bottom-bar__summary strong {
    font-weight: 700;
}

.bottom-bar__summary {
    margin-bottom: 4px;
}

.bottom-bar__total .caption {
    font-size: 15px;
}

.bottom-bar__amount {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.bottom-bar__hint {
    text-align: right;
}

.bottom-bar__buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.bottom-bar__buttons .btn,
.bottom-bar__buttons .btn-outline {
    min-height: 56px;
    padding: 0 12px;
}

.bottom-bar .btn--full {
    margin-top: 6px;
}

/* ---------- Tab bar ---------- */

.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    z-index: 10;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--column);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: calc(var(--tabbar-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.tabbar__tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--slate);
    font: 600 12px/1 var(--text-font);
}

.tabbar__tab.active {
    color: var(--ink);
}

.tabbar__tab.active span {
    font-weight: 700;
}

/* ---------- Explore ---------- */

.explore-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px var(--gutter) 0;
}

.brand-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand__name {
    font: 800 22px/1 var(--heading-font);
    letter-spacing: -0.027em;
}

.brand-row__actions {
    display: flex;
    gap: 8px;
}

.currency-button {
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--edge);
    border-radius: 12px;
    background: var(--surface);
    font: 600 15px/1 var(--text-font);
}

.explore-header .display {
    margin-top: 6px;
}

.search {
    position: relative;
}

.search__box {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 14px;
    border: 1.5px solid var(--edge);
    border-radius: 16px;
    background: var(--surface);
}

.search__box:focus-within {
    border-color: var(--ink);
}

.search__icon {
    flex: none;
    color: var(--slate);
}

.search__box input {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 16px; /* 16 px or more, or iPhones zoom in when the box gets the focus */
}

.search__box input::placeholder,
.code-box input::placeholder {
    color: var(--placeholder);
}

/* Suggestions float over the list while typing */
.suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 20;
    padding: 6px 0;
    border: 1px solid var(--line);
    box-shadow: 0 12px 32px rgba(15, 27, 45, 0.12);
}

.suggestions__heading {
    padding: 10px 18px 2px;
    font-size: 12px;
}

.suggestions__none {
    padding: 12px 18px;
}

.suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 4px 18px;
    border: 0;
    background: transparent;
    font-size: 16px;
    text-align: left;
}

.suggestion:hover,
.suggestion:focus-visible {
    background: var(--paper);
}

.suggestion__flag {
    font-size: 22px;
    line-height: 1;
}

.suggestion__text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.suggestion__text .caption {
    font-size: 12px;
}

.region-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
}

.region-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.region-card__countries {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.region-card__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.region-card__price .caption {
    font-size: 12px;
}

/* ---------- Region ---------- */

.stepper-card {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 6px;
    padding: 6px 6px 6px 16px;
}

.stepper-card__label {
    font-weight: 600;
}

.stepper-card__value {
    min-width: 80px;
    text-align: center;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 480px) {
    .plan-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.plan-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: 96px;
    padding: 12px 14px;
    border: 0;
    border-radius: 18px;
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    transition: background-color 0.12s ease;
}

.plan-tile__data {
    font: 700 24px/1.15 var(--heading-font);
}

.plan-tile__detail {
    font-size: 13px;
    color: var(--slate);
}

.plan-tile__price {
    font: 700 19px/1.2 var(--heading-font);
}

/* Selected: Ink with a lime price */
.plan-tile.is-selected {
    background: var(--ink);
}

.plan-tile.is-selected .plan-tile__data {
    color: var(--paper);
}

.plan-tile.is-selected .plan-tile__detail {
    color: var(--mist);
}

.plan-tile.is-selected .plan-tile__price {
    color: var(--signal);
}

/* ---------- Countries ---------- */

.page-titles {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
}

.country-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 14px;
}

.country-row__flag {
    font-size: 28px;
    line-height: 1;
}

.country-row__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.country-row__name {
    font-weight: 600;
    font-size: 16px;
}

/* ---------- Cart ---------- */

.title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-row .round-button {
    align-self: center;
}

.title-row--spread {
    justify-content: space-between;
    margin-top: 0;
}

.cart-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 10px 10px 16px;
}

.cart-row__top,
.cart-row__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.cart-row__top {
    align-items: flex-start;
    padding-right: 6px;
}

.cart-row__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-row__bottom .btn-text {
    margin: 0;
    align-self: center;
}

.quantity {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quantity__value {
    width: 32px;
    text-align: center;
    font: 700 18px/1 var(--heading-font);
}

.code-box {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    padding: 0 6px 0 14px;
    border-radius: 16px;
    background: var(--surface);
}

.code-box:focus-within {
    box-shadow: 0 0 0 1.5px var(--ink);
}

.code-box input {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 16px;
}

.applied-code {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
}

.applied-code .btn-text {
    margin: 0;
    align-self: center;
}

.radio-card {
    padding: 4px 8px;
}

.radio-row,
.check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
}

.radio-row + .radio-row {
    border-top: 1px solid var(--line);
}

.radio-row input,
.check-row input {
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--ink);
}

.check-card {
    display: flex;
    flex-direction: column;
    padding: 8px 14px 6px 8px;
}

.check-row {
    align-items: flex-start;
    padding-top: 12px;
    font-size: 15px;
}

.check-row input {
    margin-top: 1px;
}

.check-card .btn-text {
    margin-left: 34px;
}

.retry-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.google-signin {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.google-signin__button {
    min-height: 44px;
    width: 100%;
    max-width: 400px;
}

.google-signin__button.is-hidden {
    visibility: hidden;
    height: 0;
    min-height: 0;
    overflow: hidden;
}

.google-signin__busy {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-weight: 600;
}

/* ---------- Pay, Install ---------- */

.copy-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding-right: 10px;
}

.copy-card--top {
    align-items: start;
}

.copy-card__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.qr-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
}

.qr-card img {
    width: 220px;
    height: 220px;
    image-rendering: pixelated;
}

.manual-card {
    padding: 6px 8px 6px 16px;
}

.manual-card__row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    min-height: 64px;
    padding: 8px 0;
}

.manual-card__row + .manual-card__row {
    border-top: 1px solid var(--line);
}

.manual-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.manual-card__text .caption {
    font-size: 12px;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.steps__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.steps__list li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
}

.steps__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--signal);
    font: 700 13px/1 var(--text-font);
}

.support-ids {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 4px;
}

.support-ids .btn-text {
    margin: 0;
    align-self: center;
    font-size: 13px;
}

/* ---------- My eSIMs, Purchases ---------- */

.esim-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 16px 18px;
}

.esim-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.purchase {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px 16px;
}

.purchase__top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.purchase__id {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reference-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 0;
    border: 0;
    background: transparent;
}

.purchase__lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
}

.payment-note {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--paper);
    font-size: 14px;
}

.purchase__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

/* ---------- Messages ---------- */

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px 16px calc(16px + var(--safe-bottom));
    background: rgba(15, 27, 45, 0.45);
    animation: fade-in 0.15s ease;
}

@media (min-width: 640px) {
    .dialog-backdrop {
        align-items: center;
    }
}

.dialog {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 420px;
    max-height: 85dvh;
    overflow-y: auto;
    padding: 20px;
    border-radius: 24px;
    background: var(--surface);
    animation: rise 0.18s ease;
}

.dialog__message {
    white-space: pre-line;
    font-size: 15px;
    line-height: 1.4;
}

.dialog .btn {
    margin-top: 4px;
}

.sheet {
    gap: 8px;
}

.sheet .title {
    margin-bottom: 4px;
}

.sheet__option {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 16px;
    border: 0;
    border-radius: 14px;
    background: var(--paper);
    font-weight: 600;
    font-size: 16px;
    text-align: left;
}

.sheet__option.is-on {
    background: var(--ink);
    color: var(--paper);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 16px);
    z-index: 60;
    transform: translateX(-50%);
    max-width: calc(min(100vw, var(--column)) - 40px);
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--ink);
    color: var(--paper);
    font-size: 14px;
    overflow-wrap: anywhere;
    box-shadow: 0 8px 24px rgba(15, 27, 45, 0.25);
    animation: toast-rise 0.18s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
}

@keyframes toast-rise {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { transform: translate(-50%, 0); }
}

/* ---------- Start-up, errors, updates (index.html) ---------- */

.boot {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: var(--ink);
}

.boot__bar {
    width: 120px;
    height: 4px;
    border-radius: 2px;
    background: var(--ink-raised);
    overflow: hidden;
}

.boot__bar span {
    display: block;
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    background: var(--signal);
    transition: width 0.2s ease;
}

.boot__text {
    color: var(--mist);
}

#blazor-error-ui,
#update-ui {
    position: fixed;
    left: 50%;
    bottom: calc(var(--safe-bottom) + 16px);
    z-index: 100;
    display: none;
    align-items: center;
    gap: 14px;
    transform: translateX(-50%);
    width: calc(min(100vw, var(--column)) - 32px);
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--ink);
    color: var(--paper);
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(15, 27, 45, 0.25);
}

#update-ui.is-shown {
    display: flex;
}

#blazor-error-ui .reload,
#update-ui .reload {
    margin-left: auto;
    color: var(--signal);
    font-weight: 700;
}

#blazor-error-ui .dismiss {
    border: 0;
    background: transparent;
    color: var(--mist);
    font-size: 16px;
}

/* ---------- Stacks: children one under the other, with a gap. Last, so they win over .card. ---------- */

.stack-2, .stack-6, .stack-10, .stack-12 {
    display: flex;
    flex-direction: column;
}

.stack-2 { gap: 2px; }
.stack-6 { gap: 6px; }
.stack-10 { gap: 10px; }
.stack-12 { gap: 12px; }
