/* One Rep Max Calculator */

/* ---- Settings Row ---- */
.orm-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
  align-items: flex-end;
}

.orm-settings .setting-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.orm-settings .setting-group > label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

/* ---- Unit Toggle ---- */
.orm-settings .unit-toggle {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.orm-settings .unit-btn {
  padding: 10px 20px;
  border: none;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.orm-settings .unit-btn:not(:last-child) {
  border-right: 1px solid var(--color-border);
}

.orm-settings .unit-btn:hover {
  background: var(--color-surface-hover);
}

.orm-settings .unit-btn.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

/* ---- Form Layout ---- */
.orm-form {
  margin-bottom: 24px;
}

.orm-inputs {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.orm-inputs .input-group {
  flex: 1;
  min-width: 160px;
}

.orm-inputs input[type="number"] {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -moz-appearance: textfield;
}

.orm-inputs input[type="number"]:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.orm-inputs input[type="number"]::-webkit-inner-spin-button,
.orm-inputs input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.orm-calc-btn {
  width: auto;
}

/* ---- Results ---- */
.orm-results {
  display: none;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-light);
}

.orm-results.visible {
  display: block;
}

/* ---- 1RM Value Card ---- */
.orm-value-card {
  text-align: center;
  padding: 28px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.orm-number {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-primary);
}

.orm-unit-label {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-left: 4px;
}

.orm-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.orm-sublabel {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 6px;
}

/* ---- Section Headings ---- */
.orm-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}

/* ---- Formula Comparison Table ---- */
.orm-formula-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 28px;
  font-size: 0.92rem;
}

.orm-formula-table th,
.orm-formula-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.orm-formula-table th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
}

.orm-formula-table tbody tr:nth-child(even) {
  background: var(--color-surface);
}

.orm-formula-table tbody tr:hover {
  background: var(--color-surface-hover);
}

.orm-formula-name {
  font-weight: 600;
  color: var(--color-text);
}

.orm-formula-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-text);
}

.orm-formula-diff {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

/* ---- Percentage Chart Table ---- */
.orm-pct-chart {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.orm-pct-chart th,
.orm-pct-chart td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.orm-pct-chart th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
}

.orm-pct-chart tbody tr:nth-child(even) {
  background: var(--color-surface);
}

.orm-pct-chart tbody tr:hover {
  background: var(--color-surface-hover);
}

.orm-pct-chart .pct-col {
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.orm-pct-chart .weight-col {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-text);
}

.orm-pct-chart .reps-col {
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* Highlight the 1RM row */
.orm-pct-chart tbody tr:first-child {
  background: var(--color-primary-light);
}

.orm-pct-chart tbody tr:first-child .pct-col,
.orm-pct-chart tbody tr:first-child .weight-col {
  color: var(--color-primary);
}

/* ---- Chart Note ---- */
.orm-chart-note {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-top: 4px;
  margin-bottom: 0;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .orm-settings {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .unit-toggle {
    width: 100%;
  }

  .unit-btn {
    flex: 1;
    text-align: center;
  }

  .orm-inputs {
    flex-direction: column;
  }

  .orm-inputs .input-group {
    min-width: 0;
  }

  .orm-number {
    font-size: 2.4rem;
  }

  .orm-formula-table,
  .orm-pct-chart {
    font-size: 0.84rem;
  }

  .orm-formula-table th,
  .orm-formula-table td,
  .orm-pct-chart th,
  .orm-pct-chart td {
    padding: 8px 10px;
  }
}