:root {
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 66px;

  /* True neutral carbon palette — zero navy/cyan tint */
  --bg-canvas: #09090b;
  --bg-sidebar: #0d0d10;
  --bg-topbar: #09090b;
  --bg-surface: #121215;
  --bg-surface-hover: #18181c;
  --bg-elevated: #16161a;
  --bg-active: #1c1c21;

  --border-subtle: #1c1c21;
  --border-default: #25252b;
  --border-strong: #36363f;

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #686873;

  --accent-solid: #fafafa;
  --accent-ink: #09090b;
  --amber: #eab308;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --transition: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Inter", "Segoe UI", sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button,
input {
  font-family: inherit;
}

/* ===== Main Shell Layout ===== */
.layout {
  position: relative;
  display: flex;
  min-height: 100vh;
}

/* ===== Collapsible Left Sidebar ===== */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  transition: width var(--transition);
  z-index: 35;
  overflow: hidden;
}

.layout.is-collapsed .sidebar {
  width: var(--sidebar-w-collapsed);
}

.sidebar-head {
  height: 56px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.layout.is-collapsed .sidebar-head {
  padding: 0 10px;
  justify-content: center;
}

.brand {
  border: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  padding: 2px 0;
}

.layout.is-collapsed .brand {
  display: none;
}

.brand-text {
  display: inline-flex;
  align-items: baseline;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  white-space: nowrap;
  padding-left: 2px;
  line-height: 1;
}

.brand-accent {
  font-weight: 400;
  color: #8b8b96;
  margin-left: 1px;
}

.collapse-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.collapse-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.collapse-arrow {
  transform-origin: 13.5px 12px;
  transition: transform var(--transition);
}

.layout.is-collapsed .collapse-arrow {
  transform: rotate(180deg);
}

/* Sidebar Sections */
.sidebar-section {
  padding: 14px 10px 8px;
  flex-shrink: 0;
}

.sidebar-characters {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 12px;
  padding-bottom: 10px;
}

.sidebar-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 8px;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 8px 8px;
  white-space: nowrap;
}

.sidebar-label-row .sidebar-label {
  padding: 0;
}

.sidebar-label-count {
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.layout.is-collapsed .sidebar-label,
.layout.is-collapsed .sidebar-label-row {
  display: none;
}

.sidebar-divider {
  height: 1px;
  margin: 4px 12px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

/* Game Items inside Sidebar */
.nav-list {
  display: grid;
  gap: 2px;
}

.game-nav-item {
  position: relative;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  height: 38px;
  padding: 0 10px 0 8px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
  min-width: 0;
}

.layout.is-collapsed .game-nav-item {
  justify-content: center;
  padding: 0;
  width: 44px;
  margin: 0 auto;
}

.game-nav-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.game-nav-item.active {
  background: var(--bg-active);
  border-color: var(--border-default);
  color: #ffffff;
}

.game-nav-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 1px;
  background: #ffffff;
}

.layout.is-collapsed .game-nav-item.active::before {
  display: none;
}

.game-icon {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-nav-item.active .game-icon {
  border-color: rgba(255, 255, 255, 0.24);
}

.game-nav-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-nav-item.active .game-nav-name {
  font-weight: 600;
}

.game-nav-count {
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  flex-shrink: 0;
}

.game-nav-item.active .game-nav-count {
  color: var(--text-secondary);
}

.layout.is-collapsed .game-nav-name,
.layout.is-collapsed .game-nav-count {
  display: none;
}

/* Character Items inside Sidebar */
.char-nav-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 2px;
  align-content: start;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #27272e transparent;
}

.char-nav-list::-webkit-scrollbar {
  width: 4px;
}

.char-nav-list::-webkit-scrollbar-thumb {
  background: #27272e;
  border-radius: 999px;
}

.char-nav-list::-webkit-scrollbar-thumb:hover {
  background: #3a3a45;
}

.char-nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  height: 36px;
  padding: 0 10px 0 6px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  min-width: 0;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.layout.is-collapsed .char-nav-item {
  justify-content: center;
  padding: 0;
  width: 44px;
  margin: 0 auto;
}

.char-nav-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.char-nav-item.active {
  background: var(--bg-active);
  border-color: var(--border-default);
  color: #ffffff;
}

.char-avatar {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  background: #1b1b20;
}

.char-avatar-icon {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: #19191e;
  color: var(--text-secondary);
}

.char-nav-item.active .char-avatar-icon {
  background: #27272f;
  color: #ffffff;
}

.char-name {
  flex: 1;
  font-size: 13px;
  font-weight: 450;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-nav-item.active .char-name {
  font-weight: 600;
}

.char-count {
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  flex-shrink: 0;
}

.char-nav-item.active .char-count {
  color: var(--text-secondary);
}

.layout.is-collapsed .char-name,
.layout.is-collapsed .char-count {
  display: none;
}

/* ===== Right Main Workspace ===== */
.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(9, 9, 11, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-primary);
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.topbar-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.page-title {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-count {
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 248px;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 34px;
  padding: 0 30px 0 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.search-field input::placeholder {
  color: var(--text-muted);
}

.search-field input:hover {
  border-color: var(--border-strong);
}

.search-field input:focus {
  border-color: #52525e;
  background: var(--bg-elevated);
}

.search-kbd {
  position: absolute;
  right: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  color: var(--text-muted);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-default);
  background: var(--bg-canvas);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 7px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 0;
  background: #27272f;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.search-clear:hover {
  background: #3a3a46;
}

/* DX11 / DX12 Segmented Switch */
.dx-segment {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
}

.dx-btn {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  height: 28px;
  padding: 0 10px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.dx-btn:hover {
  color: var(--text-primary);
}

.dx-btn.active {
  background: var(--accent-solid);
  color: var(--accent-ink);
}

/* Sort Dropdown */
.sort-dropdown {
  position: relative;
}

.sort-trigger {
  height: 34px;
  padding: 0 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.sort-trigger:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.sort-trigger .caret {
  color: var(--text-muted);
  transition: transform 0.14s ease;
}

.sort-trigger[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}

.sort-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 164px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: #141418;
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  z-index: 40;
  display: grid;
  gap: 2px;
}

.sort-option {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  padding: 8px 10px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sort-option:hover {
  background: var(--bg-active);
  color: var(--text-primary);
}

.sort-option.active {
  background: var(--bg-active);
  color: #ffffff;
  font-weight: 600;
}

.sort-option.active::after {
  content: "✓";
  font-size: 11px;
  color: #ffffff;
}

/* ===== Content Grid Area ===== */
.content {
  padding: 20px 24px 56px;
  flex: 1;
}

.active-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.clear-filter-btn {
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.clear-filter-btn:hover {
  background: #23232a;
  border-color: #4a4a56;
}

/* ===== Mod Card Grid (Clean Framed Media + Dedicated Caption Bar) ===== */
.mod-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.mod-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.mod-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.mod-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0c0c0f;
}

.mod-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.22s ease;
}

.mod-card:hover .mod-cover {
  transform: scale(1.03);
}

.mod-card.is-blurred .mod-cover {
  filter: blur(14px) brightness(0.84);
  transform: scale(1.08);
}

.mod-card.is-blurred:hover .mod-cover {
  filter: blur(0px) brightness(1);
  transform: scale(1.03);
}

.mod-footer {
  padding: 11px 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border-subtle);
  min-width: 0;
}

.mod-text {
  min-width: 0;
  flex: 1;
}

.mod-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mod-char {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 450;
  color: var(--text-muted);
  min-width: 0;
}

.mod-char-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.mod-meta-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #464652;
  flex-shrink: 0;
}

.mod-size {
  font-variant-numeric: tabular-nums;
  color: #7c7c88;
  white-space: nowrap;
  flex-shrink: 0;
}

.meta-tag {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #a1a1aa;
  white-space: nowrap;
  flex-shrink: 0;
}

.meta-tag-dx11 {
  color: #c8b698;
  background: rgba(200, 182, 152, 0.1);
}

.meta-tag-dx12 {
  color: #d4d4d8;
  background: rgba(255, 255, 255, 0.08);
}

.mod-dl-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-canvas);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.mod-card:hover .mod-dl-btn {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.mod-dl-btn:hover {
  background: var(--accent-solid);
  color: var(--accent-ink) !important;
  border-color: var(--accent-solid) !important;
}

/* Load More & Empty State */
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.load-more-btn,
.reset-btn {
  height: 38px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.load-more-btn:hover,
.reset-btn:hover {
  background: var(--bg-active);
  border-color: #4f4f5c;
}

.empty-state {
  text-align: center;
  padding: 64px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  border-radius: 12px;
  overflow: hidden;
  background: #111114;
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(9, 9, 11, 0.82);
  color: #f4f4f5;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.modal-close:hover {
  background: #23232a;
  border-color: rgba(255, 255, 255, 0.3);
}

.modal-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #09090b;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-badges {
  position: absolute;
  bottom: 12px;
  left: 14px;
  display: flex;
  gap: 6px;
}

.modal-body {
  padding: 20px 22px 22px;
}

.modal-char-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-portrait {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--border-default);
  background: #18181d;
}

.modal-char-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.modal-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #ffffff;
}

/* Spec-sheet 3-column hairline grid */
.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #0c0c0f;
  overflow: hidden;
  margin-bottom: 18px;
}

.meta-tile {
  padding: 10px 13px;
  border-right: 1px solid var(--border-subtle);
}

.meta-tile:last-child {
  border-right: 0;
}

.meta-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.meta-value {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-btn,
.secondary-btn {
  flex: 1;
  min-width: 180px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.primary-btn {
  background: var(--accent-solid);
  color: var(--accent-ink);
  border: 1px solid var(--accent-solid);
}

.primary-btn:hover {
  background: #e4e4e7;
  border-color: #e4e4e7;
}

.secondary-btn {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.secondary-btn:hover {
  background: #222229;
  border-color: #4a4a56;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 32;
  background: rgba(0, 0, 0, 0.72);
}

/* ===== Responsive ===== */
@media (max-width: 1360px) {
  .mod-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1020px) {
  .search-field {
    width: 190px;
  }
  .mod-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .mobile-menu-btn {
    display: grid;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform var(--transition);
  }
  .layout.mobile-open .sidebar {
    transform: translateX(0);
  }
  .topbar {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .topbar-controls {
    width: 100%;
    flex-wrap: wrap;
  }
  .search-field {
    flex: 1;
    width: auto;
  }
  .content {
    padding: 16px 16px 40px;
  }
}

@media (max-width: 560px) {
  .mod-grid {
    grid-template-columns: 1fr;
  }
  .modal-meta-grid {
    grid-template-columns: 1fr;
  }
  .meta-tile {
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  .meta-tile:last-child {
    border-bottom: 0;
  }
}
