/* ============================================================
   REvestors — Portal Design System
   Loaded on: /team/* pages + index.html (for .nav-login-icon)
   Public site styles (styles.css) are NOT loaded on portal pages.
   ============================================================ */

/* ── 1. Tokens ─────────────────────────────────────────────── */
:root {
  --p-primary:       #1F5C96;
  --p-primary-hover: #174878;
  --p-accent:        #CF7A1A;
  --p-accent-light:  rgba(207,122,26,0.10);
  --p-bg:            #F8F6F1;
  --p-surface:       #EDEBE2;
  --p-surface-2:     #E4E1D8;
  --p-card:          #FFFFFF;
  --p-text:          #1C2A3A;
  --p-muted:         #6B7B8D;
  --p-subtle:        #9AAABB;
  --p-border:        #D8D5CC;
  --p-border-light:  #E8E5DC;
  --p-nav-h:         48px;
  --p-sidebar-w:     210px;
  --p-tabbar-h:      56px;
  --p-radius:        10px;
  --p-radius-sm:     6px;
  --p-radius-xs:     4px;
  --p-shadow-sm:     0 1px 2px rgba(28,42,58,0.06);
  --p-shadow:        0 2px 8px rgba(28,42,58,0.08);
  --p-shadow-md:     0 4px 16px rgba(28,42,58,0.12);
  --p-ease:          cubic-bezier(0.4,0,0.2,1);
  --p-dur:           160ms;
}

body.portal-page.dark-mode {
  --p-primary:       #4A8FD4;
  --p-primary-hover: #3A7FC4;
  --p-accent:        #E8921F;
  --p-accent-light:  rgba(232,146,31,0.12);
  --p-bg:            #0F1923;
  --p-surface:       #1A2536;
  --p-surface-2:     #243045;
  --p-card:          #1A2536;
  --p-text:          #EDF2F7;
  --p-muted:         #8DA0B5;
  --p-subtle:        #5A7080;
  --p-border:        #2A3D52;
  --p-border-light:  #243045;
}

/* ── 2. Portal Page Base ───────────────────────────────────── */
body.portal-page {
  margin: 0;
  padding: 0;
  background: var(--p-bg);
  color: var(--p-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.portal-page *,
body.portal-page *::before,
body.portal-page *::after {
  box-sizing: border-box;
}

body.portal-page h1,
body.portal-page h2,
body.portal-page h3,
body.portal-page h4 {
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-weight: 700;
  color: var(--p-text);
  margin: 0 0 12px;
  line-height: 1.25;
}

body.portal-page p {
  margin: 0 0 12px;
  color: var(--p-text);
  font-family: 'Inter', sans-serif;
}

body.portal-page ul,
body.portal-page ol {
  padding-left: 20px;
  margin: 0 0 12px;
}

body.portal-page li {
  margin-bottom: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--p-text);
}

body.portal-page a {
  color: var(--p-primary);
}

.portal-skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--p-primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  text-decoration: none;
}
.portal-skip-link:focus { top: 0; }

/* ── 3. Top Navigation ─────────────────────────────────────── */
.portal-topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--p-nav-h);
  background: var(--p-primary);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 0;
}

.portal-topnav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 20px;
}

.portal-topnav-logo img {
  height: 26px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.portal-topnav-links {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  flex: 1;
}

.portal-topnav-links li { list-style: none; }

.portal-topnav-links a {
  display: flex;
  align-items: center;
  height: var(--p-nav-h);
  padding: 0 13px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  letter-spacing: 0.01em;
  border-bottom: 2px solid transparent;
  transition: color var(--p-dur) var(--p-ease),
              background var(--p-dur) var(--p-ease),
              border-color var(--p-dur) var(--p-ease);
}

.portal-topnav-links a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.portal-topnav-links a[aria-current="page"] {
  color: #fff;
  border-bottom-color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.10);
}

/* Right cluster: dark toggle + avatar */
.portal-topnav-end {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  position: relative;
}

.portal-dark-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--p-dur) var(--p-ease);
  flex-shrink: 0;
}

.portal-dark-toggle:hover {
  background: rgba(255,255,255,0.20);
  color: #fff;
}

.portal-dark-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-topnav-profile {
  position: relative;
}

.portal-avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.32);
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  transition: background var(--p-dur) var(--p-ease),
              border-color var(--p-dur) var(--p-ease);
}

.portal-avatar-btn:hover {
  background: rgba(255,255,255,0.26);
  border-color: rgba(255,255,255,0.5);
}

/* Avatar dropdown */
.portal-avatar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow-md);
  overflow: hidden;
  z-index: 200;
}

.portal-avatar-dropdown[hidden] { display: none; }

.portal-avatar-dropdown-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--p-border);
}

.portal-avatar-dropdown-name {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--p-text);
}

.portal-avatar-dropdown-email {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--p-muted);
  margin-top: 2px;
  word-break: break-all;
}

.portal-avatar-dropdown-logout {
  display: block;
  width: 100%;
  padding: 10px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #DC2626;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--p-dur) var(--p-ease);
}

.portal-avatar-dropdown-logout:hover {
  background: rgba(220,38,38,0.06);
}

/* ── 4. Layout ─────────────────────────────────────────────── */
.portal-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--p-nav-h);
  background: var(--p-bg);
}

/* No sidebar variant */
.portal-layout--nosidebar > .portal-main {
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 28px 80px;
}

/* Sidebar variant */
.portal-layout--sidebar .portal-sidebar {
  width: var(--p-sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--p-nav-h);
  height: calc(100vh - var(--p-nav-h));
  overflow-y: auto;
  border-right: 1px solid var(--p-border);
  padding: 20px 0;
  background: var(--p-surface);
}

.portal-layout--sidebar > .portal-main {
  flex: 1;
  min-width: 0;
  padding: 32px 32px 80px;
}

/* Sidebar nav */
.portal-sidebar-section { margin-bottom: 4px; }

.portal-sidebar-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--p-muted);
  padding: 8px 16px 4px;
}

.portal-sidebar-link {
  display: block;
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--p-text);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color var(--p-dur) var(--p-ease),
              background var(--p-dur) var(--p-ease),
              border-color var(--p-dur) var(--p-ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-sidebar-link:hover {
  background: var(--p-surface-2);
  color: var(--p-primary);
  text-decoration: none;
}

.portal-sidebar-link.is-active {
  background: rgba(31,92,150,0.08);
  border-left-color: var(--p-primary);
  color: var(--p-primary);
  font-weight: 600;
}

/* ── 5. Page Headers ───────────────────────────────────────── */
.portal-page-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--p-border);
}

.portal-page-title {
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--p-text);
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}

.portal-page-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--p-muted);
  margin: 0;
}

/* ── 6. Cards ──────────────────────────────────────────────── */
.p-card {
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 20px;
  box-shadow: var(--p-shadow-sm);
}

.p-card--flat {
  background: var(--p-surface);
  border-color: var(--p-border-light);
  box-shadow: none;
}

/* ── 7. Priority Banner ────────────────────────────────────── */
.portal-priority {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(31,92,150,0.07);
  border: 1px solid rgba(31,92,150,0.18);
  border-radius: var(--p-radius-sm);
  padding: 10px 14px;
  margin-bottom: 24px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--p-primary);
}

.portal-priority svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── 8. KPI Row ────────────────────────────────────────────── */
.portal-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.portal-kpi-card {
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 16px 20px;
  box-shadow: var(--p-shadow-sm);
}

.portal-kpi-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--p-muted);
  margin-bottom: 6px;
}

.portal-kpi-value {
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--p-text);
  line-height: 1;
}

.portal-kpi-sub {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--p-muted);
  margin-top: 5px;
}

/* ── 9. Quick Nav Grid (Dashboard) ─────────────────────────── */
.portal-section-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-muted);
  margin-bottom: 12px;
}

.portal-quicknav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.portal-quicknav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 22px 12px;
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  text-decoration: none;
  box-shadow: var(--p-shadow-sm);
  transition: box-shadow var(--p-dur) var(--p-ease),
              transform var(--p-dur) var(--p-ease),
              border-color var(--p-dur) var(--p-ease);
}

.portal-quicknav-card:hover {
  box-shadow: var(--p-shadow-md);
  transform: translateY(-1px);
  border-color: var(--p-primary);
  text-decoration: none;
}

.portal-quicknav-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--p-primary);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-quicknav-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--p-text);
  text-align: center;
}

/* ── 10. Embed Card ────────────────────────────────────────── */
.embed-card {
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  overflow: hidden;
  box-shadow: var(--p-shadow-sm);
  margin-top: 24px;
}

.embed-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  border-bottom: 1px solid var(--p-border);
}

.embed-card-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--p-text);
}

.embed-card-body iframe {
  display: block;
  width: 100%;
  height: 420px;
  border: none;
}

/* ── 11. Cold Call — Two-Column ────────────────────────────── */
.portal-cold-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

.script-section {
  margin-bottom: 24px;
}

.script-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: var(--p-primary);
  color: #fff;
  margin-bottom: 10px;
}

.script-badge--accent { background: var(--p-accent); }

.script-text {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.75;
  color: var(--p-text);
}

.script-blank {
  display: inline-block;
  min-width: 80px;
  border-bottom: 2px solid var(--p-accent);
  color: var(--p-accent);
  font-weight: 600;
  padding-bottom: 1px;
}

.script-em {
  font-style: italic;
  color: var(--p-muted);
}

.script-note {
  font-size: 12px;
  color: var(--p-muted);
  font-style: italic;
}

.script-pro-tip {
  background: var(--p-accent-light);
  border-left: 3px solid var(--p-accent);
  border-radius: 0 var(--p-radius-sm) var(--p-radius-sm) 0;
  padding: 10px 14px;
  margin-top: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--p-text);
  line-height: 1.6;
}

.script-pro-tip strong { color: var(--p-accent); }

/* Objections panel */
.objections-panel {
  position: sticky;
  top: calc(var(--p-nav-h) + 16px);
}

.objections-panel-title {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-muted);
  margin-bottom: 4px;
  padding: 0 2px;
}

.objection-formula {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--p-primary);
  margin-bottom: 12px;
  padding: 6px 10px;
  background: rgba(31,92,150,0.07);
  border-radius: var(--p-radius-sm);
}

.objection-item {
  border-bottom: 1px solid var(--p-border-light);
}

.objection-item:last-child { border-bottom: none; }

.objection-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 2px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--p-text);
  transition: color var(--p-dur) var(--p-ease);
}

.objection-btn:hover { color: var(--p-primary); }

.objection-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--p-muted);
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--p-dur) var(--p-ease), color var(--p-dur) var(--p-ease);
}

.objection-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
  color: var(--p-primary);
}

.objection-body {
  padding: 0 2px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.65;
  color: var(--p-muted);
  display: none;
}

.objection-body.is-open { display: block; }
.objection-body p { color: var(--p-muted); font-size: 13px; margin-bottom: 6px; }
.objection-body strong { color: var(--p-text); }

/* ── 12. Playbooks ──────────────────────────────────────────── */
.playbook-card {
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--p-shadow-sm);
}

.playbook-card-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--p-dur) var(--p-ease);
}

.playbook-card-trigger:hover { background: var(--p-surface); }

.playbook-card-trigger-text { flex: 1; }

.playbook-card-title {
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--p-text);
  display: block;
}

.playbook-card-meta {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--p-muted);
  margin-top: 2px;
  display: block;
}

.playbook-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: var(--p-muted);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--p-dur) var(--p-ease);
}

.playbook-card-trigger[aria-expanded="true"] .playbook-chevron {
  transform: rotate(180deg);
}

.playbook-card-body {
  border-top: 1px solid var(--p-border);
  padding: 20px;
  display: none;
}

.playbook-card-body.is-open { display: block; }

.playbook-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.playbook-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.playbook-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--p-primary);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.playbook-step-content {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--p-text);
  padding-top: 2px;
}

.playbook-step-content strong {
  display: block;
  font-weight: 600;
  color: var(--p-text);
  margin-bottom: 2px;
}

.playbook-pro-tip {
  margin-top: 16px;
  background: var(--p-accent-light);
  border-left: 3px solid var(--p-accent);
  border-radius: 0 var(--p-radius-sm) var(--p-radius-sm) 0;
  padding: 10px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--p-text);
  line-height: 1.6;
}

.playbook-pro-tip strong { color: var(--p-accent); }

/* ── 13. Buttons ─────────────────────────────────────────────── */
.p-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--p-radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--p-dur) var(--p-ease),
              box-shadow var(--p-dur) var(--p-ease),
              border-color var(--p-dur) var(--p-ease),
              transform var(--p-dur) var(--p-ease);
  white-space: nowrap;
  line-height: 1.4;
}

.p-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.p-btn--primary {
  background: var(--p-primary);
  color: #fff;
  border-color: var(--p-primary);
}

.p-btn--primary:hover {
  background: var(--p-primary-hover);
  border-color: var(--p-primary-hover);
  box-shadow: 0 2px 8px rgba(31,92,150,0.28);
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}

.p-btn--outline {
  background: transparent;
  color: var(--p-primary);
  border-color: var(--p-border);
}

.p-btn--outline:hover {
  background: var(--p-surface);
  border-color: var(--p-primary);
  text-decoration: none;
}

.p-btn--ghost {
  background: transparent;
  color: var(--p-muted);
  border-color: transparent;
}

.p-btn--ghost:hover {
  background: var(--p-surface);
  color: var(--p-text);
  text-decoration: none;
}

.p-btn--sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* ── 14. Tools Grid ─────────────────────────────────────────── */
.portal-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.tool-card {
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--p-shadow-sm);
  transition: box-shadow var(--p-dur) var(--p-ease),
              transform var(--p-dur) var(--p-ease);
}

.tool-card:hover {
  box-shadow: var(--p-shadow-md);
  transform: translateY(-1px);
}

.tool-card--wide {
  grid-column: 1 / -1;
}

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--p-radius-sm);
  background: var(--p-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-card-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--p-primary);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-card-name {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--p-text);
}

.tool-card-desc {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--p-muted);
  line-height: 1.5;
  flex: 1;
}

.tool-card-creds {
  background: var(--p-surface);
  border-radius: var(--p-radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--p-text);
  line-height: 1.8;
}

.tool-card-creds-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--p-muted);
  margin-bottom: 4px;
  display: block;
}

.tool-card-creds-row {
  font-family: 'SF Mono','Fira Code',monospace;
  font-size: 12px;
  color: var(--p-text);
  display: block;
}

.tool-card-creds-row span {
  color: var(--p-muted);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  margin-right: 4px;
}

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

/* Transaction log embed inside tool card */
.txlog-toggle-body {
  display: none;
  border-top: 1px solid var(--p-border);
  margin: 0 -20px -10px;
  height: 500px;
}

.txlog-toggle-body.is-open { display: block; }

.txlog-toggle-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── 15. Resources — Accordion Wiki ─────────────────────────── */
.resource-chapter {
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: var(--p-shadow-sm);
}

.resource-chapter-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--p-dur) var(--p-ease);
}

.resource-chapter-trigger:hover { background: var(--p-surface); }

.resource-chapter-title {
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--p-text);
}

.resource-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: var(--p-muted);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--p-dur) var(--p-ease);
}

.resource-chapter-trigger[aria-expanded="true"] .resource-chevron {
  transform: rotate(180deg);
}

.resource-chapter-body {
  border-top: 1px solid var(--p-border);
  padding: 20px;
  display: none;
}

.resource-chapter-body.is-open { display: block; }

/* Vocabulary grid */
.vocab-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}

.vocab-term {
  font-weight: 600;
  color: var(--p-text);
  padding: 8px 12px;
  background: var(--p-surface);
  border-bottom: 1px solid var(--p-border);
}

.vocab-def {
  color: var(--p-muted);
  padding: 8px 12px;
  background: var(--p-card);
  border-bottom: 1px solid var(--p-border);
}

.vocab-term:last-of-type,
.vocab-def:last-of-type { border-bottom: none; }

/* Pillar cards */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.pillar-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  padding: 14px;
}

.pillar-card-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--p-primary);
  margin-bottom: 6px;
}

.pillar-card-desc {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--p-muted);
  margin: 0;
  line-height: 1.5;
}

/* Repair category badge */
.repair-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.repair-badge--low    { background: rgba(16,185,129,0.10); color: #059669; }
.repair-badge--medium { background: rgba(245,158,11,0.12); color: #D97706; }
.repair-badge--high   { background: rgba(239,68,68,0.10); color: #DC2626; }

/* ── 16. Badges / Pills ─────────────────────────────────────── */
.p-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.p-badge--blue  { background: rgba(31,92,150,0.10); color: var(--p-primary); }
.p-badge--amber { background: var(--p-accent-light); color: var(--p-accent); }
.p-badge--green { background: rgba(16,185,129,0.10); color: #059669; }

/* ── 17. Mobile Bottom Tab Bar ──────────────────────────────── */
.portal-tabbar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--p-tabbar-h);
  background: var(--p-card);
  border-top: 1px solid var(--p-border);
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(28,42,58,0.08);
}

.portal-tabbar-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 100%;
}

.portal-tabbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--p-muted);
  transition: color var(--p-dur) var(--p-ease);
}

.portal-tabbar-item:hover,
.portal-tabbar-item[aria-current="page"] {
  color: var(--p-primary);
  text-decoration: none;
}

.portal-tabbar-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-tabbar-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
}

/* ── 18. Divider ─────────────────────────────────────────────── */
.p-divider {
  border: none;
  border-top: 1px solid var(--p-border);
  margin: 20px 0;
}

/* ── 19. Animations ─────────────────────────────────────────── */
@keyframes p-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.portal-main {
  animation: p-fade-up 220ms var(--p-ease) both;
}

/* ── 20. Public Site Nav Login Icon ─────────────────────────── */
.nav-login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.70);
  cursor: pointer;
  padding: 0;
  transition: background 150ms ease, color 150ms ease;
  flex-shrink: 0;
}

.nav-login-icon:hover {
  background: rgba(255,255,255,0.22);
  color: #fff;
}

.nav-login-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── 21. Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .portal-layout--sidebar {
    flex-direction: column;
  }

  .portal-layout--sidebar .portal-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--p-border);
    display: flex;
    overflow-x: auto;
    padding: 8px 12px;
    gap: 2px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .portal-layout--sidebar .portal-sidebar::-webkit-scrollbar { display: none; }

  .portal-sidebar-label { display: none; }

  .portal-sidebar-section { display: contents; }

  .portal-sidebar-link {
    border-left: none;
    padding: 7px 12px;
    border-radius: var(--p-radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .portal-sidebar-link.is-active {
    border-left: none;
    background: rgba(31,92,150,0.10);
    color: var(--p-primary);
  }

  .portal-cold-layout {
    grid-template-columns: 1fr;
  }

  .objections-panel {
    position: static;
  }

  .portal-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .portal-quicknav {
    grid-template-columns: repeat(3, 1fr);
  }

  .portal-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pillar-grid {
    grid-template-columns: 1fr;
  }

  .tool-card--wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .portal-topnav-links {
    display: none;
  }

  .portal-tabbar {
    display: flex;
  }

  .portal-layout--nosidebar > .portal-main,
  .portal-layout--sidebar > .portal-main {
    padding: 20px 16px calc(var(--p-tabbar-h) + 24px);
  }

  .portal-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .portal-quicknav {
    grid-template-columns: repeat(3, 1fr);
  }

  .portal-tools-grid {
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  .portal-page-title {
    font-size: 19px;
  }
}
