.page {
  flex: 1;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Tool card ---------- */
.tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.tab-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--sub);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
  white-space: nowrap;
}
.tab-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-deep);
}
.tab-btn[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 700;
}

/* ---------- Converter body ---------- */
.conv-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.conv-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

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

.conv-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

.conv-select {
  appearance: none;
  background: var(--bg)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ca3af' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E")
    no-repeat right 14px center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 36px 10px 12px;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  width: 100%;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.conv-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.conv-input {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  width: 100%;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.conv-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.conv-input::placeholder { color: var(--muted); font-weight: 400; font-size: 14px; }

.conv-result {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  min-height: 48px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
  user-select: text;
  word-break: break-all;
}
.conv-result:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}
.conv-result.empty { color: var(--muted); font-weight: 400; font-size: 13px; }

/* ---------- Swap button ---------- */
.swap-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 4px;
}
.swap-btn {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--sub);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 200ms ease;
  flex-shrink: 0;
}
.swap-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-deep);
  transform: rotate(180deg);
}

.copy-hint {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin: 0;
}

@media (max-width: 900px) {
  .conv-input, .conv-result { font-size: 18px; }
  .tabs { display: grid; grid-template-columns: repeat(4, 1fr); }
  .tab-btn { padding: 7px 4px; text-align: center; }
}
