/* Pipbit Developer Portal — Design System
   Brand-aligned with the Pipbit consumer brand (pipbit.webflow.io / Brand Style Guide):
   Google Sans Flex, Brand Blue #009BFF, graphite #161616, 20px / 100px rounding,
   pastel secondary accents. Developer offset = graphite chrome over light content. */

:root {
  /* --- Brand palette (from Brand Style Guide + live consumer CSS) --- */
  --white: #ffffff;
  --graphite: #161616;          /* brand neutral black */
  --graphite-1: #1d1d1f;        /* lifted graphite (cards/hover on dark) */
  --graphite-2: #2a2a2c;        /* code header / inset on dark */

  --brand-blue: #009bff;        /* accent */
  --brand-blue-bright: #41a8ea; /* lighter blue (links/active on dark) */
  --brand-blue-deep: #0082f3;   /* hover */
  --accent-tint: #ecf7fd;       /* accent-10 */
  --clear-blue: #dcf8fe;
  --soft-green: #c4ffdd;
  --warm-yellow: #ffffc4;
  --light-rose: #fdcad8;

  /* --- Light content surface (the "slightly darker" offset = cool off-white, not pure #fff) --- */
  --bg: #f3f5f7;                /* page background — cool, a touch darker than consumer white */
  --bg-surface: #ffffff;
  --bg-muted: #eceff3;
  --bg-inset: #f3f5f7;
  --bg-code: #161616;           /* graphite terminal/code blocks (brand) */

  --text: #161616;
  --text-secondary: #4b5159;
  --text-muted: #7b7b7b;        /* brand black-60 */
  --text-inverse: #ffffff;
  --text-code: #e8eef2;

  /* --- Accent roles --- */
  --accent: var(--brand-blue);
  --accent-hover: var(--brand-blue-deep);
  --accent-light: var(--accent-tint);
  --accent-subtle: var(--clear-blue);

  --border: #e4e7ec;
  --border-strong: #cad4da;     /* brand gray (cool) */

  /* --- Graphite chrome (sidebar / top-bar / footer) --- */
  --chrome-bg: var(--graphite);
  --chrome-text: #c7ccd2;
  --chrome-text-strong: #ffffff;
  --chrome-text-muted: #868d96;
  --chrome-hover: rgba(255, 255, 255, 0.07);
  --chrome-active-bg: rgba(0, 155, 255, 0.16);
  --chrome-active-text: var(--brand-blue-bright);
  --chrome-border: rgba(255, 255, 255, 0.10);

  /* --- Functional colors --- */
  --danger: #d23b3b;
  --danger-hover: #b02a2a;
  --danger-light: #fdecec;

  --warning: #c98a1e;
  --warning-light: #fbf3e0;

  --success: #1f9d57;
  --success-light: #e7f9ef;

  /* --- Rounding system (brand: 20px main, 100px full) --- */
  --radius-sm: 12px;
  --radius: 20px;               /* brand main radius — cards, inputs, containers */
  --radius-lg: 28px;            /* large feature / hero cards */
  --radius-pill: 100px;         /* brand full radius — buttons, chips, avatars */

  --shadow-sm: 0 1px 2px rgba(22, 22, 22, 0.05);
  --shadow: 0 4px 16px rgba(22, 22, 22, 0.07);
  --shadow-lg: 0 16px 40px rgba(22, 22, 22, 0.12);

  --font-sans: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', ui-monospace, 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;

  --sidebar-width: 208px;
}


/* === Reset & Base === */

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-muted);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

pre {
  background: var(--bg-code);
  color: var(--text-code);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
}
pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

img { max-width: 100%; }

::selection { background: var(--accent-subtle); color: var(--graphite); }


/* === Sidebar Layout (graphite chrome) === */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--chrome-bg);
  border-right: 1px solid var(--chrome-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
}

.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 1.4rem 1.25rem 1.1rem;
}
.site-logo:hover { text-decoration: none; }

.site-logo-img {
  height: 34px;
  width: auto;
  display: block;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.5rem 0.75rem;
}

.sidebar-nav a {
  position: relative;
  color: var(--chrome-text);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
  display: block;
}
.sidebar-nav a:hover {
  background: var(--chrome-hover);
  color: var(--chrome-text-strong);
  text-decoration: none;
}
.sidebar-nav a.active {
  background: var(--chrome-active-bg);
  color: var(--chrome-active-text);
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--chrome-text-muted);
  padding: 0.85rem 0.8rem 0.3rem;
}

.sidebar-footer {
  padding: 1rem 1.1rem 1.25rem;
  border-top: 1px solid var(--chrome-border);
}

.sidebar-user {
  margin-bottom: 0.75rem;
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.3;
  color: var(--chrome-text-strong);
}

.sidebar-user-email {
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--chrome-text-muted);
}

.sidebar-overlay {
  display: none;
}


/* === Top Bar (graphite chrome) === */

.top-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 2.5rem;
  height: 56px;
  background: var(--chrome-bg);
  border-bottom: 1px solid var(--chrome-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--chrome-border);
  border-radius: var(--radius-pill);
  color: var(--chrome-text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-width: 240px;
}
.top-bar-search:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.09);
}

.top-bar-search-icon {
  color: var(--chrome-text-muted);
  flex-shrink: 0;
}

.top-bar-spacer { flex: 1; }

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}

.top-bar-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--chrome-text);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fd07e;
  box-shadow: 0 0 0 3px rgba(47, 208, 126, 0.18);
  flex-shrink: 0;
}

.top-bar-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--chrome-text);
  white-space: nowrap;
  transition: color 0.15s ease;
}
.top-bar-link:hover {
  color: var(--chrome-text-strong);
  text-decoration: none;
}

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--chrome-text-strong);
  font-size: 1.25rem;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(22, 22, 22, 0.45);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar.open ~ .main-wrapper ~ .sidebar-overlay,
  .sidebar.open + .main-wrapper + .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  .main-wrapper {
    margin-left: 0;
  }
  .top-bar {
    padding: 0 1.25rem;
  }
  .nav-toggle {
    display: block;
  }
}


/* === Page Body === */

.page-body {
  flex: 1;
  padding: 2.75rem 3rem;
  max-width: 1120px;
}

@media (max-width: 768px) {
  .page-body {
    padding: 1.5rem;
  }
}


/* === Footer (graphite chrome) === */

.site-footer {
  border-top: 1px solid var(--chrome-border);
  padding: 2.75rem 3rem 1.75rem;
  color: var(--chrome-text-muted);
  font-size: 0.85rem;
  background: var(--chrome-bg);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--chrome-border);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col a {
  color: var(--chrome-text);
  font-size: 0.85rem;
}
.footer-col a:hover {
  color: var(--chrome-text-strong);
  text-decoration: none;
}

.footer-col-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--chrome-text-muted);
  margin-bottom: 0.35rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--chrome-text-strong);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.footer-logo-mark {
  width: 24px;
  height: 24px;
  display: block;
}

.footer-address {
  font-style: normal;
  color: var(--chrome-text);
  line-height: 1.5;
  font-size: 0.82rem;
}

.footer-contact a {
  color: var(--brand-blue-bright);
  font-size: 0.82rem;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--chrome-text-muted);
}

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

@media (max-width: 900px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 600px) {
  .site-footer { padding: 2rem 1.5rem 1.25rem; }
  .footer-top {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    text-align: left;
  }
}


/* === Buttons (brand pill) === */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
  text-decoration: none;
  line-height: 1.3;
  font-family: var(--font-sans);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--text-inverse);
  box-shadow: 0 6px 18px rgba(0, 155, 255, 0.28);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--bg-muted);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--bg-surface);
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.95rem;
  font-size: 0.82rem;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.45rem 0.85rem;
}
.btn-ghost:hover {
  background: var(--bg-muted);
  color: var(--text);
}

/* Ghost buttons placed inside graphite chrome (sidebar footer, top bar) */
.sidebar-footer .btn-ghost,
.top-bar .btn-ghost {
  color: var(--chrome-text);
}
.sidebar-footer .btn-ghost:hover,
.top-bar .btn-ghost:hover {
  background: var(--chrome-hover);
  color: var(--chrome-text-strong);
}


/* === Cards === */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-header h2,
.card-header h3 {
  margin: 0;
}


/* === Forms === */

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.form-group .form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.65rem 0.95rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 155, 255, 0.18);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-checkbox {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
  margin-bottom: 0.35rem;
}

.form-checkbox input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}


/* === Tables === */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  padding: 0.8rem 1rem;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
}

tbody td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: var(--bg-muted); }


/* === Badges / Status === */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-draft {
  background: var(--warning-light);
  color: var(--warning);
}
.badge-private {
  background: var(--bg-muted);
  color: var(--text-muted);
}
.badge-pending_publication {
  background: var(--accent-tint);
  color: #0a5fa6;
}
.badge-published {
  background: var(--success-light);
  color: var(--success);
}
.badge-suspended {
  background: var(--danger-light);
  color: var(--danger);
}
.badge-revoked {
  background: var(--bg-muted);
  color: var(--text-muted);
}
.badge-active {
  background: var(--success-light);
  color: var(--success);
}
.badge-expired {
  background: var(--bg-muted);
  color: var(--text-muted);
}
.badge-exhausted {
  background: var(--warning-light);
  color: var(--warning);
}


/* === Flash / Alerts === */

.flash {
  padding: 0.8rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  border: 1px solid;
}

.flash-success {
  background: var(--success-light);
  color: var(--success);
  border-color: #b6e9cb;
}

.flash-error {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #f5c8c8;
}

.flash-info {
  background: var(--accent-tint);
  color: #0a5fa6;
  border-color: #bfe4fb;
}


/* === Hero / Landing === */

.hero {
  padding: 2.5rem 0 3rem;
  max-width: 760px;
}

.hero-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-label::before {
  content: '';
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  line-height: 1.08;
  color: var(--text);
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-actions .btn {
  padding: 0.8rem 1.9rem;
  font-size: 1rem;
}


/* === Section Dividers === */

.section-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0 2rem;
}

.section-divider::before {
  content: '';
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.section-divider span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  white-space: nowrap;
}


/* === How It Works === */

.how-it-works {
  padding: 2rem 0 3rem;
}

.how-it-works h2 {
  margin-bottom: 1.5rem;
}

.how-it-works-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

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

.how-it-works-caption {
  margin-top: 1.5rem;
}


/* === Flow Diagram === */

.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.flow-node {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  text-align: center;
}

.flow-node-device { border-color: var(--border-strong); }
.flow-node-platform {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.flow-node-agent {
  border-color: #7bd3a4;
  background: var(--soft-green);
}

.flow-node-label {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.flow-node-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.flow-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0;
  color: var(--text-muted);
}

.flow-arrow::before {
  content: '';
  width: 2px;
  height: 16px;
  background: var(--border-strong);
}
.flow-arrow::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--border-strong);
}

.flow-arrow-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0.2rem 0;
}


/* === Code Example (landing) — brand terminal === */

.code-example {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--graphite-2);
  box-shadow: var(--shadow);
}

.code-example-header {
  background: var(--graphite-2);
  color: #aab2bd;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  padding: 0.6rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-example pre {
  margin: 0;
  border-radius: 0;
}


/* === Feature Grid === */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0 3rem;
}
@media (max-width: 900px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .features { grid-template-columns: 1fr; }
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.feature-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-tint);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}
/* Rotate brand pastel accents across feature cards (no template change needed) */
.features .feature-card:nth-child(4n+1) .feature-icon { background: var(--accent-tint); }
.features .feature-card:nth-child(4n+2) .feature-icon { background: var(--soft-green); }
.features .feature-card:nth-child(4n+3) .feature-icon { background: var(--warm-yellow); }
.features .feature-card:nth-child(4n)   .feature-icon { background: var(--light-rose); }

.feature-card h3 { font-size: 1.05rem; }
.feature-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin: 0;
}


/* === Docs Layout === */

.docs-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .docs-layout { grid-template-columns: 1fr; }
}

.docs-sidebar {
  position: sticky;
  top: 1rem;
}

.docs-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.docs-sidebar nav a {
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
}
.docs-sidebar nav a:hover {
  background: var(--bg-muted);
  color: var(--text);
  text-decoration: none;
}
.docs-sidebar nav a.active {
  background: var(--accent-tint);
  color: var(--accent-hover);
}

.docs-content {
  max-width: 780px;
}

.docs-content h2 {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.docs-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}


/* === Legal Pages (Terms, Privacy) === */

.legal-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.legal-header {
  padding-bottom: 1.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.legal-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.legal-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.legal-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.legal-section {
  margin-bottom: 2.25rem;
}

.legal-section h2 {
  font-size: 1.15rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.legal-section h3 {
  font-size: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.legal-section p,
.legal-section ul {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

.legal-section ul {
  padding-left: 1.25rem;
}

.legal-section li {
  margin-bottom: 0.4rem;
}

.legal-section strong {
  color: var(--text);
  font-weight: 600;
}

.legal-address {
  font-style: normal;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 1rem 1.25rem;
  background: var(--bg-muted);
  border-radius: var(--radius);
  display: inline-block;
}


/* === Stats Row (Dashboard) === */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-top: 0.25rem;
}


/* === Agent Cards (Directory) === */

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.agent-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.agent-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.agent-avatar {
  width: 42px;
  height: 42px;
  background: var(--accent-tint);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--accent-hover);
  font-size: 1rem;
}

.agent-card-name { font-weight: 600; font-size: 1.05rem; }
.agent-card-org { font-size: 0.82rem; color: var(--text-muted); }

.agent-card-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.agent-card-skills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.skill-tag {
  background: var(--bg-muted);
  color: var(--text-secondary);
  padding: 0.18rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
}


/* === Copy-to-clipboard field === */

.copy-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-code);
  color: var(--text-code);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.copy-field code { background: none; color: inherit; padding: 0; flex: 1; }

.copy-field .btn-ghost { color: #aab2bd; }
.copy-field .btn-ghost:hover { color: var(--text-inverse); background: rgba(255,255,255,0.1); }


/* === Empty state === */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 1rem;
  margin-bottom: 1.5rem;
}


/* === Auth pages === */

.auth-page {
  max-width: 440px;
}

.auth-page .card { padding: 2rem; }

.auth-page h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.auth-page .auth-subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.auth-alt {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}


/* === Section headers === */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section-header h2 { margin: 0; }


/* === Utilities === */

.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-mono { font-family: var(--font-mono); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}


/* === Voice picker (agent form) === */

.voice-picker-chosen {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.voice-picker-chosen .form-input { flex: 1; }

.voice-picker-controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
}
.voice-picker-controls .form-input { flex: 1; }
.voice-picker-controls .form-select { width: auto; }
.voice-picker-controls .btn { white-space: nowrap; }

.voice-picker-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.voice-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
.voice-row:last-child { border-bottom: none; }
.voice-row.voice-row-selected { background: var(--accent-light); }

.voice-row-info { flex: 1; min-width: 0; }
.voice-row-name { font-weight: 600; font-size: 0.9rem; }
.voice-row-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-left: 0.45rem;
}
.voice-row-desc {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}
.voice-row-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.voice-row-reason {
  color: var(--accent-hover);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}
.voice-row-more { justify-content: center; }
