:root {
  --app-bg: #f8f8fb;
  --app-surface: #ffffff;
  --app-border: #ececf3;
  --app-ink: #191919;
  --app-muted: #8d8d98;
  --app-primary: #8f67ff;
  --app-primary-strong: #7446f7;
  --app-accent: #f1ebff;
  --app-sidebar: #ffffff;
  --app-nav-height: 64px;
}

html {
  font-size: 15px;
}

body.app-body {
  background: linear-gradient(180deg, #fcfcfe 0%, var(--app-bg) 100%);
  color: var(--app-ink);
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9375rem;
}

.app-container {
  max-width: 1480px;
}

.app-main-workspace {
  padding-bottom: 0;
  min-height: 100vh;
}

.app-navbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--app-border);
  box-shadow: 0 8px 30px rgba(25, 25, 25, 0.04);
  backdrop-filter: blur(10px);
}

.app-brand {
  display: inline-flex;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
}

.app-brand-tag {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.app-brand-logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: min(360px, 46vw);
  object-fit: contain;
}

.app-top-btn {
  border: 1px solid var(--app-border);
  background: #fff;
  color: var(--app-ink);
  border-radius: 0.8rem;
  padding-inline: 0.9rem;
}

.app-top-btn:hover {
  background: #f6f6fb;
  color: var(--app-ink);
}

.app-top-btn-primary {
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-strong));
  color: #fff;
  border-color: transparent;
}

.app-top-btn-primary:hover {
  color: #fff;
  background: linear-gradient(135deg, #9b76ff, #7d51f8);
}

.nav-user-chip {
  background: #f5f3fb;
  border: 1px solid #ece7ff;
  color: #5b4b8a;
  border-radius: 1px;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
}

.nav-user-chip-accent {
  background: #eef4ff;
  border-color: #d8e6ff;
  color: #35558a;
}

.page-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.narrow-shell {
  max-width: 1100px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 0.85rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 700;
  color: #9b96aa;
}

.page-title {
  font-size: clamp(1.55rem, 2.2vw, 2.25rem);
  line-height: 1.1;
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.page-subtitle {
  color: var(--app-muted);
  max-width: 50rem;
  margin-bottom: 0;
  font-size: 0.9rem;
}

.policy-builder {
  background: linear-gradient(180deg, #fcfcff 0%, #f5f4fb 100%);
  border: 1px solid var(--app-border);
}

.pagy.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pagy.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.9rem;
  border: 1px solid var(--app-border);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.96);
  color: var(--app-ink);
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(25, 25, 25, 0.04);
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.pagy.nav a:hover {
  background: #f6f6fb;
  border-color: #ddd9ec;
  color: var(--app-ink);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(25, 25, 25, 0.07);
}

.pagy.nav a.current {
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-strong));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 24px rgba(116, 70, 247, 0.22);
}

.pagy.nav a[aria-label="Previous"],
.pagy.nav a[aria-label="Next"] {
  min-width: 6.5rem;
  padding: 0 1rem;
  border-radius: 999px;
  font-size: 0;
  letter-spacing: 0.01em;
}

.pagy.nav a[aria-label="Previous"]::before,
.pagy.nav a[aria-label="Next"]::before {
  font-size: 0.88rem;
  font-weight: 700;
}

.pagy.nav a[aria-label="Previous"]::before {
  content: "\2039  Prev";
}

.pagy.nav a[aria-label="Next"]::before {
  content: "Next  \203A";
}

.pagy.nav a.gap,
.pagy.nav a[aria-disabled="true"] {
  background: transparent;
  color: var(--app-muted);
  border-color: transparent;
  box-shadow: none;
  transform: none;
  cursor: default;
}

.pagy.nav a.gap {
  min-width: auto;
  padding: 0 0.15rem;
}

.pagy.nav a[aria-disabled="true"] {
  opacity: 0.72;
}

.pagy.nav a[aria-disabled="true"][aria-label="Previous"],
.pagy.nav a[aria-disabled="true"][aria-label="Next"] {
  border-color: var(--app-border);
  background: rgba(245, 245, 250, 0.9);
}

.account-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(219, 227, 239, 0.72);
  backdrop-filter: blur(10px);
}

.metric-card {
  border: 1px solid var(--app-border);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  /* border-radius: 1px; */
  border-radius: 1px;
  padding: 0.9rem 1rem;
}

.metric-label {
  color: var(--app-muted);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.metric-value {
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1;
}

.metric-value.small-value {
  font-size: 0.92rem;
  line-height: 1.35;
  word-break: break-word;
}

.module-policy-table th {
  font-size: 0.82rem;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom-width: 1px;
}

.module-policy-table td,
.module-policy-table th {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.workspace-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 100vh;
}

.workspace-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  height: 100vh;
}

.workspace-sidebar-card {
  background: var(--app-sidebar);
  color: var(--app-ink);
  min-height: 100vh;
  height: 100%;
  padding: 1.1rem 1rem 0;
  border-right: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.workspace-sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.workspace-sidebar-bottom {
  margin-top: auto;
  padding-top: 1.25rem;
  padding-bottom: 1rem;
}

.workspace-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.workspace-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #c9b7ff, #9a78ff);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
}

.workspace-user-name {
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.15;
}

.workspace-user-email {
  color: var(--app-muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.workspace-client-name {
  margin-top: 0.25rem;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
}

.report-enhanced-select + .ts-wrapper {
  font-size: 0.98rem;
}

.report-enhanced-select + .ts-wrapper .ts-control {
  min-height: 3rem;
  max-height: 70px;
  border: 1px solid #d9deea;
  border-radius: 0.95rem;
  padding: 0.45rem 0.6rem;
  box-shadow: none;
  background: #fff;
  overflow-y: auto;
  align-content: flex-start;
  scrollbar-width: thin;
}

.report-enhanced-select + .ts-wrapper.focus .ts-control,
.report-enhanced-select + .ts-wrapper .ts-control:focus-within {
  border-color: #5d7df6;
  box-shadow: 0 0 0 0.2rem rgba(93, 125, 246, 0.12);
}

.report-enhanced-select + .ts-wrapper.multi .ts-control > div {
  background: #eef3ff;
  border: 1px solid #dbe5ff;
  color: #23408e;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  line-height: 1.2;
}

.report-enhanced-select + .ts-wrapper .ts-control > input {
  min-width: 8rem;
  font-size: 0.95rem;
}

.report-enhanced-select + .ts-wrapper .ts-dropdown {
  border: 1px solid #d9deea;
  border-radius: 0.95rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  padding: 0.4rem;
}

.report-enhanced-select + .ts-wrapper .option,
.report-enhanced-select + .ts-wrapper .item {
  word-break: break-word;
}

.report-enhanced-select + .ts-wrapper .option {
  border-radius: 0.7rem;
  padding: 0.55rem 0.7rem;
}

.report-enhanced-select + .ts-wrapper .option.active {
  background: #eff4ff;
  color: #173a8b;
}

.report-enhanced-select + .ts-wrapper .remove {
  border-left: 0;
  color: #4f67a9;
  margin-left: 0.35rem;
  padding-left: 0.25rem;
}

.report-enhanced-select + .ts-wrapper .no-results {
  color: #8d8d98;
  padding: 0.55rem 0.7rem;
}

.public-report-body {
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.08), transparent 32%),
    linear-gradient(180deg, #fbfcff 0%, #f3f6fb 100%);
}

.public-report-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.public-report-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.public-report-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid rgba(219, 227, 239, 0.72);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-radius: 1.4rem;
}

.public-report-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #7c86a3;
  margin-bottom: 0.45rem;
}

.public-report-title {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.public-report-subtitle {
  margin-bottom: 0;
  color: #6b7280;
  max-width: 46rem;
}

.public-report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.public-report-pill {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(219, 227, 239, 0.72);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 1.1rem;
}

@media (max-width: 991px) {
  .public-report-hero {
    flex-direction: column;
    align-items: start;
  }

  .public-report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .public-report-main {
    padding-inline: 1rem;
  }

  .public-report-summary {
    grid-template-columns: 1fr;
  }
}

.report-chart-wrap {
  display: flex;
  justify-content: center;
  padding: 1rem 0 1.5rem;
}

.report-chart-donut {
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.report-chart-center {
  width: 8.25rem;
  height: 8.25rem;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

.report-legend {
  display: grid;
  gap: 0.75rem;
}

.report-legend-item {
  display: flex;
  align-items: start;
  gap: 0.75rem;
}

.report-legend-swatch {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  margin-top: 0.25rem;
  flex: 0 0 auto;
}

.workspace-title {
  font-size: 1.25rem;
  line-height: 1.1;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.workspace-slug {
  color: var(--app-muted);
  font-size: 0.82rem;
}

.workspace-search-input {
  border-radius: 0.75rem;
  border-color: var(--app-border);
  background: #f3f4f8;
  font-size: 0.88rem;
  min-height: 2.5rem;
}

.workspace-search-input:disabled {
  color: #9d9cab;
  opacity: 1;
}

.workspace-nav-group {
  display: grid;
  gap: 0.55rem;
}

.workspace-section-label {
  color: #b0acbc;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding-inline: 0.45rem;
  margin-bottom: 0;
}

.workspace-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.workspace-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.55rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.8rem;
  color: #78788a;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.94rem;
  transition: all 0.15s ease;
}

.workspace-nav-link:hover {
  color: var(--app-ink);
  background: #f5f4fa;
}

.workspace-nav-link.active {
  color: var(--app-ink);
  background: #ffffff;
  border: 1px solid var(--app-border);
  box-shadow: 0 2px 8px rgba(32, 34, 39, 0.04);
}

.workspace-nav-link-muted {
  color: #9b97a9;
}

.workspace-main {
  min-width: 0;
  padding: 1.5rem 0 1.5rem 1.75rem;
}

.admin-sidebar-card {
  background: linear-gradient(180deg, #ffffff, #fbfbfe);
}

.admin-workspace-main {
  padding-top: 1.25rem;
}

.workspace-alert {
  margin-bottom: 1rem;
}

.auto-dismiss-alert {
  transition: opacity 0.3s ease, transform 0.3s ease, margin 0.3s ease;
}

.auto-dismiss-alert-hidden {
  opacity: 0;
  transform: translateY(-6px);
}

.panel-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--app-border);
  border-radius: 1px;
  padding: 1rem 1.05rem;
  box-shadow: 0 8px 24px rgba(22, 38, 63, 0.035);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}

.panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.panel-subtitle {
  margin: 0.25rem 0 0;
  color: var(--app-muted);
  font-size: 0.86rem;
}

.metric-card-hero {
  background: #fff;
  color: var(--app-ink);
}

.metric-card-request {
  background: linear-gradient(135deg, #fcfbff, #f6f3ff);
}

.metric-card-hero .metric-label,
.metric-card-hero .metric-footnote {
  color: var(--app-muted);
}

.metric-footnote {
  color: var(--app-muted);
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

.workspace-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--app-muted);
  border-bottom-width: 1px;
}

.workspace-table td,
.workspace-table th {
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
  font-size: 0.9rem;
}

.finding-feed {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.insight-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 0.9rem;
}
.btn{
  border-radius: 1px !important;
}

.insight-tile {
  border: 1px solid var(--app-border);
  border-radius: 1px;
  background: linear-gradient(180deg, #ffffff, #fafbfe);
  padding: 0.95rem;
}

.insight-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
  margin-bottom: 0.8rem;
}

.status-meter-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.status-meter-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.status-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.84rem;
}

.progress-thin {
  height: 0.45rem;
  background: #f1f2f7;
}

.stats-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.insight-summary-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.insight-summary-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  font-size: 0.9rem;
  color: #363847;
}

.insight-summary-dot {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-strong));
}

.insight-divider {
  height: 1px;
  background: var(--app-border);
  margin: 1rem 0;
}

.finding-feed-item {
  border: 1px solid var(--app-border);
  border-radius: 1px;
  padding: 0.9rem;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.stats-pill {
  padding: 0.9rem;
  border-radius: 1px;
  border: 1px solid var(--app-border);
  background: #fff;
}

.stats-pill-value {
  margin-top: 0.55rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.report-run-summary {
  overflow: hidden;
}

.report-run-hero {
  min-height: 100%;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--app-border);
  background:
    radial-gradient(circle at top right, rgba(143, 103, 255, 0.12), transparent 38%),
    linear-gradient(180deg, #ffffff, #f8fbff);
}

.report-run-status-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.45rem;
}

.report-run-pulse {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: #f0ad4e;
  box-shadow: 0 0 0 rgba(240, 173, 78, 0.5);
  animation: reportPulse 1.6s infinite;
}

.report-run-progress-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 255, 0.98));
}

.report-run-progress-bar {
  position: relative;
  overflow: hidden;
  height: 0.5rem;
  border-radius: 999px;
  background: #eceefa;
  margin-bottom: 1rem;
}

.report-run-progress-fill {
  height: 100%;
  width: 36%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c9b7ff, #8f67ff, #7446f7);
}

.report-run-progress-fill.is-running {
  width: 52%;
  animation: reportProgressSlide 1.8s ease-in-out infinite alternate;
}

.report-run-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  padding: 0.9rem;
  min-height: 100%;
  border: 1px solid var(--app-border);
  background: #fff;
}

.report-run-step.is-active {
  border-color: #ddd2ff;
  background: linear-gradient(180deg, #fff, #faf8ff);
}

.report-run-step-marker {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #5c46a3;
  background: #eee8ff;
}

.report-run-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.report-run-meta-item {
  padding: 0.9rem;
  border: 1px solid var(--app-border);
  background: #fff;
}

.report-run-failure-card {
  border-color: #f1d7dd;
  background: linear-gradient(180deg, #fff, #fff9fa);
}

.report-run-error {
  padding: 0.95rem 1rem;
  border: 1px solid #f4d6dd;
  background: #fff;
}

@keyframes reportPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(240, 173, 78, 0.45);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(240, 173, 78, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(240, 173, 78, 0);
  }
}

@keyframes reportProgressSlide {
  0% {
    transform: translateX(0%);
  }

  100% {
    transform: translateX(85%);
  }
}

@media (max-width: 991px) {
  .report-run-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .report-run-meta-grid {
    grid-template-columns: 1fr;
  }
}

.module-usage-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.api-key-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-control {
    border-radius: 1px;
}

.api-key-policy-panel {
  border: 1px solid #ece9f8;
  border-radius: 0.95rem;
  background: #fbfaff;
  padding: 0.95rem;
}

.api-key-policy-default-note {
  border: 1px solid #ececf3;
  border-radius: 0.8rem;
  background: #ffffff;
  padding: 0.75rem 0.85rem;
}

.policy-note {
  border: 1px solid #ececf3;
  border-radius: 0.8rem;
  background: #ffffff;
  padding: 0.75rem 0.85rem;
}

.module-score-cell {
  min-width: 140px;
}

.module-signal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.module-signal-row td {
  padding-top: 0;
  border-top: 0;
}

.module-signal-card {
  min-width: 160px;
  flex: 1 1 180px;
  max-width: 220px;
  padding: 0.7rem;
  border: 1px solid #e7eaf3;
  border-radius: 0.8rem;
  background: #fbfcff;
}

.module-score-hint {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #53576a;
  line-height: 1.35;
}

.module-score-hint strong {
  color: #222534;
}

.module-score-hint-muted {
  color: #8d90a0;
}

.api-key-card-details {
  border: 1px solid var(--app-border);
  border-radius: 1px;
  background: linear-gradient(180deg, #ffffff, #fafbfe);
  overflow: hidden;
}

.api-key-card-summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1rem 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.api-key-card-summary::-webkit-details-marker {
  display: none;
}

.api-key-card-summary::after {
  content: "+";
  font-size: 1.15rem;
  color: #82859a;
  margin-left: 0.75rem;
}

.api-key-card-details[open] .api-key-card-summary::after {
  content: "−";
}

.rounded-4{
  border-radius: 1px !important;
}
.alert {
    border-radius: 1px !important;
}
.api-key-card-summary-main {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.api-key-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.api-key-card-prefix {
  font-size: 0.8rem;
  color: var(--app-muted);
}

.api-key-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.api-key-card-summary-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  gap: 0.5rem;
}

.api-key-mini-stat {
  display: grid;
  gap: 0.15rem;
  text-align: center;
  padding: 0.55rem 0.6rem;
  border: 1px solid #ececf3;
  border-radius: 1px;
  background: #fff;
}

.api-key-mini-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
  font-weight: 700;
}

.api-key-mini-value {
  font-size: 0.98rem;
  font-weight: 700;
  color: #1f2231;
}

.api-key-card-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid #f0f1f6;
}

.api-key-inline-note {
  padding-top: 0.65rem;
  font-size: 0.8rem;
  color: #7a7f91;
}

.module-usage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 1px;
  border: 1px solid var(--app-border);
  background: #fff;
}

.table-warning-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.table-warning-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: #fff4e8;
  border: 1px solid #ffd9ae;
  color: #8a4b08;
  font-size: 0.76rem;
  line-height: 1.2;
}

.code-example-stack {
  display: grid;
  gap: 1rem;
}

.code-example-card {
  border: 1px solid var(--app-border);
  background: linear-gradient(180deg, #ffffff, #fafbfe);
}

.code-example-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem 0;
}

.empty-state-panel {
  padding: 1.1rem 1rem;
  border: 1px dashed var(--app-border);
  background: linear-gradient(180deg, #ffffff, #fafbfe);
}

.finding-fact-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed #efedf6;
}

.finding-fact-row:last-child {
  border-bottom: 0;
}

.finding-fact-label {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.finding-fact-value {
  color: var(--app-ink);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: right;
}

.request-findings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.finding-card {
  border: 1px solid var(--app-border);
  border-radius: 1px;
  padding: 0.9rem;
  background: linear-gradient(180deg, #ffffff, #fcfcfe);
}

.finding-score {
  font-weight: 700;
  color: var(--app-primary-strong);
  font-size: 0.92rem;
}

.finding-ai-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.finding-ai-highlight {
  border: 1px solid #efedf6;
  border-radius: 10px;
  padding: 0.75rem 0.8rem;
  background: #fff;
}

.finding-ai-highlight-label {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.finding-ai-highlight-value {
  color: var(--app-ink);
  font-size: 0.92rem;
  font-weight: 700;
  margin-top: 0.35rem;
  line-height: 1.25;
}

.json-block {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.76rem;
  color: #17314f;
  background: rgba(16, 35, 60, 0.05);
  border: 1px solid rgba(16, 35, 60, 0.08);
  border-radius: 1px;
  padding: 0.95rem;
  max-height: 360px;
  overflow: auto;
}

.token-panel {
  display: grid;
  gap: 0.9rem;
  background: linear-gradient(135deg, #fff8de, #ffefb4);
  border: 1px solid #f0d983;
  border-radius: 1px;
  padding: 1rem 1.05rem;
  box-shadow: 0 14px 40px rgba(135, 97, 17, 0.12);
}

.token-code-large {
  font-size: 0.9rem;
  padding: 0.85rem 0.95rem;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-list-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  border-bottom: 1px dashed #efedf6;
  padding-bottom: 0.55rem;
}

.summary-key {
  color: var(--app-muted);
  font-size: 0.8rem;
}

.summary-value {
  color: var(--app-ink);
  font-weight: 600;
  text-align: right;
  font-size: 0.86rem;
}

.finding-facts {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.finding-fact {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.82rem;
}

.finding-fact-key {
  color: var(--app-muted);
}

.finding-fact-value {
  color: var(--app-ink);
  text-align: right;
  font-weight: 500;
}

.request-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.request-summary-stat {
  border: 1px solid var(--app-border);
  border-radius: 10px;
  padding: 1rem 1.05rem;
  background: linear-gradient(180deg, #ffffff, #fbfbfd);
  min-height: 132px;
}

.request-summary-stat-score {
  background: linear-gradient(135deg, #fffdfa, #f6f2ff);
}

.request-summary-stat-core {
  background: linear-gradient(135deg, #fff6f6, #fffaf7);
}

.request-summary-stat-ai {
  background: linear-gradient(135deg, #fffaf0, #fffdf7);
}

.request-summary-stat-processing {
  background: linear-gradient(135deg, #f8fbff, #fafcff);
}

.request-summary-label,
.request-summary-meta-label {
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.request-summary-value,
.request-summary-meta-value {
  color: var(--app-ink);
  font-weight: 700;
}

.request-summary-value {
  font-size: 2rem;
  line-height: 1.05;
  margin-top: 0.55rem;
}

.request-summary-footnote {
  color: var(--app-muted);
  font-size: 0.82rem;
  margin-top: 0.55rem;
}

.request-summary-warning-panel {
  border: 1px solid var(--app-border);
  border-radius: 10px;
  padding: 1rem 1.05rem;
  background: linear-gradient(180deg, #ffffff, #fcfcfe);
}

.request-summary-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.request-summary-meta-card {
  border: 1px solid #efedf6;
  border-radius: 10px;
  padding: 0.9rem 0.95rem;
  background: #fff;
}

.request-summary-meta-value {
  margin-top: 0.45rem;
  font-size: 1rem;
  line-height: 1.3;
  word-break: break-word;
}

@media (max-width: 1199px) {
  .request-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .request-summary-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .request-summary-grid,
  .request-summary-meta-grid {
    grid-template-columns: 1fr;
  }

  .request-summary-value {
    font-size: 1.7rem;
  }

  .finding-ai-highlights {
    grid-template-columns: 1fr;
  }
}

.raw-details summary {
  cursor: pointer;
  color: var(--app-primary-strong);
  font-weight: 600;
  font-size: 0.82rem;
}

.token-alert {
  background: linear-gradient(180deg, #fff8dd, #fff2bf);
}

.token-code {
  display: block;
  padding: 0.75rem 0.85rem;
  border-radius: 0.8rem;
  background: rgba(16, 35, 60, 0.06);
  color: #0b2542;
  word-break: break-all;
  font-size: 0.82rem;
}

.list-group-item {
  background: transparent;
}

.ai-settings-hero {
  background:
    radial-gradient(circle at top right, rgba(31, 92, 214, 0.08), transparent 24rem),
    linear-gradient(180deg, #ffffff, #fbfcff);
}

.ai-settings-stat-card {
  height: 100%;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.92);
  padding: 1rem;
  border-radius: 1px;
}

.ai-settings-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
  margin-bottom: 0.55rem;
}

.ai-settings-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.ai-settings-connection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.ai-settings-connection-tile,
.ai-settings-empty-state,
.ai-settings-guidance,
.ai-settings-provider-card,
.ai-settings-builder-card,
.ai-settings-review-details {
  border: 1px solid var(--app-border);
  background: linear-gradient(180deg, #ffffff, #fbfbfe);
  border-radius: 1px;
}

.ai-settings-connection-tile,
.ai-settings-empty-state,
.ai-settings-guidance,
.ai-settings-provider-card,
.ai-settings-builder-card {
  padding: 1rem;
}

.ai-settings-empty-state {
  grid-column: 1 / -1;
}

.ai-settings-dialog {
  width: min(980px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  border: 0;
  padding: 0;
  border-radius: 1px;
  box-shadow: 0 20px 60px rgba(15, 30, 52, 0.2);
}

.ai-settings-dialog::backdrop {
  background: rgba(10, 17, 27, 0.42);
}

.ai-settings-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  padding: 1.1rem 1.1rem 0.85rem;
  border-bottom: 1px solid var(--app-border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.ai-settings-dialog-body {
  padding: 1rem 1.1rem 1.1rem;
  overflow: auto;
}

.ai-settings-provider-builder {
  border-top: 1px solid var(--app-border);
  padding-top: 1rem;
}

.ai-settings-review-details {
  overflow: hidden;
}

.ai-settings-review-summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  padding: 1rem;
  cursor: pointer;
}

.ai-settings-review-summary::-webkit-details-marker {
  display: none;
}

.ai-settings-review-summary-main {
  min-width: 0;
}

.ai-settings-review-body {
  border-top: 1px solid var(--app-border);
  padding: 1rem;
  background: rgba(252, 252, 255, 0.75);
}

.ai-settings-summary-caret {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--app-primary-strong);
}

.ai-settings-review-details[open] .ai-settings-summary-caret::after {
  content: " \2191";
}

.ai-settings-review-details:not([open]) .ai-settings-summary-caret::after {
  content: " \2193";
}

.ai-settings-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ai-settings-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d8dfeb;
  background: #f8fafc;
  color: #16324f;
  padding: 0.18rem 0.5rem;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 999px;
}

.ai-settings-chip-muted {
  color: var(--app-muted);
}

.ai-settings-module-option {
  display: flex;
  align-items: start;
  gap: 0.65rem;
  width: 100%;
  height: 100%;
  padding: 0.8rem 0.85rem;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 1px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.ai-settings-module-option:hover {
  border-color: #cfd8e6;
  background: #fbfcff;
  box-shadow: 0 8px 18px rgba(18, 34, 54, 0.04);
}

.ai-settings-module-option:has(input:checked) {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
}

.ai-settings-advanced-panel {
  border: 1px dashed #d7deea;
  border-radius: 1px;
  padding: 0.8rem 0.9rem;
  background: rgba(255, 255, 255, 0.76);
}

.ai-settings-advanced-panel summary {
  cursor: pointer;
  list-style: none;
}

.ai-settings-advanced-panel summary::-webkit-details-marker {
  display: none;
}

@media (max-width: 991.98px) {
  .page-header {
    align-items: start;
    flex-direction: column;
  }

  .metric-value {
    font-size: 1.45rem;
  }

  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    position: static;
    min-height: auto;
    height: auto;
  }

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

  .workspace-main {
    padding: 1.2rem 0 1.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .insight-grid,
  .stats-grid-compact {
    grid-template-columns: 1fr;
  }

  .ai-settings-dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }

  .ai-settings-dialog-header {
    flex-direction: column;
  }

  .ai-settings-review-summary {
    flex-direction: column;
  }
}

.auth-body {
  background:
    radial-gradient(circle at top left, rgba(16, 58, 109, 0.12), transparent 30rem),
    linear-gradient(135deg, #09131f 0%, #10233c 46%, #183d68 100%);
}

.auth-shell {
  min-height: calc(100vh - 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 560px);
  gap: 2rem;
  align-items: center;
}

.auth-brand-panel {
  color: white;
  padding: 2rem 2rem 2rem 0;
}

.auth-brand-logo {
  display: block;
  width: min(100%, 620px);
  height: auto;
  margin-bottom: 1.4rem;
  object-fit: contain;
}

.auth-brand-mark {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  margin-bottom: 1.5rem;
}

.auth-brand-title {
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 1.02;
  margin-bottom: 1rem;
  font-weight: 800;
  max-width: 12ch;
}

.auth-brand-copy {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.05rem;
  max-width: 36rem;
  margin-bottom: 1.5rem;
}

.auth-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.auth-feature-item {
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.94rem;
}

.auth-form-panel {
  display: flex;
  justify-content: flex-end;
}

.auth-card {
  width: 100%;
  border-radius: 1.6rem;
  overflow: hidden;
  border: 1px solid rgba(219, 227, 239, 0.7);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 32px 90px rgba(5, 16, 30, 0.32);
}

.auth-card-body {
  padding: 2.1rem;
}

.auth-copy-block {
  margin-bottom: 1.6rem;
}

.auth-heading {
  font-size: 2rem;
  line-height: 1.08;
  margin-bottom: 0.55rem;
  font-weight: 750;
  color: #10233c;
}

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

.auth-form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.auth-input {
  min-height: 3.15rem;
  border-radius: 0.9rem;
  border-color: #d7e0eb;
  padding-left: 0.95rem;
  padding-right: 0.95rem;
}

.auth-input:focus {
  border-color: #8fb3dd;
  box-shadow: 0 0 0 0.18rem rgba(16, 58, 109, 0.13);
}

.auth-submit {
  border-radius: 1px;
  min-height: 3.25rem;
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-strong));
  border-color: var(--app-primary-strong);
}

.auth-footer-copy,
.auth-hint {
  color: var(--app-muted);
  font-size: 0.95rem;
}

.auth-link-inline,
.auth-link,
.tiny-link {
  color: var(--app-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-link-inline:hover,
.auth-link:hover,
.tiny-link:hover {
  color: var(--app-primary-strong);
  text-decoration: underline;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 991.98px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 1.5rem;
    padding: 1.25rem 0 2rem;
  }

  .auth-brand-panel {
    padding: 0.5rem 0 0;
  }

  .auth-brand-logo {
    margin-inline: auto;
  }

  .auth-brand-title {
    max-width: none;
    font-size: 2.35rem;
  }

  .auth-form-panel {
    justify-content: stretch;
  }

  .auth-card-body {
    padding: 1.5rem;
  }
}
