body {
  font-family: Arial, sans-serif;
  background: #111;
  color: #fff;
  padding: 40px;
  margin: 0;
}

a {
  color: #7fd0ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.login-box {
  width: 320px;
  margin: 60px auto;
  background: #222;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #333;
}

input,
button,
select,
textarea {
  width: 100%;
  margin: 8px 0;
  padding: 10px;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid #444;
  background: #1a1a1a;
  color: #fff;
}

button {
  background: #2f6ea9;
  border: none;
  cursor: pointer;
}

button:hover {
  background: #3b82c4;
}

.panel {
  background: #222;
  padding: 18px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid #333;
}

.error {
  color: #ff9b9b;
  margin-top: 10px;
}

.admin-shell {
  max-width: 1200px;
  margin: 0 auto;
}

.admin-shell.narrow {
  max-width: 800px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.top-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.notice.success {
  background: #16351d;
  color: #d8f4de;
}

.notice.error {
  background: #4a1c1c;
  color: #ffd9d9;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-bar select {
  max-width: 320px;
}

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

.muted {
  color: #b7c0cc;
}

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.admin-photo-card {
  background: #181818;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #2d2d2d;
}

.thumb-wrap {
  aspect-ratio: 4 / 3;
  background: #000;
}

.thumb-wrap img,
.edit-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-photo-body {
  padding: 14px;
}

.admin-photo-body h3 {
  margin: 0 0 8px;
}

.admin-photo-body p {
  font-size: 14px;
  min-height: 40px;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card-actions form {
  margin: 0;
  width: auto;
}

.btn-small {
  display: inline-block;
  padding: 8px 12px;
  background: #2f6ea9;
  color: #fff;
  text-decoration: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  width: auto;
}

.btn-small.ghost {
  background: #444;
}

.btn-small.danger {
  background: #8d2f2f;
}

.edit-preview {
  max-width: 420px;
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
}

.gallery-section-list {
  display: grid;
  gap: 12px;
}

.gallery-section-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #181818;
  flex-wrap: wrap;
}

.section-tools {
  margin-bottom: 14px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

.checkbox-row span {
  color: #fff;
}

.iframe-panel {
  padding: 10px;
}

.admin-iframe {
  width: 100%;
  min-height: 900px;
  border: 1px solid #333;
  border-radius: 10px;
  background: #111;
}
.ticker-group {
  display: grid;
  gap: 12px;
}

.ticker-row {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr auto;
  gap: 10px;
  align-items: center;
}

@media (max-width: 820px) {
  .ticker-row {
    grid-template-columns: 1fr;
  }
}
.password-form {
  display: grid;
  gap: 10px;
}

.password-form button {
  margin-top: 6px;
}

.panel h2 {
  margin-top: 0;
}

.dropzone {
  position: relative;
  border: 2px dashed #4b5a6a;
  border-radius: 12px;
  background: #171717;
  min-height: 160px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}

.dropzone:hover {
  border-color: #7fd0ff;
}

.dropzone.dragover {
  border-color: #7fd0ff;
  background: #1b2430;
  transform: scale(1.01);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  margin: 0;
}

.dropzone-inner {
  text-align: center;
  padding: 24px;
  pointer-events: none;
}

.dropzone-inner strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.dropzone-inner span {
  display: block;
  color: #b7c0cc;
}

.file-name {
  margin-top: 10px;
  word-break: break-word;
}
.sortable-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.sortable-photo-card {
  position: relative;
  background: #181818;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #2d2d2d;
}

.sortable-photo-card.dragging {
  opacity: 0.55;
}

.drag-handle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: grab;
  user-select: none;
}

.drag-tip {
  margin-top: 12px;
}
.usage-list {
  margin: 0;
  padding-left: 20px;
}

.usage-list li {
  margin-bottom: 8px;
}
.eyebrow {
  margin: 0 0 8px;
  color: #d4b06a;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
}

.hero-topbar {
  align-items: flex-start;
  margin-bottom: 28px;
}

.dashboard-title {
  margin: 0 0 10px;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.dashboard-subtitle {
  margin: 0;
  max-width: 780px;
  color: #b7c0cc;
  font-size: 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.admin-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  padding: 22px;
  border-radius: 14px;
  border: 1px solid #303030;
  background: linear-gradient(180deg, #20242a 0%, #17191d 100%);
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.admin-card:hover {
  transform: translateY(-3px);
  border-color: rgba(127, 208, 255, 0.45);
  text-decoration: none;
}

.card-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 18px;
}

.card-copy h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.card-copy p {
  margin: 0;
  color: #b7c0cc;
  line-height: 1.5;
}

.card-link {
  margin-top: 20px;
  color: #7fd0ff;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.admin-card-photo {
  background: linear-gradient(180deg, #1c2330 0%, #161a22 100%);
}

.admin-card-gallery {
  background: linear-gradient(180deg, #25201d 0%, #1a1715 100%);
}

.admin-card-games {
  background: linear-gradient(180deg, #221d2d 0%, #17131f 100%);
}

.admin-card-backup {
  background: linear-gradient(180deg, #1c2a22 0%, #141d18 100%);
}

.admin-card-settings {
  background: linear-gradient(180deg, #2a2020 0%, #1d1717 100%);
}

.admin-card-legacy {
  background: linear-gradient(180deg, #232323 0%, #191919 100%);
}

.admin-card-health {
  background: linear-gradient(180deg, #1d2a2a 0%, #151d1e 100%);
}

@media (max-width: 700px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-title {
    font-size: 2rem;
  }
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.status-card {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #30343a;
  background: linear-gradient(180deg, #1f2228 0%, #16181c 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.status-card-wide {
  grid-column: span 1;
}

.status-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: #b7c0cc;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-value {
  display: block;
  font-size: 1.7rem;
  line-height: 1.1;
}

.status-text {
  font-size: 1rem;
  line-height: 1.35;
  word-break: break-word;
}

@media (max-width: 950px) {
  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .status-strip {
    grid-template-columns: 1fr;
  }
}
.backup-list {
  display: grid;
  gap: 12px;
}

.backup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid #333;
  border-radius: 10px;
  background: #181818;
  flex-wrap: wrap;
}

.status-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .status-strip {
    grid-template-columns: 1fr;
  }
}

input[type=text]{
width:100%;
padding:10px;
margin:6px 0 16px 0;
background:#111;
border:1px solid #333;
color:#eee;
border-radius:6px;
}

.panel label{
font-weight:600;
display:block;
margin-top:10px;
}

.gallery-checkbox-list {
columns:2;
margin-top:10px;
}

.gallery-checkbox-list label {
display:block;
margin-bottom:6px;
}

.usage-indicator {
font-size:12px;
background:#f3f3f3;
padding:4px 8px;
border-radius:4px;
display:inline-block;
}

.drag-handle {
cursor:move;
font-weight:bold;
}

.dropzone {
  position: relative;
  border: 2px dashed #3e5c73;
  border-radius: 12px;
  padding: 18px;
  background: #151b21;
  cursor: pointer;
  margin: 8px 0 16px;
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone.dragover {
  border-color: #7fd0ff;
  background: #192531;
}

.dropzone-inner {
  text-align: center;
  display: grid;
  gap: 4px;
}

.file-name {
  font-size: 13px;
}

.sortable-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.sortable-photo-card,
.gallery-card {
  position: relative;
}

.sortable-photo-card.dragging,
.gallery-section-row.dragging,
.gallery-card.dragging {
  opacity: 0.55;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #2a2a2a;
  border: 1px solid #3b3b3b;
  cursor: grab;
  user-select: none;
}

.drag-handle.large {
  width: 38px;
  height: 38px;
}

.title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.usage-pill-row {
  margin-bottom: 12px;
}

.usage-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #1e3a2d;
  color: #d8f4de;
  font-size: 12px;
  white-space: nowrap;
}

.tiny-note {
  margin-top: 10px;
  font-size: 12px;
}

.placement-panel {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #333;
  border-radius: 10px;
  background: #171717;
}

.placement-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.placement-group + .placement-group {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #2f2f2f;
}

.placement-group-title {
  font-weight: bold;
  margin-bottom: 10px;
}

.placement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 14px;
}

.placement-check {
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  margin: 0;
}

.placement-check input {
  width: auto;
  margin: 0;
}

.usage-list {
  margin: 0;
  padding-left: 20px;
}

.gallery-stack {
  display: grid;
  gap: 18px;
}

.health-run-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.health-run-panel h2 {
  margin: 0 0 8px;
}

.health-run-button {
  min-width: 150px;
  text-align: center;
}

.health-summary-strip .status-card {
  min-width: 0;
}

.health-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.health-badge-ok {
  background: #153722;
  color: #d8f4de;
  border: 1px solid #2d7046;
}

.health-badge-warning {
  background: #3d3218;
  color: #ffe6a6;
  border: 1px solid #7a6122;
}

.health-badge-error {
  background: #4a1c1c;
  color: #ffd9d9;
  border: 1px solid #8d2f2f;
}

.health-badge-info,
.health-badge-na {
  background: #1f2d3d;
  color: #dbeafe;
  border: 1px solid #365273;
}

.health-badge-unable {
  background: #2f2f35;
  color: #e5e7eb;
  border: 1px solid #5c6068;
}

.health-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.health-table td,
.health-table th {
  vertical-align: top;
}

.health-table td {
  word-break: break-word;
}

.health-empty {
  margin-bottom: 0;
}

.health-detail-table th:nth-child(4),
.health-detail-table td:nth-child(4) {
  min-width: 260px;
}

.health-detail-text {
  display: block;
  margin-top: 5px;
  color: #b7c0cc;
  font-size: 0.9rem;
  line-height: 1.45;
}

@media (max-width: 760px) {
  body {
    padding: 16px;
  }

  .login-box {
    width: 100%;
    max-width: 320px;
    margin: 32px auto;
  }

  .admin-topbar,
  .panel-header,
  .filter-bar,
  .card-actions,
  .backup-row,
  .gallery-section-row,
  .title-row,
  .module-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-links,
  .card-actions,
  .analytics-filter-actions,
  .games-controls {
    gap: 10px;
  }

  .top-links a,
  .btn-small,
  .card-actions a,
  .card-actions button,
  .analytics-filter-actions a,
  .analytics-filter-actions button,
  .games-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
  }

  .admin-photo-grid,
  .sortable-photo-grid,
  .dashboard-grid,
  .placement-grid {
    grid-template-columns: 1fr;
  }

  .gallery-checkbox-list {
    columns: 1;
  }

  .usage-pill {
    white-space: normal;
  }

  .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .analytics-table {
    min-width: 640px;
  }

  .health-run-panel {
    align-items: stretch;
  }

  .health-run-button {
    width: 100%;
  }

  .health-table-wrap {
    overflow-x: visible;
  }

  .health-table,
  .health-table thead,
  .health-table tbody,
  .health-table th,
  .health-table td,
  .health-table tr {
    display: block;
  }

  .health-table thead {
    display: none;
  }

  .health-table tr {
    padding: 12px 0;
    border-bottom: 1px solid #30343a;
  }

  .health-detail-table {
    min-width: 0;
  }

  .health-table tr:last-child {
    border-bottom: 0;
  }

  .health-table td {
    display: grid;
    grid-template-columns: minmax(96px, 34%) 1fr;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 0;
  }

  .health-table td::before {
    content: attr(data-label);
    color: #b7c0cc;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
}

.gallery-card {
  background: #1b1b1b;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 16px;
}

.compact-header {
  margin-bottom: 12px;
}
.gallery-group {
  border:1px solid #ddd;
  margin-bottom:10px;
  border-radius:6px;
}

.gallery-header {
  background:#f5f5f5;
  padding:8px 12px;
  font-weight:600;
  cursor:pointer;
}

.gallery-sections {
  padding:10px;
  display:none;
}

.gallery-sections label {
  display:block;
  margin-bottom:6px;
  font-weight:400;
}
.gallery-group {
  border: 1px solid #ddd;
  margin-bottom: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.gallery-header {
  background: #f5f5f5;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.gallery-header.open {
  background: #e9e9e9;
}

.gallery-sections {
  padding: 10px 12px;
  display: none;
}

.gallery-sections label {
  display: block;
  margin-bottom: 6px;
  font-weight: 400;
}

[data-draggable-item] {
  cursor: move;
}

[data-draggable-item].dragging {
  opacity: 0.5;
}

.reorder-actions {
  align-items: center;
}

.btn-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #444;
  color: #fff;
  border: 1px solid #5a5a5a;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.btn-icon:hover {
  background: #575757;
}

#gallery-stack > .gallery-card > .compact-header .drag-handle,
.gallery-section-row > .card-actions .drag-handle {
  position: static;
  inset: auto;
  box-shadow: none;
}

.gallery-card .card-actions,
.gallery-section-row .card-actions {
  position: relative;
}


.dashboard-sections {
  display: grid;
  gap: 22px;
}

.dashboard-section {
  border: 1px solid #30343a;
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(180deg, #181b20 0%, #121417 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.section-heading-wrap {
  margin-bottom: 18px;
}

.section-kicker {
  margin: 0 0 8px;
  color: #d4b06a;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
}

.section-heading-wrap h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2vw, 1.9rem);
}

.section-heading-wrap p {
  margin: 0;
  color: #b7c0cc;
  max-width: 800px;
  line-height: 1.5;
}

.section-grid {
  margin-top: 0;
}

.dashboard-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
}

.dashboard-section-photo {
  background: linear-gradient(180deg, #171c24 0%, #12151b 100%);
}

.dashboard-section-tv {
  background: linear-gradient(180deg, #1b1824 0%, #13111a 100%);
}

.dashboard-section-media {
  background: linear-gradient(180deg, #1a1d19 0%, #121411 100%);
}

.admin-card .card-copy h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

@media (max-width: 700px) {
  .dashboard-section {
    padding: 18px;
  }
}


.hero-topbar {
  padding: 28px;
  border-radius: 20px;
  border: 1px solid #2d3542;
  background: linear-gradient(180deg, #18202b 0%, #11161d 100%);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8fb4d6;
}

.dashboard-title {
  margin: 0;
  font-size: 38px;
  line-height: 1.05;
}

.dashboard-subtitle {
  margin: 10px 0 0;
  max-width: 760px;
  color: #b7c0cc;
  line-height: 1.6;
}

.top-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #314257;
  background: #171f29;
  color: #d7ebff;
  text-decoration: none;
}

.top-links a:hover {
  background: #1d2835;
  text-decoration: none;
}

.dashboard-sections {
  display: grid;
  gap: 24px;
}

.dashboard-section {
  padding: 22px;
  border-radius: 22px;
  border: 1px solid #2b323c;
  background: linear-gradient(180deg, #191b20 0%, #14161a 100%);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.section-heading-wrap {
  margin-bottom: 18px;
}

.section-kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: #95a9bf;
}

.section-heading-wrap h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.section-heading-wrap p:last-child {
  margin: 0;
  color: #b7c0cc;
  line-height: 1.6;
}

.section-meta-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.section-meta-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #303844;
  background: rgba(255,255,255,0.03);
}

.section-meta-card-accent {
  background: linear-gradient(180deg, rgba(127,208,255,0.18) 0%, rgba(127,208,255,0.06) 100%);
  border-color: #3f5f78;
}

.section-meta-card-wide {
  grid-column: span 2;
}

.section-meta-label {
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  color: #9eafc1;
}

.section-meta-value {
  display: block;
  font-size: 28px;
  line-height: 1.1;
}

.section-meta-value-text {
  font-size: 18px;
  word-break: break-word;
}

.dashboard-grid.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.dashboard-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.admin-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 190px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #2f3742;
  background: #171a20;
  text-decoration: none;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.admin-card:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: #47627d;
}

.card-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
}

.card-copy h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.card-copy p {
  margin: 0;
  color: #b8c2ce;
  line-height: 1.55;
}

.card-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8ccfff;
}

.admin-card-photo .card-icon,
.admin-card-gallery .card-icon {
  background: rgba(94, 168, 255, 0.12);
}

.admin-card-games .card-icon,
.admin-card-legacy .card-icon {
  background: rgba(172, 127, 255, 0.12);
}

.admin-card-backup .card-icon,
.admin-card-settings .card-icon {
  background: rgba(112, 209, 168, 0.12);
}

@media (max-width: 720px) {
  body {
    padding: 18px;
  }

  .dashboard-title {
    font-size: 30px;
  }

  .section-heading-wrap h2 {
    font-size: 24px;
  }

  .section-meta-card-wide {
    grid-column: span 1;
  }
}


.traffic-overview {
  margin-bottom: 28px;
  border-radius: 16px;
  border: 1px solid #2d3440;
  background: linear-gradient(180deg, #171c24 0%, #12161c 100%);
  box-shadow: 0 18px 40px rgba(0,0,0,0.24);
}

.traffic-header {
  margin-bottom: 16px;
}

.traffic-title {
  margin: 0 0 8px;
}

.traffic-subtitle {
  margin: 0;
}

.traffic-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.traffic-card {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #2d3440;
  background: linear-gradient(180deg, #1e2530 0%, #171c25 100%);
}

.traffic-card-accent {
  background: linear-gradient(180deg, #213246 0%, #182433 100%);
  border-color: #39516b;
}

.traffic-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b7c0cc;
}

.traffic-value {
  display: block;
  font-size: 1.8rem;
  line-height: 1.1;
}

.traffic-value-text {
  font-size: 1rem;
  line-height: 1.35;
}

.traffic-note,
.traffic-path {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: #9eacbc;
  word-break: break-word;
}

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

.traffic-table {
  width: 100%;
  border-collapse: collapse;
}

.traffic-table th,
.traffic-table td {
  padding: 12px 10px;
  border-top: 1px solid #2a313b;
  text-align: left;
  vertical-align: top;
}

.traffic-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9eacbc;
}

@media (max-width: 1100px) {
  .traffic-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .traffic-strip {
    grid-template-columns: 1fr;
  }
}

.traffic-strip-main {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.traffic-card-wide {
  grid-column: span 2;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.analytics-panel {
  grid-column: span 4;
  background: #181818;
  border: 1px solid #313131;
  border-radius: 14px;
  padding: 18px;
}

.analytics-panel-wide {
  grid-column: span 12;
}

.analytics-panel-chart {
  grid-column: span 12;
}

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

.analytics-panel h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.analytics-sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  width: auto;
  flex: 0 1 260px;
}

.analytics-sort-control label {
  color: #b7c0cc;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.analytics-sort-control select {
  width: auto;
  min-width: 190px;
  max-width: 260px;
  margin: 0;
  padding: 8px 9px;
  font-size: 13px;
}

.traffic-chart {
  min-height: 250px;
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
}

.traffic-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.traffic-bar-wrap {
  height: 180px;
  width: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  display: flex;
  align-items: end;
  padding: 6px;
}

.traffic-bar {
  width: 100%;
  border-radius: 8px;
  background: linear-gradient(180deg, #74d0ff, #2f6ea9);
  min-height: 8px;
}

.traffic-bar-value {
  font-size: 12px;
  color: #d5deea;
}

.traffic-bar-label {
  font-size: 11px;
  color: #99a6b7;
  text-align: center;
}

.metric-list {
  display: grid;
  gap: 12px;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.2fr) minmax(80px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.metric-copy {
  display: grid;
  gap: 4px;
}

.metric-copy strong {
  font-size: 14px;
}

.metric-copy span,
.metric-percent {
  font-size: 12px;
  color: #a7b2c0;
}

.metric-bar-shell {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7fd0ff, #6ca3ff);
}

@media (max-width: 1100px) {
  .analytics-panel,
  .analytics-panel-chart,
  .analytics-panel-wide {
    grid-column: span 12;
  }
}

@media (max-width: 700px) {
  .traffic-card-wide {
    grid-column: span 1;
  }

  .traffic-chart {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .traffic-chart .traffic-bar-group:nth-child(n+8) {
    display: none;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }

  .analytics-sort-control {
    width: 100%;
    flex: 1 1 100%;
  }

  .analytics-sort-control select {
    width: 100%;
    max-width: none;
  }
}


.admin-shell-wide {
  max-width: 1380px;
}

.analytics-page-panel {
  margin-bottom: 28px;
}

.admin-card-analytics {
  background: linear-gradient(180deg, #1d2530 0%, #151b23 100%);
}

.backup-title {
  margin-bottom: 8px;
}

.backup-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.backup-all-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.backup-all-panel h2 {
  margin: 0;
}

.backup-all-panel .muted {
  margin: 6px 0 0;
}

.backup-all-summary ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.backup-all-summary li + li {
  margin-top: 5px;
}

.backup-group-panel {
  border-radius: 14px;
}

.backup-group-tv {
  background: linear-gradient(180deg, #201f2b 0%, #171720 100%);
}

.backup-group-photo {
  background: linear-gradient(180deg, #25201d 0%, #1a1715 100%);
}

.backup-group-admin {
  background: linear-gradient(180deg, #1d2721 0%, #151b17 100%);
}

.backup-group-head h2,
.backup-library-head h3 {
  margin: 0;
}

.backup-action-stack,
.backup-section-stack {
  display: grid;
  gap: 14px;
}

.backup-action-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}

.backup-action-card.backup-status-healthy { border-left: 4px solid #5fc88f; }
.backup-action-card.backup-status-warning { border-left: 4px solid #e7b85c; }
.backup-action-card.backup-status-problem { border-left: 4px solid #e27676; }

.backup-action-heading > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.backup-health-badge {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  color: #dce5ef;
  font-size: 0.76rem;
  font-weight: 700;
}

.backup-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
}

.backup-status-grid > div {
  min-width: 0;
  padding: 9px 10px;
  background: #17191b;
}

.backup-status-grid dt {
  margin-bottom: 3px;
  color: #97a4b3;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.backup-status-grid dd {
  margin: 0;
  color: #f2f5f8;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.backup-warning-list,
.backup-validation-ok {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.86rem;
}

.backup-warning-list {
  padding-left: 29px;
  color: #ffe1a3;
  background: rgba(174,111,20,0.16);
}

.backup-warning-list li + li { margin-top: 4px; }

.backup-validation-ok {
  color: #bff3d3;
  background: rgba(47,139,89,0.16);
}

.backup-create-form { margin: 0; }
.backup-create-form button { width: 100%; }

.backup-file-meta {
  margin-top: 6px;
  color: #c4ced9;
  font-size: 0.82rem;
}

.backup-action-card p,
.backup-footnote {
  margin: 6px 0 0;
}

.backup-library-group {
  border: 1px solid #343434;
  border-radius: 12px;
  background: #181818;
  scroll-margin-top: 18px;
}

.backup-library-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px;
  cursor: pointer;
  list-style: none;
  border-radius: 12px;
}

.backup-library-head::-webkit-details-marker { display: none; }
.backup-library-head:hover { background: rgba(255,255,255,0.035); }
.backup-library-head:focus-visible { outline: 2px solid #8bb9e1; outline-offset: 3px; }

.backup-library-title {
  flex: 1 1 240px;
  color: #f5f5f5;
  font-size: 1.15rem;
  font-weight: 750;
}

.backup-toggle-label {
  min-width: 48px;
  color: #9fc2df;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.backup-library-group[open] .backup-library-head { border-bottom: 1px solid #343434; border-radius: 12px 12px 0 0; }
.backup-library-group[open] .backup-toggle-label::before { content: 'Hide'; }
.backup-library-group[open] .backup-toggle-label { font-size: 0; }
.backup-library-group[open] .backup-toggle-label::before { font-size: 0.82rem; }

.backup-count {
  color: #b7c0cc;
  font-size: 0.92rem;
}

.backup-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.backup-jump-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #343434;
  border-radius: 10px;
  background: #181818;
  overflow-x: auto;
}

.backup-jump-nav span {
  flex: 0 0 auto;
  color: #aab5c2;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.backup-jump-nav a {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #3d4650;
  border-radius: 999px;
  color: #dbe9f5;
  background: #24292f;
  font-size: 0.82rem;
  text-decoration: none;
}

.backup-jump-nav a:hover,
.backup-jump-nav a:focus-visible { border-color: #7daed5; background: #2c3741; }

.backup-library-group:target { border-color: #6f9fc5; box-shadow: 0 0 0 2px rgba(111,159,197,0.16); }

.backup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #202020;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .backup-groups-grid { grid-template-columns: minmax(0, 1fr); }
  .backup-status-grid { grid-template-columns: minmax(0, 1fr); }
  .backup-row { align-items: stretch; }
  .backup-row > div:first-child { min-width: 0; }
  .backup-row .card-actions { width: 100%; }
  .backup-row .card-actions > * { flex: 1 1 auto; }
  .backup-row .card-actions .btn-small { width: 100%; text-align: center; }
  .backup-library-head { align-items: center; }
  .backup-library-title { flex-basis: calc(100% - 120px); font-size: 1rem; }
  .backup-jump-nav { margin-inline: -2px; }
}

.admin-shell-wide {
  max-width: 1400px;
}

.section-heading-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}

.dashboard-layout-summary-panel {
  margin-bottom: 24px;
}

.dashboard-layout-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-layout-form {
  margin: 0;
  width: auto;
}

.dashboard-layout-tools .btn-small[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.dashboard-layout-summary-strip {
  margin-top: 18px;
}

/* Dashboard overview and grouped navigation */
.dashboard-hero .top-links {
  justify-content: flex-end;
}

.dashboard-home {
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid #2d3542;
  border-radius: 20px;
  background: linear-gradient(135deg, #18202b 0%, #15191f 55%, #171b20 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
  scroll-margin-top: 18px;
}

.dashboard-common-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
}

.dashboard-common-tools a {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 2px 10px;
  align-items: center;
  min-height: 64px;
  padding: 13px 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid #303a47;
  border-radius: 14px;
  text-decoration: none;
}

.dashboard-common-tools a:hover,
.dashboard-common-tools a:focus-visible {
  background: rgba(127, 208, 255, 0.08);
  border-color: #4e708d;
  text-decoration: none;
}

.dashboard-common-tools a > span {
  grid-row: 1 / span 2;
  font-size: 23px;
}

.dashboard-common-tools strong {
  font-size: 0.95rem;
}

.dashboard-common-tools small {
  color: #aebaca;
  font-size: 0.78rem;
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  scroll-margin-top: 18px;
}

.dashboard-sidebar {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 17px;
  border: 1px solid #2d3542;
  border-radius: 18px;
  background: #15191f;
  scrollbar-width: thin;
}

.dashboard-sidebar-heading {
  display: grid;
  gap: 2px;
  padding: 2px 5px 14px;
  border-bottom: 1px solid #2a323d;
}

.dashboard-nav {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.dashboard-nav a {
  display: block;
  padding: 9px 10px;
  border-radius: 9px;
  color: #c9d6e4;
  text-decoration: none;
  line-height: 1.25;
}

.dashboard-nav a:hover,
.dashboard-nav a:focus-visible {
  color: #fff;
  background: #202a35;
  text-decoration: none;
}

.dashboard-nav-home {
  color: #9fd7ff !important;
  background: #192431;
  font-weight: 700;
}

.dashboard-nav-group {
  border-bottom: 1px solid #272f39;
  padding-bottom: 7px;
}

.dashboard-nav-group summary {
  padding: 9px 5px;
  color: #fff;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
}

.dashboard-nav-links {
  display: grid;
  gap: 1px;
  padding: 0 0 3px 7px;
}

.dashboard-nav-links a {
  padding: 7px 9px;
  font-size: 0.84rem;
}

.dashboard-nav-logout {
  margin-top: 4px;
  color: #ffb7b7 !important;
}

.dashboard-main {
  min-width: 0;
}

.dashboard-section {
  scroll-margin-top: 18px;
}

.dashboard-layout-details {
  padding: 0;
  overflow: hidden;
}

.dashboard-layout-details > summary {
  padding: 16px 18px;
  cursor: pointer;
  color: #c8d9e9;
  font-weight: 700;
}

.dashboard-layout-details-body {
  padding: 0 18px 18px;
}

.dashboard-mobile-menu {
  display: none;
  margin-bottom: 18px;
  border: 1px solid #344252;
  border-radius: 14px;
  background: #171e27;
}

.dashboard-mobile-menu > summary {
  padding: 15px 17px;
  cursor: pointer;
  color: #d9edff;
  font-weight: 700;
}

.dashboard-mobile-menu .dashboard-nav {
  margin: 0;
  padding: 0 12px 14px;
}

@media (max-width: 940px) {
  .dashboard-workspace {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    display: none;
  }

  .dashboard-mobile-menu {
    display: block;
  }

  .dashboard-mobile-menu .dashboard-nav-group:not([open]) .dashboard-nav-links {
    display: none;
  }
}

@media (max-width: 720px) {
  .dashboard-hero {
    padding: 21px;
  }

  .dashboard-hero .top-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .dashboard-hero .top-links a {
    min-width: 0;
    padding: 10px 8px;
  }

  .dashboard-home {
    padding: 19px;
  }

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

  .dashboard-common-tools a {
    grid-template-columns: 1fr;
    min-height: 96px;
  }

  .dashboard-common-tools a > span {
    grid-row: auto;
  }

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

  .admin-card {
    min-height: 0;
  }

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

  .section-meta-value-text {
    font-size: 15px;
  }

  .panel,
  .dashboard-section {
    overflow-x: auto;
  }
}

@media (max-width: 420px) {
  .dashboard-common-tools,
  .section-meta-strip {
    grid-template-columns: 1fr;
  }
}

.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.analytics-summary-card {
  background: #181818;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 16px;
}

.analytics-summary-card-wide {
  grid-column: span 2;
}

.summary-page-list {
  margin: 10px 0 0 18px;
  padding: 0;
}

.summary-page-list li {
  margin-bottom: 8px;
}

.summary-page-list span {
  display: block;
  color: #b7c0cc;
  font-size: 13px;
  margin-top: 2px;
}

@media (max-width: 900px) {
  .analytics-summary-card-wide {
    grid-column: span 1;
  }
}

/* Shared, client-only content preview */
.preview-actions { display:inline-flex; gap:10px; align-items:center; flex-wrap:wrap; }
.preview-button { background:#24345f; border:1px solid #6f8cff; color:#fff; }
.content-preview-modal { position:fixed; inset:0; z-index:10000; display:none; align-items:center; justify-content:center; padding:24px; background:rgba(0,0,0,.78); }
.content-preview-modal.is-open { display:flex; }
.content-preview-dialog { width:min(1080px,100%); max-height:92vh; overflow:auto; border:1px solid #46516b; border-radius:18px; background:#111827; box-shadow:0 30px 90px rgba(0,0,0,.6); }
.content-preview-head { position:sticky; top:0; z-index:2; display:flex; justify-content:space-between; gap:16px; align-items:center; padding:16px 18px; background:#111827; border-bottom:1px solid #344056; }
.content-preview-head h2 { margin:0; font-size:20px; }
.content-preview-tools { display:flex; gap:8px; flex-wrap:wrap; }
.content-preview-tools button { margin:0; padding:8px 12px; }
.content-preview-tools button.is-active { background:#4064d8; }
.content-preview-notice { margin:16px 18px 0; padding:12px 14px; border:1px solid #d6a936; border-radius:10px; color:#ffe9a8; background:#372d12; font-weight:700; }
.content-preview-stage { width:100%; margin:18px auto; padding:0 18px 18px; transition:max-width .2s ease; }
.content-preview-stage.is-mobile { max-width:390px; }
.content-preview-canvas { overflow:hidden; min-height:260px; border-radius:14px; background:#f7f7f5; color:#171717; font-family:Arial,sans-serif; }
.pv-hero { min-height:340px; padding:60px 42px; display:flex; flex-direction:column; justify-content:center; background:#172033 center/cover no-repeat; color:#fff; }
.pv-eyebrow { font-size:12px; text-transform:uppercase; letter-spacing:.12em; opacity:.75; }
.pv-hero h1,.pv-section h2 { margin:8px 0 12px; }
.pv-copy { white-space:pre-wrap; line-height:1.6; }
.pv-buttons,.pv-badges { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.pv-button,.pv-badge { display:inline-block; padding:9px 13px; border-radius:999px; background:#3158b7; color:#fff; text-decoration:none; }
.pv-badge { padding:5px 9px; background:#e4e8f0; color:#25304a; font-size:12px; }
.pv-section { padding:28px; }
.pv-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:16px; }
.pv-card { overflow:hidden; border:1px solid #d8dce5; border-radius:12px; background:#fff; }
.pv-card-body { padding:16px; }
.pv-card img,.pv-photo { display:block; width:100%; max-height:420px; object-fit:cover; background:#ddd; }
.pv-video { aspect-ratio:16/9; width:100%; border:0; background:#080808; }
.pv-stars { color:#d69d00; letter-spacing:.12em; }
.pv-empty { padding:48px 24px; text-align:center; color:#667085; }
body.preview-modal-open { overflow:hidden; }
@media (max-width:600px) { .content-preview-modal{padding:0}.content-preview-dialog{max-height:100vh;border-radius:0}.pv-hero{padding:42px 24px}.pv-section{padding:20px} }

.admin-shell-wide {
  max-width: 1380px;
}

.analytics-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: end;
}

.analytics-filter-grid label {
  display: block;
  font-size: 13px;
  color: #b7c0cc;
  margin-bottom: 6px;
}

.analytics-filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.analytics-filter-actions .btn-small {
  margin: 8px 0;
}

.analytics-filter-context {
  margin-top: 10px;
}

.analytics-grid-phase2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.analytics-panel-chart.analytics-panel-wide {
  grid-column: span 2;
}

.traffic-chart-tall {
  min-height: 280px;
}

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

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

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

.form-grid.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.permission-switches,
.permission-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 18px 0;
}

.permission-tree {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.permission-domain {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255,255,255,.04);
}

.permission-domain summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.permission-feature {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.permission-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 14px;
  margin-left: 24px;
}

.inline-check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.inline-check input,
.inline-form input[type="checkbox"] {
  width: auto;
}

.inline-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.btn-small.danger,
button.danger {
  border-color: rgba(255,120,120,.5);
  color: #ffd0d0;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.analytics-table th,
.analytics-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #333;
  vertical-align: top;
  font-size: 14px;
}

.analytics-table th {
  color: #b7c0cc;
  font-weight: 600;
}

.insight-rank-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 12px;
}

.insight-rank-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
}

.insight-rank-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.insight-rank-list li span {
  color: #b7c0cc;
  text-align: right;
}

.insight-rank-list-wide li {
  align-items: flex-start;
  flex-direction: column;
}

.analytics-recent-panel,
.analytics-table-panel,
.analytics-filters-panel {
  margin-top: 20px;
}

@media (max-width: 900px) {
  .analytics-panel-chart.analytics-panel-wide {
    grid-column: span 1;
  }
}

/* Mobile usability pass: shared admin controls, navigation, and dense content. */
:focus-visible {
  outline: 3px solid #8fd3ff;
  outline-offset: 3px;
}

button,
.btn-small,
.top-links a,
summary,
input[type="checkbox"],
input[type="radio"] {
  touch-action: manipulation;
}

input[type="checkbox"],
input[type="radio"] {
  min-width: 22px;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.checkbox-row,
.placement-check,
.inline-check {
  min-height: 44px;
}

.backup-file-value,
.backup-file-meta,
.backup-row,
.traffic-value,
.admin-table td,
.analytics-table td {
  overflow-wrap: anywhere;
}

.traffic-card,
.traffic-strip > * {
  min-width: 0;
}

.analytics-grid.analytics-grid-phase2 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.analytics-grid-phase2 .analytics-panel-chart.analytics-panel-wide {
  grid-column: span 12;
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 12px;
  }

  body {
    min-width: 0;
    overflow-x: hidden;
    font-size: 16px;
  }

  input,
  select,
  textarea,
  button {
    min-height: 44px;
    font-size: 16px;
  }

  textarea {
    min-height: 132px;
    line-height: 1.5;
    resize: vertical;
  }

  input[type="file"] {
    padding: 12px;
  }

  .panel,
  .dashboard-section {
    padding: 16px;
    overflow-x: visible;
  }

  .admin-topbar {
    gap: 14px;
    margin-bottom: 18px;
  }

  .top-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .top-links a {
    min-width: 0;
    min-height: 44px;
    padding: 10px;
    text-align: center;
  }

  .filter-bar select,
  .analytics-sort-control,
  .analytics-sort-control select {
    width: 100%;
    max-width: none;
  }

  .card-actions,
  .reorder-actions,
  .preview-actions,
  .permission-toolbar,
  .permission-switches {
    width: 100%;
  }

  .card-actions > *,
  .preview-actions > *,
  .reorder-actions > * {
    flex: 1 1 132px;
  }

  .card-actions form,
  .inline-form {
    width: 100%;
  }

  .card-actions .btn-small,
  .card-actions button,
  .preview-actions .btn-small,
  .preview-actions button {
    width: 100%;
    min-height: 44px;
    text-align: center;
  }

  .btn-icon,
  .drag-handle,
  .drag-handle.large {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .dropzone {
    min-height: 180px;
  }

  .permission-domain summary,
  .dashboard-nav-group summary,
  .backup-library-head {
    min-height: 44px;
    align-items: center;
  }

  .permission-actions {
    grid-template-columns: 1fr;
    margin-left: 0;
  }

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

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

  .analytics-grid-phase2 .analytics-panel,
  .analytics-grid-phase2 .analytics-panel-chart.analytics-panel-wide {
    grid-column: auto;
  }

  .traffic-strip-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .traffic-card-wide {
    grid-column: auto;
  }

  .analytics-summary-card-wide,
  .analytics-panel-chart.analytics-panel-wide {
    grid-column: auto;
  }

  .analytics-panel,
  .analytics-panel-chart {
    min-width: 0;
  }

  .traffic-chart {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap {
    margin-inline: -16px;
    padding-inline: 16px;
    overscroll-behavior-inline: contain;
  }

  .admin-table,
  .analytics-table {
    min-width: 680px;
  }

  .backup-action-card,
  .backup-row {
    padding: 14px;
  }

  .backup-row .card-actions form + form {
    margin-top: 8px;
  }

  .content-preview-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
  }

  .content-preview-head h2 {
    font-size: 18px;
  }

  .content-preview-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-preview-tools button {
    min-width: 0;
    min-height: 44px;
    padding: 8px;
  }

  .content-preview-notice {
    position: sticky;
    top: 118px;
    z-index: 1;
    margin: 10px 12px 0;
    padding: 10px 12px;
    font-size: 14px;
  }

  .content-preview-stage,
  .content-preview-stage.is-mobile {
    max-width: 100%;
    margin: 12px auto;
    padding: 0 12px 16px;
  }

  .content-preview-canvas {
    min-height: 220px;
  }

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

  .pv-video {
    max-height: 56.25vw;
  }
}

.registry-shell { max-width: 1440px; }
.registry-summary { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.registry-summary .status-text { display: block; margin-top: 5px; color: #b7c0cc; font-size: 0.84rem; line-height: 1.35; }
.registry-source-status ul { margin: 8px 0 0; padding-left: 18px; }
.registry-source-status li { margin: 5px 0; }
.registry-source-status span { color: #b7c0cc; }
.registry-filters { display: grid; grid-template-columns: minmax(230px, 2fr) repeat(4, minmax(140px, 1fr)); gap: 14px; align-items: end; }
.registry-filters label { display: grid; gap: 7px; color: var(--muted, #aeb7c8); font-size: 13px; font-weight: 700; }
.registry-filters input[type="search"], .registry-filters select { width: 100%; min-height: 42px; box-sizing: border-box; }
.registry-filter-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.registry-filter-actions .btn-small { min-height: 42px; }
.registry-table-wrap { overflow-x: auto; }
.registry-table { min-width: 1380px; }
.registry-table td { vertical-align: top; }
.registry-table td strong, .registry-table td span, .registry-table td code { display: block; }
.registry-table code { white-space: normal; word-break: break-word; }
.registry-link { display: inline-block; margin-top: 7px; font-weight: 700; }
.registry-manager-link { white-space: nowrap; }
.registry-warning { margin-top: 5px; color: #ffd27a; line-height: 1.35; }
.registry-badge { display: inline-block !important; width: max-content; max-width: 100%; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: normal; }
.registry-status-active,
.registry-status-published,
.registry-status-playable-now,
.registry-status-live,
.registry-status-visible { background: rgba(51, 196, 129, .16); color: #7ce7ae; }
.registry-status-inactive,
.registry-status-draft,
.registry-status-hidden,
.registry-status-disabled { background: rgba(255, 103, 103, .15); color: #ff9b9b; }
.registry-status-not-available { background: rgba(160, 170, 190, .15); color: #c5ccda; }
.registry-empty { padding: 24px; text-align: center; }

@media (max-width: 1100px) { .registry-filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .registry-table-wrap { overflow-x: visible; }
  .registry-table,
  .registry-table thead,
  .registry-table tbody,
  .registry-table th,
  .registry-table td,
  .registry-table tr { display: block; min-width: 0; }
  .registry-table thead { display: none; }
  .registry-table tr {
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid #30343a;
    border-radius: 8px;
    background: #181a1f;
  }
  .registry-table td {
    display: grid;
    grid-template-columns: minmax(96px, 34%) 1fr;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 0;
  }
  .registry-table td::before {
    content: attr(data-label);
    color: #b7c0cc;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
}

@media (max-width: 620px) { .registry-filters { grid-template-columns: 1fr; } }

@media (max-width: 430px) {
  .registry-filters { grid-template-columns: 1fr; }
  body {
    padding: 12px;
  }

  .dashboard-title {
    font-size: 1.85rem;
  }

  .dashboard-hero,
  .dashboard-home,
  .dashboard-section,
  .panel {
    border-radius: 14px;
  }

  .dashboard-hero .top-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-mobile-menu {
    position: sticky;
    top: 8px;
    z-index: 50;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  }

  .dashboard-mobile-menu > summary {
    min-height: 48px;
    box-sizing: border-box;
  }

  .dashboard-mobile-menu[open] {
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
  }

  .dashboard-nav a,
  .dashboard-nav-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
  }

  .section-meta-strip,
  .dashboard-common-tools {
    grid-template-columns: minmax(0, 1fr);
  }

  .backup-library-title {
    flex-basis: 100%;
  }
}

/* Keep every historical date visible through scrolling, including on phones. */
.analytics-history-chart.traffic-chart {
  display: flex;
  align-items: flex-end;
  overflow-x: auto;
  gap: 12px;
  padding-bottom: 12px;
}
.analytics-history-chart.traffic-chart .traffic-bar-group,
.analytics-history-chart.traffic-chart .traffic-bar-group:nth-child(n+8) {
  display: flex;
  flex: 0 0 92px;
}
.analytics-history-chart .traffic-bar-label {
  white-space: nowrap;
}
