:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1a1d24;
  --text-sub: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-soft: #eef2ff;
  --positive: #059669;
  --positive-soft: #ecfdf5;
  --negative: #dc2626;
  --negative-soft: #fef2f2;
  --radius: 14px;
  --max-width: 560px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 48px;
}

header.site-header {
  padding: 8px 0 20px;
}

header.site-header h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
}

header.site-header p {
  color: var(--text-sub);
  font-size: 14px;
  margin: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.tool-link {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease;
}

.tool-link:hover,
.tool-link:focus-visible {
  border-color: var(--accent);
}

.tool-link .tool-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.tool-link .tool-desc {
  font-size: 13px;
  color: var(--text-sub);
}

.intro {
  font-size: 14px;
  color: var(--text-sub);
  margin: 0 0 20px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.field .input-wrap {
  position: relative;
}

.field input[type="number"] {
  width: 100%;
  font-size: 17px;
  padding: 12px 44px 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  -moz-appearance: textfield;
}

.field input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field .unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-sub);
  pointer-events: none;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin: 20px 0;
}

.result-main {
  text-align: center;
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.result-main .result-label {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.result-main .result-value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.result-main .result-value.negative {
  color: var(--negative);
}

.result-main .result-value.positive {
  color: var(--positive);
}

.result-note {
  font-size: 13px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 8px;
  margin-top: 10px;
}

.result-note.positive {
  background: var(--positive-soft);
  color: var(--positive);
}

.result-sub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.result-sub .item {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 12px 14px;
}

.result-sub .item .k {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.result-sub .item .v {
  font-size: 17px;
  font-weight: 700;
}

.notes {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.notes ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.notes li {
  margin-bottom: 4px;
}

.privacy-note {
  font-size: 12px;
  color: var(--text-sub);
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 20px;
}

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--text-sub);
  text-decoration: none;
  margin-bottom: 12px;
}

.back-link:hover {
  color: var(--accent);
}

@media (min-width: 640px) {
  .page {
    padding-top: 40px;
  }
}
