:root {
  color-scheme: light;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #d9e2ec;
  --bg: #f7fafc;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --blue: #2563eb;
  --amber: #b45309;
  --rose: #be123c;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.tool-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
}

.status-strip {
  min-width: 260px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.metrics-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.metrics-band div {
  min-height: 92px;
  padding: 18px;
  background: var(--panel);
}

.metrics-band span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metrics-band strong {
  font-size: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.input-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.input-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.field-row {
  display: grid;
  gap: 8px;
}

label,
legend {
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 118px;
  padding: 12px;
  line-height: 1.55;
}

fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

legend {
  padding: 0 6px;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.primary-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.result-panel {
  min-height: 620px;
  padding: 22px;
}

.empty-state {
  display: grid;
  min-height: 520px;
  place-content: center;
  color: var(--muted);
  text-align: center;
}

.answer-grid {
  display: grid;
  gap: 18px;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.signal {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.signal span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.signal strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.signal.accent {
  border-color: rgba(15, 118, 110, 0.32);
  background: #ecfdf5;
}

.signal.warn {
  border-color: rgba(180, 83, 9, 0.32);
  background: #fffbeb;
}

.summary-box {
  padding: 18px;
  border-left: 4px solid var(--accent);
  background: #f8fafc;
  line-height: 1.72;
}

.actions {
  display: grid;
  gap: 10px;
  padding-left: 0;
  list-style: none;
}

.actions li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.evidence-list {
  display: grid;
  gap: 12px;
}

.evidence-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.evidence-card h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.evidence-card p {
  margin-bottom: 8px;
  color: #334155;
  line-height: 1.62;
}

.evidence-card a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.source-note {
  color: var(--muted);
  font-size: 13px;
}

.caution {
  padding: 14px;
  border: 1px solid rgba(190, 18, 60, 0.26);
  border-radius: 8px;
  background: #fff1f2;
  color: #881337;
  line-height: 1.6;
}

.api-note {
  padding: 12px 14px;
  border: 1px solid rgba(180, 83, 9, 0.28);
  border-radius: 8px;
  background: #fffbeb;
  color: #78350f;
  font-size: 14px;
}

@media (max-width: 900px) {
  .tool-header,
  .workspace {
    grid-template-columns: 1fr;
    display: grid;
  }

  .tool-header {
    align-items: stretch;
  }

  .status-strip {
    min-width: 0;
    text-align: left;
  }

  .metrics-band,
  .score-row {
    grid-template-columns: 1fr;
  }

  .result-panel {
    min-height: 360px;
  }
}
