:root {
  color-scheme: light dark;
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --input: #0b1220;
  --border: #1f2937;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --accent: #0284c7;
    --input: #f1f5f9;
    --border: #e2e8f0;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

main {
  width: 100%;
  min-height: 100vh;
  padding: 24px 20px 32px;
  display: grid;
  align-content: start;
  gap: 16px;
  background: var(--bg);
}

.tool-main {
  gap: 6px;
}

.tab-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  width: fit-content;
  margin-bottom: 10px;
}

.tab-bar a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.tab-bar a.active {
  color: var(--text);
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

h1 {
  font-size: 1.5rem;
  margin: 0;
}

p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.4;
}

form {
  display: grid;
  gap: 14px;
}

label {
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

input,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #0f172a;
  font-size: 1rem;
}

.row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.result {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.result h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.result strong {
  font-size: 1.6rem;
  display: block;
  margin-top: 4px;
}

.content {
  display: grid;
  gap: 14px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.98rem;
}

.content strong {
  color: var(--text);
}

.footer {
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.footer a {
  color: inherit;
  text-decoration: underline;
}

.cta {
  margin-top: 28px;
  text-align: center;
  font-weight: 600;
}

.cta a,
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.cta a:hover,
.cta-button:hover {
  transform: translateY(-1px);
  box-shadow: none;
}

.cta a:active,
.cta-button:active {
  transform: translateY(0);
  opacity: 0.9;
}
