:root {
  --bg-0: #05070a;
  --bg-1: #0b1015;
  --bg-2: #121922;
  --panel: rgba(11, 16, 22, 0.84);
  --panel-strong: rgba(10, 14, 18, 0.94);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text: #f5f0e5;
  --muted: #9ca8b3;
  --gold: #d8ba73;
  --gold-strong: #f2d38a;
  --alert: #d66767;
  --success: #53d18c;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(216, 186, 115, 0.16), transparent 30%),
    radial-gradient(circle at bottom left, rgba(132, 32, 44, 0.14), transparent 30%),
    linear-gradient(160deg, var(--bg-2) 0%, var(--bg-0) 100%);
  font-family: Georgia, "Times New Roman", serif;
}

body {
  min-height: 100vh;
}

body.is-locked {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

p {
  margin: 0;
}

#appShell[hidden] {
  display: none;
}

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

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--gold);
  font-size: 0.78rem;
}

.lockscreen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 28px;
  isolation: isolate;
}

.lockscreen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(216, 186, 115, 0.12), transparent 24%),
    radial-gradient(circle at 80% 10%, rgba(180, 48, 56, 0.14), transparent 22%),
    linear-gradient(180deg, rgba(5, 7, 10, 0.18), rgba(5, 7, 10, 0.5));
  pointer-events: none;
}

.lockscreen-grid,
.lockscreen-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lockscreen-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 100%);
  opacity: 0.3;
  animation: driftGrid 18s linear infinite;
}

.lockscreen-noise {
  opacity: 0.08;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.7) 0.4px, transparent 0.5px);
  background-size: 8px 8px;
  animation: noiseFloat 9s steps(8) infinite;
}

.lockscreen-header,
.lockscreen-layout {
  position: relative;
  z-index: 1;
}

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

.lockscreen-tag,
.header-pill,
.intel-heading,
.asset-label,
.terminal-kicker,
.meta-chip,
.terminal-feed,
.unlock-form label,
.unlock-feedback,
.intel-list,
.lockscreen input,
.lockscreen button {
  font-family: Consolas, "Courier New", monospace;
}

.lockscreen-tag {
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.header-pill {
  border: 1px solid rgba(216, 186, 115, 0.36);
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(10, 14, 18, 0.62);
  color: var(--gold-strong);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.lockscreen-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(260px, 320px);
  gap: 20px;
  min-height: calc(100vh - 110px);
}

.intel-column {
  display: grid;
  gap: 20px;
  align-content: start;
}

.intel-card,
.terminal-card,
.panel,
.sidebar,
.viewport {
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.intel-card,
.terminal-card {
  position: relative;
  background: linear-gradient(180deg, rgba(9, 13, 17, 0.86), rgba(7, 10, 14, 0.96));
  border-radius: 26px;
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.intel-card {
  padding: 18px;
}

.compact-card {
  padding-bottom: 20px;
}

.intel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
}

.asset-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(216, 186, 115, 0.16), rgba(100, 26, 35, 0.24)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 70%),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 55%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.asset-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
  mix-blend-mode: screen;
  opacity: 0.4;
  animation: scanline 5s linear infinite;
}

.asset-placeholder.alt {
  min-height: 220px;
}

.asset-placeholder.emblem-slot {
  min-height: 160px;
}

.asset-placeholder.emblem-slot img {
  object-fit: contain;
  padding: 18px;
}

.asset-placeholder img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.asset-placeholder span {
  position: relative;
  z-index: 1;
  max-width: 180px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(6, 8, 11, 0.72);
  color: var(--gold-strong);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.asset-label {
  margin-top: 14px;
  color: var(--gold-strong);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
}

.prompt-copy {
  margin-top: 8px;
  color: #d7dee4;
  font-size: 0.92rem;
  line-height: 1.55;
}

.intel-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  color: #d2d8de;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.intel-list li {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.terminal-card {
  display: grid;
  align-self: stretch;
  min-height: 100%;
}

.terminal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(216, 186, 115, 0.15), transparent 36%),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.28) 100%);
  pointer-events: none;
}

.terminal-chrome {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.terminal-chrome span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.terminal-chrome span:first-child {
  background: rgba(214, 103, 103, 0.92);
}

.terminal-chrome span:nth-child(2) {
  background: rgba(216, 186, 115, 0.92);
}

.terminal-chrome span:last-child {
  background: rgba(83, 209, 140, 0.92);
}

.terminal-body {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
  align-content: center;
  padding: 34px clamp(24px, 5vw, 54px);
}

.terminal-kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
}

.terminal-body h1,
.brand-block h1,
.panel h2 {
  margin: 0;
  font-weight: 600;
}

.terminal-body h1 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 0.96;
  max-width: 10ch;
}

.terminal-copy {
  max-width: 58ch;
  color: #d2d8de;
  font-size: 1rem;
  line-height: 1.7;
}

.terminal-feed {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(216, 186, 115, 0.16);
  background:
    linear-gradient(180deg, rgba(6, 9, 12, 0.88), rgba(8, 11, 15, 0.96)),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 28px
    );
}

.terminal-feed p {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #b8c5cf;
  font-size: 0.86rem;
  line-height: 1.4;
}

.terminal-feed span {
  color: var(--gold-strong);
}

.unlock-form {
  display: grid;
  gap: 12px;
}

.unlock-form label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
}

.unlock-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 12px;
}

.unlock-form input {
  min-height: 56px;
  padding: 16px 18px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(7, 10, 14, 0.92);
  letter-spacing: 0.08em;
}

.unlock-form input:focus,
.marker-form input:focus,
.marker-form textarea:focus {
  outline: none;
  border-color: rgba(216, 186, 115, 0.62);
  box-shadow: 0 0 0 4px rgba(216, 186, 115, 0.12);
}

.unlock-feedback {
  min-height: 1.4em;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.unlock-feedback[data-tone="error"] {
  color: #f0abab;
}

.unlock-feedback[data-tone="success"] {
  color: #92e7b7;
}

.terminal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-chip {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--gold-strong);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
.danger-button,
.toolbar-button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.toolbar-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, var(--gold), var(--gold-strong));
  color: #241a0c;
  box-shadow: 0 12px 24px rgba(216, 186, 115, 0.22);
}

.unlock-button {
  min-width: 154px;
}

.secondary-button,
.toolbar-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.danger-button {
  background: rgba(212, 106, 106, 0.16);
  color: #f0c4c4;
}

.danger-button:disabled,
.secondary-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: 100vh;
  opacity: 0;
  transform: translateY(24px) scale(0.99);
  transition: opacity 420ms ease, transform 420ms ease;
}

body.is-unlocked .app-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

body.is-unlocked .lockscreen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.015);
  transition: opacity 320ms ease, transform 320ms ease, visibility 320ms ease;
}

.sidebar {
  padding: 24px;
  background: linear-gradient(180deg, rgba(8, 10, 12, 0.92), rgba(14, 18, 24, 0.84));
  border-right: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
}

.brand-block h1 {
  font-size: 2.2rem;
  line-height: 1;
}

.panel {
  margin-top: 20px;
  padding: 16px;
  background: var(--panel);
  border-radius: 20px;
}

.panel-heading,
.status-line,
.form-actions,
.toolbar,
.zoom-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-panel {
  padding-bottom: 12px;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.live-dot.online {
  background: var(--success);
  box-shadow: 0 0 12px rgba(83, 209, 140, 0.7);
}

.live-dot.offline {
  background: #a05a5a;
}

.marker-form,
.marker-form label {
  display: grid;
  gap: 8px;
}

.marker-form {
  margin-top: 12px;
}

.color-field {
  display: grid;
  gap: 10px;
}

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

.palette-swatch {
  position: relative;
  width: 100%;
  min-height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--swatch-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.palette-swatch::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.palette-swatch[aria-checked="true"]::after {
  border-color: rgba(245, 240, 229, 0.82);
  box-shadow: 0 0 0 1px rgba(8, 10, 12, 0.72) inset;
}

.palette-swatch:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(216, 186, 115, 0.24);
}

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

textarea {
  resize: vertical;
  min-height: 120px;
}

.coordinate-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.attachment-preview {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
}

.attachment-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.attachment-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.attachment-card.pending-removal {
  opacity: 0.72;
  border-color: rgba(214, 103, 103, 0.28);
}

.attachment-card img {
  display: block;
  width: 100%;
  height: 128px;
  border-radius: 12px;
  object-fit: cover;
}

.attachment-card.pending-removal img {
  filter: grayscale(0.45) brightness(0.7);
}

.attachment-card-footer {
  display: grid;
  gap: 8px;
}

.attachment-card-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
}

.attachment-card-status {
  color: var(--muted);
  font-size: 0.76rem;
}

.attachment-chip {
  justify-self: start;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.attachment-meta {
  min-height: 1.3em;
  margin: 0;
}

.attachment-button {
  width: 100%;
}

.controls-list {
  padding-left: 18px;
  margin: 12px 0 0;
  color: var(--muted);
}

.map-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.toolbar {
  padding: 18px 22px 10px;
}

.viewport {
  position: relative;
  margin: 10px 22px 22px;
  min-height: 520px;
  height: calc(100vh - 72px);
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(11, 15, 19, 0.8), rgba(10, 13, 17, 0.96)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 39px,
      rgba(255, 255, 255, 0.015) 40px
    );
  touch-action: none;
  cursor: grab;
}

.viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(216, 186, 115, 0.06), transparent 24%);
  pointer-events: none;
  z-index: 1;
}

.viewport:active {
  cursor: grabbing;
}

.scene,
.map-surface,
.marker-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 6144px;
  height: 9216px;
}

.scene {
  transform-origin: top left;
  user-select: none;
  will-change: transform;
  backface-visibility: hidden;
}

.map-surface,
.tile {
  pointer-events: none;
  user-select: none;
}

.tile {
  position: absolute;
  width: 3072px;
  height: 3072px;
  -webkit-user-drag: none;
}

.tile-0-0 {
  top: 0;
  left: 0;
}

.tile-0-1 {
  top: 0;
  left: 3072px;
}

.tile-1-0 {
  top: 3072px;
  left: 0;
}

.tile-1-1 {
  top: 3072px;
  left: 3072px;
}

.tile-2-0 {
  top: 6144px;
  left: 0;
}

.tile-2-1 {
  top: 6144px;
  left: 3072px;
}

.marker-layer {
  --marker-scale: 1;
  pointer-events: none;
}

.marker {
  --marker-color: #e55252;
  position: absolute;
  transform: translate(-50%, -100%);
  background: transparent;
  border: none;
  padding: 0;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  text-align: left;
  z-index: 2;
}

.marker-visual {
  display: grid;
  justify-items: center;
  gap: 4px;
  transform: translateZ(0) scale(var(--marker-scale));
  transform-origin: center bottom;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
  will-change: transform;
}

.marker-pin {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--marker-color);
}

.marker-pin svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
  stroke: rgba(9, 12, 16, 0.9);
  stroke-width: 1.15;
}

.marker-label {
  display: inline-block;
  max-width: 180px;
  padding: 4px 10px;
  background: rgba(9, 12, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.marker.selected .marker-label {
  border-color: var(--gold);
  color: var(--gold-strong);
}

.marker.selected .marker-pin {
  color: color-mix(in srgb, var(--marker-color) 82%, white 18%);
}

@keyframes driftGrid {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(0, 64px, 0);
  }
}

@keyframes noiseFloat {
  0% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(6px, -8px, 0);
  }

  100% {
    transform: translate3d(-6px, 10px, 0);
  }
}

@keyframes scanline {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 1180px) {
  .lockscreen-layout {
    grid-template-columns: 1fr;
  }

  .terminal-card {
    order: -1;
  }

  .intel-column {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
  }

  .toolbar {
    padding-top: 14px;
  }

  .viewport {
    min-height: 65vh;
    height: 65vh;
  }
}

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

  .lockscreen-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .unlock-button {
    width: 100%;
  }

  .terminal-body h1 {
    font-size: clamp(2.2rem, 14vw, 3.2rem);
  }

  .toolbar,
  .panel-heading,
  .status-line,
  .form-actions,
  .zoom-group {
    flex-wrap: wrap;
  }

  .viewport {
    margin-inline: 14px;
  }
}



