@media (max-width: 374px) {
  .topbar-title {
    grid-column: 1 / -1;
  }

  .month-selector {
    grid-area: 2 / 1;
  }

  .status-pill {
    grid-area: 2 / 2;
    width: 74px;
    justify-content: center;
    justify-self: end;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
  }
}

.shift-depth-panel {
  margin-top: 18px;
  padding: 24px 26px;
}

.depth-heading {
  align-items: flex-start;
}

.depth-status {
  margin: 0;
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.depth-total {
  margin: 26px 0 0;
  color: #f7fbfe;
  font-family: "Oxanium", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.depth-caption,
.depth-formula,
.depth-history-note,
.depth-error {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.depth-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.depth-stat-grid > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(104, 196, 255, 0.2);
  border-radius: 12px;
  background: rgba(10, 27, 40, 0.72);
}

.depth-stat-grid span {
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.depth-stat-grid strong {
  color: #dff7ff;
  font-size: clamp(0.96rem, 3vw, 1.3rem);
  font-variant-numeric: tabular-nums;
}

.depth-formula {
  margin: 15px 0 0;
  padding-top: 13px;
  border-top: 1px solid rgba(104, 196, 255, 0.16);
}

.depth-shift-history,
.depth-event-history {
  margin-top: 20px;
}

.depth-subheading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.depth-subheading h3 {
  margin: 0;
  color: #dff7ff;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.depth-subheading span,
.depth-empty,
.depth-event-history li span {
  color: var(--muted);
  font-size: 0.68rem;
}

.depth-shift-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(104, 196, 255, 0.12);
}

.depth-shift-row strong,
.depth-shift-row small {
  display: block;
  font-variant-numeric: tabular-nums;
}

.depth-shift-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
}

.depth-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.depth-row-actions button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.68rem;
}

.depth-event-history ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.depth-event-history li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(104, 196, 255, 0.1);
}

.depth-edit-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.depth-edit-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.depth-edit-form input {
  min-height: 40px;
  min-width: 0;
  padding: 7px 8px;
}

.depth-edit-form .depth-row-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.depth-inline-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--danger, #ff8f8f);
  font-size: 0.68rem;
}

.depth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.depth-actions button {
  min-height: 44px;
}

.depth-actions button:focus-visible,
.shift-depth-panel button:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

@media (max-width: 780px) {
  .shift-depth-panel {
    margin-top: 14px;
    padding: 20px 18px;
  }

  .depth-stat-grid {
    grid-template-columns: 1fr;
  }

  .depth-shift-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .depth-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .depth-edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .shift-depth-panel *,
  .shift-depth-panel *::before,
  .shift-depth-panel *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
