:root {
  --bg: #0a0e14;
  --bg-soft: #111722;
  --card: #141b27;
  --line: #1f2a3a;
  --text: #e6edf6;
  --muted: #8a98ad;
  --accent: #2ee6a6;
  --accent-dim: #1aa57a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); }

/* Shared top nav (rendered by app.js) */
.eq-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
  flex-shrink: 0; background: var(--bg); gap: 14px;
}
.eq-nav .brand { font-weight: 800; font-size: 19px; letter-spacing: -0.3px; text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 7px; }
.eq-nav .brand .wm { font-family: "Space Grotesk", -apple-system, "Segoe UI", sans-serif; font-weight: 700; letter-spacing: -0.5px; color: var(--text); }
.eq-nav .brand span { color: var(--accent); }
.eq-nav .brand .mark { width: 24px; height: 24px; flex: 0 0 auto;
  filter: drop-shadow(0 0 3px rgba(46,230,166,.55)) drop-shadow(0 1px 8px rgba(46,230,166,.28)); }
.eq-nav .brand .beta {
  font-size: 9px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent-dim); border-radius: 5px;
  padding: 2px 5px; line-height: 1; align-self: center;
}
.eq-links { display: flex; gap: 4px; flex: 1; justify-content: center; flex-wrap: wrap; align-items: center; }
/* Top-level links + group buttons share one look */
.eq-links .eq-top,
.eq-grouplabel {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 7px 12px; border-radius: 8px; transition: background .15s, color .15s;
  background: none; border: 0; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px; line-height: 1.4;
}
.eq-links .eq-top:hover,
.eq-grouplabel:hover { color: var(--text); background: var(--bg-soft); }
.eq-links .eq-top.active { color: var(--accent); background: rgba(46,230,166,.08); }
/* Highlight the category button that contains the current page */
.eq-group.has-active > .eq-grouplabel { color: var(--accent); }

/* Dropdown groups */
.eq-group { position: relative; display: inline-flex; }
.eq-caret { font-size: 9px; opacity: .8; transition: transform .15s; }
.eq-group.open .eq-caret { transform: rotate(180deg); }
.eq-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 6px; min-width: 168px; z-index: 60;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px; display: none; flex-direction: column; gap: 2px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
}
.eq-menu a {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 9px 12px; border-radius: 8px; white-space: nowrap; display: block;
  transition: background .15s, color .15s;
}
.eq-menu a:hover { color: var(--text); background: var(--bg-soft); }
.eq-menu a.active { color: var(--accent); background: rgba(46,230,166,.08); }
.eq-group.open .eq-menu { display: flex; }
/* Hover-to-open on desktops; a small invisible bridge keeps hover alive across
   the gap between the button and the menu. Touch devices use click instead. */
@media (hover: hover) and (pointer: fine) {
  .eq-group:hover .eq-menu { display: flex; }
  .eq-group:hover .eq-caret { transform: rotate(180deg); }
  .eq-group::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 8px; }
}

.eq-right { display: flex; align-items: center; gap: 10px; }
.eq-badge {
  display: inline-block; border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 9px; font-size: 12px; color: var(--muted); white-space: nowrap;
}
/* Plan chips in the nav */
.eq-badge.eq-pro {
  border-color: var(--accent); color: #04231a; background: var(--accent);
  font-weight: 800; letter-spacing: .5px; text-decoration: none;
}
.eq-badge.eq-upgrade {
  border-color: var(--accent-dim); color: var(--accent); font-weight: 700;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s;
}
.eq-badge.eq-upgrade:hover { background: var(--accent); color: #04231a; }
/* Language toggle chip */
.eq-badge.eq-lang { cursor: pointer; font-weight: 700; text-decoration: none; transition: border-color .15s, color .15s; }
.eq-badge.eq-lang:hover { border-color: var(--accent); color: var(--accent); }
.eq-email { color: var(--muted); font-size: 13px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The display name doubles as the link to account settings */
.eq-account { text-decoration: none; cursor: pointer; transition: color .15s; font-weight: 600; }
.eq-account:hover { color: var(--text); }
.eq-logout { color: var(--muted); font-size: 13px; text-decoration: none; cursor: pointer; }
.eq-logout:hover { color: var(--text); }

/* Notifications bell + dropdown */
.eq-bell { position: relative; display: inline-flex; }
.eq-bell-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 30px; padding: 0; cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); transition: color .15s, border-color .15s;
}
.eq-bell-btn:hover { color: var(--accent); border-color: var(--accent-dim); }
.eq-bell-badge {
  position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: #ff5470; color: #fff;
  font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
  border: 1px solid var(--bg, #0b1018);
}
.eq-bell-menu {
  position: absolute; top: calc(100% + 8px); right: 0; width: 320px; max-width: 86vw;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45); z-index: 60; overflow: hidden;
}
.eq-bell-head {
  padding: 11px 14px; font-size: 13px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--line);
}
.eq-bell-list { max-height: 360px; overflow-y: auto; }
.nb-empty { padding: 22px 14px; color: var(--muted); font-size: 13px; text-align: center; }
.nb-item {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 14px;
  text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.nb-item:last-child { border-bottom: none; }
.nb-item:hover { background: rgba(46,230,166,.06); }
.nb-dot { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: transparent; }
.nb-item.unread { background: rgba(46,230,166,.05); }
.nb-item.unread .nb-dot { background: var(--accent); }
.nb-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nb-text { font-size: 13px; line-height: 1.35; color: #cdd8e6; }
.nb-who { color: var(--accent); font-weight: 700; }
.nb-title { color: var(--text); }
.nb-time { font-size: 11px; color: var(--muted); }

@media (max-width: 640px) {
  .eq-email { display: none; }
  .eq-links a { padding: 6px 9px; font-size: 13px; }
}

/* Page shell */
.page { flex: 1; width: 100%; }
.container { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* Buttons / inputs (shared) */
.btn {
  background: var(--accent); color: #04231a; border: none; padding: 13px 22px;
  border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background .2s, transform .05s;
}
.btn:hover:not(:disabled) { background: #34f0b0; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.input, textarea.input {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--text); padding: 13px 14px; border-radius: 10px; font-size: 15px;
  outline: none; transition: border-color .2s; font-family: inherit;
}
.input:focus, textarea.input:focus { border-color: var(--accent); }

.err { color: #ff7a7a; }
.muted { color: var(--muted); }

/* === Ryze-style "shooting star" heading treatment =======================
   Wrap a hero heading like:
     <span class="rb-scanhead"><h1>Title</h1><i class="rb-comet"></i></span>
   A small comet streaks diagonally past every few seconds (the "shooting
   star"). Pure CSS — no JS — and i18n-safe (the heading text and the comet are
   separate children, so translating the heading never wipes the comet). */
.rb-scanhead {
  position: relative;
  display: inline-block;
  isolation: isolate;
  vertical-align: top;
}
.rb-scanhead > h1,
.rb-scanhead > h2 { position: relative; z-index: 1; }
/* The shooting star — a comet with a tapering tail, crossing diagonally. */
.rb-scanhead .rb-comet {
  position: absolute;
  z-index: 3;
  left: -10%;
  top: 82%;
  width: 54px;
  height: 2px;
  pointer-events: none;
  border-radius: 2px;
  background: linear-gradient(90deg,
    rgba(46, 230, 166, 0) 0%,
    rgba(46, 230, 166, 0.45) 55%,
    rgba(214, 255, 239, 0.95) 100%);
  filter: drop-shadow(0 0 6px rgba(46, 230, 166, 0.6));
  opacity: 0;
  transform: rotate(-16deg);
  animation: rb-comet-shoot 9s ease-in 1.3s infinite;
}
.rb-scanhead .rb-comet::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  width: 5px;
  height: 5px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #eafff7;
  box-shadow: 0 0 8px 2px rgba(214, 255, 239, 0.9), 0 0 18px 6px rgba(46, 230, 166, 0.5);
}
@keyframes rb-comet-shoot {
  0%   { opacity: 0; left: -12%; top: 90%; }
  4%   { opacity: 1; }
  13%  { opacity: 1; }
  18%  { opacity: 0; left: 106%; top: -30%; }
  100% { opacity: 0; left: 106%; top: -30%; }
}

/* Rich text rendered from the model */
.rich p { margin-bottom: 10px; }
.rich p:last-child { margin-bottom: 0; }
.rich strong { color: #fff; }
.rich em { color: var(--accent); font-style: italic; }
.rich h3 { font-size: 19px; letter-spacing: -0.3px; margin-bottom: 10px; }
.rich h4 { font-size: 16px; color: var(--accent); margin-bottom: 8px; }
