:root {
  --bg: #FDF8F8;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --muted: #8A8A8A;
  --accent: #D14D7E;
  --accent-dark: #B23D68;
  --line: #EFE6E8;
  --warn-bg: #FFF8E1;
  --warn-line: #E8C468;
  --danger: #D14D4D;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

body {
  padding-bottom: 24px;
}

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

/* ---------- Header ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-weight: 700;
  font-size: 16px;
}
.home-link {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}
.home-link:hover { color: var(--accent); }

/* ---------- Banner ---------- */
.banner {
  max-width: 720px;
  margin: 12px auto 0;
  padding: 12px 16px;
  background: #FCEFF3;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
}

/* ---------- Round top notice ---------- */
.round-notice {
  max-width: 720px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  background: #FCEFF3;
  border: 1px solid var(--accent);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
}

/* ---------- Tabs ---------- */
.tabs {
  max-width: 720px;
  margin: 16px auto 0;
  padding: 0 16px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.tab--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ---------- App / Sections ---------- */
.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

.section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(26, 26, 26, 0.04);
}

.section__title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
}

.section__desc {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 14px;
}

.section--collapsible .section__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.section--collapsible .section__body {
  margin-top: 14px;
}
.section--collapsible[data-open="false"] .section__body {
  display: none;
}
.chevron {
  color: var(--muted);
  transition: transform 0.15s ease;
  font-size: 14px;
}
.section--collapsible[data-open="true"] .chevron {
  transform: rotate(180deg);
}

.onboarding-steps {
  padding-left: 20px;
  margin: 0 0 12px;
}
.onboarding-steps li {
  margin-bottom: 8px;
}
.onboarding-note {
  font-size: 14px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
}

/* ---------- Fields ---------- */
.field {
  margin-bottom: 18px;
}
.field:last-child { margin-bottom: 0; }
.field--highlight {
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 14px;
  background: #FFFBFC;
}
.field__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 2px 9px;
  margin-left: 8px;
  vertical-align: middle;
}
.field__kind-tag {
  display: inline-block;
  font-size: 11px;
  color: var(--muted);
  margin-left: 8px;
  vertical-align: middle;
}
.field__label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
}
.field__example {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
  line-height: 1.5;
}
.field__hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--accent-dark);
  background: #FCEFF3;
  border-radius: 8px;
  padding: 8px 10px;
}

textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
}

.field__status {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.field__status--visible { opacity: 1; }

.fill-count {
  font-size: 14px;
  color: var(--muted);
  margin-top: 10px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-dark); }
.btn--small {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
}
.btn--big {
  width: 100%;
  padding: 16px;
  font-size: 16px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn--copied {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ---------- Result / warning boxes ---------- */
.warning-box {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 12px;
}

.result-box {
  width: 100%;
  min-height: 320px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.copy-instructions {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.6;
}
.copy-instructions strong { color: var(--text); }

/* ---------- Role / question lists ---------- */
.followup-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.followup-item:last-child { border-bottom: none; }
.followup-item--highlight {
  border: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  background: #FCEFF3;
  margin: 4px 0;
}
.followup-item--highlight .followup-item__note {
  color: var(--accent-dark);
  font-weight: 600;
}
.followup-item__text {
  flex: 1;
  font-size: 14px;
}
.followup-item__note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.danger-box {
  border: 1.5px solid var(--danger);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 16px;
  font-size: 14px;
  background: #FFF5F5;
}
.danger-box__title {
  font-weight: 700;
  color: var(--danger);
  margin: 0 0 8px;
}
.danger-box ul {
  margin: 0;
  padding-left: 18px;
}
.danger-box li { margin-bottom: 6px; }

/* ---------- Concept flow ---------- */
.quote {
  font-style: italic;
  color: var(--accent-dark);
  font-size: 13px;
  margin: 6px 0;
}

/* ---------- Post-lecture subsections ---------- */
.subsection {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px dashed var(--line);
}
.subsection:first-of-type {
  padding-top: 0;
  margin-top: 4px;
  border-top: none;
}
.subsection-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
}

.numbered-input-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.numbered-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.numbered-input-marker {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 14px;
  width: 20px;
}
.small-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
}
.small-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
}

/* ---------- Radio group ---------- */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  cursor: pointer;
}
.radio-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* ---------- Info box (제출 / 다음 회차 예고) ---------- */
.info-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 16px;
  font-size: 14px;
}
.info-box__title {
  font-weight: 700;
  margin: 0 0 6px;
}
.info-box ul {
  margin: 0;
  padding-left: 18px;
}
.info-box li {
  margin-bottom: 4px;
}
.info-box p {
  margin: 0;
  color: var(--muted);
}
.info-box--preview {
  background: #FCEFF3;
  border-color: var(--accent);
}

/* ---------- Save reminder / kipris notice (2회차 실습) ---------- */
.save-reminder,
.kipris-notice {
  margin-top: 16px;
}
.save-reminder__title {
  font-weight: 700;
  margin: 0 0 6px;
}
.kipris-notice .onboarding-steps {
  margin-top: 8px;
}

.onboarding-note--rich ul {
  margin: 6px 0;
  padding-left: 18px;
}
.onboarding-note--rich li {
  margin-bottom: 4px;
}
.onboarding-note--rich p {
  margin: 8px 0;
}
.onboarding-note--rich p:first-child {
  margin-top: 0;
}
.onboarding-note--rich p:last-child {
  margin-bottom: 0;
}

/* ---------- Lawyer contact (2회차 최하단) ---------- */
.lawyer-contact {
  background: #FCEFF3;
  border-color: var(--accent);
}
.lawyer-contact p {
  margin: 4px 0;
  font-size: 14px;
}
.lawyer-contact__lines {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--muted);
}
.lawyer-contact__lines li {
  margin-bottom: 4px;
}

/* ---------- Not-ready panel ---------- */
.not-ready {
  text-align: center;
  padding: 60px 16px;
  color: var(--muted);
}

/* ---------- Bottom fixed bar (mobile only) ---------- */
.bottom-bar {
  display: none;
}
@media (max-width: 640px) {
  .bottom-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 1px solid var(--line);
    box-shadow: 0 -2px 10px rgba(26,26,26,0.06);
  }
  .bottom-bar span {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
  }
  body { padding-bottom: 84px; }
}

@media (min-width: 641px) {
  .app { padding: 24px 16px; }
}
