:root {
  --bg-base:      #080c12;
  --bg-surface:   #0d1320;
  --bg-raised:    #111827;
  --bg-hover:     #16202f;
  --bg-active:    #1a2840;
  --border:       #1e2d42;
  --border-hover: #2d4460;
  --border-focus: #3b82f6;
  --text-primary: #e2eaf5;
  --text-muted:   #6b84a0;
  --text-faint:   #3d5168;
  --accent:       #3b82f6;
  --accent-dim:   #1d3d6f;
  --accent-glow:  rgba(59,130,246,0.15);
  --cert:         #f59e0b;
  --cert-dim:     #6b3d0a;
  --danger:       #ef4444;
  --danger-dim:   #5a1b1b;
  --success:      #22c55e;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --sidebar-w: 220px;
  --topbar-h:  56px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { font-family: var(--sans); background: var(--bg-base); color: var(--text-primary); font-size: 14px; line-height: 1.5; height: 100%; display: flex; overflow: hidden; }
a { text-decoration: none; color: inherit; cursor: pointer; }
button { font-family: var(--sans); }
input, textarea, select { font-family: var(--sans); font-size: 13px; color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; outline: none; transition: border-color 0.15s; }
input:focus, textarea:focus { border-color: var(--border-focus); }
input:disabled { opacity: 0.45; cursor: default; }
textarea { resize: vertical; line-height: 1.5; }
.sidebar { width: var(--sidebar-w); min-width: var(--sidebar-w); height: 100vh; background: var(--bg-surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; transition: transform 0.2s ease; }
.sidebar.collapsed { transform: translateX(-100%); }
.main-wrap { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; transition: margin-left 0.2s ease; }
.main-wrap.full { margin-left: 0; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 16px 14px 14px; border-bottom: 1px solid var(--border); }
.brand-mark { width: 36px; height: 36px; background: var(--accent-dim); border: 1px solid var(--accent); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: var(--accent); letter-spacing: 0.05em; flex-shrink: 0; }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: 0.03em; }
.brand-tag { display: block; font-size: 9px; letter-spacing: 0.12em; color: var(--text-muted); text-transform: uppercase; margin-top: 1px; }
.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.nav-section-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); padding: 6px 8px 4px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.1s, color 0.1s; margin-bottom: 1px; user-select: none; }
.nav-item svg { width: 15px; height: 15px; fill: currentColor; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-coming { opacity: 0.4; cursor: default; }
.nav-coming:hover { background: none; color: var(--text-muted); }
.badge-soon { margin-left: auto; font-size: 9px; background: var(--bg-raised); border: 1px solid var(--border); color: var(--text-faint); padding: 1px 5px; border-radius: 20px; letter-spacing: 0.06em; text-transform: uppercase; }
.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--border); }
.plan-badge { display: flex; align-items: center; gap: 10px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.plan-icon { font-size: 18px; }
.plan-name { font-size: 12px; font-weight: 600; }
.plan-upgrade { font-size: 11px; color: var(--accent); display: block; margin-top: 2px; }
.topbar { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--bg-surface); position: sticky; top: 0; z-index: 50; flex-shrink: 0; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.sidebar-toggle { background: none; border: none; color: var(--text-muted); padding: 4px; cursor: pointer; border-radius: var(--radius-sm); display: flex; align-items: center; }
.sidebar-toggle:hover { color: var(--text-primary); background: var(--bg-hover); }
.breadcrumb { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.service-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); background: var(--bg-raised); border: 1px solid var(--border); border-radius: 20px; padding: 5px 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.status-dot.ok   { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.warn { background: var(--cert); }
.status-dot.err  { background: var(--danger); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-dim); border: 1px solid var(--accent); color: var(--accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.view { display: none; flex: 1; overflow-y: auto; padding: 28px 28px 40px; }
.view.active { display: block; }
.view-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.view-header h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.view-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: background 0.12s, opacity 0.12s; white-space: nowrap; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2563eb; }
.btn-ghost { background: var(--bg-raised); color: var(--text-primary); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--border-hover); }
.btn-cert { background: var(--cert); color: #000; font-weight: 700; }
.btn-cert:hover:not(:disabled) { background: #d97706; }
.btn-danger { background: var(--danger-dim); color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover:not(:disabled) { background: #7f1d1d; }
.full-w { width: 100%; justify-content: center; margin-top: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.stat-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 18px; }
.stat-accent { border-color: var(--cert-dim); background: linear-gradient(135deg, var(--bg-surface), #1a140a); }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-header h2 { font-size: 15px; font-weight: 600; }
.doc-table-wrap { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.doc-table { width: 100%; border-collapse: collapse; }
.doc-table thead tr { background: var(--bg-raised); border-bottom: 1px solid var(--border); }
.doc-table th { padding: 10px 14px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); text-align: left; }
.doc-table td { padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
.doc-table tr:last-child td { border-bottom: none; }
.doc-table tbody tr:hover td { background: var(--bg-hover); cursor: pointer; }
.empty-row { color: var(--text-muted); text-align: center; padding: 32px !important; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.badge-certified { background: var(--cert-dim); color: var(--cert); border: 1px solid var(--cert-dim); }
.badge-draft     { background: var(--bg-raised); color: var(--text-muted); border: 1px solid var(--border); }
.badge-archived  { background: #1a1025; color: #8b5cf6; border: 1px solid #3b1f6b; }
.doctrine-block { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-top: 28px; }
.doctrine-title { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px; }
.doctrine-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.doctrine-item { display: flex; gap: 12px; align-items: flex-start; }
.doctrine-icon { font-size: 18px; color: var(--accent); margin-top: 1px; flex-shrink: 0; }
.doctrine-name { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.doctrine-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.search-input { width: 240px; background: var(--bg-raised); }
.editor-layout { display: grid; grid-template-columns: 200px 1fr 200px; gap: 14px; align-items: start; }
.editor-sidebar { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; position: sticky; top: 80px; }
.editor-sidebar-head { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
.editor-doc-list { display: flex; flex-direction: column; gap: 4px; max-height: 400px; overflow-y: auto; }
.editor-doc-item { padding: 8px 10px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; border: 1px solid transparent; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.editor-doc-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.editor-doc-item.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-dim); }
.editor-main { display: flex; flex-direction: column; gap: 14px; }
.editor-props { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 80px; }
.editor-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.editor-card-title { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.draft-only-label { font-size: 10px; background: var(--bg-raised); border: 1px solid var(--border); color: var(--text-faint); padding: 2px 6px; border-radius: 4px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-group label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.field-input { width: 100%; }
.field-textarea { width: 100%; min-height: 80px; }
.field-hint { font-size: 11px; color: var(--text-faint); margin-top: 8px; line-height: 1.5; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.prop-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--border); gap: 8px; }
.prop-row:last-child { border-bottom: none; }
.prop-label { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.prop-value { font-size: 12px; text-align: right; word-break: break-all; }
.prop-value.mono { font-family: var(--mono); }
.prop-value.small { font-size: 10px; }
.cert-badge-area { margin-top: 12px; }
.cert-panel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cert-op-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; transition: border-color 0.15s; }
.cert-op-card:hover { border-color: var(--border-hover); }
.cert-op-icon { font-size: 22px; color: var(--accent); margin-bottom: 10px; }
.cert-op-name { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.cert-op-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.trust-chain { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.chain-item { font-size: 11px; font-family: var(--mono); color: var(--text-muted); padding: 4px 8px; background: var(--bg-raised); border-radius: var(--radius-sm); display: flex; justify-content: space-between; align-items: center; }
.chain-role { font-size: 10px; color: var(--accent); letter-spacing: 0.05em; }
.vault-status-card { display: flex; align-items: center; gap: 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.vault-icon { font-size: 28px; }
.vault-state { font-size: 15px; font-weight: 600; }
.vault-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.price-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; position: relative; }
.price-featured { border-color: var(--accent); background: linear-gradient(160deg, var(--bg-surface), #0d1f3c); }
.price-sovereign { border-color: var(--cert-dim); background: linear-gradient(160deg, var(--bg-surface), #1a1005); }
.price-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.price-tier { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.price-amount { font-size: 32px; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 18px; }
.price-amount span { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.price-features { list-style: none; margin-bottom: 16px; display: flex; flex-direction: column; gap: 7px; }
.price-features li { font-size: 13px; color: var(--text-primary); padding-left: 16px; position: relative; }
.price-features li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-size: 11px; }
.price-features li.dim { color: var(--text-faint); }
.price-features li.dim::before { content: '–'; color: var(--text-faint); }
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(4px); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--bg-raised); border: 1px solid var(--border-hover); border-radius: var(--radius-xl); padding: 24px; width: 420px; max-width: 94vw; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: var(--radius-sm); }
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; }
.toast-msg { background: var(--bg-raised); border: 1px solid var(--border-hover); border-radius: var(--radius); padding: 12px 16px; font-size: 13px; max-width: 340px; animation: toastIn 0.2s ease; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.toast-msg.ok   { border-left: 3px solid var(--success); }
.toast-msg.err  { border-left: 3px solid var(--danger); }
.toast-msg.warn { border-left: 3px solid var(--cert); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.mono { font-family: var(--mono); font-size: 12px; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2,1fr); } .pricing-grid { grid-template-columns: repeat(2,1fr); } .cert-panel-grid { grid-template-columns: repeat(2,1fr); } .editor-layout { grid-template-columns: 1fr; } .editor-sidebar, .editor-props { position: static; } }
@media (max-width: 720px) { .sidebar { transform: translateX(-100%); } .main-wrap { margin-left: 0; } .view { padding: 16px; } .stat-grid { grid-template-columns: 1fr 1fr; } .pricing-grid { grid-template-columns: 1fr; } .doctrine-grid { grid-template-columns: 1fr; } .cert-panel-grid { grid-template-columns: 1fr; } }

/* ─── Additional badges ─── */
.badge-active { background: #0f2a1a; color: #22c55e; border: 1px solid #14532d; }

/* ─── Word editor ─── */
.we-toolbar {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 8px; background: var(--bg-raised);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.we-btn {
  background: none; border: 1px solid transparent;
  color: var(--text-muted); padding: 4px 8px;
  border-radius: 4px; font-size: 12px; cursor: pointer;
  font-family: var(--sans);
}
.we-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
.we-sep { width: 1px; background: var(--border); margin: 2px 4px; }
.word-editor-wrap {
  background: #0a0f18;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 320px;
  padding: 0;
  overflow: hidden;
}
#wordEditor {
  min-height: 320px;
  padding: 20px 24px;
  outline: none;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-primary);
  background: transparent;
  font-family: var(--sans);
}
#wordEditor:focus { background: #080c12; }
#wordEditor .we-heading { font-size: 18px; font-weight: 700; margin: 16px 0 8px; color: var(--text-primary); }
#wordEditor .we-para { margin: 6px 0; color: var(--text-primary); }
#wordEditor .we-section { margin: 12px 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--bg-raised); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
#wordEditor .we-section-title { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
#wordEditor .we-placeholder { color: var(--text-faint); font-style: italic; }
#wordEditor h1,#wordEditor h2,#wordEditor h3 { color: var(--text-primary); margin: 12px 0 6px; }
#wordEditor p { margin: 4px 0; }
#wordEditor ul,#wordEditor ol { margin: 6px 0 6px 20px; }

/* ─── Login / Admin shells ─── */
.auth-shell {
  max-width: 420px; margin: 60px auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
}
.auth-shell h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.auth-shell .auth-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.auth-field label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.auth-field input { width: 100%; }
.auth-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.auth-link { font-size: 12px; color: var(--accent); text-align: center; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }

.admin-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 8px; }
.admin-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.admin-card-title { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.admin-stat { font-size: 28px; font-weight: 700; }
.admin-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ─── Avatar menu ─── */
#avatarWrap { position: relative; }
.avatar-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-raised);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 500;
  overflow: hidden;
}
.avatar-menu-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary);
}
.avatar-menu-item:hover { background: var(--bg-hover); }
.avatar-menu-item.danger { color: var(--danger); }
.avatar-menu-sep { border-top: 1px solid var(--border); margin: 4px 0; }

/* ─── Auth view centering fix ─── */
#view-login, #view-signup {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 24px 16px;
  box-sizing: border-box;
  position: fixed;
  top: 0; left: 0;
  background: var(--bg-base);
  z-index: 100;
}
#view-login.active, #view-signup.active { display: flex; }
.auth-shell { width: 100%; max-width: 420px; padding: 40px 36px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.4); }

/* ─── Auth shell — no sidebar, no topbar ─── */
body.auth-mode .sidebar,
body.auth-mode .topbar { display: none; }
body.auth-mode .main-wrap { margin-left: 0; }
body.auth-mode .view { padding: 0; }

/* ─── Login/signup centered card ─── */
#view-login, #view-signup {
  min-height: 100vh;
  background: var(--bg-base);
  display: none;
  align-items: center;
  justify-content: center;
}
#view-login.active, #view-signup.active {
  display: flex;
}

/* ─── Admin shell ─── */
.admin-shell {
  display: flex;
  height: 100vh;
  width: 100%;
  position: fixed;
  top: 0; left: 0;
  background: var(--bg-base);
  z-index: 200;
}
.admin-shell .main-wrap { margin-left: var(--sidebar-w); }
.admin-sidebar { border-color: var(--cert-dim); }
.admin-shell .view { display: none; overflow-y: auto; flex: 1; }
.admin-shell .view.active { display: block; }

/* ─── Auth shell logo ─── */
.auth-logo {
  width: 48px; height: 48px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: var(--accent);
  margin: 0 auto 20px;
}

/* ─── PDF Workspace ─── */
.pdf-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 60px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 20px;
  background: var(--bg-surface);
}
.pdf-dropzone:hover, .pdf-dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.pdf-drop-icon { font-size: 40px; margin-bottom: 12px; }
.pdf-drop-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.pdf-drop-sub { font-size: 13px; color: var(--text-muted); }

.pdf-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-wrap: wrap; gap: 8px;
}
.pdf-toolbar-left, .pdf-toolbar-right { display: flex; align-items: center; gap: 6px; }
.pdf-page-info {
  font-size: 12px; color: var(--text-muted);
  font-family: var(--mono); padding: 0 6px;
}
.pdf-filename {
  font-size: 12px; color: var(--text-muted);
  font-family: var(--mono); max-width: 200px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.pdf-viewer-layout {
  display: grid;
  grid-template-columns: 120px 1fr 200px;
  gap: 0;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  height: 70vh;
}

.pdf-thumbs {
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.pdf-thumb {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.15s;
  background: var(--bg-surface);
}
.pdf-thumb:hover { border-color: var(--border-hover); }
.pdf-thumb.active { border-color: var(--accent); }
.pdf-thumb canvas { width: 100%; display: block; }
.pdf-thumb-label {
  font-size: 10px; text-align: center;
  color: var(--text-faint); padding: 2px 0;
  font-family: var(--mono);
}

.pdf-canvas-wrap {
  background: #05080f;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
}
.pdf-paper {
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  background: #fff;
}
.pdf-paper canvas { display: block; }
.pdf-text-layer {
  position: absolute;
  top: 0; left: 0;
  overflow: hidden;
  opacity: 0.2;
  line-height: 1;
  pointer-events: none;
}

.pdf-props {
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  padding: 14px;
  overflow-y: auto;
}

@media (max-width: 900px) {
  .pdf-viewer-layout { grid-template-columns: 1fr; height: auto; }
  .pdf-thumbs { display: none; }
  .pdf-props { border-left: none; border-top: 1px solid var(--border); }
}

/* ─── Settings / Org ─── */
.settings-layout { display: flex; flex-direction: column; max-width: 680px; }
.settings-org-list { display: flex; flex-direction: column; gap: 8px; }
.org-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: border-color 0.15s;
}
.org-item:hover { border-color: var(--border-hover); }
.org-item.active { border-color: var(--accent); background: var(--accent-dim); }
.org-item-name { font-size: 14px; font-weight: 600; }
.org-item-slug { font-size: 11px; color: var(--text-muted); font-family: var(--mono); margin-top: 2px; }
.org-item-role { font-size: 11px; color: var(--accent); font-weight: 600; }
.org-switcher-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; }
.org-switcher-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; cursor: pointer;
  transition: border-color 0.15s;
}
.org-switcher-card:hover { border-color: var(--accent); }
.org-switcher-card.active { border-color: var(--accent); background: linear-gradient(135deg,var(--bg-surface),#0d1f3c); }
.org-switcher-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.org-switcher-slug { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.org-switcher-plan { font-size: 11px; color: var(--cert); margin-top: 6px; font-weight: 600; }

/* ─── Import drop zone ─── */
.import-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: var(--text-muted);
}
.import-drop-zone:hover, .import-drop-zone.ready {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text-primary);
}

/* ─── Auth card mobile fix ─── */
.auth-card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

#view-login, #view-signup {
  padding: 16px;
  box-sizing: border-box;
}

.auth-field input, .auth-field select {
  width: 100%;
  box-sizing: border-box;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.auth-actions .btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 15px;
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
}

.auth-switch a {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 24px 18px;
    border-radius: 12px;
  }
  .auth-logo {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
}
