/* Git SHA / GitHub commit history sheet */

.bn-release-root {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.bn-release-root[hidden] {
  display: none !important;
}

.bn-release-backdrop {
  position: absolute;
  inset: 0;
  background: var(--bn-bg-overlay, rgba(15, 23, 42, 0.55));
}

.bn-release-sheet {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(88dvh, 100%);
  display: flex;
  flex-direction: column;
  background: var(--bn-surface-elevated, var(--bn-bg-surface, #fff));
  color: var(--bn-text-primary, #111827);
  border: 1px solid var(--bn-border-default, rgba(16, 24, 40, 0.1));
  border-radius: 20px 20px 0 0;
  box-shadow: var(--bn-shadow-overlay, 0 -16px 48px rgba(0, 0, 0, 0.22));
}

.bn-release-sheet::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: var(--bn-border-strong, #9ca3af);
  opacity: 0.55;
}

.bn-release-sheet__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px 10px;
}

.bn-release-sheet__kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ED3023;
}

.bn-release-sheet__title {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.bn-release-sheet__meta {
  margin: 4px 0 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--bn-text-muted, #667085);
  line-height: 1.4;
}

.bn-release-sheet__close {
  appearance: none;
  border: 0;
  background: var(--bn-surface-secondary, rgba(16, 24, 40, 0.06));
  color: var(--bn-text-secondary, #475467);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.bn-release-sheet__tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 0 18px 12px;
  align-items: end;
}

.bn-release-sheet__year-wrap {
  display: grid;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bn-text-muted, #667085);
}

.bn-release-sheet__year-wrap .bn-select-wrap {
  min-width: 7.5rem;
  width: 8.75rem;
}

.bn-release-sheet__year-wrap .bn-select-trigger {
  min-height: 42px;
  border-radius: 12px;
}

.bn-release-sheet__search {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--bn-border-default, #e5e7eb);
  border-radius: 12px;
  background: var(--bn-surface-secondary, #f8fafc);
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
}

.bn-release-sheet__search:focus {
  outline: 2px solid rgba(237, 48, 35, 0.35);
  border-color: #ED3023;
}

.bn-release-sheet__body {
  overflow: auto;
  padding: 0 18px 8px;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.bn-release-sheet__summary {
  margin: 0 0 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--bn-text-secondary, #475467);
}

.bn-release-commit {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--bn-border-muted, #f1f5f9);
}

.bn-release-commit__head {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bn-release-commit__badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #039855;
}

.bn-release-commit__meta {
  margin: 3px 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--bn-text-muted, #667085);
}

.bn-release-commit__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bn-release-commit__more {
  appearance: none;
  border: 0;
  background: transparent;
  color: #ED3023;
  min-height: 28px;
  padding: 0 8px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.bn-release-charts {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--bn-border-default, #e5e7eb);
  border-radius: 14px;
  background: var(--bn-surface-secondary, #f8fafc);
}

.bn-release-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.bn-release-kpi {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(237, 48, 35, 0.08);
  color: var(--bn-text-secondary, #475467);
  font-size: 0.72rem;
  font-weight: 700;
}

.bn-release-chart + .bn-release-chart {
  margin-top: 12px;
}

.bn-release-chart__title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bn-text-muted, #667085);
}

.bn-release-chart__bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 72px;
}

.bn-release-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.bn-release-bar__fill {
  width: 100%;
  max-width: 18px;
  border-radius: 5px 5px 2px 2px;
  background: #ED3023;
  opacity: 0.85;
}

.bn-release-bar__label {
  margin-top: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--bn-text-muted, #667085);
}

.bn-release-detail {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--bn-border-default, #e5e7eb);
}

.bn-release-detail__body {
  margin: 0 0 6px;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.bn-release-detail__meta,
.bn-release-detail__stats {
  margin: 0 0 6px;
  font-size: 0.75rem;
  color: var(--bn-text-muted, #667085);
}

.bn-release-files {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bn-release-files li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 3px 0;
  font-size: 0.72rem;
}

.bn-release-files__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.is-add { color: #039855; font-weight: 700; }
.is-del { color: #ed3023; font-weight: 700; }

.bn-release-commit.is-current {
  background: linear-gradient(90deg, rgba(237, 48, 35, 0.06), transparent 70%);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 12px;
}

.bn-release-commit.is-current .bn-release-commit__sha {
  color: #ED3023;
}

.bn-release-commit__avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--bn-surface-secondary, #e5e7eb);
}

.bn-release-commit__avatar--empty {
  display: inline-block;
}

.bn-release-commit__sha {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  font-weight: 750;
  color: var(--bn-text-primary, #111827);
  text-decoration: none;
}

.bn-release-commit__sha:hover {
  text-decoration: underline;
}

.bn-release-commit__date {
  font-size: 0.75rem;
  color: var(--bn-text-muted, #667085);
  white-space: nowrap;
}

.bn-release-commit__subject {
  margin: 4px 0 0;
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 500;
}

.bn-release-commit__author {
  margin: 3px 0 0;
  font-size: 0.75rem;
  color: var(--bn-text-muted, #667085);
}

.bn-release-commit__copy {
  appearance: none;
  border: 0;
  background: var(--bn-surface-secondary, rgba(16, 24, 40, 0.06));
  color: var(--bn-text-secondary, #475467);
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.bn-release-sentinel {
  min-height: 8px;
  margin: 0;
  padding: 14px 0 18px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bn-text-muted, #667085);
}

.bn-release-sheet__footer {
  display: flex;
  gap: 8px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--bn-border-muted, #f1f5f9);
}

.bn-release-sheet__footer button {
  appearance: none;
  border: 0;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.bn-release-sheet__history {
  flex: 1;
  background: var(--bn-surface-secondary, rgba(16, 24, 40, 0.06));
  color: var(--bn-text-secondary, #475467);
}

.bn-release-sheet__history[hidden] {
  display: none !important;
}

.bn-release-sheet__history:disabled {
  opacity: 0.55;
  cursor: wait;
}

.bn-release-sheet__done {
  flex: 1;
  background: #ED3023;
  color: #fff;
}

html.dark-mode .bn-release-sheet,
html[data-theme="dark"] .bn-release-sheet {
  background: var(--bn-bg-surface-raised, #161e2e);
  border-color: var(--bn-border-default, #2b384d);
}

html.dark-mode .bn-release-sheet__search,
html[data-theme="dark"] .bn-release-sheet__search,
html.dark-mode .bn-release-charts,
html[data-theme="dark"] .bn-release-charts {
  background: var(--bn-bg-surface-muted, #1a2233);
  border-color: var(--bn-border-default, #2b384d);
}

@media (max-width: 420px) {
  .bn-release-sheet__tools {
    grid-template-columns: 1fr;
  }

  .bn-release-sheet__year-wrap .bn-select-wrap {
    min-width: 0;
    width: 100%;
  }
}

@media (min-width: 768px) {
  .bn-release-root {
    align-items: center;
    padding: 24px;
  }

  .bn-release-sheet {
    border-radius: 18px;
    max-height: min(84vh, 820px);
  }

  .bn-release-sheet::before {
    display: none;
  }
}
