:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-soft: #eef3f1;
  --text: #15201d;
  --muted: #62706b;
  --line: #dce5e2;
  --accent: #0f766e;
  --accent-dark: #0b5751;
  --warn: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  height: 64px;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.nav {
  align-items: center;
  display: flex;
  gap: 18px;
}

.nav a,
.nav button {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 0;
}

.nav button:hover,
.nav a:hover {
  color: var(--text);
}

.page {
  margin: 0 auto;
  max-width: 1320px;
  padding: 32px 28px 56px;
}

.page-head {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: 36px;
  line-height: 1.1;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 15px;
}

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

.stats span,
.departments span {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-weight: 700;
  padding: 8px 12px;
}

.final-intro {
  color: var(--muted);
  margin: 10px 0 0;
  max-width: 760px;
}

.final-section {
  margin-top: 22px;
}

.final-section-head {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.final-note {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.final-poster-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.final-poster-card {
  display: flex;
  height: 100%;
  min-width: 0;
  min-width: 0;
}

.final-poster-card .poster-card-btn {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.final-poster-card .poster-img {
  aspect-ratio: 2 / 3;
  height: auto;
  width: 100%;
}

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

.final-source-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.final-source-poster {
  background:
    linear-gradient(180deg, rgba(21, 32, 29, 0.02), rgba(21, 32, 29, 0.12)),
    linear-gradient(135deg, #f6f0e2, #e3ddd0);
  align-items: center;
  display: flex;
  height: 440px;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  position: relative;
  width: 100%;
}

.final-source-poster img {
  background: #ffffff;
  border: 10px solid #fffdf9;
  box-shadow: 0 18px 36px rgba(21, 32, 29, 0.18);
  display: block;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  min-width: 0;
  object-fit: contain;
  width: auto;
}

.final-rank {
  background: #15201d;
  border-radius: 999px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  left: 28px;
  padding: 6px 10px;
  position: absolute;
  top: 28px;
}

.final-source-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  min-width: 0;
  padding: 16px;
}

.final-source-body h3 {
  line-height: 1.35;
}

.final-source-label {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  margin: 0;
  text-transform: uppercase;
}

.final-source-body small:last-child {
  margin-top: auto;
}

.region-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.region-card {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  min-height: 86px;
  padding: 18px;
  text-decoration: none;
}

.region-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.region-card span {
  font-weight: 800;
}

.region-card strong {
  color: var(--accent-dark);
  font-size: 24px;
}

.search {
  display: flex;
  gap: 8px;
}

.search input,
.login-form input,
.search select {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 42px;
  padding: 10px 12px;
}

.search button,
.login-form button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 10px 16px;
}

.search button:hover,
.login-form button:hover {
  background: var(--accent-dark);
}

.toolbar-panel {
  margin-bottom: 18px;
}

.toolbar-panel form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.heraldry-filters input {
  min-width: min(320px, 100%);
}

.ghost-link {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  min-height: 42px;
  padding: 10px 12px;
}

.ghost-link:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.heraldry-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.heraldry-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
}

.heraldry-card.is-selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.heraldry-thumb {
  background: #ffffff;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  padding: 12px;
}

.heraldry-thumb img {
  height: 100%;
  max-height: 84px;
  margin: 0 auto;
  object-fit: contain;
  width: 100%;
}

.heraldry-meta {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.heraldry-meta h2 {
  font-size: 14px;
  line-height: 1.2;
}

.heraldry-meta p {
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.3;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heraldry-actions {
  align-items: end;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: auto;
}

.heraldry-actions button,
.selected-heraldry-item button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 28px;
  padding: 4px 8px;
}

.heraldry-actions button.danger,
.selected-heraldry-item button.danger {
  background: var(--warn);
}

.heraldry-actions a {
  font-size: 13px;
  line-height: 1.2;
}

.selected-city-list {
  display: grid;
  gap: 14px;
}

.selected-city-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.selected-city-card > header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.selected-city-card > header span {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
}

.city-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: end;
}

.kpi.match {
  background: #e8f7ef;
  border-color: #b7e4ca;
  color: #17663f;
}

.kpi.mismatch {
  background: #fdecec;
  border-color: #f6c4c4;
  color: #8f1d1d;
}

.selected-heraldry-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.selected-heraldry-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 6px;
}

.selected-heraldry-item a {
  background: #fff;
  border-radius: 6px;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  padding: 10px;
}

.selected-heraldry-item img {
  height: 100%;
  max-height: 64px;
  margin: 0 auto;
  object-fit: contain;
  width: 100%;
}

.selected-heraldry-item p {
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.3;
  margin: 0;
  min-height: 2.6em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  color: var(--muted);
}

@media (max-width: 900px) {
  .page-head {
    align-items: start;
    flex-direction: column;
  }

  .stats {
    justify-content: start;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 24px 14px 42px;
  }

  .heraldry-grid,
  .selected-heraldry-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .heraldry-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .heraldry-actions button,
  .selected-heraldry-item button {
    width: 100%;
  }
}

.departments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.table-wrap,
.panel,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.pagination {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 22px;
}

.city-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.info-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, 1fr);
  margin-bottom: 24px;
}

.info-grid div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 14px;
}

.info-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.info-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

.split {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(360px, .9fr) minmax(0, 1.1fr);
}

.panel {
  padding: 18px;
}

.panel h2 {
  margin-bottom: 16px;
}

.source {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.source:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.source header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.source p {
  color: #2c3935;
  line-height: 1.6;
  margin: 0 0 10px;
}

.source small {
  color: var(--muted);
  font-weight: 700;
}

.image-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.image-grid-wide {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.panel-wide {
  margin-top: 18px;
}

.asset-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.asset-count {
  color: var(--muted);
  font-weight: 700;
}

.asset-filters {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(160px, 1fr));
  margin-bottom: 14px;
}

.asset-filters input,
.asset-filters select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 10px;
}

.image-tile {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: block;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.15s;
}

.image-tile.is-eligible {
  border-color: #4caf50;
  border-width: 2px;
}

.image-tile.is-rejected {
  border-color: var(--line);
  opacity: 0.55;
}

.image-media {
  position: relative;
}

.image-media a {
  display: block;
}

.image-tile img {
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  width: 100%;
}

.poster-toggle {
  align-items: center;
  background: rgba(0, 0, 0, 0.38);
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  height: 26px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 6px;
  top: 6px;
  transition: background 0.12s, transform 0.1s;
  width: 26px;
}

.heraldry-badge {
  background: rgba(132, 32, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  left: 6px;
  letter-spacing: 0;
  padding: 4px 7px;
  position: absolute;
  text-transform: uppercase;
  top: 6px;
}

.poster-toggle:hover {
  background: rgba(0, 0, 0, 0.65);
  transform: scale(1.15);
}

.is-eligible .poster-toggle {
  background: #2e7d32;
  border-color: #fff;
}

.is-rejected .poster-toggle {
  background: #b71c1c;
  border-color: #fff;
}

.poster-toggle:disabled {
  opacity: 0.5;
  cursor: wait;
}

.image-controls {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 4px;
  padding: 5px 6px;
}

.validated-btn {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  white-space: nowrap;
}

.validated-btn.is-valid {
  background: #e8f5e9;
  border-color: #81c784;
  color: #2e7d32;
}

.validated-btn:disabled {
  cursor: wait;
  opacity: 0.5;
}

.style-btns {
  display: flex;
  gap: 3px;
  margin-left: auto;
}

.style-btn {
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  opacity: 0.35;
  padding: 3px 4px;
  background: var(--panel-soft);
  color: var(--muted);
}

.style-btn.active.style-default {
  background: #e8eeff;
  border-color: #aecbfa;
  color: #1a47c4;
  opacity: 1;
}

.style-btn.active.style-van-gogh {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
  opacity: 1;
}

.style-btn.active.style-bd-realiste {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
  opacity: 1;
}

.style-btn:disabled {
  cursor: wait;
}

.image-tile.is-unvalidated {
  opacity: 0.5;
}

.image-tile span {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  min-height: 48px;
  padding: 8px;
}

.asset-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 8px 0;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 7px;
  text-transform: lowercase;
}

.badge.kind {
  background: #eef3f1;
  border-color: #d8e5e1;
  color: #36524b;
}

.badge.match {
  background: #e8f7ef;
  border-color: #b7e4ca;
  color: #17663f;
}

.badge.mismatch {
  background: #fdecec;
  border-color: #f6c4c4;
  color: #8f1d1d;
}

.badge.uncertain {
  background: #fff9e8;
  border-color: #f5e39a;
  color: #7a5d08;
}

.badge.rights {
  background: #edf4ff;
  border-color: #ccddfb;
  color: #244f92;
}

.posters-section {
  margin-top: 32px;
}

.posters-section h2 {
  margin-bottom: 16px;
}

.poster-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.poster-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.poster-img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.poster-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px 4px;
  gap: 8px;
}

.poster-model {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poster-date {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.poster-sources {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 8px;
}

.poster-sources small {
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}

.poster-source-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
}

/* --- Poster card rework --- */

.poster-count {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 2px 10px;
  vertical-align: middle;
}

.poster-card-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: block;
  padding: 0;
  text-align: left;
  width: 100%;
}

.poster-footer {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 2px 10px 8px;
}

.poster-size {
  font-size: 11px;
  color: var(--muted);
}

/* Provider badges */
.poster-provider {
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  padding: 2px 8px;
  white-space: nowrap;
}

.provider-gemini {
  background: #e8f0fe;
  border: 1px solid #aecbfa;
  color: #1a73e8;
}

.provider-openai {
  background: #e6f4f1;
  border: 1px solid #81c9bf;
  color: #0d7a6b;
}

/* Style badges */
.poster-style-badge {
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  white-space: nowrap;
}

.poster-style-default {
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
}

.poster-style-van-gogh {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.poster-style-bd-realiste {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}

/* --- Lightbox --- */

.lightbox {
  background: rgba(0, 0, 0, 0.75);
  border: none;
  height: 100dvh;
  inset: 0;
  margin: 0;
  max-height: 100dvh;
  max-width: 100dvw;
  padding: 0;
  width: 100dvw;
}

.lightbox::backdrop {
  background: transparent;
}

.lightbox-inner {
  align-items: stretch;
  display: flex;
  height: 100%;
  overflow: hidden;
}

.lightbox-img-wrap {
  align-items: center;
  display: flex;
  flex: 1;
  justify-content: center;
  overflow: hidden;
  padding: 24px;
}

.lightbox-img-wrap img {
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.lightbox-meta {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  padding: 24px 20px;
  position: relative;
  width: 280px;
}

.lb-close {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 4px 8px;
  position: absolute;
  right: 12px;
  top: 12px;
}

.lb-close:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.lightbox-meta h3 {
  font-size: 18px;
  margin-bottom: 20px;
  padding-right: 32px;
}

.lb-details {
  display: grid;
  gap: 2px 8px;
  grid-template-columns: auto 1fr;
  margin: 0 0 20px;
}

.lb-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 0;
  text-transform: uppercase;
}

.lb-details dd {
  font-size: 13px;
  margin: 0;
  padding: 6px 0;
  word-break: break-word;
}

.lb-sources-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.lb-sources-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lb-source-thumb {
  border: 1px solid var(--line);
  border-radius: 4px;
  height: 56px;
  object-fit: cover;
  width: 56px;
}

.map-choice-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.map-choice-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.map-choice-card img {
  aspect-ratio: 1 / 1.414;
  background: var(--panel-soft);
  display: block;
  object-fit: cover;
  width: 100%;
}

.map-choice-info {
  padding: 14px;
}

.map-choice-info h2 {
  font-size: 18px;
  margin: 0 0 6px;
}

.map-choice-info p {
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 12px;
}

.map-choice-info .map-choice-family {
  color: var(--accent-dark);
  font-size: 12px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.map-choice-actions {
  display: flex;
  gap: 12px;
}

.empty {
  color: var(--muted);
  margin: 0;
  padding: 18px;
}

.login-body {
  align-items: center;
  background: linear-gradient(135deg, #e9f5f2, #f7f7f0 48%, #edf3fa);
  display: flex;
  min-height: 100vh;
  justify-content: center;
  padding: 24px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-panel {
  padding: 28px;
}

.login-panel h1 {
  margin-bottom: 22px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  color: var(--muted);
  display: grid;
  font-weight: 700;
  gap: 7px;
}

.error {
  background: #fff1f0;
  border: 1px solid #ffd6d2;
  border-radius: 8px;
  color: var(--warn);
  font-weight: 700;
  margin: 0 0 16px;
  padding: 10px 12px;
}

@media (max-width: 900px) {
  .topbar,
  .page-head,
  .split {
    display: block;
  }

  .topbar {
    height: auto;
    padding: 16px;
  }

  .nav {
    flex-wrap: wrap;
    margin-top: 10px;
  }

  .stats,
  .search {
    justify-content: start;
    margin-top: 14px;
  }

  .search {
    display: grid;
  }

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

  .panel + .panel {
    margin-top: 18px;
  }

  .asset-filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .page {
    padding: 24px 14px 40px;
  }

  h1 {
    font-size: 30px;
  }

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

  .asset-filters {
    grid-template-columns: 1fr;
  }

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