:root {
  color-scheme: light;
  --bg-main: #eef8fb;
  --bg-tint: #ddf1f5;
  --surface: #ffffff;
  --surface-soft: #f4fbfd;
  --ink-900: #050708;
  --ink-700: #122634;
  --ink-500: #4f6674;
  --brand: #21bfd5;
  --brand-deep: #169db1;
  --brand-ink: #050708;
  --brand-wash: rgba(33, 191, 213, 0.2);
  --focus: rgba(33, 191, 213, 0.3);
  --good: #21bfd5;
  --mid: #169db1;
  --low: #050708;
  --border: #cde6ec;
  --shadow-lg: 0 24px 64px rgba(5, 7, 8, 0.14);
  --shadow-md: 0 14px 36px rgba(5, 7, 8, 0.1);
  --shadow-sm: 0 10px 24px rgba(5, 7, 8, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink-900);
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 12%, rgba(33, 191, 213, 0.22), transparent 42%),
    radial-gradient(circle at 90% 2%, rgba(5, 7, 8, 0.08), transparent 28%),
    linear-gradient(165deg, #f8fdff 0%, var(--bg-main) 44%, var(--bg-tint) 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
}

body::before {
  width: 240px;
  height: 240px;
  left: -80px;
  top: 190px;
  background: rgba(33, 191, 213, 0.25);
}

body::after {
  width: 280px;
  height: 280px;
  right: -110px;
  top: 420px;
  background: rgba(5, 7, 8, 0.18);
}

h1,
h2,
h3,
h4,
.eyebrow,
.hero-title,
.kit-badge {
  font-family: "Sora", "Segoe UI", sans-serif;
}

.banner {
  background: linear-gradient(90deg, rgba(5, 7, 8, 0.95), rgba(5, 7, 8, 0.86));
  color: #f3fdff;
  border-bottom: 1px solid rgba(33, 191, 213, 0.38);
  text-align: center;
  padding: 11px 24px;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.banner strong {
  color: var(--brand);
}

.banner code {
  font-family: "Sora", monospace;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 1px 6px;
  border-radius: 6px;
}

.app {
  max-width: 1140px;
  margin: 30px auto 80px;
  padding: 0 24px;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 24px;
  padding: clamp(24px, 4vw, 42px);
  border-radius: 30px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(244, 251, 253, 0.94));
  border: 1px solid rgba(205, 230, 236, 0.9);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise-in 0.7s ease;
}

.topbar::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -200px;
  top: -240px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(33, 191, 213, 0.42), rgba(33, 191, 213, 0));
}

.hero-text {
  position: relative;
  z-index: 1;
}

.brand-logo {
  display: block;
  width: min(100%, 520px);
  height: auto;
  margin-bottom: 14px;
}

.eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--brand-deep);
  font-weight: 700;
  margin: 0;
}

.topbar h1 {
  margin-top: 10px;
  font-size: clamp(1.9rem, 3.3vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 18ch;
}

.sub {
  margin-top: 9px;
  color: var(--ink-500);
  max-width: 56ch;
  line-height: 1.45;
}

.hero-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.hero-list li {
  color: var(--ink-700);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.hero-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--brand-deep));
  box-shadow: 0 0 0 4px rgba(33, 191, 213, 0.2);
  flex-shrink: 0;
}

.hero-card {
  position: relative;
  z-index: 1;
  border-radius: 22px;
  padding: 20px;
  align-self: end;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background:
    linear-gradient(155deg, rgba(5, 7, 8, 0.95), rgba(15, 31, 40, 0.9)),
    radial-gradient(circle at top right, rgba(33, 191, 213, 0.34), transparent 50%);
  box-shadow: var(--shadow-md);
}

.hero-title {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}

.hero-metrics {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.hero-metrics span {
  color: #ecfbff;
  font-weight: 700;
  font-size: 0.94rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 8px 10px;
}

.panel {
  margin-top: 24px;
  padding: 28px 32px;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid rgba(205, 230, 236, 0.9);
  box-shadow: var(--shadow-md);
  animation: rise-in 0.85s ease;
}

.kit-form label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
  color: var(--ink-900);
  font-size: 1.03rem;
}

.input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.input-row input {
  flex: 1 1 260px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f4fbfd);
  color: var(--ink-900);
  font-size: 1rem;
  padding: 13px 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-row input::placeholder {
  color: #8ea5b3;
}

.input-row input:focus {
  border-color: rgba(33, 191, 213, 0.72);
  box-shadow: 0 0 0 4px var(--focus);
}

.input-row button {
  border: none;
  border-radius: 14px;
  padding: 12px 20px;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.2s ease;
}

.input-row button:hover:not(:disabled) {
  transform: translateY(-1px);
}

#load-btn {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  box-shadow: 0 10px 22px rgba(33, 191, 213, 0.3);
}

.input-row button.secondary {
  border: 1px solid var(--border);
  color: var(--brand-ink);
  background: #ffffff;
  box-shadow: none;
}

.input-row button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.helper {
  margin-top: 11px;
  color: var(--ink-500);
  font-weight: 500;
}

.step-row {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 12px;
}

.step-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 13px;
  background: linear-gradient(145deg, #f4fbfd, #ffffff);
  font-weight: 700;
  color: var(--ink-700);
}

.step-card span {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-wash);
  color: var(--brand-deep);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.85rem;
}

.status {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 13px;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-info {
  background: rgba(33, 191, 213, 0.08);
  border-color: rgba(33, 191, 213, 0.2);
  color: #255c69;
}

.status-success {
  background: rgba(33, 191, 213, 0.14);
  border-color: rgba(33, 191, 213, 0.26);
  color: #0d6f80;
}

.status-error {
  background: rgba(5, 7, 8, 0.08);
  border-color: rgba(5, 7, 8, 0.2);
  color: #050708;
}

.report {
  margin-top: 32px;
  padding: 32px;
  border-radius: 30px;
  background: var(--surface);
  border: 1px solid rgba(205, 230, 236, 0.92);
  box-shadow: var(--shadow-lg);
}

.report:not(.hidden) {
  animation: report-in 0.55s ease;
}

.report.hidden {
  display: none;
}

.report.pdf-export {
  margin-top: 0;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: none;
  background: #ffffff;
}

.report.pdf-export,
.report.pdf-export * {
  animation: none !important;
  transition: none !important;
}

.report.pdf-export .summary-card,
.report.pdf-export .list-card,
.report.pdf-export .info-card,
.report.pdf-export .photo-card {
  box-shadow: none;
}

.report.pdf-export .supplement-media {
  border-color: #cde6ec;
}

.report.pdf-export .summary-grid,
.report.pdf-export .photo-grid,
.report.pdf-export .food-grid,
.report.pdf-export .score-grid {
  grid-template-columns: 1fr;
  align-items: start;
}

.report.pdf-export .metric-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report.pdf-export .section {
  margin-top: 24px;
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}

.report-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.report-logo {
  width: clamp(170px, 24vw, 270px);
  height: auto;
}

.report-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  letter-spacing: -0.02em;
}

.kit-badge {
  border-radius: 999px;
  background: rgba(33, 191, 213, 0.14);
  border: 1px solid rgba(33, 191, 213, 0.35);
  color: #0f6979;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 9px 14px;
}

.summary-grid {
  margin-top: 24px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.summary-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #ffffff, #f4fbfd);
  box-shadow: var(--shadow-sm);
}

.summary-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand));
}

#gut-summary::before {
  background: linear-gradient(90deg, #0d7587, var(--brand));
}

#food-summary::before {
  background: linear-gradient(90deg, #050708, var(--brand));
}

.summary-card h3 {
  margin: 0;
  font-size: 1rem;
}

.metric-row {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
}

.metric {
  padding: 10px 11px;
  border: 1px solid rgba(205, 230, 236, 0.9);
  border-radius: 14px;
  background: #ffffff;
}

.metric-value {
  display: block;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink-900);
}

.metric-label {
  color: var(--ink-500);
  font-size: 0.8rem;
}

.summary-line {
  margin-top: 9px;
  color: var(--ink-500);
  line-height: 1.4;
}

.tone-chip {
  margin-top: 11px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(33, 191, 213, 0.32);
  background: rgba(33, 191, 213, 0.15);
  color: #0d7283;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 6px 11px;
}

.section {
  margin-top: 32px;
}

.section-header {
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-header h3 {
  margin: 0;
}

.visual-section {
  margin-top: 28px;
}

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

.photo-card {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #eef8fb;
}

.photo-card figcaption {
  padding: 10px 12px;
  font-weight: 700;
  color: var(--ink-700);
  font-size: 0.9rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.82rem;
  font-weight: 700;
}

.tone-good {
  background: rgba(33, 191, 213, 0.16);
  color: var(--good);
}

.tone-mid {
  background: rgba(33, 191, 213, 0.1);
  color: var(--mid);
}

.tone-low {
  background: rgba(5, 7, 8, 0.1);
  color: var(--low);
}

.food-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.list-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.list-card h4 {
  margin: 0;
  font-size: 1.01rem;
}

.list-sub {
  margin-top: 5px;
  margin-bottom: 11px;
  color: var(--ink-500);
  font-size: 0.84rem;
}

.pill-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-list li {
  border-radius: 999px;
  background: #eaf8fb;
  border: 1px solid #cbeaf0;
  color: #1f5260;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 6px 10px;
}

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

.score-list {
  display: grid;
  gap: 12px;
}

.info-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, #ffffff, #f4fbfd);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.supplement-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #eaf8fb;
}

.supplement-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.supplement-kind {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(5, 7, 8, 0.72);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.row-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.row-between h4 {
  margin: 0;
  font-size: 1rem;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(33, 191, 213, 0.19);
  color: #0e7384;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
}

.info-card p {
  margin: 0;
  color: var(--ink-500);
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  border-radius: 999px;
  border: 1px solid #c8e7ee;
  background: #eaf8fb;
  color: #106c7d;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
}

.note {
  border-radius: 16px;
  border: 1px dashed rgba(5, 7, 8, 0.2);
  background: linear-gradient(120deg, rgba(33, 191, 213, 0.12), rgba(33, 191, 213, 0.04));
  padding: 16px;
}

.note p {
  margin: 0;
  color: var(--ink-700);
  font-weight: 600;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes report-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .hero-card {
    justify-self: stretch;
  }

  .report-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .app {
    margin-top: 20px;
    padding: 0 14px;
  }

  .panel,
  .report,
  .topbar {
    border-radius: 22px;
    padding: 20px;
  }

  .brand-logo {
    width: min(100%, 320px);
  }

  .report-title-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .report-logo {
    width: 155px;
  }

  .input-row button {
    flex: 1 1 100%;
  }
}
