:root {
  --ink: #1c1a17;
  --ink-soft: #3a342f;
  --sand: #f7f1e7;
  --dune: #e7d6c1;
  --clay: #caa688;
  --sage: #9cc7b0;
  --sun: #f4c95d;
  --ember: #e08f62;
  --rose: #c98276;
  --night: #16211e;
  --white: #ffffff;
  --shadow: 0 18px 40px rgba(22, 33, 30, 0.18);
  --radius: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff6e4 0%, var(--sand) 50%, #f2e5d2 100%);
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 0.35rem;
}

p {
  margin: 0 0 0.5rem;
  color: var(--ink-soft);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 12px 18px;
}

.hero {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 28px;
  background: linear-gradient(135deg, #fff4dd 0%, #f9e7cf 50%, #f0d9bf 100%);
  overflow: hidden;
  box-shadow: var(--shadow);
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
}

.hero__glow {
  position: absolute;
  inset: -40% -20% auto auto;
  height: 300px;
  width: 300px;
  background: radial-gradient(circle, rgba(224, 143, 98, 0.45), transparent 65%);
  pointer-events: none;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: #7b6a57;
  margin-top: 10px;
}

.lede {
  font-size: 1.05rem;
  max-width: 520px;
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.hero__controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hero__controls.is-hidden {
  display: none;
}

.hero__controls label {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: #6b5b4b;
}

.hero__controls select {
  flex: 1;
  min-width: 0;
}

.hero__side {
  display: grid;
  gap: 8px;
  align-content: start;
}

.objective {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  padding: 10px;
  border: 2px solid rgba(224, 143, 98, 0.45);
  box-shadow: 0 18px 32px rgba(22, 33, 30, 0.22);
}

.objective__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.objective__lede {
  color: #6d5a48;
  font-size: 0.9rem;
}

.objective__list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: grid;
  gap: 4px;
}

.objective__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(202, 166, 136, 0.25);
}

.objective__item-label {
  font-size: 0.85rem;
  color: #4b3f34;
}

.chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(202, 166, 136, 0.4);
}

.chip--hard {
  background: rgba(224, 143, 98, 0.2);
  border-color: rgba(224, 143, 98, 0.5);
  color: #7a3e1e;
}

.hero__card {
  background: rgba(22, 33, 30, 0.9);
  color: #f7efe5;
  padding: 20px 22px;
  border-radius: 20px;
  max-width: 360px;
  align-self: center;
  box-shadow: 0 16px 30px rgba(22, 33, 30, 0.25);
}

.hero__card h2 {
  color: #f9d39a;
}

.hero__card ul {
  padding-left: 18px;
  margin: 0;
  color: #f7efe5;
  line-height: 1.5;
}

.grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

@media (min-width: 960px) {
  .grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.panel {
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.panel__header p {
  color: #6b5b4b;
}

.form {
  display: grid;
  gap: 10px;
}

.form__group {
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(202, 166, 136, 0.3);
}

.form__group h3 {
  margin-bottom: 8px;
}

.field {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
}

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

@media (min-width: 640px) {
  .field--inline {
    grid-template-columns: minmax(0, 1fr);
  }
}

label {
  font-size: 0.88rem;
  color: #4b3f34;
}

input {
  border-radius: 12px;
  border: 1px solid rgba(124, 100, 76, 0.35);
  padding: 8px 10px;
  font-size: 0.95rem;
  background: #fff;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder {
  color: rgba(91, 74, 59, 0.35);
  opacity: 1;
}

input:focus {
  outline: none;
  border-color: #c98276;
  box-shadow: 0 0 0 3px rgba(201, 130, 118, 0.2);
}

select {
  border-radius: 12px;
  border: 1px solid rgba(124, 100, 76, 0.35);
  padding: 8px 10px;
  font-size: 0.9rem;
  background: #fff;
  min-width: 240px;
  height: auto;
  white-space: normal;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

select:focus {
  outline: none;
  border-color: #c98276;
  box-shadow: 0 0 0 3px rgba(201, 130, 118, 0.2);
}

select option {
  white-space: normal;
}

.select-wrap {
  display: grid;
  gap: 6px;
}

.field--invalid input {
  border-color: #c2543a;
  box-shadow: 0 0 0 3px rgba(194, 84, 58, 0.2);
}

.hint {
  font-size: 0.8rem;
  color: #816f5c;
}

.form__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(124, 100, 76, 0.45);
  color: #56473a;
}

.btn--accent {
  background: linear-gradient(135deg, #e08f62, #c98276);
  color: #fff;
  box-shadow: 0 10px 20px rgba(224, 143, 98, 0.3);
}

.output-group {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(124, 100, 76, 0.25);
}

.output-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr) auto;
  gap: 8px;
  align-items: center;
  padding: 2px 0;
}

.output-details {
  grid-column: 1 / -1;
  padding: 6px 8px;
  border-radius: 14px;
  border: 1px solid rgba(124, 100, 76, 0.18);
  background: rgba(255, 255, 255, 0.65);
  max-height: 160px;
  overflow: auto;
}

.output-details summary {
  cursor: pointer;
  color: #6b5b4b;
  font-size: 0.8rem;
}

.output-details__list {
  display: grid;
  gap: 0;
}

.output-details__item {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 4px 0;
  border-top: 1px dashed rgba(124, 100, 76, 0.2);
}

.output-details__item:first-child {
  border-top: none;
}

.output-details .pill {
  display: inline-flex;
}

.output-details__line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 10px;
  row-gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 0.85rem;
  color: #463a30;
  word-break: break-word;
}

.output-details__value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--night);
}

.output-details__separator {
  color: #7b6a57;
}

.output-details__path {
  font-size: 0.78rem;
  color: #6b5b4b;
  padding: 2px 6px;
  border-radius: 10px;
}

.output-details__path--warn {
  background: rgba(244, 201, 93, 0.35);
  color: #7b5b1c;
}

.output-details__path--bad {
  background: rgba(201, 130, 118, 0.25);
  color: #7c3020;
}

.output-note {
  font-size: 0.8rem;
  color: #816f5c;
  margin: 2px 0 6px;
}

.output-note--warn {
  color: #8a4a24;
}

.output-note--bad {
  color: #7c3020;
}

.output-note.is-hidden {
  display: none;
}

.field__note {
  font-size: 0.8rem;
  color: #816f5c;
  margin-top: 4px;
  display: inline-block;
}

.field__note--warn {
  color: #7b5b1c;
  background: rgba(244, 201, 93, 0.35);
  padding: 2px 6px;
  border-radius: 10px;
}

.field__note--bad {
  color: #7c3020;
  background: rgba(201, 130, 118, 0.25);
  padding: 2px 6px;
  border-radius: 10px;
}

.field__note.is-hidden {
  display: none;
}

.output-row .label {
  color: #463a30;
  font-size: 0.9rem;
}

.output-row .value {
  font-weight: 600;
  color: var(--night);
}

.output-row .provenance {
  font-size: 0.75rem;
  color: #6b5b4b;
  word-break: break-word;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(124, 100, 76, 0.1);
  color: #5c4b3c;
}

.pill.is-hidden {
  display: none;
}

.pill--guess {
  background: rgba(244, 201, 93, 0.35);
  color: #7b5b1c;
}

.pill--good {
  background: rgba(156, 199, 176, 0.35);
  color: #2f5c47;
}

.pill--incomplete {
  background: rgba(244, 201, 93, 0.2);
  color: #8a6b2f;
}

.pill--warn {
  background: rgba(224, 143, 98, 0.2);
  color: #8a4a24;
}

.pill--bad {
  background: rgba(201, 130, 118, 0.25);
  color: #7c3020;
}

.legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0 10px;
}

.flags {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  padding: 10px;
  border: 1px solid rgba(202, 166, 136, 0.3);
}

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

.flag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(124, 100, 76, 0.2);
}

.flag__badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.flag--note .flag__badge {
  background: rgba(124, 100, 76, 0.1);
  color: #5b4a3b;
}

.flag--warn .flag__badge {
  background: rgba(224, 143, 98, 0.2);
  color: #8a4a24;
}

.flag--bad .flag__badge {
  background: rgba(201, 130, 118, 0.25);
  color: #7c3020;
}

.muted {
  color: #7b6a57;
  font-size: 0.9rem;
}

.reveal {
  animation: reveal 0.6s ease both;
}

.panel--inputs {
  animation-delay: 0.1s;
}

.panel--outputs {
  animation-delay: 0.25s;
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
  }
}
