/* ===================================================================
   portal_redesign.css — EasyRender Customer Portal
   Clean dark UI. No glow. No flicker. Fast.
   =================================================================== */

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  --pr-bg:          #0d0f14;
  --pr-surface:     #13161e;
  --pr-surface-2:   #1a1f2b;
  --pr-border:      rgba(255,255,255,0.07);
  --pr-border-mid:  rgba(255,255,255,0.12);

  --pr-text:        #e8eaf0;
  --pr-text-2:      #8b929e;
  --pr-text-3:      #525966;

  --pr-accent:      #4f8eff;
  --pr-accent-dim:  rgba(79,142,255,0.12);
  --pr-accent-border: rgba(79,142,255,0.25);

  --pr-ok:          #22c55e;
  --pr-ok-dim:      rgba(34,197,94,0.10);
  --pr-ok-border:   rgba(34,197,94,0.25);

  --pr-warn:        #f59e0b;
  --pr-warn-dim:    rgba(245,158,11,0.10);
  --pr-warn-border: rgba(245,158,11,0.25);

  --pr-danger:      #ef4444;
  --pr-danger-dim:  rgba(239,68,68,0.10);
  --pr-danger-border: rgba(239,68,68,0.25);

  --pr-sidebar-w:   252px;
  --pr-topbar-h:    56px;
  --pr-radius:      10px;
  --pr-radius-sm:   6px;
  --pr-speed:       150ms;

  --pr-font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* ── Hard reset for portal pages only ────────────────────────────
   Scoped to body.page-portal to avoid conflicts with dashboard CSS */
body.page-portal {
  font-family: var(--pr-font) !important;
  background: var(--pr-bg) !important;
  color: var(--pr-text) !important;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  /* Kill Bootstrap body defaults */
  margin: 0 !important;
  padding: 0 !important;
}

/* Neutralize Bootstrap interference inside portal */
body.page-portal *,
body.page-portal *::before,
body.page-portal *::after {
  box-sizing: border-box;
}

/* Hide admin navbar when portal uses it */
body.page-portal .admin-nav { display: none !important; }

/* ── Portal Layout (sidebar + main) ──────────────────────────── */
body.page-portal.portal-layout-active {
  display: flex;
  overflow: hidden;
  height: 100vh;
}

.portal-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.portal-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--pr-sidebar-w);
  background: var(--pr-surface);
  border-right: 1px solid var(--pr-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--pr-border);
  flex-shrink: 0;
}

.sidebar-brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.sidebar-brand span {
  font-size: 16px;
  font-weight: 700;
  color: var(--pr-text);
  letter-spacing: -0.3px;
}

.sidebar-brand span em {
  font-style: normal;
  color: var(--pr-accent);
}

/* Brand wordmark plus the surface it belongs to. There are three portals on
   the same design (user, org, admin) and the wordmark alone does not say which
   one you are looking at. The tag is a <small>, not a <span>, so it escapes the
   `.sidebar-brand span` rule above rather than fighting it on specificity. */
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
}

.brand-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--pr-text-3);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--pr-radius-sm);
  color: var(--pr-text-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none !important;
  transition: background var(--pr-speed), color var(--pr-speed);
  white-space: nowrap;
}

.sidebar-nav-item i {
  width: 18px;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-nav-item:hover {
  background: var(--pr-surface-2);
  color: var(--pr-text);
}

.sidebar-nav-item.active {
  background: var(--pr-accent-dim);
  color: var(--pr-accent);
  font-weight: 600;
}

.sidebar-nav-item.active i {
  color: var(--pr-accent);
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--pr-border);
  flex-shrink: 0;
}

.user-info {
  padding: 0 4px 10px;
}

.user-email {
  display: block;
  font-size: 12px;
  color: var(--pr-text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sidebar footer actions -------------------------------------------------
   Download and Sign out are actions, not destinations, which is why they sit
   here rather than in the nav above or in the phone's bottom bar.

   They are separated and weighted deliberately. Before this, Sign out was the
   only control in the footer and it was styled as the loudest thing on the
   page — a red filled button, immediately below the nav. Download is the
   primary action now; Sign out is quiet until you approach it, and a divider
   sits between them because a primary action flush against a terminal one is a
   mis-tap generator. */
.btn-sidebar-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: var(--pr-accent-dim);
  border: 1px solid var(--pr-accent-border);
  color: var(--pr-accent);
  border-radius: var(--pr-radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--pr-font);
  text-decoration: none !important;
  cursor: pointer;
  transition: background var(--pr-speed);
}

.btn-sidebar-download:hover {
  background: var(--pr-accent-border);
  color: var(--pr-accent);
}

.sidebar-footer-divider {
  height: 1px;
  background: var(--pr-border);
  margin: 10px 2px;
}

/* Support tab: room between the buttons, and between them and the text. */
.support-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.support-actions .btn-settings { text-decoration: none; }

/* Logout button — quiet until approached */
.btn-sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: 1px solid transparent;
  color: var(--pr-text-3);
  border-radius: var(--pr-radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--pr-font);
  cursor: pointer;
  transition: background var(--pr-speed), color var(--pr-speed),
              border-color var(--pr-speed);
}

.btn-sidebar-logout:hover {
  background: var(--pr-danger-dim);
  border-color: var(--pr-danger-border);
  color: #f87171;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
}

.sidebar-overlay.active { display: block; }

/* Toggle button (mobile only) */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--pr-text);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.sidebar-toggle:hover { background: var(--pr-surface-2); }

/* ── Main Content Area ────────────────────────────────────────── */
.portal-main {
  flex: 1;
  margin-left: var(--pr-sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.portal-topbar {
  height: var(--pr-topbar-h);
  padding: 0 24px;
  border-bottom: 1px solid var(--pr-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--pr-surface);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--pr-text);
}

.portal-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.portal-content {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Cards ────────────────────────────────────────────────────── */
.portal-card,
.login-card,
.settings-card,
.plan-card,
.ntf-card,
.confirm-box {
  background: var(--pr-surface) !important;
  /* Merged 2026-09-07: this box was declared three times in this file with
     conflicting !important values, so whichever came last silently won and the
     earlier two only looked authoritative. One declaration now. */
  border: 1px solid var(--pr-border-mid) !important;
  border-radius: var(--pr-radius) !important;
  padding: 24px !important;
  transition: opacity 0.2s ease;
  /* No glow, no blur, no shadows */
}

/* Subtle interactive lift for list-item cards */
.ntf-card {
  transition: border-color var(--pr-speed) !important;
}

.ntf-card:hover {
  border-color: var(--pr-border-mid) !important;
}

/* ── Section Labels ───────────────────────────────────────────── */
.portal-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--pr-text-3);
  margin: 0 0 12px;
}

/* ── Plan Row ─────────────────────────────────────────────────── */

/* ── Buttons ──────────────────────────────────────────────────── */

/* Primary */
.btn-primary,
.btn-settings-primary,
.download-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  padding: 9px 18px !important;
  background: var(--pr-accent) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--pr-radius-sm) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  font-family: var(--pr-font) !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: opacity var(--pr-speed) !important;
  white-space: nowrap;
}

.btn-primary:hover:not(:disabled),
.btn-settings-primary:hover:not(:disabled),
.download-btn:hover:not(:disabled) {
  opacity: 0.88 !important;
  color: #fff !important;
  text-decoration: none !important;
}

.btn-primary:disabled,
.btn-settings-primary:disabled,
.download-btn:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
}

/* Outline / secondary */
.btn-portal-outline,
.btn-settings-secondary,
.btn-outline,
.btn-settings {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  padding: 9px 18px !important;
  background: var(--pr-surface-2) !important;
  border: 1px solid var(--pr-border-mid) !important;
  color: var(--pr-text) !important;
  border-radius: var(--pr-radius-sm) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  font-family: var(--pr-font) !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: background var(--pr-speed), border-color var(--pr-speed) !important;
  white-space: nowrap;
}

.btn-portal-outline:hover:not(:disabled),
.btn-settings-secondary:hover:not(:disabled),
.btn-outline:hover:not(:disabled),
.btn-settings:hover:not(:disabled) {
  background: rgba(255,255,255,0.07) !important;
  border-color: rgba(255,255,255,0.18) !important;
  color: var(--pr-text) !important;
  text-decoration: none !important;
}

/* Danger */
.btn-license-unlink,
.btn-device-unlink,
.btn-sign-out,
.btn-settings-danger,
.btn-danger {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  padding: 9px 18px !important;
  background: var(--pr-danger-dim) !important;
  border: 1px solid var(--pr-danger-border) !important;
  color: #f87171 !important;
  border-radius: var(--pr-radius-sm) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  font-family: var(--pr-font) !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: background var(--pr-speed) !important;
  white-space: nowrap;
}

.btn-license-unlink:hover:not(:disabled),
.btn-sign-out:hover:not(:disabled),
.btn-settings-danger:hover:not(:disabled),
.btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.18) !important;
  color: #fca5a5 !important;
}

/* Cancel subscription button — red border, white text, dark bg on hover */
.btn-settings-cancel {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  padding: 8px 18px !important;
  background: transparent !important;
  border: 1px solid #ef4444 !important;
  color: #fff !important;
  border-radius: var(--pr-radius-sm) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  font-family: var(--pr-font) !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: background var(--pr-speed), color var(--pr-speed), border-color var(--pr-speed) !important;
  white-space: nowrap;
}

.btn-settings-cancel:hover:not(:disabled) {
  background: rgba(239,68,68,0.22) !important;
  border-color: #f87171 !important;
  color: #fff !important;
}

.btn-settings-cancel:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Google button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: var(--pr-surface-2);
  border: 1px solid var(--pr-border-mid);
  color: var(--pr-text);
  border-radius: var(--pr-radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--pr-font);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--pr-speed);
}

.btn-google:hover {
  background: rgba(255,255,255,0.07);
  color: var(--pr-text);
  text-decoration: none;
}

/* ── Continue as X (GitHub-style) ─────────────────────────────── */
/* The step title.

   'Reset your password' was set in .continue-lead: 13px, --pr-text-dim,
   centred. That is a caption style, and as a title it left the heading
   quieter and smaller than the uppercase EMAIL label directly beneath it, so
   the eye landed on the field label first and the page read as unfinished.
   A title should be the loudest thing between the logo and the first field. */
.auth-title {
  text-align: center;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--pr-text);
  margin: 2px 0 6px;
  text-wrap: balance;
}

.auth-sub {
  text-align: center;
  font-size: 13px;
  line-height: 1.55;
  color: var(--pr-text-3);
  /* !important because .login-card sets its own paragraph margins; without it
     the sub sat 6px above the first label and the title block ran straight
     into the form with no seam between them. */
  margin: 0 auto 26px !important;
  max-width: 38ch;
  text-wrap: balance;
}

/* The account card is the Continue button. */
.continue-account {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 22px;
  padding: 14px;
  background: var(--pr-surface-2);
  border: 1px solid var(--pr-border-mid);
  border-radius: 12px;
  color: var(--pr-text);
  font-family: var(--pr-font);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--pr-speed), background var(--pr-speed),
              box-shadow var(--pr-speed);
}

.continue-account:hover,
.continue-account:focus-visible {
  border-color: color-mix(in srgb, var(--login-accent) 55%, transparent);
  background: color-mix(in srgb, var(--login-accent) 7%, var(--pr-surface-2));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--login-accent) 10%, transparent);
  outline: none;
}

.continue-avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d4ff, #4285F4);
  color: #0d0f12;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.continue-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.continue-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--pr-text-dim);
}

.continue-email {
  font-size: 14px;
  font-weight: 600;
  color: var(--pr-text);
  /* Breaks after the @ (a <wbr> in the template) before it breaks anywhere. */
  overflow-wrap: break-word;
  min-width: 0;
}

.continue-arrow {
  flex: 0 0 auto;
  color: var(--login-accent);
  transition: transform var(--pr-speed);
}

.continue-account:hover .continue-arrow { transform: translateX(3px); }

/* The way out, not a second choice of equal weight: text, no box. */
.btn-switch {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--pr-text-dim);
  border-radius: var(--pr-radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--pr-font);
  cursor: pointer;
  transition: background var(--pr-speed), color var(--pr-speed);
}

.btn-switch:hover {
  background: rgba(255,255,255,0.04);
  color: var(--pr-text);
}

/* ── Inputs ───────────────────────────────────────────────────── */
.settings-input,
.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--pr-surface-2) !important;
  border: 1px solid var(--pr-border-mid) !important;
  color: var(--pr-text) !important;
  border-radius: var(--pr-radius-sm) !important;
  padding: 10px 12px !important;
  font-size: 13.5px !important;
  font-family: var(--pr-font) !important;
  outline: none !important;
  transition: border-color var(--pr-speed) !important;
}

.settings-input:focus,
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--pr-accent) !important;
  /* No glow ring */
}

.settings-input::placeholder,
.form-group input::placeholder {
  color: var(--pr-text-3) !important;
}

.settings-input[readonly] {
  opacity: 0.55;
  cursor: default;
}

/* Field error */
.field-error {
  font-size: 12px;
  color: #f87171;
  margin-top: 4px;
  display: none;
}

.field-error.visible { display: block; }

.input-error { border-color: var(--pr-danger) !important; }

/* ── Form groups ──────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label,
.settings-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--pr-text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pw-wrap {
  position: relative;
}

.pw-wrap input { padding-right: 44px !important; }

.pw-toggle {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  padding: 0 12px;
  background: none;
  border: none;
  color: var(--pr-text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.pw-toggle:hover { color: var(--pr-text-2); }

.settings-field-group {
  margin-bottom: 14px;
}

/* ── Badges ───────────────────────────────────────────────────── */
.badge-status-success, .badge-active {
  background: var(--pr-ok-dim) !important;
  color: #4ade80 !important;
  border: 1px solid var(--pr-ok-border) !important;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
}

.badge-status-danger, .badge-danger {
  background: var(--pr-danger-dim) !important;
  color: #f87171 !important;
  border: 1px solid var(--pr-danger-border) !important;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
}

.badge-status-warning, .badge-warning {
  background: var(--pr-warn-dim) !important;
  color: #fbbf24 !important;
  border: 1px solid var(--pr-warn-border) !important;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
}

.badge-custom, .badge-unbound {
  background: var(--pr-accent-dim) !important;
  color: var(--pr-accent) !important;
  border: 1px solid var(--pr-accent-border) !important;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
}

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px !important;
  border-radius: var(--pr-radius-sm) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  margin-bottom: 16px !important;
  border: 1px solid !important;
}

.alert-error {
  background: var(--pr-danger-dim) !important;
  border-color: var(--pr-danger-border) !important;
  color: #fca5a5 !important;
}

.alert-success {
  background: var(--pr-ok-dim) !important;
  border-color: var(--pr-ok-border) !important;
  color: #86efac !important;
}

/* ── Divider ──────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  margin: 18px 0;
  color: var(--pr-text-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  gap: 10px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--pr-border);
}

/* ── Auth / Login page ─────────────────────────────────────────
   Centered single-column layout, no sidebar */
body.page-portal:not(.portal-layout-active) {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.login-container,
.portal-auth-shell,
.portal-auth-page {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.portal-auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  max-width: none;
  padding: 32px 16px;
}

.portal-auth-shell {
  width: 100%;
  max-width: 420px;
}

.portal-auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.portal-auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--pr-text);
  letter-spacing: -0.5px;
  margin: 8px 0 4px;
}

.portal-auth-tagline {
  font-size: 13px;
  color: var(--pr-text-2);
  margin: 0;
}

/* The logo links back to the store, and so does a plain link above the card:
   a sign-in page with no way back is a dead end. */
a.login-brand { text-decoration: none; color: inherit; }
.login-back {
  display: block;
  margin-bottom: 14px;
  color: var(--text-secondary, #9aa4b2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.login-back:hover { color: var(--accent, #00F2FE); }

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.login-brand span {
  font-size: 18px;
  font-weight: 700;
  color: var(--pr-text);
  letter-spacing: -0.3px;
}

.login-brand span em {
  font-style: normal;
  color: var(--pr-accent);
}

.login-footer {
  text-align: center;
  font-size: 12.5px;
  color: var(--pr-text-3);
  margin-top: 20px;
}

.login-footer a {
  color: var(--pr-accent);
  text-decoration: none;
  font-weight: 600;
}

.login-footer a:hover { text-decoration: underline; }

/* ── Step wizard (Registration) ───────────────────────────────── */
.step-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 20px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pr-border-mid);
  transition: background var(--pr-speed), transform var(--pr-speed);
}

.step-dot.active {
  background: var(--pr-accent);
  transform: scale(1.2);
}

.reg-step { display: none; }
.reg-step.active { display: block; }

.step-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pr-text-3);
  text-align: center;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-row {
  display: flex;
  gap: 8px;
}

.btn-row > * { flex: 1; }

/* ── Verification code ──────────────────────────────────────────────────────
   Six cells rather than one wide field. The old markup was a single input with
   placeholder="000000" and letter-spacing, so an EMPTY field rendered a greyed
   "0 0 0 0 0 0" that read as a disabled field which already had a value in it.
   Nobody could tell it was waiting for input.

   The cells are the visible control; a hidden input keeps name="otp" and the
   aggregated value, so the form post and every existing reader are unchanged. */
/* The label is centred with the cells. Left-aligned over a centred grid it
   read as belonging to something else. */
.otp-group { margin-bottom: 18px; }
/* Flush left like every other label on the card. It was centred, which broke
   the column edge at exactly one field and made the group look bolted on. The
   CELLS stay centred -- they are a unit, not a row of fields. */
.otp-group label { display: block; }

.otp-cells {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  /* Capped so the cells stay square-ish and centred instead of stretching into
     six wide slabs on a roomy card. */
  max-width: 296px;
  margin: 0 auto;
}

.otp-cells .otp-cell {
  width: 100% !important;
  aspect-ratio: 1 / 1.15;
  padding: 0 !important;
  text-align: center;
  font-size: 20px !important;
  font-weight: 600;
  font-family: 'JetBrains Mono', ui-monospace, monospace !important;
  font-variant-numeric: tabular-nums;
  border-radius: 10px !important;
  outline: none !important;
  transition: border-color var(--pr-speed), background var(--pr-speed);
}

.otp-cells .otp-cell::placeholder { color: transparent !important; }

/* ── The captcha ────────────────────────────────────────────────────────────
   hCaptcha renders a fixed 302px widget in its own colours and its own border,
   so on a dark card it lands as a foreign grey slab narrower than the field
   above and the button below — and it used to butt straight against the button
   with no gap at all. Centre it and give it room; do NOT add a second border
   around it, which only produces a box inside a box. */
.captcha-group {
  margin: 0 0 18px !important;
  display: flex;
  justify-content: center;
}

.captcha-group .h-captcha { line-height: 0; }

/* ── Back / Resend ──────────────────────────────────────────────────────────
   These were flex:1 each, so a full-weight outlined button sat beside a small
   grey text link, each owning half the row. Back is secondary and Resend is
   tertiary; size them that way. */
.otp-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.otp-actions .btn-outline {
  flex: 0 0 auto;
  min-width: 96px;
}

.otp-actions a {
  font-size: 12.5px;
  color: var(--pr-text-3);
  text-decoration: none;
  transition: color var(--pr-speed);
}

.otp-actions a:hover { color: var(--pr-accent); }

/* Requirements that stay put.

   These lived in the placeholder, which means they were erased by the first
   keystroke -- the reader lost the rules at the exact moment they started
   trying to satisfy them, and a rejected password left nothing on screen
   saying what was wanted. A hint under the field is quiet enough to ignore
   once known and still there when it is not. */
.field-hint {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--pr-text-3);
  margin: 6px 0 0;
}

.status-msg {
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
  display: none;
}

/* Sitting directly under the code field it is a caption for that field, so it
   needs room of its own rather than being crushed against what follows. It is
   also a confirmation, not an alarm: at full-strength green and 12px it was
   the loudest thing on the step. */
.otp-group + .status-msg {
  margin: -4px 0 18px;
  font-size: 11.5px;
  opacity: 0.85;
}

.status-msg.success { display: block; color: var(--pr-ok); }
.status-msg.error   { display: block; color: var(--pr-danger); }

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

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

/* Modal fade-in/out */
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Brand Gradient Text (accent only, no fill) ───────────────── */
.brand-gradient { color: var(--pr-accent) !important; }

/* ── Modal Overlays ───────────────────────────────────────────── */
.modal-overlay,
.confirm-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,0.65) !important;
  z-index: 1000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s ease;
}

.modal {
  animation: modal-in 0.2s ease-out;
}

.confirm-overlay .confirm-box {
  animation: modalSlideUp 0.25s ease;
}

.confirm-box {
  background: var(--pr-surface) !important;
  border: 1px solid var(--pr-border-mid) !important;
  border-radius: var(--pr-radius) !important;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}

.modal-close {
  background: none;
  border: none;
  color: var(--pr-text-3);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover { color: var(--pr-text); }

.confirm-box h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--pr-text);
  margin: 0 0 10px;
}

.confirm-box p {
  font-size: 13px;
  color: var(--pr-text-2);
  margin: 0 0 18px;
}

/* ── Toast notifications ──────────────────────────────────────── */
/* Used to be defined here: #toast-container / #settings-toast-container and
   .toast-msg, with success/error variants painted from --pr-ok-dim /
   --pr-danger-dim — a low-opacity tint with nothing solid under it, the
   "low-opacity wash" that made a toast hard to read over page content.
   Replaced by the shared .ezr-toast-container / .ezr-toast in
   static/css/toast.css (solid backgrounds), linked wherever this sheet is. */

/* ── Settings page specific ───────────────────────────────────── */
.settings-tabs {
  display: flex;
  gap: 4px;
  background: var(--pr-surface-2);
  border: 1px solid var(--pr-border);
  border-radius: var(--pr-radius-sm);
  padding: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.settings-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 5px;
  background: none;
  border: none;
  color: var(--pr-text-2);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--pr-font);
  cursor: pointer;
  transition: background var(--pr-speed), color var(--pr-speed);
  white-space: nowrap;
}

.settings-tab:hover { color: var(--pr-text); background: rgba(255,255,255,0.04); }

.settings-tab.active {
  background: var(--pr-surface);
  color: var(--pr-text);
  border: 1px solid var(--pr-border);
}

.settings-panel { display: none; }
.settings-panel.active { display: block; }

.settings-card {
  background: var(--pr-surface) !important;
  border: 1px solid var(--pr-border) !important;
  border-radius: var(--pr-radius) !important;
  padding: 20px !important;
  margin-bottom: 16px;
}

.settings-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--pr-text);
  margin: 0 0 4px;
}

.card-desc {
  font-size: 12.5px;
  color: var(--pr-text-2);
  margin: 0 0 16px;
}

.settings-header {
  margin-bottom: 24px;
}

.settings-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--pr-text);
  letter-spacing: -0.4px;
  margin: 0 0 4px;
}

.settings-title span { color: var(--pr-accent); }

.settings-subtitle {
  font-size: 13px;
  color: var(--pr-text-2);
  margin: 0;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pr-accent-dim);
  border: 1px solid var(--pr-accent-border);
  color: var(--pr-accent);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

/* The Settings FAQ accordion styling was removed with the Help tab (queue
   29) — the front page's own FAQ carries its own separate styling inline in
   store.html, unrelated to this file, so deleting these rules does not
   touch it. */

/* Sync */
.sync-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--pr-text-2);
  margin-bottom: 16px;
}

.sync-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pr-ok);
  flex-shrink: 0;
}

.sync-status .dot.none { background: var(--pr-text-3); }

.sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Portal account actions block ─────────────────────────────── */
.portal-account-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.portal-form-block {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--pr-border);
}

/* ── Portal utility classes (replaces repeated inline styles) ─── */

/* ── Notification cards ───────────────────────────────────────── */

/* ── Machine status dot ───────────────────────────────────────── */
#machine-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pr-danger);
  flex-shrink: 0;
}

#machine-status-dot.online { background: var(--pr-ok); }

/* ── The signed-in welcome ────────────────────────────────────────
   There is a second "Welcome" in portal.html, in the signed-OUT landing view.
   These are two different screens for two different people and they say
   different things on purpose — "Welcome back, <name>" here against a plain
   "Welcome" there. */
.portal-welcome {
  margin-bottom: 20px;
}

.portal-welcome-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--pr-text);
  letter-spacing: -0.4px;
  margin: 0 0 4px !important;
}

.portal-welcome-sub {
  font-size: 13px;
  color: var(--pr-text-2);
  margin: 0 !important;
}

/* ── Machine cards: the picker, promoted out of a dropdown ────────
   The <select> these replaced is still in the DOM and still holds the value —
   see the comment on #machine-picker-row in portal.html. These are what the
   user actually touches. */
.portal-machines-manage {
  font-size: 12px;
  color: var(--pr-text-3);
  text-decoration: none !important;
  white-space: nowrap;
}

.portal-machines-manage:hover { color: var(--pr-accent); }

.machine-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  margin-bottom: 10px;
  background: var(--pr-surface-2);
  border: 1px solid var(--pr-border);
  border-radius: var(--pr-radius-sm);
  font-family: var(--pr-font);
  cursor: pointer;
  transition: border-color var(--pr-speed), background var(--pr-speed);
}

.machine-card:hover { border-color: var(--pr-accent-border); }

/* The selected machine is the one every command below will go to, so this has
   to be unmistakable rather than tasteful — a card that merely looks slightly
   different is how someone shuts down the wrong computer. */
.machine-card.selected {
  border-color: var(--pr-accent);
  background: var(--pr-accent-dim);
}

.machine-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.machine-card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pr-danger);
  flex-shrink: 0;
}

.machine-card-dot.online { background: var(--pr-ok); }

.machine-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--pr-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.machine-card-state {
  font-size: 11px;
  font-weight: 600;
  color: var(--pr-text-3);
  flex-shrink: 0;
}

.machine-card-state.online { color: var(--pr-ok); }

.machine-card-meta {
  font-size: 12px;
  color: var(--pr-text-2);
  margin-top: 4px;
  margin-left: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.machine-cards-empty {
  color: var(--pr-text-2);
  font-size: 13px;
  text-align: center;
  padding: 20px;
  border: 1px dashed var(--pr-border);
  border-radius: 8px;
}

.machine-cards-error {
  color: var(--pr-danger);
  font-size: 13px;
  padding: 14px;
  border: 1px solid var(--pr-danger-border);
  background: var(--pr-danger-dim);
  border-radius: 8px;
}

/* ── Receipts table ───────────────────────────────────────────────
   Five columns do not fit a 390px phone. The table scrolls inside its own box
   rather than widening the page — a body that scrolls sideways is the bug the
   org portal had on every page, and it is worth not reintroducing here. */
.receipts-table-wrap {
  /* Positioned so the header's absolutely placed .sr-only label stays inside
     this scroll box; without it the label escaped to the page and gave the
     phone layout a sideways scroll. */
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
}

.receipts-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 13px;
}

.receipts-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pr-text-3);
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--pr-border);
  white-space: nowrap;
}

.receipts-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--pr-border);
  color: var(--pr-text);
  vertical-align: top;
}

.receipts-table tr:last-child td { border-bottom: none; }

.receipts-table .receipts-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.receipts-ref {
  display: inline-block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--pr-text-3);
  word-break: break-all;
}

/* ── Receipt download ─────────────────────────────────────────────
   An icon column, deliberately unlabelled: the table already scrolls inside
   its own box and a sixth worded header is what pushes it past a 390px phone.
   The accessible name rides on the link's aria-label instead. */
.receipts-table .receipts-pdf-col {
  width: 34px;
  padding-right: 0;
}

.receipts-pdf-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--pr-text-2);
  text-decoration: none;
  transition: background-color .12s ease, color .12s ease;
}

.receipts-pdf-link:hover,
.receipts-pdf-link:focus-visible {
  background: var(--pr-surface-2, rgba(255, 255, 255, .06));
  color: var(--pr-accent);
}

/* Visually hidden, still read out. */
.receipts-table .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Under the status badge: the plan this charge paid for will not renew. */
.receipts-plan-note {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--pr-text-2);
  line-height: 1.4;
  min-width: 110px;
}

/* ── Payment methods ──────────────────────────────────────────────
   One bordered row per saved method; the note sits under it, outside the
   border. On a phone the Remove button drops to its own full-width line. */
.pm-block + .pm-block { margin-top: 14px; }

.pm-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--pr-surface-2);
  border: 1px solid var(--pr-border);
  border-radius: var(--pr-radius-sm);
}

.pm-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 112, 224, 0.16);
  color: #4aa3ff;
  font-size: 19px;
}

.pm-text { flex: 1; min-width: 0; }

.pm-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--pr-text);
  overflow-wrap: anywhere;
}

.pm-sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--pr-text-2);
  line-height: 1.5;
}

.pm-remove { flex-shrink: 0; }

.pm-note {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--pr-text-2);
  line-height: 1.55;
}

.pm-empty {
  text-align: center;
  padding: 28px;
  border: 1px dashed var(--pr-border);
  border-radius: 8px;
  color: var(--pr-text-2);
  font-size: 13px;
}

.pm-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .pm-row { flex-wrap: wrap; align-items: flex-start; }
  .pm-text { flex-basis: calc(100% - 54px); }
  .pm-remove { width: 100%; }
}

/* ── Phone: the Settings drill-down list ──────────────────────────
   Hidden above the breakpoint, where the tab strip is the control. Rows are
   generated from those tabs — see buildDrilldown() — so this surface cannot
   offer a section the tabs have gated away. */
.settings-drilldown,
.settings-drill-actions,
.settings-back-row,
.settings-account {
  display: none;
}

.settings-drill-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--pr-border);
  color: var(--pr-text);
  font-size: 14px;
  font-family: var(--pr-font);
  font-weight: 500;
  text-align: left;
  text-decoration: none !important;
  cursor: pointer;
}

.settings-drill-row:last-child { border-bottom: none; }

.settings-drill-row > span { flex: 1; min-width: 0; }

.settings-drill-row > i:first-child {
  width: 20px;
  font-size: 16px;
  color: var(--pr-text-2);
  flex-shrink: 0;
}

.settings-drill-chevron {
  font-size: 13px;
  color: var(--pr-text-3);
  flex-shrink: 0;
}

.settings-drill-row--danger { color: #f87171; }
.settings-drill-row--danger > i:first-child { color: #f87171; }

.settings-drill-signout { margin: 0; }

/* ── Phone: the bottom bar ────────────────────────────────────────
   Three destinations, no actions. Hidden above the breakpoint, where the
   sidebar carries the same links. */
/* A floating rounded bar, the way iOS does it, rather than a full-width slab
   pinned to the edge.

   The safe-area inset moves from padding to the `bottom` offset: the bar is
   now lifted clear of the home indicator instead of padding itself away from
   underneath it, which is what stops the labels being half-covered on a modern
   iPhone. On a device with no inset the bar still floats, by the 10px.

   `overflow: hidden` matters: the active item's background would otherwise
   paint square corners back over the rounded ones. */
.portal-bottom-nav {
  display: none;
  position: fixed;
  inset: auto 12px calc(10px + env(safe-area-inset-bottom, 0px)) 12px;
  z-index: 210;
  background: var(--pr-surface);
  border: 1px solid var(--pr-border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.portal-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px 7px;
  color: var(--pr-text-3);
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: none !important;
  /* 44px is the smallest target a thumb hits reliably. */
  min-height: 44px;
}

.portal-bottom-nav-item i { font-size: 18px; }

.portal-bottom-nav-item.active { color: var(--pr-accent); }

/* ── Responsive ─────────────────────────────────────────────────

   THE BREAKPOINT LADDER. Three bands, and they are deliberate — this file
   having both a 480px and a 560px block reads like an accident and has been
   opened as one more than once. It is not. Each band owns a different kind of
   change and they touch disjoint selectors, so none of them fights another:

     768px — LAYOUT. The sidebar leaves the flow and becomes an overlay; the
             bottom nav appears. This is the only band that moves structure.
     560px — COMPONENT SPACING. Margins and padding on cards that nest
             (.plan-card inside .portal-card pays for the same padding twice),
             and the empty-state block going full-width and vertical. Nothing
             here changes type.
     480px — TYPE AND DENSITY. Font sizes and the last of the padding, for
             phones narrow enough that 14px body copy stops fitting.

   Reconciling 480 and 560 into one breakpoint was measured and declined
   (DECISIONS.md, D-11). A sweep at 320/390/430/479/540/768/1024 found no
   horizontal overflow anywhere and no element governed by both blocks, so
   there is no defect to fix — and the 481–560 band would have to move to one
   side or the other, changing spacing on real devices (the Surface Duo is
   540px) for no reported symptom.

   If you add a rule here, put it in the band that matches what it changes,
   not the one nearest the bottom of the file.
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  body.page-portal.portal-layout-active .portal-sidebar {
    left: calc(-1 * var(--pr-sidebar-w));
    transition: left 0.25s ease;
  }

  body.page-portal.portal-layout-active .portal-sidebar.active {
    left: 0;
  }

  .portal-main { margin-left: 0; }

  .sidebar-toggle { display: flex; }

  .portal-content-scroll { padding: 16px; }

  /* ── The bottom bar takes over ──────────────────────────────────
     The hamburger drawer stays in the DOM and keeps working, but the bar is
     the primary way around now, so the toggle is hidden: two navigations to
     the same three places is one more than anybody needs, and the drawer is
     the one that costs a tap. */
  .portal-bottom-nav { display: flex; }
  body.page-portal.has-bottom-nav .sidebar-toggle { display: none; }

  /* The bar is fixed, so it is out of flow and covers whatever the page ends
     with. This is the padding that stops it eating the last card — the height
     of the bar plus the iOS inset it already reserves. */
  body.page-portal.has-bottom-nav .portal-content-scroll {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  /* ── Settings: tab strip out, drill-down list in ──────────────── */
  .settings-tabs { display: none; }

  .settings-drilldown,
  .settings-drill-actions {
    display: block;
    background: var(--pr-surface);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius);
    overflow: hidden;
  }

  /* Download and Sign out sit at the BOTTOM of the list view, not 16px under
     the section list with the rest of the screen empty beneath them.

     The settings root is six rows in an 844px viewport, so the page cannot
     fill by growing — the only thing that was ever going to change is where
     the empty space sits. Between two groups it reads as a deliberate split,
     the way a phone settings screen normally separates destructive actions
     from navigation; all of it trailing off the end reads as unfinished.

     `margin-top: auto` needs a flex column that actually fills the scroll
     area, hence the two `flex: 1` above it. Only in the list view: with a
     section open the actions are hidden anyway (rule below). */
  /* Account identity, phone only. Also the thing that was missing: six rows
     in an 844px viewport cannot fill the screen, so the empty band is a
     content problem before it is a spacing one, and this is real content
     rather than padding. */
  .settings-account {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: var(--pr-surface);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius);
  }

  .settings-account-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pr-accent-dim);
    border: 1px solid var(--pr-accent-border);
    color: var(--pr-accent);
    font-size: 14px;
    font-weight: 700;
  }

  .settings-account-email {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13.5px;
    color: var(--pr-text-2);
  }

  /* The heading had 24px under it when it was the only thing above the list.
     With a card there now, that reads as a gap rather than a rhythm. */
  .settings-header { margin-bottom: 16px !important; }

  /* `flex: 1` fills a parent that has a height to fill. `.portal-content` is
     content-height inside a block scroll container, so without this the
     stretch had nothing to work against and `margin-top: auto` below did
     exactly nothing. The percentage resolves against the scroll container's
     content box, which is definite (it is `flex: 1` of a fixed-height main).
     Scoped with :has so only the settings page stretches. */
  .portal-content:has(.settings-page) { min-height: 100%; }

  .settings-page,
  .settings-shell {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  .settings-drill-actions { margin-top: auto; }

  /* The support line used to be hidden here, on the reasoning that the
     Settings list's own Help row reaches the same place and the sidebar
     carried it on desktop. Neither holds now: the sidebar copy is gone, and
     Settings is one of three pages this footer appears on. It shows at every
     width, tightened up a little. */

  /* No section chosen → the list is the page, and every panel is hidden.
     !important because the tab switcher writes display on the panel as an
     inline style, which no plain rule can outrank. */
  body:not(.settings-section-open) .settings-panel { display: none !important; }

  /* A section chosen → the list gets out of the way and back appears. */
  body.settings-section-open .settings-drilldown,
  body.settings-section-open .settings-drill-actions,
  body.settings-section-open .settings-header { display: none; }

  body.settings-section-open .settings-back-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--pr-text-2);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    margin-bottom: 16px;
    padding: 6px 2px;
  }
}

@media (max-width: 480px) {
  body.page-portal { font-size: 14px; }
  .portal-content-scroll { padding: 10px; }
  .portal-card, .settings-card, .login-card, .plan-card, .confirm-box { padding: 14px !important; }
  .btn-primary, .btn-portal-outline, .download-btn { font-size: 12px !important; padding: 7px 12px !important; }
  .portal-section-label { font-size: 9.5px; }
  .settings-tabs { gap: 1px; }
  .settings-tab { padding: 5px 8px; font-size: 11px; }
  .login-container, .portal-auth-shell { max-width: 100%; }
  .portal-auth-title { font-size: 19px; }
  .portal-auth-tagline { font-size: 12px; }
  .sidebar-brand span { font-size: 14px; }
  .topbar-title { font-size: 13px; }
  .confirm-box { max-width: 95vw; }
  /* Toast responsive sizing is now in the shared static/css/toast.css. */
}

/* ── Focus-visible for keyboard navigation ────────────────────── */
*:focus-visible {
  outline: 2px solid var(--accent, #00d4ff);
  outline-offset: 2px;
}

body.page-portal :focus-visible {
  outline: 2px solid var(--pr-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

body.page-portal button:focus:not(:focus-visible),
body.page-portal a:focus:not(:focus-visible),
body.page-portal input:focus:not(:focus-visible) {
  outline: none;
}

/* ── Command button cooldown state ───────────────────────────── */
.btn-cooldown {
  opacity: 0.5 !important;
  cursor: wait !important;
  pointer-events: none;
}

/* ── Bootstrap override cleanup ──────────────────────────────────
   Prevent Bootstrap 5 from bleeding into portal UI */
body.page-portal .container,
body.page-portal .container-fluid {
  max-width: none !important;
  padding: 0 !important;
}

body.page-portal a {
  color: inherit;
}

body.page-portal h1,
body.page-portal h2,
body.page-portal h3,
body.page-portal h4,
body.page-portal h5,
body.page-portal h6,
body.page-portal p {
  margin: 0;
}

/* Device quota line -------------------------------------------------------
   Replaces the unlink disclosure (queue 28): a password field and a red
   destructive button used to sit permanently open under the device list.
   Each device card now carries its own "Unlink" button (.btn-device-unlink,
   styled with the other danger buttons above — NOT .unlink-btn, which
   dashboard.css already claims with a conflicting `width: 100%`), and this
   line shows the remaining monthly quota fetched from the server. */
.portal-unlink-note {
  font-size: 12px;
  line-height: 1.55;
  color: var(--pr-text-3, #94a3b8);
  margin: 10px 0 14px !important;
}

/* ── Empty states ───────────────────────────────────────────────────────
   A signed-in customer with nothing to show used to get two long sentences
   left-aligned in a card. An empty state is a layout problem, not a copy
   problem: an icon to say what kind of nothing this is, one short line, and
   the single action that resolves it.

   Deliberately not a component per screen — the no-plan state, the
   remote-control-off state and anything similar share this. */
.pr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 28px;
  gap: 4px;
}

.pr-empty__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: var(--pr-accent-dim);
  border: 1px solid var(--pr-accent-border);
  color: var(--pr-accent);
}
.pr-empty__icon svg { width: 26px; height: 26px; }

/* Muted variant for states that are informational rather than actionable. */

.pr-empty__title {
  font-size: 17px;
  font-weight: 650;
  color: var(--pr-text);
  margin: 0;
  letter-spacing: -0.01em;
}

.pr-empty__text {
  font-size: 13.5px;
  color: var(--pr-text-2);
  margin: 0;
  max-width: 34ch;          /* keeps it one or two short lines, never a wall */
  line-height: 1.55;
}

.pr-empty__actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Two secondary lines, ranked: the reassurance first (it answers "did my
   payment work?"), then the identity, which is the least urgent thing here. */
.pr-empty__hint {
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--pr-text-2);
  max-width: 34ch;
}

.pr-empty__meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--pr-text-3);
}
.pr-empty__meta strong { color: var(--pr-text-2); font-weight: 600; }

@media (max-width: 560px) {
  .pr-empty { padding: 34px 18px; }
  .pr-empty__icon { width: 50px; height: 50px; border-radius: 14px; }
  .pr-empty__icon svg { width: 23px; height: 23px; }
  .pr-empty__title { font-size: 16px; }
  .pr-empty__actions { width: 100%; flex-direction: column; }
  .pr-empty__actions > * { width: 100%; }
}

/* ── Inline notices ─────────────────────────────────────────────────────
   A coloured sentence floating under a control reads as an error even when
   it is not. Give it a row, an icon and a tint so its severity is legible
   before the text is. */
.pr-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--pr-radius-sm);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--pr-text-2);
  background: rgba(139,146,158,0.08);
  border: 1px solid var(--pr-border);
}
.pr-notice strong { color: var(--pr-text); font-weight: 600; }
.pr-notice__icon { flex-shrink: 0; display: inline-flex; margin-top: 1px; }
.pr-notice__icon svg { width: 15px; height: 15px; }

.pr-notice--warn {
  background: var(--pr-warn-dim);
  border-color: var(--pr-warn-border);
}
.pr-notice--warn .pr-notice__icon { color: var(--pr-warn); }
.pr-notice--warn strong { color: var(--pr-warn); }

/* Secondary detail inside a helper line — the limit, the caveat, the count. */

/* ── Mobile density ─────────────────────────────────────────────────────
   Measured on a 390px viewport: the dashboard spent roughly a fifth of the
   first screen on gaps. Three causes, all of them invisible on desktop where
   there is room to spare:

     1. `.plan-card` carries an inline `margin-top: 32px` — inside a card that
        already has its own padding, so the gap was 32 + 14 before any content.
        Inline styles need !important to beat, which is why this is here and
        not a tidier rule.
     2. Cards nest. An outer .portal-card at 14px wrapping an inner .plan-card
        at 14px spends 28px of a 390px screen on chrome twice over.
     3. The page heading and its subtitle were separated from the first card by
        ~60px, which is a desktop rhythm applied to a phone.

   Desktop spacing is deliberately untouched — it reads correctly there. */
@media (max-width: 560px) {
  /* 1 — the inline margin */
  .plan-card { margin-top: 12px !important; margin-bottom: 12px !important; }

  /* 2 — do not pay for the same padding twice when cards nest */
  .portal-card > .plan-card { padding: 12px !important; }
  .portal-card:has(> .plan-card) { padding: 10px !important; }

  /* 3 — pull the first card up under the heading. Measured: the 36px gap was
     .portal-welcome's 20px margin plus .portal-content's 16px flex gap, which
     stack. Both are right on desktop. */
  .portal-welcome { margin-bottom: 8px !important; }
  .portal-content { gap: 12px !important; }
  .portal-welcome-sub { margin-top: 2px !important; }

  /* The bottom-bar reservation used to be repeated here as
     `padding-bottom: 76px !important`, sized for a 56px bar sitting flush
     against the edge. The bar floats now, so that number was wrong — and
     because it carried !important it silently beat the rule that owns this,
     which made changing the real one look like it did nothing.
     One source: `body.page-portal.has-bottom-nav .portal-content-scroll`. */

  /* The section label sat on its own line with a lot of air under it. */
  .portal-section-label { margin-bottom: 8px !important; }
}

/* ══ Motion ════════════════════════════════════════════════════════════
   The rule, borrowed from Discord: motion confirms an action, it never
   announces one. So everything here is under 160ms, moves less than 2px,
   and only animates transform/opacity — properties the compositor owns,
   so none of it can trigger a layout.

   The press state is the one that was actually missing. There was not a
   single `:active` rule in this stylesheet, which on a phone means a tap
   gives no feedback at all until the network answers; on a slow request
   that reads as a dead button and people tap it again.

   Hover lifts are only on things that are genuinely clickable. A card
   that lifts under the cursor but does nothing when clicked is a lie.  */

:root {
  --pr-press: 90ms;                          /* press must beat perception */
  --pr-ease:  cubic-bezier(0.2, 0, 0.2, 1);  /* fast out, gentle in */
}

.btn, .btn-primary, .btn-secondary, .btn-outline, .btn-portal-outline,
.btn-danger, .btn-google, .btn-sm, .download-btn,
.btn-settings, .btn-settings-primary, .btn-settings-secondary,
.btn-settings-cancel, .btn-settings-danger, .btn-sidebar-download,
.btn-sidebar-logout, .btn-sign-out, .btn-switch, .btn-license-unlink,
.sidebar-nav-item, .portal-bottom-nav-item, .machine-card, .settings-tab {
  transition: background var(--pr-speed) var(--pr-ease),
              border-color var(--pr-speed) var(--pr-ease),
              color var(--pr-speed) var(--pr-ease),
              transform var(--pr-press) var(--pr-ease);
}

/* Hover: the pointer-only half. `@media (hover: hover)` keeps it off
   touch screens, where :hover sticks after a tap and leaves a button
   looking pressed until you tap something else. */
@media (hover: hover) {
  .machine-card:hover { transform: translateY(-1px); }
}

/* Press. Declared after :hover so a click on a hovered card wins. */
.btn:active, .btn-primary:active, .btn-secondary:active,
.btn-outline:active, .btn-portal-outline:active,
.btn-danger:active, .btn-google:active, .btn-sm:active, .download-btn:active,
.btn-settings:active,
.btn-settings-primary:active, .btn-settings-secondary:active,
.btn-settings-cancel:active, .btn-settings-danger:active,
.btn-sidebar-download:active, .btn-sidebar-logout:active,
.btn-sign-out:active, .btn-switch:active, .btn-license-unlink:active {
  transform: scale(0.97);
}
.machine-card:active,
.sidebar-nav-item:active,
.portal-bottom-nav-item:active { transform: scale(0.985); }

/* A disabled control must not pretend to respond. */
.btn-primary:disabled:active, .btn-outline:disabled:active,
.btn-danger:disabled:active, .btn-settings-primary:disabled:active,
[disabled]:active { transform: none; }

/* ── The kill switch ──────────────────────────────────────────────────
   Nothing in this stylesheet honoured prefers-reduced-motion before, so
   the spinner and the modal slide played regardless of the OS setting
   (toasts are now the shared static/css/toast.css, which carries its own
   equivalent block). Animations are reduced to a single frame rather than
   removed, because `animation: none` on a keyframe that sets the final
   state (modalFadeIn ends at opacity 1) would leave the element invisible. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── The sign-in card, shared with the organization portal ────────
   The two sign-ins are one page wearing different words, so these rules
   restate what templates/org/login_org.html declares inline. That page is
   standalone — it loads no stylesheet from here — so a change to either
   belongs in both. The values below are the organization page's, which is
   the look that was chosen; everything is scoped to .login-card so the rest
   of the user portal keeps its own surface and its own accent.

   --pr-accent is the portal's blue and stays the portal's blue. The sign-in
   uses the product accent instead, which is what the org page, the store and
   every marketing surface already use. */
.login-card {
  --login-accent: #00d4ff;
  background: #0a0f23 !important;
  border: 1px solid #1a2040 !important;
  border-radius: 16px !important;
  padding: 40px !important;
}

/* Full width, product accent, dark label — not the portal's inline blue
   pill, which read as a different product beside the org form. */
.login-card .btn-primary {
  width: 100% !important;
  padding: 12px !important;
  background: var(--login-accent) !important;
  color: #050914 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
}

.login-card .btn-primary:hover:not(:disabled) {
  background: #0099cc !important;
  color: #050914 !important;
  opacity: 1 !important;
}

.login-card .btn-google {
  padding: 10px !important;
  background: transparent !important;
  border: 1px solid #1a2040 !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  font-size: 14px !important;
}

.login-card .btn-google:hover { background: rgba(255, 255, 255, 0.05) !important; }

/* Fields: the organization page's metrics, restated. Measured, not guessed —
   the two differed by 2px of padding, 2px of radius, half a point of type and
   a field background, which is exactly the kind of gap that reads as "not the
   same page" without being nameable. */
.login-card .form-group input,
.login-card .pw-wrap input {
  padding: 10px 14px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  background: #050914 !important;
  border: 1px solid #1a2040 !important;
}

.login-card .form-group label { letter-spacing: 0.5px !important; }

/* "or", not "OR": the org page's divider is lower case and unspaced. */
.login-card .divider span {
  text-transform: none !important;
  letter-spacing: normal !important;
  font-size: 12px !important;
}

/* At 390px the portal card ran edge to edge while the org card kept 20px of
   air, so the same card looked like two different widths. */
@media (max-width: 460px) {
  .login-container { padding-left: 20px; padding-right: 20px; }
}

.login-card .form-group input:focus,
.login-card .pw-wrap input:focus {
  border-color: var(--login-accent) !important;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1) !important;
}

/* Verification code cells, in the sign-in card's own palette.
   These live here rather than beside the rest of the .otp-cells rules because
   `.login-card .form-group input` above sets background and border !important
   and wins on both specificity and order — styling the cells anywhere else
   left them painted the PAGE background (#050914) on a #0a0f23 card, which is
   what made six inputs look like six holes punched in the card. */
.login-card .otp-cells .otp-cell {
  padding: 0 !important;
  border-radius: 10px !important;
  background: #0d1430 !important;
  border: 1px solid #263258 !important;
  color: #e8edf5 !important;
  caret-color: var(--login-accent);
}

/* There is no caret to follow across six separate boxes, so the live cell has
   to be unmistakable. */
.login-card .otp-cells .otp-cell:focus {
  background: #0a1030 !important;
  border-color: var(--login-accent) !important;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.14) !important;
}

/* Entered digits read as settled without competing with the focused cell. */
.login-card .otp-cells .otp-cell.is-filled {
  border-color: #3d4d80 !important;
}

/* "Code sent" is a confirmation, not an alert. At full-strength green it was
   the loudest element on a step whose actual subject is the six cells above
   it, so it is muted to sit beneath them in the reading order. */
.login-card .otp-group + .status-msg.success { color: #4ade80 !important; opacity: 0.72; }
.login-card .otp-group + .status-msg.error   { opacity: 1; }

.login-card .login-brand span em,
.login-card .login-footer a { color: var(--login-accent); }

/* The captcha is 302px wide and the card is not: unconstrained it decides
   the card's width on a 390px screen and pushes the whole layout sideways. */
.login-card .h-captcha {
  display: flex;
  justify-content: center;
  transform-origin: center;
  overflow: hidden;
}

/* The page behind the card, not just the card. The portal's own background is
   #0d0f14 and the organization page's is #050914, so switching sides changed
   the whole backdrop — the single most visible difference left, and the one
   that made the two sign-ins read as two products. Scoped to .page-login so
   the portal's other pages keep theirs. */
body.page-login {
  background: #050914 !important;
}

/* The captcha widget is a fixed 302px. At 390px the card's 40px padding left
   only 268px of content, so it was clipped on both edges. Trimming the padding
   on small screens buys 310px, which fits it; below 380px it is scaled instead,
   because there is no padding left to give. Both sign-ins carry this rule. */
@media (max-width: 460px) {
  .login-card { padding: 28px 20px !important; }
}

@media (max-width: 380px) {
  .login-card .h-captcha { transform: scale(0.9); }
}

/* ==========================================================================
   SERVICE TRAY — the same shape the desktop app's Settings uses
   ==========================================================================
   Connections were a flat list: one row per provider, each carrying its own
   Connect or Disconnect. That reads as a table of things you mostly do not
   have, and it puts "connect this" and "here is what you have" in the same
   undifferentiated stack.

   Split, matching desktop-app/src/core/web/js/connections.js: a tray of every
   provider up top, marked where you are already linked, and a card per live
   connection underneath. Two surfaces, one design — a user who sets Drive up
   in the app and then opens the portal should recognise the screen.

   Written against the --pr-* tokens rather than the app's, because the two
   sites have different palettes and copying hex values across is how they
   drift apart. */

.pr-svc-section + .pr-svc-section {
  margin-top: 26px;
}

.pr-svc-head {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--pr-text-3);
  margin-bottom: 12px;
}

.pr-svc-tray {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}

.pr-svc-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 104px;
  min-height: 86px;
  padding: 14px 8px 12px;
  border-radius: var(--pr-radius);
  border: 1px solid var(--pr-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--pr-text-2);
  font: inherit;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.pr-svc-tile:hover {
  border-color: var(--pr-border-mid);
  background: rgba(255, 255, 255, 0.05);
  color: var(--pr-text);
}

.pr-svc-tile:focus-visible {
  outline: 2px solid var(--pr-accent);
  outline-offset: 2px;
}

.pr-svc-tile svg {
  width: 26px;
  height: 26px;
}

.pr-svc-tile-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

/* Dimmed, not removed. A tray whose tiles disappear as you connect them
   changes shape under the cursor, and "where did Dropbox go" is a worse
   question than "why is that one green". */
.pr-svc-tile.is-on {
  border-color: var(--pr-ok-border);
  background: var(--pr-ok-dim);
  color: var(--pr-text);
}

.pr-svc-tile.is-warn {
  border-color: var(--pr-warn-border);
  background: var(--pr-warn-dim);
  color: var(--pr-text);
}

.pr-svc-tile-mark {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--pr-ok);
  color: #06281a;
}

.pr-svc-tile.is-on .pr-svc-tile-mark,
.pr-svc-tile.is-warn .pr-svc-tile-mark {
  display: flex;
}

.pr-svc-tile.is-warn .pr-svc-tile-mark {
  background: var(--pr-warn);
  color: #2a1a00;
}

.pr-svc-tile-mark svg {
  width: 9px;
  height: 9px;
}

/* ── the connected cards ─────────────────────────────────────────────── */

.pr-svc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pr-svc-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--pr-border);
  border-radius: var(--pr-radius);
  background: rgba(255, 255, 255, 0.02);
}

.pr-svc-card.is-warn {
  border-color: var(--pr-warn-border);
  background: var(--pr-warn-dim);
}

.pr-svc-card-icon {
  flex: 0 0 auto;
  color: var(--pr-text-2);
}

.pr-svc-card-icon svg {
  width: 26px;
  height: 26px;
}

.pr-svc-card-body {
  flex: 1 1 auto;
  min-width: 0;
}

.pr-svc-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.pr-svc-card-name {
  color: var(--pr-text);
  font-weight: 600;
  font-size: 15px;
}

/* A dot AND a word: colour alone is unreadable to a colourblind user and
   survives no screenshot. */
.pr-svc-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--pr-text-2);
}

.pr-svc-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.pr-svc-dot.is-ok { color: var(--pr-ok); }
.pr-svc-dot.is-warn { color: var(--pr-warn); }

.pr-svc-card-sub {
  font-size: 13px;
  color: var(--pr-text-2);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pr-svc-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.pr-svc-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--pr-radius-sm);
  background: rgba(245, 158, 11, 0.1);
  color: var(--pr-warn);
  font-size: 12px;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.pr-svc-empty {
  font-size: 13px;
  color: var(--pr-text-2);
  line-height: 1.6;
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed var(--pr-border-mid);
  border-radius: var(--pr-radius);
}

@media (prefers-reduced-motion: reduce) {
  .pr-svc-tile { transition: none; }
}

/* ── Render Notifications card ─────────────────────────────────────────
   Loading state, empty state, mark-all control and row layout for
   #portal-notifications in portal.html. Previously all of this was inline
   style on the elements themselves (including an `!important` on the
   mark-all button), which is exactly what made the card read as bolted on
   rather than part of the portal. Moved here so it can share the portal's
   own tokens instead of restating colours by hand. */

.pr-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

/* A real secondary control, not a tiny outline pill: same family as
   .btn-portal-outline but sized down just enough to sit in a card header
   next to an h6, rather than the 11px/4px pair that made it look tacked on. */
.btn-notif-mark-read {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 6px 12px;
  background: var(--pr-surface-2);
  border: 1px solid var(--pr-border-mid);
  color: var(--pr-text-2);
  border-radius: var(--pr-radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--pr-font);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--pr-speed), border-color var(--pr-speed), color var(--pr-speed);
}

.btn-notif-mark-read:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.18);
  color: var(--pr-text);
}

.btn-notif-mark-read[hidden], .btn-settings[hidden] {
  display: none !important;
}

.pr-notif-list {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Round two. The first pass (above the list rules) fixed the load, the empty
   state and the mark-all control; the owner rejected the ROWS themselves —
   "a title like 'Render complete' stacked over a grey line that says
   'render complete' again, then the filename." Two problems in one shape:
   the status word was said twice (the row title AND the meta line both led
   with it), and the filename — the thing a user actually scans a
   notification list for — was demoted to the end of the second line.

   New shape: the status is carried ONCE, by a coloured icon roundel (not
   text), so removing the left-border colour key stops being a second,
   competing way of saying the same thing. The filename leads the row in
   its own bold line; the notification's own description sits under it,
   only once, in place of the "render complete • filename" meta line that
   repeated the icon's job in words. The timestamp is relative ("2 hours
   ago") with the exact value in a native title= tooltip, not a raw
   "2026-09-19 14:02" string sitting in the corner. */
.pr-notif-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--pr-border);
  border-radius: var(--pr-radius-sm);
  background: var(--pr-surface-2);
}

.pr-notif-row.is-unread {
  background: var(--pr-accent-dim);
}

/* The status roundel is now the ONLY thing keyed to data-status — there is
   no second, redundant left-border colour doing the same job. */
.pr-notif-row-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-top: 1px;
}

.pr-notif-row[data-status="success"] .pr-notif-row-icon {
  background: var(--pr-ok-dim);
  color: var(--pr-ok);
}

.pr-notif-row[data-status="failed"] .pr-notif-row-icon {
  background: var(--pr-danger-dim);
  color: var(--pr-danger);
}

.pr-notif-row-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pr-notif-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

/* The filename leads — it is what a user scans this list for, not the
   status word (the icon already said that) and not the generic title. */
.pr-notif-row-file {
  font-size: 13px;
  color: var(--pr-text);
  font-weight: 600;
  min-width: 0;
  /* Long filenames wrap instead of clipping or forcing the row wider than
     the card — a single unbroken token like a long .blend name included. */
  overflow-wrap: anywhere;
}

.pr-notif-row-time {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--pr-text-3);
  white-space: nowrap;
  margin-top: 1px;
  cursor: default;
}

/* The notification's own description, shown exactly once — this replaced a
   meta line that opened with the status word again ("render complete •
   ..."), which is the repetition the owner was reacting to. */
.pr-notif-row-desc {
  font-size: 12px;
  color: var(--pr-text-2);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Loading state: three server-rendered rows shaped like real ones (icon
   roundel + two text lines), so the card is never an empty box while the
   fetch is in flight and does not change shape again once it resolves.
   Bars shimmer left-to-right; prefers-reduced-motion already zeroes every
   animation duration globally (see the kill switch above), so this
   degrades to a static bar with no extra rule needed. */
.pr-notif-skeleton {
  background: var(--pr-surface-2);
}

.pr-notif-skel-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-top: 1px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.06) 25%,
    rgba(255,255,255,0.14) 37%,
    rgba(255,255,255,0.06) 63%);
  background-size: 400% 100%;
  animation: pr-notif-shimmer 1.4s ease-in-out infinite;
}

.pr-notif-skel-bar {
  display: block;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.06) 25%,
    rgba(255,255,255,0.14) 37%,
    rgba(255,255,255,0.06) 63%);
  background-size: 400% 100%;
  animation: pr-notif-shimmer 1.4s ease-in-out infinite;
}

.pr-notif-skel-title { width: 42%; }
.pr-notif-skel-time  { width: 15%; flex: 0 0 auto; }
.pr-notif-skel-meta  { width: 65%; margin-top: 8px; }

@keyframes pr-notif-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* Empty and error states share one dashed-box treatment, matching
   .pr-svc-empty elsewhere in this stylesheet rather than inventing a
   second "nothing here" look. Two DIFFERENT empty states now exist (queue
   30 round two, job 3): a plain "nothing yet" and a "you have not turned
   this on" pointer at the desktop app. Same box, an accent border on the
   setup variant is the only visual difference — it is a nudge toward an
   action, not an error. */
.pr-notif-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--pr-text-2);
  line-height: 1.6;
  margin: 0;
  padding: 20px 16px;
  border: 1px dashed var(--pr-border-mid);
  border-radius: var(--pr-radius);
  text-align: center;
  justify-content: center;
}

.pr-notif-empty-error {
  color: var(--pr-danger);
  border-color: var(--pr-danger-border);
}

.pr-notif-empty-setup {
  border-color: var(--pr-accent-border);
  color: var(--pr-text);
}

.pr-notif-empty-setup i {
  color: var(--pr-accent);
}

/* Deliberately NOT flex-wrap: wrap at narrow widths. Letting the time wrap
   made the row order inconsistent: a short filename kept the timestamp on
   the first line, a long one pushed it onto its own line BETWEEN the
   filename and the description, so two rows in the same list read in a
   different order. The filename shrinks and wraps inside its own column
   (min-width:0 + overflow-wrap:anywhere) and "21 hours ago" always fits, so
   the timestamp stays pinned top-right at every width. */
.pr-notif-row-top { flex-wrap: nowrap; }

/* The empty states centre an icon beside their text. That reads fine while
   the text is one line, but at phone width the message wraps to three and
   centring the PAIR leaves the icon stranded against the left edge beside a
   paragraph. Stack it above the text instead once there is not room for
   both on a line. */
@media (max-width: 560px) {
  .pr-notif-empty {
    flex-direction: column;
    gap: 10px;
  }
}

/* No local prefers-reduced-motion rule needed here: the stylesheet's global
   kill switch (`*, *::before, *::after { animation-duration: 0.01ms
   !important; ... }`, see above) already zeroes .pr-notif-skel-icon and
   .pr-notif-skel-bar the same way it already covered the old skeleton. */

/* ── Device cards ────────────────────────────────────────────────────────
   Was built from inline styles inside _renderDeviceCards, which is how it
   ended up with the gap the owner spotted: the row was space-between, the
   left block did not grow, and the "This device" badge sat marooned in the
   middle of the row whenever the machine name wrapped to a second line.
   The name and the badge belong together and wrap together; the button is
   pinned to the right edge with no dead space in front of it. */
.pr-device-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--pr-border);
  border-radius: var(--pr-radius-sm, 8px);
  margin-bottom: 10px;
  background: var(--pr-surface-2);
}
.pr-device-card-info { flex: 1 1 auto; min-width: 0; }
/* The title line wraps as a unit, so the badge follows the name instead of
   being pushed away from it. */
.pr-device-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}
.pr-device-card-meta {
  color: var(--pr-text-2);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.pr-device-card .btn-device-unlink { flex: 0 0 auto; }

.pr-device-empty {
  color: var(--pr-text-2);
  font-size: 13px;
  text-align: center;
  padding: 20px;
  border: 1px dashed var(--pr-border);
  border-radius: var(--pr-radius-sm, 8px);
}

/* ── Dashboard plan card: compact hero (owner approved option A) ───── */
.plan-hero { display: flex; align-items: center; gap: 14px; }
.plan-hero__icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; object-fit: contain; }
/* The plan card sits inside #licenses-section, which already pads it. */
#licenses-section > .plan-card {
  margin: 0 !important; padding: 0 !important; border: 0 !important;
  background: none !important; box-shadow: none !important;
}
#licenses-section > .portal-account-actions { margin-bottom: 0 !important; }
@media (max-width: 480px) { .plan-hero { align-items: flex-start; } }
.plan-hero__main { min-width: 0; }
.plan-hero__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.plan-hero__name { font-size: 17px; font-weight: 700; color: var(--pr-text); }
.plan-hero__sub { margin-top: 3px; font-size: 13px; color: var(--pr-text-2); }

/* Two equal buttons side by side; stacked with a gap on phones. */
.plan-actions { display: flex; gap: 10px; }
.plan-actions > a { flex: 1 1 0; min-width: 0; }
@media (max-width: 480px) {
  .plan-actions { flex-direction: column; }
}
