html, body, main, header, footer {
  padding: 0px;
  margin: 0px;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}

#app-title {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  margin: 0 0 8px 0;
}

#app-subtitle {
  font-size: 14px;
  color: #64748b;
  text-align: center;
  margin: 0 0 24px 0;
}

.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 24px;
  margin-bottom: 20px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

#mode-label {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
}

.mode-btn {
  padding: 8px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  border-color: #93c5fd;
  color: #2563eb;
}

.mode-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.io-section {
  margin-bottom: 16px;
}

.io-section label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

.io-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.value-input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 18px;
  font-family: 'Courier New', Courier, monospace;
  color: #1e293b;
  background: #f8fafc;
  transition: border-color 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.value-input:focus {
  border-color: #2563eb;
  background: #ffffff;
}

.output-value {
  background: #eff6ff;
  color: #1e40af;
  cursor: default;
}

.unit-select {
  padding: 12px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  color: #334155;
  background: #ffffff;
  cursor: pointer;
  outline: none;
  min-width: 100px;
  transition: border-color 0.2s ease;
}

.unit-select:focus {
  border-color: #2563eb;
}

#swap-row {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

#swap-btn {
  padding: 10px 24px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#swap-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.copy-btn {
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
  line-height: 1;
}

.copy-btn:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.info-box {
  margin-top: 16px;
  padding: 12px 16px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  text-align: center;
}

#formula-text {
  font-size: 13px;
  color: #0c4a6e;
  line-height: 1.6;
}

#reference-title {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 16px 0;
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
}

#reference-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

#reference-table thead th {
  background: #f1f5f9;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #334155;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

#reference-table thead th.active-col {
  background: #dbeafe;
  color: #1e40af;
}

#reference-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #475569;
}

#reference-table tbody tr:hover {
  background: #f8fafc;
}

#reference-table tbody td:first-child {
  font-weight: 600;
  color: #1e293b;
}

#features {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 24px 16px;
}

#features h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 12px 0;
}

#features p {
  font-size: 15px;
  color: #475569;
  line-height: 1.8;
  margin: 0;
}

#scenarios {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 24px 16px;
}

#scenarios h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 12px 0;
}

#scenarios ul {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
}

#scenarios li {
  font-size: 15px;
  color: #475569;
  line-height: 1.8;
  margin-bottom: 8px;
}

#FAQ {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 24px 16px;
}

#FAQ h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 12px 0;
}

#FAQ dt {
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
  margin-top: 16px;
}

#FAQ dd {
  font-size: 14px;
  color: #64748b;
  line-height: 1.8;
  margin: 0 0 12px 0;
}

#__fork {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 16px 16px;
  text-align: center;
}

@media (max-width: 480px) {
  #app {
    padding: 16px 12px;
  }

  #app-title {
    font-size: 22px;
  }

  .card {
    padding: 16px;
  }

  .io-row {
    flex-wrap: wrap;
  }

  .value-input {
    font-size: 16px;
    padding: 10px 12px;
  }

  .unit-select {
    font-size: 14px;
    padding: 10px 8px;
    min-width: 80px;
  }

  .mode-btn {
    padding: 8px 14px;
    font-size: 13px;
    flex: 1;
    text-align: center;
  }

  .switch-row {
    gap: 8px;
  }

  #reference-table {
    font-size: 12px;
  }

  #reference-table thead th,
  #reference-table tbody td {
    padding: 8px 6px;
  }
}
