:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --card-border: #dfe3ee;
  --text: #1f2a44;
  --text-muted: #5f6783;
  --accent: #0b46c4;
  --accent-dark: #072f84;
  --soft-blue: #eaf1ff;
  --soft-gray: #f0f2f7;
  --success-bg: #e2f6df;
  --success-text: #1c7a2b;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 2rem;
}

.app-shell {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.calculator-card {
  background: var(--card);
  border-radius: 24px;
  border: 1px solid var(--card-border);
  box-shadow: 0 25px 70px rgba(15, 33, 75, 0.08);
  padding: 0;
}

.tab-group {
  display: flex;
  border-bottom: 1px solid var(--card-border);
}

.tab {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  border-radius: 24px 24px 0 0;
}

.tab + .tab {
  border-left: 1px solid var(--card-border);
}

.tab.active {
  background: var(--accent);
  color: #fff;
}

.calculator-body {
  padding: 1.75rem;
}

.calculator-body h1 {
  margin: 0;
  font-size: 1.4rem;
}

.calculator-body .lede {
  margin: 0.5rem 0 1.5rem;
  color: var(--text-muted);
}

.scale-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.scale-button {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.75rem;
  font-weight: 600;
  background: var(--soft-gray);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.scale-button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.field span {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.field small {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}

input,
select {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  font: inherit;
  color: var(--text);
  background: #fff;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 70, 196, 0.2);
}

.primary {
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  color: #fff;
  transition: opacity 0.2s ease;
}

.primary:hover {
  opacity: 0.95;
}

.result-banner {
  margin-top: 1rem;
  border-radius: 14px;
  padding: 1rem;
  background: var(--success-bg);
  color: var(--success-text);
  font-weight: 600;
}

.result-banner p {
  margin: 0;
}

.result-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
}

.copy {
  border: 1px solid var(--card-border);
  background: #fff;
  padding: 0.6rem 1.3rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.copy:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.status {
  min-height: 1.2rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.status[data-tone="alert"] {
  color: #c62828;
  font-weight: 600;
}

.site-footer .footer-links a {
  text-decoration: none;
}

.site-footer .footer-links a:hover {
  text-decoration: underline;
}

.footer-pill {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-weight: 600;
}

.copyright {
  display: inline-block;
  margin: 0;
  margin-top: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: #c62828;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
}

.scale-info {
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--card-border);
  padding: 1.5rem;
  box-shadow: 0 12px 40px rgba(15, 33, 75, 0.05);
}

.scale-info h2 {
  margin-top: 0;
}

.info-note {
  margin: 0.4rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.info-card {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem;
  background: var(--soft-gray);
}

.info-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.info-card ul {
  margin: 0.3rem 0 0.6rem 1.2rem;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  list-style: disc;
}

.info-card p {
  margin: 0.2rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.info-note.small {
  font-size: 0.8rem;
  line-height: 1.4;
}

@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  .tab {
    font-size: 0.95rem;
  }

  .calculator-body {
    padding: 1.25rem;
  }
}
