:root {
  --green: #2f5d1e; --green-soft: #d9ead3; --orange-soft: #fce5cd;
  --bg: #f3f3f1; --card: #fff; --text: #222; --muted: #777; --line: #e3e3e0; --error: #c0392b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; }
main { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }

.panel { background: var(--card); border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.panel h1 { margin: 0 0 4px; font-size: 22px; color: var(--green); }
.lead { margin: 0 0 16px; color: var(--muted); }
label { display: block; margin-top: 14px; font-weight: 700; }
label small { color: var(--muted); font-weight: 400; }
input, select { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit; border: 1px solid #ccc; border-radius: 8px; background: #fff; }
button { margin-top: 18px; padding: 10px 22px; border: 0; border-radius: 8px; background: var(--green); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
#status { min-height: 1.6em; margin: 12px 0 0; color: var(--muted); }
#status.error { color: var(--error); }
#actions { margin: 16px 0 0; text-align: right; }
#actions button { margin: 0; }

#report:empty { display: none; }
#report { margin-top: 16px; background: var(--card); border-radius: 12px; padding: 0 0 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; }
.report-head { background: var(--green); color: #fff; padding: 14px 24px; }
.report-head h1 { margin: 0; font-size: 22px; }
#report section { padding: 18px 24px 4px; border-bottom: 1px solid var(--line); }
#report h2 { font-size: 17px; margin: 0 0 12px; }
#report h2 small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
#report h3 { font-size: 15px; margin: 0 0 4px; }

.demo { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.bars { list-style: none; margin: 0 0 12px; padding: 0; }
.bars li { display: grid; grid-template-columns: 72px 1fr 52px; gap: 8px; align-items: center; margin-bottom: 6px; }
.bar { height: 14px; background: #eee; border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: #9bb98f; }
.bars li.top .bar span { background: var(--green); }
.bars li.top .bar-label, .bars li.top .bar-value { font-weight: 700; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding-bottom: 14px; }
.cards li { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.cards p { margin: 4px 0; }
.chip { display: inline-block; background: var(--green-soft); border-radius: 999px; padding: 0 9px; margin: 2px 4px 2px 0; font-size: 12px; }
.tags b { font-size: 12px; color: var(--muted); margin-right: 4px; }
.quote { color: var(--muted); font-size: 13px; }

.answer { color: var(--green); font-weight: 700; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-bottom: 14px; }
.compare h3 { margin-bottom: 8px; }
.compare .gap { background: var(--green-soft); border-radius: 10px; padding: 12px 14px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.plain li:last-child { border-bottom: 0; }
.plain p { margin: 2px 0; }
.vocab { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.vocab th, .vocab td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.vocab th { width: 30%; font-size: 16px; }
.sources { padding: 14px 24px; font-size: 13px; color: var(--muted); }
.sources p { margin: 0; }
.warnings { margin: 6px 0 0; padding-left: 18px; color: #a0522d; }

@media (max-width: 640px) {
  .demo, .compare { grid-template-columns: 1fr; }
  .panel, #report section { padding-left: 16px; padding-right: 16px; }
}
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  main { padding: 0; max-width: none; }
  #report { box-shadow: none; margin: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cards li { break-inside: avoid; }
}
