/* ============================================================
   TEMPERATURE CONVERTER — Extra CSS
   ============================================================ */

/* ===== THERMOMETER ===== */
.temp-thermometer {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 16px 24px;
  margin-bottom: 20px;
}

.temp-thermometer-track {
  width: 20px;
  height: 120px;
  background: var(--surface);
  border-radius: 999px;
  border: 2px solid var(--border);
  position: relative;
  overflow: hidden;
  flex: none;
}

.temp-thermometer-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, #e85d4a, #ffb238, #1fa97f);
  border-radius: 999px;
  transition: height 0.3s ease;
  min-height: 4px;
}

.temp-thermometer-label {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}

/* ===== INPUT GRID ===== */
.temp-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.temp-input-item {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.temp-input-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.temp-input-label .temp-unit-name {
  font-weight: 400;
  color: var(--ink-faint);
}

.temp-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.temp-input-wrap .field-input {
  flex: 1;
  font-size: 1.1rem;
  padding: .5rem .7rem;
}

.temp-copy-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s ease;
  flex: none;
}

.temp-copy-btn:hover {
  border-color: var(--coral);
  color: var(--coral);
}

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

.temp-hint {
  font-size: .65rem;
  color: var(--ink-faint);
  margin-top: 2px;
}

/* ===== CONTROLS ===== */
.temp-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.temp-control-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.temp-control-item .block-label {
  margin-bottom: 0;
  font-size: .78rem;
}

/* ===== REFERENCE TABLE ===== */
.temp-reference-table {
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 4px 0;
}

.temp-ref-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s ease;
}

.temp-ref-item:last-child {
  border-bottom: none;
}

.temp-ref-item:hover {
  background: var(--surface);
}

.temp-ref-icon {
  font-size: 1rem;
  flex: none;
}

.temp-ref-name {
  font-weight: 600;
  font-size: .82rem;
  color: var(--ink);
  min-width: 100px;
}

.temp-ref-values {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ink-soft);
}

/* ===== FORMULA CARDS ===== */
.temp-formula-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  height: 100%;
  transition: border-color .2s;
}

.temp-formula-card:hover {
  border-color: var(--coral);
}

.temp-formula-card h4 {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--coral);
}

.temp-formula {
  font-family: var(--font-mono);
  font-size: .9rem;
  font-weight: 700;
  background: var(--surface-2);
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  color: var(--ink);
  text-align: center;
}

.temp-formula-card p {
  font-size: .82rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.6;
}

/* ===== BLOCK LABEL ===== */
.block-label {
  font-weight: 700;
  font-size: .82rem;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 6px;
}

.block-label i {
  color: var(--coral);
}

/* ===== HISTORY ===== */
.history-list {
  max-height: 180px;
  overflow-y: auto;
}

.history-list .history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  gap: 12px;
}

.history-list .history-item:hover {
  background: var(--surface-2);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 8px;
}

.history-expr {
  font-size: .78rem;
  color: var(--ink-soft);
  word-break: break-all;
}

.history-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .85rem;
  white-space: nowrap;
  color: var(--coral);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767px) {
  .temp-input-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .temp-thermometer {
    padding: 12px 16px;
    gap: 14px;
  }

  .temp-thermometer-track {
    height: 80px;
    width: 16px;
  }

  .temp-thermometer-label {
    font-size: 1.1rem;
  }

  .temp-ref-item {
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 4px 10px;
  }

  .temp-ref-name {
    min-width: 70px;
    font-size: .75rem;
  }

  .temp-ref-values {
    font-size: .65rem;
  }

  .temp-formula-card {
    padding: 12px 14px;
  }

  .temp-formula {
    font-size: .78rem;
  }
}

@media (max-width: 575px) {
  .temp-thermometer {
    padding: 10px 12px;
    gap: 10px;
  }

  .temp-thermometer-track {
    height: 60px;
    width: 12px;
  }

  .temp-thermometer-label {
    font-size: .95rem;
  }

  .temp-input-wrap .field-input {
    font-size: .95rem;
    padding: .4rem .5rem;
  }

  .temp-copy-btn {
    width: 30px;
    height: 30px;
    font-size: .8rem;
  }

  .temp-ref-item {
    padding: 3px 8px;
    gap: 3px 6px;
  }

  .temp-ref-name {
    min-width: 60px;
    font-size: .68rem;
  }

  .temp-ref-values {
    font-size: .6rem;
  }

  .temp-controls {
    gap: 10px;
  }

  .temp-control-item .block-label {
    font-size: .7rem;
  }
}