/* ============================================================
   CMC — the social planet
   ============================================================ */

:root {
  --bg: #04050d;
  --bg-2: #070918;
  --panel: rgba(12, 14, 30, 0.78);
  --panel-solid: #0b0e1e;
  --violet: #8b5cf6;
  --violet-bright: #b07cff;
  --violet-soft: #c9a7ff;
  --pink: #e879f9;
  --text: #f4f1ff;
  --muted: #8f93b4;
  --muted-2: #626783;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --success: #4ade80;
  --danger: #fb7185;
  --radius: 26px;
  --font: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 32px 90px -20px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

html { background: var(--bg); }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

::selection { background: rgba(139, 92, 246, 0.5); color: #fff; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }

svg { display: block; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); background-clip: content-box; }

/* ------------------------------------------------------------
   Space background
   ------------------------------------------------------------ */

.space {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 900px at 70% -10%, rgba(55, 31, 110, 0.45), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(26, 28, 92, 0.5), transparent 65%),
    linear-gradient(180deg, #04050d 0%, #050713 55%, #03040a 100%);
}

#star-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.32;
  pointer-events: none;
  animation: drift 26s ease-in-out infinite alternate;
}

.nebula-a {
  width: 48vw;
  height: 48vw;
  left: -16vw;
  top: -18vw;
  background: radial-gradient(circle, rgba(109, 40, 217, 0.65), transparent 65%);
}

.nebula-b {
  width: 55vw;
  height: 55vw;
  right: -22vw;
  bottom: -26vw;
  background: radial-gradient(circle, rgba(30, 64, 175, 0.5), transparent 66%);
  animation-delay: -9s;
  animation-duration: 34s;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4vw, 3vh, 0) scale(1.12); }
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 48%, transparent 40%, rgba(2, 3, 8, 0.55) 100%);
}

/* ------------------------------------------------------------
   Globe stage
   ------------------------------------------------------------ */

.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
}

#globe-canvas,
#overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#globe-canvas { pointer-events: none; }

#overlay-canvas {
  touch-action: none;
  cursor: grab;
  outline: none;
}

#overlay-canvas:active { cursor: grabbing; }
#overlay-canvas.is-hovering { cursor: pointer; }

.globe-caption {
  position: fixed;
  left: 30px;
  bottom: 74px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 0.34em;
  color: rgba(255, 255, 255, 0.28);
  pointer-events: none;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-transform: uppercase;
}

.globe-caption .caption-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, rgba(176, 124, 255, 0.6), transparent);
}

/* ------------------------------------------------------------
   HUD / navigation
   ------------------------------------------------------------ */

.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  pointer-events: none;
}

.hud > * { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 150px;
  transition: opacity 0.2s ease;
}

.brand:hover { opacity: 0.82; }

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--violet-bright);
  border: 1px solid rgba(176, 124, 255, 0.28);
  border-radius: 12px;
  background: rgba(13, 15, 32, 0.66);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.16) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.brand-mark svg { width: 25px; height: 25px; }

.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text strong {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.16em;
  font-weight: 700;
}
.brand-text small {
  margin-top: 5px;
  font-size: 8px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.tab-shell {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  height: 48px;
  padding: 4px;
  background: rgba(10, 12, 26, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.tab-shell:hover { border-color: rgba(255, 255, 255, 0.16); }

.tab-shell.is-open {
  border-color: rgba(176, 124, 255, 0.3);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5), 0 0 44px rgba(139, 92, 246, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.tab-arrow {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: rgba(244, 241, 255, 0.75);
  background: transparent;
  transition: color 0.2s ease, background 0.2s ease;
}

.tab-arrow svg { width: 19px; height: 19px; transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1); }
.tab-arrow:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.tab-shell.is-open .tab-arrow svg { transform: rotate(180deg); }

.tab-items {
  display: flex;
  align-items: center;
  width: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateX(-6px);
  transition: width 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.tab-shell.is-open .tab-items {
  width: 144px;
  opacity: 1;
  transform: translateX(0);
}

.tab-btn {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: rgba(244, 241, 255, 0.6);
  background: transparent;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.tab-btn svg { width: 21px; height: 21px; }
.tab-tracker svg { width: 24px; height: 24px; }
.tab-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.tab-btn:active { transform: scale(0.92); }

.tab-btn::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translate(-50%, -4px);
  padding: 7px 10px;
  font-size: 11px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--text);
  background: rgba(14, 16, 34, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.tab-btn:hover::after { opacity: 1; transform: translate(-50%, 0); }

.tab-sep {
  flex: 0 0 auto;
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 2px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 5px 6px 5px 5px;
  background: rgba(10, 12, 26, 0.66);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
  animation: chipIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes chipIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #a855f7, #5b21b6);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14) inset, 0 4px 14px rgba(139, 92, 246, 0.4);
  text-transform: uppercase;
}

.avatar.small { width: 36px; height: 36px; font-size: 14px; }

.user-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12.5px;
  color: rgba(244, 241, 255, 0.78);
  white-space: nowrap;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  transition: color 0.18s ease, background 0.18s ease;
}

.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }

/* ------------------------------------------------------------
   Globe meta / hint
   ------------------------------------------------------------ */

.world-meta {
  position: fixed;
  left: 28px;
  bottom: 24px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(244, 241, 255, 0.56);
  background: rgba(9, 11, 24, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(14px);
}

.world-meta b { color: var(--text); font-weight: 600; }
.meta-sep { color: var(--muted-2); }

.globe-hint {
  position: fixed;
  right: 28px;
  bottom: 24px;
  z-index: 12;
  display: flex;
  gap: 18px;
  font-size: 10.5px;
  letter-spacing: 0.045em;
  color: var(--muted-2);
  pointer-events: none;
}

.globe-hint b { color: rgba(244, 241, 255, 0.5); font-weight: 600; }

/* ------------------------------------------------------------
   Shared bits
   ------------------------------------------------------------ */

.eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow.accent { color: var(--violet-bright); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(0.975); }
.btn.small { min-height: 38px; padding: 0 15px; font-size: 12px; }
.btn.small svg { width: 15px; height: 15px; }
.btn.tiny { min-height: 33px; padding: 0 12px; font-size: 11px; gap: 6px; }
.btn.tiny svg { width: 14px; height: 14px; }

.btn.primary {
  color: #fff;
  background: linear-gradient(120deg, #9b5cff 0%, #7c3aed 52%, #6d28d9 100%);
  box-shadow: 0 18px 40px -12px rgba(124, 58, 237, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn.primary:hover:not(:disabled) {
  box-shadow: 0 22px 46px -10px rgba(139, 92, 246, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.btn.primary:disabled { opacity: 0.35; box-shadow: none; }

.btn.ghost {
  color: rgba(244, 241, 255, 0.72);
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line);
}

.btn.ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.075); border-color: var(--line-strong); }

:focus-visible {
  outline: 2px solid rgba(176, 124, 255, 0.9);
  outline-offset: 3px;
}

kbd {
  display: inline-block;
  padding: 2px 5px;
  font-family: var(--font);
  font-size: 9px;
  color: rgba(244, 241, 255, 0.62);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 4px;
}

/* ------------------------------------------------------------
   Auth
   ------------------------------------------------------------ */

.auth-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background:
    radial-gradient(900px 700px at 50% 30%, rgba(47, 24, 99, 0.28), transparent 70%),
    rgba(3, 4, 10, 0.66);
  backdrop-filter: blur(9px) saturate(90%);
  animation: layerFade 0.45s ease both;
}

.auth-glow {
  position: absolute;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.24), transparent 62%);
  filter: blur(30px);
  pointer-events: none;
  animation: authGlow 7s ease-in-out infinite alternate;
}

@keyframes authGlow {
  from { transform: translate3d(-30px, 20px, 0) scale(1); opacity: 0.7; }
  to { transform: translate3d(30px, -20px, 0) scale(1.15); opacity: 1; }
}

@keyframes layerFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-card {
  position: relative;
  width: min(448px, 100%);
  padding: 34px 34px 26px;
  background:
    linear-gradient(160deg, rgba(23, 25, 50, 0.86), rgba(9, 11, 24, 0.94) 55%),
    var(--panel-solid);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(26px);
  overflow: hidden;
  animation: cardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(139, 92, 246, 0.16), transparent 65%),
    radial-gradient(320px 200px at 0% 100%, rgba(37, 99, 235, 0.08), transparent 70%);
  pointer-events: none;
}

.auth-card > * { position: relative; z-index: 1; }

.auth-orbit {
  position: absolute;
  top: -68px;
  right: -56px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(176, 124, 255, 0.14);
  border-radius: 50%;
  transform: rotate(-24deg) scaleY(0.5);
  pointer-events: none;
  z-index: 0;
}

.auth-orbit::after {
  content: "";
  position: absolute;
  inset: 26px;
  border: 1px solid rgba(176, 124, 255, 0.08);
  border-radius: 50%;
}

.auth-orbit .orbit-dot {
  position: absolute;
  top: 50%;
  left: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--violet-bright);
  box-shadow: 0 0 16px 3px rgba(176, 124, 255, 0.55);
}

.auth-head { margin-bottom: 24px; }
.auth-head h1 {
  margin: 11px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.auth-head h1 span {
  background: linear-gradient(100deg, #fff 10%, #c9a7ff 55%, #8b5cf6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.auth-head p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 22px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.auth-tab:hover { color: var(--text); }
.auth-tab.is-active {
  color: #fff;
  background: linear-gradient(120deg, rgba(139, 92, 246, 0.8), rgba(109, 40, 217, 0.8));
  box-shadow: 0 8px 20px -6px rgba(109, 40, 217, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.input-group { display: flex; flex-direction: column; gap: 8px; }

.input-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 51px;
  padding: 0 15px;
  background: rgba(4, 6, 15, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-shell:focus-within {
  border-color: rgba(176, 124, 255, 0.65);
  background: rgba(8, 10, 22, 0.8);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}

.input-shell .at {
  font-size: 15px;
  color: var(--violet-bright);
  font-weight: 600;
}

.input-shell input {
  flex: 1;
  min-width: 0;
  height: 49px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--text);
}

.input-shell input::placeholder { color: rgba(143, 147, 180, 0.55); }

.reveal {
  padding: 5px;
  border: 0;
  background: transparent;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  transition: color 0.18s ease;
}
.reveal:hover { color: var(--violet-soft); }

.input-hint {
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--muted-2);
}

.form-error {
  min-height: 15px;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--danger);
}

.auth-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  font-size: 13.5px;
  justify-content: space-between;
  padding: 0 20px 0 22px;
}
.auth-submit svg { transition: transform 0.2s ease; }
.auth-submit:hover svg { transform: translateX(3px); }

/* ------------------------------------------------------------
   Compose
   ------------------------------------------------------------ */

.layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  animation: layerFade 0.35s ease both;
}

.compose-layer {
  background:
    radial-gradient(1000px 600px at 78% 10%, rgba(91, 33, 182, 0.16), transparent 60%),
    radial-gradient(800px 600px at 10% 100%, rgba(30, 64, 175, 0.1), transparent 65%),
    rgba(3, 4, 11, 0.82);
  backdrop-filter: blur(20px) saturate(110%);
}

.layer-close {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 5;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: rgba(244, 241, 255, 0.66);
  background: rgba(10, 12, 26, 0.6);
  backdrop-filter: blur(12px);
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.layer-close svg { width: 18px; height: 18px; }
.layer-close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); transform: rotate(90deg); }

.compose-progress {
  position: absolute;
  top: 38px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.progress-dot.is-active {
  background: var(--violet-bright);
  box-shadow: 0 0 14px 2px rgba(176, 124, 255, 0.45);
  transform: scale(1.15);
}
.progress-line {
  width: 38px;
  height: 1px;
  background: linear-gradient(to right, rgba(176, 124, 255, 0.5), rgba(255, 255, 255, 0.12));
}

.compose-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.compose-track {
  display: flex;
  width: 200%;
  height: 100%;
  transform: translateX(0);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.compose-track.is-step-2 { transform: translateX(-50%); }

.compose-panel {
  position: relative;
  width: 50%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 92px 28px 46px;
  overflow-y: auto;
  overflow-x: visible;
}

.compose-inner {
  width: min(980px, 100%);
  margin: auto;
}

.compose-inner h2 {
  margin: 14px 0 30px;
  font-family: var(--font-display);
  font-size: clamp(36px, 5.4vw, 68px);
  font-weight: 640;
  letter-spacing: -0.05em;
  line-height: 0.97;
}

.message-shell {
  position: relative;
  padding: 24px 86px 24px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 70%);
}

#message-input {
  display: block;
  width: 100%;
  height: clamp(150px, 28vh, 290px);
  padding: 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: clamp(21px, 2.5vw, 34px);
  font-weight: 450;
  line-height: 1.32;
  letter-spacing: -0.025em;
  color: var(--text);
}

#message-input::placeholder { color: rgba(143, 147, 180, 0.42); }

.round-next {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #a855f7, #6d28d9);
  box-shadow: 0 20px 44px -12px rgba(139, 92, 246, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.round-next svg { width: 26px; height: 26px; }
.round-next:hover { transform: translateY(-50%) scale(1.06); box-shadow: 0 24px 52px -10px rgba(139, 92, 246, 0.85); }
.round-next:active { transform: translateY(-50%) scale(0.97); }

.compose-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
}

.foot-rules { display: flex; align-items: center; gap: 7px; }
.foot-rules span { color: rgba(255, 255, 255, 0.18); }

.place-inner { width: min(1040px, 100%); }
.place-inner h2 { margin-bottom: 22px; }

.compose-preview {
  max-width: 720px;
  margin: 0 0 26px;
  padding-left: 14px;
  border-left: 2px solid rgba(176, 124, 255, 0.45);
  font-size: 14px;
  line-height: 1.55;
  color: rgba(244, 241, 255, 0.55);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.place-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 13px;
  margin-bottom: 18px;
}

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.location-readout {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}
.location-readout svg { width: 16px; height: 16px; color: var(--violet-bright); flex: 0 0 auto; }
.location-readout.is-set { color: var(--text); border-color: rgba(176, 124, 255, 0.22); background: rgba(139, 92, 246, 0.07); }

.compose-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

/* ------------------------------------------------------------
   Combobox
   ------------------------------------------------------------ */

.combo { position: relative; min-width: 0; }

.combo-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  color: var(--text);
  background: rgba(8, 10, 22, 0.7);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.combo-trigger:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.2); background: rgba(12, 14, 30, 0.82); }

.combo.is-open .combo-trigger {
  border-color: rgba(176, 124, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.combo-trigger:disabled { opacity: 0.42; }
.combo-trigger > svg { width: 15px; height: 15px; color: var(--muted); flex: 0 0 auto; transition: transform 0.25s ease; }
.combo.is-open .combo-trigger > svg { transform: rotate(180deg); }

.combo-value {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combo-value.is-placeholder { color: rgba(143, 147, 180, 0.58); }
.combo-value .combo-sub {
  flex: 0 0 auto;
  padding: 2px 5px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--violet-soft);
  background: rgba(139, 92, 246, 0.12);
  border-radius: 4px;
}

.combo-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  padding: 7px;
  background: rgba(12, 14, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 26px 60px -12px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px);
  animation: menuIn 0.18s ease both;
}

.combo.is-up .combo-menu {
  top: auto;
  bottom: calc(100% + 8px);
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.combo-search {
  display: block;
  width: 100%;
  height: 39px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  outline: 0;
  background: rgba(0, 0, 0, 0.25);
  font-size: 12.5px;
  color: var(--text);
}
.combo-search::placeholder { color: var(--muted-2); }
.combo-search:focus { border-color: rgba(176, 124, 255, 0.45); }

.combo-list {
  max-height: 264px;
  margin-top: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.combo-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  text-align: left;
  font-size: 12.5px;
  color: rgba(244, 241, 255, 0.78);
  background: transparent;
}

.combo-option .opt-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-option .opt-sub { flex: 0 0 auto; font-size: 9.5px; letter-spacing: 0.05em; color: var(--muted-2); }

.combo-option:hover,
.combo-option.is-active { background: rgba(139, 92, 246, 0.15); color: #fff; }
.combo-option.is-selected { color: var(--violet-soft); }
.combo-option.is-selected .opt-name::before { content: "✓ "; }

.combo-empty,
.combo-more {
  padding: 12px 10px;
  font-size: 11px;
  color: var(--muted-2);
  text-align: center;
}

.combo-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 15px;
  font-size: 12px;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 13px;
}

.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(176, 124, 255, 0.25);
  border-top-color: var(--violet-bright);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------
   Dashboard
   ------------------------------------------------------------ */

.dashboard-layer {
  z-index: 85;
  padding: 28px;
  overflow-y: auto;
  background:
    radial-gradient(1000px 700px at 80% 0%, rgba(76, 29, 149, 0.2), transparent 62%),
    rgba(3, 4, 11, 0.82);
  backdrop-filter: blur(22px) saturate(110%);
}

.dash-shell {
  width: min(1180px, 100%);
  margin: auto;
  padding: 30px;
  background: linear-gradient(165deg, rgba(17, 19, 40, 0.88), rgba(7, 9, 20, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.dash-head h2 {
  margin: 9px 0 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 640;
  letter-spacing: -0.04em;
  line-height: 1;
}
.dash-head h2 span {
  background: linear-gradient(100deg, #fff, #c9a7ff 70%, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.dash-head-actions { display: flex; align-items: center; gap: 8px; }

.layer-close-inline {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.layer-close-inline svg { width: 17px; height: 17px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
}

.stat-label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stat-card strong { font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.stat-note { font-size: 10px; color: var(--muted-2); }

.stat-card.accent-card {
  background: linear-gradient(150deg, rgba(139, 92, 246, 0.20), rgba(109, 40, 217, 0.06));
  border-color: rgba(176, 124, 255, 0.26);
}
.stat-card.accent-card strong { color: var(--violet-soft); }

.dash-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.dash-card {
  min-width: 0;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  overflow: hidden;
}

.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dash-card-head h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(244, 241, 255, 0.70); }

.pill {
  padding: 3px 9px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}
.post-list { max-height: 390px; overflow-y: auto; padding: 6px; min-height: 120px; }

.signal-row {
  display: flex;
  gap: 11px;
  padding: 12px;
  border-radius: 13px;
  transition: background 0.16s ease;
}
.signal-row:hover { background: rgba(255, 255, 255, 0.035); }
.signal-row.is-clickable { cursor: pointer; }
.signal-row:focus-visible { outline-offset: -2px; }
.signal-row + .signal-row { border-top: 1px solid rgba(255, 255, 255, 0.045); }

.signal-row .avatar { width: 30px; height: 30px; font-size: 11px; }

.signal-body { flex: 1; min-width: 0; }
.signal-top { display: flex; align-items: baseline; gap: 7px; }
.signal-top strong { font-size: 11.5px; font-weight: 650; color: rgba(244, 241, 255, 0.85); }
.signal-top time { font-size: 9.5px; color: var(--muted-2); }
.signal-text {
  margin: 4px 0 5px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(244, 241, 255, 0.62);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.signal-place { display: flex; align-items: center; gap: 5px; font-size: 9.5px; letter-spacing: 0.03em; color: var(--violet-soft); }
.signal-place svg { width: 11px; height: 11px; flex: 0 0 auto; }

.signal-delete {
  flex: 0 0 auto;
  align-self: flex-start;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: var(--muted-2);
  background: transparent;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.signal-row:hover .signal-delete { opacity: 1; }
.signal-delete:hover { color: var(--danger); background: rgba(251, 113, 133, 0.1); }
.signal-delete svg { width: 13px; height: 13px; }

.empty-state {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 130px;
  padding: 20px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted-2);
}
.empty-state strong { font-size: 13px; font-weight: 600; color: rgba(244, 241, 255, 0.65); }

.dash-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--muted-2);
}

/* ------------------------------------------------------------
   Signal popup
   ------------------------------------------------------------ */

.post-card {
  position: fixed;
  z-index: 60;
  width: 340px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 20px;
  background: linear-gradient(165deg, rgba(23, 25, 51, 0.95), rgba(8, 10, 22, 0.97));
  border: 1px solid rgba(176, 124, 255, 0.24);
  border-radius: 22px;
  box-shadow: 0 30px 80px -16px rgba(0, 0, 0, 0.85), 0 0 60px -20px rgba(139, 92, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  animation: cardPop 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardPop {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.post-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(176, 124, 255, 0.7), transparent);
}

.post-card-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}
.post-card-close:hover { color: #fff; background: rgba(255, 255, 255, 0.09); }
.post-card-close svg { width: 13px; height: 13px; }

.post-card-head { display: flex; align-items: center; gap: 10px; padding-right: 24px; }
.post-card-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.post-card-who strong { font-size: 12.5px; font-weight: 650; }
.post-card-who span { font-size: 9.5px; color: var(--muted-2); }

.post-card-text {
  margin: 15px 0 14px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(244, 241, 255, 0.82);
  overflow-wrap: anywhere;
}

.post-card-place {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 10px 11px;
  margin-bottom: 13px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--violet-soft);
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.14);
  border-radius: 10px;
}
.post-card-place svg { width: 13px; height: 13px; margin-top: 1px; flex: 0 0 auto; }

/* ------------------------------------------------------------
   Toast
   ------------------------------------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 200;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 18px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  color: #fff;
  background: rgba(20, 22, 44, 0.96);
  border: 1px solid rgba(176, 124, 255, 0.28);
  border-radius: 999px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  font-size: 15px;
  text-align: center;
  background: var(--bg);
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 980px) {
  .hud { padding: 14px 18px; }
  .brand { min-width: 0; }
  .brand-text small { display: none; }
  .tab-shell { top: 13px; }
  .user-name { display: none; }
  .user-chip { padding: 4px; gap: 3px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-columns { grid-template-columns: 1fr; }
  .place-grid { grid-template-columns: 1fr 1fr; }
  .place-grid .field:nth-child(3) { grid-column: span 2; }
  .globe-hint { display: none; }
  .compose-panel { padding-top: 84px; }
}

@media (max-width: 680px) {
  .hud { padding: 12px; gap: 8px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-mark svg { width: 22px; height: 22px; }
  .brand-text strong { font-size: 15px; }
  .tab-shell { top: 36px; left: auto; right: 50%; transform: translateX(50%); }
  .tab-shell.is-open .tab-items { width: 144px; }
  .user-chip { position: fixed; top: 12px; right: 12px; }
  .world-meta { left: 12px; bottom: 12px; padding: 8px 12px; font-size: 10px; }
  .globe-caption { display: none; }

  .auth-layer { padding: 14px; align-items: start; padding-top: max(22px, env(safe-area-inset-top)); }
  .auth-card { padding: 26px 22px 20px; border-radius: 24px; }
  .auth-head h1 { font-size: 30px; }

  .layer-close { top: 14px; left: 14px; width: 40px; height: 40px; }
  .compose-progress { top: 28px; }
  .compose-panel { padding: 74px 18px 28px; align-items: start; }
  .compose-inner h2 { font-size: clamp(34px, 10vw, 46px); margin-bottom: 22px; }
  .message-shell { padding: 16px 0 0; border-top: 0; background: none; }
  #message-input { height: 32vh; font-size: 22px; }
  .round-next {
    position: static;
    transform: none;
    width: 54px;
    height: 54px;
    margin: 18px 0 0 auto;
  }
  .round-next:hover { transform: none; }
  .round-next svg { width: 22px; height: 22px; }
  .compose-foot { flex-direction: column; gap: 8px; }
  .place-grid { grid-template-columns: 1fr; gap: 12px; }
  .place-grid .field:nth-child(3) { grid-column: auto; }
  .compose-actions { flex-direction: column; }
  .compose-actions .btn { width: 100%; }
  .toast { bottom: 68px; }

  .dashboard-layer { padding: 12px; }
  .dash-shell { padding: 20px 16px; border-radius: 22px; }
  .dash-head { flex-direction: column; }
  .dash-head-actions { width: 100%; justify-content: space-between; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 27px; }
  .dash-foot { flex-direction: column; align-items: flex-start; }

  .post-card {
    left: 12px !important;
    right: 12px;
    bottom: 12px !important;
    top: auto !important;
    width: auto;
  }
}

@media (max-width: 390px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 13px; }
  .stat-card strong { font-size: 25px; }
}

@media (max-width: 340px) {
  .brand-text { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
