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

    :root {
      --clr: #2563eb;
      --clr-light: #eff6ff;
      --clr-hover: #1d4ed8;
      --sidebar-w: 240px;
      --row: 44px;
      --border: #e2e8f0;
      --bg: #f8fafc;
    }

    html, body {
      height: 100%;
      margin: 0;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      font-size: 14px;
      color: #1e293b;
      background: var(--bg);
    }

    /* ── Login ── */
    #loginScreen {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, #f0f9ff 0%, #f1f5f9 100%);
      padding: 24px;
    }

    .login-card {
      background: #fff;
      border-radius: 20px;
      border: 1px solid var(--border);
      padding: 48px 40px;
      width: 100%;
      max-width: 400px;
      box-shadow: 0 4px 24px rgba(37,99,235,.08), 0 1px 4px rgba(0,0,0,.05);
    }

    .login-brand {
      text-align: center;
      margin-bottom: 36px;
    }

    .login-brand-name {
      font-size: 40px;
      font-weight: 900;
      color: var(--clr);
      letter-spacing: -1px;
      line-height: 1;
    }

    .login-brand-sub {
      font-size: 13px;
      color: #94a3b8;
      margin-top: 6px;
    }

    /* ── App Screen ── */
    #appScreen {
      height: 100vh;
      display: flex;
      overflow: hidden;
    }

    /* ── Sidebar ── */
    #sidebar {
      width: var(--sidebar-w);
      flex-shrink: 0;
      background: #fff;
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      height: 100vh;
    }

    .sidebar-brand {
      padding: 24px 20px 20px;
      border-bottom: 1px solid var(--border);
    }

    .sidebar-brand-name {
      font-size: 22px;
      font-weight: 900;
      color: var(--clr);
      letter-spacing: -.5px;
    }

    .sidebar-brand-sub {
      font-size: 11px;
      color: #94a3b8;
      margin-top: 3px;
    }

    .sidebar-nav {
      flex: 1;
      padding: 12px 8px;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      padding: 10px 14px;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 600;
      color: #64748b;
      background: transparent;
      border: none;
      cursor: pointer;
      margin-bottom: 2px;
      text-align: left;
      transition: background .12s, color .12s;
    }

    .nav-item:hover { background: #f1f5f9; color: #334155; }
    .nav-item.tab-active { background: var(--clr-light); color: var(--clr); }
    .nav-item svg { flex-shrink: 0; opacity: .7; }
    .nav-item.tab-active svg { opacity: 1; }

    .sidebar-footer {
      padding: 16px 20px;
      border-top: 1px solid var(--border);
    }

    .admin-email-label {
      font-size: 11px;
      color: #94a3b8;
      margin-bottom: 2px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: .06em;
    }

    #adminEmail {
      font-size: 13px;
      color: #475569;
      font-weight: 500;
      margin-bottom: 12px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* ── Main Area ── */
    #mainArea {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    #mainHeader {
      flex-shrink: 0;
      background: #fff;
      border-bottom: 1px solid var(--border);
      padding: 0 28px;
      height: 56px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    #mainHeaderTitle {
      font-size: 16px;
      font-weight: 700;
      color: #1e293b;
    }

    /* ── Tab Body / Content ── */
    #tabBody {
      flex: 1;
      overflow-y: auto;
    }

    .tab-pane { display: none; padding: 28px; }
    .tab-pane.active { display: block; }

    .content-container {
      max-width: 900px;
      margin: 0 auto;
    }

    .form-container {
      max-width: 580px;
      margin: 0 auto;
    }

    /* ── Pioneer Program: form (left) + full agreement (right) ── */
    .pioneer-container {
      max-width: 1120px;
      margin: 0 auto;
    }
    .pioneer-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
      gap: 24px;
      align-items: start;
    }
    .pioneer-aside {
      position: sticky;
      top: 16px;
    }
    .pioneer-aside fieldset.section { margin: 0; }
    #pioAgreementBody {
      max-height: calc(100vh - 220px);
      overflow-y: auto;
      border: 1px solid var(--border, #e5e7eb);
      border-radius: 10px;
      padding: 14px 16px;
      font-size: 12.5px;
      line-height: 1.6;
      color: #334155;
      background: #fafafa;
    }
    /* Single column in mobile view */
    @media (max-width: 767px) {
      .pioneer-grid { grid-template-columns: 1fr; gap: 16px; }
      .pioneer-aside { position: static; }
      #pioAgreementBody { max-height: 340px; }
    }

    /* ── Pioneer Program: shop photos ── */
    .pio-photo-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-bottom: 10px;
    }
    .pio-photo-grid:empty { margin-bottom: 0; }
    .pio-photo-thumb {
      position: relative;
      aspect-ratio: 4 / 3;
      border-radius: 8px;
      overflow: hidden;
      border: 1px solid var(--border, #e5e7eb);
      background: #f1f5f9;
    }
    .pio-photo-thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .pio-photo-remove {
      position: absolute;
      top: 4px;
      right: 4px;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      border: none;
      background: rgba(15,23,42,.65);
      color: #fff;
      font-size: 14px;
      line-height: 1;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .pio-photo-remove:hover { background: rgba(15,23,42,.85); }
    .pio-photo-add-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 8px 14px;
      border: 1px dashed #94a3b8;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 600;
      color: #475569;
      cursor: pointer;
    }
    .pio-photo-add-btn:hover { background: #f8fafc; border-color: #64748b; }
    .pio-logo-thumb {
      width: 96px;
      aspect-ratio: 1 / 1;
      flex-shrink: 0;
    }
    .pio-logo-thumb img { object-fit: contain; padding: 8px; box-sizing: border-box; }
    @media (max-width: 480px) {
      .pio-photo-grid { grid-template-columns: repeat(2, 1fr); }
    }

    /* ── Section Header ── */
    .section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 20px;
    }

    .section-title {
      font-size: 20px;
      font-weight: 700;
    }

    .section-sub {
      font-size: 13px;
      color: #94a3b8;
      margin-top: 2px;
    }

    /* ── Cards ── */
    .card {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 14px;
      overflow: hidden;
      margin-bottom: 10px;
      transition: box-shadow .15s, border-color .15s;
    }

    .card:hover {
      border-color: #cbd5e1;
      box-shadow: 0 2px 12px rgba(0,0,0,.05);
    }

    .card-header {
      display: flex;
      align-items: center;
      padding: 10px 16px;
      min-height: 48px;
      cursor: pointer;
      user-select: none;
      transition: background .1s;
    }

    .card-header:hover { background: #fafafa; }

    .card-expand { border-top: 1px solid #f1f5f9; }

    /* ── Mobile-only info chips (card badges moved out of the header, see mobile media query) ── */
    .mobile-only-chips { display: none; }

    /* ── Card action rows: extra actions collapse into a "⋯" menu on mobile ── */
    .action-secondary-group { display: contents; }
    .kebab-toggle { display: none; }

    /* ── Device Rows ── */
    .dev-row {
      display: flex;
      align-items: center;
      padding: 10px 16px;
      border-bottom: 1px solid #f8fafc;
      gap: 10px;
      transition: background .1s;
    }

    .dev-row:last-child { border-bottom: none; }
    .dev-row:hover { background: #fafafa; }

    /* ── Badges ── */
    .badge {
      display: inline-flex;
      align-items: center;
      padding: 3px 10px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
      letter-spacing: .02em;
    }

    .badge-on      { background: #dcfce7; color: #15803d; }
    .badge-off     { background: #fee2e2; color: #b91c1c; }
    .badge-lic-ok  { background: #dcfce7; color: #15803d; }
    .badge-lic-warn{ background: #fef9c3; color: #a16207; }
    .badge-lic-exp { background: #fee2e2; color: #b91c1c; }
    .badge-lic-none{ background: #f1f5f9; color: #94a3b8; }

    .badge-sub-active  { background: #dcfce7; color: #15803d; }
    .badge-sub-pastdue { background: #fef9c3; color: #a16207; }
    .badge-sub-canceled{ background: #fee2e2; color: #b91c1c; }
    .badge-sub-none    { background: #f1f5f9; color: #94a3b8; }

    .badge-dealer { background: #f5f3ff; color: #7c3aed; }
    .badge-kiosk    { background: #ede9fe; color: #6d28d9; }
    .badge-fnb      { background: #fff7ed; color: #c2410c; }
    .badge-customer { background: #ecfdf5; color: #047857; }
    .badge-hub      { background: #e0f2fe; color: #0369a1; }
    .badge-ods      { background: #dcfce7; color: #15803d; }

    .badge-role-main   { background: #e0f2fe; color: #0369a1; }
    .badge-role-sub    { background: #f1f5f9; color: #475569; }
    .badge-role-solo   { background: #f8fafc; color: #94a3b8; }

    /* ── Stat Cards (Revenue) ── */
    .stat-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      margin-bottom: 20px;
    }

    /* Dashboard: 4 equal cards in one row (desktop); see tablet/mobile overrides below */
    .stat-row-4 { grid-template-columns: repeat(4, 1fr); }

    .stat-card {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 20px;
    }

    .stat-label {
      font-size: 11px;
      color: #94a3b8;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .06em;
      margin-bottom: 8px;
    }

    .stat-value {
      font-size: 26px;
      font-weight: 800;
      color: #0f172a;
      letter-spacing: -.5px;
    }

    .stat-sub { font-size: 12px; color: #94a3b8; margin-top: 4px; }

    /* ── Data Table ── */
    .data-table { width: 100%; border-collapse: collapse; }

    .data-table th {
      text-align: left;
      padding: 10px 16px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .06em;
      color: #94a3b8;
      border-bottom: 1px solid var(--border);
      white-space: nowrap;
    }

    .data-table td {
      padding: 12px 16px;
      font-size: 13px;
      color: #475569;
      border-bottom: 1px solid #f8fafc;
      vertical-align: middle;
    }

    .data-table tr:last-child td { border-bottom: none; }
    .data-table tbody tr:hover td { background: #fafafa; }

    /* ── Dealer Tag (customer cards) ── */
    .dealer-tag {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      font-size: 11px;
      color: #7c3aed;
      background: #f5f3ff;
      border-radius: 6px;
      padding: 1px 7px;
      font-weight: 600;
      margin-top: 2px;
    }

    /* ── Log Rows ── */
    .log-row { padding: 12px 16px; border-bottom: 1px solid #f8fafc; font-size: 13px; }
    .log-row:last-child { border-bottom: none; }
    .log-row:hover { background: #fafafa; }
    .log-time { font-size: 11px; color: #94a3b8; font-family: 'Consolas','Courier New',monospace; margin-bottom: 3px; }
    .log-action { font-weight: 700; color: #1e293b; }
    .log-dealer { color: #7c3aed; font-size: 12px; margin-left: 8px; font-weight: 600; }
    .log-details { color: #64748b; font-size: 12px; margin-top: 2px; }

    /* ── Role Chip ── */
    .role-chip {
      display: inline-flex;
      padding: 1px 7px;
      border-radius: 6px;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .role-chip-admin  { background: #eff6ff; color: #2563eb; }
    .role-chip-dealer { background: #f5f3ff; color: #7c3aed; }

    @media (max-width: 767px) {
      .stat-row { grid-template-columns: 1fr 1fr; gap: 8px; }
    }

    /* ── Form Styles ── */
    fieldset.section {
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 20px 18px;
      margin-bottom: 16px;
    }

    fieldset.section legend {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .08em;
      color: #94a3b8;
      padding: 0 4px;
    }

    label.field-label {
      display: block;
      font-size: 13px;
      font-weight: 600;
      color: #475569;
      margin-bottom: 6px;
      margin-top: 16px;
    }

    fieldset.section > label.field-label:first-of-type { margin-top: 0; }

    input.field {
      display: block;
      width: 100%;
      height: var(--row);
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      padding: 0 14px;
      font-size: 14px;
      color: #1e293b;
      background: #fff;
      outline: none;
      transition: border-color .15s, box-shadow .15s;
    }

    input.field:focus {
      border-color: var(--clr);
      box-shadow: 0 0 0 3px #dbeafe;
    }

    .field-error-flash {
      border-color: #ef4444 !important;
      box-shadow: 0 0 0 3px #fecaca !important;
    }

    input.field.mono {
      font-family: 'Consolas', 'Courier New', monospace;
      font-size: 13px;
    }

    select.field {
      display: block;
      width: 100%;
      height: var(--row);
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      padding: 0 14px;
      font-size: 14px;
      color: #1e293b;
      background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
      appearance: none;
      outline: none;
      cursor: pointer;
      transition: border-color .15s, box-shadow .15s;
    }

    select.field:focus {
      border-color: var(--clr);
      box-shadow: 0 0 0 3px #dbeafe;
    }

    .hint {
      font-size: 12px;
      color: #94a3b8;
      margin-top: 5px;
    }

    /* ── Buttons ── */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      height: var(--row);
      border-radius: 10px;
      font-size: 14px;
      font-weight: 700;
      border: none;
      cursor: pointer;
      transition: background .12s, opacity .12s, box-shadow .12s;
      white-space: nowrap;
    }

    .btn-primary {
      background: var(--clr);
      color: #fff;
      padding: 0 20px;
    }

    .btn-primary:hover { background: var(--clr-hover); box-shadow: 0 2px 8px rgba(37,99,235,.3); }
    .btn-primary:active { background: #1e40af; }
    .btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
    .btn-primary.full { width: 100%; }

    .btn-ghost {
      background: transparent;
      border: 1px solid var(--border);
      color: #475569;
      padding: 0 16px;
    }

    .btn-ghost:hover { background: #f8fafc; border-color: #cbd5e1; }

    .btn-danger {
      background: transparent;
      border: 1px solid #fecaca;
      color: #dc2626;
      padding: 0 16px;
    }

    .btn-danger:hover { background: #fef2f2; }

    .btn-sm {
      height: 34px;
      font-size: 12px;
      border-radius: 8px;
      padding: 0 12px;
    }

    /* Customers-tab status filter chips */
    .filter-chip {
      height: 30px;
      padding: 0 12px;
      font-size: 12px;
      font-weight: 600;
      border-radius: 99px;
      border: 1px solid var(--border);
      background: #fff;
      color: #475569;
      cursor: pointer;
      white-space: nowrap;
    }
    .filter-chip:hover { border-color: #cbd5e1; background: #f8fafc; }
    .filter-chip.active {
      background: var(--clr);
      border-color: var(--clr);
      color: #fff;
    }

    /* ── Alert Boxes ── */
    .alert {
      border-radius: 10px;
      padding: 12px 14px;
      font-size: 13px;
      margin-bottom: 14px;
      line-height: 1.5;
    }

    .alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
    .alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
    .alert-warn    { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

    .email-check { margin-top: 8px; font-size: 13px; min-height: 22px; }
    .email-check-ok   { color: #15803d; font-weight: 600; }
    .email-check-spin { display: flex; align-items: center; gap: 8px; color: #64748b; }
    .existing-biz-list { margin: 8px 0 4px; padding-left: 16px; }
    .existing-biz-list li { font-size: 13px; color: #475569; margin-bottom: 3px; }

    .search-wrap { position: relative; }
    .search-wrap input { padding-left: 34px; }
    .search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; color: #94a3b8; }

    /* ── Spinner ── */
    .spin {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      border: 2px solid #bfdbfe;
      border-top-color: var(--clr);
      animation: rot .7s linear infinite;
      flex-shrink: 0;
    }

    @keyframes rot { to { transform: rotate(360deg); } }

    /* ── Centered Modals ── */
    .modal {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 200;
      background: rgba(15,23,42,.4);
      align-items: center;
      justify-content: center;
      padding: 24px;
      backdrop-filter: blur(2px);
    }

    .modal.open { display: flex; }

    .dialog {
      background: #fff;
      border-radius: 20px;
      padding: 32px;
      width: 100%;
      max-width: 460px;
      box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.08);
      animation: dialogIn .16s ease;
    }

    @keyframes dialogIn {
      from { opacity: 0; transform: scale(.96) translateY(6px); }
      to   { opacity: 1; transform: scale(1) translateY(0); }
    }

    .dialog-title {
      font-size: 18px;
      font-weight: 700;
      margin-bottom: 4px;
      color: #0f172a;
    }

    .dialog-sub {
      font-size: 13px;
      color: #94a3b8;
      margin-bottom: 20px;
    }

    .dialog-actions {
      display: flex;
      gap: 10px;
      margin-top: 24px;
    }

    .dialog-actions .btn { flex: 1; }

    /* ── Empty / Loading States ── */
    .empty-state {
      text-align: center;
      padding: 80px 0;
      color: #94a3b8;
    }

    .empty-state .empty-icon { font-size: 44px; margin-bottom: 12px; }
    .empty-state p { font-size: 14px; margin: 0 0 16px; }

    .loading-state {
      text-align: center;
      padding: 80px 0;
      color: #94a3b8;
    }

    /* ── Utility ── */
    .hidden { display: none !important; }
    .chevron { font-size: 12px; color: #94a3b8; }
    .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

    /* ── Scrollbar ── */
    ::-webkit-scrollbar { width: 6px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
    ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

    /* ── Mobile Brand (hidden on tablet/desktop) ── */
    .mobile-brand {
      display: none;
      height: 28px;
      object-fit: contain;
      flex-shrink: 0;
    }

    /* ── Mobile Bottom Nav: single "current tab" trigger (hidden on tablet/desktop) ── */
    #mobileBottomNav {
      display: none;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background: #fff;
      border-top: 1px solid var(--border);
      height: 54px;
      z-index: 100;
    }

    .mobile-nav-trigger {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      background: none;
      border: none;
      font-size: 14px;
      font-weight: 700;
      color: #1e293b;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-trigger svg:first-child { color: var(--clr); flex-shrink: 0; }
    .mobile-nav-trigger .chev { color: #94a3b8; flex-shrink: 0; }

    /* ── Mobile Nav popup list (bottom-sheet opened from the trigger) ── */
    .mobile-nav-list-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 13px 14px;
      border-radius: 10px;
      font-size: 15px;
      font-weight: 600;
      color: #334155;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-list-item:active { background: #f1f5f9; }
    .mobile-nav-list-item svg { opacity: .7; flex-shrink: 0; }
    .mobile-nav-list-item.tab-active { color: var(--clr); background: var(--clr-light); }
    .mobile-nav-list-item.tab-active svg { opacity: 1; }

    /* ── Tablet: 768px – 1023px ── */
    @media (min-width: 768px) and (max-width: 1023px) {
      :root { --sidebar-w: 196px; }
      .sidebar-brand-sub { display: none; }
      .sidebar-brand { padding: 18px 16px 16px; }
      .sidebar-brand-name { font-size: 19px; }
      .tab-pane { padding: 20px; }
      .content-container { max-width: 100%; }
      .form-container { max-width: 100%; }
      #mainHeader { padding: 0 20px; }
      .stat-row-4 { grid-template-columns: repeat(2, 1fr); }
      #dashAttention { grid-template-columns: 1fr !important; }
    }

    /* ── Mobile: < 768px ── */
    @media (max-width: 767px) {
      /* Sidebar off-screen */
      #sidebar { display: none; }

      /* Show brand in header */
      .mobile-brand { display: block; }
      #mainHeaderTitle { font-size: 13px; color: #64748b; font-weight: 600; }

      /* Header */
      #mainHeader { padding: 0 16px; justify-content: space-between; }

      /* Breathing room above bottom nav */
      #tabBody { padding-bottom: 60px; }

      /* Tighter content padding */
      .tab-pane { padding: 14px 14px; }
      .content-container { max-width: 100%; }
      .form-container { max-width: 100%; }

      /* Section header: let button wrap if needed */
      .section-header { flex-wrap: wrap; gap: 8px; }
      .section-title { font-size: 17px; }

      /* Card action bar: already flex-wrap:wrap, just tighten spacing */
      .card-expand > div:last-child { padding: 10px 12px; gap: 6px; }

      /* Card header: badge cluster wraps to its own row instead of being
         clipped off-screen by .card's overflow:hidden */
      .card-header { flex-wrap: wrap; row-gap: 6px; padding: 10px 12px; }
      .card-header > div:last-child { flex: 1 0 100%; flex-wrap: wrap; row-gap: 6px; }

      /* Card header: keep only the essentials visible collapsed (name, subscription
         status, chevron) — plan-tier and add-on flags move into the expanded panel
         as .mobile-only-chips so the collapsed list isn't a wall of badges */
      .card-header .badge-tier,
      .card-header .badge-addon { display: none; }
      .mobile-only-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

      /* Card action rows: keep one primary action visible, tuck the rest behind
         a "⋯" toggle so a business card isn't a wall of buttons */
      .action-secondary-group {
        display: none;
        flex-wrap: wrap;
        gap: 6px;
        flex-basis: 100%;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dashed #f1f5f9;
      }
      .action-secondary-group.open { display: flex; }
      .kebab-toggle { display: inline-flex; margin-left: auto; padding: 0 12px; font-weight: 900; }

      /* Device rows: push action group to its own line */
      .dev-row { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
      .dev-row > div:last-child { flex: 0 0 100% !important; flex-shrink: 0 !important; justify-content: flex-start; padding-left: 16px; }

      /* Dashboard stat cards: tighter now that mobile is a strict 2×2 grid */
      .stat-value { font-size: 21px; }
      .stat-card { padding: 14px; }

      /* Add-Ons modal rows: stack instead of forcing a cramped horizontal scroll */
      .addon-row { flex-wrap: wrap !important; overflow-x: visible !important; row-gap: 8px; }
      .addon-row > div:last-child { margin-left: 0 !important; flex-basis: 100%; }

      /* Inputs/selects at 16px prevent iOS Safari auto-zoom-on-focus */
      input.field, select.field { font-size: 16px; }

      /* Plan cards (Register tab): tighter padding so 3 columns fit narrow phones */
      #regPlanCards { gap: 6px !important; }
      #regPlanCards > div { padding: 10px 4px !important; }
      #regPlanCards > div > div:nth-child(2) { font-size: 17px !important; }

      /* Login card */
      .login-card { padding: 32px 20px; }
      .login-brand-name { font-size: 34px; }

      /* Modals: bottom-sheet style */
      .modal { padding: 0; align-items: flex-end; }
      .dialog {
        border-radius: 20px 20px 0 0;
        padding: 24px 20px 28px;
        max-width: 100%;
        max-height: 90dvh;
        overflow-y: auto;
      }

      /* Show bottom nav */
      #mobileBottomNav { display: flex; }
    }
