:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef4ff;
  --text: #182230;
  --muted: #627083;
  --border: #d9e2ef;
  --brand: #0857d9;
  --brand-dark: #0646ad;
  --accent: #f5b942;
  --success: #1f9d66;
  --danger: #d64545;
  --shadow: 0 18px 45px rgba(24, 34, 48, 0.10);
  --shadow-soft: 0 8px 28px rgba(24, 34, 48, 0.08);
}

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

html {
  min-width: 320px;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.section {
  padding: 34px 0;
}

.section h2 {
  margin: 0 0 14px;
  font-size: 1.55rem;
  line-height: 1.2;
}

.section p {
  max-width: 780px;
  color: var(--muted);
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.navbar {
  width: min(1120px, calc(100% - 32px));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-name svg {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.nav-links a:hover {
  background: var(--surface-2);
  color: var(--brand);
  text-decoration: none;
}

.hero {
  background: var(--brand);
  color: #fff;
  text-align: center;
  padding: 72px 16px 76px;
}

.hero-content {
  width: min(820px, 100%);
  margin: 0 auto;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.05;
  font-weight: 800;
}

.hero .subtitle {
  margin: 0 auto 30px;
  max-width: 680px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  background: var(--brand-dark);
  color: #fff;
  text-decoration: none;
}

.btn:focus-visible,
.form-input:focus,
.key-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(8, 87, 217, 0.16);
}

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

.btn-secondary:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #b83232;
}

.btn-cta {
  background: var(--accent);
  color: #1d2939;
}

.btn-cta:hover {
  background: #e7aa2c;
  color: #1d2939;
}

.feature-list,
.pricing-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}

.feature-list li,
.pricing-list li {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

pre {
  max-width: 100%;
  margin: 18px 0 30px;
  padding: 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111827;
  color: #dbeafe;
  font-size: 0.9rem;
  line-height: 1.45;
}

.site-footer {
  margin-top: 36px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 0;
  color: var(--muted);
}

.auth-page,
.app-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(8, 87, 217, 0.12), transparent 34rem),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

.auth-shell {
  width: min(440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 800;
}

.auth-card,
.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card {
  padding: 32px;
}

.auth-card h1,
.panel h1,
.panel h2,
.panel h3 {
  margin: 0;
  line-height: 1.2;
}

.auth-card h1 {
  font-size: 1.8rem;
}

.auth-subtitle,
.page-subtitle {
  margin: 8px 0 26px;
  color: var(--muted);
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  margin-bottom: 7px;
  color: #344054;
  font-size: 0.92rem;
  font-weight: 750;
}

.form-input,
.key-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.form-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row .form-label {
  margin: 0;
}

.auth-card .btn,
.auth-card form .btn {
  width: 100%;
}

.auth-switch {
  margin: 20px 0 0;
  color: var(--muted);
  text-align: center;
}

.toast {
  display: none;
  padding: 12px 14px;
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
}

.toast.info {
  background: var(--brand);
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 54px;
}

.app-topbar {
  min-height: 72px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
}

.app-topbar-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  line-height: 1.15;
}

.panel {
  padding: 24px;
  margin-bottom: 20px;
}

.integration-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1fr);
  gap: 20px;
  align-items: center;
}

.integration-panel pre {
  margin: 0;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header h2 {
  font-size: 1.25rem;
}

.keys-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.key-item {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
}

.key-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.key-title strong {
  overflow-wrap: anywhere;
  font-size: 1.02rem;
}

.key-field {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  margin: 10px 0;
}

.key-field-label {
  padding-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.key-input {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 0.92rem;
}

textarea.key-input {
  min-height: 90px;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.action-btn {
  white-space: nowrap;
}

.empty-state,
.error {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdff;
}

.error {
  color: #9f1239;
  border-color: #fecdd3;
  background: #fff1f2;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  inset: 0;
  overflow: auto;
  padding: 24px;
  background-color: rgba(15, 23, 42, 0.56);
}

.modal-content {
  width: min(420px, 100%);
  margin: 10vh auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.modal-content input[type="password"] {
  width: 100%;
  min-height: 44px;
  margin: 14px 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 760px) {
  .navbar,
  .app-topbar-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 0;
  }

  .brand-name,
  .auth-brand {
    justify-content: center;
  }

  .nav-links {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero {
    padding: 56px 16px 60px;
  }

  .container,
  .app-shell {
    width: min(100% - 24px, 1120px);
  }

  .auth-shell {
    width: min(100% - 24px, 440px);
    padding: 36px 0;
  }

  .auth-card,
  .panel {
    padding: 20px;
  }

  .page-heading,
  .panel-header,
  .key-title {
    flex-direction: column;
    align-items: stretch;
  }

  .key-field {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .key-field-label {
    padding-top: 0;
  }

  .key-field .btn {
    width: 100%;
  }

  .key-title .btn {
    width: 100%;
  }
}

/* Public product page polish */
code {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-cta {
  background: var(--brand);
  color: #fff !important;
}

.nav-cta:hover {
  background: var(--brand-dark) !important;
  color: #fff !important;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.38);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.hero {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 26rem),
    linear-gradient(135deg, #0746b8 0%, #0857d9 54%, #0b6ce6 100%);
  color: #fff;
  padding: 72px 16px 76px;
  text-align: left;
}

.hero-grid {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: center;
  gap: 52px;
}

.hero-copy {
  max-width: 690px;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.25rem, 5vw, 4.35rem);
  line-height: 1.02;
  font-weight: 850;
}

.hero .subtitle {
  margin: 0 0 30px;
  max-width: 690px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.02rem, 2vw, 1.22rem);
}

.hero .eyebrow {
  color: #bfdbfe;
}

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

.hero-console {
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.24);
  overflow: hidden;
}

.console-top {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.74);
}

.console-top span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
}

.console-top span:nth-child(1) {
  background: #ef4444;
}

.console-top span:nth-child(2) {
  background: #f59e0b;
}

.console-top span:nth-child(3) {
  background: #22c55e;
}

.console-top strong {
  margin-left: auto;
  color: #dbeafe;
  font-size: 0.86rem;
}

.stream-line,
.stream-card,
.stream-route {
  margin: 16px;
}

.stream-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #dbeafe;
  font-weight: 750;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
}

.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}

.stream-card {
  padding: 18px;
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.44);
}

.stream-card code {
  display: block;
  margin-top: 8px;
  color: #bfdbfe;
  white-space: normal;
  overflow-wrap: anywhere;
}

.code-muted {
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stream-route {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
}

.route-line {
  height: 2px;
  background: linear-gradient(90deg, rgba(191, 219, 254, 0.2), #bfdbfe, rgba(191, 219, 254, 0.2));
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.trust-grid div,
.use-case-grid div {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.trust-grid strong,
.trust-grid span,
.use-case-grid strong,
.use-case-grid span,
.site-footer strong,
.site-footer span {
  display: block;
}

.trust-grid span,
.use-case-grid span {
  margin-top: 4px;
  color: var(--muted);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(440px, 1.1fr);
  gap: 42px;
  align-items: start;
}

.split-section > *,
.integration-panel > * {
  min-width: 0;
}

.steps-list {
  margin: 24px 0 0;
  padding-left: 22px;
  color: var(--text);
}

.steps-list li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.feature-list,
.pricing-list,
.use-case-grid {
  display: grid;
  gap: 14px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list,
.use-case-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pricing-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-list article,
.pricing-list article {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.feature-list h3,
.pricing-list h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.feature-list p,
.pricing-list p {
  margin: 0;
  color: var(--muted);
}

.account-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 0 0 auto;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
  margin-top: 12px;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 850;
}

.faq-list details p {
  margin: 12px 0 0;
}

.faq-list code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--brand-dark);
}

.footer-content {
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
}

@media (max-width: 900px) {
  .hero-grid,
  .split-section,
  .integration-panel,
  .trust-grid,
  .feature-list,
  .pricing-list,
  .use-case-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    text-align: center;
  }

  .hero-copy,
  .hero .subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions,
  .account-actions {
    justify-content: center;
  }

  .account-band,
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 520px) {
  .hero-console {
    display: none;
  }

  .stream-route {
    grid-template-columns: 1fr;
  }

  .route-line {
    display: none;
  }

  .hero-actions .btn,
  .account-actions .btn {
    width: 100%;
  }
}
