:root {
  --og-red: #b22234;
  --og-white: #fff;
  --og-blue: #002868;
  --og-surface: #1e2836;
  --loft-red: var(--og-red);
  --loft-blue: var(--og-blue);
  --loft-surface: var(--og-surface);
  --loft-border: rgba(255, 255, 255, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(40, 90, 140, 0.28), transparent 55%),
    #070b10;
  color: #fff;
  font-family: "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

.acct-chars { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.acct-chars a { color: #b9ddff; text-decoration: none; font-weight: 600; }
.acct-chars a:hover { color: #d7ecff; text-decoration: underline; }
.acct-level { margin-left: 6px; color: rgba(255, 255, 255, 0.62); }
.acct-none { color: rgba(255, 255, 255, 0.55); }

.loft-dash {
  width: 90%;
  max-width: 90%;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

@media (max-width: 640px) {
  .loft-dash { width: 95%; max-width: 95%; padding: 20px 14px 40px; }
}

.loft-card {
  position: relative;
  width: 100%;
  background: rgba(8, 14, 22, 0.88);
  border: 1px solid rgba(150, 196, 230, 0.28);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

.loft-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, #7ec8ff 20%, #d7ecff 50%, #7ec8ff 80%, transparent);
}

.loft-card--top .loft-card__pad,
.loft-card--content { padding: 24px 28px; }

.loft-card__hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}

.loft-card__title-area { flex: 1; min-width: 0; text-align: left; }
.loft-card__nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.loft-card__nav form { margin: 0; }
.loft-card__title { font-size: 1.7rem; font-weight: 800; letter-spacing: 0.04em; margin: 0 0 4px; }
.loft-card__subtitle { margin: 0; color: rgba(255, 255, 255, 0.78); }
.loft-card h2 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 800; letter-spacing: 0.04em; }
.loft-sub { margin: 0 0 16px; color: rgba(255, 255, 255, 0.78); }

@media (max-width: 768px) {
  .loft-card__hero { flex-direction: column; align-items: flex-start; }
}

a.loft-pill { color: #b9ddff; text-decoration: none; }
.loft-pill, .loft-pill--button {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(150, 196, 230, 0.35);
  background: rgba(126, 200, 255, 0.12);
  color: #b9ddff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.loft-pill:hover, .loft-pill--button:hover { background: rgba(126, 200, 255, 0.22); color: #d7ecff; }
a.loft-pill.loft-pill--active, .loft-pill--active {
  background: rgba(126, 200, 255, 0.28);
  color: #fff;
}

.loft-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
  cursor: pointer;
}

.loft-btn--primary { background: var(--loft-red); color: #fff; }
.loft-btn--sm { padding: 8px 12px; font-size: 0.9rem; }

.ops-alert { margin-bottom: 16px; padding: 12px 16px; border-radius: 10px; }
.ops-alert--ok { background: rgba(34, 197, 94, 0.3); border: 1px solid rgba(34, 197, 94, 0.5); }
.ops-alert--err { background: rgba(239, 68, 68, 0.3); border: 1px solid rgba(239, 68, 68, 0.5); }

.stack-form, .inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.ops-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: #fff; }
.ops-field input, .inline-form input, .inline-form select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  min-width: 180px;
  color-scheme: dark;
}

.inline-form select {
  min-width: 11rem;
  background: #080e16;
}

.ops-table-wrap { overflow-x: auto; }
.ops-table { width: 100%; border-collapse: collapse; background: transparent; color: #fff; }
.ops-table th, .ops-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(150, 196, 230, 0.18);
  border-left: 0;
  border-right: 0;
  vertical-align: middle;
}
.ops-table th { background: rgba(0, 0, 0, 0.25); font-weight: 600; }
.ops-table code { color: rgba(255, 255, 255, 0.9); font-size: 0.85rem; }

.loft-empty {
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
}

.roadmap { color: rgba(255, 255, 255, 0.92); line-height: 1.55; }
.roadmap h1 { margin: 0 0 12px; font-size: 1.6rem; }
.roadmap h2 {
  margin: 28px 0 10px;
  padding-top: 8px;
  font-size: 1.2rem;
  border-top: 1px solid rgba(150, 196, 230, 0.18);
}
.roadmap h2:first-of-type { border-top: 0; padding-top: 0; }
.roadmap h3 { margin: 18px 0 8px; font-size: 1.05rem; }
.roadmap p { margin: 0 0 12px; }
.roadmap a { color: #b9ddff; }
.roadmap ul, .roadmap ol { margin: 0 0 14px; padding-left: 1.3rem; }
.roadmap li { margin: 4px 0; }
.roadmap li::marker { color: #7ec8ff; }
.roadmap code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.roadmap hr { border: 0; border-top: 1px solid rgba(150, 196, 230, 0.18); margin: 20px 0; }
.roadmap .toc {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}
.roadmap .toc ul { margin: 0; }
.roadmap .toc > ul { columns: 2; }
.roadmap .toc a { text-decoration: none; font-weight: 600; }
.roadmap .toc a:hover { text-decoration: underline; }
.roadmap .ops-table-wrap { margin: 0 0 16px; }
@media (max-width: 640px) {
  .roadmap .toc > ul { columns: 1; }
}

body.landing {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(40, 90, 140, 0.28), transparent 55%),
    #070b10;
  overflow-x: hidden;
}

.landing-stage {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.landing-hero {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.landing-dock {
  position: absolute;
  top: 24px;
  right: 24px;
  width: min(320px, calc(100% - 48px));
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 22px 22px 20px;
  border-radius: 18px;
  background: rgba(8, 14, 22, 0.88);
  border: 1px solid rgba(150, 196, 230, 0.28);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.landing-dock::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, #7ec8ff 20%, #d7ecff 50%, #7ec8ff 80%, transparent);
}

.landing-kicker {
  margin: 0 0 6px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: rgba(180, 214, 240, 0.85);
}

.landing-dock h1 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.landing-lead {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.78);
}

.landing-connect {
  margin: 0;
  color: #fff;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.landing-connect span {
  display: inline-block;
  margin-right: 8px;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(180, 214, 240, 0.85);
}

.landing-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 16px;
}

.landing-switch {
  margin: 14px 0 0;
  font-size: 0.9rem;
}

.landing-switch a {
  color: #b9ddff;
  font-weight: 600;
}

.landing-dats {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(150, 196, 230, 0.22);
}

.landing-dats > p {
  margin: 0 0 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(180, 214, 240, 0.85);
}

.dat-note { margin: 0 0 10px; color: rgba(255, 255, 255, 0.78); font-size: 0.9rem; line-height: 1.4; }
.landing-dats .dat-note { margin-top: 0; }
.dat-links { list-style: none; margin: 0; padding: 0; }
.dat-links li { margin: 0 0 10px; }
.dat-links li:last-child { margin-bottom: 0; }
.dat-links a { color: #b9ddff; font-weight: 700; }
.dat-links a:hover { color: #d7ecff; }
.dat-links span { display: block; margin-top: 2px; color: rgba(255, 255, 255, 0.72); font-size: 0.86rem; line-height: 1.35; }

.landing-form .ops-field input { width: 100%; min-width: 0; }
.landing-form .loft-btn { justify-content: center; }

@media (max-width: 800px) {
  .landing-dock {
    position: static;
    width: min(480px, 92%);
    margin: 16px auto 40px;
  }
}

.map-editor { display: flex; flex-direction: column; gap: 14px; }
.map-toolbar, .map-save { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.map-levels { display: flex; gap: 8px; align-items: center; }
.map-level-label { color: #fff; font-weight: 600; min-width: 6.5em; text-align: center; }
.map-pieces { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.map-group { color: rgba(255, 255, 255, 0.55); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; margin-left: 8px; }
.map-help, .map-status { margin: 0; color: rgba(255, 255, 255, 0.78); line-height: 1.45; }
.map-stage {
  background: #080e16;
  border: 1px solid rgba(150, 196, 230, 0.28);
  border-radius: 12px;
  overflow: hidden;
}
#map-canvas { display: block; width: 100%; cursor: crosshair; touch-action: none; }
.map-save .ops-field { min-width: 180px; }
.map-save .ops-field input, .map-save .ops-field select { width: 100%; min-width: 0; background: #080e16; }
