:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --result: #374151;
  --result-light: #f9fafb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #f8fafc, #eef2f7);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  background: rgba(255,255,255,0.9);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
}

.logo span {
  color: var(--primary);
}

.language-switcher {
  display: flex;
  gap: 8px;
}

.language-switcher button {
  padding: 8px 11px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.language-switcher button.active {
  background: var(--primary);
  color: white;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 38px 20px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.badge {
  display: inline-block;
  padding: 8px 12px;
  background: #eef2ff;
  color: var(--primary-dark);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

h1 {
  font-size: 46px;
  margin: 16px 0 10px;
}

.subtitle {
  color: var(--muted);
  font-size: 18px;
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.5;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.card h2 {
  margin-top: 0;
}

label {
  display: block;
  font-weight: 700;
  margin: 18px 0 8px;
}

.input-unit {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--result-light);
  overflow: hidden;
}

.input-unit input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 15px;
  font-size: 16px;
  outline: none;
}

.input-unit span {
  padding: 0 14px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.result-box {
  margin-top: 24px;
  background: var(--result);
  color: white;
  padding: 20px;
  border-radius: 18px;
}

.result-title {
  margin: 0 0 8px;
  opacity: 0.8;
  font-size: 14px;
  font-weight: 700;
}

.result-text {
  white-space: pre-line;
  line-height: 1.7;
  font-size: 18px;
  font-weight: 700;
}

.copy-btn {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  border: 0;
  border-radius: 14px;
  background: white;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.copy-btn:hover {
  background: #f3f4f6;
  color: var(--text);
}

.small-text,
.hint {
  color: var(--muted);
  line-height: 1.5;
}

.hint {
  font-size: 13px;
}

.device-list {
  display: grid;
  gap: 10px;
}

.device {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #f9fafb;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  line-height: 1.35;
}

.device:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.info-card {
  margin-top: 22px;
}

.info-card p {
  color: var(--muted);
  line-height: 1.6;
}

.formula-box {
  margin-top: 16px;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 16px;
  line-height: 1.6;
}

.formula-box strong,
.formula-box span {
  display: block;
}

.footer {
  text-align: center;
  color: var(--muted);
  padding: 25px 20px 40px;
}

/* Mobile */
@media (max-width: 760px) {
  .topbar {
    padding: 14px 16px;
    flex-wrap: wrap;
  }

  .logo {
    font-size: 21px;
  }

  .language-switcher button {
    padding: 7px 9px;
  }

  .container {
    padding: 26px 14px;
  }

  h1 {
    font-size: 34px;
  }

  .subtitle {
    font-size: 16px;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 20px;
    border-radius: 20px;
  }

  .result-text {
    font-size: 16px;
  }
}