@charset "UTF-8";
:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: #fff;
  --soft: #f8f9fd;
  --text: #202b45;
  --muted: #747f97;
  --border: #e7ebf3;
  --primary: #5063e6;
  --primary-soft: #edf0ff;
  --green: #218c74;
  --green-soft: #e8f8f1;
  --red: #c54b61;
  --shadow: 0 12px 44px #2435640d;
  --nav: #fff;
  --chart: #586aea;
  font-size: 16px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101623;
  --surface: #192233;
  --soft: #1e293d;
  --text: #e7ebf5;
  --muted: #9ba9c1;
  --border: #2b374d;
  --primary: #98a6ff;
  --primary-soft: #293453;
  --green: #79d6b3;
  --green-soft: #183c37;
  --red: #f093a5;
  --shadow: 0 12px 44px #0002;
  --nav: #151e2e;
  --chart: #98a6ff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
button {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 17px;
  min-height: 42px;
  font-size: 0.9rem;
  font-weight: 600;
}
.primary {
  background: var(--primary);
  color: var(--surface);
}
[data-theme="dark"] .primary {
  color: #101623;
}
.primary:hover {
  filter: brightness(0.94);
}
.secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.secondary:hover,
.quiet:hover {
  background: var(--soft);
}
.quiet {
  background: transparent;
  color: var(--muted);
  padding: 8px 11px;
}
.full {
  width: 100%;
}
.icon-button,
.theme-button {
  background: transparent;
  color: var(--muted);
  padding: 7px;
  min-width: 42px;
  font-size: 1.25rem;
  border-radius: 10px;
}
.theme-button:hover,
.icon-button:hover {
  background: var(--soft);
}
.muted {
  color: var(--muted);
  font-size: 0.9rem;
}
small {
  font-size: 0.8rem;
  color: var(--muted);
}
.eyebrow {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--primary);
  font-weight: 700;
}
.error {
  color: var(--red);
  font-size: 0.9rem;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 1.8rem;
  letter-spacing: -0.04em;
  line-height: 1.35;
  margin-bottom: 9px;
}
h2 {
  font-size: 1.25rem;
  line-height: 1.4;
  margin-bottom: 8px;
}
h3 {
  font-size: 1rem;
  margin-bottom: 3px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  letter-spacing: 0.03em;
  font-size: 1.4rem;
  white-space: nowrap;
}
.brand-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #5063e6;
  color: #fff;
  font-weight: 750;
  font-size: 1.25rem;
}
.brand-icon img {
  width: 100%;
  height: 100%;
}
.brand-tag {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  margin-left: 3px;
}
.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}
aside {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--nav);
  border-right: 1px solid var(--border);
  padding: 30px 20px 24px;
}
aside > .brand {
  margin-bottom: 34px;
  padding-left: 10px;
}
.nav-label {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0 15px;
  margin: 0 0 10px;
  letter-spacing: 0.06em;
}
nav {
  overflow: auto;
}
nav a {
  display: flex;
  align-items: center;
  gap: 13px;
  border-radius: 9px;
  padding: 10px 15px;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 5px;
  min-height: 44px;
}
nav a > span {
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  color: inherit;
}
nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 650;
}
nav a:hover {
  background: var(--soft);
}
nav .nav-label {
  margin-top: 29px;
}
.sidebar-note {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding: 20px 10px 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.sidebar-note small {
  display: block;
  font-size: 0.68rem;
  margin-top: 3px;
}
.mini-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
}
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  gap: 15px;
}
.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}
.topbar-left {
  min-width: 0;
  gap: 10px;
}
.topbar-actions {
  flex-shrink: 0;
  gap: 10px;
}
.topbar h1 {
  font-size: 1.125rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
}
.page-help {
  position: relative;
  flex-shrink: 0;
}
.page-help summary {
  display: grid;
  place-items: center;
  width: 34px;
  height: 38px;
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  font-size: 1.1rem;
  border-radius: 8px;
}
.page-help summary::-webkit-details-marker {
  display: none;
}
.page-help summary:hover {
  background: var(--soft);
}
.page-help > div {
  position: absolute;
  z-index: 20;
  left: 0;
  top: calc(100% + 8px);
  width: 340px;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.875rem;
  color: var(--muted);
}
.page-help p {
  margin: 0;
}
.page-help p + p {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
#page-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.user-label {
  font-size: 0.8rem;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-actions .quiet {
  font-size: 0.8rem;
  padding: 7px 9px;
}
.mobile-only {
  display: none;
}
main {
  width: 100%;
  max-width: 1620px;
  margin: auto;
  flex: 1;
  padding: 20px 24px 24px;
}
.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--surface);
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
}
label {
  display: block;
  font-size: 0.82rem;
  font-weight: 550;
}
label > input,
label > select,
label > textarea {
  display: block;
  margin-top: 8px;
  width: 100%;
}
input,
select,
textarea {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 9px 11px;
  min-height: 42px;
  min-width: 0;
  font-size: 0.88rem;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4 3 3 3-3' fill='none' stroke='%238a96ab' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
}
.filters label {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 0.875rem;
  color: var(--muted);
}
.filters label > input,
.filters label > select {
  margin-top: 0;
}
.filters .game-choice {
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}
.filters .game-choice select {
  flex: 1;
  width: 0;
  min-width: 140px;
}
.scope-secondary select {
  width: 150px;
}
.filter-toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
  padding: 3px 10px;
  min-width: 120px;
}
.filter-toggle > span:first-child {
  font-size: 0.875rem;
}
.filter-toggle > span:last-child {
  font-size: 0.75rem;
  color: var(--muted);
}
.advanced-filters {
  display: none;
  width: 100%;
}
.filters.is-expanded .advanced-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.catalog-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
}
.catalog-toolbar input {
  flex: 1;
  min-width: 220px;
  max-width: 460px;
  background: var(--soft);
}
.catalog-toolbar select {
  width: 160px;
}
.catalog-total {
  font-size: 0.875rem;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}
.catalog-chip {
  font-size: 0.8125rem;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 8px;
  border-radius: 6px;
}
.config-panel th,
.config-panel td {
  padding: 10px 14px;
}
.config-panel .table-actions {
  white-space: nowrap;
}
.config-panel .table-title {
  font-weight: 600;
}
.id-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.id-group code {
  font:
    0.8125rem ui-monospace,
    Consolas,
    monospace;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 5px;
  padding: 2px 5px;
  user-select: all;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.copy-button {
  font-size: 0.75rem;
  background: transparent;
  color: var(--muted);
  min-height: 30px;
  padding: 3px 5px;
  white-space: nowrap;
}
.copy-button:hover {
  color: var(--primary);
  background: var(--soft);
}
.config-lines {
  display: grid;
  gap: 3px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.config-lines > span {
  display: block;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.config-lines b {
  font-weight: 500;
  color: var(--text);
}
.text-good {
  color: var(--green);
}
.linked-count {
  padding: 3px 5px;
  min-height: 34px;
  color: var(--primary);
  background: transparent;
  white-space: nowrap;
  font-size: 0.875rem;
}
.linked-count:hover {
  background: var(--primary-soft);
}
.clipboard-fallback {
  position: fixed;
  left: -9999px;
  top: 0;
}
.filters input {
  width: 147px;
}
.filters button {
  font-size: 0.82rem;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
.metric-card {
  padding: 22px 22px 19px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.metric-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 15px;
}
.metric-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}
.metric-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.metric-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 11px;
}
.metric-sub strong {
  color: var(--green);
  font-weight: 500;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  overflow: hidden;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 21px 23px 15px;
}
.panel-heading p {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}
.panel-body {
  padding: 0 23px 20px;
}
.chart-wrap {
  padding: 4px 12px 10px;
  overflow: auto;
}
.chart {
  width: 100%;
  min-width: 480px;
  display: block;
  height: 260px;
}
.chart-grid {
  stroke: var(--border);
  stroke-dasharray: 4 5;
}
.chart-label {
  fill: var(--muted);
  font-size: 12px;
}
.chart-line {
  fill: none;
  stroke: var(--chart);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-point {
  fill: var(--surface);
  stroke: var(--chart);
  stroke-width: 2;
}
.chart-area {
  fill: var(--primary-soft);
  opacity: 0.55;
}
.chart-legend {
  display: flex;
  gap: 15px;
  font-size: 0.75rem;
  color: var(--muted);
  align-items: center;
}
.legend-line {
  width: 17px;
  height: 3px;
  background: var(--chart);
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}
.table-scroll {
  overflow: auto;
  max-width: 100%;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  font-size: 0.84rem;
}
th {
  font-weight: 500;
  color: var(--muted);
  background: var(--soft);
  padding: 12px 22px;
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--soft);
}
.table-title {
  font-weight: 600;
}
.table-secondary {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 3px;
}
.tag {
  font-size: 0.72rem;
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
}
.tag.good {
  background: var(--green-soft);
  color: var(--green);
}
.tag.warn {
  background: #f3aa2920;
  color: #af7b16;
}
[data-theme="dark"] .tag.warn {
  color: #f3c15d;
}
.tag.bad {
  background: #c54b6114;
  color: var(--red);
}
.table-actions {
  display: flex;
  gap: 8px;
}
.table-actions button {
  padding: 5px 10px;
  min-height: 36px;
  font-size: 0.78rem;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  border-top: 1px solid var(--border);
  padding: 14px 22px;
  font-size: 0.78rem;
  color: var(--muted);
}
.pagination > div {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pagination button {
  padding: 5px 10px;
  font-size: 0.78rem;
  min-height: 36px;
}
.empty {
  padding: 65px 25px;
  text-align: center;
}
.empty-mark {
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 18px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  font-size: 1.6rem;
}
.empty h3 {
  margin-bottom: 8px;
}
.empty p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 15px;
}
.notice {
  display: flex;
  gap: 12px;
  align-items: start;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 22px;
}
.notice.warn {
  border-color: #daa43c70;
  background: #daa43c09;
}
.notice strong {
  color: var(--text);
}
.sync-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.sync-item {
  background: var(--soft);
  padding: 14px 15px;
  border-radius: 9px;
}
.sync-item strong {
  font-size: 0.82rem;
  font-weight: 600;
  display: block;
  margin-bottom: 5px;
}
.sync-item p {
  font-size: 0.75rem;
  margin: 4px 0 0;
  color: var(--muted);
}
.payload {
  font-size: 0.75rem;
  color: var(--muted);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.retention-cell {
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  font-weight: 600;
}
.retention-cell small {
  display: block;
  font-weight: 400;
}
.loading {
  padding: 70px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.loading::before {
  content: "";
  display: block;
  width: 26px;
  height: 26px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 18px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
footer {
  padding: 0 36px 25px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.72rem;
}
dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 30px 90px #0003;
  width: min(680px, calc(100% - 32px));
  max-height: 90dvh;
  padding: 0;
  overflow: auto;
}
dialog::backdrop {
  background: #0a14286b;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  padding: 23px 26px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  gap: 15px;
}
.dialog-heading .eyebrow {
  margin-bottom: 5px;
}
.dialog-heading h2 {
  margin: 0;
}
.editor-fields {
  padding: 22px 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 19px;
}
.editor-fields .wide {
  grid-column: 1/-1;
}
.editor-fields label {
  font-size: 0.86rem;
}
.editor-fields small {
  display: block;
  font-weight: 400;
  margin-top: 6px;
}
.editor-fields textarea {
  min-height: 150px;
  line-height: 1.6;
  resize: vertical;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
}
.editor-fields details {
  grid-column: 1/-1;
}
.editor-fields summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 0.85rem;
  padding: 7px 0;
}
.editor-fields details > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding-top: 17px;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  align-self: end;
}
.check-label input {
  width: 19px;
  height: 19px;
  min-height: 0;
  margin: 0;
  accent-color: var(--primary);
}
.dialog-footer {
  padding: 17px 26px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--soft);
}
#editor-error {
  margin: 0 26px 17px;
}
#publish-dialog > form > p {
  margin: 18px 26px;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--surface);
  padding: 12px 21px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  z-index: 100;
  max-width: calc(100% - 30px);
}
.login-shell {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100dvh;
}
.login-art {
  padding: 45px 65px;
  background: #182853;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  position: relative;
  overflow: hidden;
}
.login-art::after {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  border: 70px solid #536de714;
  border-radius: 50%;
  right: -220px;
  bottom: -120px;
  pointer-events: none;
}
.login-art .brand-tag {
  color: #aabadd;
  border-color: #ffffff26;
}
.login-art .eyebrow {
  color: #9aacff;
}
.login-art h1 {
  font-size: 3.4rem;
  line-height: 1.4;
  margin: 20px 0;
}
.login-art p {
  color: #bbc7df;
  line-height: 2;
  font-size: 0.95rem;
}
.login-art small {
  color: #8a9cc1;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
}
.art-grid {
  display: flex;
  gap: 30px;
  margin-top: 35px;
  position: relative;
  z-index: 1;
}
.art-grid > div {
  border-left: 2px solid #7184d5;
  padding-left: 14px;
}
.art-grid span {
  display: block;
  color: #a2b3d8;
  font-size: 0.75rem;
  margin-bottom: 6px;
}
.art-grid strong {
  font-size: 0.84rem;
  font-weight: 500;
}
.login-panel {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  position: relative;
}
.login-panel > .theme-button {
  position: absolute;
  right: 28px;
  top: 25px;
}
.login-panel form {
  width: 100%;
  max-width: 350px;
}
.login-panel h2 {
  font-size: 1.75rem;
  margin: 12px 0;
}
.login-panel .muted {
  margin-bottom: 32px;
}
.login-panel label {
  margin-bottom: 20px;
}
.login-panel input {
  min-height: 47px;
}
.login-panel .primary {
  min-height: 47px;
}
.login-panel > small {
  position: absolute;
  bottom: 25px;
}
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: #0a142866;
}
@media (min-width: 1600px) {
  main {
    padding: 20px 32px 24px;
  }
  .topbar {
    padding: 0 32px;
  }
  .metric-value {
    font-size: 2.3rem;
  }
}
@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  aside {
    padding: 28px 13px;
  }
  main {
    padding: 20px;
  }
  .topbar {
    padding: 0 24px;
  }
  .cards {
    gap: 12px;
  }
  .metric-card {
    padding: 18px;
  }
  .metric-value {
    font-size: 1.7rem;
  }
  .filters {
    gap: 10px;
  }
  .login-art {
    padding: 38px;
  }
  .login-art h1 {
    font-size: 2.7rem;
  }
  .login-panel {
    padding: 40px;
  }
  .art-grid {
    gap: 18px;
  }
}
@media (max-width: 800px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  aside {
    position: fixed;
    z-index: 30;
    left: 0;
    top: 0;
    width: 245px;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .nav-open aside {
    transform: translateX(0);
  }
  .mobile-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .topbar {
    height: 56px;
    padding: 0 12px;
    gap: 6px;
  }
  .topbar-left {
    gap: 4px;
    flex: 1;
  }
  .topbar h1 {
    font-size: 1rem;
  }
  .topbar-left #menu-button {
    min-width: 34px;
    padding: 4px;
  }
  .page-help summary {
    width: 28px;
  }
  .page-help > div {
    position: fixed;
    top: 64px;
    left: 12px;
    right: 12px;
    width: auto;
  }
  #page-actions .action-label {
    display: none;
  }
  #page-actions .primary {
    min-width: 42px;
    padding: 5px;
    font-size: 1.25rem;
  }
  .topbar-actions {
    gap: 4px;
  }
  .topbar-actions .avatar {
    display: none;
  }
  .user-label {
    display: none;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-title {
    font-size: 0.8rem;
  }
  .metric-card {
    padding: 18px;
  }
  .metric-value {
    font-size: 1.9rem;
  }
  main {
    padding: 16px 12px;
  }
  .filters {
    padding: 10px;
    gap: 8px;
  }
  .filters .game-choice {
    min-width: 0;
    max-width: none;
    width: auto;
  }
  .filters .scope-secondary {
    display: none;
  }
  .filters.is-expanded .scope-secondary {
    display: flex;
    order: 2;
    flex: 1;
    min-width: calc(50% - 4px);
  }
  .filters.is-expanded .scope-secondary select {
    width: 0;
    flex: 1;
    min-width: 0;
  }
  .filters .advanced-filters {
    order: 3;
  }
  .catalog-toolbar {
    padding: 10px;
    gap: 8px;
  }
  .catalog-toolbar input {
    max-width: none;
    min-width: 100%;
  }
  .catalog-toolbar select {
    flex: 1;
    min-width: 100px;
    width: 0;
  }
  .catalog-total {
    margin-left: 0;
  }
  .config-panel th:last-child,
  .config-panel td:last-child {
    position: sticky;
    right: 0;
    background: var(--surface);
    box-shadow: -4px 0 7px #00000009;
  }
  .config-panel th:last-child {
    background: var(--soft);
  }
  .config-panel .table-actions {
    gap: 5px;
  }
  .config-panel .table-actions button {
    font-size: 0.8125rem;
    padding: 4px 6px;
  }
  .filters .game-choice > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .filters .game-choice select {
    width: 100%;
    min-width: 0;
  }
  .filter-toggle {
    flex-direction: column;
    gap: 1px;
    line-height: 1.15;
    padding: 3px 10px;
    min-width: 120px;
  }
  .filter-toggle > span:first-child {
    font-size: 0.875rem;
  }
  .filter-toggle > span:last-child {
    font-size: 0.75rem;
    color: var(--muted);
  }
  .advanced-filters {
    display: none;
    width: 100%;
  }
  .filters.is-expanded .advanced-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  .advanced-filters label {
    display: block;
    white-space: normal;
  }
  .advanced-filters label > input {
    margin-top: 5px;
  }
  #apply-filter {
    grid-column: 1/-1;
  }
  .filters input {
    max-width: none;
    width: 100%;
  }
  .filters select {
    width: 100%;
  }
  .filters .quiet {
    font-size: 0.8rem;
  }
  .sync-items {
    grid-template-columns: 1fr;
  }
  .panel-heading {
    padding: 18px;
  }
  .panel-body {
    padding: 0 18px 18px;
  }
  .panel-heading h3 {
    font-size: 0.95rem;
  }
  .panel-heading p {
    font-size: 0.75rem;
  }
  th,
  td {
    padding: 12px 17px;
  }
  .pagination {
    padding: 13px 16px;
    font-size: 0.75rem;
  }
  .pagination > div {
    gap: 5px;
  }
  footer {
    padding: 0 18px 22px;
    font-size: 0.68rem;
  }
  .chart {
    height: 230px;
  }
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-art {
    min-height: auto;
    padding: 28px;
  }
  .login-art > div:nth-child(2) {
    display: none;
  }
  .login-art > small {
    display: none;
  }
  .login-panel {
    min-height: calc(100dvh - 95px);
    padding: 65px 30px;
  }
  .login-art .brand-tag {
    font-size: 0.7rem;
  }
  .notice {
    font-size: 0.78rem;
  }
  .dialog-heading {
    padding: 20px;
  }
  .editor-fields {
    padding: 20px;
    gap: 16px;
  }
  .editor-fields label {
    grid-column: 1/-1;
  }
  .editor-fields details > div {
    grid-template-columns: 1fr;
  }
  .dialog-footer {
    padding: 16px 20px;
  }
  dialog {
    max-height: calc(100dvh - 24px);
    width: calc(100% - 24px);
  }
  .dialog-heading h2 {
    font-size: 1.1rem;
  }
  .empty {
    padding: 42px 20px;
  }
  .sidebar-note {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}
label,
.filters label,
.editor-fields label,
table,
th,
.tag,
.pagination,
.pagination button,
.metric-title {
  font-size: 0.875rem;
}
.metric-sub {
  font-size: 0.8125rem;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
/* Global selection stays visible across menus; a game has one package/platform. */
.global-scope {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  max-width: 610px;
}
.global-scope label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  margin: 0;
  white-space: nowrap;
}
.global-scope label > span {
  font-size: 12px;
  color: var(--muted);
}
.global-scope select {
  min-width: 0;
  width: 100%;
  height: 34px;
  min-height: 34px;
  margin-top: 0;
  padding: 4px 24px 4px 8px;
  background: var(--soft);
  font-size: 13px;
}
.scope-status {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  min-width: 33px;
}
.topbar-left {
  flex-shrink: 0;
}
@media (min-width: 801px) {
  .filters .filter-toggle {
    display: none;
  }
  .filters .advanced-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: auto;
    padding: 0;
    border: 0;
  }
}
@media (min-width: 801px) and (max-width: 1350px) {
  .topbar {
    gap: 10px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .topbar-actions .user-label,
  .topbar-actions .avatar,
  .scope-status {
    display: none;
  }
  .global-scope {
    gap: 6px;
  }
}
@media (max-width: 1050px) and (min-width: 801px) {
  .global-scope label > span {
    display: none;
  }
  .topbar-actions {
    gap: 4px;
  }
  .topbar h1 {
    font-size: 15px;
  }
  #page-actions .action-label {
    display: none;
  }
}
@media (max-width: 800px) {
  .topbar {
    height: auto;
    min-height: 102px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 48px 42px;
    gap: 0 8px;
    padding-bottom: 8px;
  }
  .topbar-left {
    grid-column: 1;
    grid-row: 1;
  }
  .topbar-actions {
    grid-column: 2;
    grid-row: 1;
  }
  .global-scope {
    grid-column: 1/-1;
    grid-row: 2;
    width: 100%;
    max-width: none;
    gap: 8px;
  }
  .global-scope label {
    gap: 5px;
  }
  .global-scope select {
    height: 34px;
  }
  .global-scope .tag {
    font-size: 11px;
    padding: 4px 6px;
  }
  .scope-status {
    display: none;
  }
  .page-help > div {
    top: 52px;
  }
  .filters {
    padding: 8px 10px;
    margin-bottom: 12px;
  }
  .filter-toggle {
    flex-direction: row;
    gap: 8px;
    width: 100%;
  }
}
/* Destructive operations require the owner to type the selected GID. */
.danger-button {
  background: #b42318;
  color: #fff;
  border: 1px solid #b42318;
}
#delete-dialog {
  width: min(520px, calc(100vw - 32px));
}
#delete-form > p,
#delete-form > label {
  margin: 16px 24px;
  display: block;
}
#delete-confirm {
  width: 100%;
  margin-top: 8px;
}
.deletion-job {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
#deletion-jobs:empty {
  display: none;
}
.ads-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.ads-type-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ads-scope-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin: 0 0 18px;
}
.ads-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 20px;
}
.ads-results .panel {
  min-width: 0;
}
.ads-distribution {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 0 24px 24px;
}
.ads-distribution > svg {
  width: 180px;
  max-width: 100%;
}
.ads-donut-total {
  fill: var(--text);
  font-size: 26px;
  font-weight: 700;
}
.ads-result-legend {
  flex: 1;
  min-width: 190px;
  font-size: 12px;
}
.ads-result-legend > div {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto 44px;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
}
.ads-result-legend svg {
  width: 12px;
}
.ads-scene-chart {
  display: block;
  width: 100%;
  min-width: 480px;
}
@media (max-width: 1000px) {
  .ads-results {
    grid-template-columns: minmax(0, 1fr);
  }
}
.ads-toolbar input {
  flex: 1;
  min-width: 140px;
}
.ads-toolbar select {
  min-width: 140px;
}
.ads-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 0 24px 20px;
  font-size: 13px;
}
.ads-legend span:nth-child(1) {
  color: #5263e6;
}
.ads-legend span:nth-child(2) {
  color: #218c74;
}
.ads-legend span:nth-child(3) {
  color: #c54b61;
}
@media (max-width: 600px) {
  .ads-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ads-toolbar input,
  .ads-toolbar select {
    min-width: 0;
    flex: 1 1 140px;
    width: 100%;
  }
  .ads-toolbar button {
    min-width: 0;
    width: 100%;
    white-space: nowrap;
  }
  .ads-cards {
    grid-template-columns: 1fr 1fr;
  }
  .ads-type-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}
