.bpm-root {
  --bpm-primary: #4f46e5;
  --bpm-primary-hover: #4338ca;
  --bpm-primary-shadow: rgba(79, 70, 229, 0.25);
  --bpm-primary-shadow-hover: rgba(79, 70, 229, 0.3);
  --bpm-primary-shadow-hover-card: rgba(79, 70, 229, 0.08);
  --bpm-tap-active: #ec4899;
  --bpm-value: #059669;
  --bpm-success: #10b981;
  --bpm-bg: rgba(255, 255, 255, 0.7);
  --bpm-bg-card: #fff;
  --bpm-bg-input: #f8fafc;
  --bpm-bg-hover: #f1f5f9;
  --bpm-border: rgba(226, 232, 240, 0.8);
  --bpm-border-card: #e2e8f0;
  --bpm-border-th: #f1f5f9;
  --bpm-border-td: #f8fafc;
  --bpm-text: #1e293b;
  --bpm-text-muted: #64748b;
  --bpm-text-title: #475569;
  --bpm-text-note: #334155;
  --bpm-text-th: #94a3b8;
  --bpm-shadow: rgba(0, 0, 0, 0.05);
  --bpm-shadow-card: rgba(0, 0, 0, 0.02);
  --bpm-icon-color: #4f46e5;

  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--bpm-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  border: 1px solid var(--bpm-border);
  color: var(--bpm-text);
  max-width: 1100px;
  margin: 1rem auto;
  box-shadow:
    0 10px 40px var(--bpm-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.theme-dark .bpm-root {
  --bpm-primary: #818cf8;
  --bpm-primary-hover: #6366f1;
  --bpm-primary-shadow: rgba(99, 102, 241, 0.35);
  --bpm-primary-shadow-hover: rgba(99, 102, 241, 0.45);
  --bpm-primary-shadow-hover-card: rgba(99, 102, 241, 0.12);
  --bpm-tap-active: #f472b6;
  --bpm-value: #34d399;
  --bpm-success: #34d399;
  --bpm-bg: rgba(15, 23, 42, 0.8);
  --bpm-bg-card: #1e293b;
  --bpm-bg-input: #0f172a;
  --bpm-bg-hover: #334155;
  --bpm-border: rgba(255, 255, 255, 0.05);
  --bpm-border-card: rgba(255, 255, 255, 0.06);
  --bpm-border-th: rgba(255, 255, 255, 0.04);
  --bpm-border-td: rgba(255, 255, 255, 0.03);
  --bpm-text: #f1f5f9;
  --bpm-text-muted: #94a3b8;
  --bpm-text-title: #cbd5e1;
  --bpm-text-note: #cbd5e1;
  --bpm-text-th: #64748b;
  --bpm-shadow: rgba(0, 0, 0, 0.3);
  --bpm-shadow-card: rgba(0, 0, 0, 0.2);
  --bpm-icon-color: #818cf8;
}

.bpm-header {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: var(--bpm-bg-card);
  border-radius: 20px;
  border: 1px solid var(--bpm-border-card);
  box-shadow: 0 4px 12px var(--bpm-shadow-card);
}

.bpm-field {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.bpm-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--bpm-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bpm-input {
  width: 140px;
  padding: 0.5rem 1rem;
  font-size: 2.25rem;
  font-weight: 800;
  text-align: center;
  background: var(--bpm-bg-input);
  border: 2px solid var(--bpm-border-card);
  border-radius: 12px;
  color: var(--bpm-text);
  transition: all 0.3s ease;
}

.bpm-input:focus {
  outline: none;
  border-color: var(--bpm-primary);
  background: var(--bpm-bg-card);
  box-shadow: 0 0 0 4px var(--bpm-primary-shadow);
}

.bpm-tap-btn {
  height: 56px;
  min-width: 180px;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bpm-primary);
  border: none;
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px var(--bpm-primary-shadow);
}

.bpm-tap-btn svg {
  width: 20px;
  height: 20px;
}

.bpm-tap-btn:hover {
  background: var(--bpm-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--bpm-primary-shadow-hover);
}

.bpm-tap-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px var(--bpm-primary-shadow);
}

.bpm-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.bpm-card {
  background: var(--bpm-bg-card);
  border-radius: 20px;
  padding: 1.5rem;
  border: 1px solid var(--bpm-border-card);
  box-shadow: 0 2px 8px var(--bpm-shadow-card);
}

.bpm-card-title {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--bpm-text-title);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bpm-card-title svg {
  color: var(--bpm-icon-color);
  width: 18px;
  height: 18px;
}

.bpm-table {
  width: 100%;
  border-collapse: collapse;
}

.bpm-th {
  text-align: left;
  padding: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--bpm-text-th);
  text-transform: uppercase;
  border-bottom: 1px solid var(--bpm-border-th);
}

.bpm-extra-card {
  grid-column: 1 / -1;
  background: linear-gradient(to right, #f8faff, #fff9fc);
}

.theme-dark .bpm-extra-card {
  background: linear-gradient(to right, rgba(79, 70, 229, 0.05), rgba(236, 72, 153, 0.05));
}

.bpm-predelay-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.bpm-info {
  font-size: 0.85rem;
  color: var(--bpm-text-muted);
  margin-top: 0.5rem;
}

@media (max-width: 1024px) {
  .bpm-sections {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .bpm-root {
    padding: 1rem;
  }

  .bpm-header {
    flex-direction: column;
    padding: 1rem;
  }

  .bpm-sections,
  .bpm-predelay-grid {
    grid-template-columns: 1fr;
  }

  .bpm-field {
    width: 100%;
    justify-content: center;
  }

  .bpm-tap-btn {
    width: 100%;
  }
}

@keyframes bpm-tap-pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.95);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes bpm-fade-up {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.bpm-tap-btn.bpm-tap-active {
  background: var(--bpm-tap-active, #ec4899);
  animation: bpm-tap-pulse 0.15s ease-out;
}

.bpm-row {
  border-bottom: 1px solid var(--bpm-border-td, #f8fafc);
}

.bpm-td {
  padding: 0.75rem 0.5rem;
}

.bpm-note-name {
  font-size: 0.85rem;
  color: var(--bpm-text-note, #334155);
  font-weight: 500;
}

.bpm-ms-value {
  color: var(--bpm-value, #059669);
  font-weight: 700;
  font-size: 0.95rem;
}

.bpm-hz-value {
  color: var(--bpm-text-th, #94a3b8);
  font-size: 0.75rem;
}

.bpm-copy {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 0.4rem;
  color: var(--bpm-border-card, #cbd5e1);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  position: relative;
}

.bpm-copy:hover {
  background: var(--bpm-bg-hover, #f1f5f9);
  color: var(--bpm-primary, #4f46e5);
}

.bpm-copy.bpm-copy-success {
  color: var(--bpm-success, #10b981);
}

.bpm-copy.bpm-copy-success::after {
  content: attr(data-copy-feedback);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bpm-success, #10b981);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
  animation: bpm-fade-up 0.3s ease-out;
}

.bpm-predelay-card {
  background: var(--bpm-bg-card, #fff);
  padding: 1.25rem;
  border-radius: 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--bpm-border-card, #e2e8f0);
  transition: all 0.2s;
}

.bpm-predelay-card:hover {
  border-color: var(--bpm-primary, #4f46e5);
  box-shadow: 0 4px 12px var(--bpm-primary-shadow-hover-card, rgba(79, 70, 229, 0.08));
}

.bpm-predelay-info {
  display: flex;
  flex-direction: column;
}

.bpm-predelay-type {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--bpm-text-muted, #64748b);
  text-transform: uppercase;
}

.bpm-predelay-ms {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--bpm-value, #059669);
}
