/* 의료광고 점검 — mobile-first */
:root {
  --teal: #0f4c5c;
  --teal-dark: #0a3641;
  --teal-soft: #e6f1f3;
  --cream: #f6f3ed;
  --card: #ffffff;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --warn: #b54708;
  --warn-bg: #fffaeb;
  --ok: #0e7c66;
  --ok-bg: #f0fdf9;
  --low: #175cd3;
  --low-bg: #eff4ff;
  --text: #1c1917;
  --muted: #57534e;
  --line: #e7e5e4;
  --shadow: 0 8px 24px rgba(15, 76, 92, 0.08);
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--text);
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", "Apple Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
body {
  min-height: 100dvh;
  padding-bottom: calc(24px + var(--safe-bottom));
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--teal);
  color: #fff;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: calc(52px + var(--safe-top));
}
.topbar h1 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  flex: 1;
}
.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
}
.icon-btn:active { background: rgba(255,255,255,0.12); }
.icon-btn[hidden] { display: none; }
main { padding: 16px; max-width: 720px; margin: 0 auto; }
.lede { margin: 0 0 14px; color: var(--muted); font-size: 0.95rem; }
.disclaimer {
  background: var(--warn-bg);
  border: 1px solid #f5d5a6;
  color: #7a3e05;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 0 0 16px;
}
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.tab {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
.tab[aria-selected="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
label.field {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 6px;
}
textarea, input[type="url"], input[type="text"], select {
  width: 100%;
  border: 1px solid #d6d3d1;
  border-radius: 12px;
  padding: 12px 12px;
  font: inherit;
  background: #fff;
  color: var(--text);
  min-height: 44px;
}
textarea { min-height: 160px; resize: vertical; }
textarea:focus, input:focus, select:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  text-decoration: none;
}
.btn-primary { background: var(--teal); color: #fff; width: 100%; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--teal); border: 1.5px solid var(--teal); width: 100%; }
.btn-ghost { background: var(--teal-soft); color: var(--teal-dark); width: 100%; }
.btn-danger-outline { background: #fff; color: var(--danger); border: 1.5px solid #f5c2c0; }
.status, .error {
  font-size: 0.88rem;
  margin: 10px 0 0;
}
.error { color: var(--danger); }
.status { color: var(--muted); }
.progress {
  height: 6px;
  background: #e7e5e4;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--teal);
  width: 0%;
  transition: width 0.2s;
}
.thumb {
  display: block;
  max-width: 100%;
  max-height: 240px;
  border-radius: 12px;
  margin: 10px 0;
  border: 1px solid var(--line);
}
.file-row { display: flex; gap: 8px; }
.file-row .btn { flex: 1; }
.hidden-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}
.badge-high { background: var(--danger-bg); color: var(--danger); }
.badge-medium { background: var(--warn-bg); color: var(--warn); }
.badge-low { background: var(--low-bg); color: var(--low); }
.badge-none { background: var(--ok-bg); color: var(--ok); }
.overall {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.overall strong { font-size: 1.2rem; letter-spacing: -0.02em; }
.finding {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  background: #fff;
}
.finding header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.finding h3 { margin: 0; font-size: 1rem; }
.phrase {
  background: #f5f5f4;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
  margin: 8px 0;
  word-break: break-word;
}
.law-cite { color: var(--teal); font-size: 0.86rem; font-weight: 700; margin: 0 0 6px; }
.explain { margin: 0 0 8px; font-size: 0.92rem; }
.law-text {
  margin: 0;
  font-size: 0.8rem;
  color: #57534e;
  background: #fafaf9;
  border-radius: 8px;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.hint { font-size: 0.82rem; color: var(--muted); margin: 8px 0 0; }
.install-tip {
  font-size: 0.82rem;
  background: var(--teal-soft);
  color: var(--teal-dark);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 14px;
}
select { background: #fff; }
.draft-box {
  white-space: pre-wrap;
  word-break: break-word;
  background: #fafaf9;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.88rem;
  max-height: 280px;
  overflow: auto;
}
.kicker { font-size: 0.78rem; font-weight: 800; color: var(--teal); letter-spacing: 0.02em; margin: 0 0 4px; }
.busy-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 76, 92, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
  padding: 16px;
}
.busy-sheet {
  background: #fff;
  width: 100%;
  max-width: 520px;
  border-radius: 16px 16px 12px 12px;
  padding: 18px 16px calc(16px + var(--safe-bottom));
  box-shadow: 0 -8px 30px rgba(0,0,0,0.15);
}
[hidden] { display: none !important; }
.view[hidden] { display: none !important; }
.busy-overlay[hidden] { display: none !important; }
#print-root { display: none; }

@media print {
  body { background: #fff; padding: 0; }
  .topbar, .no-print, .busy-overlay, .install-tip { display: none !important; }
  main { padding: 0; max-width: none; }
  .view { display: none !important; }
  #print-root { display: block !important; }
  #print-root {
    color: #111;
    font-size: 11pt;
    padding: 16mm;
  }
  #print-root h1 { font-size: 16pt; margin: 0 0 8px; color: #0f4c5c; }
  #print-root h2 { font-size: 13pt; color: #0f4c5c; margin: 16px 0 8px; }
  #print-root img { max-width: 100%; max-height: 90mm; }
  #print-root .warn { color: #7a2e2e; font-size: 9pt; }
  @page { margin: 14mm; }
}

@media (min-width: 800px) {
  main { padding: 24px 16px 40px; }
  .file-row .btn, .actions { }
  .actions.two { display: grid; grid-template-columns: 1fr 1fr; }
}
