:root {
  --bs-body-font-family: "Manrope", "Segoe UI", sans-serif;
  --app-bg: #eef4f0;
  --app-bg-soft: #f9fbf8;
  --app-line: rgba(25, 44, 34, 0.12);
  --app-text: #1a2a24;
  --app-muted: #60716a;
  --app-primary: #1d6f52;
  --app-primary-soft: rgba(29, 111, 82, 0.08);
  --app-accent: #d9804d;
  --app-accent-soft: rgba(217, 128, 77, 0.1);
  --app-shadow: 0 20px 48px rgba(41, 67, 56, 0.1);
  --bs-primary: #1d6f52;
  --bs-primary-rgb: 29, 111, 82;
}

body.app-body {
  min-height: 100vh;
  margin: 0;
  color: var(--app-text);
  background:
    radial-gradient(circle at top left, rgba(29, 111, 82, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(217, 128, 77, 0.16), transparent 24%),
    linear-gradient(180deg, #f8fbf8 0%, #edf3ee 100%);
}

.hero-panel,
.surface-card {
  border: 1px solid var(--app-line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--app-shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  padding: 28px;
}

.page-stack {
  row-gap: 1.25rem;
}

.hero-panel-compact {
  padding: 1rem 1.25rem;
}

.hero-badge,
.section-label,
.upload-zone-label,
.version-card-label {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--app-primary);
}

.hero-badge {
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: var(--app-primary-soft);
}

.hero-title,
.section-title {
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-title {
  max-width: 14ch;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 0.98;
}

.hero-title-compact {
  max-width: 18ch;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.02;
}

.hero-text-compact {
  font-size: 0.96rem;
  line-height: 1.5;
}

.hero-note-compact {
  padding: 0.85rem 1rem;
}

.section-title {
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.hero-text,
.hero-note,
.soft-block,
.version-card,
.result-placeholder,
.result-error,
.report-card,
.change-item,
.raw-response {
  color: var(--app-muted);
}

.hero-note,
.metric-card,
.report-card,
.soft-block,
.version-card,
.result-placeholder,
.change-item,
.raw-response {
  border: 1px solid var(--app-line);
  border-radius: 22px;
  background: var(--app-bg-soft);
}

.hero-note,
.config-box,
.metric-card,
.report-card,
.soft-block,
.version-card,
.result-placeholder,
.result-error {
  padding: 1rem;
}

.upload-form {
  display: block;
}

.upload-row {
  align-items: stretch;
}

.upload-zone {
  position: relative;
  display: grid;
  gap: 0.3rem;
  min-height: 100%;
  padding: 0.95rem 1rem;
  border: 2px dashed rgba(29, 111, 82, 0.24);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(243, 249, 246, 0.95));
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.upload-zone:hover,
.upload-zone:focus-visible,
.upload-zone.is-dragover {
  transform: translateY(-1px);
  border-color: rgba(29, 111, 82, 0.6);
  box-shadow: 0 14px 30px rgba(29, 111, 82, 0.12);
  outline: none;
}

.upload-zone-accent {
  border-color: rgba(217, 128, 77, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(252, 246, 241, 0.96));
}

.upload-zone-accent:hover,
.upload-zone-accent:focus-visible,
.upload-zone-accent.is-dragover {
  border-color: rgba(217, 128, 77, 0.65);
  box-shadow: 0 14px 30px rgba(217, 128, 77, 0.12);
}

.upload-zone.is-filled {
  border-style: solid;
  background: #ffffff;
}

.upload-zone-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--app-text);
}

.upload-zone-hint,
.upload-zone-meta,
.response-viewer,
.status-box {
  font-size: 0.95rem;
}

.upload-zone-meta {
  margin-top: 0.15rem;
  color: var(--app-muted);
}

.compare-button {
  border-radius: 16px;
  padding-block: 0.9rem;
  font-weight: 700;
  box-shadow: 0 16px 32px rgba(29, 111, 82, 0.2);
}

.report-actions {
  position: relative;
}

.split-button-group {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(29, 111, 82, 0.16);
}

.split-button-group .btn {
  border-radius: 0;
  padding-inline: 1rem;
  font-weight: 700;
}

.split-button-main {
  min-width: 190px;
  border-top-left-radius: 18px !important;
  border-bottom-left-radius: 18px !important;
}

.split-button-toggle {
  min-width: 54px;
  border-top-right-radius: 18px !important;
  border-bottom-right-radius: 18px !important;
  border-left: 1px solid rgba(255, 255, 255, 0.22) !important;
}

.split-button-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  padding: 0.35rem;
  border: 1px solid var(--app-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(25, 44, 34, 0.16);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.split-button-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 0;
  border-radius: 14px;
  color: var(--app-text);
  background: transparent;
  font-weight: 700;
  text-align: left;
}

.split-button-option:hover,
.split-button-option:focus-visible {
  background: rgba(29, 111, 82, 0.08);
  outline: none;
}

.split-button-option.is-active {
  background: rgba(29, 111, 82, 0.1);
  color: var(--app-primary);
}

.split-button-disabled {
  box-shadow: none;
}

.split-button-disabled .btn {
  box-shadow: none;
}

.status-box {
  border-width: 1px;
  border-radius: 18px;
}

.status-idle {
  color: #405049;
  background: rgba(96, 113, 106, 0.08);
  border-color: rgba(96, 113, 106, 0.12);
}

.status-working {
  color: #6d481f;
  background: rgba(217, 128, 77, 0.12);
  border-color: rgba(217, 128, 77, 0.18);
}

.status-success {
  color: #205a44;
  background: rgba(29, 111, 82, 0.12);
  border-color: rgba(29, 111, 82, 0.18);
}

.status-error {
  color: #7a3131;
  background: rgba(182, 73, 73, 0.1);
  border-color: rgba(182, 73, 73, 0.16);
}

.job-status-board {
  padding: 1rem 1.05rem;
  border: 1px solid var(--app-line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 249, 246, 0.95));
}

.job-status-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.job-status-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.job-status-meta {
  margin-top: 0.2rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--app-text);
  word-break: break-word;
}

.job-status-trace {
  margin-top: 0.18rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--app-muted);
  word-break: break-word;
}

.job-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.job-status-badge-idle {
  color: #405049;
  background: rgba(96, 113, 106, 0.1);
}

.job-status-badge-working {
  color: #8a4d19;
  background: rgba(217, 128, 77, 0.14);
}

.job-status-badge-success {
  color: #205a44;
  background: rgba(29, 111, 82, 0.14);
}

.job-status-badge-error {
  color: #7a3131;
  background: rgba(182, 73, 73, 0.14);
}

.job-status-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.job-step {
  display: flex;
  gap: 0.65rem;
  min-width: 0;
}

.job-step-marker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 18px;
}

.job-step-dot {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(96, 113, 106, 0.28);
  border-radius: 999px;
  background: #ffffff;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.job-step-body {
  min-width: 0;
}

.job-step-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--app-text);
}

.job-step-description {
  margin-top: 0.14rem;
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--app-muted);
}

.job-step-done .job-step-dot {
  border-color: rgba(29, 111, 82, 0.4);
  background: var(--app-primary);
}

.job-step-active .job-step-dot {
  border-color: rgba(217, 128, 77, 0.5);
  background: var(--app-accent);
  box-shadow: 0 0 0 5px rgba(217, 128, 77, 0.12);
  transform: scale(1.06);
}

.job-step-active .job-step-title {
  color: #8a4d19;
}

.job-step-error .job-step-dot {
  border-color: rgba(182, 73, 73, 0.5);
  background: #b64949;
  box-shadow: 0 0 0 5px rgba(182, 73, 73, 0.12);
}

.job-step-error .job-step-title {
  color: #7a3131;
}

.loading-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--app-line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 249, 246, 0.98));
}

.loading-panel .spinner-border {
  flex: 0 0 auto;
}

.loading-dots {
  display: inline-flex;
  gap: 0.25rem;
}

.loading-dots span {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  background: var(--app-primary);
  animation: loading-bounce 1s infinite ease-in-out;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.metric-card {
  height: 100%;
}

.metric-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.metric-value {
  margin-top: 0.55rem;
  font-size: 1.2rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--app-text);
  word-break: break-word;
}

.metric-value-sm {
  font-size: 1rem;
}

.summary-overview-card {
  padding: 0.8rem;
  border: 1px solid var(--app-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
}

.summary-overview-title {
  margin-bottom: 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.summary-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.summary-entity {
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(25, 44, 34, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.summary-entity-report {
  background: linear-gradient(180deg, rgba(217, 128, 77, 0.08), rgba(255, 255, 255, 0.72));
}

.summary-entity-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.summary-entity-title {
  margin-top: 0.3rem;
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 800;
  color: var(--app-text);
  word-break: break-word;
}

.summary-entity-title-compact {
  font-size: 0.9rem;
}

.summary-entity-subtitle {
  margin-top: 0.24rem;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--app-muted);
}

.summary-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  padding: 0.16rem 0.38rem;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.1;
}

.summary-chip-neutral {
  background: rgba(25, 44, 34, 0.06);
  color: var(--app-text);
}

.summary-chip-label {
  color: var(--app-muted);
  font-weight: 700;
}

.summary-chip-value {
  font-weight: 800;
}

.severity-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.14rem 0.4rem;
  margin-right: 0.28rem;
  margin-bottom: 0.18rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.severity-inline-label {
  opacity: 0.9;
}

.severity-inline-count {
  font-weight: 800;
}

.severity-inline-high {
  background: rgba(182, 73, 73, 0.12);
  color: #7a3131;
}

.severity-inline-medium {
  background: rgba(217, 128, 77, 0.12);
  color: #8a4d19;
}

.severity-inline-low {
  background: rgba(29, 111, 82, 0.12);
  color: #205a44;
}

.severity-inline-neutral {
  background: rgba(96, 113, 106, 0.1);
  color: var(--app-muted);
}

.definition-grid {
  display: grid;
  gap: 0.8rem;
}

.definition-item {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(25, 44, 34, 0.08);
}

.definition-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.definition-item dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.definition-item dd {
  margin: 0.35rem 0 0;
  font-size: 0.97rem;
  line-height: 1.55;
  color: var(--app-text);
}


.report-hero {
  padding: 1rem 1.05rem;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 247, 243, 0.98));
  border: 1px solid var(--app-line);
}

.report-hero-metrics {
  --bs-gutter-y: 0.75rem;
}

.report-hero .soft-block {
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
}

.report-hero-summary {
  max-width: 62ch;
  font-size: 1.18rem;
  line-height: 1.48;
  font-weight: 600;
  color: var(--app-text);
}

.report-hero .metric-value {
  margin-top: 0.38rem;
}

.report-card {
  padding: 1.2rem;
}

.report-stack {
  display: grid;
  gap: 0;
}

.report-group {
  padding: 1.1rem;
  border: 1px solid var(--app-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
}

.report-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.soft-block {
  height: 100%;
}

.breakdown-progress {
  height: 0.7rem;
  border-radius: 999px;
  background: rgba(29, 111, 82, 0.1);
}

.breakdown-progress .progress-bar {
  background: linear-gradient(90deg, var(--app-primary), var(--app-accent));
}

.risk-badge {
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.risk-badge-large {
  font-size: 0.88rem;
}

.report-filter-panel {
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--app-line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(247, 250, 248, 0.98), rgba(241, 247, 243, 0.92));
}

.report-filter-toolbar {
  display: grid;
  gap: 0.9rem;
}

.report-filter-row {
  display: grid;
  gap: 0.45rem;
}

.report-filter-label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.report-filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.report-filter-chip,
.report-filter-reset {
  border: 1px solid rgba(29, 111, 82, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--app-text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.report-filter-chip {
  padding: 0.68rem 0.9rem;
}

.report-filter-chip:hover,
.report-filter-chip:focus-visible,
.report-filter-reset:hover,
.report-filter-reset:focus-visible {
  border-color: rgba(29, 111, 82, 0.34);
  background: rgba(29, 111, 82, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.report-filter-chip.is-active {
  border-color: rgba(29, 111, 82, 0.52);
  background: rgba(29, 111, 82, 0.12);
  color: var(--app-primary);
  box-shadow: inset 0 0 0 1px rgba(29, 111, 82, 0.08);
}

.report-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.report-filter-reset {
  padding: 0.55rem 0.85rem;
}

.change-item {
  padding: 1rem 1.1rem;
}

.change-item summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.change-item summary::-webkit-details-marker {
  display: none;
}

.version-card {
  background: #ffffff;
}

.version-card-accent {
  background: rgba(255, 248, 243, 0.95);
}

.version-card-text,
.response-viewer {
  margin: 0;
  color: var(--app-text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
}

.diff-mark {
  padding: 0.02rem 0.08rem;
  border-radius: 0.28rem;
}

.diff-mark.diff-remove {
  background: rgba(182, 73, 73, 0.16);
  color: #7a3131;
}

.diff-mark.diff-add {
  background: rgba(29, 111, 82, 0.16);
  color: #205a44;
}

.result-placeholder {
  padding: 2rem 1.25rem;
  text-align: center;
}

.result-error {
  border: 1px solid rgba(182, 73, 73, 0.18);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 250, 250, 0.98), rgba(255, 243, 243, 0.98));
}

.technical-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--app-text);
  list-style: none;
}

.technical-details summary::-webkit-details-marker {
  display: none;
}

.technical-details[open] summary {
  margin-bottom: 1rem;
}

@media (max-width: 767.98px) {
  .report-filter-summary {
    align-items: flex-start;
    flex-direction: column;
  }
}


.raw-response {
  overflow: hidden;
}

.raw-response summary {
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--app-text);
}

.raw-response summary .btn {
  flex-shrink: 0;
}

.raw-response[open] summary {
  border-bottom: 1px solid var(--app-line);
}

.response-viewer {
  min-height: 260px;
  padding: 1.1rem;
  overflow: auto;
  font-family: "Cascadia Code", "Consolas", monospace;
  background: #f5f8f6;
}

.list-group-item {
  border-color: var(--app-line);
}

@keyframes loading-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@media (max-width: 991px) {
  .hero-title {
    max-width: 100%;
  }

  .summary-table {
    grid-template-columns: 1fr;
  }

  .report-actions {
    width: 100%;
  }

  .split-button-group {
    width: 100%;
  }

  .split-button-main {
    min-width: 0;
    flex: 1 1 auto;
  }

  .summary-overview-grid {
    grid-template-columns: 1fr;
  }

  .job-status-timeline {
    grid-template-columns: 1fr;
  }
}
