.snapshots { padding: 36px 0 28px; }

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  margin-bottom: 14px;
}

h2 {
  font-size: 1.125rem;
  font-weight: 700;
}

.section-heading p {
  color: var(--muted);
  font-size: .875rem;
}

.snap-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--panel);
  overflow: hidden;
}

.snap-head,
.snap-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) minmax(330px, 2.2fr) 112px 132px 118px;
  align-items: center;
  gap: 20px;
  padding-inline: 20px;
}

.snap-head {
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .8125rem;
  font-stretch: 80%;
  font-weight: 600;
}

.snap + .snap { border-top: 1px solid var(--line); }
.snap-row { padding-block: 14px; }
.snap-bad { background: var(--bad-bg); }

.snap-when strong {
  display: block;
  font-weight: 700;
}

.snap-when span {
  color: var(--muted);
  font-size: .8125rem;
}

.tag-new {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  color: #fff !important;
  background: var(--accent);
  font-size: .75rem !important;
  font-weight: 700;
  vertical-align: 1px;
}

/* Tiga lembar: tiap lembar adalah tombol unduh berkasnya. */
.sheets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label icon" "size icon";
  align-items: center;
  column-gap: 8px;
  min-height: 48px;
  padding: 6px 10px;
  border: 1px solid rgb(23 32 58 / .28);
  border-radius: 4px;
  text-align: left;
  line-height: 1.25;
}

.sheet-1 { background: var(--sheet-1); }
.sheet-2 { background: var(--sheet-2); }
.sheet-3 { background: var(--sheet-3); }

button.sheet {
  cursor: pointer;
  transition: border-color .15s, box-shadow .2s var(--ease-out), transform .2s var(--ease-out);
}

button.sheet:hover {
  border-color: var(--ink);
  box-shadow: 0 3px 8px rgb(0 0 0 / .14);
  transform: translateY(-1px);
}

button.sheet:active {
  box-shadow: none;
  transform: none;
}

button.sheet:disabled {
  cursor: progress;
  opacity: .7;
}

.sheet-label {
  grid-area: label;
  font-size: .8125rem;
  font-stretch: 80%;
  font-weight: 600;
}

.sheet-size {
  grid-area: size;
  overflow: hidden;
  font-size: .875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet .icon {
  grid-area: icon;
  opacity: .6;
}

button.sheet:hover .icon { opacity: 1; }

.sheet-missing {
  border: 1px dashed var(--bad);
  color: var(--bad);
  background: transparent;
}

.sheet-missing .sheet-size { font-weight: 700; }

.is-first .sheet {
  animation: sheet-in .5s var(--ease-out) backwards;
  animation-delay: calc(var(--row) * 40ms + var(--n) * 55ms);
}

@keyframes sheet-in {
  from {
    transform: translateX(calc(var(--n) * -14px - 6px));
    opacity: 0;
  }
}

.snap-size { font-weight: 600; }

.size-bar {
  display: block;
  height: 4px;
  margin-top: 6px;
  border-radius: 2px;
  background: var(--line);
}

.size-bar i {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: 2px;
  background: var(--ink);
}

.snap-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ok);
  font-weight: 700;
}

.snap-bad .snap-status { color: var(--bad); }

.snap-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 36px;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}

.quiet-button:hover {
  color: var(--ink);
  background: rgb(23 32 58 / .08);
}

.quiet-button.danger:hover {
  color: var(--bad);
  background: var(--bad-bg);
}

.snap-bad .quiet-button.danger:hover { background: #fff; }
.quiet-button:disabled { cursor: progress; opacity: .6; }
.quiet-button .chevron { transition: transform .25s var(--ease-out); }
.quiet-button[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.files {
  margin: 0 20px 14px;
  border-top: 1px solid var(--line);
}

.snap-bad .files { border-color: rgb(168 42 22 / .25); }

.files li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 4px 0 4px 2px;
  border-bottom: 1px solid var(--line);
  font-size: .875rem;
}

.snap-bad .files li { border-color: rgb(168 42 22 / .25); }

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size { color: var(--muted); }

.skeleton {
  height: 77px;
  background: linear-gradient(90deg, transparent, rgb(23 32 58 / .06), transparent) 0 0 / 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton + .skeleton { border-top: 1px solid var(--line); }

@keyframes shimmer { to { background-position: -200% 0; } }

.empty-state {
  padding: 56px 24px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 1.0625rem;
}

.empty-state p {
  max-width: 52ch;
  margin-inline: auto;
  color: var(--muted);
}

@media (max-width: 1020px) {
  .snap-head { display: none; }

  .snap-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "when status"
      "sheets sheets"
      "size actions";
    gap: 12px 16px;
  }

  .snap-when { grid-area: when; }
  .sheets { grid-area: sheets; }
  .snap-status { grid-area: status; justify-self: end; }
  .snap-actions { grid-area: actions; }

  .snap-size {
    grid-area: size;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .size-bar {
    flex: 0 1 120px;
    margin-top: 0;
  }

  .quiet-button {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .snapshots { padding-top: 28px; }

  .snap-row,
  .snap-head { padding-inline: 14px; }

  .files { margin-inline: 14px; }
  .sheets { gap: 6px; }

  .sheet {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "label" "size";
    padding-inline: 8px;
  }

  .sheet .icon { display: none; }
}
