: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); }
@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); }

/* 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; }
