:root {
  color-scheme: light;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0284c7;
  --brand-dark: #075985;
  --green: #059669;
  --red: #dc2626;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--brand-dark); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
.site-header, .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.2rem;
}
.site-header nav, .site-footer { flex-wrap: wrap; }
.site-header nav, .link-list { display: flex; gap: .9rem; flex-wrap: wrap; }
.logo { font-size: 1.35rem; color: var(--text); }
main { max-width: 1160px; margin: 0 auto; padding: 1rem; }
.hero, .page-head {
  background: linear-gradient(135deg, #e0f2fe, #fff);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(2rem, 6vw, 5rem);
  margin-bottom: 1.5rem;
}
.page-head { display: flex; justify-content: space-between; gap: 1rem; }
.hero h1, .page-head h1 { font-size: clamp(2rem, 5vw, 4.5rem); line-height: 1.04; margin: .3rem 0 1rem; }
.eyebrow { color: var(--brand-dark); text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.muted, .disclaimer { color: var(--muted); }
.tool-hero { align-items: stretch; }
.tool-hero > div { max-width: 640px; }
.scenario-card {
  width: min(100%, 360px);
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.1rem;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
}
.scenario-card h2 { margin-top: 0; }
.scenario-card label {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
  margin: .75rem 0 .25rem;
}
.scenario-card input, .scenario-card select, .scenario-card button { width: 100%; }
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}
.section-heading h2 { margin: .15rem 0 0; }
.grid { display: grid; gap: 1rem; margin: 1rem 0; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card, .content-section, .notice {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .04);
}
.readable { max-width: 820px; }
.lead { font-size: 1.2rem; color: var(--text); }
.article-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.article-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .04);
}
.article-card img, .article-hero-image {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #e0f2fe;
}
.article-card img { aspect-ratio: 4 / 3; object-fit: cover; }
.article-hero-image {
  display: block;
  max-height: 420px;
  object-fit: cover;
  margin: 0 0 1rem;
}
.tool-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.tool-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.tool-card::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -42px;
  width: 108px;
  height: 108px;
  background: #bae6fd;
  border-radius: 999px;
  opacity: .55;
}
.tool-card h3 { margin: .65rem 0 .25rem; }
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: var(--brand-dark);
  font-weight: 900;
}
.tool-card-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.compact-link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}
.compact-link-grid a {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .85rem;
  background: #f8fafc;
}
.compact-link-grid span { color: var(--muted); font-weight: 800; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stats article { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 1rem; }
.stats span { display: block; color: var(--muted); font-size: .9rem; }
.stats strong { font-size: 1.35rem; }
.up { color: var(--green); }
.down { color: var(--red); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap { overflow-x: auto; }
input, select, button, textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem 1rem;
  font: inherit;
}
button {
  background: var(--brand);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 800;
}
button:hover { background: var(--brand-dark); }
.search-card, .inline-form { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; }
.search-card label { width: 100%; font-weight: 800; }
.coin-icon { width: 88px; height: 88px; object-fit: contain; }
.converter-card input { width: min(100%, 420px); display: block; margin-bottom: 1rem; }
.result { font-size: 2rem; font-weight: 900; }
details { border-top: 1px solid var(--line); padding: .9rem 0; }
summary { cursor: pointer; font-weight: 800; }
.mini-chart { min-height: 220px; display: flex; align-items: end; gap: 1rem; padding: 1rem; background: #f1f5f9; border-radius: 16px; }
.chart-column { flex: 1; height: 180px; display: flex; flex-direction: column; justify-content: end; gap: .35rem; text-align: center; }
.chart-column span { width: 100%; background: linear-gradient(180deg, #38bdf8, #075985); border-radius: 10px 10px 0 0; }
.chart-column strong { color: var(--text); font-size: .95rem; }
.chart-column small { color: var(--muted); font-weight: 700; }

@media (max-width: 760px) {
  .two, .three, .stats, .article-grid, .tool-card-grid, .compact-link-grid { grid-template-columns: 1fr; }
  .article-card { grid-template-columns: 1fr; }
  .site-header { align-items: flex-start; flex-direction: column; }
  .page-head { flex-direction: column; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .scenario-card { width: 100%; }
}
