/* ============================================================
   Practical AI for the Workplace — shared stylesheet
   Dark, technical, professional AI aesthetic.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #0a0f1e;
  --bg-soft: #0d1428;
  --surface: #111a30;
  --surface-2: #17223f;
  --border: #24304f;
  --border-strong: #33406a;

  --text: #e8edf8;
  --text-muted: #9aa6c3;
  --text-faint: #6b7794;

  --primary: #7c3aed;        /* violet */
  --primary-soft: #a78bfa;
  --accent: #22d3ee;         /* cyan */
  --accent-soft: #67e8f9;
  --danger: #f87171;
  --success: #34d399;

  --grad: linear-gradient(135deg, #7c3aed 0%, #4f46e5 50%, #0891b2 100%);
  --grad-text: linear-gradient(90deg, #a78bfa, #67e8f9);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow: 0 10px 30px rgba(3, 7, 18, 0.55);
  --shadow-soft: 0 4px 16px rgba(3, 7, 18, 0.35);

  --container: 1120px;
  --nav-height: 68px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1em; }

a { color: var(--accent-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }

.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head.centered { margin-left: auto; margin-right: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--grad-text);
  border-radius: 2px;
}

.muted { color: var(--text-muted); }

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  min-height: 44px;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary {
  background: var(--grad);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover { box-shadow: 0 8px 26px rgba(34, 211, 238, 0.3); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--accent); }

.btn-small { padding: 8px 14px; font-size: 0.85rem; min-height: 36px; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 15, 30, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .logo-mark {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--grad);
  color: #fff;
  flex: none;
}
.brand small {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); text-decoration: none; }
.nav-links a.active, .nav-links a[aria-current="page"] {
  color: var(--text);
  background: rgba(124, 58, 237, 0.16);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.nav-cta { flex: none; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 44px; height: 44px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 96px 0 84px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 320px at 18% 8%, rgba(124, 58, 237, 0.22), transparent 65%),
    radial-gradient(560px 320px at 85% 22%, rgba(8, 145, 178, 0.2), transparent 65%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(720px 420px at 50% 0%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(720px 420px at 50% 0%, black, transparent 80%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 22px;
}
.hero-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.hero p.lead {
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 640px;
  margin: 18px 0 32px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-points {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}
.hero-points div { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.9rem; }
.hero-points svg { color: var(--accent); flex: none; }

/* ---------- Cards / grids ---------- */
.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.card .icon {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: var(--primary-soft);
  margin-bottom: 16px;
}
.card .icon.cyan {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(103, 232, 249, 0.22);
  color: var(--accent-soft);
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 0.94rem; margin: 0; }

/* ---------- Split (two-column) sections ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.check-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-muted); }
.check-list svg { color: var(--success); flex: none; margin-top: 3px; }
.check-list strong { color: var(--text); font-weight: 600; }

/* Terminal-style illustration card */
.terminal {
  background: #0b1120;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.terminal-bar {
  display: flex;
  gap: 7px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.terminal-bar span:nth-child(1) { background: #f87171; }
.terminal-bar span:nth-child(2) { background: #fbbf24; }
.terminal-bar span:nth-child(3) { background: #34d399; }
.terminal pre { margin: 0; padding: 20px; overflow-x: auto; color: #b7c3e0; line-height: 1.7; }
.terminal .c-green { color: #34d399; }
.terminal .c-cyan { color: #67e8f9; }
.terminal .c-violet { color: #a78bfa; }
.terminal .c-dim { color: #64748b; }

/* ---------- Module (curriculum) cards ---------- */
.module-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.module-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }

.module-num {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent-soft);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}
.module-card h3 { font-size: 1.22rem; margin-bottom: 14px; }
.module-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.module-card li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text-muted);
  font-size: 0.92rem;
  padding-bottom: 9px;
  border-bottom: 1px dashed rgba(36, 48, 79, 0.8);
}
.module-card li:last-child { border-bottom: none; padding-bottom: 0; }
.module-card li svg { color: var(--primary-soft); flex: none; margin-top: 4px; }

/* ---------- Lesson list (Lessons page) ---------- */
.lesson-group { margin-bottom: 44px; }
.lesson-group > h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.3rem;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.lesson-group .module-chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-soft);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}
.lesson-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 10px;
  border-bottom: 1px solid rgba(36, 48, 79, 0.55);
  transition: background 0.15s ease;
}
.lesson-row:hover { background: rgba(255, 255, 255, 0.025); }
.lesson-row .lesson-no {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  width: 42px;
  flex: none;
}
.lesson-row .lesson-title { font-weight: 500; }
.lesson-row .lesson-desc { color: var(--text-muted); font-size: 0.88rem; margin: 2px 0 0; }
.lesson-row .lesson-tag {
  margin-left: auto;
  flex: none;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px 11px;
  white-space: nowrap;
}

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(420px 220px at 22% 0%, rgba(124, 58, 237, 0.28), transparent 70%),
    radial-gradient(420px 220px at 78% 100%, rgba(8, 145, 178, 0.25), transparent 70%),
    var(--surface);
}
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { color: var(--text-muted); max-width: 520px; margin: 0 auto 26px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 40px;
  background: var(--bg-soft);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 34px;
}
.site-footer h4 { font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.site-footer ul a { color: var(--text-muted); font-size: 0.92rem; }
.site-footer ul a:hover { color: var(--text); }
.footer-about p { color: var(--text-muted); font-size: 0.92rem; max-width: 340px; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 0.84rem;
}

/* ============================================================
   Chatbot page
   ============================================================ */
.chat-page-wrap { padding: 40px 0 64px; }

.chat-shell {
  display: flex;
  flex-direction: column;
  height: min(72vh, 760px);
  min-height: 480px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.chat-header .bot-avatar {
  width: 40px; height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
}
.chat-header .chat-title { line-height: 1.25; }
.chat-header .chat-title strong { display: block; font-size: 1rem; }
.chat-header .chat-title span {
  font-size: 0.8rem;
  color: var(--success);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chat-header .chat-title span::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
}
.chat-header-actions { margin-left: auto; display: flex; gap: 10px; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.msg { display: flex; gap: 12px; max-width: 85%; }
.msg .avatar {
  width: 32px; height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
}
.msg.assistant .avatar { background: var(--grad); color: #fff; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .avatar { background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-muted); }

.bubble {
  padding: 13px 17px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  min-width: 0;
}
.msg.assistant .bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}
.msg.user .bubble {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.32), rgba(79, 70, 229, 0.32));
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-top-right-radius: 4px;
  white-space: pre-wrap;
}
.msg.error .bubble {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

/* Markdown content inside assistant bubbles */
.bubble > *:first-child { margin-top: 0; }
.bubble > *:last-child { margin-bottom: 0; }
.bubble p { margin: 0 0 0.7em; }
.bubble ul, .bubble ol { margin: 0.4em 0 0.7em; padding-left: 1.3em; }
.bubble li { margin-bottom: 0.25em; }
.bubble h1, .bubble h2, .bubble h3, .bubble h4 { font-size: 1rem; margin: 0.8em 0 0.4em; }
.bubble a { color: var(--accent-soft); }
.bubble code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: rgba(103, 232, 249, 0.1);
  border: 1px solid rgba(103, 232, 249, 0.14);
  border-radius: 5px;
  padding: 1px 6px;
}
.bubble .code-block { position: relative; margin: 0.7em 0; }
.bubble .code-block pre {
  margin: 0;
  padding: 14px 16px;
  padding-top: 34px;
  background: #0b1120;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow-x: auto;
}
.bubble .code-block pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #c3cdea;
}
.bubble .copy-btn {
  position: absolute;
  top: 7px; right: 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.bubble .copy-btn:hover { color: var(--text); border-color: var(--accent); }
.bubble table { border-collapse: collapse; margin: 0.7em 0; display: block; overflow-x: auto; }
.bubble th, .bubble td { border: 1px solid var(--border-strong); padding: 6px 12px; font-size: 0.86rem; }
.bubble th { background: rgba(255, 255, 255, 0.04); }
.bubble blockquote {
  margin: 0.7em 0;
  padding: 4px 14px;
  border-left: 3px solid var(--primary-soft);
  color: var(--text-muted);
}

/* Typing indicator */
.typing { display: inline-flex; gap: 5px; align-items: center; padding: 6px 2px; }
.typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Composer */
.chat-composer {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
}
.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 10px 10px 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.composer-box:focus-within {
  border-color: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}
#chat-input {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.5;
  max-height: 160px;
  padding: 6px 0;
}
#chat-input::placeholder { color: var(--text-faint); }
#send-btn {
  flex: none;
  width: 42px; height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
#send-btn:hover:not(:disabled) { transform: translateY(-1px); }
#send-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.composer-hint {
  margin: 8px 4px 0;
  font-size: 0.76rem;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.composer-hint kbd {
  font-family: var(--mono);
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 1px 5px;
}

/* "How this chatbot works" diagram */
.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 28px 0;
}
.flow-node {
  width: min(340px, 100%);
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.flow-node small {
  display: block;
  font-family: var(--font);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
  margin-top: 3px;
}
.flow-node.highlight {
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(124, 58, 237, 0.14);
}
.flow-node.key-safe {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.07);
}
.flow-arrow {
  color: var(--accent-soft);
  padding: 7px 0;
  line-height: 1;
}

.notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--text-muted);
  font-size: 0.93rem;
}
.notice svg { color: var(--accent-soft); flex: none; margin-top: 2px; }
.notice strong { color: var(--text); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  position: relative;
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(520px 260px at 15% 0%, rgba(124, 58, 237, 0.16), transparent 70%),
    radial-gradient(520px 260px at 85% 20%, rgba(8, 145, 178, 0.13), transparent 70%);
}
.page-hero p { color: var(--text-muted); max-width: 640px; margin-bottom: 0; }

/* ---------- About page ---------- */
.about-highlight {
  border-left: 3px solid var(--primary-soft);
  padding: 6px 0 6px 22px;
  margin: 26px 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; margin-top: 34px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat b { display: block; font-size: 1.7rem; letter-spacing: -0.02em; }
.stat span { color: var(--text-muted); font-size: 0.85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; gap: 36px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-cta { display: none; }
}

@media (max-width: 780px) {
  .nav { gap: 12px; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: 14px 20px 18px;
    background: rgba(10, 15, 30, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 14px; font-size: 1rem; }

  .hero { padding: 64px 0 56px; }
  .section { padding: 52px 0; }
  .msg { max-width: 95%; }
  .chat-header-actions .btn span.label { display: none; }
  .cta-band { padding: 44px 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Account pages ---------- */
/* register.html / login.html / account.html — built from the tokens above,
   nothing here restyles an existing page. */

/* JS toggles state with the [hidden] attribute; grid/flex would beat it. */
[hidden] { display: none !important; }

.auth-wrap { padding: 48px 0 72px; }

.auth-card {
  max-width: 460px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 30px;
}
.auth-card h2 { font-size: 1.3rem; margin-bottom: 6px; }
.auth-card .auth-intro { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 22px; }
.auth-card .auth-intro:last-of-type { margin-bottom: 0; }

/* ---- Form fields ---- */
.auth-form { display: grid; gap: 18px; }

.field { display: grid; gap: 6px; }
.field label { font-size: 0.86rem; font-weight: 600; color: var(--text); }
.field label .optional { font-weight: 500; color: var(--text-faint); }

.field input {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus,
.field input:focus-visible {
  outline: none;
  border-color: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18); }

.field-hint { margin: 0; font-size: 0.78rem; color: var(--text-faint); }
.field-error { margin: 0; font-size: 0.8rem; font-weight: 500; color: var(--danger); }
.field-error:empty { display: none; }

/* ---- Status messages ---- */
.form-status {
  margin: 0;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}
.form-status.is-error {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}
.form-status.is-success {
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.35);
  color: #bbf7d0;
}

.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:disabled:hover { transform: none; }

.auth-alt {
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-notice { max-width: 560px; margin: 26px auto 0; }

/* ---- Registration success panel ---- */
.success-panel { text-align: center; }
.success-panel .success-mark {
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--success);
}
.success-panel .account-actions { justify-content: center; }
.success-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- Account overview ---- */
.account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
}
.account-identity h2 { margin-bottom: 2px; overflow-wrap: anywhere; }
.account-identity p { margin: 0; font-size: 0.92rem; overflow-wrap: anywhere; }

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin: 0 0 40px;
}
.account-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.account-item dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.account-item dd { margin: 0; }
.account-item .value { font-size: 1.02rem; font-weight: 600; overflow-wrap: anywhere; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-ok { color: var(--success); background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.3); }
.badge-off { color: var(--danger); background: rgba(248, 113, 113, 0.09); border-color: rgba(248, 113, 113, 0.32); }

.account-section-title { font-size: 1.15rem; margin-bottom: 6px; }
.account-section-note { font-size: 0.9rem; max-width: 640px; margin-bottom: 18px; }

.account-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ---- Device table (scrolls inside its own box, never the page) ---- */
.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  -webkit-overflow-scrolling: touch;
}
.device-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.device-table th {
  text-align: left;
  padding: 13px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.device-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(36, 48, 79, 0.6);
  color: var(--text-muted);
  white-space: nowrap;
}
.device-table tbody tr:last-child td { border-bottom: none; }
.device-table .mono {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.empty-state {
  text-align: center;
  padding: 40px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
  color: var(--text-muted);
  font-size: 0.93rem;
}
.empty-state p { margin: 0 0 6px; }
.empty-state p:last-child { margin-bottom: 0; }
.empty-state strong { color: var(--text); }

/* ---- Narrow screens (down to 360px) ---- */
@media (max-width: 560px) {
  .auth-wrap { padding: 32px 0 56px; }
  .auth-card { padding: 22px 18px; }
  .account-head { gap: 14px; }
  .account-head .btn { width: 100%; }
  .account-item { padding: 15px 16px; }
  .account-actions .btn { width: 100%; }
}
