/* Admin Subscriptions page (master goal V·D·21, page 6, /subscriptions): the list, dialogs, provisioning panel
   and recovery.  The one home of the list's rules; the shell keeps only the row-actions button and its menu
   (.st-menu-btn, .asub-pop in admin-shell-data-grids.css).  Strict CSP: a linked stylesheet, no inline style
   attributes. */

/* ---- dialog shell ---- */
.subs-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .6); z-index: 1000; display: flex;
  align-items: center; justify-content: center; padding: 18px; overflow: auto; overflow-x: hidden; }
#subs-confirm, #subs-days { z-index: 1200; }
.subs-dialog { width: 100%; max-width: min(560px, calc(100vw - 24px)); min-width: 0; padding: 0 !important; box-sizing: border-box;
  display: flex; flex-direction: column; max-height: 92vh; max-height: 92dvh; border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 64px -16px rgba(15, 23, 42, .45); animation: subs-in .18s ease; }
.subs-dialog-wide { max-width: min(780px, calc(100vw - 24px)); }
.subs-dialog * { box-sizing: border-box; }
.subs-dialog p, .subs-dialog code, .subs-dialog label { overflow-wrap: anywhere; }
.subs-dialog-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border-soft, #e5e7eb); flex: 0 0 auto; }
.subs-dialog-body { padding: 14px 18px; overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; gap: 12px; }
.subs-dialog-foot, .subs-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
  padding: 12px 18px 16px; border-top: 1px solid var(--border-soft, #e5e7eb); flex: 0 0 auto; }
.subs-dialog-actions { border-top: 0; padding: 4px 0 0; justify-content: flex-start; }
.subs-dialog-error:empty, .subs-field-error:empty, #sub-term-msg:empty, #sub-cancel-msg:empty, #sub-modal-msg:empty { display: none; }
.subs-dialog-error, .subs-field-error { color: #b91c1c; font-size: 13px; font-weight: 600; }
.subs-message { white-space: pre-line; line-height: 1.55; overflow-wrap: anywhere; }
.subs-field-label { display: block; margin: 0 0 6px; font-weight: 600; font-size: 13px; }
.subs-field { width: 100%; max-width: 100%; padding: 9px 10px; border: 1px solid var(--border, #cbd5e1); border-radius: 8px;
  background: var(--bg-2, #f8fafc); color: var(--text, #0f172a); font-size: 14px; }
.subs-field:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 1px; }
.subs-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.subs-info { padding: 10px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; background: var(--bg-2, #f8fafc);
  font-size: 13px; line-height: 1.55; }
.subs-choice { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px; background: var(--bg-2, #f8fafc); cursor: pointer; margin-bottom: 8px; }
.subs-choice input { margin-top: 3px; }
.subs-muted { opacity: .45; }
.subs-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; }
.subs-offscreen { position: fixed; left: -9999px; top: -9999px; }
@keyframes subs-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes subs-up { from { transform: translateY(28px); opacity: .65; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .subs-dialog { animation: none !important; } }

/* ---- deletion grace period ---- */
.subs-grace-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.subs-grace-row .subs-field { flex: 1 1 160px; width: auto; min-width: 0; }
.subs-grace-row .subs-grace-custom { flex: 0 0 96px; }
.subs-grace-hint { margin-top: 6px; }

/* ---- termination header ---- */
.stm-head-main { flex: 1 1 auto; min-width: 0; }
.stm-head-main h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.stm-sub { margin-top: 4px; font-size: 12.5px; }
.stm-chip { display: inline-block; padding: 1px 7px; border: 1px solid var(--border, #e5e7eb); border-radius: 6px;
  background: var(--bg-2, #f8fafc); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; }
.stm-x { flex: 0 0 auto; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
#sub-term-input:focus-visible { outline: 2px solid rgba(220, 38, 38, .35); outline-offset: 1px; border-color: #dc2626; }

/* ---- plan catalog ---- */
.subs-plan-jumps { display: flex; gap: 6px; flex-wrap: wrap; }
.subs-plan-list { display: grid; gap: 8px; }
.subs-plan-group { margin: 8px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted, #64748b); }
.subs-plan-card { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border: 2px solid var(--border, #e5e7eb); border-radius: 8px; cursor: pointer; background: var(--bg-2, #f8fafc);
  transition: border-color .15s, background .15s; }
.subs-plan-card.selected { border-color: var(--accent, #2563eb); background: var(--accent-soft, #eff6ff); }
.subs-plan-card:focus-within { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
.subs-plan-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.subs-plan-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.subs-plan-specs { font-size: 12px; color: var(--text-dim, #64748b); display: flex; gap: 10px; flex-wrap: wrap; }
.subs-plan-price { text-align: end; min-width: 110px; font-weight: 700; font-size: 16px; color: var(--accent, #2563eb); }
.subs-plan-effective { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border-soft, #e5e7eb); }
.subs-plan-note { padding: 10px 18px 0; }

/* ---- list additions ---- */
.subs-pinned { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 8px; }
.subs-pinned-actions { display: inline-flex; gap: 6px; margin-inline-start: auto; }
.st-menu-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---- provisioning health ---- */
.subs-pill-ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; font-weight: 700; }
.subs-pill-warn { background: #fef3c7; color: #78350f; border: 1px solid #fcd34d; font-weight: 700; }
.subs-pill-due { background: #fef9c3; color: #92400e; border: 1px solid #fcd34d; font-weight: 700; }
.subs-pill-bad { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; font-weight: 700; }
.subs-pill-muted { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; font-weight: 600; }
button.subs-pill-bad, button.subs-pill-warn { cursor: pointer; margin-inline-start: 4px; }
.subs-health { margin-bottom: 12px; border-inline-start: 4px solid #16a34a; }
.subs-health-ok { background: linear-gradient(90deg, rgba(220, 252, 231, .45) 0%, transparent 55%); }
.subs-health-unknown { border-inline-start-color: #d97706; background: linear-gradient(90deg, rgba(254, 243, 199, .5) 0%, transparent 55%); }
.subs-health-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.subs-health-pill { font-size: 13px; white-space: nowrap; }
.subs-health-text { flex: 1; min-width: 220px; }
.subs-issues { margin-bottom: 12px; border-inline-start: 4px solid #dc2626; }
.subs-issues-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.subs-scroll { overflow-x: auto; }
.subs-issues-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.subs-issues-table th { text-align: start; padding: 6px 8px; }
.subs-issues-table td { padding: 7px 8px; border-top: 1px solid var(--border-soft, #e5e7eb); vertical-align: top; }
.subs-nowrap { white-space: nowrap; }
.subs-btn-ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.subs-btn-bad { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; font-weight: 600; }
.subs-btn-primary { background: #2563eb; color: #fff; border: 1px solid #2563eb; font-weight: 600; }
.subs-btn-go { background: #16a34a; color: #fff; border: 1px solid #16a34a; font-weight: 700; }
.subs-btn-go:disabled { background: #94a3b8; border-color: #94a3b8; }
.subs-chip { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; max-width: 100%; }
.subs-chip-code { background: #f8fafc; color: #0f172a; border: 1px solid #cbd5e1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subs-chip-code.dark { background: #1f2937; color: #f3f4f6; border-color: #374151; }
.subs-chip-copy { border: 0; background: transparent; cursor: pointer; padding: 1px; line-height: 0; color: #94a3b8; flex: none; }
.subs-stripe { display: inline-flex; align-items: center; gap: 4px; color: #635bff; font-weight: 600; font-size: 12px;
  text-decoration: none; white-space: nowrap; }
.subs-stripe-button { gap: 6px; padding: 6px 12px; border: 1px solid #635bff; background: #635bff; color: #fff; border-radius: 8px; font-size: 13px; }
.subs-stripe-block { display: block; margin-top: 4px; }
.subs-stripe-inline { margin-top: 3px; }

/* ---- failure dialog and relocation ---- */
.subs-severity { border-radius: 8px; padding: 12px 14px; border: 1px solid #d97706; background: #fffbeb; }
.subs-severity.bad { border-color: #dc2626; background: #fef2f2; }
.subs-severity-label { font-weight: 700; font-size: 12px; letter-spacing: .5px; color: #d97706; }
.subs-severity.bad .subs-severity-label { color: #dc2626; }
.subs-why { margin-top: 10px; border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.55; }
.subs-why-capacity { background: #fff7ed; border: 1px solid #fdba74; }
.subs-why-region { background: #fefce8; border: 1px solid #fde047; }
.subs-kv { display: flex; gap: 8px; padding: 4px 0; }
.subs-kv-k { min-width: 130px; color: var(--text-dim, #64748b); }
.subs-kv-v { flex: 1; overflow-wrap: anywhere; }
.subs-raw-head { margin: 14px 0 6px; display: flex; align-items: center; gap: 8px; }
.subs-raw { background: #0f172a; color: #e2e8f0; padding: 10px 12px; border-radius: 6px; overflow: auto; font-size: 12px;
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.subs-pf-actions { border-top: 1px solid var(--border-soft, #e5e7eb); margin-top: 16px; padding-top: 12px; }
.subs-pf-action { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.subs-pf-status { margin-top: 10px; font-size: 13px; }
.subs-outcome { font-weight: 600; color: #166534; }
.subs-outcome.bad { color: #991b1b; }
.subs-reloc { margin-top: 12px; border: 1px solid var(--border-soft, #e5e7eb); border-radius: 10px; padding: 12px; }
.subs-reloc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.subs-countries { display: flex; flex-wrap: wrap; gap: 8px; }
.subs-country { flex: 1 1 160px; min-width: 150px; max-width: 260px; text-align: start; padding: 10px 12px; border-radius: 10px; font: inherit;
  cursor: pointer; border: 2px solid #e2e8f0; background: #fff; }
.subs-country.selected { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.subs-country-off { border: 1.5px dashed #cbd5e1; background: #f8fafc; opacity: .62; cursor: not-allowed; }
.subs-country-name { font-size: 14px; font-weight: 700; color: #0f172a; }
.subs-country-state { margin-top: 4px; font-size: 11px; font-weight: 600; }
.subs-reloc-go { margin-top: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.subs-reloc-error { padding: 10px 2px; color: #991b1b; font-size: 13px; }
.subs-note { margin-top: 8px; font-size: 12px; border-radius: 6px; padding: 8px 10px; }
.subs-note-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.subs-note-warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }

/* ---- phones: dialogs become bottom sheets with full-width, thumb-height actions ---- */
@media (max-width: 820px) {
  .subs-overlay { padding: 0; align-items: flex-end; }
  .subs-dialog, .subs-dialog-wide { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 94vh; max-height: 94dvh;
    animation: subs-up .22s ease; }
  .subs-dialog-head { padding: 14px 16px 10px; }
  .subs-dialog-body { padding: 14px 16px; }
  .subs-field { font-size: 16px; }
  .subs-grace-row .subs-field, .subs-grace-row .subs-grace-custom { flex: 1 1 100%; }
  .stm-x { width: 44px; height: 44px; }
  .subs-dialog-foot { flex-direction: column-reverse; align-items: stretch; gap: 10px;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .subs-dialog-foot .btn { width: 100%; min-height: 48px; justify-content: center; text-align: center; font-size: 15px; }
  .subs-plan-card { flex-direction: column; }
  .subs-plan-price { text-align: start; }
  .subs-kv { flex-direction: column; gap: 2px; }
}

/* ---- list (owner request 2026-11-15) ----
   Seven columns in a fixed layout fit the card at desktop widths, so the list never scrolls sideways: related
   fields share a cell, a cut-off value keeps its full text in its title, and every cell may shrink.  When the card
   itself is narrower than the columns need (a container query, so it holds with the sidebar open or collapsed),
   each row becomes a card.  Colours come from the theme tokens, so light and dark follow the shell; directions
   are logical, so Arabic mirrors without overrides. */
.subscriptions-card { min-width: 0; overflow: visible; container: subs-list / inline-size; }
.subs-title { margin: 0; flex: 1 1 240px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.subscriptions-card > .subs-title { margin-block-end: 12px; }
/* .card h3 (shell layout) is more specific than .subs-title alone; the toolbar title keeps its own size and spacing. */
.card .subs-toolbar .subs-title { margin: 0; font-size: 16px; }
.subs-count { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0;
  unicode-bidi: plaintext; }
.subs-toolbar { gap: 10px; margin-block-end: 10px; }
.subs-toolbar .btn { white-space: nowrap; }

/* search */
.st-search { position: relative; display: inline-flex; align-items: center; flex: 0 1 300px; min-width: 200px; }
.st-search-ico { position: absolute; inset-inline-start: 11px; color: var(--muted); pointer-events: none; }
.st-search-in { width: 100%; box-sizing: border-box; padding-block: 8px; padding-inline: 33px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg-2); color: var(--text); font: inherit; font-size: 13px; unicode-bidi: plaintext;
  transition: border-color .15s ease, box-shadow .15s ease; }
.st-search-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.st-search-in::placeholder { color: var(--muted); opacity: 1; }

/* the status filter: the shared Admin pill bar (admin-console.css .adm-pills) */
.subscriptions-card .adm-pills { margin-block: 4px 14px; }

/* frame and columns */
/* The shell paints a mobile "scroll for more" edge on every table; this table never scrolls sideways. */
.subs-wrap > table.subs-grid { background-image: none; }
.subs-wrap { border: 1px solid var(--border-soft); border-radius: 12px; background: var(--panel); }
.subs-grid { width: 100%; margin: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px;
  background-image: none; white-space: normal; }
.st-col-plan { width: 18%; }
.st-col-ip { width: 150px; }
.st-col-status { width: 15%; }
.st-col-bill { width: 15%; }
.st-col-pay { width: 12%; }
.st-col-act { width: 96px; }
/* The Archived tab's selection column (admin-records-archived-purge.js). */
.st-col-sel { width: 44px; }
.subs-grid .st-selcell { padding-inline: 16px 4px; vertical-align: middle; }
.subs-grid th { position: sticky; top: 0; z-index: 1; padding: 10px 8px; background: var(--panel-2); color: var(--muted);
  border-block-end: 1px solid var(--border-soft); font-size: 10.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  text-align: start; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subs-grid th:first-child { border-start-start-radius: 11px; }
.subs-grid th:last-child { border-start-end-radius: 11px; }
.subs-grid td { padding: 12px 8px; vertical-align: top; border-block-start: 1px solid var(--border-soft); white-space: normal;
  overflow-wrap: anywhere; transition: background .12s ease; }
.subs-grid tbody tr:first-child > td { border-block-start: 0; }
.subs-grid th:first-child, .subs-grid td:first-child { padding-inline-start: 16px; }
.subs-grid th:last-child, .subs-grid td:last-child { padding-inline-end: 12px; }
.subs-grid tbody tr:last-child > td:first-child { border-end-start-radius: 11px; }
.subs-grid tbody tr:last-child > td:last-child { border-end-end-radius: 11px; }
.subs-grid tbody tr:hover > td { background: var(--row-hover); }
.subs-grid tr.st-row-protected > td { background: color-mix(in srgb, var(--warn) 6%, transparent); }
.subs-grid tr.st-row-protected > td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
[dir="rtl"] .subs-grid tr.st-row-protected > td:first-child { box-shadow: inset -3px 0 0 var(--warn); }
.subs-grid tr.st-row-protected:hover > td { background: color-mix(in srgb, var(--warn) 10%, var(--row-hover)); }

/* cells */
.st-cell { min-width: 0; }
.st-cell-pri { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; font-size: 13px; font-weight: 600;
  line-height: 1.4; color: var(--text); }
.st-cell-sub { margin-block-start: 2px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.st-trunc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
div.st-trunc { display: block; }
.st-cell-pri > .st-trunc { flex: 0 1 auto; max-width: 100%; font-size: 12.5px; }
.st-label { min-width: 0; overflow-wrap: anywhere; }
.st-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; font-size: 11px; letter-spacing: .01em; }
[dir="rtl"] .st-mono { direction: ltr; text-align: right; }
.st-cell-tenant { margin-block-start: 5px; min-width: 0; overflow-wrap: anywhere; font-size: 11px; line-height: 1.4; }
.st-cell-tenant a { color: var(--accent); text-decoration: none; }
.st-cell-tenant a:hover { text-decoration: underline; }
.st-cell-tenant code { font-size: 11px; background: none; padding: 0; color: inherit; }
.subs-grid .pill { flex: none; display: inline-block; white-space: nowrap; border-radius: 999px; padding: 2px 7px; font-size: 10px;
  font-weight: 650; letter-spacing: .04em; line-height: 1.4; }
.subs-grid .pill.st-system { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.st-chip { flex: none; display: inline-block; white-space: nowrap; border-radius: 999px; padding: 1px 7px; font-size: 10.5px; font-weight: 600;
  line-height: 1.5; background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 75%, var(--text)); }
.st-plan-price { color: var(--text-dim); }
.st-cycle, .st-plan-price .st-num { font-weight: 600; }
.st-num { font-variant-numeric: tabular-nums; }
.st-ipbox { display: flex; align-items: center; gap: 2px; min-width: 0; }
.st-ip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; font-size: 11.5px; letter-spacing: .01em; }
.st-ipcopy { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted); line-height: 0; cursor: pointer; opacity: .75; }
.st-ipcopy:hover { opacity: 1; background: var(--row-hover); color: var(--text); }
.st-ipcopy:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 1px; }
.st-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.st-emails { display: flex; flex-wrap: wrap; gap: 4px; margin-block-start: 7px; }
.st-badge { display: inline-block; max-width: 100%; padding: 1px 7px; border: 1px solid transparent; border-radius: 6px;
  font-size: 10.5px; font-weight: 600; line-height: 1.5; }
.st-badge-off { background: var(--panel-2); border-color: var(--border-soft); color: var(--muted); }
.st-badge-on { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 30%, transparent);
  color: var(--ok); }
.st-kv { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; line-height: 1.6; }
.st-kv-k { flex: none; min-width: 38px; font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.st-kv-v { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.st-teardown { margin-block-start: 4px; font-size: 11px; font-weight: 600; line-height: 1.4; color: var(--warn); }
.st-pay { display: block; line-height: 1.45; color: var(--text-dim); }
.st-related { margin-block-start: 4px; font-size: 12px; }
.subs-grid td.st-actcell { padding-inline: 4px 10px; text-align: end; }
.st-protected { display: inline-block; font-size: 10px; font-weight: 600; line-height: 1.3; color: var(--muted); text-align: center; }
.subscriptions-card .st-menu-btn { width: 32px; height: 30px; }
/* AP-05 2026-11-27: Details sits above the row menu; on a stacked card it sits beside it at a 44px touch size. */
.subscriptions-card .st-details { display: block; margin-block: 0 6px; margin-inline-start: auto; white-space: nowrap; }
.subscriptions-card .st-menu-btn[aria-expanded="true"] { background: var(--row-hover); color: var(--text); border-color: var(--accent); }
.subscriptions-card .st-menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* empty, error and loading states */
.subs-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 46px 20px; text-align: center; }
.subs-empty svg { width: 40px; height: 40px; color: var(--muted); opacity: .6; }
.subs-empty .subs-empty-t { font-size: 14.5px; font-weight: 650; color: var(--text); }
.subs-empty .subs-empty-s { max-width: 360px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.subs-empty .btn { margin-block-start: 4px; }
.subs-empty.subs-empty-err svg { color: var(--danger); opacity: .85; }
.subs-loading { display: flex; align-items: center; gap: 10px; padding: 26px 2px; color: var(--muted); font-size: 13px; }
.subs-loading .subs-spin { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%;
  animation: subs-spin .7s linear infinite; }
@keyframes subs-spin { to { transform: rotate(360deg); } }

/* pager */
.subs-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 2px 0; }
.subs-pager-summary { margin-inline-end: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums;
  unicode-bidi: plaintext; }
.subs-page-size { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.subs-page-size select { min-height: 32px; padding-block: 4px; padding-inline: 8px 26px; border: 1px solid var(--border); border-radius: 8px;
  background-color: var(--bg-2); color: var(--text); }
.subs-pager button:disabled { opacity: .45; cursor: not-allowed; }

/* the card is too narrow for the columns: each row becomes a card (two across when there is room) */
@container subs-list (max-width: 879px) {
  .subscriptions-card .subs-wrap { border: 0; border-radius: 0; background: transparent; }
  .subscriptions-card .subs-grid { display: block !important; width: 100% !important; overflow: visible !important; }
  .subscriptions-card .subs-grid colgroup, .subscriptions-card .subs-grid thead { display: none !important; }
  .subscriptions-card .subs-grid tbody { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 12px; }
  .subscriptions-card .subs-grid tbody tr { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px;
    align-content: start;
    padding: 2px 14px 4px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow-sm); }
  .subscriptions-card .subs-grid tbody tr.st-row-protected { border-inline-start: 3px solid var(--warn); }
  .subscriptions-card .subs-grid tbody tr > td { display: grid !important; grid-column: 1 / -1; grid-template-columns: minmax(78px, 30%) minmax(0, 1fr);
    column-gap: 12px; align-items: start; padding: 10px 0 !important; border-block-start: 1px solid var(--border-soft);
    border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
  .subscriptions-card .subs-grid td::before { content: attr(data-label); padding-block-start: 2px; color: var(--muted); font-size: 10.5px;
    font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
  .subscriptions-card .subs-grid tbody tr > td.st-custcell { grid-column: 1; grid-row: 1; display: block !important; padding: 12px 0 10px !important;
    border-block-start: 0; }
  .subscriptions-card .subs-grid tbody tr > td.st-actcell { grid-column: 2; grid-row: 1; display: flex !important; align-items: flex-start;
    justify-content: flex-end; padding: 10px 0 0 !important; border-block-start: 0; }
  .subscriptions-card .subs-grid td.st-custcell::before, .subscriptions-card .subs-grid td.st-actcell::before { content: none; }
  .subscriptions-card .subs-grid tbody tr > td.st-selcell { grid-column: 1 / -1; grid-row: 1; display: flex !important; align-items: center;
    padding: 10px 0 0 !important; border-block-start: 0; }
  .subscriptions-card .subs-grid td.st-selcell::before { content: none; }
  .subscriptions-card .subs-grid tbody tr:has(> td.st-selcell) > td.st-custcell,
  .subscriptions-card .subs-grid tbody tr:has(> td.st-selcell) > td.st-actcell { grid-row: 2; }
  .subscriptions-card .billarc-bar .billarc-all { display: inline-flex; }
  .subscriptions-card .subs-grid .st-menu-btn { width: 44px; height: 44px; }
  .subscriptions-card .subs-grid .st-details { min-height: 44px; margin-block: 0; margin-inline: 0 8px; }
  .subscriptions-card .subs-grid .st-ipcopy { width: 40px; height: 40px; }
}
@container subs-list (max-width: 560px) {
  .subscriptions-card .subs-toolbar { display: grid; grid-template-columns: 1fr; }
  .subscriptions-card .subs-toolbar .btn { width: 100%; justify-content: center; }
  .subscriptions-card .st-search { width: 100%; min-width: 0; }
  .subscriptions-card .subs-pager { display: grid; grid-template-columns: 1fr 1fr; }
  .subscriptions-card .subs-pager-summary, .subscriptions-card .subs-page-size { grid-column: 1 / -1; justify-content: center;
    margin: 0; text-align: center; }
  .subscriptions-card .subs-pager .btn { width: 100%; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .subscriptions-card .subs-grid td { transition: none !important; }
  .subs-loading .subs-spin { animation-duration: 2s; }
}
/* The Subscriptions / Needs attention tabs (design proposal 58): the Payments page's segmented pattern. */
.subs-sections { display:flex; flex-wrap:wrap; gap:4px; margin-block-end:12px; padding:4px; border:1px solid var(--border-soft);
  border-radius:10px; inline-size:fit-content; max-inline-size:100% }
.subs-section { display:inline-flex; align-items:center; gap:6px; min-block-size:36px; padding:6px 14px; border:0; border-radius:8px;
  background:transparent; color:inherit; font:inherit; cursor:pointer }
.subs-section[aria-pressed=true] { background:var(--ai-blue-soft, #eef4ff); color:var(--ai-blue, #1d4ed8); font-weight:600 }
.subs-section:focus-visible { outline:2px solid var(--ai-blue, #1d4ed8); outline-offset:2px }
@media (max-width: 640px) { .subs-sections { inline-size:100% } .subs-section { flex:1; justify-content:center; min-block-size:44px } }
