body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(13, 110, 253, 0.08), transparent 22rem),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.emoji-input {
  cursor: pointer;
  background-color: #fff;
}

emoji-picker {
  width: 100%;
  height: min(60vh, 30rem);
}

.timeline-list {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  padding: 1rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.metric-card {
  min-height: 100%;
  border-radius: 1.25rem;
}

.metric-value {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1;
  margin-top: 0.35rem;
}

.metric-value-battery-good {
  color: #15803d;
}

.metric-value-battery-warn {
  color: #c2410c;
}

.metric-value-battery-low {
  color: #b91c1c;
}

.card {
  border-radius: 1.25rem;
}

.list-group-item {
  background: transparent;
}

.timeline-filter-form {
  width: min(100%, 18rem);
}

.timeline-board {
  display: grid;
  gap: 1rem;
}

.timeline-event {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  align-items: start;
}

.timeline-axis {
  position: relative;
  text-align: right;
  padding-right: 1rem;
}

.timeline-axis::after {
  content: "";
  position: absolute;
  top: 2.5rem;
  right: 1rem;
  bottom: -1.5rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(13, 110, 253, 0.25), rgba(13, 110, 253, 0.05));
}

.timeline-event:last-child .timeline-axis::after {
  display: none;
}

.timeline-day {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.4rem;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%);
  border: 1px solid rgba(13, 110, 253, 0.16);
  box-shadow: 0 0.5rem 1rem rgba(15, 23, 42, 0.08);
  font-size: 1.2rem;
}

.timeline-content {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  box-shadow: 0 0.6rem 1.4rem rgba(15, 23, 42, 0.05);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.timeline-time {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.timeline-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0b5ed7;
  background: rgba(13, 110, 253, 0.1);
}

.timeline-badge-soft {
  color: #475569;
  background: rgba(100, 116, 139, 0.12);
}

.timeline-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.timeline-subtitle {
  margin-top: 0.25rem;
  font-size: 0.88rem;
  color: #64748b;
}

.mapping-layout {
  display: block;
}

.mapping-device-shell {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.24), transparent 22%),
    linear-gradient(180deg, #1a86ff 0%, #0c68d9 100%);
  border-radius: 2rem;
  padding: 1.5rem;
  box-shadow: 0 22px 40px rgba(12, 104, 217, 0.2);
}

.mapping-device-header {
  color: #fff;
  margin-bottom: 1.25rem;
}

.mapping-device-header .text-secondary {
  color: rgba(255, 255, 255, 0.82) !important;
}

.mapping-device-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
}

.mapping-device-slot {
  min-width: 0;
}

.mapping-button-indicator {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.5rem;
  padding-left: 0.15rem;
}

.mapping-button-dot {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  background: #09121e;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12), 0 2px 4px rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
}

.mapping-button-number {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f5fbff;
  letter-spacing: 0.02em;
}

.mapping-button-card {
  position: relative;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(9, 18, 30, 0.08);
  border-radius: 1.2rem;
  padding: 0.95rem 0.85rem 0.8rem;
  min-height: 14.75rem;
  box-shadow: 0 10px 22px rgba(9, 18, 30, 0.12);
}

.mapping-button-card::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 0.7rem;
  height: 0.22rem;
  border-radius: 999px;
  background: rgba(12, 104, 217, 0.14);
}

.mapping-button-form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mapping-save-button {
  border: 0;
  color: #0f172a;
  background: linear-gradient(180deg, #fff7d6 0%, #ffe08a 100%);
  box-shadow: 0 10px 22px rgba(9, 18, 30, 0.16);
  font-weight: 700;
}

.mapping-save-button:hover,
.mapping-save-button:focus {
  color: #0f172a;
  background: linear-gradient(180deg, #fff2bd 0%, #ffd965 100%);
}

@media (max-width: 767.98px) {
  .navbar .container,
  main.container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .dashboard-metrics .card-body {
    padding: 1rem;
  }

  .table-responsive {
    border-radius: 1rem;
  }

  .timeline-event {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .timeline-axis {
    text-align: left;
    padding-right: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .timeline-axis::after {
    display: none;
  }

  .timeline-day {
    margin-bottom: 0;
  }

  .timeline-filter-form {
    width: 100%;
  }

  .mapping-device-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }

  .mapping-device-shell {
    padding: 1rem;
    border-radius: 1.5rem;
  }

  .mapping-button-card {
    min-height: 13.5rem;
    padding: 0.82rem 0.72rem 0.72rem;
  }

  .mapping-button-number {
    font-size: 0.76rem;
  }
}
