:root {
  color-scheme: dark;
  --bg: #111310;
  --bg-2: #171a16;
  --surface: #1e211d;
  --surface-2: #252923;
  --surface-3: #30342e;
  --line: #3d443b;
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #f1eee4;
  --muted: #a9afa4;
  --subtle: #767d72;
  --green: #42b883;
  --green-soft: rgba(66, 184, 131, 0.18);
  --gold: #e1be62;
  --blue: #70a0ff;
  --blue-soft: rgba(112, 160, 255, 0.2);
  --red: #ef6f61;
  --red-soft: rgba(239, 111, 97, 0.18);
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(66, 184, 131, 0.08), transparent 28%),
    linear-gradient(315deg, rgba(225, 190, 98, 0.06), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  min-width: 0;
}

button {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 12px;
  min-height: 100vh;
  padding: 12px;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.app-shell.sidebar-collapsed,
.app-shell:has(.side-rail.is-collapsed) {
  grid-template-columns: 76px minmax(0, 1fr);
}

.loading-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}

.loading-shell {
  min-height: 100vh;
}

.loading-screen h1,
.loading-screen p {
  margin: 0;
}

.loading-screen h1 {
  font-size: 24px;
}

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

.public-page,
.legal-page {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  border-bottom: 1px solid var(--line-soft);
}

.public-nav a,
.legal-page a,
.public-primary,
.public-cta {
  color: var(--text);
  text-decoration: none;
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.public-brand span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(225, 190, 98, 0.38);
  background: linear-gradient(145deg, #31573f, #20251d);
  color: var(--gold);
  border-radius: var(--radius);
}

.public-nav div {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.public-cta,
.public-primary {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid rgba(66, 184, 131, 0.48);
  background: var(--green-soft);
  border-radius: var(--radius);
  padding: 0 14px;
  font-weight: 900;
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: center;
  min-height: min(620px, calc(100vh - 90px));
}

.public-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.96;
}

.public-hero p {
  max-width: 620px;
  margin: 20px 0 26px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.public-preview {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(30, 33, 29, 0.94);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.public-preview strong {
  color: var(--gold);
  font-size: 18px;
}

.public-preview span,
.public-grid article {
  border: 1px solid var(--line-soft);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
}

.public-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.public-grid h2,
.public-grid p,
.legal-page h1,
.legal-page h2,
.legal-page p {
  margin: 0;
}

.public-grid h2 {
  font-size: 18px;
}

.public-grid p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.legal-page {
  display: grid;
  gap: 14px;
  max-width: 820px;
}

.legal-page h1 {
  margin-top: 24px;
  font-size: 42px;
}

.legal-page h2 {
  margin-top: 10px;
  color: var(--gold);
  font-size: 20px;
}

.legal-page p {
  color: var(--muted);
  line-height: 1.6;
}

.side-rail,
.main-surface {
  min-width: 0;
  max-width: 100%;
}

.side-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(30, 33, 29, 0.94);
  box-shadow: var(--shadow);
  padding: 14px;
  position: sticky;
  top: 12px;
  height: calc(100vh - 24px);
  border-radius: var(--radius);
  overflow: hidden;
}

.side-rail.is-collapsed {
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.brand {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.side-rail.is-collapsed .brand {
  grid-template-columns: 48px;
}

.side-rail.is-collapsed .brand > div:not(.brand-mark),
.side-rail.is-collapsed .nav-button span,
.side-rail.is-collapsed .rail-toggle span,
.side-rail.is-collapsed .settings-toggle span {
  display: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(225, 190, 98, 0.38);
  background: linear-gradient(145deg, #31573f, #20251d);
  color: var(--gold);
  border-radius: var(--radius);
  font-weight: 900;
  letter-spacing: 0;
}

.brand h1,
.brand p,
.storage-panel p,
.workspace-header h2,
.workspace-header p,
.dashboard h2,
.dashboard p,
.album-page h3,
.album-page p {
  margin: 0;
}

.brand h1 {
  font-size: 15px;
  line-height: 1.15;
}

.title-with-flag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}

.title-with-flag > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-flag {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 18px;
  border: 1px solid rgba(241, 238, 228, 0.16);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  font-size: 15px;
  line-height: 1;
  overflow: hidden;
}

.team-flag.is-css-flag {
  background: var(--flag-bg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.team-flag.is-css-flag > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.nav-tabs {
  display: grid;
  gap: 6px;
}

.nav-button,
.rail-toggle,
.settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
}

.nav-button svg,
.search-box svg,
.data-actions svg,
.icon-button svg,
.workspace-actions svg,
.rail-toggle svg,
.settings-toggle svg,
.page-jump svg,
.wide-action svg,
.confirm-icon svg,
.direction-panel svg,
.sync-actions svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.side-rail.is-collapsed .nav-tabs,
.side-rail.is-collapsed .settings-panel {
  width: 100%;
}

.side-rail.is-collapsed .nav-button,
.side-rail.is-collapsed .rail-toggle,
.side-rail.is-collapsed .settings-toggle {
  justify-content: center;
  padding: 0;
}

.nav-button.is-active,
.settings-toggle.is-active {
  border-color: rgba(66, 184, 131, 0.36);
  background: var(--green-soft);
  color: var(--text);
}

.settings-panel {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.sidebar-summary {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  background: #151814;
  border-radius: var(--radius);
  padding: 10px;
}

.summary-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-head strong {
  color: var(--green);
}

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

.summary-grid div {
  min-width: 0;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  border-radius: 5px;
  padding: 6px 5px;
}

.summary-grid span,
.summary-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.summary-grid strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 13px;
  line-height: 1;
}

.storage-panel {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  background: #151814;
  border-radius: var(--radius);
  padding: 9px;
}

.storage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.storage-row strong {
  color: var(--green);
  font-size: 11px;
}

.storage-row strong.saving {
  color: var(--gold);
}

.storage-row strong.error {
  color: var(--red);
}

.storage-panel p {
  color: var(--subtle);
  font-size: 11px;
}

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

.data-actions button,
.data-actions label,
.clear-team-button,
.secondary-action,
.danger-action,
.sync-actions button {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-align: center;
}

.storage-panel .data-actions button,
.storage-panel .data-actions label {
  min-height: 36px;
  gap: 2px;
}

.storage-panel .data-actions svg {
  width: 15px;
  height: 15px;
}

.data-actions span,
.sync-actions span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-actions button:hover,
.data-actions label:hover,
.clear-team-button:hover,
.secondary-action:hover,
.sync-actions button:hover {
  color: var(--text);
  border-color: rgba(66, 184, 131, 0.42);
}

.danger-action {
  border-color: rgba(239, 111, 97, 0.4);
  background: var(--red-soft);
  color: #ffd6d1;
}

.danger-action:hover {
  border-color: rgba(239, 111, 97, 0.72);
  color: var(--text);
}

.data-actions input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.filter-block {
  display: grid;
  gap: 8px;
}

.field-label {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  background: #151814;
  border-radius: var(--radius);
  padding: 0 10px;
}

.search-box input,
.filter-block select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  min-height: 38px;
  font-size: 13px;
}

.filter-block select {
  border: 1px solid var(--line);
  background: #151814;
  border-radius: var(--radius);
  padding: 0 10px;
}

.page-rail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.section-title strong {
  color: var(--gold);
}

.page-list {
  display: grid;
  gap: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
}

.page-list-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 36px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius);
  cursor: pointer;
}

.page-list-item span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
}

.page-list-item em {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  font-size: 12px;
}

.page-list-item.is-active {
  background: var(--surface-3);
  border-color: var(--line);
  color: var(--text);
}

.main-surface {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 64px;
  border: 1px solid var(--line-soft);
  background: rgba(30, 33, 29, 0.9);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.top-copy {
  min-width: 0;
}

.top-copy span {
  display: block;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.top-copy strong {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: min(540px, 56vw);
}

.icon-button,
.install-button,
.range-tabs button,
.trade-item button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
}

.page-range {
  flex: 1;
  min-width: 0;
  accent-color: var(--green);
}

.install-button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.page-jump {
  display: grid;
  grid-template-columns: auto 64px 38px;
  align-items: center;
  gap: 5px;
  min-width: 132px;
}

.page-jump label {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.page-jump input,
.page-jump button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius);
}

.page-jump input {
  width: 100%;
  outline: none;
  padding: 0 8px;
}

.page-jump button {
  display: grid;
  place-items: center;
  cursor: pointer;
}

.is-hidden {
  display: none;
}

.album-workspace,
.list-view,
.view-grid-single {
  min-height: 0;
  border: 1px solid var(--line-soft);
  background: rgba(23, 26, 22, 0.92);
  border-radius: var(--radius);
  padding: 16px;
  overflow: auto;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.workspace-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.workspace-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.workspace-header h2 {
  font-size: 24px;
  line-height: 1.05;
}

.workspace-header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.status-legend {
  display: grid;
  grid-template-columns: 10px auto 10px auto 10px auto;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-dot.missing {
  background: #3b403a;
}

.legend-dot.owned {
  background: var(--green);
}

.legend-dot.duplicate {
  background: var(--gold);
}

.album-spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.album-page {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #56533f;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 12%),
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(255, 255, 255, 0.025) 35px 36px),
    #242820;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.24);
}

.album-page.secondary {
  transform: none;
}

.album-page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(225, 190, 98, 0.24);
}

.album-page-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.album-page-header > div:first-child > span {
  display: block;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.album-page-header h3 {
  min-width: 0;
  font-size: 20px;
  line-height: 1.08;
}

.album-page-header p {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-page-header strong {
  color: var(--green);
  font-size: 18px;
}

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

.clear-team-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-auto-flow: column;
  min-height: 30px;
  border-color: rgba(239, 111, 97, 0.34);
  background: rgba(239, 111, 97, 0.1);
  color: #ffd6d1;
  padding: 0 8px;
  white-space: nowrap;
}

.top-clear-button {
  min-height: 38px;
  background: rgba(239, 111, 97, 0.08);
}

.clear-team-button svg {
  width: 14px;
  height: 14px;
}

.sticker-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.card-size-compact .sticker-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.card-size-large .sticker-grid {
  gap: 12px;
}

.sticker-slot {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
  gap: 5px;
  min-height: 154px;
  min-width: 0;
  border: 1px dashed rgba(241, 238, 228, 0.24);
  background: #1a1d19;
  border-radius: var(--radius);
  padding: 9px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.card-size-compact .sticker-slot {
  place-items: center;
  align-content: center;
  gap: 0;
  min-height: 48px;
  padding: 5px;
  text-align: center;
}

.card-size-large .sticker-slot {
  min-height: 182px;
  padding: 12px;
}

.sticker-slot:hover {
  transform: translateY(-2px);
  border-color: var(--slot-accent);
}

.sticker-slot.owned {
  border-style: solid;
  border-color: rgba(66, 184, 131, 0.62);
  background: linear-gradient(160deg, rgba(66, 184, 131, 0.2), #1a1d19 58%);
}

.sticker-slot.duplicate {
  border-style: solid;
  border-color: rgba(225, 190, 98, 0.58);
  background: linear-gradient(160deg, rgba(225, 190, 98, 0.16), #1a1d19 58%);
}

.sticker-number {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 800;
}

.card-size-compact .sticker-number {
  color: var(--text);
  font-size: 13px;
  line-height: 1;
}

.card-size-medium .sticker-number {
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
}

.card-size-large .sticker-number {
  color: var(--gold);
  font-size: 12px;
}

.sticker-art {
  display: none;
  place-items: center;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--slot-accent) 32%, transparent), transparent),
    #232821;
  border-radius: 6px;
}

.card-size-compact .sticker-art {
  min-height: 38px;
}

.card-size-large .sticker-art {
  min-height: 76px;
}

.sticker-art span {
  color: var(--text);
  font-size: clamp(17px, 2.4vw, 24px);
  font-weight: 950;
  letter-spacing: 0;
}

.sticker-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

.card-size-compact .sticker-name,
.card-size-compact .sticker-meta,
.card-size-compact .sticker-kind,
.card-size-compact .sticker-status {
  display: none;
}

.card-size-medium .sticker-name,
.card-size-medium .sticker-meta,
.card-size-medium .sticker-kind,
.card-size-medium .sticker-status {
  display: none;
}

.card-size-large .sticker-name {
  font-size: 15px;
}

.sticker-kind {
  overflow: hidden;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.position-tag {
  justify-self: start;
  min-width: 34px;
  border: 1px solid var(--position-border);
  background: var(--position-bg);
  color: var(--position-text);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.position-goalkeeper {
  --position-bg: rgba(225, 190, 98, 0.18);
  --position-border: rgba(225, 190, 98, 0.58);
  --position-text: #f3d77d;
}

.position-defender {
  --position-bg: rgba(84, 198, 192, 0.16);
  --position-border: rgba(84, 198, 192, 0.5);
  --position-text: #8ee2dc;
}

.position-midfielder {
  --position-bg: rgba(66, 184, 131, 0.16);
  --position-border: rgba(66, 184, 131, 0.52);
  --position-text: #8fe0b7;
}

.position-forward {
  --position-bg: rgba(239, 111, 97, 0.16);
  --position-border: rgba(239, 111, 97, 0.52);
  --position-text: #f2a59c;
}

.sticker-map-view {
  display: grid;
  align-content: start;
  gap: 10px;
}

.sticker-map-legend {
  justify-self: end;
}

.sticker-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.quick-mode-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  background: rgba(10, 12, 10, 0.7);
  border-radius: 6px;
}

.quick-mode-button,
.toolbar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 5px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.quick-mode-button.active {
  border-color: color-mix(in srgb, var(--green) 70%, var(--line));
  background: rgba(66, 184, 131, 0.2);
  color: #f1eee4;
}

.toolbar-button svg {
  width: 15px;
  height: 15px;
}

.toolbar-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.map-status-message {
  margin: -3px 0 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.map-status-message.error {
  color: var(--red);
}

.map-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.map-summary-strip span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line-soft);
  background: #151814;
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.map-summary-strip strong {
  color: var(--text);
  font-size: 16px;
}

.flag-index {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border: 1px solid var(--line-soft);
  background: #151814;
  border-radius: 6px;
  padding: 6px;
}

.flag-index > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 4px;
  padding: 0 5px;
}

.flag-index small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.sticker-map-stack {
  display: grid;
  gap: 10px;
}

.sticker-map-section {
  border: 1px solid var(--line-soft);
  background: #1b2019;
  border-radius: 6px;
  padding: 10px;
}

.sticker-map-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(241, 238, 228, 0.08);
}

.sticker-map-section-head > div > span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.sticker-map-section-head h3,
.team-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 3px 0 0;
  font-size: 16px;
  line-height: 1.2;
}

.sticker-map-section-head strong {
  color: var(--green);
  font-size: 12px;
  white-space: nowrap;
}

.sticker-map-teams {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
  gap: 6px;
}

.sticker-map-team {
  display: grid;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--slot-accent) 26%, var(--line));
  background: color-mix(in srgb, var(--slot-accent) 7%, #151814);
  border-radius: 6px;
  padding: 8px;
}

.sticker-map-team header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sticker-map-team header > div {
  min-width: 0;
}

.sticker-map-team header > div > .title-with-flag {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticker-map-team header > div > small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.sticker-map-team header strong {
  color: var(--green);
  font-size: 12px;
  white-space: nowrap;
}

.sticker-square-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 3px;
}

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

.sticker-square {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid rgba(241, 238, 228, 0.16);
  background: #2b2f2a;
  border-radius: 2px;
  padding: 0;
  cursor: pointer;
}

.sticker-square-code {
  position: absolute;
  inset: 1px;
  display: grid;
  grid-template-rows: min-content 1fr;
  align-items: center;
  justify-items: center;
  overflow: hidden;
  color: rgba(241, 238, 228, 0.82);
  line-height: 1;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}

.sticker-square-code small {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(4px, 0.42vw, 6px);
  font-weight: 900;
  line-height: 1;
  opacity: 0.72;
  text-overflow: clip;
}

.sticker-square-code strong {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(8px, 1vw, 13px);
  font-weight: 950;
  line-height: 0.92;
  text-overflow: clip;
}

.sticker-square:hover {
  border-color: var(--slot-accent);
}

.sticker-square.owned {
  border-color: rgba(241, 238, 228, 0.18);
  background: #40463e;
}

.sticker-square.duplicate {
  border-color: rgba(225, 190, 98, 0.72);
  background: var(--gold);
}

.sticker-square.owned span,
.sticker-square.duplicate span {
  color: #10130f;
}

.group-stack {
  display: grid;
  gap: 12px;
}

.group-panel {
  border: 1px solid #56533f;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 16%),
    #20251d;
  border-radius: var(--radius);
  padding: 12px;
}

.group-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(225, 190, 98, 0.22);
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.group-panel-head > div > span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.group-panel-head h3 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.2;
}

.group-panel-head strong {
  color: var(--green);
  font-size: 18px;
}

.team-lines {
  display: grid;
  gap: 10px;
}

.team-line {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.team-line-head {
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--slot-accent) 42%, var(--line));
  background: color-mix(in srgb, var(--slot-accent) 12%, #151814);
  border-radius: var(--radius);
  padding: 10px;
}

.team-line-head strong {
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
}

.team-line-head span {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-line-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.team-line-head .clear-team-button {
  justify-self: start;
  margin-top: 4px;
}

.team-line-stickers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 6px;
}

.group-view.card-size-compact .team-line {
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 6px;
}

.group-view.card-size-compact .team-line-head {
  padding: 7px;
}

.group-view.card-size-compact .team-line-head strong {
  font-size: 15px;
}

.group-view.card-size-compact .team-line-head span {
  font-size: 11px;
}

.group-view.card-size-compact .team-line-head em,
.group-view.card-size-compact .team-line-head .clear-team-button span {
  display: none;
}

.group-view.card-size-compact .team-line-stickers {
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 4px;
}

.group-view.card-size-large .team-line {
  grid-template-columns: 180px minmax(0, 1fr);
}

.group-view.card-size-large .team-line-stickers {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}

.group-view .sticker-slot {
  min-height: 78px;
}

.group-view.card-size-compact .sticker-slot {
  min-height: 34px;
  padding: 3px;
}

.group-view.card-size-large .sticker-slot {
  min-height: 138px;
}

.sticker-meta,
.sticker-status {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticker-status {
  justify-self: start;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 3px 6px;
  font-weight: 800;
}

.dashboard {
  border: 1px solid var(--line-soft);
  background: rgba(30, 33, 29, 0.94);
  border-radius: var(--radius);
  padding: 14px;
}

.dashboard.compact {
  max-height: 318px;
  overflow-x: hidden;
  overflow-y: auto;
}

.dashboard.expanded {
  width: 100%;
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard h2 {
  font-size: 20px;
  line-height: 1.05;
}

.dashboard p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.range-tabs {
  display: flex;
  gap: 4px;
  background: #151814;
  border-radius: var(--radius);
  padding: 4px;
}

.range-tabs button {
  border: 0;
  min-height: 28px;
  padding: 0 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.range-tabs button.is-active {
  background: var(--surface-3);
  color: var(--text);
}

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

.metric-card {
  min-height: 66px;
  background: #333632;
  border-radius: 6px;
  padding: 9px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 19px;
  line-height: 1;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 4px;
  margin-top: 12px;
}

.dashboard.expanded .activity-grid {
  grid-template-columns: repeat(26, 1fr);
}

.activity-cell {
  aspect-ratio: 1;
  min-width: 0;
  border: 0;
  border-radius: 3px;
  background: #333632;
  padding: 0;
  cursor: pointer;
}

.level-1 {
  background: rgba(66, 184, 131, 0.42);
}

.level-2 {
  background: rgba(112, 160, 255, 0.62);
}

.level-3 {
  background: rgba(112, 160, 255, 0.86);
}

.level-4 {
  background: #e1be62;
}

.activity-cell.is-active {
  outline: 1px solid rgba(241, 238, 228, 0.72);
  outline-offset: 1px;
}

.dashboard-note {
  margin-top: 10px;
}

.group-progress {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.group-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.bar {
  height: 8px;
  overflow: hidden;
  background: #333632;
  border-radius: 999px;
}

.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.trade-list,
.missing-table {
  display: grid;
  gap: 8px;
}

.trade-item,
.missing-row {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px;
}

.trade-item {
  grid-template-columns: 48px minmax(0, 1fr) auto;
}

.mini-sticker {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--slot-accent) 34%, #1a1d19);
  font-size: 13px;
  font-weight: 950;
}

.mini-sticker .team-flag {
  width: 24px;
  height: 16px;
}

.mini-sticker span:last-child {
  font-size: 10px;
  line-height: 1;
}

.trade-item strong,
.trade-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-item strong {
  font-size: 14px;
}

.trade-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.trade-item button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.missing-row {
  grid-template-columns: 86px 1fr 1fr 90px;
  width: 100%;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.missing-row span,
.missing-row small {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.missing-row em {
  color: var(--muted);
  font-style: normal;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.sync-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 12px;
}

.sync-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
}

.sync-card h3,
.sync-card p,
.sync-facts {
  margin: 0;
}

.sync-card h3 {
  font-size: 18px;
}

.sync-card p,
.sync-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.sync-input {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  background: #151814;
  color: var(--text);
  border-radius: var(--radius);
  outline: none;
  padding: 0 12px;
}

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

.sync-actions button {
  min-height: 52px;
  font-size: 12px;
}

.sync-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.connect-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 12px;
}

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

.trade-rule-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  background: #151814;
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trade-rule-grid input {
  accent-color: var(--green);
}

.trade-code {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border: 1px solid var(--line);
  background: #151814;
  color: var(--text);
  border-radius: var(--radius);
  outline: none;
  padding: 10px;
  font-size: 12px;
  line-height: 1.45;
}

.trade-link {
  min-height: 68px;
}

.visual-code {
  display: grid;
  grid-template-columns: repeat(17, 1fr);
  gap: 2px;
  width: min(100%, 326px);
  aspect-ratio: 1;
  border: 10px solid #f1eee4;
  background: #f1eee4;
  border-radius: 6px;
}

.visual-code span {
  background: #f1eee4;
  border-radius: 1px;
}

.visual-code span.is-filled {
  background: #151713;
}

.wide-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(66, 184, 131, 0.42);
  background: var(--green-soft);
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
}

.match-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
}

.match-panel h3,
.match-panel h4,
.match-panel p {
  margin: 0;
}

.match-panel p {
  color: var(--muted);
  font-size: 13px;
}

.match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.match-head span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.match-head h3 {
  margin-top: 3px;
  font-size: 20px;
}

.match-head button {
  min-height: 38px;
  border: 1px solid rgba(66, 184, 131, 0.44);
  background: var(--green-soft);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0 12px;
  cursor: pointer;
  font-weight: 900;
}

.direction-panel {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  border: 1px solid rgba(112, 160, 255, 0.36);
  background: rgba(112, 160, 255, 0.12);
  border-radius: var(--radius);
  padding: 12px;
}

.direction-panel svg {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  color: var(--blue);
  transform: rotate(20deg);
}

.direction-panel strong,
.direction-panel span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.direction-panel span {
  color: var(--muted);
  font-size: 13px;
}

.direction-panel.is-found {
  border-color: rgba(66, 184, 131, 0.42);
  background: var(--green-soft);
}

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

.trade-match-grid > div {
  display: grid;
  align-content: start;
  gap: 8px;
}

.trade-match-grid h4 {
  color: var(--gold);
  font-size: 13px;
  text-transform: uppercase;
}

.match-sticker {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 6px 10px;
  align-items: center;
  border: 1px solid var(--line-soft);
  background: #151814;
  border-radius: var(--radius);
  padding: 9px;
}

.match-sticker strong {
  color: var(--gold);
}

.match-sticker span,
.match-sticker em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-sticker em {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.sync-status {
  border: 1px solid var(--line);
  background: #151814;
  border-radius: var(--radius);
  padding: 10px;
}

.sync-status.ready {
  border-color: rgba(66, 184, 131, 0.36);
  color: var(--green);
}

.sync-status.syncing {
  border-color: rgba(225, 190, 98, 0.42);
  color: var(--gold);
}

.sync-status.error {
  border-color: rgba(239, 111, 97, 0.5);
  color: var(--red);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 9, 8, 0.72);
  backdrop-filter: blur(6px);
}

.confirm-modal {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  width: min(440px, 100%);
  border: 1px solid rgba(239, 111, 97, 0.36);
  background: #1d201c;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.form-modal {
  width: min(560px, 100%);
}

.form-modal form {
  display: grid;
  gap: 10px;
}

.form-modal .sync-input {
  min-height: 42px;
}

.form-modal textarea {
  min-height: 90px;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(239, 111, 97, 0.4);
  background: var(--red-soft);
  color: #ffd6d1;
  border-radius: var(--radius);
}

.confirm-modal h2,
.confirm-modal p {
  margin: 0;
}

.confirm-modal h2 {
  font-size: 20px;
}

.confirm-modal p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.confirm-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: end;
  gap: 8px;
}

.confirm-actions button {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.sync-facts {
  display: grid;
  gap: 8px;
}

.sync-facts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
}

.sync-facts dt {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sync-facts dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.analytics-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed,
  .app-shell:has(.side-rail.is-collapsed) {
    grid-template-columns: 72px minmax(0, 1fr);
  }

}

@media (max-width: 860px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    padding: 8px;
  }

  .side-rail {
    position: static;
    height: auto;
    overflow: visible;
  }

  .side-rail {
    padding: 10px;
  }

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

  .nav-button {
    justify-content: center;
    min-height: 44px;
    padding: 0 6px;
  }

  .nav-button span {
    display: none;
  }

  .filter-block {
    grid-template-columns: 1fr 1fr;
  }

  .filter-block .field-label {
    display: none;
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .page-rail {
    display: none;
  }

  .settings-panel {
    flex: none;
  }

  .sidebar-summary {
    order: 4;
  }

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

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) 38px minmax(48px, 1fr) 38px minmax(118px, auto) auto;
    min-width: 0;
    width: 100%;
  }

  .top-clear-button {
    min-width: 0;
  }

  .page-jump {
    min-width: 118px;
  }

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

  .sticker-map-toolbar {
    justify-content: stretch;
  }

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

  .quick-mode-group,
  .toolbar-button {
    width: 100%;
  }

  .quick-mode-button {
    flex: 1 1 86px;
  }

  .team-line,
  .group-view.card-size-compact .team-line,
  .group-view.card-size-large .team-line {
    grid-template-columns: 1fr;
  }

  .sync-layout {
    grid-template-columns: 1fr;
  }

  .connect-layout,
  .trade-match-grid {
    grid-template-columns: 1fr;
  }

  .public-nav,
  .public-nav div {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 42px 0 24px;
  }

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

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

  .workspace-header {
    align-items: start;
    flex-direction: column;
  }

  .workspace-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .status-legend {
    grid-template-columns: 10px auto 10px auto 10px auto;
  }

  .missing-row {
    grid-template-columns: 72px 1fr;
  }

  .missing-row em,
  .missing-row small {
    grid-column: 2;
  }
}

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

  .top-actions {
    gap: 6px;
    grid-template-columns: 36px minmax(44px, 1fr) 36px;
  }

  .top-clear-button {
    grid-column: span 3;
    min-height: 34px;
  }

  .page-jump {
    grid-column: 1 / -1;
    grid-template-columns: 28px minmax(0, 1fr) 36px;
    min-width: 0;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .install-button {
    grid-column: 1 / -1;
    justify-self: start;
    min-height: 36px;
    max-width: 72px;
    overflow: hidden;
    padding: 0 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

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

  .album-workspace,
  .list-view,
  .view-grid-single,
  .dashboard {
    padding: 10px;
  }

  .brand {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

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

  .metric-card {
    min-height: 58px;
  }

  .metric-card strong {
    font-size: 18px;
  }

  .activity-grid,
  .dashboard.expanded .activity-grid {
    grid-template-columns: repeat(13, 1fr);
  }

  .sticker-grid {
    gap: 8px;
  }

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

  .sticker-slot {
    min-height: 118px;
    padding: 8px;
  }

  .card-size-compact .sticker-slot {
    min-height: 44px;
  }

  .card-size-medium .sticker-slot {
    min-height: 56px;
  }

  .group-view.card-size-compact .team-line-stickers {
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  }

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

  .trade-item {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .trade-item button {
    grid-column: 1 / -1;
  }

  .public-page,
  .legal-page {
    width: min(100% - 16px, 1120px);
  }

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

  .public-hero h1,
  .legal-page h1 {
    font-size: 36px;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
