/* CRIMS - CAFNR Research Impact Management System
   Design system matched to CPIS/PSD: PVAMU purple & gold, modern, mobile-first.
   WCAG 2.1 AA: 4.5:1 contrast on text, visible focus, reduced-motion support. */

:root {
  --purple-900: #1F1444;
  --purple-800: #2D1E5F;
  --purple-700: #3B2A78;
  --purple-600: #4C3A94;
  --purple-100: #E9E5F6;
  --purple-50:  #F4F2FB;
  --gold-500:  #F0AB00;
  --gold-600:  #D89A00;
  --gold-100:  #FDF3D7;
  --ink:       #241E38;
  --ink-soft:  #5D5775;
  --line:      #E5E1F0;
  --bg:        #F6F5FA;
  --card:      #FFFFFF;
  --ok:        #15803D;
  --ok-bg:     #DCFCE7;
  --warn:      #92400E;
  --warn-bg:   #FEF3C7;
  --err:       #B91C1C;
  --err-bg:    #FEE2E2;
  --info:      #1D4ED8;
  --info-bg:   #DBEAFE;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(31,20,68,.07), 0 8px 24px -12px rgba(31,20,68,.18);
  --shadow-lg: 0 4px 12px rgba(31,20,68,.10), 0 20px 48px -20px rgba(31,20,68,.28);
  /* legacy CRIMS token names kept as aliases */
  --pv-purple: var(--purple-800);
  --pv-purple-dark: var(--purple-900);
  --pv-purple-light: var(--purple-600);
  --pv-gold: var(--gold-600);
  --pv-gold-bright: var(--gold-500);
  --bad: var(--err);
  --focus: 3px solid var(--gold-500);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

/* ---------- accessibility ---------- */
:focus-visible { outline: var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--gold-500); color: var(--purple-900); font-weight: 800;
  padding: 10px 18px; border-radius: 0 0 10px 0; text-decoration: none;
}
.skip-link:focus { left: 0; }
.visually-hidden, .sr-only {
  position: absolute !important; width: 1px; height: 1px;
  clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- header: brand band + nav strip (passport style) ---------- */
.topbar {
  background: linear-gradient(120deg, var(--purple-900) 0%, var(--purple-800) 55%, var(--purple-700) 100%);
  border-bottom: 3px solid var(--gold-500);
  color: #fff;
}
.brand-band {
  max-width: 1160px; margin: 0 auto; padding: 16px 20px 13px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; }
.brand-logo, .brand img {
  height: 58px; max-width: 340px; width: auto; object-fit: contain;
  background: #fff; border-radius: 10px; padding: 4px 10px;
}
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.eyebrow {
  color: var(--gold-500); font-size: 11px; font-weight: 800;
  letter-spacing: 2.2px; text-transform: uppercase;
}
.title-serif {
  font-family: Georgia, 'Palatino Linotype', 'Times New Roman', serif;
  font-size: 27px; font-weight: 700; color: #fff; line-height: 1.12; letter-spacing: .2px;
}
.title-serif em { font-style: italic; color: var(--gold-500); font-weight: 600; }
.brand-sub2 { color: #CFC7EA; font-size: 12px; margin-top: 1px; }
.cafnr-right-text {
  flex: none; text-align: right; margin-left: auto;
  font-family: Georgia, 'Palatino Linotype', 'Times New Roman', serif;
  color: var(--gold-500); font-size: 16.5px; font-weight: 700; line-height: 1.4; letter-spacing: .3px;
}
.nav-strip { background: rgba(255,255,255,.07); border-top: 1px solid rgba(255,255,255,.14); }
.nav-strip-inner { max-width: 1160px; margin: 0 auto; padding: 4px 20px; display: flex; align-items: center; }
.nav, .nav-links { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; width: 100%; }
.nav a, .nav-links a {
  color: #E4DFF5; text-decoration: none; font-size: 13.5px; font-weight: 600;
  padding: 7px 12px; border-radius: 8px; transition: background .15s, color .15s;
}
.nav a:hover, .nav-links a:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav a[aria-current="page"], .nav a.active, .nav-links a.active {
  background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 -2px 0 var(--gold-500);
}
.userbox, .nav-user {
  margin-left: auto; display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; color: #CFC7EA; white-space: nowrap;
}
.userbox b, .nav-user b { color: #fff; font-size: 13px; }
.rolechip {
  background: rgba(255,255,255,.14); color: var(--gold-500); font-weight: 800;
  padding: 3px 11px; border-radius: 999px; font-size: 11.5px; letter-spacing: .3px;
  border: 1px solid rgba(240,171,0,.5); cursor: pointer;
}
.logout-btn, .userbox .btn-outline {
  background: var(--gold-500) !important; color: var(--purple-900) !important; border: none !important;
  border-radius: 8px; padding: 6px 14px !important; font-weight: 800 !important; font-size: 12px !important;
  cursor: pointer;
}
.logout-btn:hover, .userbox .btn-outline:hover { background: var(--gold-600) !important; }

/* Mobile hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none; background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.4); border-radius: 8px;
  font-size: 13px; font-weight: 700; padding: 7px 14px; cursor: pointer; font-family: inherit;
}

@media (max-width: 900px) {
  .cafnr-right-text { display: none; }
  .brand-logo, .brand img { height: 44px; max-width: 190px; }
  .title-serif { font-size: 20px; }
  .brand-sub2 { display: none; }
  .brand-band { padding: 12px 16px 10px; flex-wrap: wrap; }
  .nav-strip-inner { flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; width: 100%; margin: 4px 0; text-align: left; }
  /* Collapsed by default on mobile; expands when the toggle adds .open */
  .nav-links { display: none; flex-direction: column; align-items: stretch; width: 100%; gap: 2px; padding-bottom: 6px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 12px; border-radius: 8px; }
  .nav-user { margin-left: 0; padding: 8px 2px 2px; flex-wrap: wrap; gap: 10px;
    border-top: 1px solid rgba(255,255,255,.15); }
}

/* ---------- layout ---------- */
.wrap, .main { max-width: 1160px; margin: 0 auto; padding: 26px 20px 60px; }
.wrap-narrow { max-width: 880px; }
.page-title { margin: 0 0 4px; font-size: 24px; font-weight: 800; color: var(--purple-900); letter-spacing: -.2px; }
.page-sub { margin: 0 0 22px; color: var(--ink-soft); font-size: 13.5px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
.card h2, .card h3 { margin-top: 0; color: var(--purple-900); }
.stat { border-top: 3px solid var(--gold-500); }
.stat .num { font-size: 27px; font-weight: 800; color: var(--purple-900); line-height: 1.1; }
.stat .lbl { font-size: 12px; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; }
.stat.gold { border-top-color: var(--gold-500); }
.stat.ok { border-top-color: var(--ok); }
.stat.warn { border-top-color: #D89A00; }
.stat.bad { border-top-color: var(--err); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  font-weight: 700; font-size: 14px; padding: 9px 18px; text-decoration: none;
  transition: transform .1s, box-shadow .15s, background .15s;
  font-family: inherit;
  background: var(--purple-800); color: #fff; box-shadow: 0 3px 10px -3px rgba(45,30,95,.5);
}
.btn:active { transform: translateY(1px); }
.btn:hover { background: var(--purple-700); }
.btn-gold { background: var(--gold-500); color: var(--purple-900); box-shadow: none; }
.btn-gold:hover { background: var(--gold-600); }
.btn-outline { background: #fff; color: var(--purple-800); border-color: #CFC7EA; box-shadow: none; }
.btn-outline:hover { background: var(--purple-50); }
.btn-danger { background: var(--err-bg); color: var(--err); box-shadow: none; }
.btn-danger:hover { background: #FCA5A5; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label, .field .lbl { display: block; font-weight: 700; font-size: 13px; color: var(--purple-900); margin-bottom: 5px; }
.req { color: var(--err); font-weight: 700; }
.help { font-size: 12px; color: var(--ink-soft); margin: 4px 0 6px; }
input[type=text], input[type=date], input[type=email], input[type=url], input[type=number],
input[type=password], input[type=tel], select, textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 14px; font-family: inherit; color: var(--ink);
  background: #FCFBFE; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--purple-600); box-shadow: 0 0 0 3px rgba(76,58,148,.14); background: #fff;
}
.field.invalid input, .field.invalid select, .field.invalid textarea {
  border-color: var(--err); box-shadow: 0 0 0 3px rgba(185,28,28,.10);
}
.err { color: var(--err); font-size: 12.5px; margin-top: 4px; font-weight: 600; }
.charcount { font-size: 11.5px; color: var(--ink-soft); text-align: right; }
fieldset { border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 16px; background: #FCFBFE; }
legend { font-weight: 800; color: var(--purple-900); padding: 0 6px; font-size: 13px; }
.choice {
  display: flex; gap: 9px; align-items: flex-start; margin: 6px 0; font-weight: 400; font-size: 13.5px;
}
.choice input { width: auto; margin-top: 4px; accent-color: var(--purple-700); }

/* ---------- progress / wizard steps ---------- */
.progress { background: var(--purple-100); border-radius: 99px; height: 7px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--gold-500), var(--gold-600)); border-radius: 99px; transition: width .3s ease; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 22px; padding: 0; list-style: none; }
.steps li {
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--purple-50); color: var(--ink-soft); border: 1.5px solid var(--line); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.steps li:hover { border-color: var(--purple-600); }
.steps li.current { background: var(--purple-800); color: #fff; border-color: var(--purple-800); font-weight: 800; }
.steps li.done { background: var(--ok-bg); color: var(--ok); border-color: #86EFAC; }

/* ---------- tables & status ---------- */
.tablewrap, .table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--ink-soft); font-weight: 800; padding: 10px 12px; border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:hover td { background: var(--purple-50); }
table.data a { color: var(--purple-700); font-weight: 700; text-decoration: none; }
table.data a:hover { text-decoration: underline; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 99px;
  font-size: 11.5px; font-weight: 800; padding: 3px 11px; letter-spacing: .2px; white-space: nowrap;
  background: #E5E7EB; color: #4B5563;
}
.badge.draft { background: #E5E7EB; color: #4B5563; }
.badge.submitted, .badge.resubmitted { background: var(--info-bg); color: var(--info); }
.badge.review { background: #EDE9FE; color: #6D28D9; }
.badge.revisions { background: var(--warn-bg); color: var(--warn); }
.badge.approved { background: var(--ok-bg); color: var(--ok); }
.badge.published { background: var(--purple-800); color: #fff; }
.badge.scheduled { background: var(--purple-100); color: var(--purple-800); }
.badge.rejected, .badge.unpublished { background: var(--err-bg); color: var(--err); }
.badge.archived, .badge.withdrawn { background: #E5E7EB; color: #4B5563; }
.badge.public { background: var(--ok-bg); color: var(--ok); }
.badge.private { background: var(--err-bg); color: var(--err); }

/* ---------- alerts ---------- */
.alert { border-radius: 10px; padding: 11px 14px; font-size: 13.5px; margin: 10px 0; border: 1px solid; }
.alert.ok   { background: var(--ok-bg); border-color: #86EFAC; color: var(--ok); }
.alert.warn { background: var(--warn-bg); border-color: #FCD34D; color: var(--warn); }
.alert.bad  { background: var(--err-bg); border-color: #FCA5A5; color: var(--err); }
.alert.info { background: var(--info-bg); border-color: #93C5FD; color: var(--info); }

/* ---------- comments / timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; border: 0; margin: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 6px; top: 5px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--purple-600); box-shadow: 0 0 0 3px var(--purple-100);
}
.timeline li::after { content: ""; position: absolute; left: 10px; top: 18px; bottom: 0; width: 1.5px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 11.5px; color: var(--ink-soft); }
.comment { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 10px 0; background: #fff; }
.comment.private { background: var(--gold-100); border-color: #FCD34D; border-left: 3px solid var(--gold-500); }
.comment .meta { font-size: 11.5px; color: var(--ink-soft); margin-bottom: 4px; }

/* ---------- modal ---------- */
dialog {
  border: none; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.35);
  padding: 22px 24px; max-width: 620px; width: 92%;
}
dialog::backdrop { background: rgba(23,15,50,.72); }

/* ---------- chat (Romeo) ---------- */
.chatlog { max-height: 460px; overflow-y: auto; padding: 8px 4px; }
.msg { max-width: 78%; margin: 8px 0; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; white-space: pre-wrap; }
.msg.user { background: var(--purple-800); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.msg.bot { background: var(--purple-50); border: 1px solid var(--purple-100); border-bottom-left-radius: 4px; }
.msg.bot .cites { margin-top: 8px; font-size: 11.5px; }
.msg.bot .cites a { color: var(--purple-700); font-weight: 700; }

/* ---------- public portal ---------- */
.hero {
  background: linear-gradient(120deg, var(--purple-900) 0%, var(--purple-800) 55%, var(--purple-700) 100%);
  color: #fff; padding: 54px 20px 60px; text-align: center;
  border-bottom: 3px solid var(--gold-500);
}
.hero h1 {
  margin: 0 0 8px; font-size: 32px;
  font-family: Georgia, 'Palatino Linotype', 'Times New Roman', serif; letter-spacing: .2px;
}
.hero h1 em { font-style: italic; color: var(--gold-500); font-weight: 600; }
.hero p { margin: 0 auto 22px; max-width: 720px; color: #CFC7EA; }
.hero .searchbar { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; }
.hero .searchbar input { flex: 1; border: none; padding: 12px 16px; border-radius: 10px; font-size: 15px; }
.impact-card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; position: relative;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.impact-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.impact-card .ic-media {
  position: relative; height: 150px; overflow: hidden;
  border-bottom: 3px solid var(--gold-500);
}
.impact-card .ic-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.impact-card .ic-media-blank {
  background: linear-gradient(135deg, var(--purple-900) 0%, var(--purple-800) 55%, var(--purple-700) 100%);
  display: flex; align-items: center; justify-content: center;
}
.impact-card .ic-badge-lg {
  width: 60px; height: 60px; border-radius: 16px; background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(240,171,0,.6); color: var(--gold-500);
  font-family: Georgia, serif; font-weight: 800; font-size: 30px;
  display: flex; align-items: center; justify-content: center;
}
.impact-card .ic-featured {
  position: absolute; top: 10px; right: 10px; background: var(--gold-500); color: var(--purple-900);
  font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(31,20,68,.3);
}
.impact-card .ic-body { padding: 14px 18px 4px; display: flex; flex-direction: column; gap: 6px; }
.impact-card .ic-focus {
  font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--purple-700);
}
.impact-card .ic-title { margin: 0; color: var(--purple-900); font-size: 16.5px; line-height: 1.3; }
.impact-card .ic-byline {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--ink-soft);
}
.impact-card .ic-author { font-weight: 700; color: var(--ink); }
.impact-card .ic-date::before { content: "· "; color: var(--ink-soft); }
.impact-card .ic-summary {
  margin: 4px 0 12px; color: var(--ink-soft); font-size: 13px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.impact-card .ic-foot {
  margin-top: auto; padding: 12px 18px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--purple-50);
}
.impact-card .ic-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.impact-card .ic-chip {
  font-size: 10.5px; font-weight: 700; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.impact-card .ic-more { font-size: 12.5px; font-weight: 800; color: var(--purple-700); white-space: nowrap; }
.impact-card:hover .ic-more { color: var(--gold-600); }
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.filterbar .field { margin: 0; min-width: 160px; flex: 1; }
mark { background: var(--gold-100); padding: 0 2px; }

/* ---------- footer ---------- */
.footer {
  background: var(--purple-900); color: #CFC7EA; font-size: 12px;
  padding: 22px 20px; text-align: center; margin-top: 40px; border-top: 3px solid var(--gold-500);
}
.footer a { color: var(--gold-500); }

/* ---------- start here / lessons ---------- */
details.lesson { border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; margin: 10px 0; box-shadow: var(--shadow); }
details.lesson summary {
  cursor: pointer; padding: 13px 18px; font-weight: 800; color: var(--purple-900); list-style: none;
  display: flex; align-items: center; gap: 10px; font-size: 14px;
}
details.lesson summary::before { content: "▸"; color: var(--gold-600); }
details.lesson[open] summary::before { content: "▾"; }
details.lesson .body { padding: 0 18px 16px; }
.lesson-done { color: var(--ok); font-size: 12px; margin-left: auto; font-weight: 700; }

/* ---------- rich-text editor ---------- */
.rte { border: 1.5px solid var(--line); border-radius: 10px; background: #FCFBFE; overflow: hidden; }
.rte:focus-within { border-color: var(--purple-600); box-shadow: 0 0 0 3px rgba(76,58,148,.14); background: #fff; }
.rte-toolbar {
  display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
  padding: 6px 8px; background: var(--purple-50); border-bottom: 1px solid var(--line);
}
.rte-btn {
  border: 1px solid transparent; background: transparent; border-radius: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--purple-800); cursor: pointer;
  padding: 4px 10px; font-family: inherit; line-height: 1.4;
}
.rte-btn:hover { background: #fff; border-color: #CFC7EA; }
.rte-btn:active { transform: translateY(1px); }
.rte-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.rte-img { color: var(--warn); }
.rte-editor {
  min-height: 170px; max-height: 480px; overflow-y: auto;
  padding: 10px 12px; font-size: 14px; color: var(--ink); outline: none;
}
.rte-editor:empty::before { content: attr(data-placeholder); color: #9A93B5; }
.rte-editor img { max-width: 100%; height: auto; border-radius: 10px; margin: 8px 0; box-shadow: var(--shadow); }
.rte-editor p { margin: 0 0 10px; }
.rte-editor ul, .rte-editor ol { margin: 0 0 10px; padding-left: 24px; }

/* ---------- rich story content (record view + public story) ---------- */
.rich-content { font-size: 14.5px; line-height: 1.65; }
.rich-content p { margin: 0 0 12px; }
.rich-content ul, .rich-content ol { margin: 0 0 12px; padding-left: 26px; }
.rich-content li { margin-bottom: 4px; }
.rich-content blockquote {
  margin: 12px 0; padding: 10px 16px; background: var(--purple-50);
  border-left: 4px solid var(--gold-500); border-radius: 8px;
}
.rich-content img {
  display: block; max-width: min(100%, 640px); height: auto;
  border-radius: var(--radius); box-shadow: var(--shadow); margin: 16px auto;
}
.rich-content figure { margin: 16px 0; text-align: center; }
.rich-content figcaption { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.rich-content a { color: var(--purple-700); font-weight: 700; }
@media print { .rich-content img { box-shadow: none; max-width: 80%; } }

/* ---------- Start Here (Getting Started Center) ---------- */
.sh-hero {
  background: linear-gradient(120deg, var(--purple-900) 0%, var(--purple-800) 55%, var(--purple-700) 100%);
  border-radius: var(--radius); border-bottom: 3px solid var(--gold-500);
  color: #fff; padding: 26px 28px; margin-bottom: 16px;
  display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
}
.sh-hero-main { flex: 1 1 480px; }
.sh-hero h1 {
  margin: 6px 0 8px; font-size: 30px; color: #fff;
  font-family: Georgia, 'Palatino Linotype', 'Times New Roman', serif; letter-spacing: .2px;
}
.sh-hero p { margin: 0 0 14px; color: #CFC7EA; font-size: 13.5px; max-width: 640px; }
.sh-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.sh-tab {
  border: 1.5px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: #E4DFF5;
  border-radius: 99px; padding: 7px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: background .15s, color .15s, border-color .15s;
}
.sh-tab:hover { background: rgba(255,255,255,.18); color: #fff; }
.sh-tab.active { background: var(--gold-500); border-color: var(--gold-500); color: var(--purple-900); }
.sh-mine {
  font-size: 9.5px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase;
  background: rgba(255,255,255,.9); color: var(--purple-800); border-radius: 99px; padding: 1px 7px; margin-left: 4px;
}
.sh-tab.active .sh-mine { background: var(--purple-900); color: var(--gold-500); }
.sh-ring-wrap { text-align: center; flex: none; }
.sh-ring { width: 118px; height: 118px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.sh-ring-in {
  width: 92px; height: 92px; border-radius: 50%; background: var(--purple-800);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: #fff;
}
.sh-ring-lbl { color: #CFC7EA; font-size: 12px; margin-top: 8px; }
.sh-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 16px; }
.sh-two { grid-template-columns: 2fr 1fr; margin-bottom: 8px; }
@media (max-width: 860px) { .sh-two { grid-template-columns: 1fr; } }
.sh-next {
  background: linear-gradient(135deg, var(--purple-900) 0%, var(--purple-800) 60%, var(--purple-700) 100%) !important;
  border: 2px solid var(--gold-500) !important; color: #fff;
  display: flex; flex-direction: column; gap: 9px; align-items: stretch;
}
.sh-next strong { color: var(--gold-500); font-size: 13px; letter-spacing: .4px; text-transform: uppercase; margin-bottom: 2px; }
.sh-next .btn-outline { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.4); }
.sh-next .btn-outline:hover { background: rgba(255,255,255,.2); }
.sh-h2 { font-size: 19px; font-weight: 800; color: var(--purple-900); margin: 26px 0 12px; }
.sh-lesson {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 10px; transition: border-color .15s;
}
.sh-lesson:hover { border-color: var(--purple-600); }
.sh-lesson.done { border-left: 4px solid var(--ok); }
.sh-lesson summary {
  display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none;
  padding: 14px 18px; user-select: none;
}
.sh-lesson summary::-webkit-details-marker { display: none; }
.sh-num {
  flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--purple-100);
  color: var(--purple-800); font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.sh-lesson.done .sh-num { background: var(--ok-bg); color: var(--ok); }
.sh-ico { font-size: 20px; flex: none; }
.sh-ttl { font-weight: 800; color: var(--purple-900); font-size: 14.5px; display: flex; flex-direction: column; }
.sh-sub { font-weight: 600; color: var(--ink-soft); font-size: 12px; }
.sh-body { padding: 0 18px 16px 56px; }
.sh-body ul { margin: 0 0 12px; padding-left: 18px; }
.sh-body li { margin-bottom: 6px; font-size: 13.5px; }
.sh-flow { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sh-step {
  flex: 1 1 130px; max-width: 168px; text-align: center; background: var(--purple-50);
  border: 1px solid var(--purple-100); border-radius: 10px; padding: 12px 10px;
  display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--ink-soft);
}
.sh-step strong { color: var(--purple-900); font-size: 12.5px; }
.sh-step-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--gold-500); color: var(--purple-900);
  font-weight: 800; font-size: 11.5px; display: flex; align-items: center; justify-content: center; margin: 0 auto 3px;
}
.sh-arrow { align-self: center; color: var(--ink-soft); font-weight: 800; }
@media (max-width: 700px) { .sh-arrow { display: none; } }

/* ---------- public header login (gold button, top-right below the gold line) ---------- */
.hero-top {
  max-width: 1160px; margin: 0 auto 6px; display: flex; justify-content: flex-end;
}
.portal-login-btn { box-shadow: 0 3px 10px -2px rgba(0,0,0,.35); }
/* Login link in the impact-detail nav bar */
.nav .portal-login {
  background: var(--gold-500); color: var(--purple-900) !important; border-radius: 8px;
  padding: 6px 14px !important; font-weight: 800;
}
.nav .portal-login:hover { background: var(--gold-600); }

/* ---------- public landing hero ---------- */
.hero-landing { padding: 62px 20px 66px; }
.hero-tagline {
  margin: 0 0 18px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 42px; line-height: 1.16; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
  color: #FFFFFF;
  text-shadow: 0 2px 14px rgba(0,0,0,.28);
}
.hero-tagline .tag-gold { color: var(--gold-500); display: inline-block; margin-top: 2px; }
.hero-sub { max-width: 620px; margin: 0 auto 24px; color: #EDE9F7; font-size: 15.5px; line-height: 1.7; }
.hero-cta { justify-content: center; margin-bottom: 26px; }
.hero-btn-ghost {
  background: rgba(255,255,255,.10); color: #fff; border: 1.5px solid rgba(255,255,255,.45); box-shadow: none;
}
.hero-btn-ghost:hover { background: rgba(255,255,255,.22); }
.ri-intro { text-align: center; max-width: 760px; margin: 6px auto 26px; }
.ri-intro h2 {
  font-family: Georgia, 'Palatino Linotype', 'Times New Roman', serif;
  color: var(--purple-900); font-size: 27px; margin: 0 0 10px;
}
.ri-intro p { color: var(--ink-soft); font-size: 15px; line-height: 1.75; margin: 0; }
@media (max-width: 700px) { .hero-tagline { font-size: 26px; } .hero-landing { padding: 40px 16px 44px; } }

/* ---------- workflow diagram ---------- */
.workflow-diagram {
  background: var(--purple-50); border: 1px solid var(--purple-100);
  border-radius: var(--radius); padding: 16px; margin: 14px 0 6px;
  overflow-x: auto;
}
.workflow-diagram svg { min-width: 560px; display: block; margin: 0 auto; }

/* ---------- Romeo AI draft card ---------- */
.romeo-card {
  background: linear-gradient(135deg, var(--purple-900) 0%, var(--purple-800) 60%, var(--purple-700) 100%);
  border: 2px solid var(--gold-500); border-radius: var(--radius);
  box-shadow: 0 6px 20px -6px rgba(31,20,68,.45);
  color: #fff; padding: 16px 20px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.romeo-card-text { flex: 1 1 380px; display: flex; flex-direction: column; gap: 4px; }
.romeo-card-text strong { color: var(--gold-500); font-size: 15px; }
.romeo-card-text span { color: #CFC7EA; font-size: 12.5px; }
.romeo-card-text em { color: var(--gold-100); font-style: normal; font-weight: 700; }
#romeo-dlg { max-width: 560px; }
#romeo-dlg textarea { min-height: 64px; }

/* ---------- purpose / callout box ---------- */
.purpose-box {
  background: var(--purple-50); border: 1px solid var(--purple-100); border-left: 4px solid var(--gold-500);
  border-radius: 10px; padding: 14px 16px; font-size: 13.5px; color: var(--ink); margin-bottom: 18px;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  table.data { font-size: 12.5px; }
  .hero h1 { font-size: 22px; }
  .wrap, .main { padding: 16px 12px 48px; }
}
@media print {
  .topbar, .nav, .nav-strip, .btn, .filterbar, .footer, .no-print, .noprint { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: none; }
}
