:root {
  color-scheme: dark;
  --page: #050806;
  --panel: #101512;
  --panel-2: #172019;
  --text: #f5f5f2;
  --muted: #91a698;
  --line: #20382c;
  --accent: #6748ff;
  --accent-2: #8b72ff;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(23, 58, 38, 0.32) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, #08110b 0 5px, var(--page) 5px 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.gallery-shell {
  width: 100%;
  min-height: 100vh;
  padding: 10px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(170px, 1fr));
  gap: 15px;
  width: 100%;
}

.model-card {
  position: relative;
  min-height: 322px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(44, 82, 61, 0.7);
  background:
    radial-gradient(circle at 50% 44%, rgba(210, 235, 214, 0.11), transparent 22%),
    linear-gradient(145deg, #182019 0%, #0f1511 46%, #222821 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.model-card::after {
  position: absolute;
  inset: auto 0 0;
  height: 44%;
  content: "";
  background: linear-gradient(180deg, transparent 0%, rgba(10, 10, 12, 0.34) 32%, rgba(10, 10, 12, 0.76) 100%);
  pointer-events: none;
}

.art-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.halo {
  position: absolute;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 62%);
  filter: blur(1px);
}

.dummy-object {
  position: relative;
  width: min(68%, 190px);
  height: 72%;
  filter: drop-shadow(0 24px 18px rgba(0, 0, 0, 0.52));
}

.part {
  position: absolute;
  display: block;
  background: linear-gradient(135deg, var(--tone-a, #c8b16b), var(--tone-b, #634616));
  box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.24), inset 0 -18px 22px rgba(0, 0, 0, 0.28);
}

.part-one {
  left: 23%;
  top: 14%;
  width: 54%;
  height: 52%;
  border-radius: 48% 52% 44% 44%;
}

.part-two {
  left: 15%;
  top: 58%;
  width: 70%;
  height: 15%;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--tone-c, #2e2f32), var(--tone-b, #634616));
}

.part-three {
  left: 34%;
  top: 71%;
  width: 32%;
  height: 8%;
  border-radius: 999px;
  background: var(--tone-d, #e5ca65);
}

.part-four {
  left: 40%;
  top: 78%;
  width: 20%;
  height: 10%;
  border-radius: 0 0 40% 40%;
  background: linear-gradient(180deg, var(--tone-a, #c8b16b), #242428);
}

.feature .art-stage {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  place-items: initial;
}

.feature .quad {
  background:
    radial-gradient(circle at 50% 50%, rgba(210, 235, 214, 0.08), transparent 32%),
    linear-gradient(145deg, #182019, #0f1511 58%, #202820);
  border: 1px solid rgba(49, 87, 66, 0.28);
}

.feature .halo,
.feature .dummy-object {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  justify-self: center;
  align-self: center;
}

.feature .dummy-object {
  width: 54%;
  height: 58%;
}

.split .dummy-object {
  transform: translateY(-4px) scale(0.82);
}

.tag-callout {
  position: absolute;
  z-index: 2;
  inset: auto 16px 18px;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.tag-callout h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.18rem, 1.2vw, 1.55rem);
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.tag-callout a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #4a31d7);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(80, 55, 230, 0.34);
}

.corner-badge {
  position: absolute;
  z-index: 3;
  top: 17px;
  left: 17px;
  width: 15px;
  height: 15px;
}

.corner-badge::before,
.corner-badge::after {
  position: absolute;
  top: 0;
  width: 6px;
  height: 11px;
  content: "";
  border-radius: 1px 1px 4px 4px;
  background: #fff;
}

.corner-badge::before {
  left: 0;
}

.corner-badge::after {
  right: 0;
}

.card-meta {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 11px;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #f5f5f5;
  font-size: 0.76rem;
  font-weight: 650;
}

.creator,
.likes {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.creator span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: inline-grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, #96f0e1, transparent 28%),
    linear-gradient(135deg, #252a31, #08090b);
  color: #dffcf8;
  font-size: 0.64rem;
  font-weight: 900;
}

.heart {
  position: relative;
  width: 15px;
  height: 14px;
  transform: rotate(-45deg);
  background: #fff;
  border-radius: 3px 0 0 3px;
}

.heart::before,
.heart::after {
  position: absolute;
  width: 15px;
  height: 14px;
  content: "";
  border-radius: 50%;
  background: #fff;
}

.heart::before {
  top: -7px;
  left: 0;
}

.heart::after {
  top: 0;
  left: 7px;
}

.trophy {
  --tone-a: #ffcf49;
  --tone-b: #8b570c;
  --tone-c: #334d35;
  --tone-d: #f5e07c;
}

.trophy .part-one {
  height: 50%;
  clip-path: polygon(16% 0, 84% 0, 70% 74%, 55% 100%, 45% 100%, 30% 74%);
}

.crystal {
  --tone-a: #67d6ff;
  --tone-b: #d54b23;
  --tone-c: #253445;
  --tone-d: #ff8a30;
}

.crystal .part-one {
  clip-path: polygon(50% 0, 82% 34%, 68% 100%, 30% 100%, 16% 34%);
  border-radius: 24% 24% 42% 42%;
}

.totem {
  --tone-a: #587041;
  --tone-b: #27281e;
  --tone-c: #9faa68;
  --tone-d: #c6a16a;
}

.totem .part-one {
  border-radius: 38% 24% 28% 44%;
}

.house {
  --tone-a: #b77d4b;
  --tone-b: #5c3c2a;
  --tone-c: #9c8b73;
  --tone-d: #ddc092;
}

.house .part-one {
  border-radius: 24% 24% 10% 10%;
}

.robot {
  --tone-a: #c9cbca;
  --tone-b: #6e7172;
  --tone-c: #a6aaa8;
  --tone-d: #f3f4ef;
}

.robot .part-one {
  border-radius: 34% 34% 18% 18%;
}

.queen {
  --tone-a: #f0b7a9;
  --tone-b: #6e493d;
  --tone-c: #d2a351;
  --tone-d: #ffe0d2;
}

.queen .part-one {
  border-radius: 50% 50% 46% 46%;
}

.egg {
  --tone-a: #1b6bd5;
  --tone-b: #c78a25;
  --tone-c: #da2958;
  --tone-d: #f5d26e;
}

.egg .part-one {
  border-radius: 50% 50% 42% 42%;
}

.vase {
  --tone-a: #83b698;
  --tone-b: #315e4d;
  --tone-c: #d9b56a;
  --tone-d: #eacfd5;
}

.vase.floral {
  --tone-a: #e3b7b8;
  --tone-b: #293b3e;
  --tone-c: #a98f67;
  --tone-d: #f4d9df;
}

.vase .part-one {
  left: 26%;
  width: 48%;
  border-radius: 30% 30% 45% 45%;
}

.box {
  --tone-a: #b4211d;
  --tone-b: #5d1715;
  --tone-c: #e65a36;
  --tone-d: #edb858;
}

.box .part-one {
  top: 38%;
  height: 28%;
  border-radius: 36% 36% 12% 12%;
}

.chair {
  --tone-a: #c2772d;
  --tone-b: #6b3c15;
  --tone-c: #efa64d;
  --tone-d: #f3bc62;
}

.chair .part-one {
  width: 62%;
  height: 44%;
  border-radius: 44% 44% 12% 12%;
}

.cabinet {
  --tone-a: #16110f;
  --tone-b: #060505;
  --tone-c: #d5a150;
  --tone-d: #f5d884;
}

.cabinet .part-one {
  left: 14%;
  top: 30%;
  width: 72%;
  height: 44%;
  border-radius: 6px;
}

.bike {
  --tone-a: #8893a3;
  --tone-b: #39343a;
  --tone-c: #d65039;
  --tone-d: #c7d0d6;
}

.bike .part-one {
  top: 28%;
  height: 30%;
  border-radius: 60% 14% 48% 20%;
}

.wildlife {
  --tone-a: #bfa77c;
  --tone-b: #62462c;
  --tone-c: #283129;
  --tone-d: #e9c584;
}

.dolls {
  --tone-a: #f0c7a4;
  --tone-b: #272329;
  --tone-c: #ee6545;
  --tone-d: #fff0cf;
}

.dragon {
  --tone-a: #9e3823;
  --tone-b: #15181e;
  --tone-c: #4d6670;
  --tone-d: #e67831;
}

@media (max-width: 1500px) {
  .gallery-grid {
    grid-template-columns: repeat(4, minmax(190px, 1fr));
  }
}

@media (max-width: 860px) {
  .gallery-shell {
    padding: 8px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 10px;
  }

  .model-card {
    min-height: 252px;
  }
}

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

  .model-card {
    min-height: 330px;
  }
}

.admin-body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #102d18 0 5px, transparent 5px),
    linear-gradient(90deg, rgba(24, 39, 31, 0.8) 0 1px, transparent 1px 100%),
    #060b08;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  display: grid;
  width: min(420px, 100%);
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101512;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.eyebrow,
.login-panel h1,
.admin-header h1,
.panel-title h2 {
  margin: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-panel h1 {
  margin-top: 6px;
  font-size: 1.9rem;
  line-height: 1.1;
}

.login-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.login-panel input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #2a4234;
  border-radius: 6px;
  background: #070d09;
  color: var(--text);
  font: inherit;
  outline: none;
  padding: 0 13px;
}

.login-panel input:focus {
  border-color: #4d725b;
  box-shadow: 0 0 0 3px rgba(87, 132, 99, 0.22);
}

.login-alert {
  display: grid;
  gap: 4px;
  margin: -6px 0 0;
  padding: 10px 12px;
  border: 1px solid #7f3b30;
  border-radius: 6px;
  background: #25120f;
  color: #ffd3ca;
}

.login-alert strong {
  font-size: 0.74rem;
  text-transform: uppercase;
}

.login-alert span {
  font-size: 0.86rem;
  font-weight: 800;
}

.login-note {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.login-panel button,
.admin-sidebar button,
.refresh-link {
  min-height: 38px;
  border: 1px solid #2b4436;
  border-radius: 6px;
  background: #151d17;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.login-panel button {
  background: linear-gradient(135deg, #244e34, #1c3327);
}

.admin-sidebar {
  position: fixed;
  inset: 5px auto 0 0;
  display: flex;
  width: 186px;
  min-height: calc(100vh - 5px);
  flex-direction: column;
  gap: 10px;
  border-right: 1px solid #1b271f;
  background: #0c110e;
  padding: 22px 10px;
}

.admin-sidebar strong {
  margin: 0 2px 18px;
  font-size: 1rem;
}

.admin-sidebar a,
.admin-sidebar button {
  display: flex;
  width: 100%;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  color: #cbd8cf;
  font-size: 0.9rem;
  text-align: left;
  text-decoration: none;
}

.admin-sidebar a.active {
  border: 1px solid #264936;
  border-radius: 6px;
  background: #132019;
  color: #fff;
}

.admin-sidebar form {
  margin-top: auto;
}

.admin-main {
  margin-left: 186px;
  padding: 28px;
}

.admin-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 18px;
  max-width: 1440px;
}

.admin-header h1 {
  font-size: 1.85rem;
  line-height: 1;
}

.admin-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.refresh-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-actions form {
  margin: 0;
}

.admin-actions button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #4d2d27;
  border-radius: 6px;
  background: #231410;
  color: #ffd6cd;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.metric-grid,
.admin-panel,
.admin-split {
  max-width: 1440px;
  margin-right: auto;
  margin-left: auto;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.metric-card,
.admin-panel {
  border: 1px solid #1d2a22;
  border-radius: 8px;
  background: #101512;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 106px;
  padding: 16px 14px;
}

.metric-card span,
.metric-card small,
.panel-title span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.metric-card span,
.panel-title span {
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 1.85rem;
  line-height: 1;
}

.admin-panel {
  padding: 14px;
  margin-bottom: 10px;
}

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

.panel-title h2 {
  font-size: 0.96rem;
}

.hour-chart {
  display: grid;
  grid-template-columns: repeat(24, minmax(20px, 1fr));
  align-items: end;
  min-height: 244px;
  gap: 8px;
  padding: 18px 8px 0;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(44, 71, 55, 0.65) 1px, transparent 1px),
    #08100b;
  background-size: 100% 48px;
}

.world-map {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid #1c2c22;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 50%, rgba(80, 151, 102, 0.15), transparent 48%),
    linear-gradient(180deg, #07110b, #050907);
}

.admin-body.map-expanded {
  overflow: hidden;
}

.world-map.is-maximized {
  position: fixed;
  inset: 18px;
  z-index: 40;
  min-height: auto;
  border-color: rgba(112, 226, 173, 0.42);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72), 0 0 0 9999px rgba(0, 0, 0, 0.62);
}

.map-maximize {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(112, 226, 173, 0.34);
  border-radius: 999px;
  background: rgba(8, 16, 11, 0.88);
  color: #dff8e9;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.map-maximize:hover,
.map-maximize:focus {
  border-color: rgba(112, 226, 173, 0.68);
  background: rgba(22, 42, 29, 0.94);
  outline: none;
}

.mini-world-map {
  min-height: 282px;
  margin-bottom: 14px;
  box-shadow: inset 0 0 44px rgba(0, 0, 0, 0.24);
}

.world-map svg,
.map-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.world-map svg {
  z-index: 2;
  cursor: grab;
  touch-action: none;
}

.world-map svg.is-panning {
  cursor: grabbing;
}

.map-grid {
  z-index: 1;
}

.country-path {
  fill: rgba(39, 70, 50, 0.86);
  stroke: rgba(93, 137, 105, 0.5);
  stroke-width: 0.8;
  outline: none;
  transition: fill 160ms ease, stroke 160ms ease;
}

.country-path:hover,
.country-path:focus {
  fill: rgba(52, 94, 67, 0.95);
  stroke: rgba(132, 184, 145, 0.9);
  stroke-width: 1.3;
}

.map-grid {
  background:
    linear-gradient(90deg, rgba(76, 111, 86, 0.16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(76, 111, 86, 0.16) 1px, transparent 1px);
  background-size: 8.333% 25%, 8.333% 25%;
  mask-image: radial-gradient(ellipse at center, #000 45%, transparent 76%);
  pointer-events: none;
}

.visitor-point {
  cursor: pointer;
  outline: none;
}

.visitor-pulse {
  fill: rgba(239, 101, 83, 0.18);
  stroke: rgba(239, 101, 83, 0.34);
  stroke-width: 0.8;
}

.visitor-dot {
  fill: #ef6553;
  filter: drop-shadow(0 0 8px rgba(239, 101, 83, 0.9));
}

.visitor-point:hover .visitor-dot,
.visitor-point:focus .visitor-dot {
  fill: #ffaaa0;
}

.visitor-point.warning .visitor-pulse {
  fill: rgba(214, 165, 70, 0.16);
  stroke: rgba(214, 165, 70, 0.44);
}

.visitor-point.warning .visitor-dot {
  fill: #d6a546;
  filter: drop-shadow(0 0 9px rgba(214, 165, 70, 0.9));
}

.visitor-point.warning:hover .visitor-dot,
.visitor-point.warning:focus .visitor-dot {
  fill: #ffd780;
}

.visitor-point.archived .visitor-pulse {
  fill: rgba(142, 154, 146, 0.14);
  stroke: rgba(142, 154, 146, 0.38);
}

.visitor-point.archived .visitor-dot {
  fill: #8e9a92;
  filter: drop-shadow(0 0 7px rgba(142, 154, 146, 0.65));
}

.visitor-point.archived:hover .visitor-dot,
.visitor-point.archived:focus .visitor-dot {
  fill: #c2cbc5;
}

.world-map:not(.mini-world-map) .visitor-pulse {
  fill: rgba(112, 226, 173, 0.16);
  stroke: rgba(112, 226, 173, 0.38);
}

.world-map:not(.mini-world-map) .visitor-dot {
  fill: #70e2ad;
  filter: drop-shadow(0 0 8px rgba(112, 226, 173, 0.82));
}

.world-map:not(.mini-world-map) .visitor-point:hover .visitor-dot,
.world-map:not(.mini-world-map) .visitor-point:focus .visitor-dot {
  fill: #b7f6d5;
}

.map-tooltip {
  z-index: 2;
  position: absolute;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid #35533f;
  border-radius: 6px;
  background: rgba(7, 15, 10, 0.94);
  color: #eef8ef;
  font-size: 0.78rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.map-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  pointer-events: none;
  z-index: 3;
}

.unlocated-list {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.unlocated-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(214, 165, 70, 0.48);
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(39, 28, 10, 0.92), rgba(14, 19, 14, 0.76));
  color: #ffe1a3;
  font-size: 0.74rem;
  font-weight: 800;
}

.unlocated-item span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.unlocated-item span::before {
  content: "Review";
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(214, 165, 70, 0.16);
  color: #ffd780;
  font-size: 0.64rem;
  text-transform: uppercase;
}

.unlocated-item.archived {
  border-color: rgba(142, 154, 146, 0.38);
  background: linear-gradient(90deg, rgba(28, 32, 30, 0.9), rgba(11, 15, 13, 0.76));
  color: #bec8c1;
}

.unlocated-item.archived span::before {
  content: "Archived";
  background: rgba(142, 154, 146, 0.16);
  color: #c7d0ca;
}

.unlocated-list code {
  color: #ffe0a3;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

.unlocated-item.archived code {
  color: #d3dbd6;
}

.unlocated-item form,
.audit-ip-row form,
.audit-event form {
  margin: 0;
}

.unlocated-item button,
.audit-ip-row button,
.audit-event button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(142, 154, 146, 0.42);
  border-radius: 999px;
  background: rgba(142, 154, 146, 0.12);
  color: #d4ddd8;
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 900;
}

.hour-bar {
  display: grid;
  align-items: end;
  height: 210px;
  gap: 8px;
}

.hour-bar span {
  display: block;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #70e2ad, #d9a946);
}

.hour-bar small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  text-align: center;
  text-overflow: clip;
}

.admin-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compact-split {
  grid-template-columns: minmax(0, 1.62fr) minmax(260px, 0.48fr);
  gap: 14px;
  align-items: stretch;
  margin: 14px 0 0;
}

.compact-split > div {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.audit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
}

.audit-summary {
  display: grid;
  gap: 8px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid #1d2a22;
  border-radius: 6px;
  background: #0a110d;
}

.audit-summary span,
.mini-title,
.audit-event span,
.audit-event small,
.audit-ip-row span {
  color: var(--muted);
}

.audit-summary span,
.mini-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.audit-summary strong {
  font-size: 1.7rem;
  line-height: 1;
}

.audit-summary.success {
  border-color: rgba(239, 101, 83, 0.5);
}

.audit-summary.danger {
  border-color: rgba(214, 165, 70, 0.5);
}

.mini-title {
  margin: 4px 0 10px;
}

.place-note {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 10px;
  color: #a9beb0;
  font-size: 0.72rem;
  font-weight: 800;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-dot.normal {
  background: #ef6553;
  box-shadow: 0 0 10px rgba(239, 101, 83, 0.7);
}

.legend-dot.warning {
  background: #d6a546;
  box-shadow: 0 0 10px rgba(214, 165, 70, 0.7);
}

.legend-dot.failed {
  background: #ef6553;
  box-shadow: 0 0 10px rgba(239, 101, 83, 0.7);
}

.audit-ip-row {
  grid-template-columns: minmax(190px, 1fr) minmax(165px, 0.8fr) max-content max-content;
  gap: 14px;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid rgba(239, 101, 83, 0.52);
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(50, 16, 14, 0.7), rgba(8, 14, 10, 0.74));
}

.audit-ip-row.unusual {
  border-color: rgba(239, 101, 83, 0.78);
  background:
    linear-gradient(90deg, rgba(68, 18, 16, 0.78), rgba(24, 10, 9, 0.74));
  box-shadow: inset 3px 0 0 #ef6553;
}

.audit-ip-row.unusual code,
.audit-ip-row.unusual em {
  color: #ffbbb0;
}

.audit-login-meta {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.audit-login-meta strong {
  color: #f4f8f2;
  font-size: 0.82rem;
  line-height: 1;
}

.audit-ip-row span,
.audit-ip-row em {
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-ip-row em {
  padding: 6px 9px;
  border: 1px solid rgba(239, 101, 83, 0.36);
  border-radius: 999px;
  background: rgba(239, 101, 83, 0.11);
  color: #ffbbb0;
  font-style: normal;
  justify-self: end;
}

.audit-ip-row.unusual em {
  border-color: rgba(239, 101, 83, 0.45);
  background: rgba(239, 101, 83, 0.13);
}

.audit-ip-row.archived {
  border-color: rgba(142, 154, 146, 0.48);
  background: linear-gradient(90deg, rgba(27, 31, 29, 0.88), rgba(9, 13, 11, 0.76));
  box-shadow: inset 3px 0 0 #8e9a92;
}

.audit-ip-row.archived code,
.audit-ip-row.archived span,
.audit-ip-row.archived strong,
.audit-ip-row.archived small,
.audit-ip-row.archived em {
  color: #c6d0ca;
}

.audit-ip-row.archived em,
.audit-ip-row.archived b {
  border-color: rgba(142, 154, 146, 0.4);
  background: rgba(142, 154, 146, 0.14);
}

.audit-ip-row b,
.unlocated-item strong {
  padding: 6px 9px;
  border: 1px solid rgba(142, 154, 146, 0.4);
  border-radius: 999px;
  background: rgba(142, 154, 146, 0.14);
  color: #c6d0ca;
  font-size: 0.68rem;
  line-height: 1;
  text-transform: uppercase;
}

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

.audit-list-header .mini-title {
  margin: 0;
}

.audit-list-header small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: none;
}

.audit-event-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  max-height: 430px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
}

.audit-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  grid-template-areas:
    "status action"
    "ip action"
    "agent action";
  align-items: center;
  column-gap: 10px;
  row-gap: 5px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid #1d2a22;
  border-radius: 6px;
  background: linear-gradient(90deg, #0b120e, #080d0a);
}

.audit-event.success {
  border-left: 3px solid #ef6553;
  background: linear-gradient(90deg, rgba(61, 18, 16, 0.62), #080d0a);
}

.audit-event.failed {
  border-left: 3px solid #d6a546;
  background: linear-gradient(90deg, rgba(47, 32, 8, 0.62), #080d0a);
}

.audit-event.rate_limited {
  border-left: 3px solid #d6a546;
  background: linear-gradient(90deg, rgba(47, 32, 8, 0.62), #080d0a);
}

.audit-event.archived {
  border-color: rgba(142, 154, 146, 0.38);
  border-left-color: #8e9a92;
  background: linear-gradient(90deg, rgba(28, 32, 30, 0.9), rgba(9, 13, 11, 0.76));
}

.audit-event div {
  grid-area: status;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.audit-event strong {
  font-size: 0.82rem;
}

.audit-event span,
.audit-event small {
  overflow: hidden;
  font-size: 0.7rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-event code {
  grid-area: ip;
  min-width: 0;
  overflow: hidden;
  color: #e6f4e9;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-event small {
  grid-area: agent;
  min-width: 0;
}

.audit-event form {
  grid-area: action;
  align-self: center;
  justify-self: end;
}

.audit-event b {
  grid-area: action;
  justify-self: end;
  padding: 6px 9px;
  border: 1px solid rgba(142, 154, 146, 0.4);
  border-radius: 999px;
  background: rgba(142, 154, 146, 0.14);
  color: #c6d0ca;
  font-size: 0.68rem;
  line-height: 1;
  text-transform: uppercase;
}

.audit-event.archived code,
.audit-event.archived span,
.audit-event.archived small,
.audit-event.archived strong {
  color: #c6d0ca;
}

.rank-list {
  display: grid;
  gap: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: minmax(150px, 260px) 1fr 44px;
  align-items: center;
  gap: 12px;
  min-height: 28px;
}

.top-ip-row {
  grid-template-columns: minmax(140px, 1fr) minmax(76px, 96px) minmax(54px, 0.38fr) 34px;
}

.ip-location {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ip-location small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ip-location .stay-time {
  color: #b8cfbf;
}

.top-ip-row .ip-location > .stay-time {
  display: none;
}

.stay-column {
  display: grid;
  min-width: 76px;
  gap: 3px;
  color: #dff4e7;
}

.top-ip-row .stay-column strong {
  justify-self: start;
  color: #f5fff7;
  font-size: 0.76rem;
  line-height: 1;
  white-space: nowrap;
}

.top-ip-row .stay-column small {
  overflow: hidden;
  color: #a9beb0;
  font-size: 0.64rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-ip-row > strong {
  justify-self: end;
}

.rank-row code,
.visit-table code {
  color: #d9f3dd;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
}

.rank-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #07100a;
}

.rank-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #55c98a, #d6a546);
}

.rank-row strong {
  justify-self: end;
  font-size: 0.9rem;
}

.empty-state {
  margin: 8px 0;
  color: var(--muted);
}

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

.visit-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.visit-table th,
.visit-table td {
  max-width: 360px;
  padding: 10px 8px;
  border-bottom: 1px solid #1d2a22;
  color: #dce6df;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
}

.visit-table th {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.monitor-page .admin-actions button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #2b4436;
  border-radius: 6px;
  background: #151d17;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.monitor-summary {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.monitor-chart-wrap {
  position: relative;
  min-height: 300px;
  border: 1px solid #1c2c22;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(76, 111, 86, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(76, 111, 86, 0.1) 1px, transparent 1px),
    #08100b;
  background-size: 10% 100%, 100% 25%;
}

.monitor-window-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.monitor-window-controls span {
  margin-right: 4px;
}

.monitor-window-controls button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #24372c;
  border-radius: 999px;
  background: #0b130e;
  color: #b8cfbf;
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 900;
}

.monitor-window-controls button:hover,
.monitor-window-controls button:focus,
.monitor-window-controls button.active {
  border-color: rgba(112, 226, 173, 0.54);
  background: rgba(112, 226, 173, 0.12);
  color: #e7fff0;
  outline: none;
}

.monitor-chart {
  display: block;
  width: 100%;
  min-height: 300px;
}

.monitor-grid-lines .grid-horizontal {
  stroke: rgba(118, 150, 126, 0.24);
  stroke-width: 1;
}

.monitor-grid-lines .grid-vertical {
  stroke: rgba(118, 150, 126, 0.14);
  stroke-width: 1;
}

.monitor-grid-lines .grid-label {
  fill: #8fa597;
  font-size: 20px;
  font-weight: 800;
}

.monitor-grid-lines .x-label {
  fill: #738779;
  font-size: 18px;
}

.monitor-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cpu-line {
  stroke: #70e2ad;
  filter: drop-shadow(0 0 7px rgba(112, 226, 173, 0.35));
}

.gpu-line {
  stroke: #d6a546;
  filter: drop-shadow(0 0 7px rgba(214, 165, 70, 0.32));
}

.monitor-legend {
  position: absolute;
  right: 12px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cfe0d4;
  font-size: 0.72rem;
}

.monitor-legend span {
  width: 20px;
  height: 3px;
  border-radius: 999px;
}

.monitor-legend .cpu {
  background: #70e2ad;
}

.monitor-legend .gpu {
  background: #d6a546;
}

.monitor-heatmap-note {
  margin: 12px 0 8px;
  padding: 10px 12px;
  border: 1px solid #20382c;
  border-radius: 6px;
  background: #0b150f;
  color: #d9eee0;
  font-size: 0.78rem;
  font-weight: 750;
}

.monitor-heatmap {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #1d2a22;
  border-radius: 6px;
  background: #08100b;
}

.monitor-heat-axis {
  display: flex;
  justify-content: space-between;
  padding-left: 92px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.monitor-heat-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.monitor-heat-row strong {
  overflow: hidden;
  color: #f4faf5;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-heat-cells {
  display: grid;
  grid-template-columns: repeat(96, minmax(4px, 1fr));
  gap: 4px;
}

.monitor-heat-cell {
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: #1c2922;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(151, 180, 160, 0.05);
}

.monitor-heat-cell:hover,
.monitor-heat-cell:focus,
.monitor-heat-cell.selected {
  outline: 2px solid rgba(238, 248, 239, 0.82);
  outline-offset: 1px;
}

.monitor-heat-cell.empty {
  background: #101712;
}

.monitor-heat-cell.idle {
  background: #26372e;
}

.monitor-heat-cell.low {
  background: #176a5d;
}

.monitor-heat-cell.active {
  background: #21b9a5;
}

.monitor-heat-cell.warn {
  background: #d6a546;
}

.monitor-heat-cell.danger {
  background: #ef6553;
}

.monitor-heat-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #254232;
  border-radius: 6px;
  background: linear-gradient(90deg, #0d1811, #08100b);
}

.monitor-heat-detail strong {
  color: #f2fbf4;
  font-size: 0.84rem;
}

.monitor-heat-detail span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: right;
}

.monitor-split {
  align-items: stretch;
}

.monitor-resource-grid,
.monitor-gpu-list {
  display: grid;
  gap: 10px;
}

.monitor-resource,
.monitor-gpu-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #24372c;
  border-radius: 6px;
  background: #0a110d;
}

.monitor-resource-top,
.monitor-two {
  display: grid;
  gap: 8px;
}

.monitor-resource-top {
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
}

.monitor-resource span,
.monitor-gpu-card span,
.monitor-resource small,
.monitor-gpu-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.monitor-resource strong,
.monitor-gpu-card strong,
.monitor-gpu-card b {
  color: #f3faf4;
}

.monitor-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #07100a;
}

.monitor-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #70e2ad;
}

.monitor-bar span.warn {
  background: #d6a546;
}

.monitor-bar span.danger {
  background: #ef6553;
}

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

.monitor-two > div {
  display: grid;
  min-width: 0;
  gap: 6px;
}

@media (max-width: 980px) {
  .admin-sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    flex-direction: row;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid #1b271f;
  }

  .admin-sidebar strong {
    margin: 0 10px 0 0;
  }

  .admin-sidebar a,
  .admin-sidebar button {
    width: auto;
    white-space: nowrap;
  }

  .admin-sidebar form {
    margin-top: 0;
    margin-left: auto;
  }

  .admin-main {
    margin-left: 0;
    padding: 16px;
  }

  .admin-actions {
    justify-content: flex-start;
  }

  .metric-grid,
  .admin-split,
  .audit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-split {
    grid-template-columns: 1fr;
  }

  .audit-event {
    grid-template-columns: minmax(0, 1fr) max-content;
  }
}

@media (max-width: 620px) {
  .admin-header,
  .panel-title {
    display: grid;
  }

  .metric-grid,
  .admin-split,
  .audit-grid {
    grid-template-columns: 1fr;
  }

  .monitor-summary {
    grid-template-columns: 1fr;
  }

  .monitor-heat-axis {
    padding-left: 0;
  }

  .monitor-heat-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .monitor-heat-cells {
    gap: 3px;
  }

  .monitor-heat-detail {
    display: grid;
  }

  .monitor-heat-detail span {
    text-align: left;
  }

  .hour-chart {
    gap: 4px;
  }

  .world-map {
    min-height: 260px;
  }

  .mini-world-map {
    min-height: 190px;
  }

  .rank-row {
    grid-template-columns: 1fr 42px;
  }

  .top-ip-row {
    grid-template-columns: minmax(0, 1fr) max-content 34px;
  }

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

  .audit-event {
    grid-template-columns: 1fr;
    grid-template-areas:
      "status"
      "ip"
      "agent"
      "action";
  }

  .audit-event form,
  .audit-event b {
    justify-self: start;
  }

  .monitor-two {
    grid-template-columns: 1fr;
  }

  .audit-ip-row em {
    justify-self: start;
  }

  .rank-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .top-ip-row .rank-track {
    grid-column: 1 / -1;
  }
}
