:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e1ea;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --green: #0f9f6e;
  --green-soft: #dff7ec;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --amber: #d97706;
  --amber-soft: #ffedd5;
  --shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--bg);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-root {
  min-height: 100vh;
}

.loading-screen,
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.loading-screen {
  color: var(--muted);
}

.loading-icon {
  width: 84px;
  height: 84px;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.brand-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
}

.brand-row h1,
.brand-row p {
  margin: 0;
}

.brand-row h1 {
  font-size: 1.8rem;
  line-height: 1.1;
}

.brand-tagline {
  font-weight: 900;
}

.brand-row p,
.muted {
  color: var(--muted);
}

.app-shell {
  width: min(980px, 100%);
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0 auto;
  padding: 14px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

@supports (-webkit-touch-callout: none) {
  .app-root {
    min-height: 100vh;
  }

  .app-shell {
    height: 100vh;
    min-height: 100vh;
    padding-bottom: 0;
  }
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -14px -14px 14px;
  padding: 12px 14px;
  background: rgba(248, 250, 252, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.collection-picker {
  display: grid;
  grid-template-columns: auto minmax(190px, min(280px, 34vw));
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.collection-picker span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.collection-picker select {
  min-height: 42px;
}

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

.share-action {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.icon-button,
.invite-button,
.small-button,
.secondary-button,
.primary-button,
.filter-row button,
.auth-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
}

.primary-button {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}

.secondary-button,
.small-button {
  padding: 0 14px;
}

.link-button {
  display: inline-grid;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.danger-button {
  min-height: 42px;
  border: 1px solid #dc2626;
  border-radius: 8px;
  background: #dc2626;
  color: #ffffff;
  font-weight: 800;
}

.text-button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  padding: 0;
  text-align: center;
}

.text-button.compact {
  min-height: 28px;
  font-size: 0.84rem;
}

.legal-footer {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.legal-footer p {
  margin: 0;
}

.legal-footer > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.invite-button {
  min-width: 0;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-icon-button {
  position: relative;
}

.stack-form,
.inline-form {
  display: grid;
  gap: 14px;
}

.stack-form.compact {
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.checkbox-row {
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--ink);
  line-height: 1.35;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
}

.inline-link {
  display: inline;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  font: inherit;
  font-weight: 900;
  text-decoration: underline;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  font-size: 1rem;
}

textarea {
  min-height: 126px;
  padding: 12px;
  line-height: 1.4;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.legal-screen {
  align-items: start;
}

.legal-panel {
  max-height: calc(100dvh - 32px);
  overflow: auto;
}

.legal-copy,
.legal-disclaimer {
  color: var(--muted);
  line-height: 1.45;
}

.legal-copy {
  display: grid;
  gap: 12px;
}

.legal-copy h3,
.legal-copy p,
.legal-copy ul {
  margin: 0;
}

.legal-copy h3 {
  color: var(--ink);
  font-size: 1rem;
}

.legal-copy ul {
  display: grid;
  gap: 6px;
  padding-left: 18px;
}

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

.legal-disclaimer {
  margin: 0 0 12px;
  font-weight: 700;
}

.danger-panel {
  border-color: #fecaca;
  background: #fff7f7;
}

.danger-note {
  margin: 0 0 12px;
  color: #991b1b;
  font-weight: 700;
  line-height: 1.4;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.form-error,
.notice {
  margin: 14px 0 0;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
}

.form-error,
.notice.error {
  background: var(--red-soft);
  color: #991b1b;
}

.notice.success {
  background: var(--green-soft);
  color: #047857;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 50;
  width: max-content;
  max-width: min(420px, calc(100vw - 28px));
  transform: translateX(-50%);
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-weight: 900;
  text-align: center;
}

.toast.success {
  background: var(--green-soft);
  color: #047857;
}

.toast.error {
  background: var(--red-soft);
  color: #991b1b;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 55;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.share-toast {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  z-index: 20;
  width: max-content;
  max-width: 220px;
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.12);
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.share-toast.success {
  background: var(--green-soft);
  color: #047857;
}

.share-toast.error {
  background: var(--red-soft);
  color: #991b1b;
}

.support-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: end center;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(23, 32, 51, 0.36);
}

.invite-backdrop {
  place-items: start center;
}

.support-dialog {
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

.invite-dialog {
  width: min(480px, 100%);
  border-color: rgba(37, 99, 235, 0.18);
  background:
    linear-gradient(135deg, rgba(219, 234, 254, 0.94) 0%, rgba(204, 251, 241, 0.82) 44%, rgba(255, 237, 213, 0.9) 100%),
    var(--panel);
}

.invite-card {
  display: grid;
  gap: 12px;
}

.invite-brand-block {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.invite-brand-block span {
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.invite-brand-block strong {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.1;
}

.invite-lede {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.35;
}

.invite-feature-list {
  display: grid;
  gap: 8px;
}

.invite-feature {
  display: grid;
  gap: 4px;
  border-left: 5px solid #94a3b8;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(23, 32, 51, 0.04);
  padding: 11px 12px;
}

.invite-feature.hero-feature {
  border-left-color: #2563eb;
  background: linear-gradient(135deg, #dbeafe 0%, #ccfbf1 100%);
}

.invite-feature.feature-scan {
  border-left-color: #0891b2;
  background: #ecfeff;
}

.invite-feature.feature-settle {
  border-left-color: #f97316;
  background: #fff7ed;
}

.invite-feature.feature-fast {
  border-left-color: #16a34a;
  background: #f0fdf4;
}

.feature-kicker {
  color: #475467;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.invite-feature strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.25;
}

.invite-qr-section {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: linear-gradient(135deg, #172033 0%, #0f766e 100%);
  color: #ffffff;
  padding: 12px;
}

.invite-qr-section > span {
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 900;
}

.invite-qr {
  width: min(220px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  padding: 8px;
}

.invite-link-field {
  font-size: 0.78rem;
}

.invite-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.secondary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.support-dialog .panel-title {
  margin-bottom: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(23, 32, 51, 0.05);
  margin-bottom: 14px;
  padding: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title h2,
.suggestion-card h3 {
  margin: 0;
  line-height: 1.2;
}

.panel-title h2 {
  font-size: 1.05rem;
}

.admin-panel {
  display: grid;
  gap: 14px;
}

.admin-panel > * {
  margin: 0;
}

.admin-title {
  margin-bottom: 0;
}

.admin-title p {
  margin: 4px 0 0;
}

.admin-metric-grid,
.admin-section-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

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

.admin-metric,
.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-metric {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px;
}

.admin-metric span {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
}

.admin-metric strong,
.admin-card h3 {
  color: var(--ink);
  font-size: 0.95rem;
}

.admin-metric small {
  color: var(--muted);
  font-weight: 800;
}

.admin-card {
  padding: 14px;
}

.admin-card h3 {
  margin: 0 0 12px;
}

.admin-kpi-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.admin-kpi-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-kpi-list dt {
  color: var(--muted);
  font-weight: 800;
}

.admin-kpi-list dd {
  margin: 0;
  font-weight: 900;
}

.admin-activity-bars {
  display: grid;
  gap: 12px;
}

.admin-day {
  display: grid;
  grid-template-columns: 54px repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
}

.admin-day > span {
  color: var(--muted);
  font-weight: 900;
}

.admin-bar-row {
  display: grid;
  grid-template-columns: auto minmax(48px, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.admin-bar-row small {
  color: var(--muted);
  font-weight: 800;
}

.admin-bar-row b {
  font-size: 0.82rem;
}

.admin-bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.admin-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.admin-table td strong,
.admin-table td span {
  display: block;
}

.admin-table td span {
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-pill {
  display: inline-flex;
  margin: 0 4px 4px 0;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #1d4ed8;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 900;
}

.filter-row,
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

#tab-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.filter-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.album-search {
  position: relative;
  display: block;
  margin-bottom: 14px;
}

.album-search input {
  min-height: 52px;
  border-color: rgba(37, 99, 235, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding-right: 46px;
  font-size: 1.08rem;
  font-weight: 800;
}

.album-search input::-webkit-search-cancel-button {
  appearance: none;
}

.album-search-clear {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 30px;
  min-height: 30px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.album-search-clear:hover,
.album-search-clear:focus-visible {
  background: #f1f5f9;
  color: var(--ink);
}

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

.album-controls {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.album-panel {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: rgba(37, 99, 235, 0.16);
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(37, 99, 235, 0.42), rgba(20, 184, 166, 0.34), rgba(245, 158, 11, 0.28)) border-box;
  margin-bottom: 0;
}

.album-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #14b8a6, #f59e0b);
}

.album-panel .album-controls,
.album-panel .album-search {
  flex: 0 0 auto;
}

.album-filter {
  margin-bottom: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 46px;
}

.sort-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.sort-toggle-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trade-mode-row {
  margin-bottom: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filter-row button,
.auth-tabs button {
  background: #ffffff;
}

.album-filter button {
  border-color: rgba(23, 32, 51, 0.13);
  box-shadow: 0 1px 0 rgba(23, 32, 51, 0.03);
}

.tab-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 20px;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  padding: 2px 6px;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 900;
}

.icon-button.active,
.filter-row button.active,
.auth-tabs button.active {
  border-color: var(--blue);
  background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 100%);
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.tab-return-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.tab-home-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 10px;
  font-size: 0.9rem;
  font-weight: 800;
}

.tab-home-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.sticker-sections {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 2px 18px 0;
}

.sticker-section {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.section-separator {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(23, 32, 51, 0.11);
  padding-top: 12px;
}

.sticker-section:first-child .section-separator {
  border-top: 0;
  padding-top: 0;
}

.section-separator > div {
  min-width: 0;
}

.section-separator h3 {
  margin: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  font-size: 1.14rem;
  line-height: 1.2;
}

.section-accent {
  width: 7px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(180deg, #2563eb, #14b8a6);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.section-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-section .section-separator h3 {
  font-size: 1.18rem;
}

.section-complete-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(15, 159, 110, 0.18);
  border-radius: 999px;
  background: var(--green-soft);
  color: #047857;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 900;
}

.sticker-section-grid {
  min-width: 0;
  display: grid;
  align-content: start;
  align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 6px;
}

.sticker-tile {
  position: relative;
  min-height: 76px;
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(23, 32, 51, 0.04);
  --tile-accent: #94a3b8;
}

.sticker-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1;
  background: var(--tile-accent);
}

.sticker-tile.is-owned {
  --tile-accent: #0f9f6e;
  border-color: rgba(15, 159, 110, 0.35);
  background: linear-gradient(180deg, #ffffff 0%, #f8fffb 100%);
}

.sticker-tile.is-missing {
  --tile-accent: #ef4444;
  border-color: rgba(220, 38, 38, 0.25);
  background: linear-gradient(180deg, #ffffff 0%, #fffafa 100%);
}

.sticker-tile.has-trade {
  --tile-accent: #f59e0b;
  border-color: rgba(217, 119, 6, 0.45);
  background: linear-gradient(180deg, #ffffff 0%, #fffaf2 100%);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.09);
}

.tile-main {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 5px;
  width: 100%;
  min-height: 74px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 7px 5px;
}

.sticker-tile.has-control .tile-main {
  padding: 7px 5px 31px;
}

.tile-main:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.32);
  outline-offset: -3px;
}

.sticker-number {
  font-size: 1.08rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.sticker-state {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 900;
}

.state-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 2px 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.state-chip.got {
  background: var(--green-soft);
  color: #047857;
}

.state-chip.need {
  background: var(--red-soft);
  color: #991b1b;
}

.state-chip.trade {
  background: var(--amber-soft);
  color: #92400e;
}

.tile-decrease {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: 100%;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(254, 226, 226, 0.62) 100%);
  color: #b91c1c;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.tile-decrease:hover,
.tile-decrease:focus-visible {
  background: rgba(254, 226, 226, 0.55);
}

.suggestion-list {
  display: grid;
  gap: 10px;
}

.suggestion-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.suggestion-card h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.direct-trade-panel {
  display: grid;
  gap: 12px;
}

.trade-mode-row {
  margin-bottom: 14px;
}

.trade-now-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.direct-trade-grid {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(260px, 1.2fr);
  gap: 12px;
  align-items: start;
}

.direct-qr-card,
.direct-code-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.direct-qr-card {
  display: grid;
  gap: 10px;
  justify-items: stretch;
}

.my-qr-card {
  width: min(300px, 100%);
  justify-self: center;
}

.direct-qr {
  width: min(220px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.direct-code-form {
  display: grid;
  gap: 12px;
}

.direct-manual-entry,
.request-instead-details,
.advanced-trades {
  display: grid;
  gap: 10px;
}

.direct-manual-entry summary,
.request-instead-details summary,
.advanced-trades summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.direct-manual-entry summary::-webkit-details-marker,
.request-instead-details summary::-webkit-details-marker,
.advanced-trades summary::-webkit-details-marker {
  display: none;
}

.direct-manual-entry[open] summary,
.request-instead-details[open] summary,
.advanced-trades[open] summary {
  margin-bottom: 10px;
}

.direct-form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.direct-result {
  display: grid;
  gap: 12px;
}

.direct-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.direct-line {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.direct-line > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.direct-line > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.direct-balance {
  margin: 0;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 800;
}

.direct-balance strong,
.direct-balance span {
  display: block;
}

.direct-balance span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

.direct-balance.balanced {
  background: var(--green-soft);
  color: #047857;
}

.direct-balance.surplus {
  background: var(--amber-soft);
  color: #92400e;
}

.direct-scanner-dialog {
  width: min(440px, 100%);
}

.direct-scanner-video {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  object-fit: cover;
}

.trade-refresh-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trade-refresh-panel h2 {
  margin: 0 0 4px;
}

.match-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.match-note.warning {
  color: #9a3412;
}

.trade-lines {
  display: grid;
  gap: 8px;
}

.trade-lines p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.trade-lines span {
  min-width: 42px;
  color: var(--muted);
  font-weight: 900;
}

.number-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #1d4ed8;
  padding: 3px 8px;
  font-size: 0.82rem;
}

.ring-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.ring-steps li {
  line-height: 1.35;
}

.ring-steps span {
  color: var(--muted);
}

.request-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.request-controls.has-offer {
  grid-template-columns: minmax(180px, 1.4fr) 1fr 1fr auto;
}

.request-controls.direct-request-controls {
  grid-template-columns: 1fr 1fr auto auto;
}

.request-controls.direct-request-controls.has-settlement {
  grid-template-columns: minmax(130px, auto) 1fr 1fr auto auto;
}

.direct-checkout-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.direct-checkout-actions.has-settlement {
  grid-template-columns: minmax(130px, auto) minmax(0, 1fr);
}

.cash-gift-toggle.active {
  border-color: #f59e0b;
  background: var(--amber-soft);
  color: #92400e;
}

.request-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.request-header h3 {
  margin-bottom: 0;
}

.meeting-line {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 800;
}

.settlement-line {
  margin: -4px 0 10px;
  color: #92400e;
  font-size: 0.86rem;
  font-weight: 900;
}

.meeting-hint {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: capitalize;
}

.status-pill.accepted,
.status-pill.completed {
  background: var(--green-soft);
  color: #047857;
}

.status-pill.completionPending {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.declined,
.status-pill.cancelled {
  background: var(--red-soft);
  color: #991b1b;
}

.response-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.response-list span {
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 0.8rem;
  font-weight: 800;
}

.response-list b {
  color: var(--ink);
}

.completion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.completion-list > span:first-child {
  flex-basis: 100%;
  color: var(--ink);
}

.completion-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.request-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.request-actions.single {
  grid-template-columns: 1fr;
}

.settings-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pro-panel {
  border-color: rgba(37, 99, 235, 0.24);
  background:
    linear-gradient(135deg, rgba(219, 234, 254, 0.78), rgba(240, 253, 244, 0.68) 52%, rgba(255, 247, 237, 0.76)),
    #ffffff;
}

.pro-title {
  align-items: flex-start;
}

.pro-title p,
.pro-copy,
.pro-footnote {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.pro-copy {
  margin-bottom: 12px;
}

.pro-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #172033;
  color: #ffffff;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.pro-usage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pro-usage {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
}

.pro-usage span {
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1;
}

.pro-usage strong {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.empty-grid {
  grid-column: 1 / -1;
  margin: 0;
}

@media (max-width: 620px) {
  .top-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .collection-picker {
    grid-column: 1 / -1;
    order: 1;
    width: 100%;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .top-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) repeat(5, 42px);
    justify-self: stretch;
    order: 2;
  }

  .top-actions.has-admin {
    grid-template-columns: minmax(0, 1fr) repeat(6, 42px);
  }

  .share-action,
  .invite-button {
    width: 100%;
  }

  .album-controls {
    grid-template-columns: 1fr;
  }

  .album-filter,
  .trade-mode-row {
    width: 100%;
  }

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

  .section-separator {
    align-items: center;
    flex-direction: row;
    gap: 4px;
  }

  .sticker-tile {
    min-height: 76px;
  }

  .request-controls {
    grid-template-columns: 1fr;
  }

  .request-controls.has-offer {
    grid-template-columns: 1fr;
  }

  .request-controls.direct-request-controls {
    grid-template-columns: 1fr;
  }

  .request-controls.direct-request-controls.has-settlement {
    grid-template-columns: 1fr;
  }

  .request-actions {
    grid-template-columns: 1fr;
  }

  .settings-actions {
    grid-template-columns: 1fr;
  }

  .pro-usage-grid {
    grid-template-columns: 1fr;
  }

  .admin-metric-grid,
  .admin-section-grid,
  .admin-day {
    grid-template-columns: 1fr;
  }

  .invite-actions {
    grid-template-columns: 1fr;
  }

  .direct-trade-grid,
  .direct-summary-grid,
  .direct-form-actions,
  .trade-now-actions,
  .direct-checkout-actions,
  .direct-checkout-actions.has-settlement {
    grid-template-columns: 1fr;
  }

  .trade-refresh-panel {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (min-width: 760px) {
  .app-shell {
    padding-top: 20px;
  }

  .top-bar {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0 0 16px;
  }
}
