@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap");

:root {
  --bg: #fbfbfb;
  --bg-elevated: #ffffff;
  --bg-soft: #f5f5f5;
  --card: #ffffff;
  --accent: #111111;
  --accent-dark: #000000;
  /* Primary call-to-action buttons (Analyze, Download CSV). */
  --cta: #ff2db2;
  --cta-hover: #e10098;
  --cta-shadow: rgba(255, 45, 178, 0.35);
  --text: #0a0a0a;
  --muted: #666666;
  --border: #e5e5e5;
  --border-strong: #cfcfcf;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.04), 0 12px 30px rgba(0, 0, 0, 0.08);
  --chip: rgba(0, 0, 0, 0.04);
  --chip-border: rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Geist", "Geist Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.page {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.page-login {
  padding-top: 28px;
}

.top-nav-shell {
  position: sticky;
  top: 0;
  z-index: 120;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 20px;
  max-width: 1120px;
  margin: 0 auto;
}

.top-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.top-nav-groups {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.top-nav-group {
  position: relative;
  display: flex;
  align-items: center;
}

.top-nav-trigger {
  margin: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  height: 38px;
  padding: 0 11px;
  background: transparent;
  color: #5f5f5f;
  font-size: 12.5px;
  font-weight: 550;
  letter-spacing: 0.004em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.top-nav-trigger:hover,
.top-nav-trigger.is-open {
  color: var(--text);
  border-color: #dedede;
  background: #f7f7f7;
}

.top-nav-trigger.is-active {
  color: var(--text);
  font-weight: 600;
}

.top-nav-chevron {
  display: inline-flex;
  width: 13px;
  height: 13px;
  color: inherit;
}

.top-nav-chevron svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s ease;
}

.top-nav-chevron.is-open svg {
  transform: rotate(180deg);
}

.top-nav-popover {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 360px;
  max-width: min(440px, calc(100vw - 40px));
  border-radius: 14px;
  border: 1px solid #dcdcdc;
  background: #ffffff;
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.12);
  padding: 8px;
  z-index: 130;
}

.top-nav-popover.is-right {
  left: auto;
  right: 0;
}

.top-nav-popover-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.top-nav-popover-link {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.top-nav-popover-link:hover {
  border-color: #dfdfdf;
  background: #fafafa;
}

.top-nav-popover-link[aria-current="page"] {
  border-color: #d4d4d4;
  background: #f4f4f4;
}

.top-nav-popover-title {
  color: var(--text);
  font-size: 13.2px;
  font-weight: 600;
}

.top-nav-popover-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.top-nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.top-nav-saved-group {
  position: relative;
}

.top-nav-saved-trigger {
  border: 1px solid var(--border);
  background: #ffffff;
  color: #4f4f4f;
  font-weight: 500;
}

.top-nav .top-nav-action-btn {
  margin: 0;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  box-shadow: none;
  transform: none;
}

.top-nav .top-nav-action-btn:hover {
  border-color: var(--border-strong);
  background: #f8f8f8;
  color: var(--text);
  box-shadow: none;
  transform: none;
}

.top-nav .top-nav-action-btn:disabled {
  cursor: default;
  opacity: 0.65;
  box-shadow: none;
}

.top-nav-mobile-trigger {
  display: none;
}

.top-nav-mobile-drawer {
  display: none;
}

@media (max-width: 980px) {
  .top-nav {
    min-height: 60px;
    padding: 10px 16px;
  }

  .top-nav-groups {
    display: none;
  }

  .top-nav-mobile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }

  .top-nav-mobile-trigger.is-open {
    border-color: var(--border-strong);
    background: #f8f8f8;
  }

  .top-nav-saved-group {
    display: none;
  }

  .top-nav .top-nav-action-btn {
    height: 38px;
    padding: 0 14px;
    font-size: 12px;
  }

  .top-nav-mobile-drawer {
    display: block;
    max-width: 1120px;
    margin: 0 auto 12px;
    padding: 0 16px;
  }

  .top-nav-mobile-sections {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.08);
    padding: 12px;
    display: grid;
    gap: 12px;
  }

  .top-nav-mobile-section {
    display: grid;
    gap: 8px;
  }

  .top-nav-mobile-section h2 {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6b6b6b;
  }

  .top-nav-mobile-links {
    display: grid;
    gap: 6px;
  }

  .top-nav-mobile-link {
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 8px 10px;
    display: grid;
    gap: 2px;
  }

  .top-nav-mobile-link:hover,
  .top-nav-mobile-link[aria-current="page"] {
    border-color: #dcdcdc;
    background: #f8f8f8;
  }

  .top-nav-mobile-link-title {
    color: var(--text);
    font-size: 12.8px;
    font-weight: 600;
  }

  .top-nav-mobile-link-description {
    color: var(--muted);
    font-size: 11.6px;
    line-height: 1.35;
  }
}

@media (max-width: 720px) {
  .top-nav {
    padding: 8px 12px;
  }

  .top-nav-mobile-drawer {
    padding: 0 12px;
  }
}

.login-card {
  padding-top: 22px;
}

.login-brand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.login-brand-mark {
  width: 72px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.login-brand-mark img {
  width: 100%;
  height: auto;
  display: block;
}

.login-brand-copy h2 {
  margin: 0 0 4px;
  font-size: 1.9rem;
}

.login-brand-copy p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.login-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  margin-left: 86px;
}

.login-actions button {
  margin-top: 0;
}

@media (max-width: 720px) {
  .login-brand {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .login-brand-mark {
    width: 58px;
  }

  .login-brand-copy h2 {
    font-size: 1.6rem;
  }

  .login-actions {
    margin-left: 0;
  }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(0, 0, 0, 0.05), transparent 55%),
    linear-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.06) 1px, transparent 1px);
  background-size: 100% 100%, 120px 120px, 120px 120px;
  pointer-events: none;
  z-index: -1;
}

.hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px 0 24px;
}

.hero-mark {
  width: 120px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  justify-self: start;
  padding: 0;
}

.hero-mark img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-copy {
  display: grid;
  gap: 12px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  color: var(--accent);
  margin: 0;
}

h1 {
  font-size: clamp(1.85rem, 1.4vw + 1.6rem, 2.4rem);
  margin: 0;
  font-weight: 600;
}

.subhead {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 0 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.page-header-mark {
  width: 44px;
  flex-shrink: 0;
}

.page-header-mark img {
  width: 100%;
  height: auto;
  display: block;
}

.page-header-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.page-header-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 10px;
  color: var(--muted);
  margin: 0;
}

.page-header-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}

.page-header-description {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.4;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  background: var(--chip);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.chip-link {
  text-decoration: none;
  color: var(--text);
}

.chip-link:hover {
  border-color: var(--border-strong);
  background: rgba(0, 0, 0, 0.06);
}

.chip-link[aria-current="page"] {
  border-color: var(--border-strong);
  background: rgba(0, 0, 0, 0.08);
}

.chip.small {
  font-size: 11px;
  padding: 2px 10px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.form-card {
  background: rgba(255, 255, 255, 0.9);
}

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

.card-header h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.card-header p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.form-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-row.compact {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.form-row.compact label {
  min-width: 160px;
  flex: 0 0 auto;
}

.form-row.compact .compact-check {
  min-width: auto;
  padding-bottom: 6px;
  white-space: nowrap;
}

.form-row.compact.portfolio-scope-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px 10px;
  align-items: stretch;
  overflow: visible;
  padding-bottom: 0;
}

.form-row.compact.portfolio-scope-row .portfolio-scope-label {
  flex: 0 1 auto;
  width: clamp(220px, 21vw, 360px);
  min-width: 220px;
  max-width: 360px;
}

.portfolio-scope-label {
  min-width: 0;
}

.portfolio-scope-label.scope-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px 7px 3px 8px;
  background: #ffffff;
  font-size: 11px;
  color: var(--muted);
}

.scope-filter-chip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #4b5565;
  white-space: nowrap;
}

.portfolio-scope-label.scope-filter-chip select {
  border: 0;
  box-shadow: none;
  border-radius: 8px;
  height: 28px;
  min-width: 0;
  width: 100%;
  padding: 4px 26px 4px 8px;
  background-position: right 8px center;
}

.portfolio-scope-label.scope-filter-chip select:focus {
  border: 0;
  box-shadow: 0 0 0 2px rgba(31, 53, 93, 0.16);
}

#portfolio-radar-form .portfolio-scope-label.scope-filter-chip select {
  min-width: 0;
}

.label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.1;
}

.info-tip {
  position: relative;
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  transform: none;
  box-shadow: none;
  margin-top: 0;
  vertical-align: middle;
}

.info-tip:hover,
.info-tip:active {
  border-color: #9ca3b3;
  background: #ffffff;
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.info-tip:focus-visible {
  outline: 2px solid rgba(31, 53, 93, 0.35);
  outline-offset: 1px;
}

.info-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translateX(-50%) translateY(4px);
  width: min(260px, 72vw);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #cfd4df;
  background: #ffffff;
  color: #1f2937;
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  z-index: 25;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.info-tip:hover::after,
.info-tip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.form-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 6px;
}

.form-checks .checkbox {
  display: inline-flex;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 500;
  font-size: 12.5px;
}

label.checkbox {
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

label.checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

input,
textarea,
select {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  background: #ffffff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Make select chevron spacing consistent (and prevent it hugging the right edge). */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
  /* Down chevron */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23111111' d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6z'/%3E%3C/svg%3E");
}

input::placeholder,
textarea::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

.keywords-input {
  min-height: 44px;
  max-height: 160px;
  resize: none;
  overflow-y: hidden;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.sfdc-only {
  display: none;
}

body[data-source="sfdc"] .sfdc-only {
  display: grid;
}

body[data-source="sfdc"] .csv-only {
  display: none;
}

.btn,
button {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  height: 36px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn.primary {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn:hover,
button:hover {
  background: var(--accent-dark);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

/* Hot pink/fuchsia CTAs (override generic `button` styling above). */
#analyze-form button[type="submit"],
#download {
  background: var(--cta);
  border-color: var(--cta);
  color: #ffffff;
}

#analyze-form button[type="submit"]:hover,
#download:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
  box-shadow: 0 10px 26px var(--cta-shadow);
}

.btn.ghost:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.btn:disabled,
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
}

.btn.ghost:disabled,
button.btn.ghost:disabled {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.btn:active,
button:active {
  transform: translateY(0);
}

.form-card button {
  margin-top: 14px;
}

.form-card .info-tip {
  margin-top: 0;
}

.analyze-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.analyze-actions > button[type="submit"] {
  background: var(--cta);
  border-color: var(--cta);
  color: #ffffff;
}

.analyze-actions > button[type="submit"]:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
  box-shadow: 0 10px 26px var(--cta-shadow);
}

#analyze-fresh-btn {
  border-color: #cfd4df;
  color: #1f2937;
  background: #ffffff;
}

#analyze-fresh-btn:hover {
  background: #f5f7fb;
  border-color: #b8c1d3;
  color: #111827;
  box-shadow: none;
}

.analyze-actions > button {
  margin-top: 0;
}

label.prompt-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
  flex: 0 0 auto;
  width: auto;
  min-width: 160px;
}

.prompt-mini-label {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

label.prompt-mini select {
  height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  width: 220px;
  max-width: 220px;
}

.prompt-help {
  flex: 1 1 260px;
  min-width: 220px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  font-style: italic;
  padding-left: 2px;
}

.prompt-help[aria-busy="true"] {
  display: flex;
  align-items: center;
  gap: 6px;
  font-style: normal;
}

.prompt-help[aria-busy="true"]::before {
  content: "";
  display: inline-block;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: status-spin 0.65s linear infinite;
}

@keyframes status-spin {
  to { transform: rotate(360deg); }
}

.run-progress {
  margin-top: 8px;
  width: min(680px, 100%);
}

.run-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f2f2f2;
  overflow: hidden;
}

.run-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff2db2, #ff4cc6, #ff2db2);
  background-size: 220% 100%;
  transition: width 0.6s ease;
}

.run-progress-bar.is-running {
  animation: run-progress-shimmer 1.4s linear infinite;
}

@keyframes run-progress-shimmer {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 220% 0%;
  }
}

.run-progress-text {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.query-preview {
  margin-top: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: #333333;
}

.portfolio-radar-preview {
  margin-top: 10px;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.portfolio-radar-preview.is-risk {
  border-color: #f0d4cf;
  background: #fff8f6;
}

.portfolio-radar-preview.is-neutral {
  border-color: #d8deea;
  background: #f7f9ff;
}

.cache-preview {
  margin-top: 8px;
  margin-bottom: 8px;
  border: 1px dashed #e5e5e5;
  background: #fcfcfc;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.35;
  color: #666666;
}

@media (min-width: 860px) {
  .analyze-actions {
    flex-wrap: nowrap;
  }
}

.status {
  margin-top: 10px;
  color: var(--muted);
  font-family: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
}

.summary {
  margin: 10px 0 12px;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.explain {
  margin: 8px 0 16px;
  background: #f5f5f5;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  min-height: 80px;
}

.explain h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.results-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.column-toggle {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  font-size: 12px;
  color: var(--muted);
  margin-top: 0;
  align-self: center;
  display: inline-flex;
  align-items: center;
}

.column-toggle summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  height: 36px;
  line-height: 1.2;
}

.column-toggle summary::-webkit-details-marker {
  display: none;
}

.column-toggle-body {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.table-tools {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: flex-end;
}

.table-search {
  min-width: 160px;
  width: clamp(170px, 17vw, 260px);
}

.tool-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.tool-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.tool-select {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
}

.tool-select > span {
  font-size: 11px;
  white-space: nowrap;
}

.tool-select select {
  min-width: 132px;
  max-width: 190px;
  padding: 6px 12px;
  border-radius: 10px;
  height: 32px;
  font-size: 12px;
}

.table-tools input.table-search {
  height: 32px;
  padding: 6px 12px;
}

.table-summary {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.table-wrap {
  margin-top: 8px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  position: relative;
}

.table-block {
  margin-top: 20px;
}

.table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.table-title-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-title .pill {
  margin-left: 0;
}

.table-title .table-summary {
  margin-top: 0;
  text-align: right;
  flex: 1 1 auto;
  min-width: 240px;
}

.table-collapse {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
  margin-top: 0;
  height: 32px;
  line-height: 1.1;
}

.table-collapse:hover {
  border-color: var(--border-strong);
  background: #f6f6f6;
}

.table-block.is-collapsed .table-tools,
.table-block.is-collapsed .table-summary,
.table-block.is-collapsed .table-wrap {
  display: none;
}

@media (max-width: 720px) {
  .table-title {
    align-items: flex-start;
  }

  .table-title .table-summary {
    text-align: left;
    width: 100%;
  }
}

.table-title h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #f5f5f5;
  color: #444444;
}

.table-block.mismatch .table-wrap {
  border-color: #f0d4cf;
  background: #fffaf9;
}

.table-block.maybe .table-wrap {
  border-color: #eedfb7;
  background: #fffdf6;
}

.table-block.fine .table-wrap {
  border-color: #d7ead7;
  background: #f8fdf8;
}

.table-block.mismatch .pill {
  background: #fff0ed;
  border-color: #f0d4cf;
  color: #8a3b2a;
}

.table-block.maybe .pill {
  background: #fff6db;
  border-color: #eedfb7;
  color: #7a5a00;
}

.table-block.fine .pill {
  background: #e8f7e8;
  border-color: #d7ead7;
  color: #1f5b2c;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

th,
td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fafafa;
}

th.col-account,
td.col-account {
  width: clamp(220px, 24vw, 300px);
  min-width: 220px;
  max-width: 300px;
}

th.col-account {
  position: sticky;
  left: 0;
  z-index: 4;
  background: #fafafa;
}

td.col-account {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #ffffff;
}

th.col-llm-rationale,
td.col-llm-rationale {
  min-width: 300px;
}

th.col-summary,
td.col-summary {
  width: 320px;
  max-width: 320px;
}

th.col-impact,
td.col-impact {
  width: 190px;
  max-width: 190px;
}

th.col-take-action,
td.col-take-action {
  width: 128px;
  min-width: 128px;
  white-space: nowrap;
}

th.col-action,
td.col-action {
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  box-sizing: border-box;
}

td.table-empty {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 18px 12px;
}

th.col-action {
  position: sticky;
  left: var(--sticky-account-width, 240px);
  z-index: 4;
  background: #fafafa;
  box-shadow: 1px 0 0 var(--border), 10px 0 14px rgba(0, 0, 0, 0.03);
}

td.col-action {
  position: sticky;
  left: var(--sticky-account-width, 240px);
  z-index: 3;
  background: #ffffff;
  box-shadow: 1px 0 0 var(--border), 10px 0 14px rgba(0, 0, 0, 0.02);
}

.col-date {
  white-space: nowrap;
}

.flag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px dashed var(--border);
  background: #f4f6f8;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.flag-badge.warning {
  border-style: solid;
  background: #fff1ef;
  color: #8a3b2a;
}

.flagged-words {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 280px;
}

.flagged-word-primary {
  display: inline-block;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  line-height: 1.25;
}

.flagged-words-more {
  display: inline-flex;
  flex: 0 0 auto;
}

.flagged-words-toggle {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  padding: 2px 8px;
  cursor: pointer;
}

.flagged-words-toggle:hover {
  text-decoration: underline;
}

td.has-next-step {
  position: relative;
}

.llm-rationale {
  display: inline;
  position: relative;
}

.llm-rationale-text {
  display: inline;
  white-space: normal;
  word-break: break-word;
}

.llm-rationale-tail {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.llm-rationale-toggle {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.llm-rationale-toggle:hover {
  text-decoration: underline;
}

.llm-rationale-extra {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  min-width: 260px;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  font-size: 12px;
  color: var(--text);
  z-index: 10000;
}

.llm-rationale-extra.is-visible {
  display: block;
}

.llm-rationale-extra.flagged-words-extra {
  max-width: min(460px, calc(100vw - 24px));
}

.flagged-words-extra-list {
  margin-bottom: 0;
}

.recent-snippet {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: 100%;
}

.recent-snippet-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  word-break: break-word;
}

.recent-snippet-tail {
  display: inline-flex;
  align-items: center;
}

.recent-snippet-toggle {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.recent-snippet-toggle:hover {
  text-decoration: underline;
}

.recent-text-popover {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  min-width: 300px;
  max-width: min(520px, calc(100vw - 24px));
  max-height: min(62vh, 460px);
  overflow: auto;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  font-size: 12px;
  color: var(--text);
  z-index: 10000;
}

.recent-text-popover.is-visible {
  display: block;
}

.recent-text-popover-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.recent-text-popover-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.recent-text-popover-link {
  margin-top: 6px;
  font-size: 12px;
}

.recent-text-popover-section + .recent-text-popover-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.recent-text-popover-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}

.recent-badge-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.recent-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f5f5f5;
  color: #444444;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
}

.recent-action-btn {
  margin-top: 0;
  height: 30px;
  font-size: 12px;
  padding: 6px 10px;
}

.recent-action-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;
}

.recent-action-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
}

.recent-action-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(680px, calc(100vw - 24px));
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.recent-action-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recent-action-header h3 {
  margin: 0;
  font-size: 1rem;
}

.recent-action-close {
  margin-top: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  height: 30px;
  min-width: 30px;
  padding: 0;
}

.recent-action-body {
  display: grid;
  gap: 8px;
}

.recent-action-meta {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}

.recent-action-label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.recent-action-text {
  min-height: 180px;
  resize: vertical;
  font-family: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
}

.recent-action-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.llm-rationale-extra-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.llm-rationale-extra-list {
  margin: 0 0 10px;
  padding-left: 16px;
}

.llm-rationale-extra-list li {
  margin-bottom: 4px;
}

.llm-rationale-extra-row {
  display: inline-flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.llm-rationale-extra-row-text {
  flex: 1 1 auto;
  min-width: 0;
}

.llm-source-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  color: rgba(0, 0, 0, 0.55);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  opacity: 0.75;
  flex: 0 0 auto;
  margin-top: 2px;
}

.llm-source-slack {
  font-size: 10px;
}

.llm-rationale-extra-text {
  margin: 0 0 10px;
}

.llm-next-step {
  position: absolute;
  right: 12px;
  top: calc(100% + 6px);
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow);
  font-size: 11px;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 3;
}

td.has-next-step:hover .llm-next-step,
td.has-next-step:focus-within .llm-next-step {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

thead {
  background: #fafafa;
}

th.is-sortable {
  cursor: pointer;
  user-select: none;
  font-weight: 600;
}

th.is-sortable:hover {
  background: #f3f4f6;
}

th.is-sortable:focus {
  outline: 2px solid rgba(0, 0, 0, 0.3);
  outline-offset: -1px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f7f7f7;
}

tbody tr.is-selected {
  background: #eeeeee;
}

tbody tr:hover td.col-account {
  background: #f7f7f7;
}

tbody tr.is-selected td.col-account {
  background: #eeeeee;
}

tbody tr:hover td.col-action {
  background: #f7f7f7;
}

tbody tr.is-selected td.col-action {
  background: #eeeeee;
}

table a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.account-cell {
  position: relative;
  white-space: normal;
  max-width: 100%;
}

.account-cell-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: 100%;
}

.account-name-link {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.account-page-link {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: #1f355d;
  border: 1px solid #bfc8dc;
  background: #f7f9ff;
  border-radius: 999px;
  padding: 2px 9px;
  line-height: 1.45;
}

.account-page-link:hover {
  background: #edf2ff;
  border-color: #a6b4d8;
  color: #10284f;
}

.account-page-link:focus-visible {
  outline: 2px solid rgba(61, 98, 173, 0.35);
  outline-offset: 1px;
}

.forecast-suggestion-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid #eedfb7;
  background: #fff7df;
  color: #7a5a00;
  padding: 2px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  cursor: default;
  white-space: normal;
}

.hover-links {
  position: absolute;
  right: 10px;
  top: 50%;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow);
  font-size: 11px;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 0.12s ease;
  z-index: 2;
  white-space: nowrap;
}

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

.hover-links .slack-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 600;
}

.hover-links span {
  font-family: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.hover-links .hover-links-sep {
  font-family: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color: var(--muted);
  opacity: 0.7;
}

.account-cell:hover .hover-links,
.account-cell:focus-within .hover-links,
tbody tr.is-selected .hover-links {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}

.action-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.take-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  height: 22px;
  min-width: 84px;
  padding: 0 8px;
  line-height: 1;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid #c9c9c9;
  background: #ffffff;
  color: #1b1b1b;
  border-radius: 999px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  width: 100%;
}

.take-action-btn:hover {
  background: #f3f3f3;
  border-color: #b6b6b6;
  color: #111111;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transform: none;
}

.take-action-btn:active {
  transform: none;
}

.action-cell.is-actioned {
  background: #f6fbf7;
  border: 1px solid #b9dfbf;
  border-radius: 12px;
  padding: 6px 7px;
  box-shadow: none;
  align-items: flex-start;
}

.action-cell a {
  font-size: 9px;
  font-weight: 600;
}

.view-analysis-btn {
  border-color: #bfc8dc;
  background: #f7f9ff;
}

.view-analysis-btn:hover {
  background: #edf2ff;
  border-color: #a6b4d8;
}

.action-modal[hidden] {
  display: none;
}

.action-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.action-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.action-modal-dialog {
  position: relative;
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: 12px auto;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.action-modal-header,
.action-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.action-modal-footer {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  justify-content: flex-end;
}

.action-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  padding: 0;
}

.action-modal-body {
  padding: 14px 16px;
}

.action-existing-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #b9dfbf;
  border-radius: 10px;
  background: #f6fbf7;
  color: #14532d;
  font-size: 12px;
  line-height: 1.35;
}

.action-existing-banner a {
  font-size: 12px;
  font-weight: 700;
}

.action-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1fr);
  gap: 16px;
}

.action-readonly {
  display: grid;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
}

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

.action-form label {
  font-size: 12px;
}

.action-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.action-preview-wrap {
  margin-top: 14px;
}

.action-preview-label {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.action-preview {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfbfb;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.4;
}

/* ── CSV Column Picker Modal ────────────────────────────── */

.csv-picker-modal[hidden] {
  display: none;
}

.csv-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.csv-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.csv-picker-dialog {
  position: relative;
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: 12px auto;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.csv-picker-header,
.csv-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.csv-picker-footer {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  justify-content: flex-end;
}

.csv-picker-body {
  padding: 14px 16px;
}

.csv-picker-actions-top {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.csv-picker-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px 12px;
  max-height: 50vh;
  overflow-y: auto;
}

.btn-sm {
  font-size: 12px;
  padding: 4px 10px;
}

.analysis-modal[hidden] {
  display: none;
}

.analysis-modal {
  position: fixed;
  inset: 0;
  z-index: 82;
}

.analysis-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.analysis-modal-dialog {
  position: relative;
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: 12px auto;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.analysis-modal.is-open .analysis-modal-backdrop {
  animation: analysis-modal-fade-in 180ms ease forwards;
}

.analysis-modal.is-open .analysis-modal-dialog {
  animation: analysis-modal-drop-in 220ms cubic-bezier(0.16, 0.84, 0.25, 1) forwards;
}

@keyframes analysis-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes analysis-modal-drop-in {
  from {
    opacity: 0;
    transform: translateY(-28px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .analysis-modal.is-open .analysis-modal-backdrop,
  .analysis-modal.is-open .analysis-modal-dialog {
    animation: none;
  }
}

.analysis-modal-header,
.analysis-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.analysis-modal-footer {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.analysis-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  padding: 0;
}

.analysis-modal-body {
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

.analysis-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.analysis-status {
  font-size: 13px;
  font-weight: 700;
}

.analysis-content {
  display: grid;
  gap: 10px;
}

.analysis-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfbfd;
  padding: 10px 12px;
}

.analysis-section h4 {
  margin: 0 0 6px;
  font-size: 13px;
}

.analysis-section h5 {
  margin: 0 0 6px;
  font-size: 12px;
}

.analysis-section p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.analysis-section ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
  font-size: 12px;
  line-height: 1.45;
}

.analysis-mitigation {
  display: grid;
  gap: 8px;
}

.analysis-mitigation-block {
  border: 1px solid #dce1ee;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px 10px;
}

.action-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  max-width: min(440px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
  font-size: 12px;
}

.action-toast[data-type="error"] {
  border-color: #b91c1c;
  color: #7f1d1d;
}

.action-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .action-grid {
    grid-template-columns: 1fr;
  }
}

pre {
  background: transparent;
  border-radius: 0;
  padding: 0;
  overflow-x: auto;
  font-size: 12px;
}

@media (max-width: 600px) {
  .page {
    padding: 0 18px 48px;
  }

  .page-login {
    padding-top: 24px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .hero-mark {
    width: min(108px, 38vw);
    justify-self: center;
  }
}

.feedback-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--cta);
  border: 1px solid var(--cta);
  color: #ffffff;
  box-shadow: 0 16px 44px rgba(225, 0, 152, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.feedback-fab:hover {
  transform: translateY(-1px);
  background: var(--cta-hover);
  border-color: var(--cta-hover);
  box-shadow: 0 22px 60px rgba(225, 0, 152, 0.33);
}

.feedback-fab:focus-visible {
  outline: 3px solid rgba(255, 45, 178, 0.45);
  outline-offset: 3px;
}

@supports (padding: max(0px)) {
  .feedback-fab {
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
  }
}

.account-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.account-forecast-suggestion {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.account-forecast-suggestion.is-mismatch {
  border-color: #eedfb7;
  background: #fff9e8;
}

.account-forecast-suggestion.is-aligned {
  border-color: #d7ead7;
  background: #edf9ed;
}

.account-forecast-suggestion-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.account-forecast-suggestion-meta {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.account-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#account-llm-coverage-badge.coverage-high {
  border-color: #b9d9bc;
  background: #edf8ee;
  color: #1f5b2c;
}

#account-llm-coverage-badge.coverage-mid {
  border-color: #eedfb7;
  background: #fff7df;
  color: #7a5a00;
}

#account-llm-coverage-badge.coverage-low {
  border-color: #f0d4cf;
  background: #fff0ed;
  color: #8a3b2a;
}

.account-metric {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.account-metric span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.account-metric strong {
  font-size: 18px;
  line-height: 1.2;
}

.account-metric.metric-high {
  border-color: #f0d4cf;
  background: #fff4f2;
}

.account-metric.metric-high strong {
  color: #8a3b2a;
}

.account-metric.metric-medium {
  border-color: #eedfb7;
  background: #fff9e8;
}

.account-metric.metric-medium strong {
  color: #7a5a00;
}

.account-deep-summary {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  padding: 10px 12px;
}

.account-quick-links {
  margin: -2px 0 10px;
}

.account-quick-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-quick-link {
  height: 32px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
}

#account-plain-english-recommendation {
  font-size: 14px;
  color: var(--text);
}

#portfolio-radar-summary {
  font-size: 13px;
  color: var(--muted);
}

.portfolio-forecast-section {
  margin-top: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.portfolio-forecast-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 10px;
}

.forecast-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.forecast-filter-toggle input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: #1f355d;
}

.forecast-filter-toggle input[type="checkbox"]:checked + span {
  color: #142846;
}

@supports selector(:has(*)) {
  .forecast-filter-toggle:has(input[type="checkbox"]:checked) {
    border-color: #1f355d;
    background: #f7f9ff;
  }
}

.forecast-filter-quarter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px 7px 3px 8px;
  background: #ffffff;
  font-size: 11px;
  color: var(--muted);
}

.forecast-filter-quarter > span {
  font-weight: 600;
  color: #4b5565;
  white-space: nowrap;
}

.forecast-filter-quarter select {
  border: 0;
  box-shadow: none;
  border-radius: 8px;
  height: 28px;
  min-width: 120px;
  padding: 4px 26px 4px 8px;
  background-position: right 8px center;
}

.forecast-filter-quarter select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(31, 53, 93, 0.16);
}

.field-help {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}

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

.portfolio-priority-block {
  display: grid;
  gap: 6px;
}

.portfolio-priority-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.portfolio-priority-header h3 {
  margin: 0;
  font-size: 15px;
}

.portfolio-priority-table-wrap {
  max-height: 420px;
  overflow-y: auto;
}

.portfolio-focus-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.portfolio-focus-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.portfolio-focus-copy h3 {
  margin: 0;
  font-size: 15px;
}

.portfolio-focus-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.portfolio-radar-table {
  margin-top: 10px;
}

#portfolio-radar-card .account-collapsible {
  margin-top: 10px;
}

.account-radar-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.account-radar-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.2;
  background: #f8f8f8;
}

.account-radar-mover-up {
  color: #8a3b2a;
  font-weight: 700;
}

.account-radar-mover-down {
  color: #1f5b2c;
  font-weight: 700;
}

.account-metric.account-metric-button {
  width: 100%;
  min-height: 72px;
  height: auto;
  margin-top: 0;
  padding: 10px 12px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
  line-height: normal;
  white-space: normal;
  font: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.account-metric.account-metric-button strong {
  display: block;
  margin: 0;
  line-height: 1.05;
}

.account-metric.account-metric-button:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.account-metric.account-metric-button.is-active {
  border-color: #1f355d;
  background: #f7f9ff;
  box-shadow: 0 0 0 2px rgba(31, 53, 93, 0.08);
}

.portfolio-focused-row {
  margin-top: 10px;
}

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

.portfolio-focused-header h3 {
  margin: 0;
  font-size: 16px;
}

.portfolio-focused-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.portfolio-focused-actions .btn {
  margin-top: 0;
}

.portfolio-focused-table-wrap {
  max-height: 730px;
  overflow-y: auto;
  overflow-x: auto;
}

.table-sort-btn {
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  width: 100%;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  border-radius: 9px;
  height: auto;
  min-height: 26px;
  box-shadow: none;
  transform: none;
  text-align: left;
}

.table-sort-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.table-sort-btn:hover,
.table-sort-btn:active {
  background: #f2f4f8;
  color: inherit;
  box-shadow: none;
  transform: none;
}

.table-sort-btn:focus-visible {
  outline: 2px solid rgba(31, 53, 93, 0.35);
  outline-offset: 1px;
}

.table-sort-btn.is-active {
  background: #e9edf5;
  color: #112745;
  font-weight: 700;
}

.table-sort-btn.is-active:hover {
  background: #e0e7f3;
}

.table-sort-arrow {
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1;
  min-width: 10px;
  text-align: right;
}

.table-sort-btn.is-active .table-sort-arrow {
  color: #112745;
}

#portfolio-radar-prompt-type,
#portfolio-radar-owner-filter,
#portfolio-radar-acv-filter,
#portfolio-radar-scan-quarters,
#portfolio-radar-operational-segment {
  min-width: 120px;
}

#portfolio-filter-quarter {
  min-width: 150px;
}

@media (max-width: 680px) {
  .form-row.compact.portfolio-scope-row .portfolio-scope-label {
    width: min(360px, 100%);
    min-width: 220px;
  }
}

.account-plain-english-bullets {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 7px;
}

.account-plain-english-bullets li {
  font-size: 13px;
  color: #2f2f2f;
  line-height: 1.45;
}

#account-selector.is-no-match {
  border-color: #d97706;
  background: #fffcf2;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.12);
}

#account-explorer-form button[type="submit"] {
  background: var(--cta);
  border-color: var(--cta);
}

#account-explorer-form button[type="submit"]:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
  box-shadow: 0 10px 26px var(--cta-shadow);
}

.account-deep-link {
  font-weight: 700;
  border-color: var(--border-strong);
}

.account-deep-link:hover {
  background: #f6f6f6;
}

.account-collapsible {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
  padding: 0;
}

.account-collapsible + .account-collapsible {
  margin-top: 10px;
}

.account-collapsible#account-plain-english-details {
  margin-top: 10px;
}

.account-collapsible summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
}

.account-collapsible summary::-webkit-details-marker {
  display: none;
}

.account-collapsible summary::after {
  content: "Show";
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  background: #ffffff;
}

.account-collapsible[open] summary::after {
  content: "Hide";
}

.account-collapsible-meta {
  margin: 0 14px 8px;
  font-size: 13px;
  color: var(--muted);
}

.table-wrap [data-evidence-opps] {
  margin-top: 0;
  height: 28px;
  padding: 4px 10px;
  font-size: 11px;
}

.account-deep-analysis-preview {
  margin: 0 14px 14px;
  white-space: pre-wrap;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  padding: 12px;
  line-height: 1.45;
}

.account-deep-analysis-full-content {
  display: grid;
  gap: 14px;
  margin: 0 14px 14px;
}

.account-deep-analysis-full-content section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
  padding: 12px;
}

.account-deep-analysis-full-content h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.account-deep-analysis-full-content p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.account-deep-analysis-full-content ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}

.account-deep-analysis-full-content li {
  font-size: 13px;
  line-height: 1.45;
}

.account-renewal-drawer[hidden] {
  display: none;
}

.account-renewal-drawer {
  position: fixed;
  inset: 0;
  z-index: 95;
}

.account-renewal-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.36);
}

.account-renewal-drawer-panel {
  position: absolute;
  right: 0;
  top: 65px;
  width: min(620px, calc(100vw - 12px));
  height: calc(100% - 65px);
  background: #ffffff;
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.16);
  display: grid;
  grid-template-rows: auto 1fr;
}

.account-renewal-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.account-renewal-drawer-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.account-renewal-drawer-content {
  padding: 14px 16px 22px;
  overflow: auto;
  display: grid;
  gap: 14px;
}

.account-drawer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 12px;
  font-size: 13px;
}

.account-drawer-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
  padding: 12px;
}

.account-drawer-block h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.account-drawer-block p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.account-drawer-evidence-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.account-drawer-evidence-list li {
  font-size: 12.5px;
  line-height: 1.4;
}

.account-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-drawer-actions .btn {
  margin-top: 0;
}

.watchlist-tools {
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.watchlist-tools .table-search {
  min-width: 220px;
  flex: 1 1 320px;
}

.watchlist-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-coverage-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.account-coverage-note {
  margin: 0;
  max-width: 280px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

#watchlist-table .btn {
  margin-top: 0;
  height: 30px;
  padding: 6px 12px;
  font-size: 12px;
}

@media (max-width: 720px) {
  .account-renewal-drawer-panel {
    width: 100%;
  }
}

/* Meeting prep drawer — wider than the renewal drilldown panel */
.account-meeting-prep-panel {
  width: min(780px, calc(100vw - 12px));
}

/* Meeting prep brief content styles */
.mp-section { margin-bottom: 20px; }
.mp-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #666;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}
.mp-situation {
  font-size: 14px;
  font-style: italic;
  color: #222;
  border-left: 3px solid #111;
  padding: 4px 0 4px 11px;
  margin: 10px 0 4px;
}
.mp-objective { font-size: 12px; color: #555; padding-left: 14px; margin-bottom: 14px; }
.mp-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.mp-success h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: #15803d; font-weight: 700; margin-bottom: 6px; }
.mp-success ul { list-style: none; padding: 0; }
.mp-success li { font-size: 12px; padding: 2px 0; }
.mp-success li::before { content: "✓ "; color: #16a34a; font-weight: 700; }
.mp-item {
  margin-bottom: 7px;
  padding: 9px 12px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
}
.mp-item-hd { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; font-size: 13px; }
.mp-item-why { font-size: 12px; color: #555; margin-bottom: 2px; }
.mp-ev { font-size: 11px; color: #777; border-left: 2px solid #ddd; padding: 2px 0 2px 7px; margin-top: 4px; }
.mp-ev-src { font-weight: 600; margin-right: 5px; }
.mp-ev-snip { font-style: italic; }
.mp-mine { border-color: #fde68a; background: #fffbeb; }
.mp-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
}
.mp-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; }
.mp-table th { text-align: left; background: #f5f5f5; padding: 5px 9px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #666; border-bottom: 1px solid #e5e5e5; }
.mp-table td { padding: 6px 9px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.mp-t-min { white-space: nowrap; color: #888; width: 68px; }
.mp-q-q { font-weight: 600; margin-bottom: 2px; font-size: 12.5px; }
.mp-q-r { font-size: 12px; color: #555; margin-bottom: 3px; }
.mp-q-t { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.mp-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mp-two-col h4 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: #999; font-weight: 700; margin-bottom: 5px; }
.mp-sh { margin-bottom: 5px; font-size: 12px; }
.mp-sh-notes { color: #666; font-style: italic; }
.mp-gaps { font-size: 11px; color: #888; margin-top: 7px; }
.mp-conf { font-size: 12px; color: #666; background: #f9f9f9; border: 1px solid var(--border); border-radius: 8px; padding: 9px 13px; }
.mp-missing { font-size: 11px; color: #999; margin-top: 3px; }

.risk-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f5f5f5;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
}

.risk-pill.risk-high {
  border-color: #f0d4cf;
  background: #fff0ed;
  color: #8a3b2a;
}

.risk-pill.risk-medium {
  border-color: #eedfb7;
  background: #fff7df;
  color: #7a5a00;
}

.risk-pill.risk-low,
.risk-pill.risk-none {
  border-color: #d7ead7;
  background: #edf9ed;
  color: #1f5b2c;
}

.risk-pill.risk-unknown {
  border-color: var(--border);
  background: #f4f4f4;
  color: var(--muted);
}

/* Social Proof */
.social-proof-filter-row label,
.social-proof-filter-row input,
.social-proof-filter-row select {
  min-width: 150px;
}

.social-proof-toggle-row {
  margin-top: 8px;
}

.social-proof-runtime-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.social-proof-pagination {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.social-proof-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.social-proof-table-tools {
  margin-top: 0;
  margin-left: auto;
}

.social-proof-table-tools .tool-select select {
  min-width: 160px;
}

.social-proof-table-hint {
  margin-left: 6px;
}

.social-proof-theme-map {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}

.social-proof-theme-map-label {
  font-size: 12px;
  color: var(--muted);
}

.social-proof-theme-map-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.social-proof-theme-map-chip {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  line-height: 1;
  padding: 5px 9px;
  cursor: pointer;
}

.social-proof-theme-map-chip:hover {
  border-color: #d6c4bf;
  background: #fff7f4;
  color: var(--text);
  box-shadow: none;
  transform: none;
}

.social-proof-theme-map-chip.is-active {
  border-color: #d7c08d;
  background: #fff4df;
  color: #7a5a00;
}

.social-proof-theme-map-chip:active,
.social-proof-theme-map-chip:focus,
.social-proof-theme-map-chip:focus-visible {
  color: var(--text);
  box-shadow: none;
  transform: none;
  outline: none;
}

.social-proof-theme-map-chip.is-active:hover,
.social-proof-theme-map-chip.is-active:active,
.social-proof-theme-map-chip.is-active:focus,
.social-proof-theme-map-chip.is-active:focus-visible {
  color: #7a5a00;
}

.social-proof-theme-map-count {
  color: var(--muted);
  margin-left: 4px;
}

/* Lifecycle stage chips (conditional view) */
.lifecycle-stage-map {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.lifecycle-stage-map-label {
  font-size: 12px;
  color: var(--muted);
}

.lifecycle-stage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lifecycle-stage-chip {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  line-height: 1;
  padding: 5px 9px;
  cursor: pointer;
}

.lifecycle-stage-chip:hover {
  border-color: #d6c4bf;
  background: #fff7f4;
  color: var(--text);
  box-shadow: none;
  transform: none;
}

.lifecycle-stage-chip.is-active {
  border-color: #d7c08d;
  background: #fff4df;
  color: #7a5a00;
}

.lifecycle-stage-chip:active,
.lifecycle-stage-chip:focus,
.lifecycle-stage-chip:focus-visible {
  color: var(--text);
  box-shadow: none;
  transform: none;
  outline: none;
}

.lifecycle-stage-chip.is-active:hover,
.lifecycle-stage-chip.is-active:active,
.lifecycle-stage-chip.is-active:focus,
.lifecycle-stage-chip.is-active:focus-visible {
  color: #7a5a00;
}

.lifecycle-stage-count {
  color: var(--muted);
  margin-left: 4px;
}

.social-proof-table-row {
  cursor: pointer;
}

#sp-snippets-table tbody tr.social-proof-table-row:hover {
  background: #f7f7f7;
}

#sp-snippets-table tbody tr.social-proof-table-row:hover td.account-cell {
  background: #f7f7f7;
}

.social-proof-table-row .account-cell-inner {
  gap: 4px;
}

.social-proof-inline-link {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.social-proof-inline-link:hover {
  background: none;
  border-color: transparent;
  box-shadow: none;
  transform: none;
  color: var(--text);
}

.social-proof-inline-link:active,
.social-proof-inline-link:focus,
.social-proof-inline-link:focus-visible {
  background: none;
  border-color: transparent;
  box-shadow: none;
  transform: none;
  color: var(--text);
  outline: none;
}

.social-proof-theme-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 6px;
  margin-bottom: 4px;
  font-size: 11px;
  background: #fafafa;
}

.social-proof-risk-chip {
  margin-right: 4px;
  margin-bottom: 4px;
}

.social-proof-status-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.2;
}

.social-proof-status-pill.status-new {
  background: #fff4df;
  border-color: #edd4a4;
  color: #7a5a00;
}

.social-proof-status-pill.status-reviewed {
  background: #fff4df;
  border-color: #edd4a4;
  color: #7a5a00;
}

.social-proof-status-pill.status-approved {
  background: #edf8ee;
  border-color: #b9d9bc;
  color: #1f5b2c;
}

.social-proof-status-pill.status-rejected {
  background: #fff0ed;
  border-color: #e9c6bf;
  color: #8a3b2a;
}

.social-proof-col-quote {
  width: 260px;
  min-width: 220px;
  max-width: 300px;
}

.social-proof-quote-cell {
  width: 260px;
  min-width: 220px;
  max-width: 300px;
}

.social-proof-drawer[hidden] {
  display: none;
}

.social-proof-drawer {
  position: fixed;
  inset: 0;
  z-index: 98;
}

.social-proof-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.34);
}

.social-proof-drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  width: min(720px, calc(100vw - 12px));
  height: 100%;
  background: #ffffff;
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.16);
  display: grid;
  grid-template-rows: auto 1fr;
}

.social-proof-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.social-proof-drawer-header h3 {
  margin: 0;
  font-size: 16px;
}

.social-proof-drawer-content {
  padding: 14px 16px 20px;
  overflow-y: auto;
  display: grid;
  gap: 12px;
}

.social-proof-drawer-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
  padding: 12px;
}

.social-proof-drawer-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.social-proof-drawer-section p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
}

.social-proof-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.social-proof-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 10px;
  font-size: 12px;
}

.social-proof-post-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
  margin-bottom: 8px;
}

.social-proof-post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.social-proof-audit-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
}

.social-proof-audit-list li {
  font-size: 12px;
  line-height: 1.4;
}

.social-proof-audit-list li p {
  margin: 2px 0 0;
}

#sp-note-input {
  width: 100%;
  resize: vertical;
  min-height: 90px;
}

.social-proof-notes-history {
  margin: 8px 0 0;
  white-space: pre-wrap;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .social-proof-table-tools {
    width: 100%;
    margin-left: 0;
  }
}

/* ---- Weekly Progress ---- */

.weekly-progress-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Table rows */
#weekly-progress-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#weekly-progress-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

#weekly-progress-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

.wp-row:hover {
  background: #f8f9fb;
}

.wp-row.is-expanded {
  background: #f0f4ff;
}

.wp-account-cell {
  white-space: normal !important;
  min-width: 160px;
  max-width: 260px;
}

.wp-date-cell {
  font-size: 12px;
  color: var(--muted);
}

.wp-actions-cell {
  white-space: nowrap !important;
  text-align: right;
}

.wp-actions-cell .btn {
  margin-left: 4px;
}

/* Risk badges */
.risk-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.risk-critical {
  background: #fde8e8;
  color: #b91c1c;
}

.risk-high {
  background: #fff3cd;
  color: #92400e;
}

.risk-medium {
  background: #e0f0ff;
  color: #1e40af;
}

.risk-low {
  background: #d1fae5;
  color: #065f46;
}

/* Direction badges */
.direction-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}

.direction-improving {
  background: #d1fae5;
  color: #065f46;
}

.direction-stable {
  background: #e0f0ff;
  color: #1e40af;
}

.direction-worsening {
  background: #fde8e8;
  color: #b91c1c;
}

/* Direction pill filter chips — identical to direction-badge in table */
.direction-filter-chip {
  cursor: pointer;
  border: none;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.direction-filter-chip:hover {
  opacity: 0.75;
}
.direction-filter-chip.is-active {
  opacity: 1;
}
.direction-pending {
  background: #f3f4f6;
  color: #6b7280;
}
.direction-filter-count {
  opacity: 0.6;
  margin-left: 2px;
}
#weekly-progress-list-card .lifecycle-stage-map {
  padding: 0 16px;
}

/* Detail panel (expands below table on row click) */
.weekly-progress-detail-panel[hidden] {
  display: none;
}

.weekly-progress-detail-panel {
  margin-top: -1px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 0 0 16px 16px;
  background: #fafbfc;
}

.weekly-progress-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.weekly-progress-detail-header h3 {
  margin: 0;
  font-size: 15px;
}

.wp-detail-section {
  margin-bottom: 12px;
}

.wp-detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.wp-detail-text {
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.weekly-progress-direction {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.wp-signal-list {
  margin: 4px 0 0 16px;
  padding: 0;
  font-size: 13px;
}

.wp-signal-list li,
.wp-detail-section ul li {
  margin-bottom: 3px;
}

.signal-positive {
  color: #065f46;
}

.signal-negative {
  color: #b91c1c;
}

.signal-neutral {
  color: var(--text);
}

.btn-sm {
  font-size: 12px;
  padding: 4px 12px;
}

.btn-sent {
  background: #d1fae5;
  color: #065f46;
  border-color: #b9dfbf;
}

#weekly-progress-list-card .portfolio-scope-row {
  padding: 0 16px 8px;
}

#weekly-progress-list-card .portfolio-scope-row .portfolio-scope-label {
  width: auto;
  min-width: 0;
  max-width: none;
}

/* Weekly Progress Modal */

.modal-overlay[hidden] {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 40px;
  background: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 80px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-footer {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  justify-content: flex-end;
}

.modal-body {
  padding: 14px 16px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.form-label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}

.form-label input[type="text"],
.form-label textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}

.slack-preview {
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
  font-size: 12px;
  font-family: monospace;
  white-space: pre-wrap;
  max-height: 300px;
  overflow: auto;
}

.wp-detail-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wp-slack-preview-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

@keyframes wp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.wp-generating {
  animation: wp-pulse 1.5s ease-in-out infinite;
}
