:root {
  --paper: #f6f3ec;
  --sheet: #fffdf8;
  --ink: #1d1b18;
  --muted: #6b665c;
  --line: #d9d3c6;
  --seal: #b3261e;      /* 브랜드 색은 인주색 하나다 */
  --serif: "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", "Batang", serif;
  --sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 16px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 480px; margin: 0 auto; padding: 14px 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 900 18px/1 var(--serif); text-decoration: none; }
.brand-seal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 5px; background: var(--seal); color: #fff; font-size: 15px; }
.top-note { color: var(--muted); font-size: 13px; }

h1 { margin: 20px 0 10px; font: 900 clamp(30px, 9vw, 38px)/1.25 var(--serif); letter-spacing: -0.02em; }
h2 { margin: 0 0 8px; font: 900 22px/1.35 var(--serif); }
.lead { margin: 0 0 24px; color: var(--muted); }
.loading { padding: 60px 0; color: var(--muted); text-align: center; }

.sheet { margin: 0 0 16px; padding: 22px 18px; background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; }

label, .label { display: block; margin: 18px 0 6px; font-size: 14px; font-weight: 700; }
label:first-child { margin-top: 0; }
input, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #a9a397;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: 16px/1.55 var(--sans);
}
textarea { min-height: 150px; resize: vertical; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row label { margin-top: 18px; }
.hint { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.hint .count { flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { min-height: 36px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 18px; background: transparent; color: var(--ink); font: 14px var(--sans); cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }

.btn { display: block; width: 100%; min-height: 52px; margin-top: 10px; padding: 12px 16px; border: 1px solid var(--ink); border-radius: 6px; background: transparent; color: var(--ink); font: 700 16px var(--sans); text-align: center; text-decoration: none; cursor: pointer; }
.btn.primary { border-color: var(--seal); background: var(--seal); color: #fff; }
.btn:disabled { opacity: 0.55; cursor: default; }
.link-btn { display: block; margin: 14px auto 0; padding: 8px; border: 0; background: none; color: var(--muted); font: 14px var(--sans); text-decoration: underline; cursor: pointer; }

.err { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid var(--seal); background: #fff; font-size: 14px; }
.ok { margin: 8px 0 0; color: var(--muted); font-size: 14px; text-align: center; }

.steps { margin: 28px 0 8px; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.steps li::before { content: counter(s); font: 900 15px var(--serif); color: var(--seal); }

.resume { display: block; margin-bottom: 16px; padding: 12px 14px; background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; font-size: 14px; text-decoration: none; }
.resume strong { display: block; }

.message-box { margin: 12px 0 0; padding: 14px; background: var(--paper); border-radius: 6px; font-size: 15px; white-space: pre-wrap; }

/* 소환장 */
.summons-mark { margin: 0 0 6px; color: var(--seal); font: 900 14px var(--serif); letter-spacing: 0.3em; }
.quote { margin: 12px 0 0; padding: 12px 14px; border-left: 3px solid var(--line); background: var(--paper); white-space: pre-wrap; }
.meta { margin: 0; color: var(--muted); font-size: 14px; }

/* 심리 중 */
.judging { padding: 44px 8px; text-align: center; }
.judging-bar { height: 3px; margin: 18px auto 0; max-width: 200px; background: var(--line); overflow: hidden; }
.judging-bar::after { content: ""; display: block; width: 40%; height: 100%; background: var(--seal); animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* 판결문 */
.verdict { position: relative; padding: 28px 20px 24px; border: 1px solid var(--ink); outline: 1px solid var(--ink); outline-offset: -6px; }
.verdict-title { margin: 0 0 14px; font: 900 30px/1.2 var(--serif); letter-spacing: 0.3em; text-align: center; text-indent: 0.3em; }
.parties { margin: 0 0 16px; font-size: 14px; }
.parties div { display: grid; grid-template-columns: 56px 1fr; padding: 2px 0; }
.parties dt { color: var(--muted); }
.parties dd { margin: 0; font-weight: 700; }
.section-name { margin: 18px 0 6px; font: 900 15px var(--serif); text-align: center; letter-spacing: 0.4em; text-indent: 0.4em; }
.order { margin: 0; font: 600 18px/1.55 var(--serif); }
.bar { display: flex; height: 26px; margin-top: 8px; border: 1px solid var(--ink); }
.bar span { display: block; height: 100%; }
.bar .heavy { background: var(--seal); }
.bar .light { background: var(--line); }
.bar-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 14px; font-weight: 700; }
.reasons { margin: 0; padding-left: 20px; }
.reasons li { margin-bottom: 6px; }
.penalty { margin: 0; padding: 10px 12px; border: 1px solid var(--line); font-weight: 700; }
.verdict-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 20px; font: 600 15px var(--serif); }
.stamp { display: inline-grid; place-items: center; width: 52px; height: 52px; border: 2.5px solid var(--seal); border-radius: 6px; color: var(--seal); font: 900 15px/1.15 var(--serif); text-align: center; transform: rotate(-7deg); animation: stamp 0.35s ease-out both; }
@keyframes stamp { from { opacity: 0; transform: rotate(-7deg) scale(1.6); } to { opacity: 1; transform: rotate(-7deg) scale(1); } }
.fine { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; }

.image-result { margin-top: 12px; }
.image-result img { display: block; width: 100%; border: 1px solid var(--line); }
.image-result p { margin: 8px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

.appeal { margin-top: 16px; }
.appeal p { margin: 0; }
.appeal .soon { margin-top: 12px; padding: 12px; background: var(--paper); font-weight: 700; text-align: center; }

.foot { padding-top: 24px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 12.5px; }
.foot p { margin: 0 0 6px; }

.prose h1 { font-size: 26px; }
.prose h2 { margin-top: 24px; font-size: 17px; }
.prose li { margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) {
  .stamp, .judging-bar::after { animation: none; }
}
