:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-2: #e9eee7;
  --text: #17201a;
  --muted: #647067;
  --border: #d5ded4;
  --green: #178b57;
  --green-soft: #dff3e8;
  --gold: #e0ad21;
  --gold-soft: #fff1c7;
  --red: #c94a3b;
  --red-soft: #ffe2dd;
  --blue: #246fa8;
  --shadow: 0 12px 40px rgba(21, 36, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.topbar,
.summary,
.toolbar,
.status-line {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 16px;
}

.eyebrow,
.muted,
.stat p,
.hint,
.status-line,
.detail-code,
.stepper p {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

#lockButton {
  border-color: var(--red);
  background: var(--red-soft);
}

#lockButton.unlocked {
  border-color: var(--green);
  background: var(--green-soft);
}

.summary {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(110px, 160px));
  margin-bottom: 16px;
}

.progress-block,
.stat,
.toolbar,
.status-line,
.dialog-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.progress-block {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.progress-block strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.progress-ring {
  position: relative;
  display: grid;
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0deg, var(--surface-2) 0deg);
  color: var(--text);
  font-weight: 900;
}

.progress-ring::before {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.progress-ring span {
  position: relative;
}

.stat {
  padding: 16px;
}

.stat span {
  display: block;
  font-size: 30px;
  font-weight: 900;
}

.toolbar {
  justify-content: space-between;
  padding: 12px;
  margin-bottom: 10px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter,
.status-line button,
.dialog-card button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 800;
}

.filter {
  padding: 0 14px;
}

.filter.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.search {
  display: flex;
  min-width: min(360px, 100%);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 0 12px;
}

.search span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search input {
  width: 100%;
  min-height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.status-line {
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.live.on .live-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.status-line button {
  padding: 0 12px;
}

.album {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

.section-header span {
  color: var(--muted);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}

.sticker {
  position: relative;
  min-height: 104px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  text-align: left;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.sticker:hover {
  transform: translateY(-1px);
}

.sticker.have {
  border-color: var(--green);
  background: var(--green-soft);
}

.sticker.duplicate {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.sticker.missing {
  border-color: var(--border);
}

.sticker-code,
.sticker-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticker-code {
  color: var(--blue);
  font-size: 19px;
  font-weight: 900;
  white-space: nowrap;
}

.sticker-label {
  display: -webkit-box;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 26px;
  border-radius: 999px;
  background: var(--gold);
  color: #211800;
  font-size: 12px;
  font-weight: 900;
  line-height: 22px;
  text-align: center;
}

dialog {
  width: min(440px, calc(100% - 24px));
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(9, 17, 12, 0.58);
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dialog-card header,
.dialog-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.dialog-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
}

.dialog-card footer button {
  padding: 0 14px;
}

.dialog-card .primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.sticker-detail strong {
  font-size: 20px;
}

.stepper {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.stepper button {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 28px;
}

.stepper span {
  display: block;
  font-size: 42px;
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100% - 32px));
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  opacity: 0;
  padding: 12px 14px;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .summary {
    grid-template-columns: 1fr 1fr;
  }

  .progress-block {
    grid-column: 1 / -1;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  }

  .sticker {
    min-height: 96px;
    padding: 9px;
  }
}
