:root {
  color-scheme: light;
  --bg: #f7f3ef;
  --bg-alt: #f2e7da;
  --ink: #1f1a16;
  --muted: #6a5b50;
  --accent: #b84a2f;
  --accent-2: #1d6b66;
  --line: #e0d2c5;
  --card: #fff9f2;
  --success: #0f7a4a;
  --danger: #b33b2e;
  --shadow: rgba(36, 20, 12, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Bookman Old Style", "Georgia", serif;
  background: radial-gradient(circle at top left, #fffdf9 0%, var(--bg) 45%, var(--bg-alt) 100%);
  color: var(--ink);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: grid;
  gap: 24px;
}

.hero {
  padding: 36px 32px;
  background: linear-gradient(135deg, #fdf1e2, #f8d9c3);
  border-radius: 24px;
  box-shadow: 0 18px 40px var(--shadow);
  position: relative;
  overflow: hidden;
  animation: rise 0.8s ease-out;
}

.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 74, 47, 0.25), transparent 70%);
}

.hero h1 {
  font-size: clamp(2.2rem, 3vw, 3rem);
  margin-bottom: 8px;
}

.lead {
  font-size: 1.05rem;
  max-width: 640px;
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-2);
}

.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.lang-switch {
  margin-top: 18px;
}

.lang-switch label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  background: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 6px 14px var(--shadow);
}

.hero__badges span {
  background: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  box-shadow: 0 6px 14px var(--shadow);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 30px var(--shadow);
  animation: fadeUp 0.6s ease-out both;
}

.card:nth-of-type(2) {
  animation-delay: 0.05s;
}

.card:nth-of-type(3) {
  animation-delay: 0.1s;
}

.card:nth-of-type(4) {
  animation-delay: 0.15s;
}

.card:nth-of-type(5) {
  animation-delay: 0.2s;
}

.section__title {
  margin-bottom: 16px;
}

.section__title p {
  color: var(--muted);
  margin: 4px 0 0;
}

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

.upload__controls {
  display: grid;
  gap: 12px;
  align-content: start;
}

.status {
  font-size: 0.9rem;
  color: var(--muted);
}

button {
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

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

.panel {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--line);
}

.panel h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.helper {
  font-size: 0.8rem;
  color: var(--muted);
}

.inline-link {
  color: var(--accent-2);
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

input[type="number"],
input[type="file"],
select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
}

input[disabled] {
  background: #f6f0ea;
  color: var(--muted);
}

label.inline {
  grid-template-columns: 1fr;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.checkboxes {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.cq-compact {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.cq-details {
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fffdf8;
  padding: 8px 10px;
}

.cq-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-2);
  font-size: 0.9rem;
  list-style: none;
}

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

.cq-details summary::after {
  content: "▾";
  float: right;
  transition: transform 0.2s ease;
}

.cq-details[open] summary::after {
  transform: rotate(180deg);
}

.cq-group {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px dashed var(--line);
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 0.85rem;
}

.notice {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fdf3e8;
  border-radius: 10px;
  border: 1px solid #f1ddcb;
  font-size: 0.85rem;
}

.log {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.log li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.log .tag {
  font-weight: 600;
  color: var(--accent-2);
}

.log .missing {
  color: var(--danger);
  font-weight: 600;
}

input.missing {
  border-color: var(--danger);
  background: #fff2f1;
}

.results {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.result-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 16px;
  box-shadow: 0 10px 20px var(--shadow);
}

.warning {
  border-left: 6px solid #d8a772;
  background: #fff5ea;
}

.warning p {
  color: var(--muted);
  line-height: 1.5;
}

.result-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.95rem;
}

.result-line:last-child {
  border-bottom: none;
}

.delta.positive {
  color: var(--danger);
}

.delta.negative {
  color: var(--success);
}

.footnotes ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 720px) {
  .hero {
    padding: 28px 22px;
  }

  .result-line {
    flex-direction: column;
    gap: 4px;
  }
}
