:root {
  color-scheme: light;
  --app-bg: #eef4ff;
  --app-bg-deep: #dbe7ff;
  --app-surface: rgba(255, 255, 255, 0.9);
  --app-surface-strong: #ffffff;
  --app-text: #0f172a;
  --app-muted: #5f6f8d;
  --app-border: rgba(148, 163, 184, 0.24);
  --app-primary: #2563eb;
  --app-primary-dark: #1d4ed8;
  --app-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body.app-shell {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--app-text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.16), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, var(--app-bg) 56%, var(--app-bg-deep) 100%);
}

.bg-orb {
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.5;
}

.bg-orb-a {
  top: 72px;
  right: 8%;
  width: 280px;
  height: 280px;
  background: rgba(37, 99, 235, 0.18);
}

.bg-orb-b {
  bottom: 72px;
  left: 6%;
  width: 220px;
  height: 220px;
  background: rgba(6, 182, 212, 0.2);
}

.container {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(15, 23, 42, 0.74);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #e2e8f0;
}

.brand-mark-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(14, 165, 233, 0.95));
  color: #ffffff;
  font-size: 1.1rem;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24);
}

.brand-title {
  font-size: 0.98rem;
  font-weight: 700;
}

.brand-subtitle {
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.8rem;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 0.84rem;
  font-weight: 600;
}

.card {
  background: var(--app-surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--app-border) !important;
  box-shadow: var(--app-shadow) !important;
  border-radius: 22px !important;
}

.hero {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.92)),
    linear-gradient(120deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.08));
}

.display-6,
.h2,
.h4 {
  color: var(--app-text);
  letter-spacing: 0;
}

.lead,
.text-secondary,
.form-text {
  color: var(--app-muted) !important;
}

.badge {
  font-weight: 600;
  letter-spacing: 0;
}

.mini-stats {
  display: grid;
  gap: 12px;
}

.mini-stat {
  padding: 14px 16px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.9);
}

.mini-stat-label {
  display: block;
  margin-bottom: 6px;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mini-stat-value {
  display: block;
  color: var(--app-text);
  font-size: 0.98rem;
  font-weight: 600;
}

.form-label,
.form-check-label {
  color: var(--app-text);
}

.dropzone {
  display: grid;
  justify-items: start;
  gap: 8px;
  min-height: 176px;
  padding: 24px;
  border: 1.5px dashed rgba(37, 99, 235, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.9)),
    linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(14, 165, 233, 0.06));
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: rgba(37, 99, 235, 0.56);
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.08);
}

.dropzone-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--app-primary);
  font-size: 1.35rem;
}

.dropzone-title {
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 700;
}

.dropzone-subtitle {
  color: var(--app-muted);
  font-size: 0.92rem;
}

.dropzone-file {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--app-text);
  font-size: 0.84rem;
  font-weight: 600;
}

.form-control {
  min-height: 52px;
  border-color: rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

.form-control:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.12);
}

.form-control-lg {
  min-height: 60px;
  padding-inline: 1rem;
}

.form-check.form-switch {
  min-height: 52px;
  padding: 14px 16px 14px 3.5rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.9);
}

.form-check-input {
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
}

.btn {
  border-radius: 14px;
  min-height: 48px;
  font-weight: 600;
  box-shadow: none !important;
}

.btn-lg {
  min-height: 56px;
}

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

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--app-primary-dark), var(--app-primary));
}

.btn-outline-primary,
.btn-outline-secondary {
  border-width: 1px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.12);
}

.result-empty {
  display: flex;
  align-items: center;
  min-height: 220px;
  padding: 20px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.68);
  color: var(--app-muted);
  font-size: 1rem;
}

.result-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.05);
}

.result-tab {
  border: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: transparent;
  color: var(--app-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.result-tab.is-active {
  background: #ffffff;
  color: var(--app-text);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.result-panel {
  display: none;
}

.result-panel.is-active {
  display: block;
}

.compact-empty {
  min-height: 180px;
}

.metric-card {
  height: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.92));
}

.metric-label {
  margin-bottom: 6px;
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.metric-value {
  color: var(--app-text);
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 700;
}

.detail-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.86);
}

.detail-row span {
  color: var(--app-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-row strong,
.detail-row code {
  color: var(--app-text);
  font-size: 0.95rem;
}

.section-list {
  display: grid;
  gap: 10px;
}

.section-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.section-name {
  color: var(--app-text);
  font-size: 0.94rem;
  font-weight: 700;
}

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

.section-item-stack {
  display: grid;
  gap: 12px;
}

.section-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.section-part-list {
  display: grid;
  gap: 8px;
}

.section-part-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--app-text);
  font-size: 0.86rem;
}

.list-group-item {
  border: 0;
  background: transparent;
  color: var(--app-text);
}

.json-preview {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 70vh;
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.92));
  color: #0b1220;
  font-size: 13px;
  line-height: 1.6;
}

.split-table thead th {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

.split-table tbody td {
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom-color: rgba(148, 163, 184, 0.12);
  color: var(--app-text);
}

.table-path {
  font-weight: 600;
  word-break: break-word;
}

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

.alert,
.mini-stat,
.metric-card,
.result-empty,
.form-check.form-switch {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

@media (max-width: 991.98px) {
  .hero .display-6 {
    font-size: 2rem;
  }

  .topbar-inner {
    padding-block: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 575.98px) {
  .card {
    border-radius: 18px !important;
  }

  .display-6 {
    font-size: 1.7rem;
  }

  .result-empty {
    min-height: 160px;
  }

  .result-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .result-tab {
    width: 100%;
    text-align: center;
    padding-inline: 8px;
    font-size: 0.8rem;
  }

  .section-part-item {
    grid-template-columns: 1fr;
  }
}
