/* Subscriber panel (/app) — the installed PWA screen. Same palette as the site. */
:root {
    --ap-bg: #f0f9ff;
    --ap-card: #ffffff;
    --ap-ink: #0c2d48;
    --ap-muted: #5b7a93;
    --ap-line: rgba(14, 165, 233, .18);
    --ap-sky: #0ea5e9;
    --ap-sky-d: #0284c7;
    --ap-sky-l: #38bdf8;
    --ap-soft: #e0f2fe;
    --ap-accent: 249, 115, 22;
    --ap-shadow: 0 4px 14px rgba(var(--ap-accent), .16), 0 1px 3px rgba(2, 132, 199, .12);
    --ap-font: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
}

[data-theme="dark"] {
    color-scheme: dark;
    --ap-bg: #0a1524;
    --ap-card: #0f2236;
    --ap-ink: #e2f0fb;
    --ap-muted: #93b4cc;
    --ap-line: rgba(56, 189, 248, .22);
    --ap-soft: rgba(56, 189, 248, .12);
    --ap-shadow: 0 4px 16px rgba(var(--ap-accent), .2), 0 1px 3px rgba(0, 0, 0, .4);
}

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

html, body {
    margin: 0;
    background: var(--ap-bg);
}

.ap-body {
    min-height: 100vh;
    color: var(--ap-ink);
    font-family: var(--ap-font);
    font-size: 16px;
    line-height: 1.45;
    -webkit-tap-highlight-color: transparent;
}

.ap {
    max-width: 560px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

a {
    color: var(--ap-sky-d);
}

[data-theme="dark"] a {
    color: #7dd3fc;
}

[hidden] {
    display: none !important;
}

/* header */
.ap-top {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: color-mix(in srgb, var(--ap-bg) 82%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ap-line);
}

.ap-logo {
    display: inline-flex;
    padding: 2px 4px;
    border-radius: 10px;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, .6) 70%, transparent);
    filter: drop-shadow(0 0 6px rgba(var(--ap-accent), .35));
}

.ap-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.ap-demo {
    margin: 10px 16px 0;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(var(--ap-accent), .12);
    color: #c2410c;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

[data-theme="dark"] .ap-demo {
    color: #fdba74;
}

.ap-main {
    padding: 14px 16px 0;
}

/* cards & rows */
.ap-card {
    margin-bottom: 12px;
    padding: 16px;
    border: 1.5px solid var(--ap-sky-l);
    border-radius: 18px;
    background: var(--ap-card);
    box-shadow: var(--ap-shadow);
}

.ap-muted {
    color: var(--ap-muted);
}

.ap-h {
    margin: 18px 4px 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ap-ink);
}

.ap-h-in {
    margin: 0 0 10px;
    color: var(--ap-ink);
}

.ap-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-top: 1px solid var(--ap-line);
}

.ap-row span {
    color: var(--ap-muted);
}

.ap-hello .ap-name {
    margin: 2px 0 8px;
    font-size: 22px;
    font-weight: 700;
}

.ap-status.active { color: #16a34a; }
.ap-status.passive { color: #ca8a04; }
.ap-status.blocked { color: #dc2626; }

.ap-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

.ap-stat span {
    color: var(--ap-muted);
    font-size: 14px;
}

.ap-stat b {
    font-size: 21px;
}

.ap-tariff-mini {
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
}

.ap-tariff-mini b {
    font-size: 19px;
}

.ap-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.ap-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    border: 1.5px solid var(--ap-sky-l);
    border-radius: 16px;
    background: var(--ap-card);
    color: var(--ap-sky-d);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--ap-shadow);
    cursor: pointer;
}

[data-theme="dark"] .ap-action {
    color: #7dd3fc;
}

.ap-package-name {
    font-size: 24px;
    font-weight: 700;
}

.ap-package-speed {
    margin-bottom: 8px;
    color: var(--ap-sky-d);
    font-size: 18px;
    font-weight: 700;
}

[data-theme="dark"] .ap-package-speed {
    color: #7dd3fc;
}

/* lists */
.ap-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1.5px solid var(--ap-sky-l);
    border-radius: 18px;
    background: var(--ap-card);
    box-shadow: var(--ap-shadow);
    overflow: hidden;
}

.ap-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2px 10px;
    padding: 12px 16px;
}

.ap-list li + li {
    border-top: 1px solid var(--ap-line);
}

.ap-list li span {
    font-weight: 700;
}

.ap-list li small {
    grid-column: 1;
    color: var(--ap-muted);
    font-size: 13px;
}

.ap-list li .ap-badge {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.ap-list li.ap-empty span {
    font-weight: 400;
    color: var(--ap-muted);
}

.ap-badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.ap-badge.open { background: rgba(234, 179, 8, .16); color: #a16207; }
.ap-badge.closed { background: rgba(22, 163, 74, .14); color: #15803d; }

[data-theme="dark"] .ap-badge.open { color: #fde047; }
[data-theme="dark"] .ap-badge.closed { color: #86efac; }

/* forms & buttons */
.ap-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ap-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ap-muted);
}

.ap-form input,
.ap-form select,
.ap-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--ap-line);
    border-radius: 14px;
    background: var(--ap-bg);
    color: var(--ap-ink);
    font: inherit;
    font-size: 17px;
}

.ap-form input:focus,
.ap-form select:focus,
.ap-form textarea:focus {
    outline: none;
    border-color: var(--ap-sky);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .2);
}

.ap-phone {
    display: flex;
    align-items: stretch;
}

.ap-phone > span {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1.5px solid var(--ap-line);
    border-right: 0;
    border-radius: 14px 0 0 14px;
    background: var(--ap-soft);
    color: var(--ap-ink);
    font-size: 17px;
}

.ap-phone input {
    border-radius: 0 14px 14px 0;
}

.ap-code {
    letter-spacing: .4em;
    text-align: center;
    font-size: 22px !important;
}

.ap-btn {
    display: block;
    width: 100%;
    padding: 13px;
    border: 1.5px solid var(--ap-sky-l);
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ap-sky), var(--ap-sky-d));
    color: #fff !important;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(var(--ap-accent), .3);
    cursor: pointer;
}

.ap-btn:disabled {
    opacity: .6;
}

.ap-btn-ghost {
    background: transparent;
    color: var(--ap-sky-d) !important;
    box-shadow: none;
}

[data-theme="dark"] .ap-btn-ghost {
    color: #7dd3fc !important;
}

.ap-msg {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(220, 38, 38, .1);
    color: #b91c1c;
    font-size: 14px;
}

.ap-msg.ok {
    background: rgba(22, 163, 74, .12);
    color: #15803d;
}

[data-theme="dark"] .ap-msg { color: #fca5a5; }
[data-theme="dark"] .ap-msg.ok { color: #86efac; }

.ap-login {
    margin-top: 8px;
    text-align: center;
}

.ap-login h2 {
    margin: 6px 0 4px;
    font-size: 22px;
}

.ap-login p {
    margin: 0 0 16px;
    font-size: 15px;
}

.ap-login .ap-form {
    text-align: left;
}

.ap-login-icon,
.ap-sheet-icon {
    display: inline-flex;
    padding: 14px;
    border-radius: 50%;
    background: var(--ap-soft);
    color: var(--ap-sky-d);
}

/* settings */
.ap-set {
    padding: 4px 0;
}

.ap-set-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    background: none;
    color: var(--ap-ink) !important;
    font: inherit;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.ap-set-row + .ap-set-row,
.ap-set-form {
    border-top: 1px solid var(--ap-line);
}

.ap-set-form {
    margin: 0;
}

/* the first row of a card (e.g. Sign out, Phone) gets no divider line on top */
.ap-set-form:first-child,
.ap-card > .ap-row:first-child {
    border-top: 0;
}

.ap-set-row svg {
    flex: none;
    color: var(--ap-sky-d);
}

.ap-set-row span {
    flex: 1;
}

.ap-set-row em {
    color: var(--ap-muted);
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
}

.ap-soon {
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(var(--ap-accent), .14);
    color: #c2410c !important;
    font-weight: 700 !important;
}

.ap-danger,
.ap-danger svg {
    color: #dc2626 !important;
}

.ap-set-note {
    padding: 0 16px 10px 50px;
    font-size: 13px;
}

.ap-switch {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    position: relative;
    width: 50px;
    height: 30px;
    margin: 0;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background .2s;
    cursor: pointer;
}

.ap-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: transform .2s;
}

.ap-switch:checked {
    background: var(--ap-sky);
}

.ap-switch:checked::after {
    transform: translateX(20px);
}

.ap-switch:disabled {
    opacity: .5;
}

.ap-seg {
    display: flex;
    padding: 4px;
    border: 1.5px solid var(--ap-sky-l);
    border-radius: 14px;
    background: var(--ap-card);
    box-shadow: var(--ap-shadow);
}

.ap-seg a,
.ap-seg button {
    flex: 1;
    padding: 10px 6px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--ap-ink) !important;
    font: inherit;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.ap-seg .active {
    background: linear-gradient(135deg, var(--ap-sky), var(--ap-sky-d));
    color: #fff !important;
}

/* bottom tab bar */
.ap-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(var(--n), 1fr);
    max-width: 560px;
    margin: 0 auto;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-top: 1.5px solid var(--ap-sky-l);
    background: color-mix(in srgb, var(--ap-card) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 16px rgba(var(--ap-accent), .14);
}

@media (min-width: 561px) {
    .ap-tabs {
        bottom: 10px;
        border: 1.5px solid var(--ap-sky-l);
        border-radius: 20px;
    }
}

.ap-tabs button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--ap-ink);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.ap-tabs button.active {
    color: var(--ap-sky-d);
    background: var(--ap-soft);
}

[data-theme="dark"] .ap-tabs button.active {
    color: #7dd3fc;
}

/* bottom sheet (chat placeholder) */
.ap-sheet {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    background: rgba(12, 45, 72, .45);
}

.ap-sheet-card {
    width: 100%;
    max-width: 440px;
    padding: 22px 20px 16px;
    border: 1.5px solid var(--ap-sky-l);
    border-radius: 22px;
    background: var(--ap-card);
    text-align: center;
    box-shadow: var(--ap-shadow);
}

.ap-sheet-card h3 {
    margin: 10px 0 4px;
}

.ap-sheet-card p {
    margin: 0 0 14px;
}

.ap-sheet-card .ap-btn + .ap-btn {
    margin-top: 8px;
}

/* Panel only inside the installed app (html.is-pwa) or in the office preview; a browser gets the install gate. */
.ap-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 420px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px 20px 120px;
    text-align: center;
}

.ap-gate img {
    border-radius: 22px;
    box-shadow: 0 0 0 4px #fff, 0 8px 24px rgba(var(--ap-accent), .45);
}

.ap-gate h1 {
    margin: 16px 0 0;
    font-size: 24px;
}

.ap-gate p {
    margin: 0 0 14px;
    color: var(--ap-muted);
}

.ap-gate .ap-gate-note {
    margin: 14px 0 0;
    font-size: 14px;
}

.ap-gate-desktop,
html.is-desktop .ap-gate .ap-btn,
html.is-desktop .ap-gate-note {
    display: none !important;
}

html.is-desktop .ap-gate-desktop {
    display: block !important;
    margin: 0;
    font-weight: 700;
}

.ap-gate .ap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ap {
    display: none;
}

html.is-pwa .ap,
.ap-demo-mode .ap,
.ap-web-mode .ap {
    display: block;
}

html.is-pwa .ap-gate,
.ap-demo-mode .ap-gate,
.ap-web-mode .ap-gate {
    display: none !important;
}

.ap-bell-first {
    margin-left: auto !important;
}

/* PWA (phone): tighter spacing between blocks, still airy */
@media (max-width: 899px) {
    .ap-main {
        padding-top: 10px;
    }

    .ap-card {
        margin-bottom: 8px;
        padding: 12px 14px;
        border-radius: 16px;
    }

    .ap-h {
        margin: 10px 4px 1px;
        font-size: 14.5px;
        line-height: 1.25;
    }

    .ap-row {
        padding: 5px 0;
    }

    .ap-list li {
        padding: 9px 14px;
    }

    .ap-set {
        padding: 2px 0;
    }

    .ap-set-row {
        padding: 9px 14px;
    }

    .ap-set-note {
        padding: 0 14px 8px 48px;
    }

    .ap-hello {
        gap: 12px;
    }

    .ap-hello .ap-name {
        font-size: 20px;
    }

    .ap-avatar {
        padding: 10px;
    }

    .ap-balance-sum {
        font-size: 32px;
    }

    .ap-balance .ap-btn {
        margin-top: 8px;
        padding: 10px;
    }

    .ap-tariffs {
        gap: 8px;
    }

    .ap-tariff {
        padding: 12px;
    }

    .ap-demo {
        margin: 8px 16px 0;
    }
}

/* Profile: language + appearance side by side, small */
.ap-prefs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ap-prefs .ap-seg {
    padding: 3px;
    border-radius: 11px;
}

.ap-prefs .ap-seg a,
.ap-prefs .ap-seg button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1;
}

.ap-prefs .ap-seg svg {
    display: block;
}

/* "New request" form: compact everywhere (PWA and website) */
#ap-complaint {
    gap: 8px;
    padding: 14px 16px;
}

#ap-complaint .ap-h-in {
    margin: 0 0 4px;
    font-size: 13px;
}

#ap-complaint label {
    gap: 4px;
    font-size: 13px;
}

#ap-complaint select,
#ap-complaint textarea {
    padding: 8px 12px;
    border-radius: 11px;
    font-size: 15px;
}

#ap-complaint textarea {
    min-height: 64px;
    resize: vertical;
}

#ap-complaint .ap-btn {
    padding: 9px;
    border-radius: 11px;
    font-size: 15px;
}

/* payments / requests rows + page numbers */
.ap-rows li {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 12px;
}

.ap-rows .ap-row-date {
    color: var(--ap-muted);
    font-size: 13px;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.ap-rows .ap-row-main {
    font-weight: 700;
    font-size: 15px;
    min-width: 0;
}

.ap-list.ap-rows li {
    padding: 9px 14px;
}

.ap-rows .ap-row-main small {
    display: block;
    overflow: hidden;
    color: var(--ap-muted);
    font-size: 12.5px;
    font-weight: 400;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ap-rows li .ap-badge {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    white-space: nowrap;
}

.ap-rows .ap-row-sum {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ap-rows .ap-row-sum.in { color: #15803d; }
.ap-rows .ap-row-sum.out { color: var(--ap-ink); }
[data-theme="dark"] .ap-rows .ap-row-sum.in { color: #86efac; }

.ap-rows li.ap-empty {
    display: block;
    color: var(--ap-muted);
    text-align: center;
}

.ap-rows.loading {
    opacity: .5;
}

.ap-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 10px 0 4px;
}

.ap-pager:empty {
    display: none;
}

.ap-pager button {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid var(--ap-sky-l);
    border-radius: 8px;
    background: var(--ap-card);
    color: var(--ap-ink);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.ap-pager button.active {
    background: linear-gradient(135deg, var(--ap-sky), var(--ap-sky-d));
    color: #fff;
    border-color: transparent;
    opacity: 1;
}

.ap-pager button:disabled:not(.active) {
    opacity: .4;
    cursor: default;
}

.ap-pager span {
    color: var(--ap-muted);
}

/* the left-menu sign out and the top language/appearance switches exist only in the website cabinet on computers */
.ap-tab-logout,
.ap-top-tools {
    display: none;
}

@media (min-width: 900px) {
    .ap-web-mode .ap-tab-logout {
        display: block;
    }

    .ap-web-mode .ap-top-tools {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
    }

    .ap-web-mode .ap-top-tools .ap-seg {
        padding: 3px;
        border-radius: 11px;
    }

    .ap-web-mode .ap-top-tools .ap-seg a,
    .ap-web-mode .ap-top-tools .ap-seg button {
        flex: none;
        min-width: 36px;
        padding: 5px 9px;
        border-radius: 8px;
        font-size: 13px;
        line-height: 1;
    }

    .ap-web-mode .ap-seg-icons button svg {
        display: block;
    }

    .ap-web-mode .ap-top-tools ~ .ap-bell-first {
        margin-left: 8px !important;
    }

    .ap-web-mode .ap-prefs,
    .ap-web-mode .ap-login + .ap-seg {
        display: none;
    }
}

/* login: a neat compact card (centered, not full width) */
.ap-view[data-view="login"] {
    max-width: 420px;
    margin: 0 auto;
}

.ap-login {
    padding: 22px 22px 20px;
}

.ap-login-icon {
    padding: 11px;
}

.ap-login-icon svg {
    width: 24px;
    height: 24px;
}

.ap-login h2 {
    font-size: 19px;
}

.ap-login p {
    font-size: 14px;
    margin-bottom: 14px;
}

.ap-login .ap-form {
    gap: 10px;
}

.ap-login .ap-form input,
.ap-login .ap-phone > span {
    padding-top: 9px;
    padding-bottom: 9px;
    font-size: 16px;
}

.ap-login .ap-btn {
    padding: 10px;
    font-size: 15px;
}

.ap-login + .ap-seg a {
    padding: 7px 6px;
    font-size: 14px;
}

@media (min-width: 900px) {
    .ap-web-mode .ap-view[data-view="login"] {
        margin-top: 40px;
    }
}

/* Website cabinet on computers: menu on the left (top to bottom), content on the right, compact sizes.
   The installed PWA keeps the phone layout. */
@media (min-width: 900px) {
    .ap-web-mode {
        font-size: 14.5px;
    }

    .ap-web-mode .ap[data-signed-in="1"] {
        display: grid;
        /* content column 560 px */
        grid-template-columns: 170px minmax(0, 560px);
        grid-template-areas: "top top" "demo demo" "nav main";
        grid-template-rows: auto auto 1fr;
        align-content: start;
        justify-content: center;
        column-gap: 18px;
        max-width: 790px;
        padding: 0 20px 30px;
    }

    .ap-web-mode .ap-top {
        grid-area: top;
        padding: 12px 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .ap-web-mode .ap-demo {
        grid-area: demo;
        margin: 10px 0 0;
    }

    .ap-web-mode .ap-main {
        grid-area: main;
        padding: 16px 0 0;
    }

    .ap-web-mode .ap-title {
        font-size: 18px;
    }

    /* left menu */
    .ap-web-mode .ap-tabs {
        grid-area: nav;
        position: sticky;
        top: 16px;
        align-self: start;
        display: flex;
        flex-direction: column;
        gap: 2px;
        max-width: none;
        margin: 16px 0 0;
        padding: 6px;
        border: 1.5px solid var(--ap-sky-l);
        border-radius: 12px;
        background: var(--ap-card);
        box-shadow: var(--ap-shadow);
        backdrop-filter: none;
    }

    .ap-web-mode .ap-tabs button {
        flex-direction: row;
        justify-content: flex-start;
        gap: 8px;
        padding: 7px 10px;
        border-radius: 8px;
        font-size: 13.5px;
        text-align: left;
    }

    .ap-web-mode .ap-tabs button svg {
        width: 16px;
        height: 16px;
    }

    /* compact content */
    .ap-web-mode .ap-card {
        margin-bottom: 10px;
        padding: 12px 16px;
        border-radius: 14px;
    }

    .ap-web-mode .ap-h {
        margin: 14px 2px 6px;
        font-size: 14px;
    }

    .ap-web-mode .ap-row {
        padding: 6px 0;
    }

    .ap-web-mode .ap-hello .ap-name {
        font-size: 18px;
    }

    .ap-web-mode .ap-avatar {
        padding: 9px;
    }

    .ap-web-mode .ap-avatar svg {
        width: 24px;
        height: 24px;
    }

    .ap-web-mode .ap-list {
        border-radius: 14px;
    }

    .ap-web-mode .ap-list li {
        padding: 9px 14px;
    }

    .ap-web-mode .ap-balance-sum {
        font-size: 28px;
    }

    .ap-web-mode .ap-balance .ap-btn,
    .ap-web-mode .ap-btn {
        padding: 9px 14px;
        font-size: 14.5px;
    }

    .ap-web-mode .ap-balance .ap-btn {
        width: auto;
        min-width: 220px;
    }

    .ap-web-mode .ap-seg {
        max-width: 420px;
    }

    .ap-web-mode .ap-seg a,
    .ap-web-mode .ap-seg button {
        padding: 7px 6px;
        font-size: 14px;
    }

    .ap-web-mode .ap-set-row {
        padding: 9px 14px;
    }

    .ap-web-mode .ap-tariffs {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 10px;
    }

    .ap-web-mode .ap-tariff {
        padding: 12px;
    }

    .ap-web-mode .ap-tariff-name {
        font-size: 15px;
    }

    .ap-web-mode .ap-tariff-price {
        font-size: 17px;
        margin-bottom: 8px;
    }

    .ap-web-mode .ap-btn-sm,
    .ap-web-mode .ap-tariff-tag {
        padding: 6px;
        font-size: 13px;
        border-radius: 10px;
    }

    .ap-web-mode .ap-form input,
    .ap-web-mode .ap-form select,
    .ap-web-mode .ap-form textarea {
        padding: 9px 12px;
        font-size: 15px;
    }

    .ap-web-mode .ap-bell {
        padding: 6px;
    }

    .ap-web-mode .ap-bell svg {
        width: 20px;
        height: 20px;
    }

    /* sign out in the left menu (bottom); not repeated in Profile */
    .ap-web-mode .ap-tab-logout {
        margin: 4px 0 0;
        padding-top: 4px;
        border-top: 1px solid var(--ap-line);
    }

    .ap-web-mode .ap-tab-logout button {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 7px 10px;
        border: 0;
        border-radius: 8px;
        background: none;
        color: #dc2626;
        font: inherit;
        font-size: 13.5px;
        font-weight: 700;
        cursor: pointer;
    }

    .ap-web-mode .ap-tab-logout button:hover {
        background: rgba(220, 38, 38, .08);
    }

    .ap-web-mode .ap-tab-logout svg {
        width: 16px;
        height: 16px;
    }

    .ap-web-mode .ap-logout-card {
        display: none;
    }

    /* smaller controls in the content (language, appearance, setting rows) */
    .ap-web-mode .ap-main .ap-seg {
        max-width: 300px;
        padding: 3px;
        border-radius: 11px;
    }

    .ap-web-mode .ap-main .ap-seg a,
    .ap-web-mode .ap-main .ap-seg button {
        padding: 5px 6px;
        border-radius: 8px;
        font-size: 13px;
    }

    .ap-web-mode .ap-set-row {
        padding: 7px 12px;
        font-size: 14px;
    }

    .ap-web-mode .ap-set-row svg {
        width: 18px;
        height: 18px;
    }

    .ap-web-mode .ap-set-row em {
        font-size: 13px;
    }

    .ap-web-mode .ap-switch {
        width: 40px;
        height: 24px;
    }

    .ap-web-mode .ap-switch::after {
        width: 18px;
        height: 18px;
    }

    .ap-web-mode .ap-switch:checked::after {
        transform: translateX(16px);
    }

    .ap-web-mode .ap-set-note {
        padding: 0 12px 8px 42px;
        font-size: 12.5px;
    }

    /* signed out: the login card alone, centered */
    .ap-web-mode .ap[data-signed-in="0"] {
        max-width: 1080px;
        padding: 0 20px;
    }
}

.ap-body .st-install-fab {
    display: none;
}

/* profile */
.ap-hello {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ap-avatar {
    flex: none;
    display: inline-flex;
    padding: 12px;
    border-radius: 50%;
    background: var(--ap-soft);
    color: var(--ap-sky-d);
}

.ap-hello .ap-name {
    margin: 0;
}

/* label keeps its own width, the value (e.g. a long address) gets all the rest and wraps only when it really does not fit */
.ap-row > span {
    flex: none;
}

.ap-row b {
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
}

.ap-badge.price {
    background: var(--ap-soft);
    color: var(--ap-sky-d);
}

[data-theme="dark"] .ap-badge.price {
    color: #7dd3fc;
}

.ap-login + .ap-seg {
    margin-top: 4px;
}

/* payments */
.ap-balance {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}

.ap-balance-sum {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.15;
}

.ap-balance .ap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.ap-msg-in {
    margin: 0 16px 12px;
}

/* tariffs */
.ap-lead {
    margin: 0 4px 12px;
    font-size: 15px;
}

.ap-tariffs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ap-tariff {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 14px 14px;
    border: 1.5px solid var(--ap-sky-l);
    border-radius: 18px;
    background: var(--ap-card);
    box-shadow: var(--ap-shadow);
}

.ap-tariff.current {
    border-width: 2.5px;
    border-color: var(--ap-sky);
    background: linear-gradient(160deg, var(--ap-soft), var(--ap-card) 70%);
}

.ap-tariff-name {
    font-size: 17px;
    font-weight: 700;
}

.ap-tariff-speed {
    color: var(--ap-sky-d);
    font-weight: 700;
}

[data-theme="dark"] .ap-tariff-speed {
    color: #7dd3fc;
}

.ap-tariff-price {
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 700;
}

.ap-tariff-tag {
    margin-top: auto;
    padding: 8px;
    border-radius: 12px;
    background: rgba(22, 163, 74, .14);
    color: #15803d;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

[data-theme="dark"] .ap-tariff-tag {
    color: #86efac;
}

.ap-btn-sm {
    margin-top: auto;
    padding: 8px;
    font-size: 14px;
}

.ap-tariffs + .ap-msg {
    margin-top: 14px;
}

/* internet call */
.ap-call-btn {
    color: #16a34a !important;
}

.ap-call-btn + .ap-bell {
    margin-left: 8px;
}

.ap-call h3 {
    margin-bottom: 2px;
}

.ap-call-avatar {
    display: inline-flex;
    padding: 20px;
    border-radius: 50%;
    background: var(--ap-soft);
    color: var(--ap-sky-d);
    transition: background .2s, color .2s;
}

.ap-call-avatar.ring {
    animation: ap-ring 1.2s ease-in-out infinite;
}

.ap-call-avatar.talk {
    background: rgba(22, 163, 74, .14);
    color: #16a34a;
}

.ap-call-avatar.bad {
    background: rgba(220, 38, 38, .12);
    color: #dc2626;
}

@keyframes ap-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, .45); }
    50% { box-shadow: 0 0 0 16px rgba(14, 165, 233, 0); }
}

.ap-call-status {
    min-height: 22px;
    color: var(--ap-muted);
}

.ap-call-timer {
    margin-top: 4px;
    font-size: 26px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ap-call-volume {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 260px;
    margin: 14px auto 0;
    color: var(--ap-muted);
    font-size: 13px;
    font-weight: 700;
}

.ap-call-volume[hidden] {
    display: none;
}

.ap-call-volume input {
    flex: 1;
    accent-color: var(--ap-sky);
}

.ap-call-actions {
    display: flex;
    justify-content: center;
    gap: 26px;
    margin: 20px 0 14px;
}

.ap-call-round {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ap-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.ap-call-round svg {
    box-sizing: content-box;
    padding: 18px;
    border-radius: 50%;
    color: #fff;
}

.ap-call-round.go svg { background: #16a34a; box-shadow: 0 6px 18px rgba(22, 163, 74, .4); }
.ap-call-round.end svg { background: #dc2626; transform: rotate(135deg); box-shadow: 0 6px 18px rgba(220, 38, 38, .4); }
.ap-call-round.mute svg { background: var(--ap-soft); color: var(--ap-sky-d); }
.ap-call-round.mute.on svg { background: #f97316; color: #fff; }
.ap-call-round:disabled { opacity: .5; }

/* bell + notification list */
.ap-bell {
    position: relative;
    margin-left: auto;
    display: inline-flex;
    padding: 8px;
    border: 1.5px solid var(--ap-sky-l);
    border-radius: 50%;
    background: var(--ap-card);
    color: var(--ap-sky-d);
    box-shadow: var(--ap-shadow);
    cursor: pointer;
}

.ap-bell.active {
    background: var(--ap-soft);
}

[data-theme="dark"] .ap-bell {
    color: #7dd3fc;
}

.ap-bell-n {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #f97316;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.ap-inbox-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 28px;
    margin: 0 4px 10px;
    font-size: 14px;
}

.ap-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ap-sky-d);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

[data-theme="dark"] .ap-link {
    color: #7dd3fc;
}

.ap-inbox {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ap-inbox li {
    position: relative;
    margin-bottom: 10px;
    padding: 14px 16px 12px;
    border: 1.5px solid var(--ap-line);
    border-radius: 16px;
    background: var(--ap-card);
}

.ap-inbox li.unread {
    border-color: var(--ap-sky-l);
    box-shadow: var(--ap-shadow);
    cursor: pointer;
}

.ap-inbox li.unread::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f97316;
}

.ap-inbox li.ap-empty {
    color: var(--ap-muted);
    text-align: center;
}

.ap-inbox-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.ap-inbox-head small {
    flex: none;
    color: var(--ap-muted);
    font-size: 12px;
}

.ap-inbox p {
    margin: 4px 0 8px;
    white-space: pre-line;
}

.ap-inbox li.read p {
    color: var(--ap-muted);
}

.ap-inbox-state {
    color: #15803d;
    font-size: 13px;
    font-weight: 700;
}

[data-theme="dark"] .ap-inbox-state {
    color: #86efac;
}
