.haptic-switch {
  display: flex;
  align-items: center;
  gap: 10px;
}
.haptic-switch input {
  accent-color: var(--accent);
}
.haptic-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.haptic-tabs button {
  font-size: 12px;
  padding: 9px 12px;
}
.haptic-tabs [aria-selected='true'] {
  background: #234039;
  border-color: var(--accent);
  color: var(--accent);
}
.haptic-effect-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding: 2px;
}
.haptic-effect-list button {
  display: flex;
  gap: 9px;
  text-align: left;
  font-size: 12px;
  padding: 10px;
  align-items: flex-start;
}
.haptic-effect-list button .mono {
  color: var(--muted);
}
.haptic-effect-list [aria-pressed='true'] {
  border-color: var(--accent);
  background: #203b35;
}
.haptic-selection {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.haptic-selection strong {
  font-weight: 500;
  font-size: 15px;
}
.haptic-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 13px 0;
}
.haptic-actions button {
  font-size: 12px;
  padding: 9px 11px;
}
.haptic-sequence-timeline {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.haptic-sequence-slot {
  padding: 10px;
  background: #234039;
  color: var(--accent);
  border-radius: 5px;
  font-size: 12px;
}
.haptic-sequence-slot.wait {
  background: #2c2d30;
  color: var(--muted);
}
.haptic-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.haptic-row > select,
.haptic-row > input {
  width: 100%;
  min-width: 0;
  padding: 9px;
  margin: 0;
  font-size: 12px;
}
.haptic-row.envelope {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}
.haptic-row.envelope label {
  margin: 0;
  font-size: 12px;
}
.haptic-row.envelope input {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  padding: 8px;
  margin-top: 6px;
}
.haptic-row .step-actions button {
  font-size: 12px;
  padding: 5px 7px;
}
.haptic-curve-wrap {
  min-width: 0;
  margin: 14px 0;
}
.haptic-curve-wrap svg {
  width: 100%;
  display: block;
  touch-action: none;
}
.haptic-curve-wrap text {
  fill: var(--muted);
  font-size: 12px;
}
.haptic-grid {
  stroke: var(--line);
  stroke-width: 1;
}
.haptic-wave {
  stroke: var(--accent);
  stroke-width: 2;
}
.haptic-drag-segment {
  cursor: ns-resize;
}
.haptic-drag-segment:hover {
  fill: #8be0d110;
}
#hapticEventRows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}
#hapticCompatibility.haptic-error {
  color: #ffb9ac;
}
.tabs {
  gap: 20px;
}
.tabs button {
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .haptic-row {
    grid-template-columns: 80px minmax(0, 1fr);
  }
  .haptic-row .step-actions {
    grid-column: 1/-1;
    justify-content: flex-end;
  }
  .haptic-row.envelope {
    grid-template-columns: 1fr 1fr;
  }
  .tabs {
    gap: 13px;
  }
}
@media (max-width: 430px) {
  .haptic-effect-list {
    grid-template-columns: 1fr;
  }
  #hapticEventRows {
    grid-template-columns: 1fr;
  }
  .haptic-tabs {
    gap: 5px;
  }
  .haptic-tabs button {
    padding: 9px;
    font-size: 12px;
  }
  .tabs {
    gap: 14px;
  }
}

.cal-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}
.cal-fields label {
  font-size: 12px;
  min-width: 0;
}
.cal-fields input:not([type='checkbox']),
.cal-fields select {
  width: 100%;
  min-width: 0;
}
.cal-status {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.8;
}
.cal-raw {
  white-space: pre-wrap;
  font-size: 11px;
  max-height: 300px;
  overflow: auto;
}
#calibrationEditor details {
  margin: 14px 0;
}
#calibrationEditor summary {
  cursor: pointer;
}
#calNotice.haptic-error {
  color: #ffb9ac;
}
@media (max-width: 430px) {
  .cal-fields {
    grid-template-columns: 1fr;
  }
}
