/* ═══════════════════════════════════════════════════════════════
   Analog Rechner — Tool Styles
   ═══════════════════════════════════════════════════════════════ */

.ar-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.ar-card-header {
  background: #F8FAFC;
  border-bottom: 1px solid var(--card-border);
  padding: 11px 18px;
  font-size: 12px; font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.7px;
}
.ar-card-body { padding: 18px; }

/* ── Form fields ─────────────────────────────────────────────── */
.ar-field { margin-bottom: 14px; }
.ar-field:last-child { margin-bottom: 0; }
.ar-label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text-secondary); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.ar-select, .ar-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 14px; color: var(--text-primary);
  background: #FAFBFC;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  font-family: inherit;
}
.ar-select:focus, .ar-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
  background: #fff;
}

/* Custom raw section */
.ar-custom-section {
  background: #FFFBEB;
  border: 1px dashed #FCD34D;
  border-radius: 8px;
  padding: 14px; margin-top: 4px;
}
.ar-custom-section .ar-label { color: #92400E; }
.ar-custom-section .ar-input { border-color: #FCD34D; background: #fff; }

/* ── Raw value + Slider ──────────────────────────────────────── */
.ar-input-large {
  font-size: 22px; font-weight: 700;
  text-align: center; padding: 10px 12px;
}
.ar-raw-row { display: flex; align-items: center; gap: 12px; }
.ar-raw-row .ar-input { flex: 1; }
.ar-raw-range { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.ar-slider {
  -webkit-appearance: none;
  width: 100%; height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) 50%, #E2E8F0 50%);
  outline: none; cursor: pointer;
}
.ar-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25); cursor: pointer;
}
.ar-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25); cursor: pointer;
}
.ar-slider-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted); margin-top: 4px;
}

/* ── Unit chips ──────────────────────────────────────────────── */
.ar-unit-row { display: flex; flex-direction: column; gap: 8px; }
.ar-unit-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ar-chip {
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--card-border);
  background: #F8FAFC; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.12s; font-family: inherit;
}
.ar-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.ar-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Result card ─────────────────────────────────────────────── */
.ar-result-card {
  background: linear-gradient(135deg, #1565C0 0%, #1976D2 100%);
  border-radius: var(--card-radius);
  padding: 28px 24px; color: #fff;
  box-shadow: 0 4px 16px rgba(21,101,192,0.28);
  transition: background 0.25s;
}
.ar-result-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; opacity: 0.75; margin-bottom: 8px;
}
.ar-result-value {
  font-size: 2.8rem; font-weight: 800; line-height: 1; margin-bottom: 16px;
}
.ar-result-unit { font-size: 1.5rem; font-weight: 500; opacity: 0.8; margin-left: 6px; }

.ar-result-status {
  display: inline-flex; align-items: center;
  padding: 5px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 700;
  background: rgba(255,255,255,0.2);
}
.ar-result-status.status-ok    { background: rgba(76,175,80,0.35); }
.ar-result-status.status-over  { background: rgba(255,152,0,0.35); }
.ar-result-status.status-under { background: rgba(244,67,54,0.35); }

/* ── Detail cards ────────────────────────────────────────────── */
.ar-detail-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px; padding: 14px 16px;
  box-shadow: var(--card-shadow);
}
.ar-detail-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 6px;
}
.ar-detail-value { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.ar-detail-small { font-size: 15px; }

/* ── Progress bar ────────────────────────────────────────────── */
.ar-progress-wrap { padding: 4px 0; }
.ar-progress-bar-bg {
  position: relative; height: 18px; border-radius: 9px;
  background: #E2E8F0; overflow: visible; margin-bottom: 8px;
}
.ar-progress-bar-fill {
  height: 100%; border-radius: 9px;
  background: linear-gradient(90deg, #1565C0, #42A5F5);
  transition: width 0.22s ease;
  min-width: 0; max-width: 100%;
}
.ar-progress-bar-marker {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px;
  background: #fff; border: 3px solid #1565C0;
  border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: left 0.22s ease;
}
.ar-progress-labels {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-muted);
}
.ar-progress-mid { color: var(--accent); font-weight: 600; }

/* ── Bidirectional input blocks ──────────────────────────────── */
.ar-input-block {
  padding: 12px 14px;
  border: 2px solid var(--card-border);
  border-radius: 10px;
  background: #FAFBFC;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.ar-input-block.is-driving {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}
.ar-input-block-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.ar-input-block-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-secondary);
}
.ar-input-block .ar-input-large {
  background: transparent; border: 1px solid var(--card-border);
}
.ar-input-block.is-driving .ar-input-large {
  background: #fff; border-color: var(--accent);
}

/* OR Divider */
.ar-or-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0;
}
.ar-or-divider span {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted);
  white-space: nowrap;
}
.ar-or-divider::before, .ar-or-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--card-border);
}

/* Signal badge */
.ar-sig-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  background: var(--accent-light); color: var(--accent);
  padding: 2px 8px; border-radius: 20px; letter-spacing: 0.3px;
}

/* ── Kennlinie chart ─────────────────────────────────────────── */
.ar-chart-body { padding: 0; }
#arChart { display: block; width: 100%; border-radius: 0 0 var(--card-radius) var(--card-radius); }

/* ── Formula ─────────────────────────────────────────────────── */
.ar-formula {
  background: #F8FAFC;
  border: 1px solid var(--card-border);
  border-radius: 8px; padding: 12px 16px;
  font-size: 13.5px; color: var(--text-secondary);
  line-height: 1.6;
}
.ar-formula-values { color: var(--accent); font-weight: 600; word-break: break-all; }
