:root {
  --bg: #080a09;
  --bg-2: #101410;
  --panel: rgba(20, 24, 21, 0.88);
  --panel-2: rgba(35, 40, 34, 0.92);
  --panel-3: #2b3029;
  --line: rgba(222, 197, 143, 0.2);
  --line-strong: rgba(241, 189, 99, 0.42);
  --text: #f3ead8;
  --muted: #b0b3a4;
  --soft: #d2c3a2;
  --amber: #d49a3a;
  --amber-2: #f1bd63;
  --forest: #5f7f52;
  --deep-forest: #20352c;
  --moss: #93a56b;
  --stone: #778071;
  --volcanic: #9a4b37;
  --teal: #4f8a83;
  --danger: #d66f58;
  --focus: #f1bd63;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
  --shadow-soft: 0 16px 42px rgba(0, 0, 0, 0.3);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 28px),
    radial-gradient(circle at 18% 3%, rgba(212, 154, 58, 0.18), transparent 28%),
    radial-gradient(circle at 88% 15%, rgba(79, 138, 131, 0.18), transparent 30%),
    radial-gradient(circle at 50% 82%, rgba(154, 75, 55, 0.14), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.024) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(180deg, #080a09 0%, #111711 52%, #090a08 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

::selection {
  background: rgba(212, 154, 58, 0.34);
  color: var(--text);
}

.app-shell {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(18, 22, 18, 0.96), rgba(7, 9, 8, 0.98)),
    linear-gradient(135deg, rgba(212, 154, 58, 0.1), transparent 38%),
    url("/dashboard/images/titan-ops-hero.png") center bottom / contain no-repeat;
  padding: 20px 14px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03), 18px 0 60px rgba(0, 0, 0, 0.24);
}

.sidebar::after {
  content: "";
  position: sticky;
  display: block;
  bottom: 0;
  height: 150px;
  margin: 18px -14px -20px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(7, 9, 8, 0.94));
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 8px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(241, 189, 99, 0.95), rgba(145, 86, 42, 0.92)),
    #d49a3a;
  color: #161006;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 10px 26px rgba(212, 154, 58, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-mark::before {
  content: "";
  width: 25px;
  height: 25px;
  border-radius: 55% 45% 48% 52%;
  background:
    radial-gradient(circle at 44% 20%, #171006 0 3px, transparent 4px),
    radial-gradient(circle at 28% 55%, #171006 0 3px, transparent 4px),
    radial-gradient(circle at 72% 56%, #171006 0 3px, transparent 4px),
    radial-gradient(circle at 50% 68%, #171006 0 7px, transparent 8px);
}

.brand-mark {
  font-size: 0;
}

.brand h1,
.topbar h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.1;
  color: var(--text);
}

.brand p,
.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

.tabs {
  display: grid;
  gap: 7px;
  padding-top: 18px;
}

.tab {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 10px 11px;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.tab span:first-child {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.tab.active {
  background: linear-gradient(135deg, rgba(212, 154, 58, 0.16), rgba(95, 127, 82, 0.13));
  border-color: var(--line-strong);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--amber), var(--shadow-soft);
}

.tab:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(215, 190, 137, 0.24);
  color: var(--text);
  transform: translateX(2px);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 26px;
  background:
    linear-gradient(90deg, rgba(212, 154, 58, 0.08), transparent 34%),
    rgba(8, 11, 10, 0.82);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.topbar h2::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--amber);
  box-shadow: 0 0 18px rgba(212, 154, 58, 0.75);
  transform: rotate(45deg);
}

.auth-box {
  display: flex;
  gap: 10px;
  min-width: max-content;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.server-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(95, 127, 82, 0.12);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 0 16px rgba(147, 165, 107, 0.9);
}

.view {
  padding: 26px;
}

.grid {
  display: grid;
  gap: 16px;
}

.theme-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.8fr) 260px;
  gap: 20px;
  align-items: center;
  min-height: 318px;
  margin-bottom: 18px;
  padding: 32px;
  border: 1px solid rgba(241, 189, 99, 0.26);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(7, 9, 8, 0.94) 0%, rgba(7, 9, 8, 0.82) 50%, rgba(7, 9, 8, 0.68) 100%),
    linear-gradient(0deg, rgba(7, 9, 8, 0.84), rgba(7, 9, 8, 0.08) 44%),
    #151914;
  box-shadow: var(--shadow);
}

.theme-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  height: auto;
  background:
    linear-gradient(90deg, rgba(241, 189, 99, 0.16) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(0deg, rgba(241, 189, 99, 0.11) 1px, transparent 1px) 0 0 / 56px 56px,
    radial-gradient(circle at 72% 42%, transparent 0 20%, rgba(8, 10, 8, 0.12) 42%, rgba(8, 10, 8, 0.68) 100%);
  opacity: 0.7;
}

.theme-hero h3 {
  position: relative;
  margin: 6px 0 7px;
  max-width: 760px;
  font-size: 44px;
  line-height: 1.02;
  color: var(--text);
  text-shadow: 0 16px 42px rgba(0, 0, 0, 0.55);
}

.theme-hero p {
  position: relative;
  max-width: 680px;
  margin: 0;
  color: var(--soft);
  line-height: 1.6;
  font-size: 15px;
}

.hero-actions {
  position: relative;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hero-art-window {
  position: relative;
  min-height: 240px;
  align-self: stretch;
  border: 1px solid rgba(241, 189, 99, 0.2);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, rgba(241, 189, 99, 0.14), transparent 58%),
    url("/dashboard/images/titan-ops-hero.png") center / 100% 100% no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), var(--shadow-soft);
  overflow: hidden;
}

.hero-art-window::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 9, 8, 0.42), transparent 24%, transparent 76%, rgba(7, 9, 8, 0.36)),
    linear-gradient(0deg, rgba(7, 9, 8, 0.5), transparent 28%);
  pointer-events: none;
}

.hero-status-stack {
  position: relative;
  align-self: end;
  display: grid;
  gap: 10px;
}

.hero-status-stack span {
  display: grid;
  gap: 3px;
  padding: 13px 14px;
  border: 1px solid rgba(241, 189, 99, 0.28);
  border-radius: 8px;
  background: rgba(5, 7, 6, 0.66);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.hero-status-stack b {
  color: var(--amber-2);
  font-size: 18px;
}

.setup-guide {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(147, 165, 107, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(32, 53, 44, 0.7), rgba(10, 13, 12, 0.86)),
    linear-gradient(90deg, rgba(241, 189, 99, 0.08), transparent);
  box-shadow: var(--shadow-soft);
}

.setup-guide.compact {
  margin-bottom: 16px;
}

.setup-intro h3 {
  margin: 6px 0 8px;
  font-size: 22px;
}

.setup-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.setup-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.setup-step {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 132px;
  padding: 12px;
  border: 1px solid rgba(215, 190, 137, 0.17);
  border-radius: 8px;
  background: rgba(6, 8, 7, 0.44);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.setup-step:hover {
  transform: translateY(-2px);
  border-color: var(--amber);
  background: rgba(212, 154, 58, 0.1);
}

.setup-step span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(212, 154, 58, 0.15);
  border: 1px solid rgba(212, 154, 58, 0.34);
  color: var(--amber-2);
  font-size: 12px;
  font-weight: 900;
}

.setup-step.done span {
  background: rgba(95, 127, 82, 0.28);
  border-color: rgba(147, 165, 107, 0.48);
  color: #dce9c9;
}

.setup-step b {
  font-size: 13px;
}

.setup-step small {
  color: var(--muted);
  line-height: 1.45;
}

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

.workflow-strip span,
.guide-callout {
  border: 1px solid rgba(241, 189, 99, 0.2);
  border-radius: 8px;
  background: rgba(212, 154, 58, 0.08);
}

.workflow-strip span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.workflow-strip b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--amber);
  color: #171006;
}

.guide-callout {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  padding: 12px;
  color: var(--soft);
  line-height: 1.5;
}

.guide-callout b {
  color: var(--amber-2);
}

.eyebrow {
  position: relative;
  color: var(--amber-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.dino-sketch {
  position: relative;
  height: 132px;
  opacity: 0.92;
}

.dino-sketch span {
  position: absolute;
  display: block;
  background: linear-gradient(135deg, #d9c59a, #8e6d3b);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.dino-sketch .body {
  width: 128px;
  height: 52px;
  left: 76px;
  top: 52px;
  border-radius: 58% 45% 48% 52%;
}

.dino-sketch .neck {
  width: 58px;
  height: 22px;
  left: 168px;
  top: 40px;
  transform: rotate(-24deg);
  border-radius: 999px;
}

.dino-sketch .head {
  width: 48px;
  height: 26px;
  left: 210px;
  top: 24px;
  border-radius: 70% 45% 40% 55%;
}

.dino-sketch .tail {
  width: 90px;
  height: 18px;
  left: 15px;
  top: 61px;
  transform: rotate(-12deg);
  border-radius: 999px 0 0 999px;
}

.dino-sketch .leg {
  width: 18px;
  height: 58px;
  top: 89px;
  border-radius: 999px;
}

.dino-sketch .leg.a {
  left: 107px;
  transform: rotate(10deg);
}

.dino-sketch .leg.b {
  left: 166px;
  transform: rotate(-8deg);
}

.dino-sketch .ridge {
  width: 116px;
  height: 22px;
  left: 92px;
  top: 36px;
  background:
    linear-gradient(135deg, transparent 0 12%, #e8c978 12% 19%, transparent 19% 29%, #e8c978 29% 37%, transparent 37% 48%, #e8c978 48% 58%, transparent 58%);
  box-shadow: none;
}

.editor-shell {
  margin-top: 16px;
}

.stats-grid {
  grid-template-columns: repeat(6, minmax(132px, 1fr));
}

.two-col {
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.stat-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.panel::before,
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(241, 189, 99, 0.5), transparent);
  pointer-events: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.panel-header h3 {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

.panel-body {
  padding: 16px;
}

.stat-card {
  padding: 15px;
  min-height: 92px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.stat-card span {
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-card strong {
  font-size: 28px;
  color: var(--amber-2);
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  border-bottom: 1px solid rgba(215, 190, 137, 0.12);
  padding: 12px 13px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #171b16;
  color: var(--soft);
  font-size: 11px;
  text-transform: uppercase;
}

td {
  color: #e9dfca;
}

tr {
  transition: background 140ms ease;
}

tr:hover td {
  background: rgba(212, 154, 58, 0.06);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(215, 190, 137, 0.18);
  border-radius: 8px;
  background: rgba(6, 8, 7, 0.72);
  color: var(--text);
  min-height: 40px;
  padding: 9px 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

select {
  cursor: pointer;
}

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

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(241, 189, 99, 0.36);
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid rgba(241, 189, 99, 0.7);
  outline-offset: 1px;
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)), var(--panel-2);
  color: var(--text);
  min-height: 40px;
  padding: 9px 13px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover {
  border-color: var(--amber);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
}

.button.primary {
  background: linear-gradient(135deg, var(--amber-2), var(--amber));
  border-color: rgba(241, 189, 99, 0.72);
  color: #171006;
}

.button.warning {
  background: linear-gradient(135deg, #d0a34c, #9a6d2d);
  border-color: rgba(241, 189, 99, 0.65);
  color: #171006;
}

.button.danger {
  background: rgba(154, 75, 55, 0.12);
  color: #f0a08b;
  border-color: rgba(214, 111, 88, 0.48);
}

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

.status {
  min-height: 20px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(147, 165, 107, 0.42);
  border-radius: 8px;
  background: #182016;
  color: var(--text);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.toast.error {
  border-color: rgba(214, 111, 88, 0.62);
  background: #251411;
  color: #ffd0c4;
}

.badge {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.045);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.ok {
  border-color: rgba(147, 165, 107, 0.55);
  color: #dce9c9;
  background: rgba(95, 127, 82, 0.22);
}

.badge.bad {
  border-color: rgba(214, 111, 88, 0.58);
  color: #ffd0c4;
  background: rgba(154, 75, 55, 0.22);
}

.status-card {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(215, 190, 137, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.status-card small,
.error-text {
  color: var(--muted);
}

.error-text {
  color: #ffd0c4;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 10px;
  margin-bottom: 12px;
}

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

.log-row {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(215, 190, 137, 0.13);
  border-radius: 8px;
  background: rgba(6, 8, 7, 0.42);
}

.log-row strong,
.log-row small,
.log-row p,
.log-row code {
  display: block;
}

.log-row small {
  color: var(--muted);
  margin-top: 3px;
}

.log-row p {
  margin: 7px 0;
}

.log-row code {
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  color: #ead8b0;
}

.map-surface {
  position: relative;
  min-height: 520px;
  max-height: 72vh;
  margin-top: 12px;
  border: 1px solid rgba(215, 190, 137, 0.18);
  border-radius: 8px;
  background: rgba(5, 7, 6, 0.72);
  overflow: auto;
  overscroll-behavior: contain;
}

.map-controls {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: 42px minmax(160px, 1fr) 42px auto 70px;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(215, 190, 137, 0.16);
  border-radius: 8px;
  background: rgba(5, 7, 6, 0.72);
  backdrop-filter: blur(10px);
}

.map-controls .button {
  min-height: 36px;
  padding: 7px 10px;
}

.map-controls input[type="range"] {
  width: 100%;
  min-height: 36px;
  padding: 0;
  accent-color: var(--amber);
}

.map-canvas {
  position: relative;
  min-width: 900px;
  min-height: 580px;
  background:
    linear-gradient(90deg, rgba(215, 190, 137, 0.1) 1px, transparent 1px) 0 0 / 50px 50px,
    linear-gradient(0deg, rgba(215, 190, 137, 0.1) 1px, transparent 1px) 0 0 / 50px 50px,
    radial-gradient(ellipse at 30% 26%, rgba(95, 127, 82, 0.34), transparent 24%),
    radial-gradient(ellipse at 72% 68%, rgba(68, 96, 91, 0.28), transparent 26%),
    radial-gradient(ellipse at 55% 42%, rgba(154, 75, 55, 0.16), transparent 22%),
    rgba(12, 15, 12, 0.96);
}

.map-canvas::before {
  content: "";
  position: absolute;
  inset: 6%;
  border: 2px solid rgba(215, 190, 137, 0.12);
  border-radius: 48% 42% 52% 38%;
  box-shadow:
    inset 0 0 0 22px rgba(215, 190, 137, 0.035),
    inset 0 0 0 54px rgba(95, 127, 82, 0.035);
  pointer-events: none;
}

.local-map-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0.82;
  mix-blend-mode: normal;
  pointer-events: none;
  filter: saturate(0.9) contrast(1.05) brightness(0.82);
}

.map-canvas.map-gondwa {
  background:
    linear-gradient(90deg, rgba(215, 190, 137, 0.1) 1px, transparent 1px) 0 0 / 50px 50px,
    linear-gradient(0deg, rgba(215, 190, 137, 0.1) 1px, transparent 1px) 0 0 / 50px 50px,
    radial-gradient(ellipse at 22% 22%, rgba(95, 127, 82, 0.42), transparent 25%),
    radial-gradient(ellipse at 66% 31%, rgba(51, 96, 107, 0.28), transparent 20%),
    radial-gradient(ellipse at 54% 76%, rgba(154, 75, 55, 0.2), transparent 30%),
    rgba(12, 15, 12, 0.96);
}

.map-canvas.map-riparia {
  background:
    linear-gradient(90deg, rgba(215, 190, 137, 0.1) 1px, transparent 1px) 0 0 / 50px 50px,
    linear-gradient(0deg, rgba(215, 190, 137, 0.1) 1px, transparent 1px) 0 0 / 50px 50px,
    radial-gradient(ellipse at 45% 45%, rgba(51, 96, 107, 0.44), transparent 34%),
    radial-gradient(ellipse at 20% 72%, rgba(95, 127, 82, 0.32), transparent 20%),
    rgba(10, 13, 15, 0.96);
}

.map-title,
.map-compass,
.map-ruler {
  position: absolute;
  z-index: 6;
  border: 1px solid rgba(215, 190, 137, 0.2);
  border-radius: 8px;
  background: rgba(5, 7, 6, 0.82);
  color: var(--soft);
  box-shadow: var(--shadow);
}

.map-title {
  top: 14px;
  left: 14px;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
}

.map-title strong,
.map-compass {
  color: var(--text);
}

.map-compass {
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-weight: 900;
}

.map-ruler {
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  font-size: 11px;
}

.map-ruler span {
  display: block;
  width: 120px;
  height: 6px;
  border-left: 2px solid var(--amber);
  border-right: 2px solid var(--amber);
  background: linear-gradient(90deg, var(--amber), var(--amber)) center / 100% 2px no-repeat;
}

.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid rgba(241, 189, 99, 0.82);
  border-radius: 50%;
  background: rgba(212, 154, 58, 0.22);
  color: #fff2d3;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
  cursor: pointer;
  z-index: 5;
  padding: 0;
}

.map-marker small {
  position: absolute;
  left: 50%;
  top: calc(100% + 5px);
  transform: translateX(-50%);
  max-width: 160px;
  padding: 3px 7px;
  border: 1px solid rgba(241, 189, 99, 0.28);
  border-radius: 999px;
  background: rgba(5, 7, 6, 0.88);
  color: var(--soft);
  font-size: 10px;
  white-space: nowrap;
  pointer-events: none;
}

.marker-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%);
  display: none;
  min-width: 190px;
  padding: 10px;
  border: 1px solid rgba(241, 189, 99, 0.32);
  border-radius: 8px;
  background: rgba(5, 7, 6, 0.94);
  color: var(--soft);
  text-align: left;
  box-shadow: var(--shadow);
}

.map-marker:hover .marker-popover,
.map-marker:focus .marker-popover,
.map-marker:focus-within .marker-popover {
  display: grid;
  gap: 6px;
}

.marker-popover b {
  color: var(--text);
}

.marker-popover em {
  font-style: normal;
  font-size: 11px;
}

.marker-popover span {
  display: flex;
  gap: 7px;
}

.marker-popover i {
  padding: 5px 8px;
  border: 1px solid rgba(215, 190, 137, 0.2);
  border-radius: 999px;
  color: #ffe0a3;
  font-size: 11px;
  font-style: normal;
}

.map-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(215, 190, 137, 0.2);
  border-radius: 8px;
  background: rgba(5, 7, 6, 0.82);
  color: var(--soft);
  font-size: 11px;
  box-shadow: var(--shadow);
  z-index: 6;
}

.map-legend strong {
  color: var(--text);
}

.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0;
}

.detail-chips span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid rgba(215, 190, 137, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--soft);
  font-size: 11px;
}

.detail-chips b {
  color: var(--text);
}

.technical-details {
  margin-top: 7px;
}

.technical-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.technical-details code {
  margin-top: 7px;
}

.muted-line {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.info-strip {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid rgba(147, 165, 107, 0.25);
  border-radius: 8px;
  background: rgba(95, 127, 82, 0.12);
  color: var(--soft);
  font-weight: 700;
}

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

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

.item-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 12px;
  border: 1px solid rgba(215, 190, 137, 0.14);
  border-radius: 8px;
  background: rgba(6, 8, 7, 0.42);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.item-row:hover,
.item-row.active {
  border-color: var(--amber);
  background: rgba(212, 154, 58, 0.1);
}

.item-row span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.item-row small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-row b {
  color: var(--amber-2);
  white-space: nowrap;
}

.preview-box,
.preview-panel {
  border: 1px solid rgba(215, 190, 137, 0.16);
  border-radius: 8px;
  background: rgba(5, 7, 6, 0.48);
  padding: 14px;
}

.preview-box {
  display: grid;
  gap: 6px;
}

.preview-box span {
  color: var(--amber-2);
  font-weight: 900;
}

.preview-box small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.preview-panel h4 {
  margin: 0 0 12px;
  color: var(--soft);
}

.discord-message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
}

.avatar-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--forest));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.discord-card {
  display: grid;
  gap: 10px;
  max-width: 560px;
  padding: 13px;
  border-left: 4px solid var(--amber);
  border-radius: 4px;
  background: #2f322f;
  color: #f4f0e8;
}

.discord-card p {
  margin: 0;
  white-space: pre-wrap;
}

.preview-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.preview-fields span {
  display: grid;
  gap: 2px;
  color: #e9dfca;
  overflow-wrap: anywhere;
}

.preview-fields b {
  color: #ffffff;
}

.preview-image,
.image-placeholder {
  width: 100%;
  max-height: 320px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.image-placeholder {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.24);
}

.chip-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.chip {
  border: 1px solid rgba(147, 165, 107, 0.4);
  border-radius: 999px;
  background: rgba(95, 127, 82, 0.18);
  color: #d9e4c1;
  min-height: 30px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.pill {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--soft);
  background: rgba(212, 154, 58, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.code {
  display: block;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: #ead8b0;
}

pre.code {
  max-height: 440px;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(215, 190, 137, 0.15);
  border-radius: 8px;
  background: rgba(5, 7, 6, 0.62);
}

@media (max-width: 1180px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(132px, 1fr));
  }

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

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

  .theme-hero {
    grid-template-columns: 1fr;
  }

  .hero-art-window {
    min-height: 280px;
    order: 2;
  }

  .hero-status-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-self: stretch;
    order: 3;
  }

  .setup-guide {
    grid-template-columns: 1fr;
  }

  .setup-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .topbar,
  .server-badge,
  .auth-box {
    flex-direction: column;
    align-items: stretch;
  }

  .view {
    padding: 16px;
  }

  .stats-grid,
  .three-col,
  .form-grid,
  .filter-row,
  .log-row,
  .hero-status-stack,
  .setup-steps,
  .workflow-strip {
    grid-template-columns: 1fr;
  }

  .theme-hero {
    min-height: 420px;
    padding: 22px;
  }

  .hero-art-window {
    min-height: 220px;
  }

  .theme-hero h3 {
    font-size: 34px;
  }

  .hero-actions {
    display: grid;
  }

  .map-controls {
    grid-template-columns: 42px 42px 1fr;
  }

  .map-controls input[type="range"],
  .map-controls .pill,
  .map-controls #fitMap {
    grid-column: 1 / -1;
  }
}
