/* ─────────────────────────────────────────────────────────
   TPC Client Portal — style.css
   ───────────────────────────────────────────────────────── */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:               #faf9f7;
  --surface:          #ffffff;
  --surface-2:        #f4f2ef;
  --card:             #ffffff;
  --border:           #e5e1da;
  --border-50:        rgba(229, 225, 218, 0.5);
  --foreground:       #1a1814;
  --muted:            #6b6560;
  --primary:          #7c3aed;
  --primary-hover:    #6d28d9;
  --primary-light:    #f5f0ff;
  --accent:           #f59e0b;
  --success:          #22c55e;
  --danger:           #ef4444;
  --sidebar-w:        240px;
  --topbar-h:         56px;
  --radius:           12px;
  --shadow-card:      0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-modal:     0 20px 60px rgba(0,0,0,0.18);
  font-size: 15px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif; background: var(--bg); color: var(--foreground); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── App Layout ──────────────────────────────────────────── */
.portal-app { display: flex; min-height: 100vh; }
.portal-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px 32px;
  min-height: calc(100vh - var(--topbar-h));
  max-width: 1100px;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.portal-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 200;
  transition: transform 0.25s ease;
}
.portal-sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.portal-sidebar-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; }
.portal-sidebar-title { font-weight: 700; font-size: 15px; color: var(--foreground); }

.portal-nav { list-style: none; padding: 10px 0; flex: 1; overflow-y: auto; }
.portal-nav li { margin: 2px 8px; }
.portal-nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--muted);
  cursor: pointer; transition: background 0.15s, color 0.15s;
  text-decoration: none; position: relative;
}
.portal-nav-link:hover { background: var(--surface-2); color: var(--foreground); text-decoration: none; }
.portal-nav-link.is-active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.portal-nav-icon { font-size: 16px; width: 20px; text-align: center; }
.portal-nav-badge {
  position: absolute; right: 10px;
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 20px;
}

.portal-sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.portal-signout-btn { font-size: 13px; color: var(--muted); }

/* ── Topbar ──────────────────────────────────────────────── */
.portal-topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  z-index: 100;
}
.portal-topbar-title { font-weight: 600; font-size: 15px; flex: 1; }
.portal-menu-btn { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--foreground); }
.portal-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}

/* ── Page header ─────────────────────────────────────────── */
.portal-page-header { margin-bottom: 24px; }
.portal-page-title { font-size: 24px; font-weight: 700; color: var(--foreground); }
.portal-page-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ── Cards ───────────────────────────────────────────────── */
.portal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.portal-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.portal-card-title { font-size: 16px; font-weight: 600; color: var(--foreground); }
.portal-card-sub { font-size: 12px; color: var(--muted); }

/* ── Stats ───────────────────────────────────────────────── */
.portal-stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 24px;
}
.portal-stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.portal-stat-value { font-size: 28px; font-weight: 700; color: var(--foreground); line-height: 1; }
.portal-stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Two-col layout ──────────────────────────────────────── */
.portal-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── Tab bar ─────────────────────────────────────────────── */
.portal-tab-bar { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.portal-tab {
  padding: 7px 16px; border-radius: 20px;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border); cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.portal-tab.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Activity feed ───────────────────────────────────────── */
.portal-activity-feed { display: flex; flex-direction: column; gap: 10px; }
.portal-activity-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border-50);
}
.portal-activity-row:last-child { border-bottom: none; }
.portal-activity-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.portal-activity-body { flex: 1; }
.portal-activity-text { font-size: 14px; color: var(--foreground); }
.portal-activity-sub { font-size: 12px; color: var(--muted); }
.portal-activity-time { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ── Quick actions ───────────────────────────────────────── */
.portal-quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.portal-quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--foreground); font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.portal-quick-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); text-decoration: none; }
.portal-quick-icon { font-size: 22px; }

/* ── Journey progress ────────────────────────────────────── */
.portal-journey { display: flex; flex-direction: column; gap: 12px; }
.portal-journey-item {
  background: var(--surface-2); border-radius: 8px;
  padding: 12px 14px; border: 1px solid var(--border-50);
}
.portal-journey-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.portal-journey-name { font-size: 13px; font-weight: 600; color: var(--foreground); }
.portal-journey-status { font-size: 12px; color: var(--muted); }
.portal-progress-bar-wrap { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; }
.portal-progress-bar { height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.4s; }
.portal-journey-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Orders grid ─────────────────────────────────────────── */
.portal-orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.portal-order-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s;
}
.portal-order-card:hover { border-color: var(--primary); }
.portal-order-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.portal-order-icon { font-size: 28px; }
.portal-order-meta { flex: 1; }
.portal-order-name { font-size: 14px; font-weight: 600; color: var(--foreground); }
.portal-order-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.portal-order-type-badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.portal-order-footer { display: flex; align-items: center; gap: 8px; }
.portal-order-amount { font-size: 16px; font-weight: 700; color: var(--foreground); flex: 1; }
.portal-order-status-pill { font-size: 11px; padding: 3px 8px; border-radius: 20px; background: var(--surface-2); color: var(--muted); }
.portal-order-status-pill.is-paid { background: #dcfce7; color: #15803d; }

/* ── Download modal ──────────────────────────────────────── */
.portal-download-links { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.portal-download-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-radius: 8px;
  background: var(--primary-light); color: var(--primary);
  font-weight: 600; font-size: 14px;
  border: 1px solid var(--primary);
  transition: background 0.15s;
}
.portal-download-btn:hover { background: var(--primary); color: #fff; text-decoration: none; }
.portal-download-unavailable { padding: 12px 16px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 14px; }

/* ── Messages layout ─────────────────────────────────────── */
.portal-messages-layout { display: flex; gap: 0; padding: 0; max-width: 100%; }
.portal-thread-list {
  width: 280px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}
.portal-thread-list-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.portal-thread-item {
  padding: 14px 16px; border-bottom: 1px solid var(--border-50);
  cursor: pointer; transition: background 0.12s;
}
.portal-thread-item:hover { background: var(--surface-2); }
.portal-thread-item.is-active { background: var(--primary-light); }
.portal-thread-item-subject { font-size: 14px; font-weight: 500; color: var(--foreground); }
.portal-thread-item-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

.portal-thread-detail { flex: 1; display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h)); overflow: hidden; }
.portal-thread-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; gap: 12px; color: var(--muted); font-size: 15px; }
.portal-thread-header { padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.portal-thread-subject { font-size: 16px; font-weight: 600; }
.portal-thread-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.portal-email-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.portal-email-bubble {
  max-width: 70%; padding: 12px 16px;
  border-radius: 14px; font-size: 14px; line-height: 1.55;
}
.portal-email-bubble.is-mine { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.portal-email-bubble.is-theirs { background: var(--surface-2); color: var(--foreground); align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--border); }
.portal-bubble-meta { font-size: 11px; margin-bottom: 5px; opacity: 0.7; }

.portal-reply-compose { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface); }
.portal-reply-textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; resize: vertical;
  font-family: inherit; background: var(--bg);
  color: var(--foreground);
}
.portal-reply-textarea:focus { outline: none; border-color: var(--primary); }
.portal-reply-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.portal-reply-status { font-size: 13px; color: var(--muted); }

/* ── Sessions ────────────────────────────────────────────── */
.portal-session-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border-50);
}
.portal-session-card:last-child { border-bottom: none; }
.portal-session-card.is-upcoming { background: var(--primary-light); margin: 0 -4px; padding: 14px 4px; border-radius: 8px; border-bottom: none; margin-bottom: 8px; }
.portal-session-icon { font-size: 22px; }
.portal-session-body { flex: 1; }
.portal-session-title { font-size: 14px; font-weight: 600; color: var(--foreground); }
.portal-session-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.portal-session-notes { font-size: 13px; color: var(--foreground); margin-top: 6px; background: var(--surface-2); padding: 8px 10px; border-radius: 6px; }
.portal-session-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.portal-session-amount { font-size: 15px; font-weight: 700; color: var(--foreground); }
.portal-session-status { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }

/* ── Resources grid ──────────────────────────────────────── */
.portal-resources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.portal-resource-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-card); display: flex; flex-direction: column;
  transition: border-color 0.15s;
}
.portal-resource-card:hover { border-color: var(--primary); }
.portal-resource-thumb {
  height: 140px; display: flex; align-items: center; justify-content: center;
}
.portal-resource-img { width: 100%; height: 100%; object-fit: cover; }
.portal-resource-icon { font-size: 48px; }
.portal-resource-body { padding: 12px 14px; flex: 1; }
.portal-resource-name { font-size: 14px; font-weight: 600; color: var(--foreground); }
.portal-resource-type { font-size: 12px; font-weight: 500; text-transform: capitalize; margin-top: 2px; }
.portal-resource-shared { font-size: 11px; color: var(--muted); margin-top: 4px; }
.portal-resource-dl-btn { margin: 8px 14px 14px; }

/* ── Invoices table ──────────────────────────────────────── */
.portal-table { width: 100%; border-collapse: collapse; }
.portal-table thead th {
  text-align: left; padding: 10px 12px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.04em;
}
.portal-table-cell { padding: 12px 12px; border-bottom: 1px solid var(--border-50); font-size: 14px; }
.portal-table-row:last-child .portal-table-cell { border-bottom: none; }
.portal-invoice-desc { font-weight: 500; color: var(--foreground); }
.portal-invoice-id { font-size: 11px; color: var(--muted); margin-top: 2px; }
.portal-invoice-amount { font-weight: 700; font-size: 15px; }
.portal-status-pill { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }

/* ── Auth page ───────────────────────────────────────────── */
.portal-auth-page { background: linear-gradient(135deg, #f5f0ff 0%, #faf9f7 60%, #fff8e7 100%); min-height: 100vh; }
.portal-auth-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.portal-auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 36px 32px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-modal);
}
.portal-auth-brand { text-align: center; margin-bottom: 28px; }
.portal-brand-logo { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 12px; }
.portal-auth-title { font-size: 24px; font-weight: 700; color: var(--foreground); }
.portal-auth-sub { font-size: 14px; color: var(--muted); margin-top: 6px; }
.portal-auth-footer { font-size: 12px; color: var(--muted); margin-top: 20px; }
.portal-auth-divider { text-align: center; position: relative; margin: 18px 0; }
.portal-auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.portal-auth-divider span { background: var(--surface); padding: 0 10px; position: relative; font-size: 13px; color: var(--muted); }

/* ── Form elements ───────────────────────────────────────── */
.portal-field-group { margin-bottom: 14px; }
.portal-label { display: block; font-size: 13px; font-weight: 500; color: var(--foreground); margin-bottom: 6px; }
.portal-input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; background: var(--bg); color: var(--foreground);
  font-family: inherit; transition: border-color 0.15s;
}
.portal-input:focus { outline: none; border-color: var(--primary); }
.portal-input:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Buttons ─────────────────────────────────────────────── */
.portal-btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 11px 18px; border-radius: 8px;
  background: var(--primary); color: #fff;
  font-weight: 600; font-size: 14px; border: none; cursor: pointer;
  transition: background 0.15s; margin-top: 6px;
}
.portal-btn-primary:hover { background: var(--primary-hover); }
.portal-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.portal-btn-surface {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 10px 18px; border-radius: 8px;
  background: var(--surface-2); color: var(--foreground);
  font-weight: 500; font-size: 14px; border: 1px solid var(--border); cursor: pointer;
  transition: background 0.15s; margin-top: 6px;
}
.portal-btn-surface:hover { background: var(--border); }
.portal-btn-text {
  background: none; border: none; color: var(--primary);
  font-size: 13px; cursor: pointer; padding: 0; text-decoration: underline;
}
.portal-btn-sm { width: auto; padding: 6px 14px; font-size: 13px; margin-top: 0; }

/* ── Status messages ─────────────────────────────────────── */
.portal-auth-status { font-size: 13px; color: var(--muted); margin-bottom: 6px; padding: 6px 0; text-align: center; }
.portal-auth-status.is-error { color: var(--danger); }
.portal-auth-status.is-success { color: var(--success); }

/* ── Modals ──────────────────────────────────────────────── */
.portal-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 900; padding: 20px;
}
.portal-modal {
  background: var(--surface); border-radius: 16px;
  padding: 28px 28px 24px; max-width: 480px; width: 100%;
  box-shadow: var(--shadow-modal); position: relative;
}
.portal-modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--surface-2); border: none; border-radius: 50%;
  width: 30px; height: 30px; cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.portal-modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

/* ── Loading / Empty ─────────────────────────────────────── */
.portal-loading-row { padding: 20px; text-align: center; color: var(--muted); font-size: 14px; }
.portal-empty-state {
  padding: 36px 20px; text-align: center;
  color: var(--muted); font-size: 14px; line-height: 1.7;
}

/* ── Mobile responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .portal-sidebar {
    transform: translateX(-100%);
  }
  .portal-sidebar.is-open {
    transform: translateX(0);
  }
  .portal-main {
    margin-left: 0;
    padding: 20px 16px;
  }
  .portal-topbar {
    left: 0;
  }
  .portal-menu-btn { display: block; }
  .portal-stats-row { grid-template-columns: repeat(2, 1fr); }
  .portal-two-col { grid-template-columns: 1fr; }
  .portal-messages-layout { flex-direction: column; }
  .portal-thread-list { width: 100%; height: auto; max-height: 220px; }
  .portal-email-bubble { max-width: 90%; }
  .portal-orders-grid { grid-template-columns: 1fr; }
  .portal-resources-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .portal-stats-row { grid-template-columns: 1fr 1fr; }
  .portal-resources-grid { grid-template-columns: 1fr; }
  .portal-auth-card { padding: 24px 20px; }
}

/* ── Attachment Preview Dialog ───────────────────────────── */
.portal-preview-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: stretch; justify-content: center;
  z-index: 950;
  padding: 0;
}
.portal-preview-dialog {
  background: var(--surface);
  display: flex; flex-direction: column;
  width: 100%; max-width: 900px;
  height: 100%;
  box-shadow: var(--shadow-modal);
}
@media (min-width: 768px) {
  .portal-preview-overlay { padding: 24px; align-items: center; }
  .portal-preview-dialog { height: calc(100vh - 48px); border-radius: 16px; }
}

.portal-preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}
.portal-preview-title {
  font-size: 16px; font-weight: 600; color: var(--foreground);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.portal-preview-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }
.portal-preview-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.portal-preview-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; font-size: 15px; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.portal-preview-close:hover { background: var(--border); color: var(--foreground); }

.portal-preview-body {
  flex: 1; overflow: hidden; display: flex;
  align-items: stretch; position: relative;
}
.portal-preview-iframe {
  width: 100%; height: 100%; border: none; display: block;
}
.portal-preview-image {
  max-width: 100%; max-height: 100%;
  object-fit: contain; margin: auto; display: block;
}
.portal-preview-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; flex: 1; color: var(--muted); font-size: 14px;
}
.portal-preview-unavailable {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; gap: 10px; text-align: center; padding: 40px;
  color: var(--muted); font-size: 14px;
}
.portal-preview-unavail-icon { font-size: 48px; }
.portal-preview-unavail-sub { font-size: 13px; color: var(--muted); }
.portal-preview-pdf-fallback {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; gap: 10px; text-align: center; padding: 40px;
}

/* ── Preview PDF watermark ───────────────────────────────── */
.portal-preview-frame-wrap {
  position: relative;
  width: 100%; height: 100%;
  display: flex;
}
.attach-preview-watermark {
  position: absolute;
  top: 22%; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0;
  z-index: 10;
}
.attach-preview-watermark span {
  display: block;
  width: 50%;
  padding: 60px 0;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(120, 80, 220, 0.18);
  transform: rotate(-35deg);
  user-select: none;
  white-space: nowrap;
}
