:root {
  --ink: #16171d;
  --ink-soft: #55586b;
  --bg: #f6f5fb;
  --card: #ffffff;
  --border: #e7e5f3;
  --brand: #6c4cf1;
  --brand-dark: #4f33c9;
  --brand-soft: #efeafd;
  --accent: #16b981;
  --danger: #e0533d;
  --shadow: 0 8px 24px rgba(30, 20, 70, 0.08);
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eeeef5;
    --ink-soft: #a7a7bd;
    --bg: #100f1a;
    --card: #1a1826;
    --border: #2b2840;
    --brand: #9c85ff;
    --brand-dark: #b9a7ff;
    --brand-soft: #241f3d;
    --accent: #35d399;
    --danger: #ff7a63;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  line-height: 1.55;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
  color: var(--ink);
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: inline-block;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin: 2px 0 0 18px;
}

.back-link {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
}
.back-link:hover { color: var(--brand); }

h1 {
  font-size: 24px;
  margin: 18px 0 6px;
  letter-spacing: -0.01em;
}

.lede {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 0 0 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 14px 0 6px;
}
label:first-child { margin-top: 0; }

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
}

textarea { resize: vertical; min-height: 90px; }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 400px) {
  .row { grid-template-columns: 1fr; }
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 14px 18px;
  margin-top: 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-size: 15.5px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.btn.secondary {
  background: var(--card);
  color: var(--brand);
  border: 1.5px solid var(--brand);
}

.result {
  display: none;
  margin-top: 18px;
}
.result.show { display: block; }

.result-big {
  font-size: 30px;
  font-weight: 900;
  color: var(--brand-dark);
  letter-spacing: -0.02em;
  word-break: break-word;
}
.result-big.bad { color: var(--danger); }
.result-big.good { color: var(--accent); }
@media (max-width: 360px) {
  .result-big { font-size: 25px; }
  .score-num { font-size: 38px; }
}

.result-label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 700;
  margin-bottom: 4px;
}

.breakdown {
  margin-top: 14px;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}
.breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 5px 0;
  color: var(--ink-soft);
}
.breakdown-row b { color: var(--ink); font-weight: 700; }

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  margin-bottom: 10px;
}

.tools-grid {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.tool-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s;
}
.tool-card:hover { transform: translateY(-2px); }
.tool-card .emoji { font-size: 24px; }
.tool-card h3 { margin: 8px 0 4px; font-size: 16.5px; }
.tool-card p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }

.cta-box {
  margin-top: 28px;
  background: linear-gradient(135deg, var(--brand-soft), var(--bg));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
}
.cta-box h3 {
  margin: 0 0 6px;
  font-size: 17px;
}
.cta-box p {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.disclaimer {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 14px;
  line-height: 1.6;
}

.inline-cta {
  margin-top: 18px;
  padding: 16px;
  background: var(--brand-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.inline-cta-text {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.5;
}
.inline-cta .btn { margin-top: 0; }

.share-row {
  margin-top: 10px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--brand);
  flex-shrink: 0;
}
.checklist-item .ci-text { font-size: 14.5px; }
.checklist-item .ci-hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

.score-ring-label {
  text-align: center;
}
.score-num {
  font-size: 46px;
  font-weight: 900;
  color: var(--brand-dark);
}
.score-out {
  font-size: 16px;
  color: var(--ink-soft);
}

footer {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 40px;
}
footer a { color: var(--ink-soft); }
