/* T.A Customer Portal — its own design system (not TAPortal Admin's). Compact SaaS layout: deep-gold sidebar, blue as the
   primary colour, cool light canvas, small type so grids get the width. Green is reserved for "active/ok" states.
   Self-contained: no Tabler/Bootstrap. Contrast pairs checked for WCAG AA. */

:root {
    --cp-bg: #F5F7FB;
    --cp-surface: #FFFFFF;
    --cp-surface-2: #F9FAFC;
    --cp-ink: #0F172A;
    --cp-ink-2: #334155;
    --cp-ink-3: #556275;
    --cp-line: #E4E8F0;
    --cp-line-2: #D3D9E4;
    --cp-blue-700: #1D4ED8;
    --cp-blue-600: #2563EB;
    --cp-blue-500: #3B82F6;
    --cp-blue-100: #DBE6FE;
    --cp-blue-50: #EFF4FF;
    --cp-gold-900: #7A4A00;
    --cp-gold-800: #8A5300;
    --cp-gold-700: #A16207;
    --cp-gold-500: #EAB308;
    --cp-gold-200: #FDE9B8;
    --cp-gold-100: #FEF3C7;
    --cp-gold-text: #92400E;
    --cp-green-700: #166534;
    --cp-green-500: #22C55E;
    --cp-green-100: #DCFCE7;
    --cp-red: #B42318;
    --cp-red-50: #FEF0EE;
    /* Hover rule: every clickable white box (card link, picker tile, plan card) turns light orange on hover. */
    --cp-hover-bg: #FFF4E5;
    --cp-hover-line: #FBD38D;
    --cp-font: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --cp-mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
    --cp-radius: 12px;
    --cp-radius-sm: 8px;
    --cp-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
    --cp-shadow-md: 0 8px 24px -12px rgba(15, 23, 42, .18);
    --cp-shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, .35);
    --cp-ring: 0 0 0 3px rgba(37, 99, 235, .28);
    --cp-ease: cubic-bezier(.2, .7, .2, 1);
    /* Sidebar: deep gold, laid out like the T.A Admin menu (operator, 2026-11-05: same structure, gold colours kept). */
    --cp-side-bg: radial-gradient(260px 200px at 0% 0%, rgba(255, 255, 255, .12), transparent 70%), linear-gradient(180deg, var(--cp-gold-700) 0%, var(--cp-gold-800) 55%, var(--cp-gold-900) 100%);
    --cp-side-hover: rgba(255, 255, 255, .12);
    --cp-side-active: rgba(255, 255, 255, .2);
    --cp-side-line: rgba(255, 255, 255, .14);
    --cp-side-text: #FFF4D6;
    --cp-side-muted: var(--cp-gold-200);
    --cp-side-marker: #fff;
    --cp-side-w: 256px;
    --cp-rail-w: 68px;
    --cp-top-h: 56px;
}

/* Base ------------------------------------------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--cp-bg); color: var(--cp-ink); font-family: var(--cp-font); font-size: 13px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
a { color: var(--cp-blue-600); text-decoration: none; }
a:hover { color: var(--cp-blue-700); }
button, input, select, textarea { font: inherit; color: inherit; }
:where(a, button, input, summary, [tabindex]):focus-visible { outline: 0; box-shadow: var(--cp-ring); border-radius: 8px; }
[hidden] { display: none !important; }
.d-none { display: none !important; }
.ta-icon { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: -3px; }
.cp-skip { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--cp-ink); color: #fff; }
.cp-skip:focus { top: 10px; }

/* Sidebar (deep gold; same structure as the T.A Admin menu: sections, marker on the current page) ----------------------------- */
.cp-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--cp-side-w); display: flex; flex-direction: column; background: var(--cp-side-bg); color: var(--cp-side-text);
    transition: width .2s var(--cp-ease), transform .22s var(--cp-ease), visibility .22s; }
.cp-sidebar__brand { height: var(--cp-top-h); flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--cp-side-line); }
.cp-brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.cp-brand:hover { color: #fff; }
.cp-brand__mark { width: 32px; height: 32px; flex: 0 0 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: #fff; color: var(--cp-gold-900); font-weight: 800; font-size: 13px; letter-spacing: -.04em; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .35); }
.cp-brand__mark span { color: var(--cp-blue-600); }
.cp-brand__logo { width: 34px; height: 34px; flex: 0 0 34px; object-fit: contain; border-radius: 6px; background: #fff; padding: 3px; }
.cp-brand__text { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; overflow: hidden; }
.cp-brand__text small { margin-top: 3px; color: var(--cp-side-muted); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.cp-sidebar__close { display: none; margin-left: auto; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--cp-side-text); cursor: pointer; align-items: center; justify-content: center; }
.cp-sidebar__close:hover { background: var(--cp-side-hover); color: #fff; }
.cp-workspace { display: flex; align-items: center; gap: 10px; margin: 12px 12px 0; padding: 9px 10px; border-radius: 8px; background: rgba(0, 0, 0, .16); border: 1px solid var(--cp-side-line); color: #fff; transition: background .15s; }
.cp-workspace:hover { background: rgba(0, 0, 0, .24); color: #fff; }
.cp-workspace__mark { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 6px; background: var(--cp-blue-600); color: #fff; font-weight: 800; font-size: 12px; }
.cp-workspace__mark--logo { object-fit: contain; background: #fff; padding: 2px; }
.cp-workspace__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.cp-workspace__text small { color: var(--cp-side-muted); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.cp-workspace__text strong { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-side-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 2px; padding: 4px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.cp-side-nav__label { margin: 18px 12px 6px; color: var(--cp-side-muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cp-side-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; border-radius: 8px; color: var(--cp-side-text); font-weight: 500; font-size: 13px; line-height: 1.3; white-space: nowrap; transition: background .15s, color .15s; }
.cp-side-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cp-side-link:hover { background: var(--cp-side-hover); color: #fff; }
.cp-side-link .ta-icon { width: 19px; height: 19px; flex: 0 0 19px; }
.cp-side-link[aria-current="page"] { background: var(--cp-side-active); color: #fff; font-weight: 600; }
.cp-side-link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--cp-side-marker); }
.cp-side-link[aria-current="page"] .ta-icon { color: var(--cp-side-marker); }
.cp-sidebar__foot { flex: 0 0 auto; padding: 12px; border-top: 1px solid var(--cp-side-line); }
.cp-logout { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--cp-side-text); font: inherit; font-weight: 500; cursor: pointer; }
.cp-logout .ta-icon { width: 19px; height: 19px; }
.cp-logout:hover { background: rgba(0, 0, 0, .18); color: #fff; }
.cp-maker { display: block; margin-top: 6px; padding: 2px 12px; color: var(--cp-side-muted); font-size: 10.5px; line-height: 1.4; text-decoration: none; opacity: .85; }
.cp-maker:hover { color: #fff; text-decoration: underline; opacity: 1; }
.ta-overlay { position: fixed; inset: 0; z-index: 45; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }

/* Desktop rail (sidebar collapsed) */
@media (min-width: 1200px) {
    body.ta-sidebar-collapsed .cp-sidebar { width: var(--cp-rail-w); }
    body.ta-sidebar-collapsed .cp-shell { margin-left: var(--cp-rail-w); }
    body.ta-sidebar-collapsed .cp-sidebar__brand { padding: 0; justify-content: center; }
    body.ta-sidebar-collapsed :is(.cp-maker, .cp-brand__text, .cp-workspace__text, .cp-side-nav__label, .cp-side-link span, .cp-logout span, .cp-workspace > .ta-icon) { display: none; }
    body.ta-sidebar-collapsed :is(.cp-side-nav, .cp-sidebar__foot) { padding-left: 8px; padding-right: 8px; }
    body.ta-sidebar-collapsed :is(.cp-side-link, .cp-logout) { justify-content: center; padding: 8px; }
    body.ta-sidebar-collapsed .cp-side-link[aria-current="page"]::before { left: -8px; }
    body.ta-sidebar-collapsed .cp-workspace { justify-content: center; margin: 12px 8px 0; }
    body.ta-sidebar-collapsed .cp-workspace { padding: 8px 0; }
}

/* Shell + top bar ------------------------------------------------------------------------------------------------- */
.cp-shell { min-height: 100vh; margin-left: var(--cp-side-w); display: flex; flex-direction: column; transition: margin-left .2s var(--cp-ease); }
.cp-topbar { position: sticky; top: 0; z-index: 30; height: var(--cp-top-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--cp-line); }
.cp-icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--cp-line); border-radius: 8px; background: var(--cp-surface); color: var(--cp-ink-2); cursor: pointer; }
.cp-icon-btn:hover { background: var(--cp-surface-2); color: var(--cp-ink); }
.cp-crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--cp-ink-3); font-size: 12.5px; white-space: nowrap; }
.cp-crumbs strong { color: var(--cp-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cp-crumbs .ta-icon { width: 14px; height: 14px; }
.cp-topbar__end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.cp-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--cp-blue-100); background: var(--cp-blue-50); color: var(--cp-blue-700); font-weight: 600; font-size: 12.5px; }
.cp-chip:hover { background: var(--cp-blue-100); color: var(--cp-blue-700); }
.cp-user { position: relative; }
.cp-user > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 10px; cursor: pointer; }
.cp-user > summary::-webkit-details-marker { display: none; }
.cp-user > summary:hover, .cp-user[open] > summary { background: var(--cp-surface-2); }
.cp-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(140deg, var(--cp-blue-500), var(--cp-blue-700)); color: #fff; font-weight: 700; font-size: 12px; }
.cp-avatar--lg { width: 56px; height: 56px; font-size: 20px; }
.cp-user__name { display: flex; flex-direction: column; line-height: 1.2; font-weight: 600; font-size: 12.5px; }
.cp-user__name small { color: var(--cp-ink-3); font-weight: 500; font-size: 11px; }
.cp-user__menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; padding: 6px; background: var(--cp-surface); border: 1px solid var(--cp-line); border-radius: 10px; box-shadow: var(--cp-shadow-lg); animation: cp-pop .14s var(--cp-ease) both; }
.cp-user__menu a, .cp-user__menu button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--cp-ink); font-size: 13px; text-align: left; cursor: pointer; }
.cp-user__menu a:hover, .cp-user__menu button:hover { background: var(--cp-surface-2); color: var(--cp-ink); }
.cp-user__menu hr { margin: 4px; border: 0; border-top: 1px solid var(--cp-line); }
.cp-user__menu .cp-danger { color: var(--cp-red); }

/* Content -------------------------------------------------------------------------------------------------------- */
.cp-main { flex: 1 1 auto; width: 100%; padding: 22px 24px 40px; outline: 0; }
.cp-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.cp-head__text { flex: 1 1 320px; min-width: 0; }
.cp-eyebrow { margin-bottom: 4px; color: var(--cp-gold-text); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cp-title { font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
.cp-sub { margin-top: 4px; max-width: 80ch; color: var(--cp-ink-3); font-size: 13px; }
.cp-section { margin: 24px 0 10px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.cp-section h2 { font-size: 14px; font-weight: 700; }
.cp-section p { color: var(--cp-ink-3); font-size: 12.5px; }
.cp-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cp-grid--2 { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.cp-grid > * { min-width: 0; }
.cp-grid > .cp-card { display: flex; flex-direction: column; }
.cp-grid > .cp-card > .cp-card__foot { margin-top: auto; }

/* Workspace banner (dashboard) */
.cp-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 20px 22px; border-radius: var(--cp-radius); color: #fff;
    background: radial-gradient(420px 180px at 100% 0%, rgba(234, 179, 8, .35), transparent 70%), radial-gradient(rgba(255, 255, 255, .1) 1px, transparent 1.3px) 0 0 / 18px 18px, linear-gradient(120deg, #1E3A8A 0%, var(--cp-blue-700) 55%, var(--cp-blue-600) 100%);
    box-shadow: var(--cp-shadow-md); }
.cp-hero > * { position: relative; }
.cp-hero__greet { color: #C7D7FE; font-size: 12.5px; }
.cp-hero__name { margin: 2px 0 10px; font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.cp-hero__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-glass { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); font-size: 12px; font-weight: 600; }
.cp-glass .ta-icon { width: 14px; height: 14px; color: #FDE68A; }
.cp-hero__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cp-hero__role { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--cp-gold-500); color: #422006; font-weight: 700; font-size: 12.5px; }
.cp-hero__status { display: inline-flex; align-items: center; gap: 6px; color: #DBE6FE; font-size: 12px; }
.cp-hero__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cp-green-500); box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }

/* Cards, stats, services */
.cp-card { background: var(--cp-surface); border: 1px solid var(--cp-line); border-radius: var(--cp-radius); box-shadow: var(--cp-shadow); }
.cp-card__head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--cp-line); }
.cp-card__head h2 { font-size: 14px; font-weight: 700; }
.cp-card__body { padding: 16px 18px; }
.cp-card__foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--cp-line); background: var(--cp-surface-2); border-radius: 0 0 var(--cp-radius) var(--cp-radius); }
.cp-stat { padding: 16px 18px; color: inherit; transition: transform .18s var(--cp-ease), box-shadow .18s, border-color .18s; }
.cp-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 14px; }
.cp-stats .cp-stat { text-decoration: none; }
.cp-stats .cp-stat[aria-current="page"] { border-color: var(--cp-hover-line); box-shadow: var(--cp-shadow-md); }
a.cp-stat:hover { transform: translateY(-1px); border-color: var(--cp-hover-line); background: var(--cp-hover-bg); box-shadow: var(--cp-shadow-md); color: inherit; }
.cp-stat__top { display: flex; align-items: center; justify-content: space-between; }
.cp-stat__label { color: var(--cp-ink-3); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.cp-stat__value { margin-top: 10px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.cp-stat__hint { margin-top: 2px; color: var(--cp-ink-3); font-size: 12px; }
/* Phones: the status cards become one row that slides sideways (the next card peeks in) */
@media (max-width: 640px) {
    .cp-stats { display: flex; gap: 10px; margin: 0 -12px 12px; padding: 2px 12px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 12px; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .cp-stats::-webkit-scrollbar { display: none; }
    .cp-stats > .cp-stat { flex: 0 0 min(72%, 260px); scroll-snap-align: start; padding: 12px 14px; }
    .cp-stats .cp-stat__value { margin-top: 6px; }
    a.cp-stat:hover { transform: none; }
}
.cp-blob { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--cp-blue-50); color: var(--cp-blue-600); }
.cp-blob .ta-icon { width: 18px; height: 18px; }
.cp-blob--gold { background: var(--cp-gold-100); color: var(--cp-gold-text); }
.cp-blob--ink { background: #EEF1F6; color: var(--cp-ink-2); }
.cp-blob--green { background: var(--cp-green-100); color: var(--cp-green-700); }
.cp-blob--blue { background: var(--cp-blue-50); color: var(--cp-blue-700); }
.cp-blob--red { background: var(--cp-red-50); color: var(--cp-red); }
.cp-service { flex-direction: row !important; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.cp-service h3 { font-size: 13px; font-weight: 600; }
.cp-service p { margin-top: 4px; color: var(--cp-ink-3); font-size: 12px; }
a.cp-card { transition: background .15s, border-color .15s, box-shadow .15s; }
a.cp-card:hover { background: var(--cp-hover-bg); border-color: var(--cp-hover-line); color: inherit; }

/* Badges, buttons */
.cp-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.cp-badge--green { background: var(--cp-green-100); color: var(--cp-green-700); }
.cp-badge--gold { background: var(--cp-gold-100); color: var(--cp-gold-text); }
.cp-badge--blue { background: var(--cp-blue-50); color: var(--cp-blue-700); }
.cp-badge--soft { background: #EEF1F6; color: var(--cp-ink-2); }
.cp-code { font-family: var(--cp-mono); font-size: 12px; padding: 1px 7px; border-radius: 6px; background: #F1F4F9; border: 1px solid var(--cp-line); }
.cp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; transition: background-color .15s, box-shadow .15s, transform .15s; }
.cp-btn:active { transform: translateY(1px); }
.cp-btn--primary { background: var(--cp-blue-600); color: #fff; box-shadow: 0 1px 2px rgba(29, 78, 216, .4), inset 0 1px 0 rgba(255, 255, 255, .15); }
.cp-btn--primary:hover { background: var(--cp-blue-700); color: #fff; }
.cp-btn--gold { background: var(--cp-gold-500); color: #422006; }
.cp-btn--ghost { background: var(--cp-surface); border-color: var(--cp-line-2); color: var(--cp-ink); }
.cp-btn--ghost:hover { background: var(--cp-surface-2); color: var(--cp-ink); }
.cp-btn--block { width: 100%; }
.cp-btn--lg { height: 40px; font-size: 14px; }
.cp-btn:disabled { opacity: .6; cursor: not-allowed; }
.is-busy { opacity: .75; cursor: progress; }

/* Definition lists, profile, notes */
.cp-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 20px; margin: 0; }
.cp-dl > div { padding: 10px 0; border-bottom: 1px solid var(--cp-line); }
.cp-dl dt { display: flex; align-items: center; gap: 6px; color: var(--cp-ink-3); font-size: 12px; }
.cp-dl dt .ta-icon { width: 14px; height: 14px; color: var(--cp-blue-500); }
.cp-dl dd { margin: 3px 0 0; font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.cp-dl .cp-span { grid-column: 1 / -1; }
.cp-profile { display: flex; align-items: center; gap: 14px; padding: 18px; border-bottom: 1px solid var(--cp-line); }
.cp-profile h2 { font-size: 16px; font-weight: 700; }
.cp-profile p { color: var(--cp-ink-3); font-size: 12.5px; }
.cp-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--cp-radius-sm); background: var(--cp-blue-50); border: 1px solid var(--cp-blue-100); color: var(--cp-ink-2); font-size: 12.5px; }
.cp-note .ta-icon { margin-top: 1px; color: var(--cp-blue-600); }
.cp-note--warn { margin-bottom: 14px; background: #FFF7E0; border-color: #F4D58A; }
.cp-note--warn .ta-icon { color: #B7791F; }
.cp-note p { margin: 4px 0 0; }
.cp-check--option { padding: 10px 12px; border: 1px solid var(--cp-line, #E3E8EF); border-radius: var(--cp-radius-sm); margin-bottom: 8px; }
.cp-check--option:hover { background: var(--cp-hover-bg); border-color: var(--cp-hover-line); }
.cp-check--option:has(input:checked) { border-color: var(--cp-blue-600); background: var(--cp-blue-50); }

/* Forms */
.cp-field { margin-bottom: 14px; }
.cp-label { display: block; margin-bottom: 5px; font-size: 12.5px; font-weight: 600; color: var(--cp-ink-2); }
.cp-input-wrap { position: relative; }
.cp-input-wrap > .ta-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--cp-ink-3); pointer-events: none; }
.cp-input { width: 100%; height: 36px; padding: 0 40px 0 34px; border: 1px solid var(--cp-line-2); border-radius: 8px; background: var(--cp-surface); color: var(--cp-ink); font-size: 13px; transition: border-color .15s, box-shadow .15s; }
.cp-input::placeholder { color: #94A0B4; }
.cp-input:hover { border-color: #BCC5D3; }
.cp-input:focus { outline: 0; border-color: var(--cp-blue-500); box-shadow: var(--cp-ring); }
.cp-input.input-validation-error { border-color: var(--cp-red); }
.cp-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--cp-ink-3); cursor: pointer; }
.cp-toggle:hover { background: var(--cp-surface-2); color: var(--cp-ink); }
.cp-toggle .ta-icon-hide, .cp-toggle.is-shown .ta-icon-show { display: none; }
.cp-toggle.is-shown .ta-icon-hide { display: inline; }
.cp-hint { margin-top: 5px; color: var(--cp-ink-3); font-size: 12px; }
.password-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; margin: 8px 0 0; padding: 0; list-style: none; color: var(--cp-ink-3); font-size: 12px; }
.password-rules li { display: flex; align-items: center; gap: 6px; transition: color .15s; }
.password-rules li::before { content: ""; width: 14px; height: 14px; flex: 0 0 14px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 9px; font-weight: 900; line-height: 1; }
.password-rules li.ok { color: var(--cp-green-700); }
.password-rules li.ok::before { content: "✓"; background: var(--cp-green-700); border-color: var(--cp-green-700); color: #fff; }
.password-rules li.fail { color: var(--cp-red); }
.password-rules li.fail::before { content: "✕"; background: var(--cp-red-50); border-color: var(--cp-red); color: var(--cp-red); }
.cp-alert { display: flex; gap: 10px; margin-bottom: 14px; padding: 10px 12px; border-radius: var(--cp-radius-sm); background: var(--cp-red-50); border: 1px solid #F6C9C4; color: var(--cp-red); font-size: 12.5px; }
.cp-alert ul { margin: 0; padding-left: 16px; }
.validation-summary-valid { display: none !important; }

/* Lists: search + company cards + pager */
.cp-search { position: relative; margin-bottom: 12px; }
.cp-search > .ta-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--cp-ink-3); }
.cp-search .cp-input { padding-right: 12px; }
.cp-company-list { display: grid; gap: 8px; }
.cp-company { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--cp-line); border-radius: var(--cp-radius); background: var(--cp-surface); box-shadow: var(--cp-shadow); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.cp-company:hover { border-color: var(--cp-hover-line); background: var(--cp-hover-bg); box-shadow: var(--cp-shadow-md); transform: translateY(-1px); }
.cp-company__mark { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 9px; background: var(--cp-blue-50); color: var(--cp-blue-700); font-weight: 700; font-size: 12px; }
.cp-company__body { flex: 1 1 auto; min-width: 0; }
.cp-company__name { display: block; font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.cp-company__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cp-company > .ta-icon:last-child { color: var(--cp-ink-3); }
.cp-empty { padding: 20px; text-align: center; color: var(--cp-ink-3); }
.ta-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; color: var(--cp-ink-3); font-size: 12px; }
.ta-pager__info { margin-right: auto; }
.ta-pager__sizes, .ta-pager__pages { display: inline-flex; gap: 4px; }
.ta-pager button { min-width: 28px; height: 28px; padding: 0 8px; border: 1px solid var(--cp-line-2); border-radius: 7px; background: var(--cp-surface); font-size: 12px; font-weight: 600; cursor: pointer; }
.ta-pager button[aria-current="page"], .ta-pager button[aria-pressed="true"] { background: var(--cp-blue-600); border-color: var(--cp-blue-600); color: #fff; }
.ta-pager button:disabled { opacity: .45; cursor: not-allowed; }
.ta-list-turn > [data-ta-row] { animation: cp-fade .18s ease both; }

/* Sign-in */
.cp-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 44%) 1fr; background: var(--cp-surface); }
.cp-auth__panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 36px 44px; color: #fff;
    background: radial-gradient(380px 260px at 100% 0%, rgba(255, 255, 255, .16), transparent 70%), radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.3px) 0 0 / 20px 20px, linear-gradient(160deg, var(--cp-gold-700), var(--cp-gold-900)); }
.cp-auth__panel::after { content: ""; position: absolute; right: -120px; bottom: -140px; width: 360px; height: 360px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .07); }
.cp-auth__panel > * { position: relative; }
.cp-auth__headline { max-width: 420px; }
.cp-auth__headline h1 { font-size: 28px; line-height: 1.15; font-weight: 750; letter-spacing: -.02em; }
.cp-auth__headline h1 em { font-style: normal; color: #FDE68A; }
.cp-auth__headline p { margin-top: 10px; color: #FFF1C9; font-size: 13.5px; }
.cp-auth__points { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.cp-auth__points li { display: flex; align-items: center; gap: 10px; color: #FFF7E0; }
.cp-auth__points span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgba(255, 255, 255, .14); }
.cp-auth__form { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: var(--cp-bg); }
.cp-auth__card { width: min(380px, 100%); padding: 28px; background: var(--cp-surface); border: 1px solid var(--cp-line); border-radius: 14px; box-shadow: var(--cp-shadow-md); animation: cp-rise .35s var(--cp-ease) both; }
.cp-auth__card h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.cp-auth__card > p { margin: 4px 0 20px; color: var(--cp-ink-3); }
.cp-auth__foot { margin-top: 16px; color: var(--cp-ink-3); font-size: 12px; text-align: center; }
.cp-auth-shell { min-height: 100vh; }
.cp-center { min-height: calc(100vh - var(--cp-top-h) - 80px); display: grid; place-items: center; }
.cp-state { max-width: 420px; padding: 28px 24px; text-align: center; }
.cp-state .cp-blob { margin: 0 auto 12px; width: 44px; height: 44px; }
.cp-state h1 { font-size: 16px; font-weight: 700; }
.cp-state p { margin: 6px 0 16px; color: var(--cp-ink-3); }

/* Payments area: toolbar, tables, forms, flash messages, QR */
.cp-badge--red { background: var(--cp-red-50); color: var(--cp-red); }
/* Order list: a dot in the order status colour before the code, and a one-line description that opens on tap */
.cp-order-code { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.cp-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: #98A2B3; box-shadow: 0 0 0 3px rgba(152, 162, 179, .18); }
.cp-dot--blue { background: var(--cp-blue-600); box-shadow: 0 0 0 3px var(--cp-blue-50); }
.cp-dot--gold { background: #D97706; box-shadow: 0 0 0 3px var(--cp-gold-100); }
.cp-dot--green { background: #16A34A; box-shadow: 0 0 0 3px var(--cp-green-100); }
.cp-dot--red { background: #DC2626; box-shadow: 0 0 0 3px var(--cp-red-50); }
.cp-clamp { display: block; max-width: 200px; margin: 2px 0 0 15px; padding: 0; border: 0; background: none; color: var(--cp-ink-3); font: inherit; font-size: 12px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cp-clamp.is-open { width: 200px; white-space: normal; overflow-wrap: anywhere; }
.cp-clamp:focus-visible { outline: 2px solid var(--cp-blue-500); outline-offset: 2px; border-radius: 4px; }
.cp-flash { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; padding: 10px 14px; border-radius: var(--cp-radius-sm); font-size: 13px; animation: cp-pop .2s var(--cp-ease) both; }
.cp-flash--ok { background: var(--cp-green-100); color: var(--cp-green-700); border: 1px solid #BBF7D0; }
.cp-flash--error { background: var(--cp-red-50); color: var(--cp-red); border: 1px solid #F6C9C4; }
/* Toasts: flash messages raised by ta-shell.js to a fixed stack at the top centre of the screen. */
.ta-toasts { position: fixed; top: 16px; left: 50%; z-index: 1090; display: flex; flex-direction: column; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px); transform: translateX(-50%); pointer-events: none; }
.ta-toasts .ta-toast { position: relative; width: min(560px, calc(100vw - 32px)); margin: 0; padding-right: 44px; font-size: 14px; font-weight: 550; box-shadow: var(--cp-shadow-lg); pointer-events: auto; animation: ta-toast-in .28s cubic-bezier(.2, .8, .2, 1) both; }
.ta-toasts .ta-toast.is-leaving { animation: ta-toast-out .22s ease-in both; }
.ta-toast__close { display: none; }
.ta-toasts .ta-toast__close { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: inherit; font-size: 20px; line-height: 1; opacity: .65; cursor: pointer; }
.ta-toasts .ta-toast__close:hover, .ta-toasts .ta-toast__close:focus-visible { opacity: 1; background: rgba(15, 23, 42, .08); }
@keyframes ta-toast-in { from { opacity: 0; transform: translateY(-16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ta-toast-out { to { opacity: 0; transform: translateY(-12px); } }
@media (prefers-reduced-motion: reduce) { .ta-toasts .ta-toast, .ta-toasts .ta-toast.is-leaving { animation-duration: .01s; } }
@media (max-width: 575.98px) { .ta-toasts { top: 10px; } .ta-toasts .ta-toast { width: calc(100vw - 24px); } }
.cp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--cp-line); }
.cp-toolbar .cp-search { flex: 1 1 260px; margin: 0; max-width: 420px; }
.cp-toolbar__end { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.cp-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-filter { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--cp-line-2); color: var(--cp-ink-2); font-size: 12px; font-weight: 600; text-decoration: none; background: var(--cp-surface); }
.cp-filter:not([aria-current="page"]):hover { background: var(--cp-hover-bg); border-color: var(--cp-hover-line); color: var(--cp-ink); }
.cp-filter[aria-current="page"] { background: var(--cp-blue-600); border-color: var(--cp-blue-600); color: #fff; }
.cp-table-wrap { overflow-x: auto; }
.cp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cp-table th { padding: 9px 14px; text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--cp-ink-3); background: var(--cp-surface-2); border-bottom: 1px solid var(--cp-line); white-space: nowrap; }
.cp-table td { padding: 10px 14px; border-bottom: 1px solid var(--cp-line); vertical-align: middle; }
.cp-table tbody tr:hover { background: #FAFBFE; }
.cp-table .cp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-table .cp-actions { text-align: right; white-space: nowrap; }
.cp-table .cp-actions form { display: inline; }
.cp-muted { color: var(--cp-ink-3); font-size: 12px; }
.cp-link { color: var(--cp-blue-600); font-weight: 600; text-decoration: none; }
.cp-link:hover { text-decoration: underline; }
.cp-btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.cp-btn--danger { background: var(--cp-surface); border-color: #F6C9C4; color: var(--cp-red); }
.cp-btn--danger:hover { background: var(--cp-red-50); }
.cp-form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cp-form-grid .cp-span { grid-column: 1 / -1; }
/* Forms whose sections hold three fields: three even columns so a row fills the card instead of crowding the left. */
.cp-form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1099.98px) { .cp-form-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639.98px) { .cp-form-grid--3 { grid-template-columns: minmax(0, 1fr); } }
.cp-input--plain { padding-left: 12px; padding-right: 12px; }
select.cp-input { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--cp-ink-3) 50%), linear-gradient(135deg, var(--cp-ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.cp-input { height: auto; min-height: 72px; padding-top: 8px; padding-bottom: 8px; resize: vertical; }
.cp-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; cursor: pointer; }
.cp-check input { width: 16px; height: 16px; margin-top: 1px; accent-color: var(--cp-blue-600); }
.cp-error { margin-top: 4px; color: var(--cp-red); font-size: 12px; }
.cp-bank-pick { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cp-bank-pick a { display: flex; align-items: center; justify-content: center; min-height: 72px; padding: 12px; border: 1px solid var(--cp-line-2); border-radius: var(--cp-radius-sm); background: var(--cp-surface); transition: background .15s, border-color .15s; }
.cp-bank-pick img { width: 120px; height: 45px; object-fit: contain; }
.cp-bank-pick a:hover { border-color: var(--cp-hover-line); background: var(--cp-hover-bg); }
.cp-bank-pick a[aria-current="true"] { border-color: var(--cp-blue-600); box-shadow: var(--cp-ring); }
.cp-lines td { padding: 6px 8px; }
.cp-lines .cp-input { height: 32px; padding-right: 10px; }
.cp-lines .cp-input.cp-num { text-align: right; }
.cp-input-wrap--top > .ta-icon { top: 18px; }
.cp-otp { padding-right: 12px; }
.cp-total { display: flex; justify-content: flex-end; gap: 16px; padding: 12px 16px; font-size: 14px; font-weight: 700; border-top: 1px solid var(--cp-line); }
.cp-qr { display: grid; place-items: center; gap: 10px; padding: 18px; text-align: center; }
.cp-qr svg { width: min(260px, 100%); height: auto; padding: 8px; border-radius: 12px; border: 1px solid var(--cp-line); background: #fff; }
.cp-qr__amount { font-size: 22px; font-weight: 800; color: var(--cp-ink); }
.cp-progress { height: 8px; border-radius: 999px; background: #EEF1F6; overflow: hidden; }
.cp-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--cp-blue-500), var(--cp-green-500)); }
.cp-otp { letter-spacing: .4em; font-size: 20px; text-align: center; font-family: var(--cp-mono); }

/* Motion: soft navigation cross-fades the content; sidebar and top bar stay still */
.cp-enter { animation: cp-rise .28s var(--cp-ease) both; }
@supports (view-transition-name: none) { main[data-ta-swap] { view-transition-name: cp-main; } .cp-enter { animation: none; } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .12s; }
::view-transition-old(cp-main) { animation: cp-out .12s ease both; }
::view-transition-new(cp-main) { animation: cp-rise .22s var(--cp-ease) both; }
@keyframes cp-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes cp-out { to { opacity: 0; transform: translateY(-3px); } }
@keyframes cp-fade { from { opacity: .3; } to { opacity: 1; } }
@keyframes cp-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* Responsive: below 1200px the sidebar becomes an off-canvas drawer (ta-shell.js toggles body.ta-drawer-open) */
@media (max-width: 1199.98px) {
    .cp-sidebar { transform: translateX(-100%); visibility: hidden; width: min(272px, 86vw); box-shadow: var(--cp-shadow-lg); }
    body.ta-drawer-open .cp-sidebar { transform: none; visibility: visible; }
    body.ta-drawer-open { overflow: hidden; }
    .cp-sidebar__close { display: inline-flex; }
    .cp-shell { margin-left: 0; }
}
@media (max-width: 767.98px) {
    .cp-topbar { padding: 0 12px; }
    .cp-main { padding: 16px 12px 32px; }
    .cp-chip span, .cp-user__name { display: none; }
    .cp-hero { grid-template-columns: 1fr; padding: 18px; }
    .cp-hero__side { align-items: flex-start; }
    .cp-grid--2 { grid-template-columns: minmax(0, 1fr); }
    .cp-auth { grid-template-columns: 1fr; }
    .cp-auth__panel { padding: 24px 20px; gap: 16px; }
    .cp-auth__headline h1 { font-size: 22px; }
    .cp-auth__points { display: none; }
    .password-rules { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
.cp-auth__forgot { margin: -6px 0 14px; text-align: right; font-size: 12.5px; }
.cp-auth__forgot a { color: var(--cp-blue-600); text-decoration: none; }
.cp-auth__forgot a:hover { text-decoration: underline; }

/* QR lifetime: days / hours / minutes side by side (_QrLifetime partial). */
.cp-duration { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cp-duration .cp-input-wrap { position: relative; }
.cp-duration .cp-input { padding-right: 46px; }
.cp-duration__unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--cp-ink-3); font-size: 13px; pointer-events: none; }
@media (max-width: 560px) { .cp-duration .cp-input-wrap > .ta-icon { display: none; } .cp-duration .cp-input { padding-left: 10px; padding-right: 40px; } .cp-duration__unit { right: 10px; } }
/* Order details: receiving account picker next to "Tạo QR". */
.cp-inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cp-inline-form select { width: auto; max-width: 360px; }
/* Reconciliation: actions under a transaction. */
.cp-tx-actions { margin-top: 6px; }
.cp-tx-actions form { margin-top: 6px; }
/* Sign-up and buyer forms: type choice as tiles, tax code with a lookup button, sections that follow the chosen type. */
.cp-auth__card--wide { width: min(640px, 100%); }
.cp-seg { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-bottom: 14px; }
.cp-seg label { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--cp-line); border-radius: 10px; background: var(--cp-surface); cursor: pointer; transition: background .15s, border-color .15s; }
.cp-seg label:hover { background: var(--cp-hover-bg); border-color: var(--cp-hover-line); }
.cp-seg input { position: absolute; opacity: 0; pointer-events: none; }
.cp-seg strong { font-size: 13.5px; }
.cp-seg small { color: var(--cp-ink-3); font-size: 11.5px; }
.cp-seg label:has(input:checked) { border-color: var(--cp-blue-600); box-shadow: 0 0 0 1px var(--cp-blue-600) inset; }
.cp-seg label:has(input:focus-visible) { outline: 2px solid var(--cp-blue-600); outline-offset: 2px; }
.cp-lookup { display: flex; gap: 8px; }
.cp-lookup .cp-input-wrap { flex: 1 1 auto; min-width: 0; }
.cp-lookup .cp-btn { flex: none; }
.cp-lookup-msg { margin-top: 5px; font-size: 12px; color: var(--cp-ink-3); }
.cp-lookup-msg.is-ok { color: var(--cp-green-700); }
.cp-lookup-msg.is-error { color: #B42318; }
.cp-form-section { grid-column: 1 / -1; margin: 6px 0 2px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--cp-ink-3); }
[data-cp-when][hidden] { display: none !important; }
.cp-label.is-required::after { content: " *"; color: #B42318; }

/* Hóa đơn điện tử: readiness checklist (ok / warn / todo) and the folding "Các bước" guide. */
.cp-readiness { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cp-readiness__item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--cp-line); border-radius: var(--cp-radius-sm); }
.cp-readiness__item > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.cp-readiness__item div { display: grid; gap: 2px; min-width: 0; }
.cp-readiness__item span { color: var(--cp-ink-3); font-size: 12.5px; }
.cp-readiness__item.is-ok > svg { color: var(--cp-green-700); }
.cp-readiness__item.is-warn { background: var(--cp-gold-100); border-color: transparent; }
.cp-readiness__item.is-warn > svg { color: var(--cp-gold-text); }
.cp-readiness__item.is-todo { background: var(--cp-red-50); border-color: transparent; }
.cp-readiness__item.is-todo > svg { color: var(--cp-red); }
.cp-einvoice-guide > summary { cursor: pointer; list-style: none; transition: background .15s; }
.cp-einvoice-guide > summary::-webkit-details-marker { display: none; }
.cp-einvoice-guide > summary:hover { background: var(--cp-hover-bg); }
.cp-steps-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13px; }

/* Hóa đơn điện tử: the provider login form folds away once connected. */
.cp-einvoice-connect > summary { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--cp-line); cursor: pointer; color: var(--cp-blue-600); font-weight: 600; list-style: none; transition: background .15s; }
.cp-einvoice-connect > summary::-webkit-details-marker { display: none; }
.cp-einvoice-connect > summary:hover { background: var(--cp-hover-bg); }
.cp-einvoice-connect > summary svg { width: 16px; height: 16px; }
.cp-einvoice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Logos: the company's own (Hồ sơ doanh nghiệp) and its customers' (Khách hàng) */
.cp-logo-picker { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cp-logo-frame { display: grid; place-items: center; width: 88px; height: 88px; flex: none; border: 1px dashed var(--cp-line-2); border-radius: 50%; background: var(--cp-surface-2); overflow: hidden; color: var(--cp-ink-3); }
.cp-logo-frame img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cp-logo-frame .ta-icon { width: 28px; height: 28px; }
.cp-logo-picker__body { display: grid; gap: 8px; min-width: 0; flex: 1 1 220px; }
.cp-logo-picker input[type=file] { max-width: 100%; font-size: 12.5px; }
.cp-logo-picker__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Customer list: logo (or initials) next to the name */
.cp-party { display: flex; align-items: center; gap: 10px; }
.cp-party__logo { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; border: 1px solid var(--cp-line); background: #fff; object-fit: contain; }
.cp-party__logo--initials { display: grid; place-items: center; border: 0; background: linear-gradient(140deg, var(--cp-blue-500), var(--cp-blue-700)); color: #fff; font-size: 11px; font-weight: 700; }

/* Order details: link of the public payment page */
.cp-paylink { display: grid; gap: 10px; }
.cp-paylink__text { display: grid; gap: 2px; font-size: 13px; }
.cp-paylink__row { display: flex; gap: 8px; flex-wrap: wrap; }
.cp-paylink__row .cp-input-wrap { flex: 1 1 220px; min-width: 0; }
.cp-paylink__row .cp-input { font-family: var(--cp-mono); font-size: 12px; }
@media (max-width: 560px) {
    .cp-paylink__row .cp-input-wrap { flex-basis: 100%; }
    .cp-paylink__row .cp-btn { flex: 1 1 0; justify-content: center; }
}

/* Order details: change the QR lifetime / re-issue the QR (collapsed while a QR is open) */
.cp-reissue { display: block; }
.cp-reissue > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; font-weight: 600; color: var(--cp-blue-700); cursor: pointer; }
.cp-reissue > summary::-webkit-details-marker { display: none; }
.cp-reissue > summary .ta-icon { width: 16px; height: 16px; }
.cp-reissue > summary::after { content: ""; width: 7px; height: 7px; margin-left: auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s var(--cp-ease); }
.cp-reissue[open] > summary::after { transform: rotate(-135deg); }
.cp-reissue__form { display: grid; gap: 12px; margin-top: 8px; }
.cp-reissue__form p { margin: 0; }
.cp-reissue__form .cp-btn { justify-self: start; }
@media (max-width: 560px) { .cp-reissue__form .cp-btn { justify-self: stretch; justify-content: center; } }

/* Tables that become one card per row on phones (cells carry data-label) */
@media (max-width: 640px) {
    .cp-table--stack thead { display: none; }
    .cp-table--stack, .cp-table--stack tbody { display: block; }
    .cp-table--stack tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; padding: 12px 14px; border-bottom: 1px solid var(--cp-line); }
    .cp-table--stack td { display: flex; justify-content: space-between; gap: 8px; padding: 0; border: 0; text-align: right; white-space: normal; }
    .cp-table--stack td::before { content: attr(data-label); color: var(--cp-ink-3); font-size: 12px; text-align: left; }
    .cp-table--stack td[data-label="#"] { display: none; }
    .cp-table--stack .cp-stack-title { grid-column: 1 / -1; display: block; text-align: left; font-weight: 600; overflow-wrap: anywhere; }
    .cp-table--stack .cp-stack-title::before { content: none; }
    .cp-table--stack .cp-stack-total { grid-column: 1 / -1; padding-top: 6px; border-top: 1px dashed var(--cp-line); font-weight: 700; }
}

/* Public payment page (/pay/{token}): two logos joined by a link, order, invoice details, QR and countdown */
.cp-pay-body { min-height: 100vh; background: radial-gradient(600px 320px at 10% -10%, var(--cp-gold-100), transparent 70%), radial-gradient(640px 360px at 110% 0%, var(--cp-blue-50), transparent 70%), var(--cp-bg); }
.cp-pay { display: grid; justify-items: center; padding: 28px 16px 40px; }
.cp-pay__card { width: min(560px, 100%); display: grid; gap: 18px; padding: 24px; border: 1px solid var(--cp-line); border-radius: 20px; background: var(--cp-surface); box-shadow: var(--cp-shadow-lg); }
.cp-pay__brands { display: grid; grid-template-columns: 1fr minmax(60px, 120px) 1fr; align-items: start; gap: 6px; padding: 6px 0 2px; }
.cp-pay__brands.is-single { grid-template-columns: 1fr; }
.cp-pay__party { display: grid; justify-items: center; gap: 8px; margin: 0; text-align: center; min-width: 0; }
.cp-pay__party figcaption { display: grid; gap: 1px; min-width: 0; }
.cp-pay__party small { color: var(--cp-ink-3); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.cp-pay__party strong { font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.cp-pay__logo { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: #fff; border: 1px solid var(--cp-line); box-shadow: 0 0 0 5px var(--cp-gold-100), var(--cp-shadow-md); overflow: hidden; }
.cp-pay__party--buyer .cp-pay__logo { box-shadow: 0 0 0 5px var(--cp-blue-50), var(--cp-shadow-md); }
.cp-pay__logo img { width: 100%; height: 100%; object-fit: contain; }
.cp-pay__initials { display: grid; place-items: center; width: 100%; height: 100%; font-size: 24px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--cp-gold-700), var(--cp-gold-900)); }
.cp-pay__initials--buyer { background: linear-gradient(135deg, var(--cp-blue-500), var(--cp-blue-700)); }
.cp-pay__bridge { position: relative; display: flex; align-items: center; height: 76px; }
.cp-pay__wire { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--cp-blue-500) 0 6px, transparent 6px 11px); background-size: 22px 2px; animation: cp-pay-flow 1.2s linear infinite; }
.cp-pay__wire:last-child { background-image: repeating-linear-gradient(90deg, var(--cp-gold-500) 0 6px, transparent 6px 11px); }
.cp-pay__knot { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--cp-blue-600), var(--cp-gold-500)); box-shadow: var(--cp-shadow-md); }
.cp-pay__knot .ta-icon { width: 18px; height: 18px; }
@keyframes cp-pay-flow { to { background-position: 22px 0; } }
/* Operator 2026-11-13: a glowing dot runs customer -> bank -> seller and the bank pulses when it passes. */
.cp-pay__knot { position: relative; z-index: 1; animation: cp-pay-pulse 2.4s ease-out infinite; }
.cp-pay__bridge::before { content: ""; position: absolute; top: calc(50% - 5px); left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--cp-blue-500); box-shadow: 0 0 0 3px rgba(59, 130, 246, .22), 0 0 12px 2px rgba(59, 130, 246, .55); animation: cp-pay-dot 2.4s ease-in-out infinite; pointer-events: none; }
@keyframes cp-pay-dot {
    0% { left: 0; opacity: 0; transform: scale(.6); }
    8% { opacity: 1; transform: none; }
    42% { left: calc(50% - 5px); background: var(--cp-blue-500); }
    58% { left: calc(50% - 5px); background: var(--cp-gold-500); box-shadow: 0 0 0 3px rgba(234, 179, 8, .22), 0 0 12px 2px rgba(234, 179, 8, .55); }
    92% { opacity: 1; transform: none; }
    100% { left: calc(100% - 10px); opacity: 0; transform: scale(.6); background: var(--cp-gold-500); box-shadow: 0 0 0 3px rgba(234, 179, 8, .22), 0 0 12px 2px rgba(234, 179, 8, .55); }
}
@keyframes cp-pay-pulse {
    0%, 38% { transform: none; box-shadow: 0 0 0 0 rgba(37, 99, 235, 0), var(--cp-shadow-md); }
    48% { transform: scale(1.12); box-shadow: 0 0 0 4px rgba(37, 99, 235, .3), var(--cp-shadow-md); }
    62% { transform: none; box-shadow: 0 0 0 12px rgba(234, 179, 8, 0), var(--cp-shadow-md); }
    100% { transform: none; box-shadow: 0 0 0 0 rgba(234, 179, 8, 0), var(--cp-shadow-md); }
}
.cp-pay__bridge.is-paid::before { display: none; }
.cp-pay__bridge.is-paid .cp-pay__wire { background-image: linear-gradient(90deg, var(--cp-green-700), var(--cp-green-700)); animation: none; }
.cp-pay__bridge.is-paid .cp-pay__knot { background: var(--cp-green-700); box-shadow: 0 0 0 5px var(--cp-green-100), var(--cp-shadow-md); animation: cp-pop .3s var(--cp-ease) both; }
.cp-pay__head { display: grid; justify-items: center; gap: 6px; text-align: center; padding-top: 12px; border-top: 1px solid var(--cp-line); }
.cp-pay__head h1 { margin: 0; font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.cp-pay__invoice { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--cp-line); border-radius: var(--cp-radius); background: var(--cp-surface-2); }
.cp-pay__section-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.cp-pay__section-title .ta-icon { color: var(--cp-gold-700); }
.cp-pay__invoice-row { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(0, 1.3fr) auto; gap: 10px; align-items: start; }
.cp-pay__invoice .cp-field { margin-bottom: 0; }
.cp-pay__invoice .cp-hint { margin: 0; }
.cp-pay__save { margin-top: 24px; height: 34px; padding: 0 12px; animation: cp-pop .2s var(--cp-ease) both; }
.cp-btn--icon { width: 34px; padding: 0; }
.cp-pay__qr { display: grid; justify-items: center; gap: 10px; text-align: center; }
.cp-pay__qr-box svg { display: block; width: min(260px, 72vw); height: auto; padding: 10px; border-radius: 16px; border: 1px solid var(--cp-line); background: #fff; box-shadow: var(--cp-shadow-md); }
.cp-pay__amount { display: grid; gap: 2px; }
.cp-pay__amount small { color: var(--cp-ink-3); font-size: 12px; }
.cp-pay__amount strong { font-size: 28px; font-weight: 800; letter-spacing: -.01em; color: var(--cp-ink); }
.cp-pay__timer { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--cp-blue-50); color: var(--cp-blue-700); font-size: 13px; }
.cp-pay__timer strong { font-family: var(--cp-mono); font-size: 15px; font-variant-numeric: tabular-nums; }
.cp-pay__timer.is-ending { background: var(--cp-gold-100); color: var(--cp-gold-text); }
.cp-pay__timer.is-over { background: var(--cp-red-50); color: var(--cp-red); }
.cp-pay__until { font-size: 12px; }
.cp-pay__done { display: grid; justify-items: center; gap: 6px; padding: 18px; color: var(--cp-ink-3); }
.cp-pay__done .ta-icon { width: 44px; height: 44px; }
.cp-pay__done.is-paid { color: var(--cp-green-700); }
.cp-pay__done p { margin: 0; font-size: 14px; text-align: center; line-height: 1.5; }
.cp-pay__facts { display: grid; gap: 0; margin: 0; border: 1px solid var(--cp-line); border-radius: var(--cp-radius); overflow: hidden; }
.cp-pay__facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; font-size: 13px; }
.cp-pay__facts > div + div { border-top: 1px solid var(--cp-line); }
.cp-pay__facts dt { color: var(--cp-ink-3); }
.cp-pay__facts dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.cp-pay__invoice .cp-pay__facts { background: var(--cp-surface); }
.cp-pay__lines summary { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--cp-ink-2); }
.cp-pay__lines ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; }
.cp-pay__lines li { display: grid; gap: 2px; padding: 8px 0; font-size: 13px; border-top: 1px solid var(--cp-line); }
.cp-pay__lines li:first-child { border-top: 0; padding-top: 0; }
.cp-pay__line-name { overflow-wrap: anywhere; }
.cp-pay__line-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cp-pay__line-row small { min-width: 0; }
.cp-pay__line-row strong { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cp-pay__foot { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--cp-ink-3); font-size: 12px; text-align: center; }
.cp-pay__foot .ta-icon { flex: none; color: var(--cp-green-700); }
/* "Chuyển khoản": opens the payer's banking app with the QR's transfer filled in. */
.cp-pay__transfer { margin-top: 6px; height: 42px; padding: 0 22px; font-size: 15px; }
.cp-pay__transfer.cp-btn--block { width: 100%; justify-content: center; margin-top: 0; }
.cp-pay__apps { width: min(520px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 24px)); padding: 18px; border: 0; border-radius: 18px; background: var(--cp-surface); color: var(--cp-ink); box-shadow: var(--cp-shadow-lg); }
.cp-pay__apps::backdrop { background: rgba(15, 23, 42, .45); }
.cp-pay__apps-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 16px; }
.cp-pay__apps-close { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--cp-ink-3); font-size: 22px; line-height: 1; cursor: pointer; }
.cp-pay__apps-close:hover { background: var(--cp-hover-bg); color: var(--cp-ink); }
.cp-pay__app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.cp-pay__app-grid a { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border: 1px solid var(--cp-line); border-radius: 12px; background: var(--cp-surface); color: var(--cp-ink); font-size: 12px; font-weight: 600; text-align: center; text-decoration: none; }
.cp-pay__app-grid a:hover { background: var(--cp-hover-bg); border-color: var(--cp-hover-line); }
.cp-pay__apps-group { margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--cp-ink); }
.cp-pay__apps .cp-pay__app-grid + .cp-pay__apps-group { padding-top: 12px; border-top: 1px solid var(--cp-line); }
/* "Tải ảnh mã QR": the button under the QR and the preview of the drawn image. */
.cp-pay__qr-save { height: 36px; padding: 0 16px; }
.cp-pay__qr-image img { display: block; width: 100%; max-width: 360px; height: auto; margin: 10px auto 14px; border: 1px solid var(--cp-line); border-radius: 12px; }
.cp-pay__qr-image .cp-btn--block { width: 100%; justify-content: center; }
.cp-pay__app-grid img {width: 44px; height: 44px; border-radius: 11px; object-fit: cover; background: var(--cp-surface-2); }
@media (max-width: 560px) {
    .cp-pay { padding: 12px 10px 28px; }
    .cp-pay__card { padding: 18px 16px; border-radius: 16px; }
    .cp-pay__logo { width: 64px; height: 64px; }
    .cp-pay__bridge { height: 64px; }
    .cp-pay__invoice-row { grid-template-columns: 1fr; }
    .cp-pay__save { margin-top: 0; justify-self: end; }
}
/* The payment bridge keeps moving even when the device asks for reduced motion (operator 2026-11-13): it is small and
   slow, and shows the customer the page is live. More specific than the global reduce rule, so it wins. */
@media (prefers-reduced-motion: reduce) {
    .cp-pay__bridge:not(.is-paid) .cp-pay__wire { animation-duration: 1.2s !important; }
    .cp-pay__bridge:not(.is-paid) .cp-pay__knot, .cp-pay__bridge:not(.is-paid)::before { animation-duration: 2.4s !important; }
}

/* Products (catalogue, order picker, "keep this price" dialog) */
.cp-product-thumb { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid var(--cp-line); border-radius: 8px; background: #fff; object-fit: cover; overflow: hidden; color: var(--cp-ink-3); }
.cp-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cp-product-thumb--empty, .cp-product-thumb--sm { background: var(--cp-surface-2); }
.cp-product-thumb--sm { width: 30px; height: 30px; flex-basis: 30px; }
.cp-product-thumb .ta-icon { width: 16px; height: 16px; }
.cp-product-thumb[hidden] { display: none; }
.cp-line-item { display: flex; align-items: center; gap: 8px; min-width: 220px; }
.cp-line-item .cp-input-wrap { flex: 1; }
.cp-line-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cp-logo-frame--square { border-radius: 14px; }
.cp-logo-frame--square img { object-fit: cover; }
.cp-dialog { width: min(480px, calc(100vw - 24px)); max-height: min(680px, calc(100vh - 24px)); padding: 18px; border: 0; border-radius: 16px; background: var(--cp-surface); color: var(--cp-ink); box-shadow: var(--cp-shadow-lg); }
.cp-dialog--wide { width: min(760px, calc(100vw - 24px)); }
.cp-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.cp-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 16px; }
.cp-dialog__close { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--cp-ink-3); font-size: 22px; line-height: 1; cursor: pointer; }
.cp-dialog__close:hover { background: var(--cp-hover-bg); color: var(--cp-ink); }
.cp-dialog__foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.cp-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; max-height: 50vh; overflow: auto; padding: 2px; }
.cp-product-card { position: relative; display: grid; gap: 4px; align-content: start; padding: 8px; border: 1px solid var(--cp-line); border-radius: 12px; background: var(--cp-surface); color: var(--cp-ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.cp-product-card:hover { background: var(--cp-hover-bg); border-color: var(--cp-hover-line); }
.cp-product-card:focus-visible { outline: none; box-shadow: var(--cp-ring); }
.cp-product-card.is-picked { border-color: var(--cp-blue-500); box-shadow: inset 0 0 0 1px var(--cp-blue-500); }
.cp-product-card__img { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 8px; background: var(--cp-surface-2); color: var(--cp-ink-3); font-size: 26px; font-weight: 700; overflow: hidden; }
.cp-product-card__img img { width: 100%; height: 100%; object-fit: cover; }
.cp-product-card__price { color: var(--cp-blue-700); font-weight: 700; }
.cp-product-card .cp-badge { position: absolute; top: 12px; left: 12px; }
.cp-remember-row { padding: 8px 0; border-top: 1px solid var(--cp-line); }
@media (max-width: 560px) { .cp-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .cp-dialog { padding: 14px; } }
/* Payment page: copy buttons beside the account, amount and transfer content. */
.cp-pay__copy { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; }
.cp-pay__copy button { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border: 1px solid var(--cp-line); border-radius: 8px; background: var(--cp-surface); color: var(--cp-ink-3); cursor: pointer; }
.cp-pay__copy button:hover { background: var(--cp-hover-bg); border-color: var(--cp-hover-line); color: var(--cp-ink); }
.cp-pay__copy button.is-copied { background: var(--cp-green-100); border-color: var(--cp-green-500); color: var(--cp-green-700); }
.cp-pay__copy .ta-icon { width: 15px; height: 15px; }
.cp-pay__facts > div:has(.cp-pay__copy) { align-items: center; }

/* Sign-in pages (operator 2026-11-12): the maker line sits at the very bottom of the light area, under the card, on every
   width; terms of service as a dialog on the sign-up form and as a page. */
.cp-auth__form { flex-direction: column; }
.cp-auth__form > .cp-auth__card { margin: auto 0; }
.cp-auth__maker { margin: 24px 0 0; text-align: center; }
.cp-auth__maker .cp-maker { display: inline; margin: 0; padding: 0; color: var(--cp-ink-3); font-size: 12px; opacity: 1; }
.cp-auth__maker .cp-maker:hover { color: var(--cp-blue-600); }
.cp-check a { color: var(--cp-blue-600); }
.cp-auth--doc { grid-template-columns: 1fr; }
.cp-auth__card--doc { width: min(860px, 100%); }
.cp-auth__card--doc h2 { margin: 18px 0 2px; }
.cp-brand--ink .cp-brand__text { color: var(--cp-ink); }
.cp-brand--ink .cp-brand__text small { color: var(--cp-ink-3); }
.cp-terms__date { margin: 0 0 12px; color: var(--cp-ink-3); font-size: 12.5px; }
.cp-terms { display: grid; gap: 8px; }
.cp-terms__item { border: 1px solid var(--cp-line); border-radius: 10px; background: var(--cp-surface); }
.cp-terms__item summary { padding: 10px 14px; font-weight: 600; cursor: pointer; }
.cp-terms__item[open] summary { border-bottom: 1px solid var(--cp-line); }
.cp-terms__item p, .cp-terms__item ul { margin: 10px 14px; font-size: 13.5px; line-height: 1.6; color: var(--cp-ink-2); }
.cp-terms__item ul { padding-left: 20px; }
.cp-terms-dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 14px; box-shadow: var(--cp-shadow-md); }
.cp-terms-dialog[open] { display: flex; flex-direction: column; }
.cp-terms-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.cp-terms-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--cp-line); }
.cp-terms-dialog__head h2 { font-size: 17px; font-weight: 700; }
.cp-terms-dialog__close { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--cp-ink-3); cursor: pointer; }
.cp-terms-dialog__close:hover { background: var(--cp-surface-2); }
.cp-terms-dialog__body { flex: 1; overflow: auto; padding: 14px 20px; background: var(--cp-bg); }
.cp-terms-dialog__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--cp-line); }

/* Sign-in scenery (2026-11-12): the gold panel shows one payment becoming an e-invoice; the light side has invoice
   sheets, QR tiles, receipts and coins drifting behind the card. Both are decorative (aria-hidden) and hold still
   under reduced motion. */
.cp-auth__panel::before { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 0deg at 50% 50%, transparent 0 70%, rgba(255, 255, 255, .07) 80%, transparent 90%); animation: cp-auth-sweep 18s linear infinite; pointer-events: none; }
@keyframes cp-auth-sweep { to { transform: rotate(1turn); } }
.cp-show { display: grid; gap: 18px; width: min(440px, 100%); }
.cp-show__stage { position: relative; height: 262px; }
.cp-show__invoice { position: absolute; left: 50%; top: 50%; width: 252px; padding: 16px; translate: -50% -50%; color: var(--cp-ink); background: #fff; border-radius: 14px;
    box-shadow: 0 26px 50px rgba(60, 30, 0, .38), 0 2px 6px rgba(60, 30, 0, .2); animation: cp-show-float 6s ease-in-out infinite; }
.cp-show__head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px dashed var(--cp-line); }
.cp-show__head b, .cp-show__chip b { display: block; font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.cp-show__head small, .cp-show__chip small { display: block; color: var(--cp-ink-3); font-size: 10.5px; line-height: 1.3; }
.cp-show__doc, .cp-show__qr, .cp-show__ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; }
.cp-show__doc { color: var(--cp-gold-text); background: var(--cp-gold-100); }
.cp-show__qr { color: #fff; background: var(--cp-gold-800); }
.cp-show__ico--green { color: var(--cp-green-700); background: var(--cp-green-100); }
.cp-show__ico--blue { color: var(--cp-blue-700); background: var(--cp-blue-100); }
.cp-show__rows { display: grid; gap: 9px; padding: 14px 0; }
.cp-show__rows span { display: flex; justify-content: space-between; }
.cp-show__rows i { height: 7px; border-radius: 4px; background: #E8ECF3; }
.cp-show__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; border-top: 1px solid var(--cp-line); font-size: 11px; color: var(--cp-ink-3); }
.cp-show__total b { color: var(--cp-ink); font-size: 15px; }
.cp-show__stamp { position: absolute; left: 16px; bottom: 46px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; color: var(--cp-green-700); font-size: 11px; font-weight: 750;
    text-transform: uppercase; letter-spacing: .04em; border: 2px solid currentColor; border-radius: 7px; background: rgba(220, 252, 231, .9); rotate: -8deg; animation: cp-seq-3 9s var(--cp-ease) infinite; }
.cp-show__stamp .ta-icon { width: 13px; height: 13px; }
.cp-show__chip { position: absolute; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; color: var(--cp-ink); background: rgba(255, 255, 255, .96);
    border-radius: 12px; box-shadow: 0 14px 30px rgba(60, 30, 0, .3); white-space: nowrap; }
.cp-show__chip--qr { left: 0; top: 0; animation: cp-seq-1 9s var(--cp-ease) infinite; }
.cp-show__chip--bank { right: 0; top: 92px; animation: cp-seq-2 9s var(--cp-ease) infinite; }
.cp-show__chip--mail { left: 18px; bottom: 0; animation: cp-seq-4 9s var(--cp-ease) infinite; }
.cp-show__steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: cp-step; }
.cp-show__steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; color: #FFF1C9; font-size: 11px; font-weight: 600;
    text-align: center; border-radius: 10px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.cp-show__steps li > * { position: relative; }
.cp-show__steps li::before { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); border-radius: inherit; }
.cp-show__steps li:nth-child(1)::before { animation: cp-seq-1 9s var(--cp-ease) infinite; }
.cp-show__steps li:nth-child(2)::before { animation: cp-seq-2 9s var(--cp-ease) infinite; }
.cp-show__steps li:nth-child(3)::before { animation: cp-seq-3 9s var(--cp-ease) infinite; }
.cp-show__steps li:nth-child(4)::before { animation: cp-seq-4 9s var(--cp-ease) infinite; }
.cp-show__steps li:not(:last-child)::after { content: ""; position: absolute; right: -6px; top: 50%; width: 6px; height: 2px; background: rgba(255, 255, 255, .35); }
@keyframes cp-show-float { 50% { transform: translateY(-7px); } }
@keyframes cp-seq-1 { 0% { opacity: 0; transform: translateY(10px) scale(.94); } 5%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes cp-seq-2 { 0%, 16% { opacity: 0; transform: translateY(10px) scale(.94); } 22%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes cp-seq-3 { 0%, 34% { opacity: 0; transform: scale(1.5); } 39%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
@keyframes cp-seq-4 { 0%, 52% { opacity: 0; transform: translateY(10px) scale(.94); } 58%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: translateY(-6px); } }

.cp-auth__form { position: relative; overflow: hidden; isolation: isolate; }
.cp-backdrop { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
    background: radial-gradient(rgba(37, 99, 235, .09) 1px, transparent 1.4px) 0 0 / 22px 22px;
    -webkit-mask-image: radial-gradient(120% 90% at 50% 45%, #000 40%, transparent 100%); mask-image: radial-gradient(120% 90% at 50% 45%, #000 40%, transparent 100%); }
.cp-backdrop__glow { position: absolute; width: 460px; height: 460px; border-radius: 50%; filter: blur(70px); opacity: .55; animation: cp-glow 16s ease-in-out infinite alternate; }
.cp-backdrop__glow--a { left: -140px; top: -120px; background: var(--cp-gold-200); }
.cp-backdrop__glow--b { right: -160px; bottom: -160px; background: var(--cp-blue-100); animation-delay: -8s; }
@keyframes cp-glow { to { transform: translate(60px, 40px) scale(1.15); } }
.cp-backdrop__item { position: absolute; display: block; opacity: 0; animation: cp-drift linear infinite; }
.cp-backdrop__item svg { display: block; width: 100%; height: auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cp-backdrop__item--invoice { color: var(--cp-blue-500); }
.cp-backdrop__item--qr { color: var(--cp-gold-700); }
.cp-backdrop__item--receipt { color: #0EA5A4; }
.cp-backdrop__item--coin { color: var(--cp-gold-500); }
.cp-backdrop__item--bank { color: var(--cp-green-700); }
.cp-backdrop__item--tax { color: #DC6B19; }
.cp-backdrop__item--transfer { color: var(--cp-blue-600); }
.cp-backdrop__item--card { color: #7C5CC4; }
.cp-backdrop__item--transfer svg { animation: cp-swap 3.2s ease-in-out infinite; }
@keyframes cp-swap { 50% { transform: translateX(6%); } }
@keyframes cp-drift {
    0% { top: 105%; opacity: 0; transform: rotate(-14deg); }
    12% { opacity: .3; }
    85% { opacity: .3; }
    100% { top: -12%; opacity: 0; transform: rotate(16deg); }
}
@media (max-width: 767.98px) {
    .cp-show { display: none; }
    .cp-backdrop__glow { width: 280px; height: 280px; }
}
@media (prefers-reduced-motion: reduce) {
    .cp-auth__panel::before, .cp-show *, .cp-show__steps li::before, .cp-backdrop * { animation: none !important; }
    .cp-backdrop__item { opacity: .14; }
    .cp-show__steps li:not(:first-child)::before { opacity: 0; }
}

/* Reconciliation: period totals line and "Đồng bộ từ ngân hàng" (2026-11-12). */
.cp-tx-sync { justify-content: space-between; align-items: center; }
.cp-tx-sync p { margin: 0; }

/* Sign-in gold panel on wide screens (operator 2026-11-12: "vẫn còn nhiều khoảng trống"): the panel stops growing past
   720px, its content becomes one centred column, and the illustration scales up to fill that column. */
@media (min-width: 1200px) {
    .cp-auth:not(.cp-auth--doc) { grid-template-columns: minmax(360px, min(44%, 720px)) 1fr; }
    .cp-auth__panel { padding-inline: 56px; }
    .cp-auth__panel > * { width: 100%; max-width: 560px; margin-inline: auto; }
    .cp-auth__headline h1 { font-size: 32px; }
    .cp-auth__headline p { font-size: 14.5px; }
    .cp-show { width: 100%; }
    .cp-auth__points { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .cp-auth__points li { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); line-height: 1.35; }
}
@media (min-width: 1200px) and (min-height: 860px) {
    .cp-show { zoom: 1.22; max-width: calc(560px / 1.22); }
}

/* Operator 2026-11-13: every stat/service card group is always one row. Up to 4 cards share the width; more cards
   slide sideways, the next one peeking in. Phones show one card at a time (see .cp-stats above). */
.cp-stats, .cp-grid:has(> .cp-stat), .cp-grid:has(> .cp-service) { --cp-slide-gap: 12px; display: flex; gap: var(--cp-slide-gap); margin-inline: -4px; padding: 4px 4px 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 4px; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--cp-line) transparent; }
.cp-grid:has(> .cp-stat), .cp-grid:has(> .cp-service) { --cp-slide-gap: 14px; }
.cp-stats > *, .cp-grid:has(> .cp-stat) > *, .cp-grid:has(> .cp-service) > * { flex: 1 0 max(220px, calc((100% - 3 * var(--cp-slide-gap)) / 4 - 24px)); min-width: 0; scroll-snap-align: start; }
@media (hover: none) { .cp-stats, .cp-grid:has(> .cp-stat), .cp-grid:has(> .cp-service) { scrollbar-width: none; } .cp-stats::-webkit-scrollbar, .cp-grid:has(> .cp-stat)::-webkit-scrollbar, .cp-grid:has(> .cp-service)::-webkit-scrollbar { display: none; } }
@media (max-width: 640px) {
    .cp-stats, .cp-grid:has(> .cp-stat), .cp-grid:has(> .cp-service) { --cp-slide-gap: 10px; margin: 0 -12px 12px; padding: 2px 12px 8px; scroll-padding: 0 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .cp-stats::-webkit-scrollbar, .cp-grid:has(> .cp-stat)::-webkit-scrollbar, .cp-grid:has(> .cp-service)::-webkit-scrollbar { display: none; }
    .cp-stats > .cp-stat { flex: 0 0 min(72%, 260px); }
    .cp-grid:has(> .cp-stat) > *, .cp-grid:has(> .cp-service) > * { flex: 0 0 min(78%, 280px); }
    .cp-grid:has(> .cp-stat) > .cp-stat { padding: 12px 14px; }
}
/* Payment page (operator 2026-11-17): the maker line under the card, like the sign-in pages. */
.cp-pay__maker { margin: 20px 0 8px; text-align: center; }
.cp-pay__maker .cp-maker { display: inline; margin: 0; padding: 0; color: var(--cp-ink-3); font-size: 12px; opacity: 1; }
.cp-pay__maker .cp-maker:hover { color: var(--cp-blue-600); }
/* Public state pages (Không có quyền truy cập, Lỗi hệ thống) without sign-in: card and maker line stacked (operator 2026-11-17). */
.cp-center:has(> .cp-auth__maker) { align-content: center; gap: 0; }
