/* =====================================================================
   Ping Tact — "One Line" theme (design system v2, DECISIONS D16–D18)
   Loaded AFTER site.css. Light chrome, flat surfaces, navy as the ink and
   Ping Blue as the only accent. Later rules win, so this file restyles the
   shell and the stock components without editing the views that use them,
   and adds the shared components the billing, usage and CRM screens use.
   Tokens live at the top of site.css.
   ===================================================================== */

h1, h2, h3, h4, h5, h6 { color: var(--pt-ink); }
h1, .h1, h2, .h2 { font-weight: 600; letter-spacing: -.01em; }
h3, .h3, h4, .h4, h5, .h5 { font-weight: 600; }
b, strong { font-weight: 600; }
a { text-underline-offset: 3px; }
::selection { background: var(--pt-sky-blue); color: var(--pt-deep-navy); }
:focus-visible { outline: 2px solid var(--pt-ping-blue); outline-offset: 2px; }
.text-muted { color: var(--pt-ink-3) !important; }
.text-secondary { color: var(--pt-ink-2) !important; }
code, kbd { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.pt-num, td.num, time { font-variant-numeric: tabular-nums; }

/* ---- shell: top bar and content ---- */
.topbar-title { color: var(--pt-ink); font-weight: 600; }
.topbar-link { color: var(--pt-ink-2); }
.topbar-bell { color: var(--pt-ink-2); border-radius: 6px; }
.topbar-bell:hover { background: var(--pt-hover); color: var(--pt-ink); }
.app-content { padding: 24px 28px 40px; max-width: 1360px; width: 100%; }
.impersonation-badge { background: var(--pt-warning-tint); color: var(--pt-warning); border-color: rgba(138,75,0,.2); border-radius: 6px; }
.impersonation-badge a { color: var(--pt-warning); }
@media (max-width: 991.98px) {
    .app-content { padding: 16px 14px 32px; }
}

/* ---- stock components: flat, one line where a box is needed ---- */
.card { border: 1px solid var(--pt-line); box-shadow: none; border-radius: var(--pt-radius); background: var(--pt-surface); }
.card-header { background: var(--pt-surface); border-bottom: 1px solid var(--pt-line); font-weight: 600; border-radius: var(--pt-radius) var(--pt-radius) 0 0 !important; }
.card-footer { background: var(--pt-surface); border-top: 1px solid var(--pt-line); }
.shadow, .shadow-sm { box-shadow: 0 6px 24px rgba(5,15,42,.08) !important; }
.btn { border-radius: 6px; font-weight: 500; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--pt-line-2); --bs-btn-hover-bg: var(--pt-ground-2); --bs-btn-hover-border-color: var(--pt-ink-3); }
.btn-outline-secondary { --bs-btn-color: var(--pt-ink); --bs-btn-border-color: var(--pt-line-2); --bs-btn-hover-bg: var(--pt-ground-2); --bs-btn-hover-color: var(--pt-ink); --bs-btn-hover-border-color: var(--pt-ink-3); --bs-btn-active-bg: var(--pt-selected); --bs-btn-active-color: var(--pt-ink); }
.btn-secondary { --bs-btn-bg: #fff; --bs-btn-color: var(--pt-ink); --bs-btn-border-color: var(--pt-line-2); --bs-btn-hover-bg: var(--pt-ground-2); --bs-btn-hover-color: var(--pt-ink); --bs-btn-hover-border-color: var(--pt-ink-3); --bs-btn-active-bg: var(--pt-selected); --bs-btn-active-color: var(--pt-ink); }
.btn-success { --bs-btn-bg: var(--pt-success); --bs-btn-border-color: var(--pt-success); --bs-btn-hover-bg: #0F5A2D; --bs-btn-hover-border-color: #0F5A2D; }
.btn-danger { --bs-btn-bg: var(--pt-danger); --bs-btn-border-color: var(--pt-danger); --bs-btn-hover-bg: #93201A; --bs-btn-hover-border-color: #93201A; }
.btn-outline-danger { --bs-btn-color: var(--pt-danger); --bs-btn-border-color: rgba(179,38,30,.45); --bs-btn-hover-bg: var(--pt-danger-tint); --bs-btn-hover-color: var(--pt-danger); --bs-btn-hover-border-color: var(--pt-danger); }
.btn-quiet { --bs-btn-bg: transparent; --bs-btn-color: var(--pt-ink-2); --bs-btn-border-color: transparent; --bs-btn-hover-bg: var(--pt-ground-2); --bs-btn-hover-color: var(--pt-ink); --bs-btn-active-bg: var(--pt-selected); }
.form-control, .form-select { border-radius: 6px; border-color: var(--pt-line-2); color: var(--pt-ink); }
.form-control:hover, .form-select:hover { border-color: var(--pt-ink-3); }
.form-control::placeholder { color: var(--pt-ink-3); opacity: 1; }
.form-label { font-weight: 500; color: var(--pt-ink); }
.form-text { color: var(--pt-ink-3); }
.form-check-input:checked { background-color: var(--pt-ping-blue); border-color: var(--pt-ping-blue); }
.input-group-text { background: var(--pt-ground-2); border-color: var(--pt-line-2); color: var(--pt-ink-2); }
.table { --bs-table-color: var(--pt-ink); --bs-table-hover-bg: rgba(207,232,255,.22); --bs-table-striped-bg: rgba(207,232,255,.14); border-color: var(--pt-line); }
.table thead th { color: var(--pt-ink-3); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .8rem; }
html[lang^="en"] .table thead th { text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }
.table > :not(caption) > * > * { border-bottom-color: var(--pt-line); }
.badge { font-weight: 600; border-radius: 4px; }
.badge.bg-success { background-color: var(--pt-success-tint) !important; color: var(--pt-success) !important; }
.badge.bg-danger { background-color: var(--pt-danger) !important; }
.badge.bg-warning { background-color: var(--pt-warning-tint) !important; color: var(--pt-warning) !important; }
.badge.bg-secondary { background-color: var(--pt-ground-2) !important; color: var(--pt-ink-2) !important; }
.badge.bg-info { background-color: var(--pt-selected) !important; color: var(--pt-ping-blue) !important; }
.badge.bg-light { background-color: var(--pt-ground-2) !important; color: var(--pt-ink-2) !important; }
.alert { border-radius: 8px; border: 1px solid transparent; }
.alert-success { background: var(--pt-success-tint); color: var(--pt-success); border-color: rgba(20,108,56,.15); }
.alert-danger { background: var(--pt-danger-tint); color: var(--pt-danger); border-color: rgba(179,38,30,.15); }
.alert-warning { background: var(--pt-warning-tint); color: var(--pt-warning); border-color: rgba(138,75,0,.15); }
.alert-info, .alert-primary { background: var(--pt-selected); color: #163F8C; border-color: rgba(31,90,200,.15); }
.alert-secondary, .alert-light { background: var(--pt-ground-2); color: var(--pt-ink-2); border-color: var(--pt-line); }
.nav-tabs { border-bottom-color: var(--pt-line); }
.nav-tabs .nav-link { color: var(--pt-ink-2); font-weight: 500; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding-inline: 2px; margin-inline-end: 22px; }
.nav-tabs .nav-link:hover { color: var(--pt-ink); border-bottom-color: var(--pt-line-2); }
.nav-tabs .nav-link.active { color: var(--pt-ink); background: none; border-bottom-color: var(--pt-ping-blue); }
.nav-pills .nav-link { color: var(--pt-ink-2); }
.nav-pills .nav-link.active { background: var(--pt-selected); color: var(--pt-ink); }
.modal-content { border-radius: 10px; box-shadow: 0 12px 40px rgba(5,15,42,.14); }
.modal-header { border-color: var(--pt-line); border-radius: 10px 10px 0 0; }
.modal-footer { border-color: var(--pt-line); }
.dropdown-menu { border: 1px solid var(--pt-line); border-radius: 8px; box-shadow: 0 6px 24px rgba(5,15,42,.08); --bs-dropdown-link-active-bg: var(--pt-selected); --bs-dropdown-link-active-color: var(--pt-ink); }
.dropdown-item { border-radius: 4px; }
.page-link { color: var(--pt-ping-blue); }
.page-item.active .page-link { background-color: var(--pt-ping-blue); border-color: var(--pt-ping-blue); }
.progress { background-color: var(--pt-ground-2); }
.progress-bar { background-color: var(--pt-ping-blue); }
.list-group-item.active { background: var(--pt-selected); color: var(--pt-ink); border-color: var(--pt-line); }

/* the shared .pt- layer in site.css, re-tuned to the kit */
.pt-head { border-bottom: 0; padding-bottom: 0; margin-bottom: 1.5rem; }
.pt-head h1, .pt-head h2 { font-size: 1.6rem; font-weight: 600; color: var(--pt-ink); }
.pt-head .pt-sub { color: var(--pt-ink-3); font-size: .92rem; }
.pt-stat { box-shadow: none; }
.pt-stat-label { color: var(--pt-ink-3); font-weight: 500; letter-spacing: 0; text-transform: none; font-size: .8rem; }
html[lang^="en"] .pt-stat-label { text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; }
.pt-stat-value { font-family: var(--pt-font-display); font-weight: 700; letter-spacing: -.02em; }
.pt-card { box-shadow: none; }
.pt-card > header { background: var(--pt-surface); }
.pt-table thead th { background: var(--pt-surface); color: var(--pt-ink-3); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .8rem; }
html[lang^="en"] .pt-table thead th { text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; }
.pt-table tbody tr:hover { background: rgba(207,232,255,.18); }
.pt-filters { box-shadow: none; }
.pt-pill-info { background: var(--pt-selected); color: var(--pt-ping-blue); border-color: rgba(31,90,200,.18); }
.pt-funnel-fill.is-reply, .pt-funnel-fill.is-read { color: var(--pt-deep-navy); }   /* white on light blue was 2.23:1 (test of 2026-11-06) */
.pt-step.is-active { background: var(--pt-ping-blue); border-color: var(--pt-ping-blue); }
.pt-step.is-done { background: var(--pt-success-tint); border-color: rgba(20,108,56,.2); color: var(--pt-success); }
.pt-composer-send { box-shadow: none; }
.status-page { box-shadow: none; border: 1px solid var(--pt-line); }
.status-page .status-icon { background: var(--pt-deep-navy); }
.status-page h1 { color: var(--pt-ink); font-weight: 600; }
.status-page p { color: var(--pt-ink-2); }

/* =====================================================================
   Components v2 — shared by the billing, usage and CRM screens.
   ===================================================================== */

/* Page head: breadcrumbs, then title, one-sentence description, actions. */
.pt-crumbs { display: flex; gap: 6px; align-items: center; font-size: .82rem; color: var(--pt-ink-3); margin-bottom: 6px; }
.pt-crumbs a { color: var(--pt-ink-2); text-decoration: none; }
.pt-crumbs a:hover { color: var(--pt-ping-blue); text-decoration: underline; }
[dir="rtl"] .pt-crumbs .bi-chevron-right, [dir="rtl"] .pt-flip { transform: scaleX(-1); display: inline-block; }

/* KPI strip: one unboxed row, numbers lead. */
.pt-kpis { display: flex; flex-wrap: wrap; border-block: 1px solid var(--pt-line); margin-bottom: 1.5rem; }
.pt-kpi { flex: 1 1 160px; padding: 14px 20px; border-inline-start: 1px solid var(--pt-line); min-width: 0; }
.pt-kpi:first-child { border-inline-start: 0; padding-inline-start: 0; }
.pt-kpi-label { font-size: .8rem; color: var(--pt-ink-3); }
.pt-kpi-value { font-family: var(--pt-font-display); font-weight: 700; font-size: 1.6rem; letter-spacing: -.02em; line-height: 1.25; color: var(--pt-ink); font-variant-numeric: tabular-nums; }
.pt-kpi-value small { font-size: .8rem; font-weight: 500; color: var(--pt-ink-3); font-family: var(--pt-font); letter-spacing: 0; }
.pt-kpi-sub { font-size: .78rem; color: var(--pt-ink-3); margin-top: 2px; }
@media (max-width: 575.98px) { .pt-kpi { flex-basis: 50%; border-inline-start: 0; padding-inline-start: 0; } }

/* Section: a flat region headed by a title and a hairline; a box only around data. */
.pt-section { border-top: 1px solid var(--pt-line); padding-top: 18px; margin-bottom: 28px; }
.pt-section > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pt-section > header h2 { font-size: 1.1rem; font-weight: 600; margin: 0; }
.pt-section > header p { margin: 2px 0 0; font-size: .85rem; color: var(--pt-ink-3); }
.pt-box { background: var(--pt-surface); border: 1px solid var(--pt-line); border-radius: var(--pt-radius); }
.pt-box > .pt-box-body { padding: 16px 18px; }
.pt-box .pt-table thead th:first-child, .pt-box .pt-table tbody td:first-child { padding-inline-start: 18px; }
.pt-box .pt-table thead th:last-child, .pt-box .pt-table tbody td:last-child { padding-inline-end: 18px; }

/* Usage meter: a number and the 4px brand line; the line turns amber, then red, as it fills. */
.pt-meter { display: grid; gap: 6px; }
.pt-meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .88rem; }
.pt-meter-head b { font-weight: 600; }
.pt-meter-val { font-variant-numeric: tabular-nums; color: var(--pt-ink-2); white-space: nowrap; }
.pt-meter-val strong { color: var(--pt-ink); }
.pt-meter-track { height: 4px; border-radius: 2px; background: var(--pt-ground-2); overflow: hidden; }
.pt-meter-fill { display: block; height: 100%; border-radius: 2px; background: var(--pt-ping-blue); width: calc(var(--v, 0) * 100%); max-width: 100%; }
.pt-meter.is-warn .pt-meter-fill { background: var(--pt-warning-solid); }
.pt-meter.is-over .pt-meter-fill { background: var(--pt-danger); }
.pt-meter-note { font-size: .76rem; color: var(--pt-ink-3); }

/* Banner: say it once, quietly; colour only when something needs the reader. */
.pt-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; background: var(--pt-ground-2); color: var(--pt-ink); margin-bottom: 16px; font-size: .9rem; }
.pt-banner > i { font-size: 1.1rem; line-height: 1.5; color: var(--pt-ink-3); }
.pt-banner-body { flex: 1; min-width: 0; }
.pt-banner-body p { margin: 2px 0 0; color: var(--pt-ink-2); }
.pt-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pt-banner.is-warn { background: var(--pt-warning-tint); }
.pt-banner.is-warn > i { color: var(--pt-warning); }
.pt-banner.is-danger { background: var(--pt-danger-tint); }
.pt-banner.is-danger > i { color: var(--pt-danger); }
.pt-banner.is-ok { background: var(--pt-success-tint); }
.pt-banner.is-ok > i { color: var(--pt-success); }
.pt-banner.is-info { background: var(--pt-selected); }
.pt-banner.is-info > i { color: var(--pt-ping-blue); }

/* Status: quiet text with a dot; a capsule only for what is not OK. */
.pt-dot { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--pt-ink-2); white-space: nowrap; }
.pt-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pt-silver); flex: none; }
.pt-dot.is-ok::before { background: var(--pt-success); }
.pt-dot.is-info::before { background: var(--pt-ping-blue); }
.pt-dot.is-warn { background: var(--pt-warning-tint); color: var(--pt-warning); padding: 1px 8px; border-radius: 4px; }
.pt-dot.is-warn::before { background: var(--pt-warning); }
.pt-dot.is-danger { background: var(--pt-danger-tint); color: var(--pt-danger); padding: 1px 8px; border-radius: 4px; }
.pt-dot.is-danger::before { background: var(--pt-danger); }

/* Channel label: the only place a channel's own colour may appear. */
.pt-ch { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; white-space: nowrap; }
.pt-ch::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pt-silver); flex: none; }
.pt-ch[data-ch="WhatsApp"]::before { background: #25D366; }
.pt-ch[data-ch="Messenger"]::before { background: #0084FF; }
.pt-ch[data-ch="Instagram"]::before { background: #E1306C; }
.pt-ch[data-ch="TikTok"]::before { background: #111; box-shadow: 1px 0 0 #25F4EE, -1px 0 0 #FE2C55; }
.pt-ch[data-ch="X"]::before { background: #000; }
.pt-ch[data-ch="Sms"]::before { background: var(--pt-ink-3); }

/* Key–value list. */
.pt-kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 20px; margin: 0; font-size: .9rem; }
.pt-kv dt { color: var(--pt-ink-3); font-weight: 400; }
.pt-kv dd { margin: 0; color: var(--pt-ink); min-width: 0; }

/* Segmented tabs: an underline on the current one. */
.pt-seg { display: flex; gap: 22px; border-bottom: 1px solid var(--pt-line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.pt-seg > a, .pt-seg > button { border: 0; background: none; padding: 8px 0; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--pt-ink-2); text-decoration: none; font-weight: 500; white-space: nowrap; }
.pt-seg > a:hover, .pt-seg > button:hover { color: var(--pt-ink); }
.pt-seg > [aria-current="page"], .pt-seg > [aria-pressed="true"], .pt-seg > .active { color: var(--pt-ink); border-bottom-color: var(--pt-ping-blue); }

/* Billing-cycle switch (monthly / yearly). */
.pt-switch { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--pt-ground-2); gap: 2px; position: relative; }
.pt-switch > label, .pt-switch > a, .pt-switch > button { border: 0; background: none; padding: 6px 14px; border-radius: 6px; color: var(--pt-ink-2); font-weight: 500; font-size: .88rem; cursor: pointer; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.pt-switch > input { position: absolute; opacity: 0; pointer-events: none; }
.pt-switch > input:checked + label, .pt-switch > .active, .pt-switch > [aria-pressed="true"] { background: #fff; color: var(--pt-ink); box-shadow: 0 0 0 1px var(--pt-line); }
.pt-switch > input:focus-visible + label { outline: 2px solid var(--pt-ping-blue); outline-offset: 1px; }
.pt-save { font-size: .72rem; color: var(--pt-success); font-weight: 600; }

/* Plan cards: the price leads; the recommended one carries the only accent. */
.pt-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.pt-plan { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px 20px 20px; border: 1px solid var(--pt-line); border-radius: 10px; background: var(--pt-surface); }
.pt-plan.is-recommended { border-color: var(--pt-ping-blue); box-shadow: 0 0 0 1px var(--pt-ping-blue); }
.pt-plan.is-current { background: var(--pt-ice-white); }
.pt-plan-flag { position: absolute; top: -11px; inset-inline-start: 18px; background: var(--pt-ping-blue); color: #fff; font-size: .72rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.pt-plan-flag.is-current { background: var(--pt-deep-navy); }
.pt-plan h3 { font-size: 1.15rem; margin: 0; }
.pt-plan-tag { color: var(--pt-ink-3); font-size: .85rem; margin: 2px 0 0; }
/* Taglines run one or two lines; a fixed head keeps every price on the same baseline. */
.pt-plan-head { min-height: 4.6em; }
@media (max-width: 767.98px) { .pt-plan-head { min-height: 0; } }
.pt-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pt-price .amount { font-family: var(--pt-font-display); font-weight: 700; font-size: 2rem; letter-spacing: -.03em; line-height: 1; color: var(--pt-ink); font-variant-numeric: tabular-nums; }
.pt-price .cur { font-size: .85rem; color: var(--pt-ink-2); font-weight: 500; }
.pt-price .per { font-size: .82rem; color: var(--pt-ink-3); }
.pt-price .was { font-size: .9rem; color: var(--pt-ink-3); text-decoration: line-through; }
.pt-offer { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--pt-success); background: var(--pt-success-tint); padding: 2px 8px; border-radius: 4px; width: fit-content; }
.pt-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: .88rem; color: var(--pt-ink-2); }
.pt-features li { display: flex; gap: 8px; align-items: flex-start; }
.pt-features li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: .6em; border-radius: 50%; background: var(--pt-ping-blue); }
.pt-features li.is-off { color: var(--pt-ink-3); }
.pt-features li.is-off::before { background: none; box-shadow: inset 0 0 0 1.5px var(--pt-silver); }
.pt-soon { margin-inline-start: auto; font-size: .7rem; color: var(--pt-ink-3); border: 1px solid var(--pt-line-2); border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.pt-plan .btn { margin-top: auto; }

/* Beat stepper: progress drawn as the logo line with beats. */
.pt-beats { list-style: none; margin: 0 0 24px; padding: 0; display: flex; position: relative; }
.pt-beats::before { content: ""; position: absolute; top: 9px; inset-inline: 10px; height: 2.4px; background: var(--pt-line-2); border-radius: 2px; }
.pt-beats li { flex: 1; position: relative; padding-top: 28px; font-size: .82rem; color: var(--pt-ink-3); }
.pt-beats li::before { content: ""; position: absolute; top: 4px; inset-inline-start: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--pt-ice-white); box-shadow: inset 0 0 0 2px var(--pt-silver); }
.pt-beats li[data-beat="done"] { color: var(--pt-ink-2); }
.pt-beats li[data-beat="done"]::before { background: var(--pt-deep-navy); box-shadow: none; }
.pt-beats li[data-beat="current"] { color: var(--pt-ink); font-weight: 600; }
.pt-beats li[data-beat="current"]::before { top: 2px; inset-inline-start: 4px; width: 16px; height: 16px; background: var(--pt-ping-blue); box-shadow: 0 0 0 4px var(--pt-ice-white); }

/* Empty state ends on the resolved line. */
.pt-empty-v2 { display: grid; grid-template-columns: auto 1fr; gap: 0 24px; align-items: center; max-width: 640px; padding: 32px 0; }
.pt-empty-v2 .pt-resolved { grid-row: 1 / span 4; width: 140px; height: 60px; background: url("../img/brand/resolved-line.svg") center / contain no-repeat; }
[dir="rtl"] .pt-empty-v2 .pt-resolved { transform: scaleX(-1); }
.pt-empty-v2 h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 4px; }
.pt-empty-v2 p { color: var(--pt-ink-2); margin: 0 0 12px; }
.pt-empty-v2 .btn { justify-self: start; }
@media (max-width: 575.98px) { .pt-empty-v2 { grid-template-columns: 1fr; } .pt-empty-v2 .pt-resolved { grid-row: auto; } }

/* Two-column page: content and a narrow aside. */
.pt-grid-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
@media (max-width: 1099.98px) { .pt-grid-main-side { grid-template-columns: minmax(0, 1fr); } }

/* Read-only money. */
.pt-money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-money .cur { font-size: .8em; color: var(--pt-ink-3); margin-inline-start: 3px; }

/* ---- the installed app (PWA, see _PwaHead): clear of the notch and the home indicator ----
   viewport-fit=cover lets the page reach the screen's edges; env(safe-area-inset-*) is how far
   the notch, the round corners and the iPhone's home indicator reach in. It is 0 on screens
   without them (desktops, most Android phones), so nothing here moves anything there. */
body.app-body { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.app-content { padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 991.98px) {
    .app-content { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
}
/* Sign-in pages: their own layout, whose inline styles come after this file. */
body.auth .auth-main {
    padding: calc(20px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-right, 0px))
             calc(20px + env(safe-area-inset-bottom, 0px)) calc(24px + env(safe-area-inset-left, 0px));
}

/* "Install the app": its how-to sheet (_InstallApp, js/pwa.js). */
.pt-install-icon { border-radius: 10px; flex: none; }
.pt-install-steps { margin: 0; padding-inline-start: 1.3rem; display: grid; gap: 12px; }
.pt-install-steps[hidden] { display: none; }
.pt-install-steps li { padding-inline-start: 4px; }
.pt-install-steps li span { vertical-align: middle; }
.pt-install-glyph {
    display: inline-grid; place-items: center; width: 30px; height: 30px; margin-inline-start: 6px;
    border-radius: 7px; background: var(--pt-ground-2); color: var(--pt-ping-blue); font-size: 1rem;
    vertical-align: middle;
}

/* =====================================================================
   Accessibility and phone fixes from the full test of 2026-11-05.
   ===================================================================== */

/* "Skip to content": the first stop of the Tab key, shown only while it has the focus. */
.skip-link {
    position: absolute; inset-inline-start: 8px; top: -200px; z-index: 2000;
    background: var(--pt-deep-navy); color: #fff; padding: 10px 16px; border-radius: 6px;
    font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 8px; color: #fff; }
.app-content:focus { outline: none; }

/* The top-bar title is the screen's h1 when the screen has no h1 of its own. */
h1.topbar-title { font-size: 1.05rem; line-height: 1.3; margin: 0; letter-spacing: 0; }

/* ---- phones (≤ 767 px) ---- */
@media (max-width: 767.98px) {
    /* A table wider than the screen scrolls sideways inside its box, and its row buttons
       stay pinned at the end of the row instead of being cut off at the edge (contacts,
       users, templates, workflows, teams — test of 2026-11-05). */
    .table-responsive > table:not(.pt-cards-m) tbody tr > td:last-child:has(.btn, button, .dropdown, form),
    .table-responsive > table:not(.pt-cards-m):has(tbody td:last-child .btn, tbody td:last-child button) thead tr > th:last-child {
        position: sticky; inset-inline-end: 0; z-index: 1;
        background: var(--pt-surface, #fff);
        box-shadow: inset 1px 0 0 var(--pt-line);
    }
    html[dir="rtl"] .table-responsive > table:not(.pt-cards-m) tbody tr > td:last-child:has(.btn, button, .dropdown, form),
    html[dir="rtl"] .table-responsive > table:not(.pt-cards-m):has(tbody td:last-child .btn, tbody td:last-child button) thead tr > th:last-child {
        box-shadow: inset -1px 0 0 var(--pt-line);
    }
    .table-responsive > table:not(.pt-cards-m) tbody tr > td:last-child .btn { min-height: 36px; min-width: 36px; }

    /* Tabs that do not fit scroll sideways — never up and down — and fade at the edge that
       has more, so the hidden ones are not a secret (My company had 7 tabs in 362 px). */
    .nav-tabs {
        flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; white-space: nowrap;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .nav-tabs::-webkit-scrollbar { display: none; }
    .nav-tabs .nav-link { min-height: 44px; }
    .nav-tabs.has-more-end { -webkit-mask-image: linear-gradient(to var(--pt-end-side, right), #000 80%, transparent); mask-image: linear-gradient(to var(--pt-end-side, right), #000 80%, transparent); }
    html[dir="rtl"] .nav-tabs.has-more-end { --pt-end-side: left; }

    /* Channels: phone-sized buttons, and Disconnect set apart from pause and Reconnect. */
    .ch-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
    .ch-acts .btn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
    .ch-acts .ch-danger { margin-inline-start: auto; }

    /* Touch targets that were 17–23 px tall. */
    .form-check-input { width: 1.25em; height: 1.25em; }

    /* A date never breaks in the middle ("2026-09-" / "23"). */
    .pt-table td time, .table td time, td.text-nowrap-m { white-space: nowrap; }
}
@media (min-width: 768px) {
    .ch-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
    .ch-acts .ch-danger { margin-inline-start: 10px; }
}

/* Filters folded behind "More filters" on a phone; on wider screens they sit in the row as before. */
@media (min-width: 768px) {
    .pt-filter-more, .pt-filter-more.collapse:not(.show) { display: contents !important; }
}
@media (max-width: 767.98px) {
    .pt-filter-more.show, .pt-filter-more.collapsing { display: flex; flex-wrap: wrap; width: 100%; margin: 0; padding: 0; gap: 0; }
    .pt-filter-more > [class*="col-"] { padding: 4px; }
}

/* A paused row (a branch the bot no longer sends): faded, except the name and its «Paused» pill. */
tr.pt-row-paused > td:not(:first-child) { opacity: .55; }

/* List tables become cards on a phone: one card per row, each value under its column's name
   (data-label, written by site.js from the table head), the row's buttons along the bottom.
   Nothing is cut off at the edge and nothing hides behind a pinned column. */
@media (max-width: 767.98px) {
    table.pt-cards-m, table.pt-cards-m tbody { display: block; width: 100%; }
    table.pt-cards-m thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    table.pt-cards-m tbody tr {
        display: block; margin: 0 0 10px; padding: 6px 12px; border: 1px solid var(--pt-line); border-radius: 10px;
        background: var(--pt-surface, #fff);
    }
    table.pt-cards-m tbody tr:last-child { margin-bottom: 0; }
    table.pt-cards-m tbody td {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        width: auto !important; max-width: none !important; padding: 7px 0 !important; border: 0 !important;
        text-align: start; white-space: normal; background: none !important;
    }
    table.pt-cards-m tbody td + td { border-top: 1px dashed var(--pt-line) !important; }
    table.pt-cards-m tbody td[data-label]::before {
        content: attr(data-label); flex: none; max-width: 45%; color: var(--pt-ink-3); font-size: .8rem; font-weight: 500;
    }
    table.pt-cards-m tbody td > :only-child { margin-inline-start: auto; }
    /* The first cell is the row's name: no label, full width. The last holds the buttons. */
    table.pt-cards-m tbody td:first-child { font-weight: 600; }
    table.pt-cards-m tbody td:first-child::before { display: none; }
    table.pt-cards-m tbody td.pt-card-actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; padding-top: 10px !important; }
    table.pt-cards-m tbody td.pt-card-actions::before { display: none; }
    table.pt-cards-m tbody td.pt-card-actions .btn { min-height: 40px; min-width: 40px; }
    table.pt-cards-m tbody td:empty { display: none; }
    .table-responsive:has(> table.pt-cards-m) { overflow: visible; }
    .pt-box:has(> .table-responsive > table.pt-cards-m), .pt-card:has(> .table-responsive > table.pt-cards-m),
    .pt-box:has(> table.pt-cards-m) { background: transparent; border: 0; box-shadow: none; padding: 0; }
}

/* Icons that point the way the text runs turn round in Arabic: send, reply, sign out, back and next. */
[dir="rtl"] .bi-send::before, [dir="rtl"] .bi-send-fill::before, [dir="rtl"] .bi-send-check::before,
[dir="rtl"] .bi-reply::before, [dir="rtl"] .bi-reply-fill::before,
[dir="rtl"] .bi-box-arrow-right::before, [dir="rtl"] .bi-box-arrow-in-right::before, [dir="rtl"] .bi-box-arrow-in-left::before {
    display: inline-block; transform: scaleX(-1);
}
@media (max-width: 767.98px) {
    table.pt-cards-m tbody td > .pt-cell-v { min-width: 0; text-align: end; margin-inline-start: auto; }
    table.pt-cards-m tbody td:first-child > .pt-cell-v { text-align: start; margin-inline-start: 0; }
}

/* =====================================================================
   Second test round (2026-11-06): touch targets, focus, phone menu, search.
   ===================================================================== */

/* Touch: every control a finger presses is at least 44 × 44 px — the bell,
   the small buttons on every screen, the card buttons, the row links. Only on a touch screen
   or a phone-width window, so a desktop keeps its compact rows. */
@media (pointer: coarse), (max-width: 575.98px) {
    .topbar-bell { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 !important; }
    .app-content .btn-sm, .modal .btn-sm {
        min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    }
    table.pt-cards-m tbody td.pt-card-actions .btn { min-height: 44px; min-width: 44px; }
    .table-responsive > table:not(.pt-cards-m) tbody tr > td:last-child .btn { min-height: 44px; min-width: 44px; }
    /* A name that opens a row (a workflow, a campaign) gets a finger-sized line. */
    table.pt-cards-m tbody td:first-child a:not(.btn) { display: inline-block; padding: 10px 0; }
    /* The privacy / terms links on the sign-in page and the public pages: a
       finger-sized line (they were 17–24 px tall; verification of 2026-11-08, B6). */
    .su-legal a, .auth-legal a, .auth-foot a, .pt-public-legal a {
        display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-size: .85rem;
    }
    .form-check-input { width: 1.5em; height: 1.5em; }
    .pt-perm-cell label { min-width: 44px; min-height: 44px; }
    /* A tag's edit / delete buttons (B9). */
    .co-tag-btn { width: 44px; height: 44px; font-size: .9rem; }
}
/* WCAG 2.5.8 everywhere: nothing pressable smaller than 24 px, desktop included. */
.su-legal a { display: inline-block; min-height: 24px; padding-block: 3px; }

/* The dashboard's date fields showed no focus ring (the browser's inner date parts take the
   focus): the ring is drawn on the field whenever focus is anywhere inside it. */
input[type="date"]:focus, input[type="date"]:focus-within, input[type="time"]:focus, input[type="time"]:focus-within {
    outline: 2px solid var(--pt-ping-blue); outline-offset: 2px; box-shadow: var(--pt-focus); border-color: var(--pt-ping-blue);
}

/* Ctrl+K: the quick-open dialog's list (_QuickOpen). */
.pt-quick-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.pt-quick-list a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; min-height: 44px;
    color: var(--pt-ink) !important; text-decoration: none;
}
.pt-quick-list li[aria-selected="true"] a, .pt-quick-list a:hover { background: var(--pt-hover, #EEF3FB); }
.pt-quick-list i { color: var(--pt-ping-blue); }

/* The translated file picker (Pages/Shared/_FilePicker.cshtml). */
.pt-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: relative; }
.pt-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.pt-file-input:focus-visible + .pt-file-btn { outline: 2px solid var(--pt-ping-blue); outline-offset: 2px; }
.pt-file-btn { margin: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pt-file-name { font-size: .85rem; color: var(--pt-ink-3); min-width: 0; overflow-wrap: anywhere; }

/* Tag chips with their own edit and delete buttons (My company → Contact settings). */
.co-tag { font-size: .85rem; padding: .35em .3em .35em .6em; }
.co-tag-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0;
    border: 0; border-radius: 50%; background: rgba(255, 255, 255, .22); color: #fff !important; text-decoration: none; font-size: .7rem;
}
.co-tag-btn:hover, .co-tag-btn:focus-visible { background: rgba(255, 255, 255, .4); }
@media (pointer: coarse) { .co-tag-btn { width: 44px; height: 44px; font-size: .9rem; } }

/* Screen permissions: the whole cell is the box's label, and the box is 24 px. */
.pt-perm-hit { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 36px; margin: 0; cursor: pointer; }
.pt-perm-hit .form-check-input { width: 1.5em; height: 1.5em; margin: 0; }

/* A banner with buttons on a phone: the buttons go under the text instead of squeezing it into
   a narrow column beside them (signup page, test of 2026-11-06). */
@media (max-width: 575.98px) {
    .pt-banner:has(> .pt-banner-actions) { flex-wrap: wrap; }
    .pt-banner:has(> .pt-banner-actions) > .pt-banner-body { flex: 1 1 calc(100% - 40px); min-width: 0; }
    .pt-banner > .pt-banner-actions { flex: 1 1 100%; }
}
/* The public pages' footer links: a finger-sized target (12 px tall before). */
.pt-public-legal a { display: inline-block; padding: 10px 6px; min-height: 24px; }
