:root {
  --paper: #f3efe4;
  --card: #fffdf8;
  --ink: #1c1914;
  --muted: #5e584e;
  --line: #e2d8c6;
  --banner: #f3d56a;
  --banner-edge: #c4552a;
  --green: #0e6b50;
  --green-ink: #e7f6ef;
  --warn: #8a3b12;
  --shadow: 0 16px 40px rgba(40, 28, 12, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, #fff8e8 0, transparent 36%),
    var(--paper);
  color: var(--ink);
  font: 17px/1.55 "Segoe UI", "Helvetica Neue", sans-serif;
}

a { color: var(--green); }

.top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 1.2rem;
  background: rgba(243, 239, 228, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand strong { font-size: 1rem; }

.brand span,
.progress { color: var(--muted); font-size: 0.85rem; }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

button,
.button {
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  cursor: pointer;
}

.primary { background: var(--green); color: var(--green-ink); }

.quiet { background: transparent; color: var(--ink); border: 1px solid var(--line); }

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.2rem;
}

nav {
  position: sticky;
  top: 5rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
}

nav a:hover,
nav a.active { background: #fff; }

nav a.done { box-shadow: inset 3px 0 0 var(--green); }

main { min-width: 0; }

main > section { display: none; }

main > section.on { display: block; }

.hero, section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.2rem 1.3rem 1.4rem;
  box-shadow: var(--shadow);
}

.banner {
  display: inline-block;
  margin: 0 0 0.8rem;
  padding: 0.28rem 0.8rem 0.34rem;
  background-color: var(--banner);
  background-image:
    linear-gradient(rgba(160, 70, 20, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 70, 20, 0.16) 1px, transparent 1px);
  background-size: 14px 14px;
  border: 3px solid var(--banner-edge);
  box-shadow: 4px 4px 0 rgba(196, 85, 42, 0.18);
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 1.35rem;
  line-height: 1.2;
}

h2 { font-size: 1.05rem; margin: 1.1rem 0 0.35rem; }

p { margin: 0.4rem 0 0.8rem; }

.note {
  color: var(--muted);
  font-size: 0.95rem;
}

ol.steps { margin: 0.2rem 0 0.8rem; padding-left: 1.2rem; }

ol.steps li { margin: 0.25rem 0; }

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.7rem 0;
  font-weight: 650;
}

label span.hint,
.hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.88rem;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

textarea { min-height: 4.2rem; resize: vertical; }

textarea.tall { min-height: 7.5rem; }

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.canvas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.side {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.2rem 0.8rem 0.8rem;
  background: #fffaf1;
}

#briefs { max-width: 12rem; }

.pager {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  position: sticky;
  bottom: 0.6rem;
  padding: 0.7rem 0.8rem;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }

.card {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 0.8rem;
  margin: 0.6rem 0;
  background: #fffaf1;
}

.row-actions { display: flex; justify-content: flex-end; }

.warn {
  background: #fff1e6;
  color: var(--warn);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
}

table.guide {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table.guide th,
table.guide td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.4rem;
}

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  nav {
    position: static;
    flex-direction: row;
    overflow: auto;
    padding-bottom: 0.3rem;
  }
  nav a { white-space: nowrap; }
  .grid, .canvas { grid-template-columns: 1fr; }
  .top { align-items: flex-start; flex-direction: column; }
}

@media print {
  .top, nav, .actions, .pager, button { display: none !important; }
  main > section { display: block !important; }
  body { background: white; }
  .layout { display: block; }
  section, .hero { box-shadow: none; break-inside: avoid; }
}
