.battery-archive {
  --archive-muted: var(--muted-ink, #4f6458);
  --archive-line: #cedfd3;
  --archive-accent: var(--brand, #18583f);
  max-width: 760px;
  margin-inline: auto;
}

.battery-archive h1 {
  font-size: 29px;
  letter-spacing: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.archive-title,
.archive-detail-nav,
.archive-section-head,
.archive-latest-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.archive-title { margin-bottom: 14px; }

.archive-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 550;
  color: var(--archive-accent);
  white-space: nowrap;
}

.archive-inline-link svg { width: 16px; height: 16px; }

.archive-search {
  display: flex;
  position: relative;
  align-items: center;
  margin-bottom: 23px;
  color: var(--archive-muted);
}

.archive-search > svg {
  position: absolute;
  left: 14px;
  pointer-events: none;
}

.archive-search input {
  min-height: 49px;
  padding: 10px 48px 10px 43px;
  border: 1px solid #cedfd3;
  border-radius: 13px;
  background: #fff;
  font-size: 16px;
}

.archive-search input::placeholder { color: var(--archive-muted); }
.archive-search input::-webkit-search-cancel-button { display: none; }

.archive-search button {
  position: absolute;
  right: 3px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--archive-muted);
}

.archive-search button svg { width: 16px; height: 16px; }

.archive-search-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.archive-section + .archive-section { margin-top: 23px; }
.archive-section-head { margin: 0 1px 9px; }

.archive-section-head h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.archive-section-head > span,
.archive-meta,
.archive-detail-note {
  font-size: 13px;
  color: var(--archive-muted);
  line-height: 1.5;
}

.archive-surface,
.archive-empty {
  border: 1px solid var(--archive-line);
  border-radius: 16px;
  background: white;
}

.archive-surface {
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-surface > li + li { border-top: 1px solid var(--archive-line); }

.archive-battery-row,
.archive-history-row {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 15px 12px;
  min-height: 76px;
}

.archive-battery-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.archive-battery-row:hover,
.archive-history-row:hover { background: var(--surface-muted, #eff5f0); }
.archive-surface > li:first-child > :is(.archive-battery-row,.archive-history-row) { border-radius: 15px 15px 0 0; }
.archive-surface > li:last-child > :is(.archive-battery-row,.archive-history-row) { border-radius: 0 0 15px 15px; }
.archive-surface > li:only-child > :is(.archive-battery-row,.archive-history-row) { border-radius: 15px; }

.archive-glyph {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  border-radius: 11px;
  background: var(--surface-muted, #eff5f0);
  color: var(--brand, #18583f);
  flex: none;
}

.archive-source-synthetic .archive-glyph { background: #f0edf8; color: #635080; }

.archive-battery-text,
.archive-history-text {
  display: grid;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.archive-battery-text strong {
  font-size: 16px;
  font-weight: 650;
}

.archive-pack-id {
  font-size: 13px;
  color: var(--archive-muted);
}

.archive-row-side {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.archive-row-link {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--archive-accent);
  font-size: 13px;
  white-space: nowrap;
}

.archive-row-link svg { width: 13px; height: 13px; }

.archive-status {
  justify-self: end;
  border-radius: 6px;
  padding: 3px 7px;
  color: #465669;
  background: #edf1f5;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.archive-status.pending { color: #785216; background: #faf0da; }
.archive-status.active { color: var(--brand, #18583f); background: var(--surface-muted, #eff5f0); }
.archive-status.reviewed { color: #346253; background: #e8f3ed; }

.archive-empty { padding: 24px 18px 16px; }
.archive-empty strong { font-size: 16px; }
.archive-empty p { margin-top: 5px; color: var(--archive-muted); font-size: 14px; }

.archive-detail-nav { margin: -5px 0 14px; }

.archive-identity {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 23px;
}

.archive-identity .archive-glyph { width: 44px; height: 46px; }
.archive-identity h1 { font-size: 24px; }
.archive-detail-note { margin-top: 5px; overflow-wrap: anywhere; }

.archive-latest {
  padding: 16px 14px;
  border-radius: 15px 15px 0 0;
  background: var(--surface-muted, #eff5f0);
}

.archive-latest:only-child { border-radius: 15px; }
.archive-latest-head { margin-bottom: 4px; }
.archive-latest-head h3 { font-size: 16px; }

.archive-goal {
  margin: 10px 0 16px;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.archive-main-action {
  display: flex;
  min-height: 44px;
  width: 100%;
  background: var(--archive-accent);
}

.archive-main-action:hover { background: var(--brand-strong, #104833); }
.archive-main-action svg { width: 16px; height: 16px; }

.archive-history-row { grid-template-columns: minmax(0, 1fr) auto 13px; }
.archive-history-row > svg { width: 13px; height: 13px; color: var(--archive-muted); }
.archive-history-text strong { font-size: 14px; }

.archive-history-text > span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 13px;
  color: var(--archive-muted);
}

@media (min-width: 651px) {
  .battery-archive h1 { font-size: 36px; }
  .archive-title { margin-bottom: 20px; }
  .archive-section-head { margin-bottom: 12px; }
  .archive-search { margin-bottom: 28px; }
  .archive-battery-row,
  .archive-history-row { padding: 16px 21px; gap: 14px; }
  .archive-latest { padding: 20px 21px; }
  .archive-main-action { display: inline-flex; width: auto; }
  .archive-identity h1 { font-size: 30px; }
}
