:root {
  --ink: #141c1a;
  --ink-soft: #24302c;
  --pine: #2f5348;
  --pine-deep: #1d3a33;
  --copper: #b56a3a;
  --copper-deep: #8a4a24;
  --gold: #d7b07a;
  --paper: #f4efe4;
  --paper-2: #ebe3d3;
  --cream: #faf7f0;
  --line: rgba(20, 28, 26, 0.12);
  --muted: #5c6762;
  --ok: #245c45;
  --err: #8b2e2e;
  --shadow: 0 18px 50px rgba(20, 28, 26, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(215, 176, 122, 0.18), transparent 50%),
    linear-gradient(180deg, #f7f2e8 0%, var(--paper) 40%, #efe7d8 100%);
  color: var(--ink);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

h1, h2, h3, .brand strong, .card-num {
  font-family: "Noto Serif KR", "Apple SD Gothic Neo", serif;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

a { color: var(--pine-deep); }
a:hover { color: var(--copper-deep); }
code {
  font-size: 0.9em;
  background: rgba(20, 28, 26, 0.06);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--gold);
  border-radius: 12px;
  font-family: "Noto Serif KR", serif;
  font-size: 22px;
}
.brand-copy { display: flex; flex-direction: column; }
.brand-copy strong { font-size: 17px; }
.brand-copy small { color: var(--muted); font-size: 12px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-nav a, .site-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.site-nav a:hover, .site-nav button:hover, .site-nav a.is-on {
  background: rgba(20, 28, 26, 0.06);
}
.site-nav a.nav-ext { color: var(--pine-deep); }
.nav-form { display: inline; }

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 28px;
  align-items: stretch;
  padding: 28px 0 12px;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  margin: 10px 0 16px;
}
.lede { font-size: 17px; color: var(--ink-soft); max-width: 42rem; }
.eyebrow {
  margin: 0;
  color: var(--copper-deep);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 18px; }
.axis {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.08em;
}
.axis span { color: var(--copper); }

.hero-panel {
  background: var(--ink);
  color: #f3ecdf;
  border-radius: 24px;
  padding: 28px 26px;
  box-shadow: var(--shadow);
}
.hero-panel h2 { margin: 6px 0 16px; color: #fff; }
.panel-kicker { margin: 0; color: var(--gold); font-size: 12px; letter-spacing: 0.08em; }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin: 6px 0; }
.panel-note { color: #cfc4b0; font-size: 14px; }

.section { margin: 48px 0; }
.section-head { margin-bottom: 20px; }
.section-head h2, .narrow h1, .toolbar h1 { margin: 6px 0 0; font-size: clamp(28px, 4vw, 40px); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.card, .sheet, .principle-card, .empty, .admin-card, .list-sheet {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 22px; }
.card-num { margin: 0; color: var(--copper); font-size: 20px; }
.card h3 { margin: 8px 0; }

.section-split {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 24px;
  align-items: center;
}
.cta-stack { display: grid; gap: 12px; }
.fine { color: var(--muted); font-size: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--ink); color: #f6efe3; }
.btn-primary:hover { background: var(--pine-deep); color: #fff; }
.btn-secondary { background: var(--pine); color: #f6efe3; }
.btn-secondary:hover { background: var(--pine-deep); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: rgba(20, 28, 26, 0.05); color: var(--ink); }

.flash {
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
}
.flash-ok { background: #e5f2ea; color: var(--ok); }
.flash-err { background: #f8e6e4; color: var(--err); }

.narrow { width: min(640px, 100%); }
.sheet { padding: 22px; }
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: 8px 0 20px;
}

label.field { display: grid; gap: 6px; margin: 0 0 14px; }
label.field span { font-weight: 600; font-size: 14px; }
label.field em { color: var(--copper); font-style: normal; }
label.field small, .muted { color: var(--muted); font-size: 13px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: inherit;
}
textarea { resize: vertical; }
fieldset {
  border: 1px dashed var(--line);
  border-radius: 14px;
  margin: 0 0 16px;
  padding: 14px 14px 2px;
}
legend { padding: 0 6px; color: var(--pine); font-weight: 600; }

.ops-tip {
  background: var(--cream);
  border: 1px solid var(--line);
  border-left: 5px solid var(--pine);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 16px 18px;
  margin: 0 0 16px;
  max-width: 42rem;
}
.ops-tip h2 {
  margin: 4px 0 8px;
  font-size: 18px;
}
.ops-tip p { margin: 0 0 8px; color: var(--ink-soft); font-size: 14px; }
.ops-tip p:last-child { margin-bottom: 0; }

.list-sheet { overflow: hidden; }
.case-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
}
.case-row:last-child { border-bottom: 0; }
.case-row:hover { background: rgba(47, 83, 72, 0.05); }
.case-row h3 { margin: 2px 0 4px; }
.case-ref { margin: 0; font-size: 12px; letter-spacing: 0.06em; color: var(--copper-deep); }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.stage-intake { background: #ece4d4; color: #5a4630; }
.stage-guide { background: #e4eee8; color: #24543f; }
.stage-docs { background: #e7eef5; color: #27415f; }
.stage-field { background: #f3e7d8; color: #6a3d1d; }
.stage-review { background: #ece6f4; color: #46315f; }
.stage-done { background: #dce8e1; color: #1d3d30; }

.stage-track {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 0;
  margin: 0 0 22px;
}
.stage-step {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.stage-dot {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ddd4c4;
  color: var(--ink);
  font-weight: 700;
}
.stage-step.is-done .stage-dot,
.stage-step.is-current .stage-dot {
  background: var(--pine);
  color: #fff;
}
.stage-step.is-current .stage-label { color: var(--ink); font-weight: 700; }

.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  margin-bottom: 14px;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  margin: 0 0 16px;
}
.meta-grid dt { color: var(--muted); font-size: 12px; }
.meta-grid dd { margin: 2px 0 0; font-weight: 600; }
.summary { white-space: pre-wrap; }
.share-box { display: flex; gap: 8px; }
.share-box input { font-size: 13px; }

.principle-card {
  padding: 26px;
  margin: 14px 0;
  border-left: 6px solid var(--gold);
}
.fee-card { border-left-color: var(--copper); }
.card-kicker { margin: 0; color: var(--copper-deep); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }
.principle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.principle-card ol, .principle-card ul { padding-left: 18px; }
.callout {
  background: rgba(181, 106, 58, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
}
.callout.strong { background: rgba(36, 92, 69, 0.1); font-weight: 600; }
.check-list { padding-left: 18px; }

.event-log { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.event-log li { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.event-log time, .event-log small { color: var(--muted); margin-left: 8px; font-size: 12px; }

.empty { padding: 36px 24px; text-align: center; }
.admin-list { display: grid; gap: 14px; }
.admin-card { padding: 18px; }
.admin-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.admin-form { display: grid; gap: 10px; }

.site-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  gap: 10px;
}
.site-footer strong { color: var(--ink); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.footer-links a {
  color: var(--pine-deep);
  font-weight: 600;
  text-decoration: none;
}
.footer-links a:hover { color: var(--copper-deep); }
.footer-note { font-size: 13px; max-width: 52rem; }

.page-share .site-nav a[href="/login"],
.page-share .site-nav a[href="/admin"] { opacity: 0.7; }

@media (max-width: 860px) {
  .hero, .section-split, .card-grid, .detail-grid, .principle-grid, .meta-grid {
    grid-template-columns: 1fr;
  }
  .stage-track { grid-template-columns: repeat(3, 1fr); }
  .site-header { align-items: flex-start; flex-direction: column; }
  .share-box { flex-direction: column; }
  .toolbar { flex-direction: column; align-items: stretch; }
}

@media (max-width: 520px) {
  .stage-track { grid-template-columns: repeat(2, 1fr); }
  .case-row { align-items: flex-start; flex-direction: column; }
}
