:root {
  /* Surfaces */
  --page-bg: #f5f6f8;
  --surface: #ffffff;
  --surface-subtle: #f7f8fa;
  --surface-subtle-2: #fafbfc;

  /* Text */
  --text-primary: #1c2430;
  --text-secondary: #5b6472;
  --text-secondary-2: #3a4453;
  --text-muted: #8a919e;
  --text-muted-2: #a4abb6;
  --text-muted-3: #9aa1ac;

  /* Borders */
  --border-1: #e3e6ea;
  --border-2: #e6e9ed;
  --border-3: #eef1f4;
  --border-4: #d8dde3;
  --border-5: #cfd6df;
  --border-canvas: #dfe3e8;

  /* Brand */
  --brand: #2b5d9c;
  --brand-hover: #1e4676;
  --brand-tint-bg: #eaf1f9;
  --brand-tint-border: #cfe0f2;

  /* Status */
  --valid-text: #158060;
  --valid-bg: #e4f3ec;
  --expiring-text: #c98a12;
  --expiring-text-dark: #9a6708;
  --expiring-bg: #f8efdc;
  --expired-text: #b23a2e;
  --expired-bg: #f9e8e5;

  /* Placeholder stripes */
  --stripe-a: #eef1f4;
  --stripe-b: #e2e7ec;

  --radius-card: 11px;
  --radius-card-lg: 14px;
  --radius-input: 8px;
  --radius-pill: 20px;

  --shadow-float: 0 20px 55px -26px rgba(20, 30, 50, 0.4);
  --shadow-modal: 0 24px 60px -26px rgba(20, 30, 50, 0.5);
  --shadow-hover: 0 8px 20px -12px rgba(20, 30, 50, 0.3);

  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text-primary);
  background: var(--page-bg);
}
a { color: var(--brand); text-decoration: none; cursor: pointer; }
a:hover { color: var(--brand-hover); }
button { font-family: inherit; }
img { display: block; max-width: 100%; }

.mono {
  font-family: 'IBM Plex Mono', monospace;
}

#app { min-height: 100vh; }

/* ---------- App shell / top nav ---------- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-1);
  flex-shrink: 0;
}
.topnav-left { display: flex; align-items: center; gap: 30px; }
.brand-mark { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.shield {
  width: 24px; height: 24px; flex-shrink: 0;
  background: var(--brand);
  clip-path: polygon(50% 0, 100% 18%, 100% 58%, 50% 100%, 0 58%, 0 18%);
}
.shield.sm { width: 22px; height: 22px; }
.shield.xs { width: 16px; height: 16px; }
.wordmark { font-weight: 700; letter-spacing: 0.02em; font-size: 15px; color: var(--text-primary); }
.topnav-nav { display: flex; gap: 24px; font-size: 14px; }
.topnav-nav a {
  color: var(--text-secondary);
  padding-bottom: 19px;
  margin-bottom: -20px;
  border-bottom: 2px solid transparent;
}
.topnav-nav a:hover { color: var(--brand); }
.topnav-nav a.active {
  color: var(--brand);
  font-weight: 600;
  border-bottom-color: var(--brand);
}
.topnav-right { display: flex; align-items: center; gap: 14px; }
.topnav-search {
  display: flex; align-items: center; gap: 8px;
  width: 240px; height: 36px; padding: 0 12px;
  border: 1px solid var(--border-1); border-radius: var(--radius-input);
  background: var(--surface-subtle);
  font-size: 13px; color: var(--text-muted);
}
.topnav-search input { border: none; background: transparent; outline: none; font: inherit; color: var(--text-primary); width: 100%; }
.topnav-search input::placeholder { color: var(--text-muted); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: repeating-linear-gradient(45deg, var(--stripe-a) 0 6px, var(--stripe-b) 6px 12px);
}

.page-content { flex: 1; padding: 26px 32px; background: var(--page-bg); }

.icon { width: 15px; height: 15px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.icon-sm { width: 13px; height: 13px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-outline { background: transparent; border-color: var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand-tint-bg); }
.btn-neutral-outline { background: transparent; border-color: var(--border-5); color: var(--text-secondary-2); }
.btn-neutral-outline:hover { background: var(--surface-subtle); }
.btn-danger-text { background: transparent; color: var(--expired-text); border: none; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.btn-danger-outline { background: transparent; border-color: var(--expired-text); color: var(--expired-text); }
.btn-danger-outline:hover { background: var(--expired-bg); }
.btn-tint { background: var(--brand-tint-bg); color: var(--brand); border: none; }
.btn-tint:hover { background: var(--brand-tint-border); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn {
  width: 30px; height: 30px; flex-shrink: 0;
  border: 1px solid var(--border-1); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); background: transparent; cursor: pointer;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Pills / status ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-pill);
  white-space: nowrap;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.pill.status-valid { background: var(--valid-bg); color: var(--valid-text); }
.pill.status-valid .pill-dot { background: var(--valid-text); }
.pill.status-expiring { background: var(--expiring-bg); color: var(--expiring-text-dark); }
.pill.status-expiring .pill-dot { background: var(--expiring-text); }
.pill.status-expired { background: var(--expired-bg); color: var(--expired-text); }
.pill.status-expired .pill-dot { background: var(--expired-text); }

/* ---------- Directory ---------- */
.directory-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.directory-title { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.directory-subline { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.directory-subline .ok { color: var(--valid-text); font-weight: 600; }

.filter-row { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-search {
  flex: 1; min-width: 260px; display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px; border: 1px solid var(--border-1); border-radius: 9px;
  background: var(--surface); font-size: 13px; color: var(--text-muted);
}
.filter-search input { border: none; outline: none; background: transparent; font: inherit; color: var(--text-primary); width: 100%; }
.filter-search input::placeholder { color: var(--text-muted); }
.filter-chip {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border: 1px solid var(--border-1); border-radius: 9px; background: var(--surface);
  font-size: 13px; color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}
.filter-chip select { border: none; background: transparent; font: inherit; color: inherit; cursor: pointer; outline: none; }
.filter-chip .chev { color: var(--text-muted-2); }
.filter-chip.active {
  border-color: var(--brand); background: var(--brand-tint-bg); color: var(--brand); font-weight: 600;
}

.worker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 980px) { .worker-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .worker-grid { grid-template-columns: 1fr; } }

.worker-card {
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-card);
  padding: 16px; cursor: pointer; transition: border-color 150ms ease, box-shadow 150ms ease;
}
.worker-card:hover { border-color: var(--brand); box-shadow: var(--shadow-hover); }
.worker-card-top { display: flex; gap: 13px; align-items: center; }
.photo-placeholder {
  border-radius: 9px; flex-shrink: 0;
  background: repeating-linear-gradient(45deg, var(--stripe-a) 0 7px, var(--stripe-b) 7px 14px);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted-3); font-family: 'IBM Plex Mono', monospace;
  overflow: hidden;
}
.photo-placeholder img, .badge-placeholder img { width: 100%; height: 100%; object-fit: cover; }
.worker-card-name { font-size: 15px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.worker-card-title { font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.worker-card-meta { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; letter-spacing: 0.02em; }
.worker-card-divider { height: 1px; background: var(--border-3); margin: 14px 0; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-state { padding: 60px 20px; text-align: center; color: var(--text-secondary); font-size: 14px; }

/* ---------- Profile (2A sidebar) ---------- */
.profile-breadcrumb { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text-muted); }
.profile-layout { display: flex; gap: 0; max-width: 1180px; margin: 0 auto; background: var(--surface); border-radius: var(--radius-card); border: 1px solid var(--border-2); overflow: hidden; }
@media (max-width: 800px) { .profile-layout { flex-direction: column; } }

.profile-sidebar {
  width: 300px; flex-shrink: 0; background: var(--surface-subtle);
  border-right: 1px solid var(--border-2); padding: 24px 22px;
}
@media (max-width: 800px) { .profile-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-2); } }
.profile-photo { width: 100%; height: 210px; border-radius: 10px; }
.profile-name { font-size: 21px; font-weight: 700; margin-top: 16px; letter-spacing: -0.01em; }
.profile-title { font-size: 14px; color: var(--brand); font-weight: 600; margin-top: 2px; }
.profile-dept-chip {
  display: inline-flex; margin-top: 10px; font-size: 11.5px; font-weight: 600; color: var(--text-secondary);
  background: var(--border-3); padding: 4px 10px; border-radius: 6px;
}
.profile-divider { height: 1px; background: var(--border-2); margin: 20px 0; }
.contact-block { display: flex; flex-direction: column; gap: 14px; }
.field-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--text-muted-2); letter-spacing: 0.1em; }
.field-value { font-size: 13.5px; color: var(--text-primary); margin-top: 2px; }
.field-value.mono { font-family: 'IBM Plex Mono', monospace; font-size: 13px; }
.field-value.mono.small { font-size: 12px; word-break: break-all; }

.skills-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--text-muted-2); letter-spacing: 0.1em; margin-bottom: 9px; }
.skill-chip { font-size: 11.5px; color: var(--text-secondary-2); background: var(--surface); border: 1px solid var(--border-1); padding: 4px 9px; border-radius: 6px; }
.skill-chip.on-subtle { background: var(--page-bg); }
.skill-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }

.sidebar-actions { display: flex; gap: 8px; margin-top: 22px; }
.sidebar-actions .btn { flex: 1; height: 40px; }

.profile-main { flex: 1; padding: 24px 26px; min-width: 0; }
.profile-main-header { display: flex; align-items: baseline; justify-content: space-between; }
.profile-main-header h2 { font-size: 18px; font-weight: 700; margin: 0; }
.status-summary { display: flex; gap: 8px; margin: 14px 0 20px; }
.status-tile { flex: 1; text-align: center; padding: 9px 0; border-radius: 8px; }
.status-tile .num { font-size: 18px; font-weight: 700; }
.status-tile .lbl { font-size: 10.5px; font-weight: 600; }
.status-tile.valid { background: var(--valid-bg); } .status-tile.valid .num, .status-tile.valid .lbl { color: var(--valid-text); }
.status-tile.expiring { background: var(--expiring-bg); } .status-tile.expiring .num, .status-tile.expiring .lbl { color: var(--expiring-text-dark); }
.status-tile.expired { background: var(--expired-bg); } .status-tile.expired .num, .status-tile.expired .lbl { color: var(--expired-text); }

.cert-list { display: flex; flex-direction: column; gap: 11px; }
.cert-row {
  display: flex; gap: 14px; padding: 15px;
  border: 1px solid var(--border-2); border-radius: 10px; border-left: 3px solid var(--border-2);
}
.badge-placeholder {
  border-radius: 8px; flex-shrink: 0;
  background: repeating-linear-gradient(45deg, var(--stripe-a) 0 6px, var(--stripe-b) 6px 12px);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted-3); font-family: 'IBM Plex Mono', monospace; overflow: hidden;
}
.cert-row .badge-placeholder { width: 52px; height: 52px; font-size: 8px; }
.cert-body { flex: 1; min-width: 0; }
.cert-body-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cert-name { font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.cert-issuer { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.cert-meta-row { display: flex; align-items: center; gap: 18px; margin-top: 9px; flex-wrap: wrap; }
.cert-meta { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--text-muted); }
.cert-meta span { color: var(--text-secondary-2); }
.cert-actions { margin-left: auto; display: flex; gap: 14px; font-size: 12px; font-weight: 600; }
.cert-actions .download-link { color: var(--text-secondary); }

/* ---------- Admin ---------- */
.admin-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.range-select {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border: 1px solid var(--border-1); border-radius: 8px; background: var(--surface);
  font-size: 13px; color: var(--text-secondary);
}
.range-select select { border: none; background: transparent; font: inherit; color: inherit; cursor: pointer; outline: none; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-card); padding: 18px; border-top: 3px solid var(--border-2); }
.stat-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--text-muted); letter-spacing: 0.08em; }
.stat-value { font-size: 30px; font-weight: 700; margin-top: 8px; }
.stat-note { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.admin-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; }
@media (max-width: 980px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-card { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-card); overflow: hidden; }
.admin-card-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--border-3); }
.admin-card-header h3 { font-size: 15px; font-weight: 700; margin: 0; }
.admin-card-header a { font-size: 12px; font-weight: 600; }
.admin-card-body { padding: 18px; }

.table-head, .table-row {
  display: grid; grid-template-columns: 1.4fr 1.6fr 1fr 0.9fr; align-items: center;
}
.table-head {
  padding: 10px 18px; background: var(--surface-subtle);
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--text-muted); letter-spacing: 0.06em;
}
.table-row { padding: 13px 18px; border-top: 1px solid var(--border-3); }
.table-worker { display: flex; align-items: center; gap: 9px; min-width: 0; }
.table-worker .avatar-sm { width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0; background: repeating-linear-gradient(45deg, var(--stripe-a) 0 5px, var(--stripe-b) 5px 10px); }
.table-worker-name { font-size: 13px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-cert-name { font-size: 13px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-cert-issuer { font-size: 11px; color: var(--text-muted); }
.table-expiry { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--text-secondary-2); }
.table-status { text-align: right; }

.dept-row { display: flex; flex-direction: column; gap: 15px; }
.dept-item-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.dept-item-head .name { color: var(--text-secondary-2); }
.dept-item-head .pct { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.dept-track { height: 7px; background: var(--border-3); border-radius: 20px; overflow: hidden; }
.dept-fill { height: 100%; border-radius: 20px; }

/* ---------- Edit / Create form ---------- */
.form-title { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } }
.form-card { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-card); padding: 22px; }
.form-card h3 { font-size: 15px; font-weight: 700; margin: 0 0 18px; }

.photo-upload-row { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.photo-upload-row .photo-placeholder { width: 80px; height: 80px; font-size: 9px; }
.dropzone {
  flex: 1; border: 1.5px dashed var(--border-5); border-radius: 9px; padding: 16px; text-align: center;
  background: var(--surface-subtle-2); cursor: pointer; position: relative;
}
.dropzone:hover { border-color: var(--brand); }
.dropzone .dz-title { font-size: 12.5px; color: var(--brand); font-weight: 600; }
.dropzone .dz-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone.compact { padding: 0; height: 38px; display: flex; align-items: center; justify-content: center; font-size: 11.5px; color: var(--brand); font-weight: 600; background: var(--surface); }

.field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; }
.field.span-2 { grid-column: span 2; }
.field .field-label { margin-bottom: 6px; }
.field input, .field select, .field textarea {
  height: 40px; padding: 0 12px; border: 1px solid var(--border-4); border-radius: var(--radius-input);
  background: var(--surface); font-size: 13.5px; color: var(--text-primary); font-family: inherit; outline: none;
}
.field input.mono, .field select.mono { font-family: 'IBM Plex Mono', monospace; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); }

.skills-editor {
  border: 1px solid var(--border-4); border-radius: var(--radius-input); background: var(--surface);
  padding: 10px; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; align-items: center;
}
.skill-tag { font-size: 11.5px; color: var(--text-secondary-2); background: var(--border-3); padding: 4px 9px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; }
.skill-tag button { border: none; background: none; color: var(--text-muted-2); cursor: pointer; font-size: 12px; line-height: 1; padding: 0; }
.skills-editor input { border: none; outline: none; font-size: 11.5px; color: var(--text-primary); flex: 1; min-width: 100px; background: transparent; }

.certs-editor-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.certs-editor-header h3 { margin: 0; }
.cert-editor { border: 1px solid var(--border-2); border-radius: 10px; padding: 16px; background: var(--surface-subtle-2); margin-bottom: 12px; }
.cert-editor-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cert-editor-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--text-muted); letter-spacing: 0.08em; }
.cert-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cert-editor-grid .field.span-2 { grid-column: span 2; }
.cert-editor-grid .field-label { font-size: 9.5px; margin-bottom: 5px; }
.cert-editor-grid input, .cert-editor-grid select { height: 38px; border-radius: 7px; font-size: 13px; }
.cert-editor-grid input.mono { font-size: 12.5px; }
.badge-upload-cell { display: flex; align-items: flex-end; }

/* ---------- Share dialog ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 30, 50, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.share-modal {
  width: 520px; max-width: 100%; border: 1px solid var(--border-canvas); border-radius: var(--radius-card-lg);
  background: var(--surface); box-shadow: var(--shadow-modal); overflow: hidden;
}
.share-modal-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border-3);
  display: flex; align-items: center; justify-content: space-between;
}
.share-modal-header h2 { font-size: 16px; font-weight: 700; margin: 0; }
.share-modal-header .sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.share-modal-body { padding: 22px; display: flex; gap: 22px; flex-wrap: wrap; }
.qr-block { display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; }
.qr-frame { padding: 12px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--surface); }
.qr-caption { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--text-muted); letter-spacing: 0.06em; }
.share-actions-col { flex: 1; min-width: 220px; display: flex; flex-direction: column; }
.link-row { display: flex; gap: 8px; }
.link-field {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; display: flex; align-items: center;
  border: 1px solid var(--border-4); border-radius: 8px; background: var(--surface-subtle);
  font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--brand);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.share-secondary-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.share-secondary-actions .row-btn {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-1); border-radius: 8px; font-size: 13px; color: var(--text-secondary-2);
  background: transparent; cursor: pointer; text-align: left; width: 100%;
}
.share-secondary-actions .row-btn:hover { border-color: var(--brand); color: var(--brand); }

.public-toggle-card { margin-top: 16px; padding: 12px 14px; background: var(--page-bg); border-radius: 9px; }
.public-toggle-top { display: flex; align-items: center; justify-content: space-between; }
.public-toggle-title { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.toggle { width: 34px; height: 20px; border-radius: 20px; background: var(--border-5); position: relative; cursor: pointer; border: none; padding: 0; flex-shrink: 0; transition: background 150ms ease; }
.toggle.on { background: var(--brand); }
.toggle .knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left 150ms ease; }
.toggle.on .knob { left: 16px; }
.public-toggle-help { font-size: 11.5px; color: var(--text-secondary); margin-top: 6px; line-height: 1.4; }
.link-expires { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--text-muted-2); margin-top: 12px; }
.link-expires .change-link { color: var(--brand); cursor: pointer; }

/* ---------- Public / mobile record ---------- */
.public-page { min-height: 100vh; background: var(--page-bg); display: flex; flex-direction: column; }
.public-header { background: var(--surface); padding: 24px 16px; text-align: center; border-bottom: 1px solid var(--border-3); }
.public-brand { display: flex; align-items: center; gap: 6px; justify-content: center; margin-bottom: 16px; }
.public-photo { width: 96px; height: 96px; border-radius: 14px; margin: 0 auto; }
.public-name { font-size: 20px; font-weight: 700; margin-top: 12px; }
.public-title { font-size: 13px; color: var(--brand); font-weight: 600; }
.public-body { flex: 1; max-width: 480px; margin: 0 auto; width: 100%; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.public-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.public-fact-card { background: var(--surface); border: 1px solid var(--border-3); border-radius: 9px; padding: 11px; }
.public-fact-label { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--text-muted-2); }
.public-fact-value { font-size: 13px; font-weight: 600; margin-top: 2px; }
.public-certs-heading { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--text-muted); letter-spacing: 0.08em; margin-top: 6px; }
.public-cert-card { background: var(--surface); border: 1px solid var(--border-3); border-radius: 10px; padding: 12px; border-left: 3px solid var(--border-3); }
.public-cert-top { display: flex; align-items: center; gap: 10px; }
.public-cert-top .badge-placeholder { width: 38px; height: 38px; font-size: 8px; }
.public-cert-name { font-size: 13px; font-weight: 600; line-height: 1.25; }
.public-cert-issuer { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.public-cert-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.public-footer { flex-shrink: 0; padding: 14px 16px; background: var(--surface); border-top: 1px solid var(--border-3); position: sticky; bottom: 0; max-width: 480px; margin: 0 auto; width: 100%; }
.public-unavailable { flex: 1; display: flex; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; color: var(--text-secondary); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-hover); z-index: 200;
  animation: toast-in 160ms ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.section-title-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-title-row h2 { font-size: 17px; font-weight: 700; margin: 0; }

.badge-wall-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 600px) { .badge-wall-grid { grid-template-columns: 1fr; } }

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

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Auth / login ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 380px; max-width: 100%; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-card-lg); box-shadow: var(--shadow-float); padding: 32px 30px; }
.auth-brand { display: flex; align-items: center; gap: 9px; justify-content: center; margin-bottom: 22px; }
.auth-title { font-size: 19px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.auth-sub { font-size: 13px; color: var(--text-secondary); text-align: center; margin-bottom: 24px; }
.auth-field { margin-bottom: 14px; }
.auth-error { font-size: 12.5px; color: var(--expired-text); background: var(--expired-bg); border-radius: 7px; padding: 9px 11px; margin-bottom: 14px; display: none; }
.auth-error.show { display: block; }
.topnav-user { display: flex; align-items: center; gap: 10px; }
.topnav-signout { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); cursor: pointer; background: none; border: none; font-family: inherit; }
.topnav-signout:hover { color: var(--brand); }
