* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  line-height: 1.6;
}

.topbar {
  padding: 24px 16px 16px;
  text-align: center;
  background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
  border-bottom: 1px solid #30363d;
}

.topbar h1 { margin: 0; font-size: 1.5rem; font-weight: 600; }
.topbar .sub { margin: 4px 0 0; font-size: 0.85rem; color: #8b949e; }

main { max-width: 720px; margin: 0 auto; padding: 16px; }

.panel, .about {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.cat-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cat-tabs button {
  background: #21262d;
  border: 1px solid #30363d;
  color: #8b949e;
  border-radius: 20px;
  padding: 5px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
}
.cat-tabs button.active { background: #1f6feb; border-color: #1f6feb; color: #fff; }

.converter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side input, .side select {
  background: #0d1117;
  border: 1px solid #30363d;
  color: #c9d1d9;
  border-radius: 6px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 1rem;
}

.side input { font-family: ui-monospace, monospace; }
#to-value { color: #ffd33d; font-weight: 600; }

#swap {
  background: #21262d;
  border: 1px solid #30363d;
  color: #c9d1d9;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 1.1rem;
}
#swap:hover { background: #30363d; }

.about h2, .panel h2 { margin-top: 0; font-size: 1.05rem; }

.all-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.all-table td { padding: 6px 8px; border-bottom: 1px solid #1c2331; }
.all-table td.label { color: #8b949e; }
.all-table td.value { text-align: right; font-family: ui-monospace, monospace; color: #c9d1d9; }
.all-table tr.current td { background: #1c2331; }
.all-table tr.current td.value { color: #ffd33d; font-weight: 600; }

.about p { font-size: 0.9rem; }
.about code { font-family: ui-monospace, monospace; background: #21262d; padding: 1px 5px; border-radius: 3px; }
.dim { color: #8b949e; font-size: 0.85rem; }
.about a { color: #58a6ff; }

footer {
  border-top: 1px solid #30363d;
  padding: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: #8b949e;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 720px;
  margin: 24px auto 0;
}
footer a { color: #58a6ff; }

@media (max-width: 520px) {
  .converter { flex-direction: column; }
  #swap { transform: rotate(90deg); }
}
