:root {
  color-scheme: light dark;
  /* Remapped onto the Telemetry design tokens (tokens.css). The app's legacy
     var names now resolve to the new system and switch with [data-theme]. */
  --ink: var(--text-hi);
  --muted: var(--text-muted);
  --line: var(--border);
  --paper: var(--canvas);
  --panel: var(--surface-1);
  --panel-strong: var(--surface-2);
  /* --accent intentionally not redefined here → inherits the Telemetry
     electric-blue --accent from tokens.css. */
  --accent-soft: var(--accent-tint);
  --blue: var(--accent);
  --blue-soft: var(--accent-tint);
  --green: var(--status-active);
  --green-soft: var(--status-active-tint);
  --gold: var(--status-approval);
  --gold-soft: var(--status-approval-tint);
  --rose: var(--status-danger);
  --rose-soft: var(--status-danger-tint);
  --shadow: var(--shadow-card);
}

* {
  box-sizing: border-box;
}

/* Branded text selection — a clean accent tint instead of the muddy OS default.
   Token-driven, so it adapts to light/dark and keeps selected text readable. */
::selection {
  background: color-mix(in oklch, var(--accent) 26%, transparent);
  color: var(--text-hi);
}
::-moz-selection {
  background: color-mix(in oklch, var(--accent) 26%, transparent);
  color: var(--text-hi);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  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: var(--canvas);
}

.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: var(--surface-1);
  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: var(--surface-1);
  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: var(--surface-1);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-view,
.onboarding {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: var(--canvas);
}

.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: var(--border);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface-1);
}

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

/* Focused onboarding prompt — a single centered question + URL field. */
.setup-prompt {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 26px;
  width: min(680px, 100%);
  margin: 0 auto;
}
.setup-headline {
  margin: 0;
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--text-hi);
}
.setup-sub {
  margin: 0;
  max-width: 480px;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.55;
}
.setup-form {
  width: min(560px, 100%);
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  margin-top: 4px;
}
.setup-form input {
  height: 52px;
  padding: 0 18px;
  font-size: 1.05rem;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}
.setup-form input::placeholder {
  color: var(--text-muted);
}
.setup-form button {
  height: 52px;
  padding: 0 26px;
  font-size: 1rem;
  border-radius: 10px;
}
@media (max-width: 560px) {
  .setup-form {
    grid-template-columns: 1fr;
  }
}

.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, var(--canvas) 0%, var(--surface-1) 52%, var(--canvas) 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: var(--text);
  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: var(--surface-1);
  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: var(--text);
  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: var(--text-muted);
  font-size: 0.75rem;
}

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

/* Auth screen (Sign in / Sign up) — clean centered card */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--paper);
}
.auth-wrap {
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  margin-bottom: 28px;
}
.auth-brand .brand-logo {
  height: 30px;
  width: auto;
}
.auth-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 28px;
  color: var(--ink);
}
.auth-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth-card .gsi-material-button {
  width: 100%;
}
.auth-email {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.auth-field span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.auth-field input {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 12px 14px;
  font-size: 0.95rem;
  outline: none;
}
.auth-field input:focus {
  border-color: var(--accent);
}
.auth-continue {
  width: 100%;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 12px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.auth-continue:hover {
  border-color: var(--accent);
}
.auth-or {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 18px 0;
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-or span {
  padding: 0 12px;
}
.auth-status {
  margin: 12px 0 0;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.4;
}
.auth-status.ok {
  color: var(--green);
}
.auth-status.err {
  color: var(--rose);
}
.auth-sub {
  margin: 4px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Connecting interstitial (shown while an OAuth connect redirect is in flight) */
.connect-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.connect-overlay.hidden {
  display: none;
}
.connect-overlay-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 32px;
  max-width: 340px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.connect-overlay-card strong {
  font-size: 1.05rem;
  color: var(--ink);
}
.connect-overlay-card span {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Company status pill (next to the company name) */
.tenant-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tenant-favicon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
  background: var(--panel-strong);
  flex: 0 0 auto;
}
.tenant-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.tenant-pill.live {
  background: var(--green-soft);
  color: var(--green);
}
.tenant-pill.initializing {
  background: var(--gold-soft);
  color: var(--gold);
}
.auth-toggle {
  margin: 4px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.auth-toggle a {
  color: var(--accent);
  text-decoration: none;
}
.auth-toggle a:hover {
  text-decoration: underline;
}
.auth-card .auth-hint {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 0;
}

.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%),
    var(--surface-1);
}

.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: var(--text);
}

.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: var(--canvas);
}

.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%),
    var(--canvas);
}

.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%),
    var(--surface-1);
}

.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: var(--text-hi);
  font-family: var(--font-mono);
  font-size: 2.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

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

.pricing-card strong {
  color: var(--text-hi);
  font-size: 0.92rem;
}

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

.pricing-card li {
  color: var(--text);
  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: var(--surface-1);
  font-weight: 800;
  text-decoration: none;
}

.secondary-plan {
  border-color: var(--line);
  background: var(--canvas);
  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: var(--surface-1);
}

.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: 4px;
  border-radius: 4px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  /* Google's button is always white in both themes, so its text must stay a
     fixed dark color (not a theme surface token, which goes near-white in light). */
  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: var(--surface-2)1f;
}

.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: var(--border);
  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: var(--border);
  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-home {
  color: inherit;
  text-decoration: none;
}

.brand-home:hover .brand-logo,
.brand-home:focus-visible .brand-logo {
  opacity: 0.82;
}

.brand-home:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
  border-radius: 6px;
}

.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: var(--surface-1);
  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: var(--surface-2);
  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),
    var(--canvas);
}

.app-footer {
  width: 100%;
  margin-top: 26px;
  padding-bottom: 8px;
}

.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: var(--canvas);
}

.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: var(--text);
  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: var(--surface-1);
  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: var(--surface-1);
  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: var(--accent-tint-bd);
  background: var(--accent-tint);
}

.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: var(--canvas);
  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: var(--surface-1);
}

.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: var(--surface-1);
  color: var(--text);
  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: var(--text);
}

.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: var(--surface-1);
  color: var(--text-hi);
  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: var(--canvas);
}

.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: var(--surface-1);
  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: var(--surface-1);
}

.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: var(--inset);
}

.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: var(--border);
}

.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: var(--surface-1);
}

.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: var(--surface-1);
  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: var(--surface-1);
}

.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: var(--surface-1);
}

.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: var(--surface-1);
  color: var(--text);
  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: var(--canvas);
}

.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: var(--text);
  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: var(--surface-1);
  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: var(--text);
  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: var(--surface-1);
}

.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: var(--canvas);
  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: var(--surface-1);
  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: var(--surface-1);
  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: var(--surface-1);
  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: var(--surface-2);
  color: var(--text);
  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: var(--surface-2);
  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: var(--surface-2);
  color: var(--muted);
}

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

.badge.active {
  background: var(--green-soft);
  color: var(--green);
}
.badge.needs_approval {
  background: var(--gold-soft);
  color: var(--gold);
}
.badge.done {
  background: var(--green-soft);
  color: var(--green);
}
.badge.skipped {
  background: rgba(155, 155, 155, 0.16);
  color: var(--muted);
}

/* Queue table */
.queue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.queue-table th,
.queue-table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.queue-table thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.queue-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.queue-table th.sortable:hover {
  color: var(--ink);
}
.queue-table th.active {
  color: var(--ink);
}
.queue-row.expandable {
  cursor: pointer;
}
.queue-row:hover td {
  background: var(--panel);
}
.q-channel {
  white-space: nowrap;
}
.q-channel svg,
.q-channel img,
.q-channel i {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 8px;
}
.q-channel span {
  vertical-align: middle;
}
.q-work {
  max-width: 460px;
}
.q-caret {
  display: inline-block;
  width: 14px;
  color: var(--muted);
  transition: transform 0.15s;
}
.queue-row.open .q-caret {
  transform: rotate(90deg);
}
.q-score {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.q-when {
  color: var(--muted);
  white-space: nowrap;
}
.q-actions {
  white-space: nowrap;
  text-align: left;
}
.q-actions > * {
  vertical-align: middle;
}
.q-actions > * + * {
  margin-left: 8px;
}
.queue-btn {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 6px 10px;
  font-size: 0.82rem;
  cursor: pointer;
}
.queue-btn:hover {
  border-color: var(--accent);
}
.queue-btn.secondary {
  color: var(--muted);
}
.queue-link {
  color: var(--blue);
  text-decoration: none;
  font-size: 0.85rem;
}
.queue-detail td {
  background: var(--panel);
}
.queue-detail.hidden {
  display: none;
}
.queue-draft {
  white-space: pre-wrap;
  margin: 0 0 8px;
  padding: 12px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink);
}
.queue-empty {
  color: var(--muted);
  padding: 24px 0;
}

.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: var(--surface-1);
  color: var(--muted);
  border-color: var(--line);
}

.tab.active {
  background: var(--surface-2);
  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%;
  }
}

.admin-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(246, 130, 31, 0.35);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  vertical-align: middle;
  text-decoration: none;
}

.admin-pill:hover {
  background: var(--accent);
  color: #ffffff;
}

.user-box-actions {
  display: flex;
  gap: 14px;
  margin-top: 4px;
}

#updateBanner {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 9px 9px 18px;
  background: var(--panel-strong, #151515);
  color: var(--ink, var(--text-hi));
  border: 1px solid var(--accent);
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  font-size: 14px;
}

#updateBanner button {
  border: none;
  background: var(--accent);
  color: #1a1205;
  font-weight: 700;
  padding: 6px 15px;
  border-radius: 999px;
  cursor: pointer;
}

#updateBanner button:hover {
  filter: brightness(1.08);
}

/* Telemetry theme toggle (lives in Settings → Appearance) */
.appearance-card .settings-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
/* Appearance: Light / System / Dark segmented control */
.theme-select {
  flex: none;
  display: inline-flex;
  align-items: stretch;
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.theme-option {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.theme-option:hover {
  color: var(--text-hi);
}
.theme-option.active {
  background: var(--accent);
  color: #fff;
}

/* Inline button spinner (e.g. while a company workspace is being created) */
.btn-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Analysis "Initializing" progress (shown while the homepage crawl runs) */
.init-progress {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  min-height: 280px;
  padding: 32px 6px;
}
.init-progress-title {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text-hi);
}
.init-progress-bar {
  height: 7px;
  background: var(--inset);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.init-progress-bar > span {
  display: block;
  height: 100%;
  width: 8%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  animation: init-fill 42s cubic-bezier(0.15, 0.6, 0.2, 1) forwards;
}
@keyframes init-fill {
  from { width: 8%; }
  to { width: 92%; }
}
.init-progress-step {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--accent-text);
}
.init-progress-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}
@media (prefers-reduced-motion: reduce) {
  .init-progress-bar > span { animation: none; width: 55%; }
}

/* White-mark brand icons (X, Threads, TikTok) are filled #FFFFFF, so they vanish
   on a light background. Sit them on a fixed dark chip so they read in both themes. */
img[src$="/x.svg"],
img[src$="/threads.svg"],
img[src$="/tiktok.svg"] {
  background: #15171c;
  border-radius: 3px;
  padding: 1px;
}
