:root {
  color-scheme: dark;
  --ink: #f2f2f2;
  --muted: #9b9b9b;
  --line: #2e2e2e;
  --paper: #000000;
  --panel: #101010;
  --panel-strong: #151515;
  --accent: #f6821f;
  --accent-soft: rgba(246, 130, 31, 0.14);
  --blue: #2f7df6;
  --blue-soft: rgba(47, 125, 246, 0.16);
  --green: #00b663;
  --green-soft: rgba(0, 182, 99, 0.14);
  --gold: #f5a524;
  --gold-soft: rgba(245, 165, 36, 0.16);
  --rose: #ff4d5e;
  --rose-soft: rgba(255, 77, 94, 0.15);
  --shadow: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #000000;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 13px;
}

body.app-booting .auth-view,
body.app-booting .onboarding,
body.app-booting .app-shell {
  visibility: hidden;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px 1fr;
  background: #000000;
}

.hidden {
  display: none !important;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  min-height: 32px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
  padding: 0 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
}

button.secondary {
  background: #0b0b0b;
  color: var(--ink);
  border-color: var(--line);
}

button.danger {
  color: #ff9aa4;
  border-color: rgba(255, 77, 94, 0.45);
  background: rgba(255, 77, 94, 0.08);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #080808;
  color: var(--ink);
  border-radius: 6px;
  padding: 8px 9px;
}

textarea {
  resize: vertical;
  min-height: 84px;
}

.sidebar {
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background: #050505;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-view,
.onboarding {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: #000000;
}

.onboarding-panel {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.setup-content {
  min-height: calc(100vh - 190px);
}

.setup-visual {
  min-height: 360px;
  display: grid;
  place-items: center;
}

.setup-visual .onboarding-panel {
  width: min(620px, calc(100% - 40px));
  border-color: #2b2b2b;
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    #050505;
}

.setup-visual .url-form {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.landing-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 24px 28px;
  overflow: visible;
  background:
    radial-gradient(circle at 14% 88%, rgba(246, 130, 31, 0.1), transparent 26%),
    radial-gradient(circle at 82% 30%, rgba(47, 125, 246, 0.08), transparent 30%),
    linear-gradient(180deg, #020202 0%, #050505 52%, #000000 100%);
}

.landing-nav {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 28px;
  justify-content: space-between;
  padding: 4px 0;
}

.landing-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.landing-menu a,
.text-login {
  color: #c7c7c7;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.landing-menu a:hover,
.text-login:hover {
  color: var(--ink);
}

.landing-login {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.ghost-login {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: var(--ink);
  background: #101010;
  padding: 0 13px;
  text-decoration: none;
  font-weight: 600;
}

.landing-content {
  width: min(1180px, 100%);
  flex: 1;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 74px 0;
}

.landing-copy {
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
}

.landing-copy h1 {
  max-width: 920px;
  margin-bottom: 0;
  font-size: clamp(2.6rem, 6vw, 5.5rem);
  line-height: 0.95;
}

.landing-copy h1 span {
  display: block;
}

.landing-kicker {
  max-width: 760px;
  margin-bottom: 0;
  color: #bdbdbd;
  font-size: clamp(1.1rem, 2.3vw, 2rem);
  line-height: 1.5;
}

.landing-actions {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.landing-actions .auth-hint {
  max-width: 340px;
  color: #777777;
  font-size: 0.75rem;
}

#authView .auth-hint {
  display: none;
}

.landing-visual {
  min-height: 520px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 42%),
    #050505;
}

.landing-footer {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.landing-footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 20px 0 2px;
  border-top: 1px solid var(--line);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.footer-links div {
  display: grid;
  gap: 7px;
}

.footer-links strong {
  color: #d8d8d8;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

.legal-page {
  min-height: 100vh;
  background: #000000;
}

.legal-nav {
  width: min(1180px, calc(100% - 32px));
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.legal-nav .brand {
  color: var(--ink);
  text-decoration: none;
}

.legal-shell {
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  padding: 74px 0 96px;
}

.legal-shell h1 {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.legal-updated {
  margin: 18px 0 48px;
  color: var(--muted);
}

.legal-shell section {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.legal-shell h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.legal-shell p {
  margin: 0 0 12px;
  color: #c6c6c6;
  font-size: 0.98rem;
  line-height: 1.7;
}

.legal-shell a {
  color: var(--ink);
}

.pricing-page {
  background:
    radial-gradient(circle at 18% 16%, rgba(246, 130, 31, 0.08), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(47, 125, 246, 0.09), transparent 30%),
    #000000;
}

.pricing-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 74px 0 64px;
}

.pricing-hero {
  max-width: 780px;
  display: grid;
  gap: 14px;
  margin-bottom: 34px;
}

.pricing-hero h1 {
  max-width: 740px;
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 5.1rem);
  line-height: 0.98;
}

.pricing-hero p {
  max-width: 650px;
  margin: 0;
  color: #b9b9b9;
  font-size: 1rem;
  line-height: 1.65;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pricing-card {
  min-height: 430px;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 42%),
    #101010;
}

.pricing-card.featured-plan {
  border-color: rgba(246, 130, 31, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.plan-label {
  display: inline-flex;
  color: #ababab;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pricing-card h2 {
  margin: 8px 0 0;
  font-size: 1.35rem;
}

.plan-price {
  margin: 8px 0 0;
  color: #ffffff;
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1;
}

.plan-price span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.pricing-card strong {
  color: #ffffff;
  font-size: 0.92rem;
}

.pricing-card ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pricing-card li {
  color: #bdbdbd;
  line-height: 1.4;
}

.pricing-card li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
}

.plan-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  margin-top: auto;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #050505;
  font-weight: 800;
  text-decoration: none;
}

.secondary-plan {
  border-color: var(--line);
  background: #090909;
  color: var(--ink);
}

.pricing-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.pricing-notes div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080808;
}

.pricing-notes h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.pricing-notes p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.pricing-footer {
  width: min(1180px, calc(100% - 32px));
  padding-bottom: 28px;
}

.gsi-material-button {
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-appearance: none;
  background-color: white;
  background-image: none;
  border: 1px solid #747775;
  -webkit-border-radius: 20px;
  border-radius: 20px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  color: #1f1f1f;
  cursor: pointer;
  font-family: "Roboto", arial, sans-serif;
  font-size: 14px;
  height: 40px;
  letter-spacing: 0.25px;
  outline: none;
  overflow: hidden;
  padding: 0 12px;
  position: relative;
  text-align: center;
  -webkit-transition: background-color 0.218s, border-color 0.218s, box-shadow 0.218s;
  transition: background-color 0.218s, border-color 0.218s, box-shadow 0.218s;
  vertical-align: middle;
  white-space: nowrap;
  width: auto;
  max-width: 400px;
  min-width: min-content;
  text-decoration: none;
}

.gsi-material-button .gsi-material-button-icon {
  height: 20px;
  margin-right: 10px;
  min-width: 20px;
  width: 20px;
}

.gsi-material-button .gsi-material-button-content-wrapper {
  -webkit-align-items: center;
  align-items: center;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;
  -webkit-flex-wrap: nowrap;
  flex-wrap: nowrap;
  height: 100%;
  justify-content: space-between;
  position: relative;
  width: 100%;
}

.gsi-material-button .gsi-material-button-contents {
  -webkit-flex-grow: 1;
  flex-grow: 1;
  font-family: "Roboto", arial, sans-serif;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.gsi-material-button .gsi-material-button-state {
  -webkit-transition: opacity 0.218s;
  transition: opacity 0.218s;
  bottom: 0;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.gsi-material-button:disabled {
  cursor: default;
  background-color: #ffffff61;
  border-color: #1f1f1f1f;
}

.gsi-material-button:disabled .gsi-material-button-contents {
  opacity: 38%;
}

.gsi-material-button:disabled .gsi-material-button-icon {
  opacity: 38%;
}

.gsi-material-button:not(:disabled):active .gsi-material-button-state,
.gsi-material-button:not(:disabled):focus .gsi-material-button-state {
  background-color: #303030;
  opacity: 12%;
}

.gsi-material-button:not(:disabled):hover {
  -webkit-box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.gsi-material-button:not(:disabled):hover .gsi-material-button-state {
  background-color: #303030;
  opacity: 8%;
}

.google-g {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-block;
  border-radius: 50%;
  background: conic-gradient(
    from -38deg,
    #4285f4 0deg 78deg,
    #34a853 78deg 147deg,
    #fbbc05 147deg 217deg,
    #ea4335 217deg 292deg,
    #4285f4 292deg 360deg
  );
}

.google-g::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #ffffff;
}

.google-g::after {
  content: "";
  position: absolute;
  right: 0;
  top: 8px;
  width: 10px;
  height: 4px;
  background: #4285f4;
  border-radius: 0 1px 1px 0;
}

.auth-hint {
  margin-bottom: 0;
  color: var(--muted);
}

.url-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-logo {
  display: block;
  width: 142px;
  height: auto;
}

.sidebar .brand-logo {
  width: 130px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.company-link,
.field span,
.section-head span,
.eyebrow,
.stats span,
.card small {
  color: var(--muted);
  font-size: 0.75rem;
}

.company-link {
  display: inline-block;
  margin-top: 5px;
  text-decoration: none;
  font-weight: 600;
}

.mark {
  width: 32px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #080808;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 5px;
}

.tenant-form,
.experiment-form {
  display: grid;
  gap: 8px;
}

.user-box {
  display: grid;
  gap: 3px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  min-height: 56px;
}

.user-box span,
.user-box a {
  color: var(--muted);
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-box a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

nav {
  display: grid;
  gap: 4px;
}

.nav-button {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  text-align: left;
  min-height: 30px;
}

.nav-button.active {
  background: #171717;
  border-color: var(--line);
  color: var(--ink);
  box-shadow: none;
}

main {
  padding: 14px 16px 18px;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 180px),
    #000000;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: -14px -16px 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: #000000;
}

.eyebrow {
  margin: 0 0 3px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 600;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

strong {
  font-weight: 600;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.2vw, 2.25rem);
  line-height: 1;
  letter-spacing: 0;
  font-weight: 600;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
  color: #dddddd;
  font-weight: 600;
}

h3 {
  margin-bottom: 7px;
  font-size: 0.9rem;
  color: #b7b7b7;
  font-weight: 500;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stats article,
.card,
.agent-card,
.activity-card,
.module-card,
.experiment-card,
.analysis-document-editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.stats article {
  padding: 9px 11px;
  display: grid;
  gap: 3px;
}

.stats strong {
  font-size: 1.3rem;
  font-weight: 600;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
}

.modal-panel {
  width: min(460px, 100%);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080808;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.icon-button {
  min-width: 32px;
  padding: 0;
  font-size: 1rem;
}

.modal-company-form {
  display: grid;
  gap: 8px;
}

.stat-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-topline b {
  border: 1px solid rgba(246, 130, 31, 0.42);
  border-radius: 999px;
  padding: 2px 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.64rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.heartbeat-card small {
  color: var(--muted);
  font-size: 0.7rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.plan-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(280px, 0.8fr);
  gap: 8px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
}

.live-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(280px, 0.65fr);
  gap: 10px;
  align-items: start;
}

.live-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.live-summary article {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b0b0b;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.live-summary span,
.live-summary small {
  color: var(--muted);
  font-size: 0.72rem;
}

.live-summary strong {
  font-size: 1.1rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-feed,
.agent-list,
.job-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.activity-card,
.agent-card,
.module-card,
.job-card {
  padding: 9px 10px;
}

.activity-card p,
.agent-card p,
.module-card p,
.job-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.35;
}

.module-card {
  display: grid;
  gap: 8px;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background-color 120ms ease;
}

.module-card:hover,
.module-card.selected {
  border-color: rgba(246, 130, 31, 0.72);
  background: #15110d;
}

.module-card small {
  color: var(--muted);
}

.module-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.module-title img,
.module-title .channel-fallback,
.module-title .channel-logo-text {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.module-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.module-metrics span {
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #090909;
  color: var(--muted);
  font-size: 0.72rem;
}

.module-metrics strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.live-module-detail {
  display: grid;
  gap: 10px;
}

.module-detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b0b0b;
}

.module-detail-head h3 {
  margin-bottom: 4px;
}

.module-detail-head p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.module-detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(240px, 0.8fr);
  gap: 10px;
}

.analysis-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 0.25fr) minmax(520px, 1fr);
  gap: 10px;
  align-items: start;
}

.analysis-file-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 12px;
}

.analysis-file-panel h3 {
  margin-bottom: 7px;
  font-size: 0.82rem;
}

.analysis-signals p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.4;
}

.analysis-signals {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.analysis-signals a {
  color: var(--accent);
  text-decoration: none;
}

.analysis-document-panel {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
}

.analysis-document-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.analysis-document-head h3 {
  margin-bottom: 0;
}

.analysis-document-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
}

.analysis-document-editor {
  width: 100%;
  min-height: min(64vh, 720px);
  padding: 12px;
  resize: vertical;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.5;
}

.document-tabs {
  margin-bottom: 0;
}

.document-tab {
  font-size: 0.76rem;
}

.empty-tab {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  color: var(--muted);
  font-size: 0.76rem;
}

.markdown-output {
  max-height: 560px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #050505;
  color: #d9d9d9;
  font-size: 0.78rem;
  line-height: 1.48;
}

.markdown-output h2,
.markdown-output h3,
.markdown-output h4,
.markdown-output h5 {
  margin: 12px 0 6px;
  color: var(--ink);
  line-height: 1.18;
}

.markdown-output h2:first-child,
.markdown-output h3:first-child {
  margin-top: 0;
}

.markdown-output h2 {
  font-size: 1rem;
}

.markdown-output h3 {
  font-size: 0.88rem;
}

.markdown-output h4,
.markdown-output h5 {
  font-size: 0.78rem;
  color: #c7c7c7;
}

.markdown-output p,
.markdown-output ul,
.markdown-output ol {
  margin: 0 0 8px;
}

.markdown-output ul,
.markdown-output ol {
  padding-left: 18px;
}

.markdown-output li {
  margin-bottom: 4px;
}

.markdown-output code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #111111;
  color: #f0f0f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
}

.markdown-output pre {
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #020202;
}

.markdown-output a {
  color: var(--accent);
  text-decoration: none;
}

.analysis-edit-panel {
  width: min(900px, 100%);
}

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

.analysis-editor {
  width: 100%;
  min-height: min(62vh, 640px);
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #050505;
  color: var(--ink);
  font: 0.82rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.module-operating-card {
  display: grid;
  gap: 8px;
}

.detail-metrics {
  grid-template-columns: repeat(3, minmax(70px, 1fr));
}

.agent-card {
  display: grid;
  gap: 4px;
}

.settings-grid {
  display: grid;
  gap: 10px;
  max-width: 1040px;
}

.settings-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.settings-card-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.company-management {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.company-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b0b0b;
}

.company-row span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
}

.company-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.integration-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.channel-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #141414;
}

.channel-plan strong,
.channel-plan span {
  display: block;
}

.channel-plan strong {
  font-size: 0.82rem;
}

.channel-plan span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
}

.channel-meter {
  width: 148px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #2b2b2b;
}

.channel-meter span {
  display: block;
  height: 100%;
  margin: 0;
  background: #93c47d;
}

.integration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b0b0b;
}

.integration-row.connected {
  border-color: #333333;
}

.integration-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.channel-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f7f7;
  color: #050505;
  font-weight: 800;
  overflow: visible;
}

.channel-avatar > img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
}

.channel-avatar i {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #383838;
  border-radius: 6px;
  background: #050505;
}

.channel-avatar i img {
  width: 12px;
  height: 12px;
}

.integration-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #050505;
}

.integration-icon img {
  width: 15px;
  height: 15px;
}

.integration-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 3px;
}

.integration-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.integration-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.integration-row code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #050505;
  color: #dcdcdc;
  font-size: 0.68rem;
}

.integration-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
}

.integration-empty {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 16px;
  border: 1px dashed #343434;
  border-radius: 7px;
  background: #090909;
}

.integration-empty p {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.channel-modal-panel {
  width: min(760px, calc(100% - 32px));
  max-height: min(780px, calc(100vh - 40px));
  overflow: auto;
}

.remove-channel-panel {
  width: min(480px, 100%);
}

.remove-channel-copy {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 77, 94, 0.32);
  border-radius: 7px;
  background: rgba(255, 77, 94, 0.08);
}

.remove-channel-copy p {
  margin: 0;
  color: #d4d4d4;
  font-size: 0.82rem;
  line-height: 1.5;
}

.provider-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.provider-tile {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-height: 160px;
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #181818;
  text-align: center;
}

.provider-tile.disabled {
  opacity: 0.62;
}

.provider-tile.unavailable {
  opacity: 0.62;
}

.provider-limit-note {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(246, 130, 31, 0.42);
  border-radius: 7px;
  background: var(--accent-soft);
}

.provider-limit-note span {
  color: #cfcfcf;
  font-size: 0.78rem;
}

.provider-tile-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #050505;
}

.provider-tile-icon img {
  width: 22px;
  height: 22px;
}

.provider-tile span,
.provider-tile small {
  color: var(--muted);
  font-size: 0.75rem;
}

.provider-tile .provider-redirect {
  width: 100%;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: #0c0c0c;
  font-size: 0.62rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-tile .provider-scopes {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-tile em {
  max-width: 230px;
  color: #ffb4a8;
  font-size: 0.7rem;
  font-style: normal;
  line-height: 1.3;
}

.provider-connect-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  background: #93c47d;
  color: #050505;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.provider-connect-link.disabled {
  border: 1px solid var(--line);
  background: #0a0a0a;
  color: var(--muted);
  cursor: default;
}

.channel-settings-panel {
  width: min(620px, calc(100% - 32px));
}

.channel-settings-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.channel-settings-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.channel-settings-form input,
.channel-settings-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #050505;
  color: var(--ink);
  padding: 9px 10px;
  font: inherit;
}

.channel-settings-form textarea {
  resize: vertical;
}

.toggle-row {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px !important;
  color: var(--ink) !important;
}

.toggle-row input {
  width: auto;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 6px;
  background: var(--accent);
  color: #050505;
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
}

.agent-card span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.72rem;
}

.activity-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.queue-heading {
  margin-top: 12px;
}

.card {
  padding: 11px;
}

.card h3 {
  margin-bottom: 7px;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  background: #171717;
  color: #d7d7d7;
  font-size: 0.75rem;
  font-weight: 500;
}

.channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 6px;
}

.channel-pill img,
.channel-fallback,
.channel-logo-text {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.channel-fallback,
.channel-logo-text {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #262626;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 700;
}

.channel-logo-text.linkedin-logo {
  border-radius: 3px;
  background: #0a66c2;
  color: #ffffff;
  font-family: Arial, sans-serif;
  font-size: 0.56rem;
  letter-spacing: 0;
}

.experiment-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.experiment-card {
  padding: 10px;
  display: grid;
  gap: 6px;
}

.experiment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 600;
}

.badge.winner {
  background: var(--green-soft);
  color: var(--green);
}

.badge.loser {
  background: var(--rose-soft);
  color: var(--rose);
}

.badge.inconclusive {
  background: var(--gold-soft);
  color: var(--gold);
}

.badge.running,
.badge.queued {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge.complete {
  background: var(--green-soft);
  color: var(--green);
}

.badge.approval {
  background: var(--gold-soft);
  color: var(--gold);
}

.badge.interrupted,
.badge.failed {
  background: var(--rose-soft);
  color: var(--rose);
}

.badge.setup {
  background: #1b1b1b;
  color: var(--muted);
}

.badge.research {
  background: var(--gold-soft);
  color: var(--gold);
}

.badge.active {
  background: var(--green-soft);
  color: var(--green);
}

.job-error {
  color: #ff9aa4;
  line-height: 1.35;
}

.result-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(80px, 1fr));
  gap: 6px;
}

.result-form textarea,
.result-form button {
  grid-column: 1 / -1;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.tab {
  background: #0b0b0b;
  color: var(--muted);
  border-color: var(--line);
}

.tab.active {
  background: #1b1b1b;
  color: var(--ink);
  border-color: #444444;
}

@media (max-width: 900px) {
  .landing-page,
  .setup-page {
    padding: 16px;
  }

  .landing-nav {
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 14px;
  }

  .landing-menu {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .landing-content {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 34px 0;
  }

  .landing-copy h1 {
    font-size: 4.2rem;
  }

  .landing-kicker {
    font-size: 1rem;
  }

  .landing-footer,
  .footer-links {
    grid-template-columns: 1fr;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats,
  .analysis-workspace,
  .plan-grid,
  .pricing-grid,
  .pricing-notes,
  .module-grid,
  .module-detail-grid,
  .live-summary,
  .live-grid,
  .url-form,
  .result-form {
    grid-template-columns: 1fr;
  }

  .module-detail-head {
    grid-template-columns: 1fr;
  }

  .provider-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .landing-copy h1 {
    font-size: 3.2rem;
  }

  .landing-actions,
  .landing-actions .gsi-material-button,
  .ghost-login {
    width: 100%;
  }

  .landing-menu {
    gap: 12px;
  }

  .company-row,
  .integration-row,
  .settings-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-card-actions,
  .channel-plan {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .channel-meter {
    width: 100%;
  }

  .provider-picker {
    grid-template-columns: 1fr;
  }

  .company-row-actions,
  .integration-actions {
    width: 100%;
    flex-direction: column;
  }

  .integration-actions .button-link,
  .integration-actions button {
    width: 100%;
  }
}
