:root {
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface-soft: #f8f6f2;
  --ink: #171412;
  --muted: #68605a;
  --line: #e3ddd5;
  --line-strong: #cbbbaa;
  --accent: #9a5b2f;
  --accent-dark: #5a321c;
  --accent-soft: #f1e3d6;
  --green: #2f6c55;
  --danger: #9b3b34;
  --shadow: 0 18px 50px rgba(42, 34, 29, 0.08);
  --shadow-soft: 0 10px 28px rgba(42, 34, 29, 0.06);
  --radius: 8px;
  --sans: "Montserrat", "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    linear-gradient(180deg, #ffffff 0, #f5f4f1 360px),
    var(--bg);
}

a { color: inherit; }

button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  width: min(100% - 32px, 1180px);
  margin: 28px auto 48px;
}

.topbar,
.section,
.notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  color: #fff7ef;
  background:
    linear-gradient(135deg, rgba(154, 91, 47, 0.22), transparent 48%),
    linear-gradient(135deg, #211914 0%, #34261f 58%, #4b2d1c 100%);
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.brand-lockup img {
  display: block;
  width: 156px;
  height: auto;
  filter: brightness(0) invert(1);
}

.brand-lockup span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-left: 1px solid rgba(255, 247, 239, 0.22);
  padding-left: 12px;
  color: rgba(255, 247, 239, 0.72);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.topbar p {
  margin: 12px 0 0;
  max-width: 780px;
  color: rgba(255, 247, 239, 0.74);
  font-size: 0.96rem;
  line-height: 1.7;
}

.top-actions,
.actions {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.topbar .button {
  border-color: rgba(255, 247, 239, 0.24);
  background: rgba(255, 247, 239, 0.08);
  color: #fff7ef;
}

.topbar .button:hover {
  background: rgba(255, 247, 239, 0.14);
}

.section {
  margin-top: 18px;
  padding: 26px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section h2 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-head p,
.muted,
.field span,
.answer-label {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.62;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-grid,
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.resource-card {
  display: grid;
  gap: 10px;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  padding: 18px;
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.metric-card:hover,
.resource-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.metric-card strong {
  color: var(--accent-dark);
  font-size: 2rem;
  line-height: 1;
}

.metric-card span,
.resource-card p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.resource-card h3 {
  margin: 2px 0 0;
  font-size: 1rem;
  line-height: 1.35;
}

.field {
  display: grid;
  gap: 8px;
}

.field.full,
.full {
  grid-column: 1 / -1;
}

.field strong {
  color: #2b241f;
  font-size: 0.83rem;
  line-height: 1.35;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea {
  min-height: 128px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(154, 91, 47, 0.12);
  background: #fffdfb;
}

.button,
button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 15px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(42, 34, 29, 0.04);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
}

.button::before,
button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.36) 42%, transparent 72%);
  transform: translateX(-130%);
  transition: transform 0.45s ease;
  pointer-events: none;
}

.button.primary,
button.primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), #7f4728);
  color: #fffaf4;
  box-shadow: 0 12px 24px rgba(154, 91, 47, 0.22);
}

.button.green,
button.green {
  border-color: var(--green);
  background: linear-gradient(135deg, var(--green), #244f40);
  color: #fff;
  box-shadow: 0 12px 24px rgba(47, 108, 85, 0.2);
}

.button:hover,
button:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 14px 28px rgba(42, 34, 29, 0.12);
}

.button:hover::before,
button:hover::before {
  transform: translateX(130%);
}

.button:active,
button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 7px 16px rgba(42, 34, 29, 0.1);
}

.button:focus-visible,
button:focus-visible {
  outline: 0;
  box-shadow:
    0 0 0 4px rgba(154, 91, 47, 0.18),
    0 14px 28px rgba(42, 34, 29, 0.12);
}

.notice {
  margin-top: 18px;
  padding: 18px 20px;
  color: var(--muted);
  line-height: 1.65;
}

.notice strong {
  color: var(--ink);
}

.notice.error {
  border-color: rgba(155, 59, 52, 0.35);
  color: var(--danger);
}

.quiz-progress {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.step-meta,
.quiz-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.step-meta strong {
  color: var(--accent-dark);
  font-size: 1.05rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece6df;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #c38a61);
}

.quiz-step {
  min-height: 430px;
}

.quiz-footnote {
  margin: 14px 0 0;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.option-item,
.scale-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 11px 12px;
  color: var(--ink);
  font-size: 0.9rem;
}

.option-item:has(input:checked),
.scale-item:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option-item input,
.scale-item input {
  width: auto;
  min-height: 0;
  margin: 0;
  accent-color: var(--accent);
}

.scale-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.scale-item {
  justify-content: center;
}

.table-wrap {
  overflow-x: auto;
}

.spaced {
  margin-top: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--accent-dark);
  font-size: 0.73rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  padding: 0 11px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  white-space: nowrap;
}

.answer-block {
  display: grid;
  gap: 8px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.answer-block:last-child {
  border-bottom: 0;
}

.answer-label {
  font-weight: 700;
  color: var(--accent-dark);
}

.answer-value {
  white-space: pre-wrap;
  line-height: 1.68;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1180px);
    margin-top: 10px;
  }

  .topbar,
  .section-head,
  .step-meta,
  .quiz-actions {
    display: grid;
  }

  .brand-lockup {
    display: grid;
    gap: 10px;
  }

  .brand-lockup span {
    border-left: 0;
    padding-left: 0;
  }

  .grid,
  .grid.three,
  .metric-grid,
  .resource-grid,
  .option-grid,
  .scale-grid {
    grid-template-columns: 1fr;
  }
}
