[hidden] { display: none !important; }

.complaint {
  max-width: 430px;
  min-height: 100%;
  margin: 0 auto;
  padding: 27px 22px calc(26px + env(safe-area-inset-bottom));
  background: var(--paper);
}

.complaint header {
  padding: 0 0 15px;
  border-bottom: 3px double var(--ink);
  text-align: center;
}

.complaint header p { font-weight: 600; letter-spacing: .35em; }
.complaint h1 { margin-top: 4px; font-size: 2.5rem; line-height: 1.3; letter-spacing: .16em; }
.complaint form { font-family: "Malgun Gothic", system-ui, sans-serif; }
#landing { padding-top: clamp(12px, 6vh, 54px); }
#landing h1 { font-weight: 900; font-size: clamp(1.9rem, 8vw, 2.5rem); letter-spacing: -.04em; }
.landing-chat {
  display: grid;
  gap: 14px;
  margin-top: 28px;
  padding: 24px 18px;
  background: #d7e2eb;
  font: 1rem/1.5 "Malgun Gothic", system-ui, sans-serif;
}
.landing-chat p { padding: 8px 14px; }
.landing-chat .outgoing { justify-self: end; background: #ffe65c; border-radius: 14px 2px 14px 14px; }
.landing-chat .incoming { justify-self: start; background: white; border-radius: 2px 14px 14px 14px; }
.landing-verdict { margin: 24px 0; border-block: 3px double var(--ink); }
.landing-verdict div { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 4px; line-height: 1.65; }
.landing-verdict div + div { border-top: 1px solid var(--rule); }
.landing-verdict dt { font-weight: 600; }
.landing-verdict dd { font-weight: 700; }
.write-link {
  display: grid;
  place-items: center;
  min-height: 48px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
}
.form-row { display: grid; gap: 6px; margin: 15px 0; min-width: 0; border: 0; }
.form-row > label, .form-row legend { font-size: .94rem; font-weight: 700; }
.optional { font-size: .82rem; color: var(--gray); font-weight: 400; }

.form-row select, .form-row input[type="text"], #share-address {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: #fffefa;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  font-size: 1rem;
}

.form-row select {
  appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
                    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 16px center, right 11px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.text-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.text-entry span { color: var(--gray); font-size: .82rem; font-variant-numeric: tabular-nums; }
.text-entry .over-limit, .form-error { color: #981d26; }
.form-row [aria-invalid="true"] { border-color: #981d26; }

#defendant-options { display: flex; flex-wrap: wrap; gap: 0 12px; }
#defendant-options label { display: flex; align-items: center; gap: 5px; min-height: 44px; font-size: .875rem; }
#defendant-options input { width: 16px; height: 16px; accent-color: var(--ink); }

.field-help, .privacy-note, .form-error { font-size: .875rem; line-height: 1.55; }
.field-help, .privacy-note { color: #63574e; }
.field-help:empty, .form-error:empty, #share-status:empty { display: none; }
.form-error { margin-top: 10px; }
.complaint button[type="submit"] {
  width: 100%;
  min-height: 48px;
  margin-top: 13px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: 700 1rem "Noto Serif KR", "Batang", serif;
  cursor: pointer;
}

.sentence-examples { display: flex; flex-wrap: wrap; gap: 6px; }
.sentence-examples button {
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
}

.stage .appeal-title { margin-left: .12em; font-size: 2.15rem; letter-spacing: .12em; }
.stage .name { overflow-wrap: anywhere; }
.stage .order .main, .stage .order .sub { white-space: normal; }
.stage .order .hl { max-width: 100%; overflow-wrap: anywhere; }
.stage .order .sub, .stage .reasons li { overflow-wrap: anywhere; }
.stage .actions { flex-wrap: wrap; }
.stage .actions button { min-width: 5.2em; }
#appeal-panel { width: 100%; padding: 12px 0 0; border-top: 1px solid var(--rule); }
#appeal-heading { margin-bottom: 8px; font-size: .95rem; }
#appeal-choices { display: grid; gap: 6px; }
.stage #appeal-choices button {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border-width: 1px;
  text-align: left;
}
#share-status { width: 100%; font: .875rem "Malgun Gothic", sans-serif; }
#share-address { min-width: 0; }
