:root {
  color-scheme: light;
  --ink: #182033;
  --ink-soft: #556078;
  --paper: #f7f4e8;
  --surface: #fffdf7;
  --surface-strong: #ffffff;
  --line: #dcd8ca;
  --line-strong: #beb8a7;
  --yellow: #f6c945;
  --yellow-soft: #fff2b7;
  --yellow-deep: #d7a900;
  --blue: #315aa6;
  --blue-soft: #e8eefb;
  --green: #267a55;
  --green-soft: #e2f3ea;
  --red: #a7463e;
  --red-soft: #fae8e5;
  --shadow: 0 16px 45px rgba(28, 35, 51, 0.09);
  --shadow-small: 0 8px 22px rgba(28, 35, 51, 0.08);
  --radius-large: 26px;
  --radius: 16px;
  --radius-small: 10px;
  --content: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 3%, rgba(246, 201, 69, 0.24), transparent 28rem),
    radial-gradient(circle at 96% 14%, rgba(49, 90, 166, 0.09), transparent 25rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--blue);
}

img {
  max-width: 100%;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  color: white;
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  color: var(--ink-soft);
}

.brand-mark {
  width: 4.5rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0.45rem 0.45rem 0 var(--ink);
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.app-shell {
  width: min(var(--content), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.brand .brand-mark {
  width: 3.1rem;
  box-shadow: 0.27rem 0.27rem 0 var(--ink);
  font-size: 0.92rem;
}

.brand-copy {
  display: grid;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 1.05rem;
}

.brand-copy span {
  margin-top: 0.22rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.header-actions,
.button-row,
.inline-actions,
.filter-row,
.tab-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.75fr);
  gap: 1.4rem;
  align-items: stretch;
  margin-top: 1.5rem;
}

.hero-copy,
.panel,
.group-banner,
.metric,
.member-card,
.trade-card,
.shortage-card,
.notice,
.join-card {
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.94);
  box-shadow: var(--shadow-small);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  min-height: 31rem;
  padding: clamp(2rem, 5vw, 4.5rem);
  border-radius: var(--radius-large);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-copy::after {
  content: "30";
  position: absolute;
  right: -1.2rem;
  bottom: -5.8rem;
  color: rgba(246, 201, 69, 0.19);
  font-size: clamp(13rem, 30vw, 24rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.12em;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--blue);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.group-banner h1,
.section-heading h2,
.panel h2,
.panel h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.hero h1 {
  position: relative;
  z-index: 1;
  max-width: 12ch;
  font-size: clamp(2.65rem, 6vw, 5rem);
}

.hero-copy > p:not(.eyebrow) {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 1.35rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 2vw, 1.25rem);
}

.feature-strip {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 2rem;
}

.feature-chip,
.status-pill,
.count-pill,
.you-pill,
.member-progress,
.card-state,
.trade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
}

.feature-chip {
  padding: 0.48rem 0.72rem;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.panel {
  padding: clamp(1.35rem, 3vw, 2rem);
  border-radius: var(--radius-large);
}

.start-panel {
  display: grid;
  align-content: center;
  gap: 1.2rem;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.form-stack {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.38rem;
}

.field label {
  font-size: 0.83rem;
  font-weight: 750;
}

.field small,
.help-text,
.muted {
  color: var(--ink-soft);
}

input[type="text"] {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  color: var(--ink);
  background: white;
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(49, 90, 166, 0.13);
}

.button {
  min-height: 2.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 780;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:focus-visible,
.tab-button:focus-visible,
.quantity-button:focus-visible,
.card-image-button:focus-visible,
.dialog-close:focus-visible {
  outline: 3px solid rgba(49, 90, 166, 0.35);
  outline-offset: 2px;
}

.button:disabled,
.quantity-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button-primary {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 0.22rem 0.22rem 0 var(--ink);
}

.button-primary:hover:not(:disabled) {
  box-shadow: 0.32rem 0.32rem 0 var(--ink);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.button-quiet {
  border-color: transparent;
  color: var(--ink-soft);
  background: transparent;
}

.button-danger {
  border-color: var(--red);
  color: var(--red);
  background: white;
}

.button-small {
  min-height: 2.2rem;
  padding: 0.45rem 0.68rem;
  font-size: 0.82rem;
}

.full-width {
  width: 100%;
}

.group-banner {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.2rem;
  align-items: center;
  padding: clamp(1.5rem, 4vw, 2.7rem);
  border-radius: var(--radius-large);
  background:
    linear-gradient(125deg, rgba(246, 201, 69, 0.91), rgba(255, 243, 190, 0.92)),
    var(--surface);
}

.group-banner::after {
  content: "30";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-52%);
  color: rgba(24, 32, 51, 0.07);
  font-size: 9rem;
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
}

.group-banner > * {
  position: relative;
  z-index: 1;
}

.group-banner h1 {
  max-width: 20ch;
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.group-code {
  display: inline-flex;
  margin-top: 0.9rem;
  padding: 0.38rem 0.6rem;
  border: 1px solid rgba(24, 32, 51, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.tab-bar {
  position: sticky;
  z-index: 20;
  top: 0;
  margin: 1rem 0 1.35rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(247, 244, 232, 0.91);
  box-shadow: 0 8px 25px rgba(28, 35, 51, 0.08);
  backdrop-filter: blur(15px);
}

.tab-list {
  gap: 0.35rem;
}

.tab-button {
  min-height: 2.45rem;
  padding: 0.55rem 0.8rem;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  font-weight: 750;
  cursor: pointer;
}

.tab-button[aria-selected="true"] {
  color: var(--ink);
  background: white;
  box-shadow: var(--shadow-small);
}

.section-stack {
  display: grid;
  gap: 1.25rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading h2 {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.section-heading p {
  max-width: 48rem;
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.metric {
  min-height: 9rem;
  display: grid;
  align-content: space-between;
  gap: 1rem;
  padding: 1.15rem;
  border-radius: var(--radius);
}

.metric-label {
  color: var(--ink-soft);
  font-size: 0.79rem;
  font-weight: 730;
}

.metric-value {
  font-size: clamp(1.8rem, 4vw, 2.65rem);
  font-weight: 880;
  line-height: 1;
  letter-spacing: -0.055em;
}

.metric-detail {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.member-card {
  display: grid;
  gap: 0.95rem;
  padding: 1.1rem;
  border-radius: var(--radius);
}

.member-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.member-name {
  min-width: 0;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.you-pill,
.status-pill,
.count-pill,
.trade-badge {
  padding: 0.28rem 0.52rem;
}

.you-pill {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-pill.complete {
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.missing {
  color: var(--red);
  background: var(--red-soft);
}

.member-progress {
  justify-content: flex-start;
  color: var(--ink-soft);
}

.progress-track {
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e0d2;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--yellow-deep);
}

.member-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.join-card,
.notice {
  padding: 1.2rem;
  border-radius: var(--radius);
}

.join-card {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 0.55fr);
  gap: 1rem;
  align-items: center;
  border-color: #d3b33d;
  background: var(--yellow-soft);
}

.notice {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  color: var(--ink-soft);
}

.notice strong {
  color: var(--ink);
}

.notice-warning {
  border-color: #d8a351;
  background: #fff4dc;
}

.notice-info {
  border-color: #9bb0da;
  background: var(--blue-soft);
}

.inventory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.inventory-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.count-pill {
  border: 1px solid var(--line);
  background: white;
}

.filter-button {
  min-height: 2.2rem;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: white;
  font-size: 0.8rem;
  font-weight: 740;
  cursor: pointer;
}

.filter-button[aria-pressed="true"] {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--yellow-soft);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

.collection-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-small);
}

.collection-card.is-missing {
  background: #f3f1ea;
}

.collection-card.is-spare {
  border-color: #c29b13;
  box-shadow: 0 0 0 2px rgba(246, 201, 69, 0.3), var(--shadow-small);
}

.card-image-button {
  position: relative;
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: #eee9d9;
  cursor: zoom-in;
}

.card-image-button img {
  width: 100%;
  aspect-ratio: 0.716;
  display: block;
  object-fit: cover;
  transition: filter 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.collection-card.is-missing .card-image-button img {
  filter: grayscale(1);
  opacity: 0.38;
}

.card-image-button:hover img {
  transform: scale(1.015);
}

.image-fallback {
  width: 100%;
  aspect-ratio: 0.716;
  display: none;
  place-content: center;
  padding: 1rem;
  color: var(--ink-soft);
  background: linear-gradient(145deg, #f3d65f, #fff3b7);
  text-align: center;
  font-weight: 800;
}

.card-image-button.image-error img {
  display: none;
}

.card-image-button.image-error .image-fallback {
  display: grid;
}

.card-body {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-number {
  font-weight: 860;
}

.card-set-number,
.card-artist {
  display: block;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.card-state {
  flex: 0 0 auto;
  padding: 0.26rem 0.48rem;
  color: var(--red);
  background: var(--red-soft);
}

.card-state.have {
  color: var(--green);
  background: var(--green-soft);
}

.card-state.spare {
  color: #765c00;
  background: var(--yellow-soft);
}

.quantity-control {
  display: grid;
  grid-template-columns: 2.35rem 1fr 2.35rem;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: white;
}

.quantity-button {
  min-height: 2.45rem;
  border: 0;
  background: #f4f1e8;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
}

.quantity-value {
  text-align: center;
  font-size: 0.92rem;
  font-weight: 850;
}

.save-bar {
  position: sticky;
  z-index: 15;
  bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 14px;
  color: white;
  background: rgba(24, 32, 51, 0.96);
  box-shadow: 0 16px 38px rgba(24, 32, 51, 0.24);
  backdrop-filter: blur(12px);
}

.save-bar p {
  margin: 0;
}

.trade-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.trade-summary-item {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: white;
}

.trade-summary-item strong {
  display: block;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.trade-summary-item span {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.trade-list {
  display: grid;
  gap: 1rem;
}

.trade-card {
  overflow: hidden;
  border-radius: var(--radius);
}

.trade-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: #fbf7e9;
}

.trade-names {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 850;
}

.trade-arrow {
  color: var(--ink-soft);
}

.trade-badge {
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: white;
}

.trade-directions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trade-direction {
  padding: 1rem 1.1rem 1.15rem;
}

.trade-direction + .trade-direction {
  border-left: 1px solid var(--line);
}

.trade-direction h4 {
  margin: 0 0 0.8rem;
  font-size: 0.86rem;
}

.trade-direction-empty {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.trade-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.mini-card {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.52rem 0.35rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  font-size: 0.77rem;
  font-weight: 760;
}

.mini-card img {
  width: 2rem;
  border-radius: 3px;
}

.shortage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.shortage-card {
  display: grid;
  grid-template-columns: 3.3rem 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem;
  border-radius: var(--radius-small);
}

.shortage-card img {
  width: 3.3rem;
  border-radius: 5px;
}

.shortage-card strong,
.shortage-card span {
  display: block;
}

.shortage-card span {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 720;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.46);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.admin-list {
  display: grid;
  gap: 0.6rem;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: white;
}

.danger-zone {
  border-color: #d99a94;
  background: var(--red-soft);
}

.app-footer {
  display: grid;
  gap: 0.35rem;
  margin-top: 2.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.73rem;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 1rem;
  bottom: 1rem;
  width: min(24rem, calc(100% - 2rem));
  display: grid;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  background: rgba(24, 32, 51, 0.96);
  box-shadow: var(--shadow);
  animation: toast-in 180ms ease both;
}

.toast.error {
  background: rgba(130, 47, 42, 0.97);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
}

.card-dialog {
  width: min(94vw, 31rem);
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(16, 22, 35, 0.42);
}

.card-dialog::backdrop {
  background: rgba(18, 24, 38, 0.75);
  backdrop-filter: blur(4px);
}

.card-dialog img {
  width: 100%;
  max-height: 78vh;
  display: block;
  object-fit: contain;
  background: #ece8da;
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 0.65rem;
  right: 0.65rem;
  width: 2.5rem;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  color: white;
  background: rgba(24, 32, 51, 0.78);
  font-size: 1.4rem;
  cursor: pointer;
}

.dialog-caption {
  display: grid;
  padding: 0.9rem 1rem 1rem;
}

.dialog-caption span {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.error-page {
  min-height: 70vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.8rem;
  text-align: center;
}

.error-page h1 {
  margin: 0;
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: 25rem;
  }

  .metric-grid,
  .trade-summary,
  .shortage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 1rem, var(--content));
    padding-top: 0.45rem;
  }

  .site-header {
    align-items: flex-start;
  }

  .brand-copy span {
    display: none;
  }

  .header-actions .button-quiet {
    display: none;
  }

  .group-banner {
    grid-template-columns: 1fr;
  }

  .group-banner .button-row {
    justify-content: flex-start;
  }

  .section-heading,
  .inventory-toolbar,
  .save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .join-card {
    grid-template-columns: 1fr;
  }

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

  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .card-body {
    padding: 0.65rem;
  }

  .card-artist {
    min-height: 2.15rem;
  }

  .trade-directions {
    grid-template-columns: 1fr;
  }

  .trade-direction + .trade-direction {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .save-bar .button {
    width: 100%;
  }
}

@media (max-width: 490px) {
  .site-header {
    gap: 0.4rem;
  }

  .brand .brand-mark {
    width: 2.65rem;
  }

  .brand-copy strong {
    font-size: 0.92rem;
  }

  .header-actions {
    justify-content: flex-end;
  }

  .header-actions .button {
    min-height: 2.25rem;
    padding: 0.42rem 0.58rem;
    font-size: 0.75rem;
  }

  .hero-copy {
    min-height: 23rem;
    padding: 1.7rem;
  }

  .metric-grid,
  .trade-summary,
  .shortage-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric {
    min-height: 7.5rem;
  }

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

  .tab-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .tab-list.has-admin {
    grid-template-columns: repeat(4, 1fr);
  }

  .tab-button {
    padding-inline: 0.3rem;
    font-size: 0.73rem;
  }

  .trade-card-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  body {
    background: white;
  }

  .site-header,
  .group-banner .button-row,
  .tab-bar,
  .app-footer,
  .print-hide,
  .toast-region {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .group-banner,
  .panel,
  .trade-card,
  .shortage-card {
    box-shadow: none;
  }

  .trade-card {
    break-inside: avoid;
  }
}


/* Native progress element used on the collection screen. */
.progress-meter {
  width: min(100%, 28rem);
  height: 0.65rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e5e0d2;
  appearance: none;
}

.progress-meter::-webkit-progress-bar {
  border-radius: 999px;
  background: #e5e0d2;
}

.progress-meter::-webkit-progress-value {
  border-radius: 999px;
  background: var(--yellow-deep);
}

.progress-meter::-moz-progress-bar {
  border-radius: 999px;
  background: var(--yellow-deep);
}

.clipboard-fallback {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.image-unavailable {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
