* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #EAECEF;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.calculator-container {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #D8D8D8;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 32px;
  max-width: 480px;
  width: 100%;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 28px;
}

h2 {
  font-size: 22px;
  font-weight: 700;
  color: #111;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 13px;
  color: #888;
}

/* Form */
.form-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

select {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid #E4E4E4;
  border-radius: 10px;
  font-size: 16px;
  color: #111;
  background: #fff 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='%23aaa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center;
  cursor: pointer;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

select:focus {
  outline: none;
  border-color: #1E3A5F;
}

/* Radio cards */
.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.radio-card {
  position: relative;
  cursor: pointer;
  display: block;
}

.radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 2px solid #E4E4E4;
  border-radius: 10px;
  transition: border-color 0.15s, background 0.15s;
}

.radio-card input:checked + .radio-content {
  border-color: #1E3A5F;
  background: #F0F4F9;
}

.radio-title {
  font-size: 14px;
  font-weight: 600;
  color: #111;
}

.radio-hint {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
}

/* Weight input */
.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 48px 14px 16px;
  border: 2px solid #E4E4E4;
  border-radius: 10px;
  font-size: 28px;
  font-weight: 700;
  color: #111;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}

.input-wrapper input::-webkit-inner-spin-button,
.input-wrapper input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.input-wrapper input:focus {
  outline: none;
  border-color: #1E3A5F;
}

.input-unit {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 600;
  color: #aaa;
  pointer-events: none;
}

/* Results */
.results {
  border-top: 2px solid #F0F0F0;
  padding-top: 24px;
}

/* Ratio bar */
.ratio-bar-wrap {
  margin-bottom: 20px;
}

.ratio-bar {
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.bar-base {
  background: #1E3A5F;
  transition: width 0.35s ease;
  height: 100%;
}

.bar-hardener {
  background: #E85D04;
  transition: width 0.35s ease;
  height: 100%;
}

.ratio-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.legend-base,
.legend-hardener {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: #555;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.legend-base .legend-dot {
  background: #1E3A5F;
}

.legend-hardener .legend-dot {
  background: #E85D04;
}

.ratio-text {
  font-size: 12px;
  color: #aaa;
}

/* Result cards */
.result-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.result-card {
  padding: 20px 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.result-card--base {
  background: #EEF2F7;
  border: 2px solid #1E3A5F;
}

.result-card--hardener {
  background: #FEF3EE;
  border: 2px solid #E85D04;
}

.result-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #888;
  margin-bottom: 4px;
}

.result-value {
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  color: #111;
  letter-spacing: -2px;
}

.result-unit {
  font-size: 13px;
  color: #999;
  margin-top: 2px;
}

/* Instructions */
.instructions {
  background: #F8F8F8;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.instructions p {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

.pot-life-note {
  color: #92400E !important;
  font-weight: 500;
}

/* Copy button */
.copy-btn {
  width: 100%;
  padding: 14px;
  background: #1E3A5F;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.copy-btn:hover {
  background: #162d4a;
}

.copy-btn:active {
  transform: scale(0.99);
}

/* Coverage calculator */
.coverage-toggle {
  background: none;
  border: none;
  padding: 6px 0 0;
  font-size: 13px;
  color: #1E3A5F;
  cursor: pointer;
  text-align: left;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.coverage-toggle:hover {
  color: #162d4a;
}

.coverage-calc {
  background: #F4F7FB;
  border: 1px solid #D0DCF0;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;
}

.coverage-result {
  background: #fff;
  border: 1px solid #D0DCF0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coverage-output {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.coverage-label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.coverage-value {
  font-size: 28px;
  font-weight: 800;
  color: #111;
  letter-spacing: -1px;
}

.coverage-unit {
  font-size: 13px;
  color: #999;
}

.coverage-note {
  font-size: 12px;
  color: #888;
  line-height: 1.4;
}

.use-coverage-btn {
  width: 100%;
  padding: 10px;
  background: #E85D04;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.use-coverage-btn:hover {
  background: #c94e02;
}

.hidden {
  display: none;
}

.credit {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: #aaa;
}

.credit a {
  color: #aaa;
  text-decoration: none;
}

.credit a:hover {
  color: #555;
}

/* Mobile */
@media (max-width: 480px) {
  .calculator-container {
    padding: 24px 18px;
  }

  h2 {
    font-size: 19px;
  }

  .result-value {
    font-size: 44px;
  }
}

/* Embed (iframe) */
body.embeddable {
  background: transparent;
  min-height: unset;
  padding: 16px;
}

.embeddable .calculator-container {
  max-width: 100%;
}
