:root {
  color-scheme: dark;
  --ink: #edf7ff;
  --muted: #91a6ba;
  --panel: #0d1b2a;
  --panel-deep: #07111f;
  --line: rgba(102, 197, 255, .22);
  --blue: #42b8ff;
  --green: #68e39f;
  --amber: #ffce68;
  --red: #ff7c7c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 0, rgba(38, 123, 193, .2), transparent 34rem),
    #07111f;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
  width: min(1740px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

h1, h2, h3, p, figure { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(28px, 4vw, 44px); }

.room-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  background: rgba(13, 27, 42, .95);
  box-shadow: 0 20px 46px rgba(0, 0, 0, .22);
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .15em;
}

.summary {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.header-actions,
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.header-actions { justify-content: flex-end; }

a, button {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #12253a;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

a:hover, button:hover, button:focus-visible, a:focus-visible {
  border-color: var(--blue);
  outline: none;
}

button:disabled { cursor: wait; opacity: .55; }

.primary-action {
  border-color: rgba(66, 184, 255, .7);
  background: #176fa9;
}

.room-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 16px 0;
  border: 1px solid var(--line);
  background: rgba(13, 27, 42, .92);
}

.room-stats article {
  min-width: 0;
  padding: 15px 17px;
  border-right: 1px solid var(--line);
}

.room-stats article:last-child { border-right: 0; }
.room-stats span, .product-file, .product-meta {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
}
.room-stats strong { display: block; margin-top: 6px; }

.room-controls {
  display: grid;
  grid-template-columns: minmax(230px, 330px) minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(13, 27, 42, .92);
}

.search-control span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

input[type="search"] {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-deep);
  color: var(--ink);
  font: inherit;
}

.filter-button.active {
  border-color: rgba(66, 184, 255, .82);
  background: #176fa9;
}

.available-control {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 4px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.available-control input { width: 18px; height: 18px; accent-color: var(--blue); }

.room-message {
  margin: 0 0 16px;
  padding: 14px 17px;
  border: 1px solid rgba(66, 184, 255, .25);
  background: rgba(13, 50, 78, .28);
  color: #b9ddf3;
}

.room-message.good {
  border-color: rgba(104, 227, 159, .3);
  background: rgba(16, 77, 48, .2);
  color: var(--green);
}

.room-message.bad {
  border-color: rgba(255, 124, 124, .3);
  background: rgba(73, 22, 28, .24);
  color: var(--red);
}

.map-sections { display: grid; gap: 26px; }

.map-section {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(13, 27, 42, .75);
}

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

.section-heading h2 { margin-bottom: 3px; font-size: 21px; }
.section-heading p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.section-count {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.map-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(7, 17, 31, .96);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .2);
}

.map-card[hidden], .map-section[hidden] { display: none; }

.card-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-height: 72px;
  padding: 11px 12px 10px;
  border-bottom: 1px solid var(--line);
}

.card-heading h3 {
  margin-bottom: 5px;
  font-size: 14px;
  line-height: 1.25;
}

.product-file {
  display: block;
  overflow: hidden;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.map-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 206, 104, .4);
  border-radius: 999px;
  color: var(--amber);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  white-space: nowrap;
}

.map-card.available .map-status {
  border-color: rgba(104, 227, 159, .42);
  color: var(--green);
}

.map-card.missing .map-status {
  border-color: rgba(255, 124, 124, .4);
  color: var(--red);
}

.map-preview {
  position: relative;
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(135deg, #07111f, #111f2f);
  cursor: zoom-in;
}

.map-preview[hidden] { display: none; }

.map-preview:hover { border-color: transparent; }
.map-preview[aria-disabled="true"] { cursor: default; }

.map-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: linear-gradient(135deg, #07111f, #111f2f);
}

.map-live-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: linear-gradient(135deg, #07111f, #111f2f);
}

.map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 22px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
  text-align: center;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 11px;
}

.product-meta {
  letter-spacing: .04em;
  line-height: 1.4;
}

.open-map,
.social-queue-action {
  min-height: 31px;
  padding: 6px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.social-queue-action.queued {
  border-color: rgba(79, 223, 147, .72);
  background: rgba(38, 121, 79, .32);
  color: #b9ffd8;
}

.card-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.preview-toggle {
  min-height: 31px;
  padding: 6px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.preview-toggle:disabled,
.social-queue-action:disabled {
  cursor: default;
  opacity: .38;
}

.open-map.disabled {
  pointer-events: none;
  opacity: .38;
}

.empty-section {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .room-header { flex-direction: column; }
  .header-actions { justify-content: flex-start; }
  .room-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .room-stats article { border-bottom: 1px solid var(--line); }
  .room-controls { grid-template-columns: 1fr; align-items: start; }
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1500px) and (min-width: 1181px) {
  .map-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  main { width: min(100% - 18px, 1740px); padding-top: 9px; }
  .room-header, .map-section { padding: 16px; }
  .room-stats { grid-template-columns: 1fr 1fr; }
  .room-stats article { border-right: 1px solid var(--line); }
  .map-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
}
