@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ───────────────────────────────────────────────────────────────
   ProLevelMax — base stylesheet
   Aesthetic: warm dark, modern sans for body, mono only where it fits
   ─────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,700;1,400&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  --bg:        #0c0a08;   /* near black, warm */
  --bg-soft:   #16120e;
  --panel:     #1a1612;
  --panel-2:   #221c16;
  --border:    #2e2620;
  --border-hi: #4a3d33;
  --ink:       #f0e6d6;   /* warm cream */
  --ink-dim:   #a89882;
  --ink-soft:  #756553;
  --amber:     #f59e0b;
  --amber-2:   #d97706;
  --teal:      #4ade80;   /* terminal green for success */
  --red:       #ef4444;
  --shadow:    0 0 0 1px rgba(245, 158, 11, 0.0), 0 20px 40px -20px rgba(0,0,0,0.6);

  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Subtle grain texture overlay — gives surfaces some depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 0% 0%, rgba(245, 158, 11, 0.06), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(74, 222, 128, 0.04), transparent 50%);
}
body > * { position: relative; z-index: 1; }

a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease;
}
a:hover { border-bottom-color: var(--amber); }

code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2.5rem, 5.5vw, 4rem); line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: 1.75rem; line-height: 1.2; }
h3 { font-size: 1.15rem; line-height: 1.3; }

p { margin: 0 0 1em; color: var(--ink-dim); }
p strong { color: var(--ink); }

/* ── Nav ────────────────────────────────────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(12, 10, 8, 0.85);
  backdrop-filter: blur(10px);
  z-index: 50;
}
.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-brand:hover { border: none; }
.nav-links {
  display: flex;
  gap: 1.8rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.nav-links a {
  color: var(--ink-dim);
  border: none;
}
.nav-links a:hover { color: var(--ink); border: none; }
.nav-links a.active { color: var(--ink); }

/* ── Buttons ────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 4px;
  border: 1px solid var(--border-hi);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 120ms ease;
  text-decoration: none;
}
.btn:hover {
  background: var(--panel-2);
  border-color: var(--amber);
  border-bottom-color: var(--amber);
}
.btn-primary {
  background: var(--amber);
  color: #1a1208;
  border-color: var(--amber);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--amber-2);
  border-color: var(--amber-2);
  transform: translateY(-1px);
}
.btn-danger {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--red);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
}
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Forms ──────────────────────────────────────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}
.field label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.field input,
.field textarea,
.field select {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.7rem 0.9rem;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: border-color 120ms ease;
  width: 100%;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--amber);
  background: var(--bg);
}
.field .hint { font-size: 0.78rem; color: var(--ink-soft); font-family: var(--font-mono); }

/* ── Cards / panels ─────────────────────────────────────────────── */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.panel-header h2,
.panel-header h3 {
  margin: 0;
}

/* ── Containers ─────────────────────────────────────────────────── */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}
.container-narrow {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Hero (landing) ─────────────────────────────────────────────── */

.hero {
  padding: 5rem 0 4rem;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: center;
}
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; padding: 3rem 0; gap: 2.5rem; }
}
.hero h1 {
  margin-bottom: 1.2rem;
}
.hero h1 .accent { color: var(--amber); }
.hero .lede {
  font-size: 1.15rem;
  color: var(--ink-dim);
  margin-bottom: 2rem;
  max-width: 36ch;
}
.hero-cta {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* ── Terminal block (hero right side, decorative) ───────────────── */

.terminal {
  background: #0a0806;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(to bottom, #1c1812, #16120e);
  border-bottom: 1px solid var(--border);
}
.terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #3a3128;
}
.terminal-title {
  margin-left: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.terminal-body {
  padding: 1.3rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  min-height: 280px;
}
.terminal-body .line { display: block; }
.terminal-body .prompt { color: var(--amber); }
.terminal-body .cmd { color: var(--ink); }
.terminal-body .out { color: var(--ink-dim); }
.terminal-body .ok { color: var(--teal); }
.terminal-body .dim { color: var(--ink-soft); }
.terminal-body .cursor {
  display: inline-block;
  width: 0.5em;
  background: var(--amber);
  color: var(--amber);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Features grid (landing) ────────────────────────────────────── */

.features {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.feature {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  transition: all 200ms ease;
}
.feature:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
}
.feature-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--amber);
  border-radius: 4px;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-weight: 700;
}
.feature h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}
.feature p {
  font-size: 0.92rem;
  margin: 0;
}

/* ── Section ────────────────────────────────────────────────────── */

.section {
  padding: 4rem 0;
}
.section-heading {
  text-align: center;
  margin-bottom: 3rem;
}
.section-heading h2 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}
.section-heading p {
  max-width: 50ch;
  margin: 0 auto;
  color: var(--ink-soft);
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--amber);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

/* ── Comparison table ───────────────────────────────────────────── */

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.compare-table th,
.compare-table td {
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
}
.compare-table th {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.compare-table .yes { color: var(--teal); }
.compare-table .no  { color: var(--ink-soft); }

/* ── Code block ─────────────────────────────────────────────────── */

.code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink);
  overflow-x: auto;
  position: relative;
}
.code-copy {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--ink-dim);
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms;
}
.code:hover .code-copy { opacity: 1; }
.code-copy:hover { color: var(--amber); border-color: var(--amber); }
.code-copy.copied { color: var(--teal); border-color: var(--teal); opacity: 1; }

/* ── Footer ─────────────────────────────────────────────────────── */

.footer {
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}
.footer a { color: var(--ink-dim); }

/* ── Auth pages ─────────────────────────────────────────────────── */

.auth-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-box {
  width: 100%;
  max-width: 420px;
}
.auth-box .auth-brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 0.4rem;
}
.auth-box .auth-sub {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.auth-box .panel {
  padding: 2rem;
}
.auth-box .field:last-of-type { margin-bottom: 1.5rem; }
.auth-foot {
  text-align: center;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ── Messages ──────────────────────────────────────────────────── */

.alert {
  padding: 0.8rem 1rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid;
}
.alert-error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}
.alert-success {
  color: var(--teal);
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.3);
}
.alert-warning {
  color: var(--amber);
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
}

/* ── Dashboard ──────────────────────────────────────────────────── */

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 720px) {
  .dash-grid { grid-template-columns: 1fr; }
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 720px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat {
  padding: 1.2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
}
.stat-value.accent { color: var(--amber); }
.stat-value.success { color: var(--teal); }
.stat-value.danger { color: var(--red); }

.keys-list {
  margin-top: 1rem;
}
.key-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.key-row:last-child { border-bottom: none; }
.key-row .key-info { min-width: 0; }
.key-row .key-prefix {
  color: var(--ink);
  margin-right: 0.5rem;
}
.key-row .key-label {
  color: var(--ink-dim);
}
.key-row .key-meta {
  color: var(--ink-soft);
  font-size: 0.78rem;
  margin-top: 0.2rem;
}
.key-row.revoked { opacity: 0.4; }
.key-row.revoked .key-prefix { text-decoration: line-through; }

.key-reveal {
  background: var(--bg);
  border: 1px solid var(--amber);
  border-radius: 6px;
  padding: 1.2rem;
  margin-top: 1rem;
}
.key-reveal-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.key-reveal-value {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  word-break: break-all;
  color: var(--ink);
  background: var(--bg-soft);
  padding: 0.8rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin-bottom: 0.8rem;
  user-select: all;
}
.key-reveal-warning {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--amber);
}

.usage-chart {
  height: 140px;
  margin: 1rem 0;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 0 0.3rem;
  border-bottom: 1px solid var(--border);
}
.usage-bar {
  flex: 1;
  background: var(--amber);
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  position: relative;
  opacity: 0.7;
  transition: opacity 120ms;
}
.usage-bar:hover { opacity: 1; }
.usage-bar[data-empty] { background: var(--border); }

.recent-list {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.recent-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.recent-row:last-child { border-bottom: none; }
.recent-row .status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}
.recent-row .status.error { background: var(--red); }
.recent-row .actor { color: var(--ink); }
.recent-row .items { color: var(--ink-dim); }
.recent-row .time { color: var(--ink-soft); }

/* ── Tab strip ──────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0.2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.tab {
  padding: 0.8rem 1.2rem;
  background: none;
  border: none;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 120ms;
}
.tab:hover { color: var(--ink-dim); }
.tab.active {
  color: var(--ink);
  border-bottom-color: var(--amber);
}

/* ── Modal ─────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  padding: 1.8rem;
  max-width: 460px;
  width: 100%;
}
.modal h3 { margin-bottom: 0.5rem; }
.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ── Loading / empty states ────────────────────────────────────── */

.loading,
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* ── Typing animation (hero) ───────────────────────────────────── */
@keyframes typingFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.terminal-body .line {
  animation: typingFadeIn 400ms ease backwards;
}
.terminal-body .line:nth-child(1)  { animation-delay: 0.1s; }
.terminal-body .line:nth-child(2)  { animation-delay: 0.4s; }
.terminal-body .line:nth-child(3)  { animation-delay: 0.7s; }
.terminal-body .line:nth-child(4)  { animation-delay: 1.0s; }
.terminal-body .line:nth-child(5)  { animation-delay: 1.3s; }
.terminal-body .line:nth-child(6)  { animation-delay: 1.6s; }
.terminal-body .line:nth-child(7)  { animation-delay: 1.9s; }
.terminal-body .line:nth-child(8)  { animation-delay: 2.2s; }
.terminal-body .line:nth-child(9)  { animation-delay: 2.5s; }

/* ── Small utilities ───────────────────────────────────────────── */
.mono { font-family: var(--font-mono); }
.dim  { color: var(--ink-soft); }
.row  { display: flex; align-items: center; gap: 0.5rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.78rem; }
.spacer-1 { height: 1rem; }
.spacer-2 { height: 2rem; }

/* ════════════════════════════════════════════════════════════════
   Mobile / responsive
   Three breakpoints:
     ≤900px  — tablet: tighten padding, single-column grids
     ≤600px  — phone: stack nav, scrollable tabs, full-width modals
     ≤380px  — small phone: shrink type a notch
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .container { padding: 0 1.2rem; }
  .container-narrow { padding: 0 1.2rem; }
  .nav { padding: 1.1rem 1.2rem; }
  .features-grid { grid-template-columns: 1fr; }
  .code-examples-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  /* Nav: brand on top, links wrap below */
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.9rem 1.2rem;
  }
  .nav-links {
    gap: 1.1rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
  }

  /* Headings scale down */
  h1 { font-size: 1.6rem !important; }
  h2 { font-size: 1.25rem; }
  .hero h1 { font-size: 2rem !important; }
  .lede { font-size: 1rem; }

  /* Tabs scroll horizontally instead of wrapping/squashing */
  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    padding: 0.7rem 0.9rem;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* All multi-column grids collapse */
  .dash-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .features-grid,
  .code-examples-grid { grid-template-columns: 1fr; }

  /* Panels: less padding */
  .panel { padding: 1.1rem; }

  /* Modals go (nearly) full-screen */
  .modal-backdrop { padding: 0.8rem; align-items: flex-start; padding-top: 2.5rem; }
  .modal {
    max-width: 100%;
    padding: 1.3rem;
    max-height: 88vh;
    overflow-y: auto;
  }

  /* Crypto deposit modal: QR + address stack vertically */
  #crypto-deposit-content > div {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  #crypto-deposit-content img {
    width: 150px !important;
    height: 150px !important;
    align-self: center;
  }

  /* Key rows & recent rows: let content wrap, drop fixed columns */
  .key-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .recent-row {
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem 0.6rem;
    font-size: 0.82rem;
  }
  .recent-row .time { display: none; }  /* least important, save space */

  /* Code blocks: smaller, still scrollable */
  .code, pre.code {
    font-size: 0.75rem;
    padding: 0.8rem;
  }

  /* Tables scroll horizontally inside their container */
  .compare-table { font-size: 0.8rem; }
  .compare-table th,
  .compare-table td { padding: 0.5rem 0.6rem; }

  /* Terminal demo on landing */
  .terminal-body { font-size: 0.72rem; }

  /* Buttons a touch bigger for tap targets */
  .btn { padding: 0.65rem 1rem; }
  .btn-sm { padding: 0.5rem 0.8rem; }

  /* Forms full-width */
  .field input,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"] {
    width: 100%;
    box-sizing: border-box;
  }

  /* Modal action buttons stack */
  .modal-actions {
    flex-direction: column-reverse;
  }
  .modal-actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 380px) {
  body { font-size: 0.92rem; }
  .hero h1 { font-size: 1.7rem !important; }
  .stat-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 0.9rem; }
}

/* Make wide tables/code blocks scrollable rather than overflowing
   on any narrow viewport */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ════════════════════════════════════════════════════════════════
   Brand-friendly landing additions: AI chat demo, step cards
   ════════════════════════════════════════════════════════════════ */

/* AI chat demo bubble (replaces terminal on landing hero) */
.chat-demo {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.chat-bubble {
  padding: 0.9rem 1.1rem;
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.chat-user {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  align-self: flex-end;
  max-width: 88%;
}
.chat-ai {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.20);
  align-self: flex-start;
  max-width: 95%;
}
.chat-from {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
.chat-thinking {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* 3-step "how it works" grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.step {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.4rem 1.3rem;
  position: relative;
}
.step-num {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 0.5rem;
  line-height: 1;
}
.step h3 {
  margin-bottom: 0.5rem;
}
.step p {
  color: var(--ink-dim);
  margin-bottom: 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .steps-grid { grid-template-columns: 1fr; }
}

/* Connect tab: step labels, copy rows, setup cards */
.step-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.10em;
  color: var(--amber);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.copy-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.copy-target {
  flex: 1;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
  word-break: break-all;
  user-select: all;
  display: flex;
  align-items: center;
}
.copy-btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.setup-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
}
.setup-card summary {
  cursor: pointer;
  font-size: 0.95rem;
  list-style: none;
  outline: none;
}
.setup-card summary::-webkit-details-marker { display: none; }
.setup-card[open] summary {
  margin-bottom: 0.7rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}
.setup-list {
  margin: 0;
  padding-left: 1.4rem;
  color: var(--ink-dim);
  font-size: 0.92rem;
  line-height: 1.7;
}
.setup-list li { margin-bottom: 0.3rem; }
.setup-list strong { color: var(--ink); }
.setup-list code {
  background: var(--bg);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85rem;
}

/* Language switcher in nav */
.lang-switch {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px;
}
.lang-switch [data-lang] {
  padding: 3px 8px;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 3px;
  font-family: inherit;
  font-size: inherit;
}
.lang-switch [data-lang]:hover { color: var(--ink-dim); }
.lang-switch [data-lang].active {
  background: var(--bg-soft);
  color: var(--ink);
}

/* Auth pages brand mark above the heading */
.auth-logo {
  display: block;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink-dim);
  text-decoration: none;
  margin-bottom: 2rem;
  border: none;
}
.auth-logo:hover { color: var(--ink); border: none; }

/* Data-point list inside platform feature cards */
.data-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.data-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.32rem 0;
  color: var(--ink-dim);
  font-size: 0.92rem;
  line-height: 1.45;
}
.data-list li::before {
  content: '';
  flex-shrink: 0;
  width: 4px;
  height: 4px;
  margin-top: 0.55rem;
  border-radius: 50%;
  background: var(--amber);
}

/* Payment method options (coming soon list) */
.pay-option {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
}
.pay-option:first-of-type { border-top: none; padding-top: 0.4rem; }
.pay-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  font-family: var(--font-sans);
}
.pay-info { flex: 1; min-width: 0; }
.pay-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 0.15rem;
}
.pay-desc { line-height: 1.4; }
.pay-btn {
  flex-shrink: 0;
  opacity: 0.6;
  cursor: not-allowed !important;
}

/* Truncate long emails in dashboard nav so they don't push other items off */
#user-email {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}
@media (max-width: 700px) {
  #user-email { max-width: 130px; }
}

/* Code snippet with overlay Copy button */
.snippet {
  position: relative;
  margin: 0.6rem 0;
}
.snippet .snippet-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
}

/* Compact nav on phones — items wrap nicely instead of squishing */
@media (max-width: 700px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
  }
  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
  }
  #user-email { max-width: 150px; font-size: 0.8rem; }
  .lang-switch { margin-left: auto; }
}
