:root {
  --bg: #f5f3fb;
  --surface: #ffffff;
  --surface-2: #f0edf9;
  --text: #201c2c;
  --muted: #746f80;
  --line: #ded9eb;
  --brand: #5d35d7;
  --brand-2: #7a52ea;
  --accent: #f1bf35;
  --danger: #b42318;
  --success: #14804a;
  --warning: #9a6700;
  --shadow: 0 10px 30px rgba(54, 40, 96, .08);
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15131b;
    --surface: #211e2a;
    --surface-2: #2b2737;
    --text: #f4f1fb;
    --muted: #b5aec4;
    --line: #3b3549;
    --brand: #9b7cf5;
    --brand-2: #b39af8;
    --accent: #f0c755;
    --danger: #ff8a80;
    --success: #71d6a2;
    --warning: #f4cf68;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, color-mix(in srgb, var(--brand) 15%, transparent), transparent 32rem),
    var(--bg);
}
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  min-height: 70px;
  padding: 12px max(18px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; color: white; font-weight: 900; font-size: 1.3rem;
  background: linear-gradient(145deg, var(--brand-2), var(--brand));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: .72rem; margin-top: 1px; }
.user-nav { display: flex; align-items: center; gap: 14px; font-size: .9rem; }
.user-nav a, .link-button { color: var(--muted); text-decoration: none; }
.user-nav form { margin: 0; }
.link-button { padding: 0; border: 0; background: none; cursor: pointer; }
.user-name { font-weight: 700; }

.page-shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 26px 0 60px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero, .collection-hero { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.hero h1, .collection-hero h1, .narrow-panel h1 { margin: 4px 0 8px; letter-spacing: -.035em; font-size: clamp(1.8rem, 5vw, 3.1rem); line-height: 1; }
.hero p, .collection-hero p { margin: 0; max-width: 700px; }
.compact-hero { align-items: center; }
.eyebrow { margin: 0; color: var(--brand); font-size: .75rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.muted { color: var(--muted); }
.back-link { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 8px; font-size: .9rem; }

.primary-button, .secondary-button, .danger-button {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: 12px; font-weight: 750; text-decoration: none; cursor: pointer;
}
.primary-button { color: white; border: 1px solid var(--brand); background: var(--brand); }
.secondary-button { color: var(--text); border: 1px solid var(--line); background: var(--surface); }
.danger-button { min-height: 42px; padding: 9px 15px; border-radius: 12px; font-weight: 750; cursor: pointer; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line)); background: var(--surface); }
.primary-button:hover { filter: brightness(1.04); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

.collection-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.collection-card { display: block; padding: 22px; text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
.collection-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.collection-card h2 { margin: 24px 0 5px; font-size: 1.35rem; }
.collection-card p { color: var(--muted); margin: 0 0 20px; }
.collection-season { color: var(--brand); font-weight: 850; font-size: .8rem; }
.card-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .75rem; border-top: 1px solid var(--line); padding-top: 13px; }
.empty-state { padding: 32px; text-align: center; }
.empty-state p { color: var(--muted); }

.narrow-panel { width: min(520px, 100%); margin: 5vh auto 0; padding: 28px; }
.auth-card { margin-top: 9vh; }
.stack-form { display: grid; gap: 16px; margin-top: 24px; }
.stack-form label { display: grid; gap: 7px; font-weight: 700; font-size: .9rem; }
.stack-form input, .stack-form select, .controls input, .controls select {
  width: 100%; min-height: 44px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 9px 12px; outline: none;
}
.stack-form input:focus, .stack-form select:focus, .controls input:focus, .controls select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.form-error, .errorlist { color: var(--danger); }
.errorlist { margin: 0; padding-left: 18px; font-weight: 500; }

.flash-stack { width: min(1180px, calc(100% - 28px)); margin: 14px auto -8px; }
.flash { padding: 11px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; }

.sync-indicator { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; border: 1px solid var(--line); background: var(--surface); padding: 9px 12px; border-radius: 999px; font-size: .82rem; color: var(--muted); }
.sync-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--muted); }
.sync-indicator[data-state="online"] .sync-dot { background: var(--success); }
.sync-indicator[data-state="offline"] .sync-dot { background: var(--warning); }
.sync-indicator[data-state="syncing"] .sync-dot { background: var(--brand); animation: pulse 1s infinite alternate; }
.sync-indicator[data-state="error"] .sync-dot { background: var(--danger); }
@keyframes pulse { from { opacity: .35; transform: scale(.8); } to { opacity: 1; transform: scale(1.15); } }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 10px; }
.stat { padding: 16px 18px; display: grid; gap: 2px; }
.stat strong { font-size: clamp(1.35rem, 4vw, 2rem); line-height: 1; }
.stat span { color: var(--muted); font-size: .78rem; }
.progress-panel { padding: 15px 18px; margin-bottom: 10px; }
.progress-label { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .78rem; margin-bottom: 9px; }
.progress-track { height: 9px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .2s ease; }

.controls { display: grid; grid-template-columns: minmax(250px, 2fr) minmax(130px, .75fr) minmax(170px, 1fr) minmax(140px, .8fr) auto; gap: 10px; align-items: end; padding: 14px; margin-bottom: 16px; position: sticky; top: 82px; z-index: 12; }
.controls label { display: grid; gap: 5px; color: var(--muted); font-size: .72rem; font-weight: 750; }
.compact-check { min-height: 44px; display: flex !important; flex-direction: row !important; align-items: center; gap: 8px !important; padding: 0 8px; white-space: nowrap; }
.compact-check input { width: auto; min-height: auto; accent-color: var(--brand); }

.notice { margin: 0 0 14px; padding: 11px 14px; border-radius: 12px; background: color-mix(in srgb, var(--warning) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warning) 32%, var(--line)); font-size: .86rem; }
.notice.warning { color: var(--warning); }

.sticker-groups { display: grid; gap: 12px; }
.sticker-group { overflow: hidden; }
.group-header { width: 100%; border: 0; background: var(--surface); color: var(--text); padding: 15px 17px; display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; text-align: left; border-left: 5px solid var(--group-accent, var(--brand)); }
.group-heading { min-width: 0; }
.group-heading strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-heading small { color: var(--muted); }
.group-progress { min-width: 108px; display: grid; justify-items: end; gap: 5px; color: var(--muted); font-size: .75rem; }
.group-mini-track { width: 96px; height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.group-mini-fill { height: 100%; background: var(--group-accent, var(--brand)); }
.group-body { border-top: 1px solid var(--line); }
.group-body[hidden] { display: none; }

.sticker-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 14px 11px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sticker-row:last-child { border-bottom: 0; }
.sticker-row[data-owned="true"] { background: color-mix(in srgb, var(--success) 5%, var(--surface)); }
.sticker-row[data-unassigned="true"] .sticker-name { font-style: italic; color: var(--muted); }
.sticker-row[data-active="false"] { opacity: .72; }
.sticker-main { min-width: 0; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; align-items: center; }
.sticker-code { width: 42px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); font-weight: 850; font-size: .82rem; font-variant-numeric: tabular-nums; }
.sticker-name { min-width: 0; font-weight: 720; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticker-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: .72rem; margin-top: 3px; }
.badge { padding: 2px 6px; border-radius: 999px; border: 1px solid var(--line); }
.badge.archived { color: var(--warning); }
.quantity-control { display: grid; grid-template-columns: 34px 42px 34px; gap: 5px; align-items: center; }
.quantity-control button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text); cursor: pointer; font-weight: 900; font-size: 1.1rem; }
.quantity-control button:disabled { opacity: .35; cursor: not-allowed; }
.quantity { text-align: center; font-variant-numeric: tabular-nums; font-weight: 850; }
.dupe-count { color: var(--brand); font-size: .68rem; font-weight: 800; text-align: center; margin-top: 1px; min-height: 1em; }

body.compact .sticker-row { padding-top: 6px; padding-bottom: 6px; }
body.compact .sticker-code { height: 28px; }
body.compact .sticker-meta { display: none; }
body.compact .quantity-control button { width: 30px; height: 30px; }
body.compact .quantity-control { grid-template-columns: 30px 36px 30px; }

@media (max-width: 780px) {
  .site-header { min-height: 60px; }
  .brand small, .user-name { display: none; }
  .user-nav { gap: 10px; }
  .page-shell { width: min(100% - 18px, 1180px); padding-top: 18px; }
  .hero, .collection-hero { align-items: flex-start; flex-direction: column; }
  .compact-hero { flex-direction: row; align-items: center; }
  .collection-hero { gap: 14px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .controls { top: 69px; grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .compact-check { justify-content: flex-start; }
  .sticker-row { padding-left: 12px; }
  .sticker-main { grid-template-columns: 40px minmax(0, 1fr); gap: 8px; }
  .sticker-code { width: 38px; }
}

@media (max-width: 500px) {
  .compact-hero { flex-direction: column; align-items: stretch; }
  .controls { grid-template-columns: 1fr; position: static; }
  .search-field { grid-column: auto; }
  .progress-label { flex-direction: column; gap: 2px; }
  .sticker-row { gap: 6px; }
  .sticker-name { font-size: .91rem; }
  .quantity-control { grid-template-columns: 32px 34px 32px; gap: 3px; }
  .quantity-control button { width: 32px; height: 32px; }
  .group-progress { min-width: 92px; }
  .group-mini-track { width: 78px; }
}

/* 0.2 — ações, listas e coleções partilhadas */
.collection-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.sync-indicator > span:last-child { display: grid; gap: 1px; }
.sync-indicator small { font-size: .64rem; color: var(--muted); }
.secondary-button:disabled { opacity: .5; cursor: wait; }
.stat-button { appearance: none; color: var(--text); border: 1px solid var(--line); text-align: left; cursor: pointer; }
.stat-button:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); transform: translateY(-1px); }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.soft-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .72rem; font-weight: 750; }
.dashboard-progress { display: grid; gap: 7px; margin: 0 0 13px; }
.dashboard-progress > div:first-child { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: .76rem; }
.dashboard-progress strong { color: var(--text); font-size: 1.15rem; }
.collection-mini-stats { display: flex; gap: 12px; color: var(--muted); font-size: .76rem; margin-bottom: 14px; }
.collection-mini-stats strong { color: var(--text); }

.lists-dialog { width: min(680px, calc(100% - 20px)); max-height: min(86vh, 760px); border: 0; padding: 0; background: transparent; color: var(--text); }
.lists-dialog::backdrop { background: rgba(16, 13, 25, .5); backdrop-filter: blur(4px); }
.dialog-shell { padding: 20px; }
.dialog-header { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 14px; }
.dialog-header h2 { margin: 3px 0 0; }
.icon-button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 1.5rem; cursor: pointer; }
.dialog-select { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 750; }
.dialog-select select { min-height: 42px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); }
.list-output { width: 100%; min-height: 330px; resize: vertical; margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); font: 500 .84rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.dialog-feedback { min-height: 1.2em; margin: 8px 0 0; color: var(--success); font-size: .78rem; text-align: right; }

.members-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 14px; align-items: start; }
.members-panel { padding: 22px; }
.members-panel h2 { margin: 0 0 14px; }
.member-list { display: grid; }
.member-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.member-identity { display: grid; gap: 2px; }
.member-identity span { color: var(--muted); font-size: .76rem; }
.member-actions, .inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.inline-form select { min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); }

@media (max-width: 900px) {
  .controls { grid-template-columns: 1fr 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .members-layout { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .collection-actions { justify-content: flex-start; width: 100%; }
  .collection-actions .sync-indicator { margin-left: auto; }
}

@media (max-width: 500px) {
  .collection-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .collection-actions .sync-indicator { grid-column: 1 / -1; margin-left: 0; justify-self: stretch; justify-content: center; }
  .controls { grid-template-columns: 1fr; }
  .dialog-actions > * { flex: 1 1 auto; }
  .list-output { min-height: 280px; }
  .member-row { align-items: flex-start; flex-direction: column; }
  .member-actions { width: 100%; }
}

/* 0.3 — marcação rápida e administração orientada a tarefas */
.collection-hint { margin: -5px 0 14px; color: var(--muted); font-size: .76rem; }
.sticker-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; padding-left: 12px; transition: background .15s ease; }
.owned-check { width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; position: relative; }
.owned-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.owned-checkmark { width: 27px; height: 27px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 8px; color: transparent; background: var(--surface-2); font-size: .9rem; font-weight: 900; transition: all .12s ease; }
.owned-check input:checked + .owned-checkmark { color: white; border-color: var(--success); background: var(--success); }
.owned-check input:focus-visible + .owned-checkmark { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 2px; }
.owned-check input:disabled + .owned-checkmark { opacity: .55; cursor: not-allowed; }
.sticker-main { width: 100%; border: 0; padding: 4px 5px; margin: -4px -5px; background: transparent; color: inherit; text-align: left; border-radius: 10px; cursor: pointer; font: inherit; }
.sticker-main:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.sticker-main:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 32%, transparent); outline-offset: 2px; }
.sticker-main:disabled { cursor: default; }
.sticker-copy { min-width: 0; display: block; }
.sticker-name { display: block; }
.quantity-block { min-width: 116px; }
.sticker-row[data-owned="true"] .sticker-code { background: color-mix(in srgb, var(--success) 12%, var(--surface-2)); }

.management-hero { margin-bottom: 12px; }
.management-nav { display: flex; gap: 5px; overflow-x: auto; padding: 5px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); scrollbar-width: thin; }
.management-nav a { flex: 0 0 auto; padding: 9px 12px; border-radius: 9px; color: var(--muted); font-size: .8rem; font-weight: 800; text-decoration: none; }
.management-nav a:hover, .management-nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.management-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.management-stats > div { padding: 16px 18px; display: grid; gap: 3px; }
.management-stats strong { font-size: 1.55rem; }
.management-stats span { color: var(--muted); font-size: .75rem; }
.management-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.management-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.management-card { display: flex; gap: 14px; padding: 18px; color: var(--text); text-decoration: none; align-items: flex-start; }
a.management-card:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); transform: translateY(-1px); }
.management-card h2 { margin: 0 0 5px; font-size: 1rem; }
.management-card p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.management-card-icon { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--brand) 12%, var(--surface-2)); color: var(--brand); font-weight: 900; }
.management-card-form { padding: 0; }
.management-card-form button { width: 100%; min-height: 100%; display: flex; align-items: flex-start; gap: 14px; padding: 18px; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.management-card-form strong { display: block; font-size: 1rem; margin-bottom: 5px; }
.management-card-form small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.static-card { cursor: default; }
.static-card .card-topline { align-items: flex-start; }
.static-card h2 { margin-right: 8px; }
.concept-panel, .management-section, .form-panel { padding: 20px; margin-bottom: 14px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 15px; }
.section-heading h2, .management-section h2, .form-panel h2 { margin: 2px 0 0; }
.section-heading a { font-size: .8rem; font-weight: 800; }
.concept-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.concept-grid.one-column { grid-template-columns: 1fr; }
.concept-grid > div { padding: 14px; border-radius: 11px; background: var(--surface-2); }
.concept-grid strong { font-size: .87rem; }
.concept-grid p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.simple-list { display: grid; }
.simple-list > div { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(100px, .8fr) auto; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.simple-list > div:last-child { border-bottom: 0; }
.simple-list span, .simple-list small { color: var(--muted); font-size: .76rem; }
.responsive-table { overflow-x: auto; }
.responsive-table table { width: 100%; border-collapse: collapse; min-width: 720px; }
.responsive-table th { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 10px 9px; border-bottom: 1px solid var(--line); }
.responsive-table td { padding: 12px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .82rem; }
.responsive-table tr:last-child td { border-bottom: 0; }
.responsive-table td > strong { display: block; }
.responsive-table td > small { display: block; color: var(--muted); margin-top: 2px; }
.status-pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: .69rem; font-weight: 800; background: var(--surface-2); color: var(--muted); }
.status-pill.ok { background: color-mix(in srgb, var(--success) 13%, var(--surface)); color: var(--success); }
.status-pill.off { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); }
.table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.secondary-button.small { min-height: 34px; padding: 6px 9px; font-size: .72rem; }
.link-button.danger { color: var(--danger); }
.definition-list, .system-list { margin: 10px 0 0; display: grid; }
.definition-list > div, .system-list > div { display: flex; justify-content: space-between; gap: 15px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.definition-list > div:last-child, .system-list > div:last-child { border-bottom: 0; }
.definition-list dt, .system-list dt { color: var(--muted); font-size: .76rem; }
.definition-list dd, .system-list dd { margin: 0; font-weight: 800; font-size: .78rem; text-align: right; }
.narrow-panel { max-width: 600px; }
.management-two-columns { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 14px; align-items: start; }
.compact-concepts { margin-bottom: 14px; }
.diff-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.diff-stats > div { padding: 11px; background: var(--surface-2); border-radius: 10px; display: grid; gap: 2px; }
.diff-stats strong { font-size: 1.15rem; }
.diff-stats span { color: var(--muted); font-size: .7rem; }
.diff-list { display: grid; margin-top: 10px; }
.diff-list > div { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(180px, .6fr) 1fr; gap: 12px; }
.diff-list span { color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.table-progress { display: grid; gap: 2px; }
.table-progress span { color: var(--muted); font-size: .72rem; }
.advanced-admin-note { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.advanced-admin-note p { margin: 5px 0 0; color: var(--muted); max-width: 700px; }
.system-list code { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .management-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .concept-grid { grid-template-columns: repeat(2, 1fr); }
  .management-two-columns { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .sticker-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 7px; padding-left: 8px; }
  .quantity-block { min-width: 104px; }
  .management-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .management-grid, .management-grid-3 { grid-template-columns: 1fr; }
  .concept-grid { grid-template-columns: 1fr; }
  .simple-list > div { grid-template-columns: 1fr; gap: 2px; }
  .diff-stats { grid-template-columns: repeat(2, 1fr); }
  .advanced-admin-note { align-items: stretch; flex-direction: column; }
  .sticker-row { grid-template-columns: 30px minmax(0, 1fr) auto; padding-right: 8px; }
  .owned-check { width: 30px; }
  .owned-checkmark { width: 25px; height: 25px; }
  .quantity-block { min-width: 100px; }
}

.stacked-form { display: grid; gap: 14px; }
.stacked-form p { margin: 0; display: grid; gap: 6px; }
.stacked-form label { font-weight: 750; font-size: .82rem; }
.stacked-form input, .stacked-form select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--text); }
.stacked-form input[type="checkbox"] { width: auto; min-height: auto; justify-self: start; }
.stacked-form .helptext, .stacked-form p > span.helptext { color: var(--muted); font-size: .73rem; font-weight: 500; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.stack-form label small { color: var(--muted); font-weight: 500; line-height: 1.35; }

/* 0.4 — edições, trocas e impressão */
.controls { grid-template-columns: minmax(220px, 1.7fr) minmax(125px, .7fr) minmax(155px, .9fr) minmax(125px, .7fr) minmax(120px, .65fr) auto; }
.dialog-note { margin: 8px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.trade-help { padding: 16px 18px; margin-bottom: 14px; }
.trade-help p { margin: 4px 0 0; color: var(--muted); line-height: 1.45; }
.trade-collection-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap:12px; margin-bottom:14px; }
.trade-collection-card { padding:18px; display:flex; justify-content:space-between; align-items:center; gap:16px; }
.trade-collection-card h2 { margin:3px 0 4px; }
.trade-match-list { display:grid; }
.trade-match-row { display:grid; grid-template-columns:minmax(180px,1fr) auto auto; gap:16px; align-items:center; padding:13px 0; border-bottom:1px solid var(--line); }
.trade-match-row:last-child { border-bottom:0; }
.trade-match-row > div:first-child { display:grid; gap:2px; }
.trade-match-row > div:first-child span { color:var(--muted); font-size:.76rem; }
.trade-match-stats { display:flex; gap:14px; color:var(--muted); font-size:.75rem; }
.trade-match-stats strong { color:var(--text); }
.trade-columns { display:grid; grid-template-columns:1fr 1fr; gap:14px; align-items:start; margin-bottom:14px; }
.trade-select-panel { padding:20px; }
.trade-select-panel h2 { margin:3px 0 14px; font-size:1.1rem; }
.trade-sticker-option { display:grid; grid-template-columns:26px minmax(0,1fr) auto; gap:10px; align-items:center; padding:10px 0; border-bottom:1px solid var(--line); cursor:pointer; }
.trade-sticker-option:last-child { border-bottom:0; }
.trade-sticker-option input { width:20px; height:20px; accent-color:var(--brand); }
.trade-sticker-option > span:nth-child(2) { display:grid; gap:2px; }
.trade-sticker-option small { color:var(--muted); }
.trade-message { padding:18px; }
.trade-message label { display:grid; gap:6px; font-weight:750; }
.trade-message textarea { width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:11px; background:var(--surface-2); color:var(--text); font:inherit; resize:vertical; }
.trade-status { display:inline-flex; padding:7px 11px; border-radius:999px; background:var(--surface-2); font-size:.78rem; font-weight:850; }
.trade-status-accepted { color:var(--brand); background:color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.trade-status-completed { color:var(--success); background:color-mix(in srgb, var(--success) 11%, var(--surface)); }
.trade-status-rejected, .trade-status-cancelled { color:var(--muted); }
.trade-summary-item { display:grid; gap:2px; padding:9px 0; border-bottom:1px solid var(--line); }
.trade-summary-item:last-child { border-bottom:0; }
.trade-summary-item span { color:var(--muted); font-size:.78rem; }
.trade-actions-panel { padding:20px; display:grid; gap:12px; }
.trade-actions-panel h2, .trade-actions-panel p { margin:0; }
.confirmation-grid { display:flex; gap:8px; flex-wrap:wrap; }
.success-text { color:var(--success); }
.badge.edition { color:var(--brand); border-color:color-mix(in srgb, var(--brand) 30%, var(--line)); }

@media (max-width: 1000px) {
  .controls { grid-template-columns: repeat(3, 1fr); }
  .search-field { grid-column:1 / -1; }
}
@media (max-width: 780px) {
  .trade-columns { grid-template-columns:1fr; }
  .trade-match-row { grid-template-columns:1fr auto; }
  .trade-match-row .trade-match-stats { grid-column:1 / -1; }
  .trade-collection-card { align-items:flex-start; flex-direction:column; }
}
@media (max-width: 500px) {
  .controls { grid-template-columns:1fr; }
  .trade-match-row { grid-template-columns:1fr; }
  .trade-sticker-option { grid-template-columns:24px minmax(0,1fr); }
  .trade-sticker-option .status-pill { grid-column:2; justify-self:start; }
}

/* 0.5 — navegação rápida entre secções */
.sticker-groups { margin-bottom: 82px; }
.sticker-group { scroll-margin-top: 180px; }
.section-dock {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 24px));
  min-height: 52px;
  z-index: 19;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 12px 38px rgba(35, 25, 66, .18);
  backdrop-filter: blur(16px);
}
.section-dock-actions { display: flex; flex: 0 0 auto; gap: 5px; padding-right: 7px; border-right: 1px solid var(--line); }
.dock-action, .section-jump-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 850;
  font-size: .7rem;
  cursor: pointer;
}
.dock-action { display: inline-flex; align-items: center; gap: 4px; padding: 6px 9px; white-space: nowrap; }
.section-jump-list {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  padding: 1px 2px 3px;
}
.section-jump-button {
  flex: 0 0 auto;
  min-width: 40px;
  padding: 5px 8px;
  scroll-snap-align: center;
}
.section-jump-button:hover:not(:disabled), .dock-action:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.section-jump-button.is-current { color: #fff; border-color: var(--brand); background: var(--brand); }
.section-jump-button:disabled { opacity: .28; cursor: default; }

@media (max-width: 780px) {
  .sticker-group { scroll-margin-top: 148px; }
  .section-dock { width: calc(100% - 14px); bottom: max(7px, env(safe-area-inset-bottom)); border-radius: 14px; }
  .dock-action { padding-inline: 8px; }
}
@media (max-width: 500px) {
  .sticker-groups { margin-bottom: 74px; }
  .sticker-group { scroll-margin-top: 70px; }
  .section-dock { min-height: 48px; padding: 5px; gap: 5px; }
  .section-dock-actions { gap: 3px; padding-right: 5px; }
  .dock-action { width: 35px; min-height: 35px; padding: 5px; justify-content: center; font-size: .82rem; }
  .dock-action span { display: none; }
  .section-jump-list { gap: 4px; }
  .section-jump-button { min-width: 37px; min-height: 35px; padding: 5px 7px; font-size: .66rem; }
}
