/* ============ Design tokens ============ */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e4e8ef;
  --border-strong: #cfd6e2;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --primary: #2f5bea;
  --primary-600: #2449c9;
  --primary-50: #eef3ff;
  --sidebar: #0f172a;
  --sidebar-2: #1e293b;
  --sidebar-text: #cbd5e1;
  --green: #0f9f6e;  --green-50: #e7f7f0;
  --amber: #b76e00;  --amber-50: #fff4e0;
  --red: #d33a3a;    --red-50: #fdecec;
  --blue: #2563eb;   --blue-50: #e9f0ff;
  --violet: #7c3aed; --violet-50: #f2ecff;
  --slate: #475569;  --slate-50: #eef1f5;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.icon { width: 18px; height: 18px; flex: none; }
.hidden { display: none !important; }

/* ============ Shell ============ */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: none; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 6px 10px 18px; font-weight: 700; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--primary); color: #fff; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px;
  color: var(--sidebar-text); font-weight: 500;
}
.nav-link:hover { background: var(--sidebar-2); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--primary); color: #fff; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text strong { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: #94a3b8; font-size: 12px; }
.avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--primary-50); color: var(--primary); font-weight: 700; font-size: 12.5px;
}
.sidebar .avatar { background: var(--sidebar-2); color: #fff; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 28px 32px 48px; max-width: 1440px; width: 100%; }
.scrim { display: none; }

/* ============ Page header ============ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: block; }

/* ============ Cards / grid ============ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-body { padding: 20px; }
.content > .card + .card { margin-top: 20px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* ============ Stat tiles ============ */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--border-strong); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 500; font-size: 13px; }
.stat-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--primary-50); color: var(--primary); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat-sub { font-size: 13px; color: var(--text-2); }
.stat-sub b { color: var(--text); }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.table tbody tr:hover { background: #fafbfd; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-title { font-weight: 600; color: var(--text); }
.table .cell-sub { font-size: 12.5px; color: var(--muted); }
.table td.actions { white-space: nowrap; text-align: right; }

/* ============ Badges ============ */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-blue { background: var(--blue-50); color: var(--blue); }
.badge-violet { background: var(--violet-50); color: var(--violet); }
.badge-slate { background: var(--slate-50); color: var(--slate); }

.status-select {
  appearance: none; -webkit-appearance: none; border: 1px solid transparent; border-radius: 999px;
  padding: 3px 26px 3px 11px; font: 600 12px var(--font); cursor: pointer;
  background: var(--slate-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23475569' stroke-width='1.6'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 9px center;
  color: var(--slate);
}
.status-select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.tone-confirm, .tone-done, .tone-completed { background-color: var(--green-50); color: var(--green); }
.tone-pending { background-color: var(--amber-50); color: var(--amber); }
.tone-dispute { background-color: var(--red-50); color: var(--red); }
.tone-refund { background-color: var(--slate-50); color: var(--slate); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font: 600 13.5px var(--font); cursor: pointer;
  background: var(--primary); color: #fff; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--primary-600); text-decoration: none; }
.btn:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn .icon { width: 16px; height: 16px; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--slate-50); color: var(--text); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #b92f2f; }
.btn-danger-ghost { background: transparent; color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-50); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-lg { height: 44px; font-size: 14.5px; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: var(--slate-50); }
.inline-form { display: inline; margin: 0; }

/* Row action menu */
.menu { position: relative; display: inline-block; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 210px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  display: none; text-align: left;
}
.menu.open .menu-list { display: block; }
.menu-list a, .menu-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; border: 0;
  background: none; color: var(--text); font: 500 13px var(--font); cursor: pointer; text-align: left;
}
.menu-list a:hover, .menu-list button:hover { background: var(--slate-50); text-decoration: none; }
.menu-list .danger { color: var(--red); }
.menu-list .danger:hover { background: var(--red-50); }
.menu-list hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu-list .icon { width: 16px; height: 16px; color: var(--muted); }
.menu-list .danger .icon { color: var(--red); }

/* ============ Forms ============ */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.req { color: var(--red); }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: 14px var(--font); color: var(--text); background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2364748b' stroke-width='1.8'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 91, 234, .15); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.input-icon .input { padding-left: 36px; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 -4px; grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 4px; grid-column: 1 / -1; }
.service-block { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px 20px; padding: 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); }
.service-block .full { grid-column: 1 / -1; }

/* Filters */
.filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.filters .field label { font-size: 12px; }
.filters .input { height: 36px; font-size: 13px; }
.filters .grow { grid-column: span 2; }
.filters-actions { display: flex; gap: 8px; align-items: flex-end; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.pager-links { display: flex; gap: 4px; }
.pager-links a, .pager-links span {
  min-width: 34px; height: 32px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 7px;
  border: 1px solid var(--border); color: var(--text-2); font-weight: 500; font-size: 13px; background: var(--surface);
}
.pager-links a:hover { background: var(--surface-2); text-decoration: none; }
.pager-links .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-links .disabled { opacity: .45; }

/* ============ Alerts / empty ============ */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; border: 1px solid; }
.alert-success { background: var(--green-50); color: #0b6e4c; border-color: #bfe8d6; }
.alert-error { background: var(--red-50); color: #a32424; border-color: #f5c8c8; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; color: var(--muted); text-align: center; }
.empty .icon { width: 30px; height: 30px; color: #a3aec2; margin-bottom: 4px; }
.empty strong { color: var(--text-2); }

/* ============ Detail lists / tabs / timeline ============ */
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.profile { display: flex; align-items: center; gap: 14px; }
.profile .avatar { width: 48px; height: 48px; font-size: 16px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tab { padding: 12px 12px; border: 0; background: none; font: 600 13.5px var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--slate-50); color: var(--text-2); font-size: 11.5px; margin-left: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 18px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .t-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ============ Public / auth pages ============ */
body.public { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, #dfe8ff 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e6f5ef 0, transparent 55%), var(--bg); }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px; }
.auth-card.wide { max-width: 820px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; margin-bottom: 22px; }
.auth-brand .brand-mark { width: 36px; height: 36px; }
.auth h1 { font-size: 22px; margin-bottom: 6px; }
.auth .lead { color: var(--muted); margin-bottom: 22px; }
.auth form { display: flex; flex-direction: column; gap: 16px; }
.auth form.form-grid { display: grid; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.auth-foot a { margin: 0 6px; }

/* ============ Customer portal ============ */
.portal { max-width: 1180px; margin: 0 auto; padding: 24px 20px 48px; }
.portal-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.portal-logo { max-height: 46px; max-width: 220px; }
.portal-hero { padding: 22px 24px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.portal-hero .kpis { display: flex; gap: 28px; flex-wrap: wrap; }
.kpi strong { display: block; font-size: 22px; font-weight: 700; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.plan-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.plan-ok { background: var(--green-50); color: var(--green); }
.plan-expired { background: var(--red-50); color: var(--red); }
.case-item { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 14px; }
.case-item:last-child { border-bottom: 0; }
.case-item .grow { flex: 1; min-width: 0; }
.case-reply { margin-top: 8px; padding: 8px 12px; background: var(--primary-50); border-radius: 8px; font-size: 13px; color: var(--text-2); }
.support-box { padding: 20px; background: linear-gradient(135deg, var(--primary), #5b7cf5); color: #fff; border: 0; }
.support-box .muted { color: rgba(255,255,255,.8); }
.support-box strong { font-size: 20px; display: block; margin-top: 4px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: grid; place-items: center; padding: 16px; z-index: 60; }
.modal { width: 100%; max-width: 420px; padding: 28px; }

/* ============ Responsive ============ */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 40; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; height: 56px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .topbar-title { font-weight: 600; }
  .content { padding: 20px 16px 40px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 20px; }
  .form-grid, .service-block { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .grow { grid-column: 1 / -1; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .auth-card { padding: 24px 20px; }
  .card-head, .card-body { padding-left: 16px; padding-right: 16px; }
  .table th, .table td { padding: 10px 12px; }
}

/* ============ Print documents (invoice / agreement) ============ */
body.doc-page { background: #e9edf3; }
.doc { max-width: 880px; margin: 24px auto; background: #fff; padding: 48px 56px; border-radius: 6px; box-shadow: var(--shadow-lg); color: #1f2937; font-size: 13.5px; }
.doc-toolbar { max-width: 880px; margin: 24px auto 0; display: flex; justify-content: flex-end; gap: 8px; padding: 0 4px; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 24px; border-bottom: 2px solid #111827; }
.doc-logo { max-width: 240px; max-height: 80px; }
.doc-title { text-align: right; }
.doc-title h1 { font-size: 28px; letter-spacing: .02em; text-transform: uppercase; }
.doc-title .ref { font-size: 13px; color: var(--muted); margin-top: 4px; }
.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px 0; }
.doc-meta h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.doc-meta p { margin: 2px 0; }
.doc-table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; }
.doc-table th { background: #111827; color: #fff; text-align: left; padding: 10px 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.doc-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-table .num { text-align: right; white-space: nowrap; }
.doc-totals { margin-left: auto; width: 280px; }
.doc-totals div { display: flex; justify-content: space-between; padding: 6px 0; }
.doc-totals .grand { border-top: 2px solid #111827; margin-top: 4px; padding-top: 10px; font-weight: 700; font-size: 16px; }
.doc h2 { font-size: 15px; margin: 22px 0 8px; }
.doc h3 { font-size: 13.5px; margin: 16px 0 4px; }
.doc p { margin: 0 0 8px; line-height: 1.6; }
.doc .fill-table td { padding: 6px 12px 6px 0; }
.doc .fill-line { display: inline-block; min-width: 200px; border-bottom: 1px solid #9ca3af; height: 18px; }
.doc .sign-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.doc .sign-row div { border-top: 1px solid #111827; padding-top: 6px; font-size: 12px; color: var(--muted); }
.doc .callout { background: #eff6ff; border-left: 3px solid var(--primary); padding: 10px 14px; border-radius: 4px; }
.doc .hl { background: #fef3c7; padding: 0 4px; border-radius: 3px; }
@media (max-width: 700px) {
  .doc { padding: 24px 20px; margin: 12px; }
  .doc-head, .doc-meta { grid-template-columns: 1fr; display: grid; }
  .doc-title { text-align: left; }
  .doc .sign-row { grid-template-columns: 1fr; }
}
@media print {
  body.doc-page { background: #fff; }
  .doc { box-shadow: none; margin: 0; padding: 0; max-width: none; border-radius: 0; }
  .no-print, .doc-toolbar { display: none !important; }
  .doc-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.menu-list form { display: block; }

/* Renewal notice (customer portal) */
.renew-note { display: flex; gap: 18px; align-items: flex-start; padding: 20px 22px; margin-bottom: 20px; flex-wrap: wrap; }
.renew-expired { background: #fff6f6; border-color: #f3c9c9; }
.renew-soon { background: #fffaf0; border-color: #f2dcaf; }
.renew-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none; }
.renew-expired .renew-icon { background: var(--red-50); color: var(--red); }
.renew-soon .renew-icon { background: var(--amber-50); color: var(--amber); }
.renew-icon .icon { width: 22px; height: 22px; }
.renew-body { flex: 1; min-width: 240px; }
.renew-body h2 { font-size: 17px; margin-bottom: 4px; }
.renew-expired h2 { color: #a32424; }
.renew-soon h2 { color: #8a5300; }
.renew-body p { color: var(--text-2); }
.renew-points { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.renew-points li { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.renew-points .icon { width: 16px; height: 16px; color: var(--green); }
.renew-done { margin-top: 12px; display: flex; gap: 8px; align-items: center; font-weight: 600; color: var(--green) !important; }
.renew-done .icon { width: 16px; height: 16px; }
.renew-actions { display: flex; flex-direction: column; gap: 8px; align-self: center; }
@media (max-width: 640px) { .renew-actions { flex-direction: row; width: 100%; } .renew-actions .btn, .renew-actions form { flex: 1; } .renew-actions form .btn { width: 100%; } }

/* Small floating chat button (opens tawk.to) */
.chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 54px; height: 54px; border-radius: 50%;
  border: 0; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 8px 24px rgba(47, 91, 234, .35); transition: transform .15s, background .15s;
}
.chat-fab:hover { background: var(--primary-600); transform: translateY(-2px); }
.chat-fab .icon { width: 24px; height: 24px; }
.chat-fab-badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font: 700 11px/20px var(--font); text-align: center; }
.portal { padding-bottom: 96px; }

/* Screen sharing (portal + CRM viewer) */
.share-card { padding: 20px; text-align: left; }
.share-card h2 { margin: 10px 0 6px; }
.share-card .btn { margin-top: 14px; }
.share-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--primary-50); color: var(--primary); }
.share-icon .icon { width: 22px; height: 22px; }
.modal h2 { margin: 14px 0 10px; font-size: 18px; }
.ss-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ss-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.ss-points .icon { width: 18px; height: 18px; color: var(--primary); margin-top: 1px; }
.modal-backdrop[hidden], .ss-bar[hidden] { display: none; }
.ss-bar {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 14px;
  padding: 10px 12px 10px 16px; border-radius: 999px; background: #0f172a; color: #fff; box-shadow: var(--shadow-lg); font-size: 13.5px;
  max-width: calc(100% - 24px); flex-wrap: wrap; justify-content: center;
}
.ss-bar .btn { background: var(--red); }
.ss-bar .btn:hover { background: #b92f2f; }
.ss-dot { width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; flex: none; }
.ss-live .ss-dot { background: #ef4444; animation: ss-pulse 1.2s infinite; }
@keyframes ss-pulse { 50% { opacity: .35; } }
.ss-code { background: rgba(255,255,255,.12); padding: 3px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.ss-code strong { letter-spacing: .12em; }
.alert-live { background: #fff1f1; color: #9f1c1c; border-color: #f5c2c2; align-items: center; }
.alert-live span { flex: 1; }
.viewer { background: #0b1220; border-radius: var(--radius); overflow: hidden; position: relative; min-height: 420px; display: grid; place-items: center; }
.viewer video { width: 100%; max-height: 75vh; display: block; background: #0b1220; }
.viewer-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #cbd5e1; text-align: center; padding: 24px; }
.viewer-msg .icon { width: 36px; height: 36px; margin: 0 auto 10px; display: block; color: #64748b; }
.big-code { font-size: 30px; font-weight: 800; letter-spacing: .18em; font-variant-numeric: tabular-nums; }

/* Live Support login */
.portal-login-features { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.portal-login-features span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.portal-login-features .icon { width: 16px; height: 16px; color: var(--primary); }

/* Customer search */
.search-box { position: relative; display: flex; align-items: center; gap: 8px; }
.search-box > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 36px; }
.sidebar-search { padding: 0 4px 14px; }
.sidebar-search .input { height: 36px; background: var(--sidebar-2); border-color: transparent; color: #fff; font-size: 13px; }
.sidebar-search .input::placeholder { color: #94a3b8; }
.sidebar-search .input:focus { border-color: var(--primary); box-shadow: none; }
.search-big .input { height: 48px; font-size: 15px; padding-left: 42px; }
.search-big > .icon { left: 15px; width: 18px; height: 18px; }
.search-big .btn { height: 48px; padding: 0 22px; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 420px; overflow-y: auto; min-width: 280px;
}
.sidebar-search .search-results { width: 340px; right: auto; }
.search-results[hidden] { display: none; }
.sr-item { display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; padding: 9px 12px; border-radius: 8px; color: var(--text); }
.sr-item:hover, .sr-item.sr-active { background: var(--primary-50); text-decoration: none; }
.sr-name { font-weight: 600; font-size: 14px; }
.sr-sub { grid-column: 1; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-meta { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 12px; color: var(--green); font-weight: 600; white-space: nowrap; }
.sr-meta.sr-expired { color: var(--red); }
.sr-all { display: block; padding: 10px 12px; font-size: 13px; font-weight: 600; border-top: 1px solid var(--border); margin-top: 4px; }
.sr-empty { padding: 14px 12px; color: var(--muted); font-size: 13.5px; }
@media (max-width: 640px) { .search-big .btn { display: none; } }

/* ============ AI login screens ============ */
body.ai-page { min-height: 100vh; margin: 0; background: radial-gradient(1200px 700px at 15% 10%, #1e1b4b 0%, transparent 60%), radial-gradient(1000px 700px at 90% 90%, #0c4a6e 0%, transparent 55%), #050816; color: #e2e8f0; overflow-x: hidden; }
#ai-canvas { position: fixed; inset: 0; z-index: 0; }
.ai-grid { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .18;
  background-image: linear-gradient(rgba(148,163,184,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.12) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.ai-orb { position: fixed; border-radius: 50%; filter: blur(80px); opacity: .45; z-index: 0; pointer-events: none; animation: ai-float 14s ease-in-out infinite alternate; }
.ai-orb-1 { width: 420px; height: 420px; background: #6366f1; top: -120px; left: -80px; }
.ai-orb-2 { width: 380px; height: 380px; background: #06b6d4; bottom: -140px; right: -60px; animation-delay: -7s; }
@keyframes ai-float { to { transform: translate(60px, 40px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .ai-orb { animation: none; } }

.ai-auth { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 64px; align-items: center; max-width: 1120px; margin: 0 auto; padding: 40px 24px; }
.ai-hero h1 { font-size: 44px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; color: #fff; margin: 18px 0 14px; }
.ai-hero h1 .grad { background: linear-gradient(90deg, #818cf8, #22d3ee 60%, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ai-hero p { font-size: 16px; color: #94a3b8; max-width: 460px; line-height: 1.6; }
.ai-hero ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.ai-hero li { display: flex; align-items: center; gap: 12px; color: #cbd5e1; font-size: 14.5px; }
.ai-hero li span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(99,102,241,.16); border: 1px solid rgba(129,140,248,.3); color: #a5b4fc; }
.ai-hero li .icon { width: 18px; height: 18px; }
.ai-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.3); color: #67e8f9; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: #22d3ee; box-shadow: 0 0 0 0 rgba(34,211,238,.6); animation: ai-ping 2s infinite; }
@keyframes ai-ping { 70% { box-shadow: 0 0 0 10px rgba(34,211,238,0); } 100% { box-shadow: 0 0 0 0 rgba(34,211,238,0); } }

.ai-card { position: relative; padding: 34px; border-radius: 22px; background: rgba(255,255,255,.96); color: var(--text); box-shadow: 0 30px 80px rgba(2,6,23,.55), 0 0 0 1px rgba(255,255,255,.08); }
.ai-card::before { content: ""; position: absolute; inset: -1px; border-radius: 23px; padding: 1px; z-index: -1; background: linear-gradient(135deg, #818cf8, #22d3ee, #a78bfa); filter: blur(14px); opacity: .55; }
.ai-card .auth-brand { margin-bottom: 18px; }
.ai-card h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.ai-card .lead { color: var(--muted); margin: 0 0 22px; }
.ai-card form { display: flex; flex-direction: column; gap: 16px; }
.ai-card .btn-lg { height: 48px; background: linear-gradient(90deg, #4f46e5, #2563eb 55%, #0891b2); border: 0; box-shadow: 0 10px 24px rgba(37,99,235,.35); }
.ai-card .btn-lg:hover { filter: brightness(1.08); }
.ai-card .input { height: 46px; background: #f8fafc; }
.ai-card .input:focus { background: #fff; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-toggle:hover, .pw-toggle.on { color: var(--primary); background: var(--primary-50); }
.caps-warn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--amber); }
.caps-warn[hidden] { display: none; }
.caps-warn .icon { width: 14px; height: 14px; }
.ai-secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; font-size: 12px; color: var(--muted); }
.ai-secure .icon { width: 14px; height: 14px; color: var(--green); }

@media (max-width: 920px) {
  .ai-auth { grid-template-columns: 1fr; gap: 28px; max-width: 480px; padding: 28px 16px; }
  .ai-hero { text-align: center; }
  .ai-hero h1 { font-size: 30px; margin: 14px 0 8px; }
  .ai-hero p { margin: 0 auto; font-size: 14.5px; }
  .ai-hero ul { display: none; }
  .ai-card { padding: 26px 22px; }
}

/* Customer portal on the AI background */
.portal-page .portal { position: relative; z-index: 1; }
.portal-page .portal-top .muted, .portal-page .portal > .stack > .muted, .portal-page .portal p.muted.small.right { color: #cbd5e1; }
.portal-page .portal-top [data-clock] { color: #cbd5e1; }
.portal-page .portal-top .btn-ghost { color: #e2e8f0; }
.portal-page .portal-top .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.portal-page .portal-top .btn-secondary { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #fff; backdrop-filter: blur(6px); }
.portal-page .portal-top .btn-secondary:hover { background: rgba(255,255,255,.2); }
.portal-page .portal-logo { background: rgba(255,255,255,.92); padding: 6px 10px; border-radius: 10px; }
.portal-page .card { box-shadow: 0 18px 50px rgba(2,6,23,.45); border-color: rgba(255,255,255,.12); }
.portal-page .portal-hero { background: linear-gradient(135deg, rgba(255,255,255,.97), rgba(238,243,255,.97)); }
.portal-page .grid-side p.muted.small.right { color: #94a3b8; }
/* Cards on the dark AI background keep normal dark text */
.ai-page .card, .ai-page .modal, .ai-page .ai-card { color: var(--text); }
.ai-page .portal-top h1, .ai-page .portal-top strong { color: #fff; }
.ss-req-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--primary-50); color: var(--primary-600); font-size: 14px; }
.ss-req-note[hidden] { display: none; }

/* Live Support console */
.live-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.live-row:last-child { border-bottom: 0; }
.live-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.live-green { background: var(--green-50); color: var(--green); }
.live-amber { background: var(--amber-50); color: var(--amber); }
.live-red { background: var(--red-50); color: var(--red); }
.live-red .ss-dot { background: #ef4444; animation: ss-pulse 1.2s infinite; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(15,159,110,.5); animation: live-ping 2s infinite; }
@keyframes live-ping { 70% { box-shadow: 0 0 0 7px rgba(15,159,110,0); } 100% { box-shadow: 0 0 0 0 rgba(15,159,110,0); } }
.live-head-note { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 760px) { .live-row { grid-template-columns: 1fr; gap: 8px; } }

/* ============ Customer Live Support: glass theme ============ */
body.portal-page { color: #e2e8f0; }
body.portal-page .glass-brand { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; color: #e0f2fe; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

/* Glass cards */
body.portal-page .card, body.portal-page .portal-hero {
  background: rgba(255,255,255,.07); color: #e2e8f0;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 20px 50px rgba(2,6,23,.45), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
}
body.portal-page .card-head, body.portal-page .tabs, body.portal-page .case-item { border-color: rgba(255,255,255,.1); }
body.portal-page h1, body.portal-page h2, body.portal-page h3, body.portal-page .kpi strong, body.portal-page .case-item strong, body.portal-page .kv dd { color: #fff; }
body.portal-page .muted, body.portal-page .kpi span, body.portal-page .kv dt, body.portal-page .t-meta, body.portal-page .field .hint { color: #94a3b8 !important; }
body.portal-page .field label, body.portal-page .label { color: #cbd5e1; }
body.portal-page .portal-hero p.muted.small { color: #a5f3fc !important; }

/* Glass inputs */
body.portal-page .input { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); color: #fff; color-scheme: dark; }
body.portal-page .input::placeholder { color: #94a3b8; }
body.portal-page .input:focus { border-color: #22d3ee; box-shadow: 0 0 0 3px rgba(34,211,238,.18); background: rgba(255,255,255,.1); }

/* Buttons */
body.portal-page .btn:not(.btn-secondary):not(.btn-ghost) { background: linear-gradient(90deg, #4f46e5, #2563eb 55%, #0891b2); border: 0; box-shadow: 0 10px 24px rgba(37,99,235,.35); }
body.portal-page .btn:not(.btn-secondary):not(.btn-ghost):hover { filter: brightness(1.1); }
body.portal-page .btn-secondary { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; }
body.portal-page .btn-secondary:hover { background: rgba(255,255,255,.16); }
body.portal-page .btn-ghost { color: #e2e8f0; }
body.portal-page .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Tabs, cases, timeline, empty states */
body.portal-page .tab { color: #94a3b8; }
body.portal-page .tab:hover { color: #fff; }
body.portal-page .tab.active { color: #fff; border-bottom-color: #22d3ee; }
body.portal-page .count { background: rgba(255,255,255,.12); color: #e2e8f0; }
body.portal-page .case-reply { background: rgba(99,102,241,.16); color: #c7d2fe; border: 1px solid rgba(129,140,248,.25); }
body.portal-page .case-reply .muted { color: #a5b4fc !important; }
body.portal-page .timeline li { color: #e2e8f0; }
body.portal-page .timeline li::before { background: #22d3ee; box-shadow: 0 0 10px rgba(34,211,238,.7); }
body.portal-page .timeline li::after { background: rgba(255,255,255,.15); }
body.portal-page .empty, body.portal-page .empty strong { color: #cbd5e1; }
body.portal-page .empty .icon { color: #64748b; }

/* Badges & status pills */
body.portal-page .badge-amber { background: rgba(245,158,11,.16); color: #fcd34d; }
body.portal-page .badge-green { background: rgba(16,185,129,.16); color: #6ee7b7; }
body.portal-page .badge-red { background: rgba(239,68,68,.16); color: #fca5a5; }
body.portal-page .plan-ok { background: rgba(16,185,129,.16); color: #6ee7b7; border: 1px solid rgba(110,231,183,.3); }
body.portal-page .plan-expired { background: rgba(239,68,68,.16); color: #fca5a5; border: 1px solid rgba(252,165,165,.3); }

/* Renewal notice as tinted glass */
body.portal-page .renew-expired { background: rgba(239,68,68,.1); border-color: rgba(248,113,113,.35); }
body.portal-page .renew-soon { background: rgba(245,158,11,.1); border-color: rgba(252,211,77,.35); }
body.portal-page .renew-expired h2 { color: #fca5a5; }
body.portal-page .renew-soon h2 { color: #fcd34d; }
body.portal-page .renew-body p, body.portal-page .renew-points li { color: #e2e8f0; }
body.portal-page .renew-body strong { color: #fff; }
body.portal-page .renew-expired .renew-icon { background: rgba(239,68,68,.18); color: #fca5a5; }
body.portal-page .renew-soon .renew-icon { background: rgba(245,158,11,.18); color: #fcd34d; }
body.portal-page .renew-points .icon { color: #6ee7b7; }
body.portal-page .renew-done { color: #6ee7b7 !important; }

/* Share-screen card + popup */
body.portal-page .share-icon { background: rgba(34,211,238,.14); color: #67e8f9; border: 1px solid rgba(34,211,238,.3); }
body.portal-page .modal { background: rgba(15,23,42,.82); color: #e2e8f0; border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
body.portal-page .ss-points li { color: #cbd5e1; }
body.portal-page .ss-points strong { color: #fff; }
body.portal-page .ss-points .icon { color: #67e8f9; }
body.portal-page .ss-req-note { background: rgba(34,211,238,.12); color: #a5f3fc; border: 1px solid rgba(34,211,238,.3); }

/* Messages */
body.portal-page .alert-success { background: rgba(16,185,129,.14); color: #a7f3d0; border-color: rgba(110,231,183,.35); }
body.portal-page .alert-error { background: rgba(239,68,68,.14); color: #fecaca; border-color: rgba(252,165,165,.35); }
body.portal-page .portal-top { margin-bottom: 18px; }

/* Payment page */
.pay-card { max-width: 480px; }
body.portal-page .pay-card { background: rgba(255,255,255,.07); color: #e2e8f0; border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.pay-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 14px; background: rgba(34,211,238,.08); border: 1px solid rgba(34,211,238,.28); margin: 16px 0; }
.pay-summary > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pay-summary strong { color: #fff; font-size: 16px; }
.pay-amount { font-size: 30px; font-weight: 800; color: #fff; white-space: nowrap; }
.pay-amount span { font-size: 13px; color: #94a3b8; margin-left: 4px; font-weight: 600; }
.pay-kv { margin-top: 8px; }
.pay-done { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(16,185,129,.18); color: #6ee7b7; border: 1px solid rgba(110,231,183,.4); margin-bottom: 14px; }
.pay-done .icon { width: 32px; height: 32px; }
@media print { body.portal-page { background: #fff; } #ai-canvas, .ai-orb, .ai-grid, .toolbar { display: none !important; } body.portal-page .pay-card { color: #000; background: #fff; border: 1px solid #ddd; } body.portal-page h1, body.portal-page .kv dd { color: #000; } }

/* Payment link popup (staff) */
.pl-modal { max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; }
.pl-head { display: flex; justify-content: space-between; align-items: center; }
.pl-head h2 { margin: 0; font-size: 18px; }
.pl-types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pl-types label { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; }
.pl-types label:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.pl-types span { display: flex; flex-direction: column; }
.pl-types small { color: var(--muted); font-size: 12px; }
.pl-error { color: var(--red); font-weight: 600; font-size: 13.5px; margin: 0; }
.pl-error[hidden] { display: none; }
.pl-ok { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 10px; background: var(--green-50); color: #0b6e4c; }
.pl-ok .icon { width: 22px; height: 22px; flex: none; }
.pl-ok span { display: block; font-size: 13px; margin-top: 2px; }
.pl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }

/* Payment request card on the customer page */
.paycard { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 20px; flex-wrap: wrap; }
body.portal-page .paycard { background: rgba(34,211,238,.1); border-color: rgba(34,211,238,.4); box-shadow: 0 0 0 1px rgba(34,211,238,.15), 0 20px 50px rgba(2,6,23,.45); }
.paycard-icon { font-size: 26px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: rgba(34,211,238,.15); flex: none; }
.paycard-body { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.paycard-body strong { font-size: 16px; }
.paycard-amt { font-size: 26px; font-weight: 800; }
body.portal-page .paycard-amt, body.portal-page .paycard-body strong { color: #fff; }
body.portal-page .pay-summary { margin: 12px 0; }
.pl-modal [hidden], #pay-modal[hidden], .modal-backdrop[hidden] { display: none !important; }
/* Keep content clear of the tawk.to side tab on narrower screens */
@media (max-width: 1300px) { body.portal-page .portal { padding-right: 72px; } }
@media (max-width: 480px) { body.portal-page .portal { padding-right: 16px; } .paycard .btn { width: 100%; } }

/* Merchants + payment options */
.gw-picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.gw-picker label { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; }
.gw-picker label:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.gw-picker span { display: flex; flex-direction: column; font-weight: 600; font-size: 13px; }
.gw-picker small { font-weight: 500; color: var(--muted); font-size: 11.5px; }
@media (max-width: 900px) { .gw-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pl-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pl-methods label { display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--border-strong); border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; }
.pl-methods label:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.pl-methods span { display: flex; flex-direction: column; }
.pl-methods small { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.pay-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.05); cursor: pointer; }
.pay-opt:has(input:checked) { border-color: #22d3ee; background: rgba(34,211,238,.1); box-shadow: 0 0 0 1px rgba(34,211,238,.3); }
.pay-opt input { accent-color: #22d3ee; }
.pay-opt-ic { font-size: 22px; width: 36px; text-align: center; }
.pay-opt span:last-child { display: flex; flex-direction: column; }
.pay-opt strong { color: #fff; }
.pay-opt small { color: #94a3b8; }
.pay-steps { margin: 12px 0; padding-left: 20px; display: grid; gap: 10px; color: #e2e8f0; line-height: 1.5; }
.pay-steps strong { color: #fff; }
.pay-warn { display: flex; gap: 8px; align-items: flex-start; color: #fcd34d !important; }
.pay-warn .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.badge-violet { background: var(--violet-50); color: var(--violet); }

/* Refund popover on the payments list */
.refund-box { display: inline-block; position: relative; }
.refund-box > summary { list-style: none; cursor: pointer; }
.refund-box > summary::-webkit-details-marker { display: none; }
.refund-box[open] > form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 240px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); text-align: left; white-space: normal; }

/* Schedule appointment (collapsible) */
.appt-toggle { width: 100%; display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius); }
.appt-toggle:hover { background: rgba(255,255,255,.04); }
.appt-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #4f46e5, #0891b2); color: #fff; flex: none; box-shadow: 0 8px 20px rgba(37,99,235,.35); }
.appt-ic .icon { width: 22px; height: 22px; }
.appt-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.appt-text strong { font-size: 16px; }
.appt-text small { color: var(--muted); font-size: 13px; }
body.portal-page .appt-text strong { color: #fff; }
body.portal-page .appt-text small { color: #94a3b8; }
.appt-chev { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-size: 20px; font-weight: 700; background: rgba(34,211,238,.14); color: #67e8f9; transition: transform .2s; flex: none; }
.appt-card.open .appt-chev { transform: rotate(45deg); }
.appt-card.open .appt-toggle { border-bottom: 1px solid rgba(255,255,255,.1); border-radius: var(--radius) var(--radius) 0 0; }
.appt-body[hidden] { display: none !important; }

/* HUD style: cooler cyan tint, radar sits behind the page */
body.portal-page, body.hud-page { background: radial-gradient(1100px 700px at 75% 50%, rgba(8,47,73,.55) 0%, transparent 60%), radial-gradient(900px 600px at 10% 0%, rgba(30,27,75,.6) 0%, transparent 60%), #030712; }
body.portal-page .ai-orb, body.hud-page .ai-orb { opacity: .16; animation-duration: 30s; }
body.portal-page .ai-grid, body.hud-page .ai-grid { display: none; }

/* ---------- Scan your device (customer portal) ---------- */
.scan-top { display: flex; gap: 14px; align-items: flex-start; }
.scan-top h2 { margin: 2px 0 6px; }
.scan-radar { position: relative; flex: 0 0 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(34,211,238,.45); background: radial-gradient(circle, rgba(34,211,238,.18) 0 20%, transparent 21% 45%, rgba(34,211,238,.12) 46% 47%, transparent 48%); overflow: hidden; }
.scan-radar span { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(34,211,238,.55), transparent 70deg); animation: scan-spin 3s linear infinite; }
.scan-radar i { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #22d3ee; box-shadow: 0 0 10px #22d3ee; }
.scan-card.scanning .scan-radar span { animation-duration: .9s; }
@keyframes scan-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .scan-radar span { animation: none; } }
.scan-progress { margin-top: 14px; }
.scan-bar { height: 6px; border-radius: 99px; background: rgba(148,163,184,.25); overflow: hidden; }
.scan-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22d3ee, #6366f1); transition: width .3s; }
.scan-step { margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #0891b2; }
.scan-results { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.scan-results li { display: grid; grid-template-columns: 20px minmax(0, .8fr) minmax(0, 1.4fr); gap: 8px; align-items: center; font-size: 13px; padding: 7px 10px; border-radius: 10px; background: rgba(148,163,184,.1); animation: scan-in .3s ease; }
.scan-results li b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; color: #fff; background: #94a3b8; }
.scan-results li.dv-ok b { background: #10b981; }
.scan-results li.dv-warn b { background: #f59e0b; }
.scan-results li.dv-warn { background: rgba(245,158,11,.12); }
.scan-results li strong { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
@keyframes scan-in { from { opacity: 0; transform: translateY(4px); } }
.scan-summary { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.scan-summary.is-ok { background: rgba(16,185,129,.14); color: #047857; }
.scan-summary.is-warn { background: rgba(245,158,11,.14); color: #b45309; }
.scan-note { margin: 10px 0 0; }
body.portal-page .scan-step { color: #67e8f9; }
body.portal-page .scan-summary.is-ok { color: #6ee7b7; }
body.portal-page .scan-summary.is-warn { color: #fcd34d; }

/* Device check in the staff Live Support console */
.live-device { grid-column: 1 / -1; font-size: 13px; background: var(--bg, #f8fafc); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.live-device summary { cursor: pointer; font-weight: 600; }
.live-device ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.live-device li { display: flex; justify-content: space-between; gap: 12px; }
.live-device li span { color: var(--muted, #64748b); }
.live-device li.dv-warn strong { color: #b45309; }
.live-device li.dv-ok strong::before { content: '✓ '; color: #10b981; }
.live-device li.dv-warn strong::before { content: '⚠ '; }
.scan-clean { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(148,163,184,.25); }
.scan-clean h3 { margin: 0 0 4px; font-size: 15px; }
.scan-clean ol { list-style: none; counter-reset: cl; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.scan-clean li { counter-increment: cl; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 12px 10px 42px; position: relative; border-radius: 10px; background: rgba(148,163,184,.1); }
.scan-clean li::before { content: counter(cl); position: absolute; left: 12px; top: 10px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: rgba(34,211,238,.2); color: #0891b2; }
.scan-clean li.is-done::before { content: '✓'; background: #10b981; color: #fff; }
.scan-clean li.is-done strong { text-decoration: line-through; opacity: .7; }
.scan-clean li p { margin: 3px 0 6px; }
.clean-check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
body.portal-page .scan-clean li::before { color: #67e8f9; }
body.portal-page .scan-clean li.is-done::before { color: #fff; }

/* Scan popup: always fits the screen, content scrolls inside */
.scan-actions { margin-top: 14px; gap: 8px; }
.scan-actions .btn { margin-top: 0; flex: 1; justify-content: center; }
.scan-card .scan-summary { margin-top: 12px; }
.modal.scan-modal { max-width: 640px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 20px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.scan-mhead { display: flex; gap: 12px; align-items: center; }
.scan-mhead > div:nth-child(2) { flex: 1; min-width: 0; }
.scan-mhead .scan-radar { flex-basis: 42px; height: 42px; }
.scan-mhead h2 { margin: 0 0 2px; }
.scan-mhead .scan-step { margin: 0; }
.scan-x { padding: 6px; }
.scan-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(148,163,184,.14); }
.scan-tabs button { flex: 1; border: 0; background: none; padding: 8px 10px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; color: inherit; opacity: .7; cursor: pointer; }
.scan-tabs button.is-active { background: rgba(34,211,238,.18); opacity: 1; }
.scan-tabs button:disabled { opacity: .35; cursor: default; }
.scan-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 99px; font-size: 11px; background: #22d3ee; color: #083344; }
.scan-panel { flex: 1 1 auto; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.scan-panel[hidden] { display: none; }
.scan-modal .scan-results { margin: 0 0 12px; grid-template-columns: 1fr; gap: 6px; }
.scan-modal .scan-results li { grid-template-columns: 20px minmax(0, 1fr); gap: 2px 8px; padding: 7px 10px; }
.scan-modal .scan-results li strong { grid-column: 2; text-align: left; font-size: 12px; }
.scan-modal .scan-clean { margin: 0; padding: 0; border: 0; }
.scan-modal .scan-panel { min-height: 0; }
.scan-modal .scan-panel:empty, .scan-modal.scanning .scan-panel { display: none; }
.scan-modal .scan-summary { margin: 0; }
.scan-mfoot { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.scan-mfoot .scan-note { margin: 0; flex: 1; }
.scan-mfoot .btn { flex: 0 0 auto; }
@media (max-width: 560px) {
  .modal.scan-modal { padding: 16px; }
  .scan-mfoot { flex-direction: column; align-items: stretch; }
}

/* ---------- E-sign (sign.php) ---------- */
.esign-bar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: #0f172a; color: #e2e8f0; box-shadow: 0 2px 12px rgba(15,23,42,.25); }
.esign-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.esign-brand > div { display: flex; flex-direction: column; min-width: 0; }
.esign-brand span.small { color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.esign-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.esign-progress { color: #94a3b8; }
.esign-bar .btn[data-esign-finish] { background: #f5b800; color: #111827; border-color: #f5b800; font-weight: 700; min-width: 96px; justify-content: center; }
.esign-bar .btn[data-esign-finish]:disabled { opacity: .5; }
.esign-banner { max-width: 880px; margin: 20px auto 0; display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 10px; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.esign-banner > .icon { flex: 0 0 auto; width: 22px; height: 22px; }
.esign-banner span { display: block; font-size: 13px; margin-top: 2px; }
.esign-banner.esign-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.esign-consent { max-width: 880px; margin: 20px auto 0; padding: 22px 24px; display: flex; gap: 16px; align-items: flex-start; }
.esign-consent h2 { margin: 0 0 6px; }
.esign-agree { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 12px; font-size: 14px; cursor: pointer; }
.esign-agree input { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; accent-color: #f5b800; }
.esign-disclosure { padding: 10px 12px; border-radius: 8px; background: var(--bg, #f8fafc); margin-bottom: 12px; }
.esign-docs.is-locked { filter: blur(2px); opacity: .55; pointer-events: none; user-select: none; }
.doc .esign-input { display: inline-block; width: 220px; max-width: 100%; height: 30px; padding: 4px 8px; font-size: 13px; background: #fffbe6; border: 1.5px dashed #d4a300; border-radius: 4px; }
.doc .esign-input[name="f[last4]"] { width: 90px; }
.doc .esign-input.esign-req::placeholder { color: #b45309; }
.doc .esign-input.is-done { background: #f0fdf4; border-style: solid; border-color: #86efac; }
.doc .esign-input:focus { outline: 2px solid #f5b800; outline-offset: 1px; }
.doc .esign-filled { min-width: 200px; font-weight: 600; color: #1e3a8a; border-bottom-color: #1e3a8a; height: auto; padding-bottom: 1px; }
.doc .esign-row > div { border-top: 0; padding-top: 0; display: flex; flex-direction: column; justify-content: flex-end; min-height: 64px; }
.doc .esign-row > div > small { display: block; border-top: 1px solid #111827; padding-top: 6px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.esign-auto { font-size: 14px; color: #1e3a8a; font-weight: 600; }
.esign-tag { position: relative; align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; min-width: 120px; height: 52px; padding: 0 16px 0 22px; border: 0; border-radius: 4px; background: #f5b800; color: #111827; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.esign-tag::before { content: ''; position: absolute; left: -10px; top: 50%; margin-top: -10px; border: 10px solid transparent; border-right-color: #f5b800; border-left: 0; }
.esign-tag-label::after { content: ' ↓'; }
.esign-tag.is-signed { background: none; box-shadow: none; padding: 0; cursor: default; height: auto; }
.esign-tag.is-signed::before, .esign-tag.is-signed .esign-tag-label { display: none; }
.esign-tag img { height: 56px; width: auto; max-width: 220px; }
.esign-tag.pulse, .doc .esign-input.pulse { animation: esign-pulse .5s ease 3; }
@keyframes esign-pulse { 50% { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(245,184,0,.35); } }
.esign-sig { display: flex; flex-direction: column; align-items: flex-start; }
.esign-sig img { height: 56px; width: auto; max-width: 240px; }
.esign-id { font-size: 9.5px; color: #64748b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; border-left: 2px solid #1e3a8a; padding-left: 5px; }
.esign-guide { position: fixed; left: 18px; top: 50%; z-index: 45; padding: 12px 22px 12px 18px; border: 0; border-radius: 4px 999px 999px 4px; background: #f5b800; color: #111827; font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.esign-guide.is-finish { background: #10b981; color: #fff; }
.esign-guide[hidden] { display: none; }
.esign-modal { max-width: 560px; }
.esign-modal h2 { margin-top: 0; }
.esign-tabs { display: flex; gap: 4px; margin: 14px 0 10px; border-bottom: 1px solid var(--border); }
.esign-tabs button { border: 0; background: none; padding: 8px 14px; font: inherit; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.esign-tabs button.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.esign-styles { display: grid; gap: 8px; }
.esign-style { display: block; width: 100%; padding: 4px 10px; background: #fff; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; }
.esign-style.is-active { border-color: #f5b800; box-shadow: 0 0 0 3px rgba(245,184,0,.25); }
.esign-style img { display: block; height: 58px; width: auto; max-width: 100%; }
.esign-pad { display: block; width: 100%; height: auto; aspect-ratio: 600 / 180; background: #fff; border: 1.5px dashed #94a3b8; border-radius: 8px; touch-action: none; cursor: crosshair; margin-bottom: 6px; }
.esign-cert h3 { margin-top: 20px; }
.esign-kv td:first-child { width: 170px; }
.esign-cert-sig { height: 48px; width: auto; }
.esign-events td { font-size: 12px; }
@media (max-width: 640px) {
  .esign-bar { padding: 8px 12px; }
  .esign-progress { display: none; }
  .esign-consent { flex-direction: column; margin: 12px; padding: 18px; }
  .esign-banner { margin: 12px; }
  .esign-guide { left: auto; right: 12px; top: auto; bottom: 16px; border-radius: 999px; }
}
@media print {
  .esign-cert { page-break-before: always; }
  .doc + .doc { page-break-before: always; }
}
.esign-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: rgba(245,184,0,.12); border: 1px solid rgba(245,184,0,.45); text-align: left; }
.esign-cta span { display: block; opacity: .8; margin-top: 2px; }
.btn.esign-cta-btn { background: #f5b800; border-color: #f5b800; color: #111827; font-weight: 700; flex: 0 0 auto; }
@media (max-width: 480px) { .esign-cta { flex-direction: column; align-items: stretch; } }
.lslink-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px; }
.lslink-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; background: var(--primary-50); color: var(--primary); }
.lslink-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lslink-row { display: flex; gap: 8px; align-items: center; }
.lslink-row .input { flex: 1; min-width: 0; height: 34px; font-size: 12.5px; }
.lslink-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lslink-actions form { display: inline; }
@media (max-width: 760px) { .lslink-card { flex-direction: column; align-items: stretch; } .lslink-actions { justify-content: flex-start; } }
.esign-bar { justify-content: flex-start; }
.esign-bar .esign-brand { flex: 1; }
.esign-nav { display: flex; gap: 6px; flex: 0 0 auto; }
.esign-navbtn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #e2e8f0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.esign-navbtn:hover { background: rgba(255,255,255,.16); color: #fff; }
.esign-navbtn .icon { width: 19px; height: 19px; }
.esign-bar .brand-mark { display: none; }
@media (max-width: 480px) { .esign-navbtn { width: 34px; height: 34px; } }

/* ---------- AI genie helper (Live Support pages) ---------- */
.genie { position: fixed; right: 22px; bottom: 22px; z-index: 55; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; transition: opacity .25s, transform .25s, translate 7s cubic-bezier(.45,.05,.35,1); translate: var(--gx, 0px) var(--gy, 0px); }
.genie.is-hidden { opacity: 0; transform: translateY(20px) scale(.9); pointer-events: none; }
.genie-btn { position: relative; width: 170px; height: 209px; padding: 0; border: 0; background: none; cursor: pointer; filter: drop-shadow(0 10px 22px rgba(34,211,238,.35)); animation: genie-float 3.6s ease-in-out infinite; }
.genie-btn svg { width: 100%; height: 100%; overflow: visible; }
.genie-btn:hover { filter: drop-shadow(0 12px 28px rgba(99,102,241,.6)); }
.genie-btn:focus-visible { outline: 3px solid #22d3ee; outline-offset: 4px; border-radius: 20px; }
.genie-dot { position: absolute; right: 27px; top: 36px; width: 18px; height: 18px; border-radius: 50%; background: #22c55e; border: 2.5px solid #0f172a; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: genie-ping 2s infinite; }
.genie .gn-tail { transform-origin: 60px 90px; animation: genie-sway 3s ease-in-out infinite; }
.genie .gn-arm { transform-origin: 80px 74px; animation: genie-wave 2.4s ease-in-out infinite; }
.genie .gn-eyes { transform-origin: 60px 47px; animation: genie-blink 4.5s infinite; }
.genie .gn-tip { animation: genie-glow 1.6s ease-in-out infinite; }
.genie .gn-aura { transform-origin: 60px 62px; animation: genie-pulse 3.2s ease-in-out infinite; }
.genie .gn-spark { animation: genie-twinkle 2.2s ease-in-out infinite; }
.genie.is-loading .genie-btn { animation-duration: .9s; }
.genie-bubble { position: relative; margin-right: 18px; width: 220px; border-radius: 16px 16px 4px 16px; background: rgba(15,23,42,.92); color: #e2e8f0; border: 1px solid rgba(103,232,249,.35); box-shadow: 0 12px 30px rgba(2,6,23,.45); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); animation: genie-pop .35s ease; }
.genie-bubble[hidden] { display: none; }
.genie-msg { display: block; width: 100%; padding: 12px 30px 12px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.genie-text { display: flex; flex-direction: column; gap: 3px; }
.genie-text[hidden], .genie-typing[hidden] { display: none; }
.genie-text small { font-size: 11.5px; color: #94a3b8; }
.genie-text strong { font-size: 16px; color: #fff; }
.genie-text em { font-style: normal; font-size: 12px; color: #67e8f9; }
.genie-x { position: absolute; top: 4px; right: 6px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: #94a3b8; font-size: 18px; line-height: 1; cursor: pointer; }
.genie-x:hover { background: rgba(255,255,255,.1); color: #fff; }
.genie-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.genie-typing i { width: 7px; height: 7px; border-radius: 50%; background: #67e8f9; animation: genie-typing 1s infinite; }
.genie-typing i:nth-child(2) { animation-delay: .15s; }
.genie-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes genie-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes genie-sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }
@keyframes genie-wave { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-18deg); } 80% { transform: rotate(8deg); } 90% { transform: rotate(-12deg); } }
@keyframes genie-blink { 0%, 44%, 48%, 100% { transform: scaleY(1); } 46% { transform: scaleY(.1); } }
@keyframes genie-glow { 50% { fill: #a855f7; } }
@keyframes genie-pulse { 50% { transform: scale(1.08); opacity: .7; } }
@keyframes genie-twinkle { 50% { opacity: .3; } }
@keyframes genie-ping { 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
@keyframes genie-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes genie-pop { from { opacity: 0; transform: translateY(8px) scale(.95); } }
.genie.is-paused { transition-duration: .25s, .25s, 1.2s; }
.genie-still .genie-btn, .genie-still svg *, .genie-still .genie-dot, .genie-still .genie-bubble { animation: none !important; }
@media (max-width: 560px) {
  .genie { right: 10px; bottom: 12px; }
  .genie-btn { width: 120px; height: 148px; }
  .genie-dot { right: 18px; top: 25px; width: 14px; height: 14px; }
  .genie-bubble { margin-right: 8px; width: 190px; }
  .genie-text strong { font-size: 14.5px; }
}
@media print { .genie { display: none; } }
/* Genie colour by service status */
.genie-soon .genie-btn { filter: drop-shadow(0 10px 22px rgba(245,158,11,.45)); }
.genie-soon .genie-bubble { border-color: rgba(251,191,36,.55); }
.genie-soon .genie-text small, .genie-soon .genie-text em { color: #fcd34d; }
.genie-soon .genie-typing i { background: #fbbf24; }
.genie-soon .genie-dot { background: #f59e0b; box-shadow: 0 0 0 0 rgba(245,158,11,.6); animation-name: genie-ping-amber; }
.genie-expired .genie-btn { filter: drop-shadow(0 10px 22px rgba(239,68,68,.5)); }
.genie-expired .genie-bubble { border-color: rgba(248,113,113,.6); }
.genie-expired .genie-text small, .genie-expired .genie-text em { color: #fca5a5; }
.genie-expired .genie-typing i { background: #f87171; }
.genie-expired .genie-dot { background: #ef4444; box-shadow: 0 0 0 0 rgba(239,68,68,.6); animation-name: genie-ping-red; }
@keyframes genie-ping-amber { 70% { box-shadow: 0 0 0 10px rgba(245,158,11,0); } 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); } }
@keyframes genie-ping-red { 70% { box-shadow: 0 0 0 10px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }
.genie.no-move { transition: none !important; }
/* Genie faces: little reactions on hover / click */
.genie.is-reacting .genie-btn svg { animation: genie-bounce .55s ease; }
.genie[data-face="laugh"].is-reacting .genie-btn svg { animation: genie-giggle .18s ease-in-out 6; }
.genie[data-face="cry"].is-reacting .genie-btn svg { animation: genie-sob .4s ease-in-out 3; }
.genie[data-face="surprised"].is-reacting .genie-btn svg { animation: genie-jump .5s ease; }
.genie .gn-tears { animation: genie-tear 1s ease-in infinite; }
.genie .gn-joy { animation-duration: .7s; }
@keyframes genie-bounce { 30% { transform: scale(1.08) translateY(-6px); } 60% { transform: scale(.97); } }
@keyframes genie-giggle { 50% { transform: rotate(-4deg) translateY(-2px); } }
@keyframes genie-sob { 50% { transform: translateY(3px) scaleY(.97); } }
@keyframes genie-jump { 40% { transform: translateY(-16px) scale(1.05); } }
@keyframes genie-tear { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(9px); opacity: 0; } }
/* Email > Settings: quick setup */
.mail-presets { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; padding: 14px 16px; margin-bottom: 18px; border: 1px dashed var(--border); border-radius: 12px; background: var(--bg, #f8fafc); }
.mail-presets > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.mail-preset-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.mail-preset-note { flex-basis: 100%; margin: 0; color: #047857; font-weight: 600; }
.input.is-filled { background: #f0fdf4; }
.input.needs-input { outline: 2px solid #f59e0b; outline-offset: 1px; }
/* Quick renew popup */
.rn-current { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg, #f8fafc); border: 1px solid var(--border); font-size: 13px; }
.rn-current:empty { display: none; }
.rn-bad { color: var(--red, #dc2626); }
.rn-warn { color: #b45309; }
.btn.rn-due { border-color: #fca5a5; color: #b91c1c; background: #fef2f2; }
.pay-lasterr { color: #b91c1c; max-width: 360px; white-space: normal; margin-top: 4px; }

/* Support workspace: use the available width and keep the assistant clear of content. */
body.portal-page .portal-workspace { grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 20px; }
body.portal-page .portal-workspace > .stack { min-width: 0; }
body.portal-page .portal-renew-key h2 { display:flex; align-items:center; gap:8px; }
body.portal-page .portal-renew-key .input { min-width:0; width:100%; font-size:13px; }
body.portal-page .portal-renew-key .hint { margin-top:12px; color:#a6b7ca; }
body.portal-page .portal-plan-summary .kv { margin-bottom:0; }
body.portal-page .appt-chev { width:auto; height:auto; flex-shrink:0; padding:9px 12px; border-radius:9px; font-size:13px; font-weight:600; white-space:nowrap; }
body.portal-page .portal-genie-dock { position:relative; min-height:150px; display:flex; justify-content:flex-end; align-items:flex-end; margin-top:18px; }
body.portal-page .portal-genie-dock .genie { position:relative; right:auto; bottom:auto; transform:none!important; }
body.portal-page .portal-genie-dock .genie-btn { width:100px; height:125px; }
body.portal-page .portal-genie-dock .genie-bubble { margin-right:8px; }
@media(max-width:800px){ body.portal-page .portal-workspace { grid-template-columns:1fr; } }
@media(max-width:480px){ body.portal-page .appt-toggle { flex-wrap:wrap; } body.portal-page .appt-text { min-width:160px; } body.portal-page .appt-chev { margin-left:52px; } body.portal-page .portal-genie-dock .genie-bubble { width:180px; } }

/* Plan details stay together in the My plan tab. */
body.portal-page .plan-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
body.portal-page .plan-heading h2 { margin:4px 0 0; font-size:24px; }
body.portal-page .plan-heading p { margin:0; letter-spacing:.08em; }
body.portal-page .plan-dates { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:22px 0; padding:18px; border-radius:12px; background:rgba(103,232,249,.06); border:1px solid rgba(103,232,249,.14); }
body.portal-page .plan-dates strong { display:block; margin-top:6px; color:#e0f2fe; font-size:18px; }
body.portal-page .plan-renew-row { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:14px; border-top:1px solid rgba(255,255,255,.12); padding-top:18px; margin-top:18px; }
body.portal-page .plan-renew-row p { margin:4px 0 0; }
@media(max-width:420px){body.portal-page .plan-dates { grid-template-columns:1fr; }}

/* Compact customer plan: retain details without tall stacked rows. */
body.portal-page .plan-details { padding:16px 18px; }
body.portal-page .plan-heading h2 { font-size:20px; margin-top:2px; }
body.portal-page .plan-dates { gap:12px; margin:12px 0; padding:12px 14px; grid-template-columns:1fr 1fr; }
body.portal-page .plan-dates strong { font-size:15px; margin-top:2px; }
body.portal-page .plan-details .kv { display:grid; grid-template-columns:1fr 1fr; gap:3px 18px; margin:12px 0; }
body.portal-page .plan-details .kv dt { margin:0; padding:0; font-size:12px; color:#a8b7cc; }
body.portal-page .plan-details .kv dd { margin:0; padding:0 0 10px; font-size:14px; font-weight:600; }
body.portal-page .plan-details .kv dt:nth-of-type(1) { grid-column:1; grid-row:1; }
body.portal-page .plan-details .kv dd:nth-of-type(1) { grid-column:1; grid-row:2; }
body.portal-page .plan-details .kv dt:nth-of-type(2) { grid-column:2; grid-row:1; }
body.portal-page .plan-details .kv dd:nth-of-type(2) { grid-column:2; grid-row:2; }
body.portal-page .plan-details .kv dt:nth-of-type(3) { grid-column:1; grid-row:3; }
body.portal-page .plan-details .kv dd:nth-of-type(3) { grid-column:1; grid-row:4; }
body.portal-page .plan-details .kv dt:nth-of-type(4) { grid-column:2; grid-row:3; }
body.portal-page .plan-details .kv dd:nth-of-type(4) { grid-column:2; grid-row:4; }
body.portal-page .plan-renew-row { margin-top:0; padding-top:12px; gap:8px; }
body.portal-page .plan-renew-row strong { font-size:13px; }
body.portal-page .plan-renew-row p { display:none; }
@media(max-width:360px){ body.portal-page .plan-dates { padding:10px; gap:8px; } body.portal-page .plan-details { padding:14px; } }

/* Compact floating chat assistant: no extra section at the page bottom. */
body.portal-page .portal { padding-bottom:48px; }
body.portal-page .genie { bottom:32px; }
body.portal-page .genie-btn { width:100px; height:123px; }
body.portal-page .genie-dot { width:10px; height:10px; right:12px; top:18px; }
body.portal-page .genie-bubble { width:190px; margin-right:0; }

/* Reference-inspired customer dashboard. */
body.portal-page{background:#040c22;color:#f1f5ff}body.portal-page .ai-grid,body.portal-page #ai-canvas{opacity:.12}body.portal-page .portal{max-width:1240px;padding:26px 24px 150px}body.portal-page .card{background:linear-gradient(130deg,rgba(15,31,53,.96),rgba(21,23,64,.88));border:1px solid #334158;border-radius:15px;box-shadow:0 6px 25px #02071930}body.portal-page .portal-top{gap:24px;margin-bottom:22px;flex-wrap:wrap}.reference-brand{display:flex;align-items:center;gap:12px}.reference-v{font-size:64px;font-weight:900;line-height:1;background:linear-gradient(140deg,#2cbbff,#8844ed);color:transparent;background-clip:text}.reference-brand strong{font-size:30px;letter-spacing:1px}.reference-brand small{display:block;letter-spacing:4px;color:#75b7ff;font-size:11px}.reference-welcome{border-left:1px solid #475569;padding-left:25px;flex:1}.reference-welcome strong{font-size:21px}.reference-welcome small{display:block;margin-top:6px;color:#bec9df}body.portal-page [data-clock]{display:none}body.portal-page .portal-top .btn{padding:12px 16px;background:linear-gradient(120deg,#218cf4,#1946cc);border-color:#508bf6}body.portal-page .portal-top [data-open-chat]{background:linear-gradient(120deg,#9351e9,#5429bc);border-color:#a177e5}.reference-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:16px}.metric-card{display:flex;gap:18px;padding:18px;align-items:center}.metric-icon{display:grid;place-items:center;width:62px;height:62px;flex-shrink:0;border-radius:50%;background:linear-gradient(135deg,#368bf7,#12399c);color:white}.metric-icon svg{width:30px;height:30px}.metric-icon.purple{background:linear-gradient(135deg,#a464ef,#4026ad)}.metric-card h2{font-size:16px;margin:0}.metric-card strong{font-size:36px;line-height:1.3}.metric-card p{font-size:12px;margin:3px 0;color:#c6d4ec}body.portal-page .portal-workspace{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:start}body.portal-page .portal-workspace>.stack:first-child{display:contents}.reference-cases{grid-column:1;grid-row:1;min-height:330px}.reference-plan{grid-column:2;grid-row:1;padding:14px}.reference-device{grid-column:3;grid-row:1}body.portal-page .appt-card{grid-column:1/-1;grid-row:2}.reference-title{display:flex;gap:10px;align-items:center;font-size:19px;margin:0;padding:14px 12px}.reference-title svg{color:#80b9ff;width:25px;height:25px}.reference-plan-body{background:#0a182b80;border:1px solid #354359;border-radius:12px;padding:16px}.reference-plan-body h3{font-size:18px;margin:0 0 5px}.reference-days{display:flex;justify-content:space-between;align-items:center;border-block:1px solid #354359;padding:12px 0;margin:12px 0}.reference-days strong{display:block;color:#82bbff;font-size:34px}.reference-ring{border:6px solid #7052e8;border-top-color:#4197ff;border-radius:50%;height:62px;width:62px;display:grid;place-items:center;font-size:18px}.reference-technician{display:flex;gap:12px;margin:14px 0}.reference-technician .metric-icon{width:40px;height:40px}.reference-technician small,.reference-technician strong{display:block}.reference-technician strong{color:#83bfff}.reference-technician small{color:#bec9df}.reference-plan-body>.btn{width:100%;margin-top:8px}body.portal-page .scan-card{min-height:330px;padding:22px}body.portal-page .scan-actions{display:flex;flex-direction:column;align-items:stretch;gap:14px;margin-top:26px}body.portal-page .scan-actions .btn{width:100%;justify-content:flex-start;padding:18px;background:#162342;border:1px solid #414c6d;border-radius:12px}.reference-cases .empty{padding:40px 20px}body.portal-page .tabs{flex-wrap:wrap}body.portal-page .muted{color:#bbc7dd}
@media(max-width:980px){body.portal-page .portal-top .toolbar{width:100%}.reference-welcome{flex:1}.reference-metrics{gap:9px}.metric-card{padding:12px;gap:10px}.metric-icon{width:45px;height:45px}body.portal-page .portal-workspace{grid-template-columns:1fr 1fr}.reference-device{grid-column:1/-1;grid-row:2}body.portal-page .appt-card{grid-row:3}.reference-device .scan-card{min-height:0}}
@media(max-width:620px){body.portal-page .portal{padding:18px 16px 150px}.reference-brand strong{font-size:24px}.reference-v{font-size:48px}.reference-welcome{border:0;padding:0;flex-basis:100%}.reference-metrics{grid-template-columns:1fr}.metric-card strong{font-size:28px}.metric-card p{font-size:12px}body.portal-page .portal-workspace{grid-template-columns:1fr}.reference-cases{grid-column:1;grid-row:1}.reference-plan{grid-column:1;grid-row:2}.reference-device{grid-column:1;grid-row:3}body.portal-page .appt-card{grid-column:1;grid-row:4}.reference-cases{min-height:260px}}

/* Refined neutral support header and balanced cards. */
body.portal-page .reference-brand strong{font-size:23px;letter-spacing:0;font-weight:700}body.portal-page .reference-brand small{font-size:9px;letter-spacing:1.8px;margin-top:5px;color:#93a8cf}.support-brand-icon{display:grid;place-items:center;width:46px;height:46px;border-radius:14px;background:linear-gradient(145deg,#237bf0,#7544d8);box-shadow:0 5px 20px #3575ff25}.support-brand-icon svg{width:25px;height:25px}body.portal-page .reference-welcome strong{font-size:18px}body.portal-page .reference-welcome small{font-size:12px;color:#9cacc8}body.portal-page .portal-top{padding:0 0 22px;border-bottom:1px solid #25334d;margin-bottom:22px}body.portal-page .portal-top .btn{border-radius:10px}body.portal-page .reference-plan{padding:10px}body.portal-page .reference-plan-body{background:linear-gradient(145deg,#10203b,#0b152b);border-color:#2a3b58}body.portal-page .reference-cases{min-height:330px}body.portal-page .reference-title{padding:16px;font-size:18px}body.portal-page .card{border-color:#2c3a55;box-shadow:0 12px 35px #00000020}body.portal-page .tabs{margin:0 12px;border-bottom-color:#2b3b56}body.portal-page .tab{font-size:12px;padding:12px 10px}body.portal-page .scan-card{background:linear-gradient(140deg,#111e38,#171636)}body.portal-page .scan-actions .btn{transition:background .2s,border-color .2s}body.portal-page .scan-actions .btn:hover{background:#21335b;border-color:#6b8bc3}body.portal-page .appt-card{margin-top:3px}body.portal-page .reference-days{border-color:#2d3d59}body.portal-page .reference-technician{padding:4px 0}
@media(max-width:620px){body.portal-page .reference-welcome{padding-top:4px}.reference-brand{gap:10px}body.portal-page .portal-top{gap:16px}body.portal-page .portal-top .toolbar{gap:8px}body.portal-page .portal-top .btn{padding:10px 12px}}

/* Match the robot greeting to its orange accents. */
body.portal-page .genie-text strong { color:#ffb454; }
body.portal-page .genie-text small, body.portal-page .genie-text em { color:#ffd29a; }

/* Raised assistant and a restrained technical backdrop. */
body.portal-page .genie{bottom:64px}
body.portal-page{background-color:#040c22;background-image:radial-gradient(ellipse at 8% 18%,rgba(33,104,205,.22),transparent 42%),radial-gradient(ellipse at 90% 48%,rgba(103,57,182,.19),transparent 44%),linear-gradient(150deg,#030b1c,#08152c 55%,#080c24);background-attachment:fixed}
body.portal-page .ai-grid{opacity:.24;background-image:linear-gradient(rgba(98,152,230,.09) 1px,transparent 1px),linear-gradient(90deg,rgba(98,152,230,.09) 1px,transparent 1px);background-size:64px 64px;mask-image:linear-gradient(to bottom,transparent,#000 30%,#000 75%,transparent);pointer-events:none}
body.portal-page .ai-orb-1{opacity:.22}body.portal-page .ai-orb-2{opacity:.16}
body.portal-page .portal::before{content:"";position:fixed;z-index:-1;inset:12% -180px auto auto;width:550px;height:550px;border:1px solid #426dac25;border-radius:50%;box-shadow:0 0 0 45px #426dac0d,0 0 0 90px #426dac0a;pointer-events:none}
@media(max-width:620px){body.portal-page .genie{bottom:48px}body.portal-page .ai-grid{background-size:48px 48px;opacity:.18}}

/* Circuit-board backdrop, concentrated around the content edges. */
body.portal-page{background-image:url('tech-circuit-background.svg'),radial-gradient(ellipse at 90% 20%,rgba(90,46,161,.2),transparent 48%),linear-gradient(145deg,#030a19,#07162b 55%,#080d24);background-size:cover,cover,cover;background-position:center top;background-repeat:no-repeat;background-attachment:fixed}
body.portal-page .ai-grid{opacity:.1}body.portal-page #ai-canvas{opacity:.07}body.portal-page .portal::before{display:none}

body.portal-page .genie-bubble{background:transparent;border:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none}
body.portal-page .genie-text{text-shadow:0 1px 4px rgba(0,0,0,.8)}

/* Sharper glass surfaces for the customer dashboard. */
body.portal-page .portal-workspace .card{background:linear-gradient(135deg,rgba(39,65,102,.58),rgba(13,23,49,.78) 55%,rgba(37,30,74,.62));border:1px solid rgba(154,191,239,.28);backdrop-filter:blur(20px) saturate(135%);-webkit-backdrop-filter:blur(20px) saturate(135%);box-shadow:inset 0 1px 0 rgba(220,238,255,.16),inset 0 -1px 0 rgba(70,123,204,.1),0 14px 35px rgba(0,4,18,.28)}
body.portal-page .reference-plan-body{background:linear-gradient(145deg,rgba(43,68,103,.35),rgba(9,20,43,.62));border-color:rgba(163,198,243,.22);box-shadow:inset 0 1px 0 rgba(225,240,255,.1)}
body.portal-page .scan-actions .btn{background:linear-gradient(135deg,rgba(74,97,147,.34),rgba(30,43,79,.58));border-color:rgba(165,191,240,.24);box-shadow:inset 0 1px 0 rgba(255,255,255,.09)}
body.portal-page .reference-title{color:#f4f8ff}body.portal-page .reference-title svg{filter:drop-shadow(0 0 5px rgba(82,158,255,.3))}
@supports not (backdrop-filter:blur(1px)){body.portal-page .portal-workspace .card{background:linear-gradient(135deg,#172941,#111a35)}}

/* Elegant glass finish and readable assistant greeting: 70% transparent. */
body.portal-page .genie-bubble{background:rgba(8,17,35,.30);border:1px solid rgba(255,204,135,.32);border-radius:16px;backdrop-filter:blur(16px) saturate(140%);-webkit-backdrop-filter:blur(16px) saturate(140%);box-shadow:inset 0 1px 0 rgba(255,235,204,.15),0 8px 28px rgba(0,0,0,.22)}
body.portal-page .genie-text strong{color:#ffc16c;font-weight:700;line-height:1.35}body.portal-page .genie-text small,body.portal-page .genie-text em{color:#ffe2ba;line-height:1.45}body.portal-page .genie-text{text-shadow:0 1px 3px #030913}body.portal-page .genie-x{color:#ffe2ba}
body.portal-page .portal-workspace .card{background:linear-gradient(135deg,rgba(63,87,124,.40),rgba(14,27,50,.60) 60%,rgba(58,43,95,.38));border-color:rgba(184,212,250,.26);backdrop-filter:blur(24px) saturate(150%);-webkit-backdrop-filter:blur(24px) saturate(150%);box-shadow:inset 0 1px 0 rgba(241,248,255,.20),inset 1px 0 0 rgba(207,228,255,.06),0 16px 38px rgba(0,5,20,.25)}
body.portal-page .reference-plan-body{background:rgba(12,25,47,.38);border-color:rgba(186,210,249,.20)}body.portal-page .portal-top{border-bottom-color:rgba(180,208,250,.17)}body.portal-page .scan-actions .btn{background:linear-gradient(145deg,rgba(100,128,178,.24),rgba(32,49,82,.38));border-color:rgba(192,214,250,.23);box-shadow:inset 0 1px 0 rgba(255,255,255,.13)}body.portal-page .scan-actions .btn:hover{background:rgba(91,123,180,.32);border-color:rgba(181,212,255,.45)}

/* Messages to customers */
.notice-modal { max-width: 460px; }
.notice-from { color: #67e8f9; font-weight: 600; display: block; margin-top: 10px; }
.notice-modal h2 { margin: 4px 0 8px; }
.notice-msg { font-size: 15px; line-height: 1.55; }
.notice-banner { position: relative; display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; padding: 12px 34px 12px 14px; border-radius: 12px; background: #fffbeb; border: 1px solid #fcd34d; color: #78350f; font-size: 13.5px; text-align: left; }
.notice-x { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 20px; line-height: 1; color: #92400e; cursor: pointer; }
/* Visitors page */
.visit-list { border-top: 1px solid var(--border); }
.visit { border-bottom: 1px solid var(--border); }
.visit summary { display: grid; grid-template-columns: 36px minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 20px; cursor: pointer; list-style: none; }
.visit summary::-webkit-details-marker { display: none; }
.visit summary:hover { background: var(--bg, #f8fafc); }
.visit-who { display: flex; flex-direction: column; min-width: 0; }
.visit-meta { font-size: 12.5px; }
.visit-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.visit-timeline { list-style: none; margin: 0; padding: 4px 20px 14px 68px; display: grid; gap: 4px; }
.visit-timeline li { display: grid; grid-template-columns: 96px 1fr; gap: 10px; font-size: 13px; padding: 4px 0; border-left: 2px solid var(--border); padding-left: 12px; position: relative; }
.visit-timeline li::before { content: ''; position: absolute; left: -6px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.visit-timeline li.ev-click::before { background: var(--primary, #4f46e5); }
.visit-timeline li.ev-view::before { background: #10b981; }
.visit-timeline li.ev-chat::before { background: #f59e0b; }
.visit-timeline time { color: var(--muted, #64748b); font-variant-numeric: tabular-nums; }
.visit-actions { padding: 0 20px 14px 68px; }
@media (max-width: 760px) { .visit summary { grid-template-columns: 36px 1fr; } .visit-meta, .visit-pills { grid-column: 2; justify-content: flex-start; } .visit-timeline, .visit-actions { padding-left: 20px; } }
/* "Get messages on this device" card (customer Live Support page) */
.push-card { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px 16px; }
.push-card[hidden] { display: none; }
.push-ico { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; font-size: 20px; background: rgba(250,204,21,.16); border: 1px solid rgba(250,204,21,.35); }
.push-body { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.push-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.push-card.is-on .push-ico { background: rgba(16,185,129,.16); border-color: rgba(16,185,129,.4); }
/* Buttons hidden with the [hidden] attribute must stay hidden even though .btn sets display */
.btn[hidden], .push-card [hidden] { display: none !important; }

/* ================= Live Support: everything on one screen, no page scrolling =================
   Computers/tablets: header, alerts and the three columns fill the window; long lists scroll inside their own card.
   Phones: header + one section at a time + a bottom bar (Cases · Plan · Device). */
body.portal-page { height: 100vh; height: 100dvh; overflow: hidden; }
body.portal-page .portal { height: 100vh; height: 100dvh; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; }
body.portal-page .portal > * { flex: 0 0 auto; }
body.portal-page .portal > .portal-workspace { flex: 1 1 auto; min-height: 0; margin: 0; }
body.portal-page .portal p.muted.small.right { display: none; }                 /* "version 3.0" */
/* alerts become slim strips */
body.portal-page .portal > .paycard, body.portal-page .portal > #paylink-slot > .paycard, body.portal-page .portal > .renew-note, body.portal-page .portal > .flash, body.portal-page .portal > .alert { margin: 0 0 10px; padding: 10px 14px; gap: 12px; }
body.portal-page .portal > .renew-note .renew-points, body.portal-page .portal > .renew-note .renew-icon { display: none; }
body.portal-page .portal > .renew-note h2 { font-size: 15px; margin: 0 0 2px; }
body.portal-page .portal > .renew-note p { font-size: 12.5px; margin: 0; }
body.portal-page .portal > .renew-note .renew-actions { align-self: center; }
body.portal-page .paycard .paycard-icon { width: 36px; height: 36px; font-size: 18px; }
body.portal-page .reference-cases, body.portal-page .reference-plan, body.portal-page .reference-device, body.portal-page .scan-card { min-height: 0 !important; }

@media (min-width: 821px) {
  body.portal-page .portal { max-width: 1320px; padding: 14px 22px 0 !important; }
  body.portal-page .portal-top { padding-bottom: 12px !important; margin-bottom: 12px !important; }
  body.portal-page .portal-workspace { grid-template-rows: minmax(0, 1fr) auto; align-items: stretch !important; gap: 12px !important; padding-bottom: 150px; }
  body.portal-page .reference-cases { display: flex; flex-direction: column; overflow: hidden; }
  body.portal-page .reference-cases .tab-panel.active { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  body.portal-page .reference-plan { overflow-y: auto; }
  body.portal-page .reference-plan-body { padding: 12px 14px; }
  body.portal-page .reference-days { padding: 8px 0; margin: 8px 0; }
  body.portal-page .reference-device { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }
  body.portal-page .reference-device .scan-card { padding: 16px; }
  body.portal-page .reference-device .scan-actions { margin-top: 14px; }
  body.portal-page .reference-device .scan-actions .btn { padding: 12px 14px; }
  body.portal-page .appt-card { margin: 0 !important; }
  body.portal-page .appt-toggle { padding-top: 10px; padding-bottom: 10px; }
  /* genie sits in its own band at the bottom centre, bubble beside it */
  body.portal-page .genie { flex-direction: row; align-items: flex-end; bottom: 8px; }
  body.portal-page .genie-btn { width: 112px; height: 138px; }
  body.portal-page .genie-bubble { margin: 0 0 8px; }
}
@media (min-width: 821px) and (max-height: 760px) {
  body.portal-page .portal-workspace { padding-bottom: 118px; }
  body.portal-page .genie-btn { width: 88px; height: 108px; }
  body.portal-page .genie-bubble { margin-bottom: 4px; }
  body.portal-page .genie-text small { display: none; }
  body.portal-page .reference-title { padding: 10px 12px !important; font-size: 16px !important; }
  body.portal-page .reference-days strong { font-size: 26px; }
  body.portal-page .reference-ring { width: 48px; height: 48px; border-width: 5px; font-size: 15px; }
  body.portal-page .reference-plan-body > p.muted.small:first-of-type { display: none; }
  body.portal-page .reference-technician { margin: 8px 0; }
}
/* very short windows (e.g. a small laptop with the browser zoomed): fall back to normal scrolling */
@media (min-width: 821px) and (max-height: 560px) {
  body.portal-page, body.portal-page .portal { height: auto; overflow: visible; }
}

/* ---------- phones: app-style sections ---------- */
.ptab-bar { display: none; }
@media (max-width: 820px) {
  body.portal-page .portal { padding: 10px 12px 0 !important; max-width: none; }
  body.portal-page .portal-top { gap: 8px !important; padding-bottom: 8px !important; margin-bottom: 8px !important; }
  body.portal-page .reference-brand small, body.portal-page .reference-welcome small { display: none; }
  body.portal-page .support-brand-icon { width: 34px; height: 34px; border-radius: 10px; }
  body.portal-page .reference-brand strong { font-size: 17px !important; }
  body.portal-page .reference-welcome strong { font-size: 14px !important; }
  body.portal-page .portal-top .toolbar { width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  body.portal-page .portal-top .btn { padding: 8px 10px !important; font-size: 12.5px; white-space: nowrap; }
  body.portal-page .portal > .renew-note .renew-actions .btn-secondary { display: none; }
  body.portal-page .portal-workspace { display: block !important; position: relative; padding-bottom: 64px; }
  body.portal-page .portal-workspace > .stack:first-child { display: contents; }
  body.portal-page .reference-cases, body.portal-page .reference-plan, body.portal-page .reference-device, body.portal-page .appt-card { display: none !important; }
  /* the section chosen in the bottom bar fills the space; its content scrolls inside it */
  body.portal-page:not([data-ptab]) .reference-cases, body.portal-page[data-ptab="cases"] .reference-cases,
  body.portal-page[data-ptab="plan"] .reference-plan, body.portal-page[data-ptab="device"] .reference-device { display: flex !important; flex-direction: column; height: 100%; overflow-y: auto; box-sizing: border-box; }
  body.portal-page:not([data-ptab]) .appt-card, body.portal-page[data-ptab="cases"] .appt-card { display: block !important; margin: 0 0 10px !important; }
  body.portal-page:not([data-ptab]) .reference-cases, body.portal-page[data-ptab="cases"] .reference-cases { height: calc(100% - 70px); }
  body.portal-page .reference-device { gap: 10px; }
  .ptab-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 6px;
    background: rgba(4, 12, 34, .96); border-top: 1px solid #25334d; backdrop-filter: blur(10px); }
  .ptab-bar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 0; border-radius: 10px; background: none; color: #93a8cf; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
  .ptab-bar button .icon { width: 20px; height: 20px; }
  .ptab-bar button.is-active { background: rgba(59,130,246,.18); color: #fff; }
  body.portal-page .genie { bottom: 64px; }
  body.portal-page .genie-btn { width: 62px; height: 78px; }
  /* room at the end of each section so the genie never hides the last button */
  body.portal-page .reference-cases, body.portal-page .reference-plan, body.portal-page .reference-device { padding-bottom: 90px !important; }
  body.portal-page .genie-bubble { width: 180px; }
}
/* Security / authenticator */
.tfa-status { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--bg, #f8fafc); border: 1px solid var(--border); }
.tfa-status > div { display: flex; flex-direction: column; gap: 2px; }
.tfa-status.on { background: #ecfdf5; border-color: #a7f3d0; }
.tfa-ico { font-size: 26px; }
.tfa-setup { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: start; }
.tfa-qr { width: 220px; height: 220px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-sizing: border-box; }
.tfa-qr svg { width: 100%; height: 100%; }
.tfa-secret { display: inline-block; margin-top: 4px; padding: 4px 8px; border-radius: 6px; background: var(--bg, #f1f5f9); letter-spacing: 1px; font-size: 13px; }
.tfa-input { font-size: 20px !important; letter-spacing: 4px; text-align: center; font-variant-numeric: tabular-nums; }
.tfa-codes { padding: 14px 16px; border-radius: 12px; background: #fffbeb; border: 1px solid #fcd34d; }
.tfa-code-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0; }
.tfa-code-grid span { padding: 6px; border-radius: 6px; background: #fff; border: 1px solid #fde68a; text-align: center; }
@media (max-width: 640px) { .tfa-setup { grid-template-columns: 1fr; } .tfa-code-grid { grid-template-columns: repeat(2, 1fr); } }
/* Visitor / live customer location */
.visit-geo, .live-geo { font-weight: 600; color: var(--text, #0f172a); }
/* Public appointment form (vonetel.support home) */
.appt-public { display: flex; flex-direction: column; gap: 4px; }
.appt-public textarea { resize: vertical; min-height: 72px; }
.appt-when { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.appt-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted, #64748b); font-size: 12px; }
.appt-or::before, .appt-or::after { content: ''; flex: 1; height: 1px; background: var(--border, #e2e8f0); }
.appt-done { text-align: center; padding: 6px 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* Home page: free tools */
.home-tools { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.home-tools-title { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #67e8f9; }
.home-tool { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: rgba(15, 23, 42, .55); border: 1px solid rgba(148, 163, 184, .25); backdrop-filter: blur(8px); }
.home-tool-ico { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; font-size: 22px; background: rgba(34, 211, 238, .12); border: 1px solid rgba(34, 211, 238, .3); }
.home-tool-body { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: #e2e8f0; }
.home-tool-body span { font-size: 12.5px; color: #94a3b8; }
.home-tool-body .scan-summary { margin: 6px 0 0; }
.home-tool-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.sec-modal { max-width: 620px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 20px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.sec-modal .scan-panel { overflow-y: auto; }
.sec-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(148, 163, 184, .14); }
.sec-tabs button { flex: 1; border: 0; background: none; padding: 8px 10px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; color: inherit; opacity: .7; cursor: pointer; }
.sec-tabs button.is-active { background: rgba(34, 211, 238, .18); opacity: 1; }
.sec-score { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.sec-score:empty { display: none; }
.sec-score > div { display: flex; flex-direction: column; gap: 2px; }
.sec-ring { --p: 0; flex: 0 0 auto; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#10b981 calc(var(--p) * 1%), rgba(148, 163, 184, .25) 0); position: relative; }
.sec-ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #fff; z-index: 0; }
.sec-ring b { position: relative; z-index: 1; font-size: 17px; color: #0f172a; }
.sec-modal .scan-results { grid-template-columns: 1fr; margin: 0; }
.sec-modal .scan-results li { grid-template-columns: 20px minmax(0, .8fr) minmax(0, 1.4fr); }
.sec-steps { list-style: none; counter-reset: cl; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.sec-steps li { counter-increment: cl; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 12px 10px 42px; position: relative; border-radius: 10px; background: rgba(148, 163, 184, .1); }
.sec-steps li::before { content: counter(cl); position: absolute; left: 12px; top: 10px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: rgba(34, 211, 238, .2); }
.sec-steps li.is-done::before { content: '✓'; background: #10b981; color: #fff; }
.sec-steps li.is-done strong { text-decoration: line-through; opacity: .7; }
.sec-steps li p { margin: 3px 0 0; }
.sec-steps .btn { margin-top: 6px; }

/* Live Support: Quick help panel (fills the Device column) */
.quick-help { padding: 0 12px 12px; }
.quick-help .reference-title { padding: 14px 4px 10px !important; }
.qh-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.qh-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; text-align: left; cursor: pointer; text-decoration: none;
  background: #162342; border: 1px solid #414c6d; color: #f1f5ff; font: inherit; transition: background .2s, border-color .2s; }
.qh-btn:hover { background: #21335b; border-color: #6b8bc3; color: #fff; }
.qh-btn > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.qh-btn strong { font-size: 14px; }
.qh-btn small { font-size: 12px; color: #94a3b8; }
.qh-ico { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; font-size: 18px; background: rgba(59, 130, 246, .16); }
/* Computers: booking moved into Quick help, so the full-width appointment bar goes and the columns get its height */
@media (min-width: 821px) {
  body.portal-page .portal-workspace { grid-template-rows: minmax(0, 1fr) !important; }
  body.portal-page .appt-card { display: none !important; }
  body.portal-page .reference-device .scan-card { flex: 0 0 auto; }
  body.portal-page .reference-device .quick-help { flex: 1 1 auto; display: flex; flex-direction: column; }
  body.portal-page .reference-device .qh-grid { flex: 1 1 auto; align-content: start; }
}
@media (min-width: 821px) and (max-height: 760px) {
  .qh-btn { padding: 7px 10px; }
  .qh-ico { width: 30px; height: 30px; font-size: 15px; }
  .qh-btn small { display: none; }
}
/* Support Plan column: what's included (fills the empty space) */
.plan-included { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #0a182b80; border: 1px solid #2a3b58; }
.plan-included strong { display: block; font-size: 14px; margin-bottom: 6px; color: #e2e8f0; }
.plan-included ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plan-included li { position: relative; padding-left: 22px; font-size: 13px; color: #c6d4ec; }
.plan-included li::before { content: '✓'; position: absolute; left: 0; top: 0; color: #34d399; font-weight: 700; }
@media (min-width: 821px) { .plan-included { margin-top: 10px; padding: 10px 12px; } .plan-included ul { gap: 3px; } .plan-included li { font-size: 12.5px; } .reference-plan-body > .btn { margin-top: 6px; } }
/* only where it fits without making the column scroll */
@media (min-width: 821px) and (max-height: 860px) { .plan-included { display: none; } }

/* Home page (vonetel.support) fits one screen — scoped to the home page only */
body.hud-page:has(.home-tools) .ai-card .input { height: 40px; }
body.hud-page:has(.home-tools) .ai-card textarea.input { height: auto; min-height: 58px; }
body.hud-page:has(.home-tools) .ai-card .btn-lg { height: 44px; }
body.hud-page:has(.home-tools) .ai-card .auth-brand { margin-bottom: 10px; }
body.hud-page:has(.home-tools) .ai-card .lead { margin: 0 0 10px; }
body.hud-page:has(.home-tools) .appt-public { gap: 8px; }
body.hud-page:has(.home-tools) .appt-public .field { gap: 4px; }
body.hud-page:has(.home-tools) .appt-public .btn-lg { margin-top: 4px; }
body.hud-page:has(.home-tools) .appt-or { margin: 8px 0; }
body.hud-page:has(.home-tools) .auth-foot { margin-top: 8px; }
@media (min-width: 921px) {
  body.hud-page:has(.home-tools) .ai-auth { min-height: 0; height: 100vh; height: 100dvh; padding: 16px 24px; }
  body.hud-page:has(.home-tools) .ai-card { padding: 22px 28px; }
  body.hud-page:has(.home-tools) .ai-hero h1 { font-size: 40px; margin: 12px 0 10px; }
  body.hud-page:has(.home-tools) .home-tools { margin-top: 14px; gap: 8px; }
  body.hud-page:has(.home-tools) .home-tool { padding: 10px 12px; }
}
@media (min-width: 921px) and (max-height: 700px) {
  body.hud-page:has(.home-tools) .ai-hero ul, body.hud-page:has(.home-tools) .ai-card .lead { display: none; }
}
@media (max-width: 920px) {
  body.hud-page:has(.home-tools) .ai-auth { min-height: 100dvh; gap: 12px; padding: 12px 14px; align-content: center; }
  body.hud-page:has(.home-tools) .ai-eyebrow, body.hud-page:has(.home-tools) .ai-hero p,
  body.hud-page:has(.home-tools) .home-tools-title, body.hud-page:has(.home-tools) .ai-card .lead,
  body.hud-page:has(.home-tools) .appt-or { display: none; }
  body.hud-page:has(.home-tools) .ai-hero h1 { font-size: 23px; margin: 0; }
  body.hud-page:has(.home-tools) .home-tools { margin: 10px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  body.hud-page:has(.home-tools) .home-tool { flex-direction: column; align-items: stretch; gap: 6px; padding: 9px 10px; text-align: left; }
  body.hud-page:has(.home-tools) .home-tool-ico, body.hud-page:has(.home-tools) .home-tool-body > span { display: none; }
  body.hud-page:has(.home-tools) .home-tool-body { flex: 0 0 auto; font-size: 13px; }
  body.hud-page:has(.home-tools) .home-tool-btns .btn { flex: 1 1 auto; justify-content: center; }
  body.hud-page:has(.home-tools) [data-sec-open="safer"] { display: none; }
  body.hud-page:has(.home-tools) .ai-card { padding: 16px 16px 12px; }
  body.hud-page:has(.home-tools) .ai-card .auth-brand { font-size: 14px; }
  body.hud-page:has(.home-tools) .appt-public .field label { font-size: 12px; }
  body.hud-page:has(.home-tools) .appt-chat { margin-top: 8px; }
}

/* Services page */
.svc-table td { vertical-align: top; }
.svc-table td:nth-child(3) { min-width: 240px; }
.svc-table td:nth-child(4) { min-width: 240px; }
.svc-table td:nth-child(5) { min-width: 220px; }
.svc-table textarea.input { min-height: 0; resize: vertical; }
.svc-table tr.svc-off td { opacity: .6; }

/* ================= Live Support v4 layout: alerts row · hero (plan + actions) · cases & plan details =================
   Cards are only as tall as their content (no empty boxes); long lists scroll inside their card. */
body.portal-page .ls-alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 10px; margin: 0 0 12px; }
body.portal-page .ls-alerts:not(:has(.card)) { display: none; }
body.portal-page #paylink-slot { display: contents; }
body.portal-page .ls-alerts .card { margin: 0 !important; padding: 10px 14px !important; display: flex; flex-wrap: nowrap !important; align-items: center; gap: 12px; min-height: 0; }
body.portal-page .ls-alerts .paycard-amt { font-size: 20px; flex: 0 0 auto; }
body.portal-page .ls-alerts .paycard-body span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.portal-page .ls-alerts .paycard-body { flex: 1 1 auto; min-width: 0; }
body.portal-page .ls-alerts .paycard-body strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.portal-page .ls-alerts .btn { flex: 0 0 auto; padding: 8px 12px; }
body.portal-page .ls-alerts .renew-note { display: flex; }
body.portal-page .ls-alerts .renew-note .renew-icon { width: 34px; height: 34px; flex: 0 0 auto; }
body.portal-page .ls-alerts .renew-note .renew-body { flex: 1 1 auto; min-width: 0; }
body.portal-page .ls-alerts .renew-note h2 { font-size: 14.5px; margin: 0 0 2px; }
body.portal-page .ls-alerts .renew-note p { font-size: 12.5px; margin: 0; }
body.portal-page .ls-alerts .renew-note .renew-points { display: none; }

body.portal-page .ls-main { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, max-content); align-content: center; align-items: start; gap: 14px; padding-bottom: 150px; box-sizing: border-box; }
body.portal-page .ls-main .card { margin: 0; border-radius: 18px; background: linear-gradient(135deg, rgba(63,87,124,.40), rgba(14,27,50,.62) 60%, rgba(58,43,95,.38));
  border: 1px solid rgba(184,212,250,.24); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(241,248,255,.18), 0 16px 38px rgba(0,5,20,.25); }

/* hero: plan status | actions */
body.portal-page .ls-hero { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.45fr); gap: 26px; padding: 22px 24px; }
.ls-status { display: flex; align-items: center; gap: 22px; padding-right: 26px; border-right: 1px solid rgba(148,163,184,.18); }
.ls-ring { position: relative; width: 136px; height: 136px; flex: 0 0 auto; }
.ls-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ls-ring circle { fill: none; stroke-width: 10; }
.ls-ring .ls-ring-bg { stroke: rgba(148,163,184,.18); }
.ls-ring .ls-ring-fg { stroke: #38bdf8; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(56,189,248,.55)); transition: stroke-dashoffset 1s ease; }
.ls-ring.is-soon .ls-ring-fg { stroke: #fbbf24; filter: drop-shadow(0 0 6px rgba(251,191,36,.5)); }
.ls-ring.is-expired .ls-ring-fg { stroke: #f87171; }
.ls-ring-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ls-ring-num strong { font-size: 38px; line-height: 1; color: #fff; }
.ls-ring-num small { margin-top: 4px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #9fb4d6; }
.ls-status-text { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ls-kicker { font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: #7dd3fc; }
.ls-status-text h2 { margin: 0; font-size: 22px; line-height: 1.2; color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ls-sub { margin: 0; font-size: 13.5px; color: #c3d0e6; }
.ls-sub b { color: #fff; }
.ls-tech { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.ls-tech-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #368bf7, #12399c); flex: 0 0 auto; }
.ls-tech-ico .icon { width: 18px; height: 18px; }
.ls-tech small { display: block; font-size: 11.5px; color: #9fb4d6; }
.ls-tech strong { display: block; color: #93c5fd; font-size: 15px; }
.ls-status-text .btn { margin-top: 6px; }

.ls-actions { min-width: 0; }
.ls-actions-title { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: #9fb4d6; }
.ls-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ls-tile-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ls-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; height: 100%; padding: 14px 16px; box-sizing: border-box;
  border-radius: 14px; border: 1px solid rgba(148,163,184,.22); background: rgba(10,20,40,.5); color: #e2e8f0; font: inherit; text-align: left; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.ls-tile:hover { transform: translateY(-2px); border-color: rgba(125,211,252,.55); background: rgba(20,36,66,.65); }
.ls-tile:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 2px; }
.ls-tile .ls-ico { order: 0; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; margin-bottom: 6px; }
.ls-tile .ls-ico .icon { width: 19px; height: 19px; }
.ls-tile strong { order: 1; font-size: 15px; color: #fff; }
.ls-tile small { order: 2; font-size: 12.5px; color: #9fb4d6; }
.t-chat .ls-ico { background: linear-gradient(135deg, #a855f7, #6d28d9); }
.t-share .ls-ico { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.t-scan .ls-ico { background: linear-gradient(135deg, #2dd4bf, #0f766e); }
.t-appt .ls-ico { background: linear-gradient(135deg, #fbbf24, #ea580c); }
.ls-tile-wrap .scan-summary { margin: 0; font-size: 12px; }
.ls-mini { align-self: flex-start; padding: 4px 10px; border-radius: 8px; border: 1px solid rgba(148,163,184,.3); background: rgba(15,23,42,.6); color: #e2e8f0; font: inherit; font-size: 12px; cursor: pointer; }
.ls-mini[hidden] { display: none; }

/* cases + plan details */
body.portal-page .ls-cases, body.portal-page .ls-plan { display: flex; flex-direction: column; min-height: 0; max-height: 100%; overflow: hidden; padding: 16px 18px; box-sizing: border-box; }
.ls-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; flex: 0 0 auto; }
.ls-card-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 17px; color: #fff; }
.ls-card-head h2 .icon { width: 20px; height: 20px; color: #7dd3fc; }
.ls-card-head .tabs { margin: 0; border: 0; gap: 4px; }
body.portal-page .ls-card-head .tab { padding: 6px 12px; border-radius: 999px; border: 0 !important; margin: 0; box-shadow: none; }
body.portal-page .ls-card-head .tab.active { background: rgba(56,189,248,.18); color: #fff; }
.ls-scroll { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
.ls-cases .case-item { padding: 12px 14px; margin: 0 0 8px; border-radius: 12px; border: 1px solid rgba(148,163,184,.16); background: rgba(10,20,40,.42); }
.ls-cases .case-item:last-child { margin-bottom: 0; }
.ls-cases .case-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ls-cases .case-top .badge { flex: 0 0 auto; }
.ls-cases .case-reply { margin-top: 8px; }
.ls-cases .empty { padding: 18px 10px; }
.ls-new-case { align-self: flex-start; margin-top: 12px; flex: 0 0 auto; }
.ls-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.ls-kv > div { padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(148,163,184,.16); background: rgba(10,20,40,.42); min-width: 0; }
.ls-kv dt { font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: #9fb4d6; }
.ls-kv dd { margin: 3px 0 0; font-weight: 600; color: #fff; overflow-wrap: anywhere; }
body.portal-page .ls-plan .plan-included { display: block !important; margin: 0; }

/* shorter laptop screens */
@media (min-width: 821px) and (max-height: 940px) {
  body.portal-page .ls-main { padding-bottom: 124px; gap: 12px; }
  body.portal-page .genie-btn { width: 92px; height: 114px; }
  body.portal-page .ls-hero { padding: 16px 20px; gap: 20px; }
  .ls-ring { width: 108px; height: 108px; }
  .ls-ring-num strong { font-size: 30px; }
  .ls-tile { padding: 11px 14px; }
  .ls-tile .ls-ico { width: 32px; height: 32px; margin-bottom: 4px; }
  .ls-actions-title { margin-bottom: 8px; }
}
@media (min-width: 821px) and (max-height: 700px) {
  .ls-tile small, .ls-kicker { display: none; }
}
/* tablets / narrow laptops: hero stacks */
@media (min-width: 821px) and (max-width: 1100px) {
  body.portal-page .ls-hero { grid-template-columns: 1fr; }
  .ls-status { border-right: 0; padding-right: 0; }
}

/* phones: Home · Cases · My plan */
@media (max-width: 820px) {
  body.portal-page .ls-alerts { grid-template-columns: 1fr; gap: 8px; margin-bottom: 8px; }
  body.portal-page .ls-alerts .card { padding: 8px 10px !important; }
  body.portal-page .ls-alerts .renew-note .renew-icon { display: none; }
  body.portal-page .ls-main { display: block; padding: 0 0 64px; }
  body.portal-page .ls-main > section { display: none !important; }
  body.portal-page:not([data-ptab]) .ls-hero, body.portal-page[data-ptab="home"] .ls-hero,
  body.portal-page[data-ptab="cases"] .ls-cases, body.portal-page[data-ptab="plan"] .ls-plan { display: flex !important; flex-direction: column; max-height: 100%; overflow-y: auto; }
  body.portal-page .ls-hero { gap: 14px; padding: 14px; }
  .ls-status { border-right: 0; padding-right: 0; gap: 14px; }
  .ls-ring { width: 92px; height: 92px; }
  .ls-ring circle { stroke-width: 11; }
  .ls-ring-num strong { font-size: 26px; }
  .ls-ring-num small { font-size: 9.5px; }
  .ls-status-text h2 { font-size: 18px; }
  .ls-tech { margin-top: 2px; }
  .ls-tiles { gap: 8px; }
  .ls-tile { padding: 10px 12px; }
  .ls-tile .ls-ico { width: 30px; height: 30px; margin-bottom: 2px; }
  .ls-tile strong { font-size: 13.5px; }
  .ls-tile small { font-size: 11.5px; }
  body.portal-page .ls-cases, body.portal-page .ls-plan { padding: 14px; }
  body.portal-page .ls-main > section { padding-bottom: 90px !important; }   /* room for the genie */
  .ptab-bar button { position: relative; }
  .ptab-count { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #f59e0b; color: #111; font-size: 10px; line-height: 16px; }
}
/* v4 fixes: alert text room, nothing wider than the screen, compact tiles on short screens */
body.portal-page .ls-alerts > *, body.portal-page .ls-alerts .card > * { min-width: 0; }
body.portal-page .ls-alerts .paycard-icon { display: none; }
body.portal-page .ls-alerts .btn { font-size: 13px; }
.ls-tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
body.portal-page .ls-main > section, body.portal-page .ls-hero > * { min-width: 0; }
.ls-cases .ls-scroll { min-height: 96px; }
@media (min-width: 821px) and (max-height: 800px) {
  body.portal-page .ls-hero { padding: 14px 18px; }
  .ls-ring { width: 92px; height: 92px; }
  .ls-ring-num strong { font-size: 26px; }
  .ls-ring-num small { font-size: 9.5px; }
  .ls-status-text h2 { font-size: 19px; }
  .ls-kicker, .ls-actions-title { display: none; }
  .ls-tiles { gap: 10px; }
  .ls-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; row-gap: 0; align-items: center; padding: 10px 12px; }
  .ls-tile .ls-ico { grid-row: 1 / span 2; margin: 0; }
  .ls-tile strong { grid-column: 2; }
  .ls-tile small { grid-column: 2; display: block !important; }
}
@media (max-width: 820px) {
  body.portal-page .portal, body.portal-page .ls-main { max-width: 100vw; overflow-x: hidden; }
  body.portal-page .ls-alerts { grid-template-columns: minmax(0, 1fr); }
  body.portal-page .ls-alerts .paycard-body > span { display: none; }
  body.portal-page .ls-alerts .card { padding: 8px 10px !important; gap: 8px; }
  body.portal-page .ls-alerts .btn { padding: 6px 10px; font-size: 12.5px; }
  body.portal-page .ls-alerts .paycard-amt { font-size: 16px; }
}
body.portal-page .ls-alerts .btn { width: auto !important; flex: 0 0 auto !important; }

/* ===== Device check-up popup (Live Support) ===== */
.scan-modal.ds2 { max-width: 600px; gap: 14px; }
.scan-modal.ds2.scanning .scan-panel, .scan-modal.ds2 .scan-panel { display: block; }
.ds2 .ds-head-text { flex: 1; min-width: 0; }
.ds2 .scan-step { font-family: inherit !important; color: #7dd3fc; }
.ds2 .ds-pct { font-size: 22px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.ds2 .ds-pct:empty { display: none; }
.ds2 .scan-bar { height: 8px; }
.ds2 .ds-groups { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ds2 .ds-g { display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px;
  background: rgba(148,163,184,.08); border: 1px solid rgba(148,163,184,.18); transition: background .25s, border-color .25s; }
.ds2 .ds-g strong { font-size: 13.5px; color: #fff; }
.ds2 .ds-g small { grid-column: 2; font-size: 12px; color: #9fb4d6; }
.ds2 .ds-g-ic { grid-row: 1 / span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #fff; background: rgba(148,163,184,.25); }
.ds2 .ds-g.is-run { border-color: rgba(56,189,248,.5); background: rgba(56,189,248,.08); }
.ds2 .ds-g.is-run .ds-g-ic { background: none; border: 3px solid rgba(56,189,248,.25); border-top-color: #38bdf8; animation: scan-spin .8s linear infinite; box-sizing: border-box; }
.ds2 .ds-g.is-ok .ds-g-ic { background: #10b981; }
.ds2 .ds-g.is-ok small { color: #6ee7b7; }
.ds2 .ds-g.is-warn { border-color: rgba(245,158,11,.45); background: rgba(245,158,11,.08); }
.ds2 .ds-g.is-warn .ds-g-ic { background: #f59e0b; color: #111; }
.ds2 .ds-g.is-warn small { color: #fcd34d; }
.ds2 .ds-g.is-wait { opacity: .6; }
.ds2 .ds-result { display: flex; align-items: center; gap: 18px; padding: 14px 16px; margin-bottom: 12px; border-radius: 14px; background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.35); }
.ds2 .ds-result[hidden] { display: none; }
.ds2 .ds-result.is-warn { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.4); }
.ds2 .ds-result.is-bad { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.4); }
.ds2 .ds-score { position: relative; width: 88px; height: 88px; flex: 0 0 auto; }
.ds2 .ds-score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ds2 .ds-score circle { fill: none; stroke-width: 9; }
.ds2 .ds-score-bg { stroke: rgba(148,163,184,.2); }
.ds2 .ds-score-fg { stroke: #10b981; stroke-linecap: round; transition: stroke-dashoffset 1.2s ease; }
.ds2 .is-warn .ds-score-fg { stroke: #f59e0b; }
.ds2 .is-bad .ds-score-fg { stroke: #ef4444; }
.ds2 .ds-score > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ds2 .ds-score strong { font-size: 28px; line-height: 1; color: #fff; }
.ds2 .ds-score small { font-size: 11px; color: #9fb4d6; }
.ds2 .ds-result-text { min-width: 0; }
.ds2 .ds-kicker { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: #9fb4d6; }
.ds2 .ds-result-text h3 { margin: 2px 0 4px; font-size: 20px; color: #fff; }
.ds2 .ds-result .scan-summary { background: none !important; border: 0 !important; padding: 0 !important; color: #c3d0e6 !important; font-weight: 500; }
.ds2 .ds-result + .ds-groups { margin-bottom: 12px; }
.ds2 .scan-results { margin: 0 0 12px; }
.ds2 .scan-results li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; }
.ds2 .scan-results li b { flex: 0 0 22px; width: 22px; height: 22px; }
.ds2 .scan-results li span { display: block; font-size: 12px; color: #fcd34d; font-weight: 700; }
.ds2 .scan-results li strong { display: block; text-align: left; font-size: 13px; }
.ds2 .ds-fix { margin: 4px 0 0; font-size: 12.5px; color: #e2e8f0; }
.ds2 .ds-fix::before { content: 'How to fix: '; color: #7dd3fc; font-weight: 700; }
.ds2 .ds-clean-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ds2 .ds-count { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: rgba(148,163,184,.18); color: #e2e8f0; }
.ds2 .ds-count.is-all { background: rgba(16,185,129,.25); color: #6ee7b7; }
.ds2 .ds-count:empty { display: none; }
.ds2 .ds-foot-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ds2.scanning .ds-foot-btns [data-device-scan] { display: none; }
.ds2 .ds-foot-btns [hidden] { display: none !important; }
@media (max-width: 520px) { .ds2 .ds-groups { grid-template-columns: 1fr; } .ds2 .ds-result { gap: 12px; } .ds2 .ds-score { width: 72px; height: 72px; } .ds2 .scan-mfoot { flex-direction: column; align-items: stretch; } }
/* the scan tile on the page stays the same size: the summary lives in the popup, "Cleanup steps" sits on the tile corner */
body.portal-page .ls-tile-wrap { position: relative; }
body.portal-page .ls-tile-wrap .scan-summary { display: none !important; }
body.portal-page .ls-tile-wrap .ls-mini { position: absolute; top: 10px; right: 10px; }
/* Live Support: My license */
.ls-license { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(56,189,248,.35); background: linear-gradient(135deg, rgba(56,189,248,.10), rgba(99,102,241,.08)); }
.ls-license-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ls-license-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #fff; }
.ls-license-title .icon { width: 17px; height: 17px; color: #7dd3fc; }
.ls-license-key { display: flex; align-items: center; gap: 8px; margin: 8px 0 10px; }
.ls-license-key code { flex: 1 1 auto; min-width: 0; padding: 8px 10px; border-radius: 8px; background: rgba(2,6,23,.55); border: 1px dashed rgba(125,211,252,.45); color: #e0f2fe; font: 600 13.5px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .5px; overflow-wrap: anywhere; }
.ls-license-key .ls-mini { position: static; }
.ls-license-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 0; }
.ls-license-grid .full { grid-column: 1 / -1; }
.ls-license-grid dt { font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; color: #9fb4d6; }
.ls-license-grid dd { margin: 1px 0 0; font-size: 13.5px; font-weight: 600; color: #fff; overflow-wrap: anywhere; }
.ls-license-via { margin: 8px 0 0; font-size: 11.5px; color: #9fb4d6; }

/* phones: the genie's greeting bubble would cover the page, so only the genie shows (tap it to chat) */
@media (max-width: 820px) { body.portal-page .genie-bubble { display: none !important; } }
body.portal-page .portal-top .toolbar:not(:has(.btn)) { display: none; }
/* Live Support: customer name & ID a bit larger (ID shown on phones too) */
body.portal-page .reference-welcome strong { font-size: 25px !important; line-height: 1.2; }
body.portal-page .reference-welcome small { display: block !important; font-size: 15px !important; margin-top: 6px; color: #cfe0f7; font-weight: 600; letter-spacing: .2px; }
@media (max-width: 820px) {
  body.portal-page .reference-welcome strong { font-size: 18px !important; }
  body.portal-page .reference-welcome small { font-size: 13.5px !important; margin-top: 3px; }
}
/* Scan tile stands out: teal glow, bigger icon with a gentle pulse, clear "Cleanup steps" button */
body.portal-page .ls-tile.t-scan { border-color: rgba(45,212,191,.55); background: linear-gradient(135deg, rgba(20,184,166,.22), rgba(10,20,40,.55) 70%); box-shadow: 0 0 0 1px rgba(45,212,191,.15), 0 8px 24px rgba(20,184,166,.18); }
body.portal-page .ls-tile.t-scan:hover { border-color: #2dd4bf; background: linear-gradient(135deg, rgba(20,184,166,.32), rgba(20,36,66,.65) 70%); }
body.portal-page .ls-tile.t-scan .ls-ico { width: 46px; height: 46px; border-radius: 13px; position: relative; box-shadow: 0 0 18px rgba(45,212,191,.55); }
body.portal-page .ls-tile.t-scan .ls-ico .icon { width: 24px; height: 24px; }
body.portal-page .ls-tile.t-scan .ls-ico::after { content: ''; position: absolute; inset: -4px; border-radius: 16px; border: 2px solid rgba(45,212,191,.7); animation: ls-scan-pulse 2.2s ease-out infinite; }
@keyframes ls-scan-pulse { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { body.portal-page .ls-tile.t-scan .ls-ico::after { animation: none; opacity: .5; } }
body.portal-page .ls-tile.t-scan strong { font-size: 16px; }
body.portal-page .ls-tile.t-scan small { color: #99f6e4; }
body.portal-page .ls-tile-wrap .ls-mini { padding: 6px 12px; border-radius: 9px; border-color: transparent; background: linear-gradient(135deg, #14b8a6, #0d9488); color: #fff; font-weight: 700; font-size: 12.5px; box-shadow: 0 4px 12px rgba(20,184,166,.35); }
body.portal-page .ls-tile-wrap .ls-mini:hover { background: linear-gradient(135deg, #2dd4bf, #14b8a6); }
@media (min-width: 821px) and (max-height: 800px) { body.portal-page .ls-tile.t-scan .ls-ico { width: 36px; height: 36px; } body.portal-page .ls-tile.t-scan .ls-ico .icon { width: 20px; height: 20px; } }
@media (max-width: 820px) { body.portal-page .ls-tile.t-scan .ls-ico { width: 36px; height: 36px; } body.portal-page .ls-tile-wrap .ls-mini { top: 8px; right: 8px; padding: 4px 8px; font-size: 11.5px; } }

/* Device check-up: "check again in 15–30 days" reminder */
.ds2 .ds-remind { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin: 0 0 12px; border-radius: 14px; border: 1px solid rgba(129,140,248,.45); background: linear-gradient(135deg, rgba(99,102,241,.16), rgba(56,189,248,.08)); }
.ds2 .ds-remind[hidden] { display: none; }
.ds2 .ds-remind-ic { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; background: rgba(99,102,241,.25); }
.ds2 .ds-remind strong { display: block; color: #fff; font-size: 14.5px; }
.ds2 .ds-remind p { margin: 3px 0 0; font-size: 13px; color: #c7d2fe; line-height: 1.45; }
.ds2 .ds-remind p b { color: #fff; }
.ds2 .ds-remind .ds-remind-next { margin-top: 6px; color: #a5f3fc; font-weight: 600; }

/* Live Support: last device check-up (real date from the customer's last scan) */
.ls-lastscan { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 7px 12px 7px 8px; border-radius: 12px; border: 1px solid rgba(148,163,184,.3); background: rgba(10,20,40,.45); color: #e2e8f0; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.ls-lastscan:hover { background: rgba(20,36,66,.65); }
.ls-lastscan-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; background: rgba(148,163,184,.18); flex: 0 0 auto; }
.ls-lastscan strong { display: block; font-size: 13px; color: #fff; }
.ls-lastscan small { display: block; font-size: 12px; font-weight: 600; }
.ls-lastscan.is-ok { border-color: rgba(16,185,129,.45); } .ls-lastscan.is-ok small { color: #6ee7b7; } .ls-lastscan.is-ok .ls-lastscan-ic { background: rgba(16,185,129,.2); }
.ls-lastscan.is-soon { border-color: rgba(56,189,248,.5); } .ls-lastscan.is-soon small { color: #7dd3fc; } .ls-lastscan.is-soon .ls-lastscan-ic { background: rgba(56,189,248,.2); }
.ls-lastscan.is-due { border-color: rgba(245,158,11,.55); background: rgba(245,158,11,.08); } .ls-lastscan.is-due small { color: #fcd34d; } .ls-lastscan.is-due .ls-lastscan-ic { background: rgba(245,158,11,.22); }
@media (min-width: 821px) and (max-height: 800px) { .ls-lastscan { margin-top: 4px; padding: 5px 10px 5px 6px; } .ls-lastscan-ic { width: 26px; height: 26px; font-size: 14px; } }

/* reminder card: chat with your technician */
.ds2 .ds-remind-chat { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 10px 14px 10px 10px; border: 0; border-radius: 12px; cursor: pointer; text-align: left; font: inherit; color: #fff;
  background: linear-gradient(120deg, #9351e9, #5429bc); box-shadow: 0 8px 22px rgba(124,58,237,.35); transition: transform .15s, box-shadow .15s; }
.ds2 .ds-remind-chat:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(124,58,237,.5); }
.ds2 .ds-remind-chat-ic { position: relative; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.18); }
.ds2 .ds-remind-chat-ic .icon { width: 20px; height: 20px; }
.ds2 .ds-remind-chat-ic i { position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid #6d3ad6; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: ds-online 2s ease-out infinite; }
@keyframes ds-online { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.6); } 100% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } }
@media (prefers-reduced-motion: reduce) { .ds2 .ds-remind-chat-ic i { animation: none; } }
.ds2 .ds-remind-chat > span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.ds2 .ds-remind-chat strong { display: block; font-size: 14.5px; color: #fff; }
.ds2 .ds-remind-chat small { display: block; font-size: 12px; color: #e9d5ff; }
.ds2 .ds-remind-chat .ds-go { flex: 0 0 auto; font-size: 26px; line-height: 1; opacity: .85; }

/* Reports */
.rpt-filters { margin-bottom: 16px; }
.rpt-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.rpt-cols { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; }
.rpt-cols-label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-right: 4px; }
.rpt-chip { position: relative; cursor: pointer; }
.rpt-chip input { position: absolute; opacity: 0; pointer-events: none; }
.rpt-chip span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; color: var(--text-2); background: var(--surface, #fff); transition: all .12s; }
.rpt-chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.rpt-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.rpt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rpt-stats .card { padding: 14px 16px; }
.rpt-stats span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.rpt-stats strong { display: block; font-size: 24px; margin-top: 4px; }
.rpt-card { margin-bottom: 16px; }
.rpt-card .num, .rpt-detail .num { text-align: right; white-space: nowrap; }
.rpt-group td { background: rgba(47,91,234,.07); font-weight: 700; font-size: 13px; }
/* PDF / print view */
body.report-print { background: #fff; color: #0f172a; padding: 24px; }
body.report-print .rpt-title { font-size: 22px; margin: 0; }
body.report-print .rpt-sub { color: #64748b; margin: 4px 0 16px; font-size: 12px; }
body.report-print .card { box-shadow: none; border: 1px solid #e2e8f0; }
body.report-print .table { font-size: 11.5px; }
body.report-print .table th, body.report-print .table td { padding: 6px 8px; }
@media print { @page { size: landscape; margin: 12mm; } body.report-print { padding: 0; } .rpt-group td, .rpt-stats .card, .table thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .rpt-card, .table tr { break-inside: avoid; } }

/* ================= Live Support colour themes =================
   body[data-ls-theme] sets the palette; everything below reads these variables. Midnight = the original look. */
body.portal-page { --ls-bg: #040c22; --ls-orb1: #6366f1; --ls-orb2: #06b6d4;
  --ls-card-a: rgba(63,87,124,.40); --ls-card-b: rgba(14,27,50,.62); --ls-card-c: rgba(58,43,95,.38); --ls-border: rgba(184,212,250,.24);
  --ls-accent: #38bdf8; --ls-accent-soft: #7dd3fc; --ls-accent-bg: rgba(56,189,248,.16); --ls-muted: #9fb4d6; --ls-tech-a: #368bf7; --ls-tech-b: #12399c; }
body.portal-page[data-ls-theme="ocean"] { --ls-bg: #021619; --ls-orb1: #14b8a6; --ls-orb2: #0ea5e9;
  --ls-card-a: rgba(20,110,120,.38); --ls-card-b: rgba(4,32,40,.66); --ls-card-c: rgba(14,90,110,.34); --ls-border: rgba(125,230,230,.24);
  --ls-accent: #2dd4bf; --ls-accent-soft: #5eead4; --ls-accent-bg: rgba(45,212,191,.16); --ls-muted: #94c9c9; --ls-tech-a: #14b8a6; --ls-tech-b: #0f5f6b; }
body.portal-page[data-ls-theme="sunset"] { --ls-bg: #1a0a10; --ls-orb1: #f97316; --ls-orb2: #e11d48;
  --ls-card-a: rgba(140,60,50,.38); --ls-card-b: rgba(40,14,22,.66); --ls-card-c: rgba(120,30,70,.34); --ls-border: rgba(253,186,140,.24);
  --ls-accent: #fb923c; --ls-accent-soft: #fdba74; --ls-accent-bg: rgba(251,146,60,.16); --ls-muted: #e2b4a6; --ls-tech-a: #f97316; --ls-tech-b: #9f1239; }
body.portal-page[data-ls-theme="forest"] { --ls-bg: #04140c; --ls-orb1: #22c55e; --ls-orb2: #84cc16;
  --ls-card-a: rgba(40,110,70,.36); --ls-card-b: rgba(6,30,18,.66); --ls-card-c: rgba(60,100,30,.32); --ls-border: rgba(160,235,180,.22);
  --ls-accent: #34d399; --ls-accent-soft: #86efac; --ls-accent-bg: rgba(52,211,153,.16); --ls-muted: #a7cbb3; --ls-tech-a: #22c55e; --ls-tech-b: #14532d; }
body.portal-page[data-ls-theme="royal"] { --ls-bg: #12061f; --ls-orb1: #a855f7; --ls-orb2: #ec4899;
  --ls-card-a: rgba(100,60,150,.40); --ls-card-b: rgba(28,10,46,.66); --ls-card-c: rgba(130,40,110,.34); --ls-border: rgba(221,190,255,.24);
  --ls-accent: #c084fc; --ls-accent-soft: #e9d5ff; --ls-accent-bg: rgba(192,132,252,.16); --ls-muted: #c4b0dc; --ls-tech-a: #a855f7; --ls-tech-b: #6b21a8; }
body.portal-page[data-ls-theme="graphite"] { --ls-bg: #0b0d10; --ls-orb1: #64748b; --ls-orb2: #eab308;
  --ls-card-a: rgba(90,96,108,.34); --ls-card-b: rgba(18,20,24,.70); --ls-card-c: rgba(70,74,84,.30); --ls-border: rgba(214,220,230,.20);
  --ls-accent: #facc15; --ls-accent-soft: #fde68a; --ls-accent-bg: rgba(250,204,21,.14); --ls-muted: #a8b0bd; --ls-tech-a: #ca8a04; --ls-tech-b: #3f3f46; }

body.portal-page[data-ls-theme] { background: var(--ls-bg); transition: background-color .4s; }
body.portal-page[data-ls-theme] .ai-orb-1 { background: var(--ls-orb1); }
body.portal-page[data-ls-theme] .ai-orb-2 { background: var(--ls-orb2); }
body.portal-page[data-ls-theme] .ls-main .card, body.portal-page[data-ls-theme] .ls-alerts .card {
  background: linear-gradient(135deg, var(--ls-card-a), var(--ls-card-b) 60%, var(--ls-card-c)); border-color: var(--ls-border); }
body.portal-page[data-ls-theme] .ls-ring .ls-ring-fg { stroke: var(--ls-accent); filter: drop-shadow(0 0 6px var(--ls-accent)); }
body.portal-page[data-ls-theme] .ls-ring.is-soon .ls-ring-fg { stroke: #fbbf24; }
body.portal-page[data-ls-theme] .ls-ring.is-expired .ls-ring-fg { stroke: #f87171; }
body.portal-page[data-ls-theme] .ls-card-head h2 .icon, body.portal-page[data-ls-theme] .ls-license-title .icon, body.portal-page[data-ls-theme] .ls-kicker { color: var(--ls-accent-soft); }
body.portal-page[data-ls-theme] .ls-ring-num small, body.portal-page[data-ls-theme] .ls-actions-title, body.portal-page[data-ls-theme] .ls-tech small,
body.portal-page[data-ls-theme] .ls-tile small, body.portal-page[data-ls-theme] .ls-kv dt, body.portal-page[data-ls-theme] .ls-license-grid dt { color: var(--ls-muted); }
body.portal-page[data-ls-theme] .ls-tech strong { color: var(--ls-accent-soft); }
body.portal-page[data-ls-theme] .ls-tech-ico { background: linear-gradient(135deg, var(--ls-tech-a), var(--ls-tech-b)); }
body.portal-page[data-ls-theme] .ls-tile:hover { border-color: var(--ls-accent); }
body.portal-page[data-ls-theme] .ls-card-head .tab.active { background: var(--ls-accent-bg); }
body.portal-page[data-ls-theme] .ls-license { border-color: var(--ls-border); background: linear-gradient(135deg, var(--ls-accent-bg), rgba(255,255,255,.03)); }
body.portal-page[data-ls-theme] .ptab-bar { background: color-mix(in srgb, var(--ls-bg) 94%, transparent); }
body.portal-page[data-ls-theme] .ptab-bar button.is-active { background: var(--ls-accent-bg); }
body.portal-page[data-ls-theme] .support-brand-icon { background: linear-gradient(135deg, var(--ls-orb1), var(--ls-orb2)); }

/* theme picker */
.ls-theme { position: relative; margin-left: auto; align-self: center; }
.ls-theme-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--ls-border, rgba(184,212,250,.24)); background: rgba(255,255,255,.06); color: #e2e8f0; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ls-theme-btn:hover { background: rgba(255,255,255,.12); }
.ls-theme-dot { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--ls-orb1, #6366f1), var(--ls-orb2, #06b6d4)); box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.ls-theme-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 230px; padding: 8px; border-radius: 14px; background: rgba(10,14,26,.97); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.ls-theme-menu[hidden] { display: none; }
.ls-theme-menu p { margin: 4px 6px 8px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #94a3b8; }
.ls-theme-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: none; color: #e2e8f0; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.ls-theme-opt:hover { background: rgba(255,255,255,.08); }
.ls-theme-opt.is-on { background: rgba(255,255,255,.12); font-weight: 700; }
.ls-theme-opt.is-on::after { content: '✓'; margin-left: auto; }
.ls-theme-opt i { width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto; }
@media (max-width: 820px) { .ls-theme-btn span:last-child { display: none; } .ls-theme-btn { padding: 7px; } .ls-theme { position: absolute; top: 12px; right: 12px; } }

/* scrolling inside Cases / Plan details: visible scrollbar, fade at the bottom, "More" button */
body.portal-page .ls-cases, body.portal-page .ls-plan { position: relative; }
.ls-scroll { scrollbar-width: thin; scrollbar-color: var(--ls-accent, #38bdf8) rgba(255,255,255,.06); padding-right: 6px; }
.ls-scroll::-webkit-scrollbar { width: 7px; }
.ls-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,.06); border-radius: 8px; }
.ls-scroll::-webkit-scrollbar-thumb { background: var(--ls-accent, #38bdf8); border-radius: 8px; }
.ls-scroll.has-more { -webkit-mask-image: linear-gradient(#000 calc(100% - 46px), transparent); mask-image: linear-gradient(#000 calc(100% - 46px), transparent); }
.ls-more { position: absolute; left: 50%; bottom: 10px; transform: translate(-50%, 8px); opacity: 0; pointer-events: none; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--ls-border, rgba(184,212,250,.3));
  background: color-mix(in srgb, var(--ls-bg, #040c22) 88%, white 6%); color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.4); transition: opacity .2s, transform .2s; }
.ls-more.is-on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.ls-more span { color: var(--ls-accent, #38bdf8); animation: ls-bob 1.4s ease-in-out infinite; }
@keyframes ls-bob { 50% { transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .ls-more span { animation: none; } }
@media (max-width: 820px) { .ls-more { bottom: 96px; } }
/* "More" button sits at the bottom-right of the card */
.ls-more { left: auto; right: 22px; transform: translateY(8px); }
.ls-more.is-on { transform: translateY(0); }

/* Email > Settings: sending accounts (rotation) */
.pool-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pool-head > div { flex: 1 1 420px; }
.pool-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.pool-stats > div { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2, #f8fafc); }
.pool-stats span { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.pool-stats strong { font-size: 18px; }
.pool-stats small { font-size: 12px; color: var(--muted); font-weight: 500; }
.pool-bar { height: 6px; border-radius: 6px; background: #e2e8f0; overflow: hidden; margin-bottom: 3px; }
.pool-bar span { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #f59e0b); }
.pool-test { display: inline-flex; gap: 6px; }
.pool-test .input { width: 150px; height: 32px; }
.pool-form { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.pool-limit { display: flex; align-items: center; gap: 8px; }
.pool-limit .input { width: 90px; }
.pool-limit span { font-size: 13px; color: var(--text-2); }

/* Live Support: festive-day greeting with the today-only offer */
.ls-holiday { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 12px 16px; border-radius: 16px; position: relative; overflow: hidden;
  background: linear-gradient(110deg, rgba(234,88,12,.30), rgba(219,39,119,.26) 55%, rgba(124,58,237,.28)); border: 1px solid rgba(253,186,116,.5);
  box-shadow: 0 10px 30px rgba(234,88,12,.18); }
.ls-holiday::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.12) 45%, transparent 60%); transform: translateX(-100%); animation: ls-shine 4.5s ease-in-out infinite; pointer-events: none; }
@keyframes ls-shine { 60%, 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .ls-holiday::after { animation: none; display: none; } }
.ls-holiday-emoji { font-size: 34px; line-height: 1; flex: 0 0 auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }
.ls-holiday-text { flex: 1 1 auto; min-width: 0; }
.ls-holiday-text strong { display: block; color: #fff; font-size: 15.5px; }
.ls-holiday-text span { display: block; color: #fde68a; font-size: 13px; margin-top: 2px; }
.ls-holiday-text b { color: #fff; }
.ls-holiday-badge { flex: 0 0 auto; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fde047, #f59e0b); color: #7c2d12; font-weight: 900; font-size: 18px; line-height: 1; box-shadow: 0 6px 16px rgba(245,158,11,.45); transform: rotate(-8deg); }
.ls-holiday-badge small { display: block; font-size: 10px; letter-spacing: 1px; }
.ls-holiday-form { margin: 0; flex: 0 0 auto; position: relative; z-index: 1; }
.ls-holiday-btn { padding: 10px 16px; border: 0; border-radius: 12px; background: #fff; color: #9a3412; font: inherit; font-weight: 800; font-size: 13.5px; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); white-space: nowrap; }
.ls-holiday-btn:hover { transform: translateY(-1px); }
@media (max-width: 820px) {
  .ls-holiday { flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px; margin-bottom: 8px; }
  .ls-holiday-emoji { font-size: 26px; }
  .ls-holiday-text { flex: 1 1 calc(100% - 110px); }
  .ls-holiday-text strong { font-size: 13.5px; }
  .ls-holiday-text span { font-size: 12px; }
  .ls-holiday-badge { width: 46px; height: 46px; font-size: 15px; }
  .ls-holiday-form { flex: 1 1 100%; }
  .ls-holiday-btn { width: 100%; padding: 8px; }
}
@media (min-width: 821px) and (max-height: 800px) { .ls-holiday { padding: 8px 14px; } .ls-holiday-emoji { font-size: 28px; } .ls-holiday-badge { width: 48px; height: 48px; font-size: 15px; } }
/* staff payment link: holiday discount option */
.pl-holiday { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid #fdba74; background: #fff7ed; cursor: pointer; }
.pl-holiday strong { display: block; font-size: 14px; color: #9a3412; }
.pl-holiday small { display: block; font-size: 12.5px; color: #7c2d12; }

/* Security page: site security, file check, sign-in history */
.sec-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.sec-toggle { display: flex; gap: 10px; align-items: flex-start; flex: 1 1 420px; cursor: pointer; }
.sec-toggle input { margin-top: 3px; width: 18px; height: 18px; }
.sec-toggle strong { display: block; }
.sec-toggle small { display: block; color: var(--muted); font-size: 12.5px; }
.sec-idle { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.sec-idle .input { width: 80px; }
.sec-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.sec-stats > div { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2, #f8fafc); }
.sec-stats span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.sec-stats strong { display: block; font-size: 18px; margin-top: 2px; }
.sec-stats small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.sec-stats .is-ok strong { color: #15803d; }
.sec-stats .is-warn { border-color: #fcd34d; background: #fffbeb; }
.sec-stats .is-warn strong { color: #b45309; }
.sec-stats .is-bad { border-color: #fca5a5; background: #fef2f2; }
.sec-stats .is-bad strong { color: #b91c1c; }
.sec-alert { color: #b91c1c; font-weight: 700; }

/* Live Support: four action tiles (Chat · Scan · Appointment · Browser security) in a row; 2 x 2 on smaller screens */
body.portal-page .ls-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 821px) and (max-width: 1100px) { body.portal-page .ls-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { body.portal-page .ls-tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
body.portal-page .ls-tiles.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* My cases + Plan details: same height, compact (extra content scrolls inside with "More") */
@media (min-width: 821px) {
  body.portal-page .ls-main { grid-template-rows: auto auto; align-items: stretch; }
  body.portal-page .ls-hero { align-self: start; }
  body.portal-page .ls-cases, body.portal-page .ls-plan { height: 300px; max-height: 300px; padding: 14px 16px; }
  body.portal-page .ls-cases .ls-scroll, body.portal-page .ls-plan .ls-scroll { flex: 1 1 auto; min-height: 0; }
  body.portal-page .ls-card-head { margin-bottom: 8px; }
  body.portal-page .ls-card-head h2 { font-size: 16px; }
  body.portal-page .ls-kv { gap: 6px; margin-bottom: 8px; }
  body.portal-page .ls-kv > div { padding: 7px 10px; }
  body.portal-page .ls-kv dd { font-size: 13.5px; }
  body.portal-page .ls-plan .plan-included { padding: 8px 12px; }
  body.portal-page .ls-plan .plan-included li { font-size: 12.5px; }
  body.portal-page .ls-cases .case-item { padding: 10px 12px; }
}
@media (min-width: 821px) and (max-height: 800px) {
  body.portal-page .ls-cases, body.portal-page .ls-plan { height: 240px; max-height: 240px; }
}
/* smaller still */
@media (min-width: 821px) {
  body.portal-page .ls-cases, body.portal-page .ls-plan { height: 210px; max-height: 210px; padding: 12px 14px; }
  body.portal-page .ls-card-head { margin-bottom: 6px; }
  body.portal-page .ls-card-head h2 { font-size: 15px; }
  body.portal-page .ls-card-head .tab { padding: 4px 10px; font-size: 12.5px; }
  body.portal-page .ls-cases .case-item { padding: 8px 10px; }
  body.portal-page .ls-cases .case-item strong { font-size: 13px; }
  body.portal-page .ls-cases .case-reply { margin-top: 6px; padding: 6px 10px; font-size: 12.5px; }
  body.portal-page .ls-kv > div { padding: 6px 9px; }
  body.portal-page .ls-kv dt { font-size: 10px; }
  body.portal-page .ls-kv dd { font-size: 13px; }
}
@media (min-width: 821px) and (max-height: 800px) {
  body.portal-page .ls-cases, body.portal-page .ls-plan { height: 180px; max-height: 180px; }
}

/* keep sections together at the top (no gap between the alert and the main card) */
@media (min-width: 821px) { body.portal-page .ls-main { align-content: start; } }

/* genie sits under the cards, so only its own height is kept free below them */
@media (min-width: 821px) { body.portal-page .ls-main { padding-bottom: 140px !important; } body.portal-page .genie { transition: bottom .3s ease; } }
@media (min-width: 821px) and (max-height: 940px) { body.portal-page .ls-main { padding-bottom: 122px !important; } }

/* Email > Templates: style picker */
.email-style-pick { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.email-style-pick .label { flex: 1 1 100%; }
.es-opt { flex: 1 1 260px; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--border); border-radius: 12px; cursor: pointer; }
.es-opt.is-on { border-color: var(--primary); background: rgba(47,91,234,.05); }
.es-opt input { margin-top: 3px; }
.es-opt strong { display: block; }
.es-opt small { display: block; color: var(--muted); font-size: 12.5px; }

/* Email > Templates: phone number for "Call us now" */
.call-number-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }

/* Visitors: map + countries */
.vis-range { display: inline-flex; gap: 6px; margin-left: 6px; }
.vis-geo { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; padding: 0 20px 16px; }
.vis-map { height: 340px; border-radius: 12px; border: 1px solid var(--border); background: #e5e7eb; z-index: 0; }
.vis-map-note { margin: 6px 2px 0; }
.vis-countries { border: 1px solid var(--border); border-radius: 12px; overflow: auto; max-height: 370px; }
.vis-countries-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface, #fff); z-index: 1; }
.vis-ctable td, .vis-ctable th { padding: 8px 12px; }
.vis-ctable td a { color: inherit; text-decoration: none; font-weight: 600; }
.vis-ctable td a:hover { color: var(--primary); }
.vis-ctable tr.is-on td { background: rgba(47,91,234,.08); }
.vis-ctable .num { text-align: right; }
.vis-bar { height: 7px; border-radius: 6px; background: #e2e8f0; overflow: hidden; margin-bottom: 2px; }
.vis-bar span { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #10b981); }
.vis-filter-note { margin: 0 20px 12px; padding: 8px 12px; border-radius: 8px; background: rgba(47,91,234,.07); font-size: 13.5px; }
@media (max-width: 900px) { .vis-geo { grid-template-columns: 1fr; } .vis-map { height: 260px; } .vis-range { margin-left: 0; } }

/* ===== Visitors: polished map & countries ===== */
.vis-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; padding: 0 20px 14px; }
.vis-chip { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: linear-gradient(135deg, #f8fafc, #eef4ff); }
.vis-chip span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.vis-chip strong { display: block; font-size: 17px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vis-chip small { display: block; font-size: 12px; color: var(--muted); }
.vis-geo { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 16px; }
.vis-map-card { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 6px 22px rgba(15,23,42,.06); }
.vis-map { height: 400px; border: 0; border-radius: 0; background: #eef2f7; }
.vis-tiles { filter: grayscale(.85) brightness(1.06) contrast(.92); }
.vis-legend { position: absolute; left: 12px; bottom: 12px; z-index: 500; display: flex; gap: 12px; align-items: center; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.92); font-size: 12px; box-shadow: 0 2px 8px rgba(15,23,42,.12); }
.vis-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.vis-legend .lg-cust { background: #10b981; } .vis-legend .lg-vis { background: #3b82f6; }
.vb-wrap { background: none; border: 0; }
.vb { display: grid; place-items: center; border-radius: 50%; color: #fff; font: 800 12px/1 Inter, system-ui, sans-serif; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(15,23,42,.28); transition: transform .15s; position: relative; }
.vb:hover { transform: scale(1.12); }
.vb-vis { background: radial-gradient(circle at 35% 30%, #60a5fa, #1d4ed8); }
.vb-cust { background: radial-gradient(circle at 35% 30%, #34d399, #047857); }
.vb-top::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid currentColor; color: #3b82f6; animation: vb-pulse 2s ease-out infinite; }
.vb-cust.vb-top::after { color: #10b981; }
@keyframes vb-pulse { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .vb-top::after { animation: none; } }
.vb-pop strong { display: block; font-size: 14px; margin-bottom: 2px; }
.vb-pop div { color: #475569; font-size: 13px; margin-bottom: 6px; }
.vb-pop a { font-weight: 700; font-size: 13px; }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.vis-countries { border-radius: 16px; max-height: 402px; box-shadow: 0 6px 22px rgba(15,23,42,.06); }
.vis-clist { list-style: none; margin: 0; padding: 6px; }
.vis-clist li a { display: grid; grid-template-columns: 22px 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.vis-clist li a:hover { background: #f1f5f9; }
.vis-clist li.is-on a { background: rgba(47,91,234,.09); box-shadow: inset 3px 0 0 var(--primary); }
.vc-rank { font-size: 12px; font-weight: 800; color: #94a3b8; text-align: center; }
.vis-clist li.is-top .vc-rank { color: #fff; background: linear-gradient(135deg, #f59e0b, #d97706); border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.vc-flag { font-size: 22px; line-height: 1; }
.vc-main { min-width: 0; }
.vc-name { display: block; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-bar { display: block; height: 6px; border-radius: 6px; background: #e2e8f0; overflow: hidden; margin: 5px 0 3px; }
.vc-bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #60a5fa, #10b981); }
.vc-sub { display: block; font-size: 11.5px; color: var(--muted); }
.vc-num { text-align: right; }
.vc-num strong { display: block; font-size: 18px; line-height: 1.1; }
.vc-num small { display: block; font-size: 11.5px; color: var(--muted); }
.vis-clist li.is-muted a { opacity: .6; }
.vis-clist li.is-muted .vc-bar span { background: #94a3b8; }
.vis-loc { display: inline-block; margin-top: 3px; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; font-size: 12.5px; }
@media (max-width: 900px) { .vis-map { height: 300px; } }

/* ===== Visitors v3: plain headline, grouped map, two clear tables ===== */
.vis-headline { margin: 0 20px 14px; padding: 14px 18px; border-radius: 14px; background: linear-gradient(135deg, #eff6ff, #ecfdf5); border: 1px solid #dbeafe; font-size: 15.5px; line-height: 1.6; color: #0f172a; }
.vis-map-card { margin: 0 20px 16px; }
.vis-map { height: 380px; }
.vb-group { border-style: double; border-width: 5px; }
.vis-tables { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 0 20px 18px; }
.vis-box { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface, #fff); }
.vis-box-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.vis-box-head strong { font-size: 15px; }
.vis-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.vis-t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 9px 16px; border-bottom: 1px solid var(--border); }
.vis-t td { padding: 10px 16px; border-bottom: 1px solid #f1f5f9; }
.vis-t tbody tr { cursor: pointer; }
.vis-t tbody tr:hover td { background: #f8fafc; }
.vis-t tr.is-on td { background: rgba(47,91,234,.08); }
.vis-t tr.is-muted td { color: var(--muted); }
.vis-t .num { text-align: right; white-space: nowrap; }
.vis-t td a { color: inherit; text-decoration: none; font-weight: 600; }
.vt-flag { font-size: 18px; margin-right: 8px; vertical-align: -2px; }
.vt-pct { display: inline-block; width: 60px; height: 6px; border-radius: 6px; background: #e2e8f0; overflow: hidden; margin-right: 8px; vertical-align: middle; }
.vt-pct span { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, #10b981); }
@media (max-width: 1000px) { .vis-tables { grid-template-columns: 1fr; } .vis-map { height: 300px; } }

/* Visitors: country picker on the map */
.vis-map-card { position: relative; }
.vis-map-pick { position: absolute; top: 12px; right: 12px; z-index: 600; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: 0 4px 14px rgba(15,23,42,.15); }
.vis-map-pick label { font-size: 13px; font-weight: 700; color: #0f172a; white-space: nowrap; }
.vis-map-pick select { height: 34px; min-width: 220px; font-size: 14px; }
@media (max-width: 700px) { .vis-map-pick { left: 12px; right: 12px; flex-wrap: wrap; } .vis-map-pick select { min-width: 0; flex: 1; } }

/* ---------- Email desk ---------- */
.desk-search .card-body { padding: 18px 20px; }
.desk-search-row { display: flex; align-items: center; gap: 10px; }
.desk-search-row .input { flex: 1; min-width: 0; height: 48px; font-size: 16px; }
.desk-search-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft, #eef2ff); color: var(--primary, #4f46e5); flex: none; }
.desk-search .hint { margin: 10px 0 0; }
.desk-cust-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.desk-cust-head .avatar { width: 48px; height: 48px; font-size: 17px; }
.desk-cust-name { flex: 1; min-width: 0; }
.desk-cust-name h2 { margin: 0 0 2px; font-size: 20px; }
.desk-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; padding: 16px 20px 18px; }
.desk-facts div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.desk-facts .wide { grid-column: 1 / -1; }
.desk-facts span { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.desk-facts b { font-weight: 600; overflow-wrap: anywhere; }
.desk-red { color: #dc2626; }
.desk-to { display: flex; align-items: center; background: var(--surface-2, #f8fafc); color: var(--muted); }
.tab .icon { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
@media (max-width: 760px) {
  .desk-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desk-search-row { flex-wrap: wrap; }
  .desk-search-row .btn { width: 100%; }
  .desk-search-ic { display: none; }
}
.btn.armed { background: #16a34a; border-color: #16a34a; color: #fff; }
.desk-modal { position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, .55); display: grid; place-items: center; padding: 16px; }
.desk-modal[hidden] { display: none; }
.desk-modal-box { width: 100%; max-width: 700px; height: min(90vh, 1000px); background: var(--surface, #fff); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.desk-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.desk-modal-box iframe { flex: 1; width: 100%; border: 0; background: #eef1f6; }

/* Live Support: Browser security tile + window, cancelled service */
.t-browser .ls-ico { background: linear-gradient(135deg, #60a5fa, #4f46e5); }
.t-react .ls-ico { background: linear-gradient(135deg, #f87171, #b91c1c); }
.ls-tile-form { margin: 0; display: flex; }
.ls-tile-form .ls-tile { cursor: pointer; }
.ls-cancelled { border-color: rgba(248,113,113,.55) !important; }
.modal.bs-modal { max-width: 620px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 20px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.bs-head { display: flex; align-items: center; gap: 12px; }
.bs-head h2 { margin: 0; font-size: 19px; }
.bs-head > div { flex: 1; min-width: 0; }
.bs-sub { opacity: .75; }
.bs-shield { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(135deg, #60a5fa, #4f46e5); color: #fff; box-shadow: 0 0 18px rgba(96,165,250,.45); flex: none; }
.bs-shield .icon { width: 22px; height: 22px; }
.bs-body { overflow: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 2px; }
.bs-verdict { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid; }
.bs-verdict strong { font-size: 16px; }
.bs-verdict span { font-size: 13px; opacity: .85; }
.bs-verdict.is-ok { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.45); }
.bs-verdict.is-warn { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.45); }
.bs-verdict.is-bad { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.45); }
.bs-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bs-checks li { display: flex; gap: 11px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.bs-checks li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bs-checks strong { font-size: 14.5px; }
.bs-checks small { font-size: 12.5px; opacity: .78; line-height: 1.45; }
.bs-dot { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 800; color: #fff; background: #64748b; }
.bs-ok .bs-dot { background: #16a34a; }
.bs-warn .bs-dot { background: #d97706; }
.bs-bad .bs-dot { background: #dc2626; }
.bs-info .bs-dot { background: #3b82f6; }
.bs-steps h3 { margin: 4px 0 8px; font-size: 15px; }
.bs-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.bs-steps li { font-size: 13.5px; line-height: 1.5; }
.bs-steps li strong { display: block; font-size: 14px; }
.bs-steps li span { opacity: .8; }
.bs-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; }
.bs-foot p { margin: 0; flex: 1; min-width: 200px; }

/* CRM customer page: service status bar */
.svc-status { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px; flex-wrap: wrap; }
.svc-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #dcfce7; color: #15803d; flex: none; }
.svc-status.is-cancelled { border-color: #fecaca; background: #fef2f2; }
.svc-status.is-cancelled .svc-ic { background: #fee2e2; color: #b91c1c; }
.svc-text { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.svc-text span { font-size: 13px; color: var(--muted); }
.svc-cancel { position: relative; }
.svc-cancel summary { list-style: none; cursor: pointer; }
.svc-cancel summary::-webkit-details-marker { display: none; }
.svc-cancel-form { display: flex; flex-direction: column; gap: 8px; width: min(360px, 80vw); padding: 14px; margin-top: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface, #fff); box-shadow: 0 12px 30px rgba(15,23,42,.12); position: absolute; right: 0; z-index: 20; }
.svc-cancel-form p { margin: 0; }
body.portal-page .ls-alerts .card.ls-cancelled { grid-column: 1 / -1; flex-wrap: wrap !important; }
body.portal-page .ls-alerts .ls-cancelled .renew-body { flex: 1 1 320px; min-width: 0; }
body.portal-page .ls-alerts .ls-cancelled .renew-actions { flex: none; }

/* Dashboard: Cancel a service */
.svc-find { display: flex; gap: 10px; flex-wrap: wrap; }
.svc-find .input { flex: 1; min-width: 220px; }
.svc-dash .svc-status { margin: 14px 0 0; border: 1px solid var(--border); border-radius: 12px; }

/* Email desk: appointment date & time picker */
.desk-when-row { display: flex; gap: 8px; flex-wrap: wrap; }
.desk-when-row input { flex: 1 1 220px; }
.desk-when-row select { flex: 0 1 180px; }
.desk-when-need .input { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

/* Live Support: call button in the header */
body.portal-page .ls-call { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 8px; border-radius: 999px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, rgba(34,197,94,.22), rgba(10,20,40,.55)); border: 1px solid rgba(74,222,128,.55); box-shadow: 0 6px 18px rgba(34,197,94,.18); margin-left: auto; }
body.portal-page .ls-call:hover { border-color: #4ade80; background: linear-gradient(135deg, rgba(34,197,94,.34), rgba(20,36,66,.65)); }
body.portal-page .ls-call-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #22c55e, #15803d); font-size: 15px; }
body.portal-page .ls-call-txt { display: flex; flex-direction: column; line-height: 1.15; }
body.portal-page .ls-call-txt small { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #bbf7d0; }
body.portal-page .ls-call-txt strong { font-size: 15px; color: #fff; white-space: nowrap; }
body.portal-page .ls-call + .ls-theme { margin-left: 10px; }
@media (max-width: 820px) {
  body.portal-page .ls-call { padding: 5px 12px 5px 5px; gap: 8px; }
  body.portal-page .ls-call-ic { width: 28px; height: 28px; font-size: 13px; }
  body.portal-page .ls-call-txt small { display: none; }
  body.portal-page .ls-call-txt strong { font-size: 13.5px; }
}

/* Dashboard: Live Support page settings */
.ls-set-form { display: flex; flex-direction: column; gap: 14px; }
.ls-set-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.ls-set-check input { margin-top: 3px; }
.ls-set-check span { display: flex; flex-direction: column; gap: 2px; }
.ls-set-check small { color: var(--muted); }
.dash-logout:hover { border-color: #f87171; color: #b91c1c; }
.desk-when[hidden] { display: none !important; }

/* Calm mode (slow computer, data saver, or "reduce motion"): decorative animations hold still; scan progress keeps moving */
html.calm *, html.calm *::before, html.calm *::after { animation-play-state: paused !important; }
html.calm .scan-modal *, html.calm .scan-modal *::before, html.calm .scan-modal *::after { animation-play-state: running !important; }
html.calm .ai-orb { display: none !important; }

/* ================= Staff CRM on phones: app-style ================= */
.crm-tabs { display: none; }
@media (max-width: 820px) {
  body.app { padding-bottom: calc(68px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
  /* bottom tab bar */
  body.app .crm-tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255,255,255,.97); border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgba(15,23,42,.06); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); }
  body.app .crm-tabs a, body.app .crm-tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border: 0; background: none;
    color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none; border-radius: 12px; cursor: pointer; min-width: 0; }
  body.app .crm-tabs .icon { width: 22px; height: 22px; }
  body.app .crm-tabs a.on { color: var(--primary, #2563eb); background: var(--primary-soft, #eef2ff); }
  body.app .crm-tabs span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  /* compact sticky header */
  body.app .topbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  body.app .content { padding: 14px 12px 20px; }
  body.app .page-head { margin-bottom: 12px; gap: 10px; }
  body.app .page-head h1 { font-size: 22px; line-height: 1.2; }
  body.app .page-head .muted { font-size: 13px; }
  /* action buttons: one row you can swipe, instead of many rows of big buttons */
  body.app .page-actions { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; width: 100%; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  body.app .page-actions::-webkit-scrollbar { display: none; }
  body.app .page-actions > *, body.app .page-actions .btn { flex: 0 0 auto; }
  body.app .page-actions .btn { padding: 8px 12px; font-size: 13px; border-radius: 999px; white-space: nowrap; }
  body.app .profile .avatar { width: 44px; height: 44px; font-size: 15px; }
  body.app .card { border-radius: 14px; }
  body.app .card-head { padding: 12px 14px; }
  body.app .card-body { padding: 14px; }
  body.app .btn, body.app .input, body.app select.input { min-height: 42px; }
  /* tables become cards: one card per row, each value with its column name */
  body.app .table-wrap { overflow: visible; }
  body.app table.table.has-labels thead { display: none; }
  body.app table.table.has-labels, body.app table.table.has-labels tbody { display: block; width: 100%; }
  body.app table.table.has-labels tr { display: block; margin: 10px 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
  body.app table.table.has-labels td { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; max-width: none !important; min-width: 0 !important; white-space: normal; }
  body.app table.table.has-labels td::before { content: attr(data-label); flex: 0 0 auto; max-width: 42%; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
  body.app table.table.has-labels td[data-label=""]::before { display: none; }
  body.app table.table.has-labels td:first-child { display: block; text-align: left; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
  body.app table.table.has-labels td:first-child::before { display: none; }
  body.app table.table.has-labels td.actions, body.app table.table.has-labels td:last-child:empty { justify-content: flex-end; flex-wrap: wrap; }
  body.app table.table.has-labels td.actions::before { display: none; }
  body.app table.table.has-labels td > * { min-width: 0; }
  /* dashboard: live list buttons wrap neatly */
  body.app .live-row { flex-wrap: wrap; gap: 10px; }
  body.app .live-action { display: flex; flex-wrap: wrap; gap: 6px; }
  body.app .live-action .btn { flex: 1 1 auto; }
}
@media (max-width: 820px) {
  body.app table.table.has-labels td { display: block; text-align: right; overflow: hidden; }
  body.app table.table.has-labels td::before { float: left; margin-right: 12px; }
  body.app table.table.has-labels td.actions { display: flex; }
  body.app table.table.has-labels td .cell-sub { display: block; }
  body.app .page-head h1, body.app .page-head > div > h1 { font-size: 22px !important; letter-spacing: -.01em; }
  body.app .profile h1 { font-size: 20px !important; }
  body.app .page-actions .btn { min-height: 38px; padding: 7px 12px; }
}
@media (max-width: 820px) {
  body.app .desk-cust-head { flex-wrap: wrap; }
  body.app .desk-cust-head .inline-form { margin-left: auto; }
  body.app .desk-cust-name { flex: 1 1 200px; }
}
@media (max-width: 820px) { body.app.nav-open .crm-tabs { display: none; } }
