/* ============================================================
   MTDOX rebrand + note flow
   Loaded after styles.css so it can replace the CMC chrome.
   ============================================================ */

/* ------------------------------------------------------------
   Brand
   ------------------------------------------------------------ */

.brand { min-width: 0; }
.brand-mark {
  width: 38px;
  height: 38px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  background: #f5f2ea;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}
.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.brand-text small { display: none; }
.brand-text strong {
  font-size: 17px;
  letter-spacing: 0.2em;
}
.brand:hover .brand-mark { transform: rotate(-3deg) scale(1.04); }
.brand-mark { transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }

.globe-caption { color: rgba(255, 255, 255, 0.3); }

/* ------------------------------------------------------------
   Basic register / login
   ------------------------------------------------------------ */

.auth-layer {
  background: rgba(0, 0, 0, .9);
  backdrop-filter: blur(14px) saturate(115%);
  place-items: center;
  padding: 22px;
  animation: none;
}
.auth-card {
  width: min(356px, 100%);
  max-width: 100%;
  padding: 25px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(28, 28, 38, .75), rgba(9, 9, 15, .77));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(20px) saturate(135%);
  animation: none;
}
.auth-card::before { display: none; }
.auth-layer,
.auth-layer *,
.auth-layer *::before,
.auth-layer *::after { animation: none !important; transition: none !important; }
.auth-logo {
  display: block;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border: 0;
  border-radius: 11px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}
#auth-title {
  margin: 0 0 22px;
  font-family: var(--font);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-align: center;
  color: #f2f2f2;
}
.basic-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.basic-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1;
  color: #d2d2d2;
}
.basic-field > span { padding-left: 1px; }
.basic-input {
  width: 100%;
  height: 41px;
  padding: 0 11px;
  border: 1px solid #383838;
  border-radius: 2px;
  outline: 0;
  background: rgba(38, 38, 38, .72);
  color: #f4f4f4;
  font-size: 13px;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.basic-input::placeholder { color: #8b8b8b; }
.basic-input:hover { border-color: #4a4a4a; }
.basic-input:focus {
  border-color: #8b8b8b;
  background: #2d2d2d;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}
.basic-submit {
  width: 100%;
  height: 42px;
  margin-top: 4px;
  border: 1px solid #3b3b3b;
  border-radius: 2px;
  background: rgba(48, 48, 48, .76);
  color: #ededed;
  font-size: 13px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.16s ease, box-shadow 0.2s ease;
}
.basic-submit:hover {
  background: #3a3a3a;
  border-color: #565656;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}
.basic-submit:active { transform: none; }
.auth-switch {
  margin: 17px 0 0;
  font-size: 12px;
  text-align: center;
  color: #888;
}
.auth-switch button {
  padding: 3px 4px;
  border: 0;
  background: transparent;
  color: #f0f0f0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.18s ease, transform 0.18s ease;
}
.auth-switch button:hover { color: #b07cff; transform: none; }
#signup-error, #signin-error { min-height: 0; }
#signup-error:empty, #signin-error:empty { display: none; }

/* ------------------------------------------------------------
   Left pastes drawer
   ------------------------------------------------------------ */

.pastes-toggle {
  position: fixed;
  left: 0;
  top: 50%;
  z-index: 32;
  width: 32px;
  height: 62px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(8, 9, 18, 0.82);
  backdrop-filter: blur(14px);
  transform: translateY(-50%);
  transition: width 0.22s ease, color 0.2s ease, background 0.2s ease, opacity 0.22s ease, transform 0.3s ease;
}
.pastes-toggle svg { width: 17px; height: 17px; transition: transform 0.25s ease; }
.pastes-toggle:hover {
  width: 40px;
  color: #fff;
  background: rgba(24, 18, 46, 0.95);
}
.pastes-toggle:hover svg { transform: translateX(2px); }
body.pastes-open .pastes-toggle {
  opacity: 0;
  pointer-events: none;
  transform: translate(-10px, -50%);
}

.pastes-scrim {
  position: fixed;
  inset: 0;
  z-index: 33;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(3px);
  animation: mtdoxFade 0.25s ease both;
}

.pastes-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 34;
  width: min(390px, 92vw);
  display: flex;
  flex-direction: column;
  padding: 26px 0 0;
  visibility: hidden;
  background:
    radial-gradient(420px 300px at 0% 0%, rgba(139, 92, 246, 0.12), transparent 68%),
    #06060a;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 30px 0 80px rgba(0, 0, 0, 0.68);
  transform: translateX(-102%);
  transition: transform 0.44s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.44s;
}
.pastes-panel.is-open {
  visibility: visible;
  transform: translateX(0);
  transition: transform 0.44s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}
.pastes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 20px;
}
.pastes-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 0.18em;
  color: #f4f1ff;
  white-space: nowrap;
}
.pastes-title span { color: var(--violet-bright); }
.pastes-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.pastes-close svg { width: 17px; height: 17px; }
.pastes-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(-2px);
}
.pastes-sub {
  margin: 5px 20px 18px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666a83;
}
.pastes-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 94px;
  overflow-y: auto;
  padding: 0 20px 14px;
}
.filter-chip {
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: rgba(244, 241, 255, 0.6);
  background: transparent;
  font-size: 10.5px;
  line-height: 1;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.filter-chip:hover {
  color: #fff;
  border-color: rgba(176, 124, 255, 0.45);
  transform: translateY(-1px);
}
.filter-chip.is-active {
  color: #0a0a0d;
  border-color: #f2efff;
  background: #f2efff;
}
.pastes-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 20px 8px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 0.18s ease, background 0.18s ease;
}
.pastes-search:focus-within {
  border-color: rgba(176, 124, 255, 0.5);
  background: rgba(255, 255, 255, 0.055);
}
.pastes-search svg { width: 15px; height: 15px; color: #747895; flex: 0 0 auto; }
.pastes-search input {
  width: 100%;
  height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
  color: #f4f1ff;
}
.pastes-search input::placeholder { color: #5f6380; }
.pastes-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 0 16px;
}
.paste-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 20px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  text-align: left;
  background: transparent;
  animation: pasteRowIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  transition: background 0.18s ease, padding-left 0.2s ease;
}
.paste-row:hover {
  background: rgba(139, 92, 246, 0.09);
  padding-left: 25px;
}
.paste-row strong {
  color: #f4f1ff;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.paste-row-meta {
  font-size: 9.5px;
  color: #7f83a0;
}
.paste-row-place {
  font-size: 10.5px;
  color: var(--violet-soft);
}
.pastes-empty {
  padding: 52px 28px;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  color: #666a83;
}
.pastes-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  color: #6b6f8a;
}
.pastes-new {
  padding: 7px 11px;
  border: 1px solid rgba(176, 124, 255, 0.3);
  border-radius: 999px;
  color: #d8c8ff;
  background: rgba(139, 92, 246, 0.12);
  font-size: 10.5px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.pastes-new:hover {
  color: #fff;
  background: rgba(139, 92, 246, 0.26);
  transform: translateY(-1px);
}

/* ------------------------------------------------------------
   Full-page note editor
   ------------------------------------------------------------ */

.note-compose-layer {
  z-index: 80;
  overflow: hidden;
  background:
    radial-gradient(800px 500px at 82% 0%, rgba(80, 34, 148, 0.13), transparent 66%),
    #050506;
  backdrop-filter: none;
}
.note-back {
  position: fixed;
  top: 21px;
  left: 22px;
  z-index: 6;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.64);
  background: rgba(255, 255, 255, 0.025);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.note-back svg { width: 18px; height: 18px; }
.note-back:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(-2px);
}
.note-wordmark {
  position: fixed;
  top: 30px;
  left: 74px;
  z-index: 5;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: rgba(244, 241, 255, 0.3);
  pointer-events: none;
}
#message-input.note-body {
  position: fixed;
  top: 84px;
  left: clamp(28px, 8vw, 128px);
  right: clamp(28px, 8vw, 128px);
  bottom: 72px;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: clamp(19px, 2vw, 29px);
  font-weight: 420;
  line-height: 1.55;
  letter-spacing: -0.02em;
  color: #ece9f7;
}
#message-input.note-body::placeholder { color: rgba(244, 241, 255, 0.22); }
.note-count {
  position: fixed;
  left: clamp(28px, 8vw, 128px);
  bottom: 27px;
  z-index: 5;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: #4f536b;
  pointer-events: none;
}
.note-menu {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 10;
  width: 44px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.03);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.note-menu svg { width: 21px; height: 21px; transition: transform 0.25s ease; }
.note-menu:hover {
  color: #fff;
  border-color: rgba(176, 124, 255, 0.42);
  background: rgba(139, 92, 246, 0.14);
  transform: translateY(-1px);
}
.note-menu.is-active {
  color: #0a0a0d;
  border-color: #f2efff;
  background: #f2efff;
}
.note-menu.is-active svg { transform: rotate(90deg); }

.note-meta {
  position: fixed;
  top: 72px;
  right: 22px;
  z-index: 9;
  width: min(358px, calc(100vw - 36px));
  padding: 18px;
  visibility: hidden;
  opacity: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background:
    radial-gradient(130% 90% at 100% 0%, #1b1c28 0%, #101017 52%, #09090e 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.72);
  transform: translateY(-8px) scale(0.985);
  transform-origin: top right;
  transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.3s;
}
.note-meta.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}
.note-meta-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}
.note-meta-head img {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: #f5f2ea;
}
.note-meta-head div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.note-meta-head strong {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.18em;
  color: #f4f1ff;
}
.note-meta-head span {
  font-size: 10px;
  color: #7f83a0;
}
.meta-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 11px;
  min-width: 0;
}
.meta-field .input-label {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #727692;
}
.meta-input {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  outline: 0;
  background: rgba(255, 255, 255, 0.04);
  color: #f4f1ff;
  font-size: 12.5px;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.meta-input:focus {
  border-color: rgba(176, 124, 255, 0.55);
  background: rgba(255, 255, 255, 0.065);
}
.note-meta .combo-trigger {
  min-height: 42px;
  padding: 0 11px;
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}
.note-meta .combo-trigger:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
}
.note-meta .combo-menu { z-index: 20; }
.note-meta .combo-value { font-size: 12px; }
.note-meta .location-readout {
  min-height: 40px;
  margin: 4px 0 10px;
  padding: 9px 11px;
  font-size: 11px;
  border-radius: 6px;
}
.note-create {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}
.note-create:disabled {
  background: #241a38;
  color: #7d6d9c;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

/* ------------------------------------------------------------
   Note reader
   ------------------------------------------------------------ */

.note-view-layer {
  z-index: 82;
  overflow-y: auto;
  background: #000;
  animation: mtdoxFade 0.25s ease both;
}
.note-view-card {
  width: min(780px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(36px, 6vw, 74px) clamp(20px, 5vw, 48px) 60px;
}
.note-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.note-view-brand {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: #666a83;
}
.note-view-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.62);
  background: transparent;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.note-view-close svg { width: 16px; height: 16px; }
.note-view-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(90deg);
}
.note-view-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 34px;
  font-size: 11px;
  color: #777b95;
}
.note-view-meta span:first-child { color: #d8c8ff; }
#note-view-title {
  margin: 12px 0 13px;
  font-family: var(--font-display);
  font-size: clamp(36px, 5.6vw, 62px);
  font-weight: 620;
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: #f5f2ff;
  overflow-wrap: anywhere;
}
.note-view-place {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  margin-bottom: 30px;
  font-size: 10.5px;
  color: var(--violet-soft);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.08);
}
.note-view-place:empty { display: none; }
.note-view-body {
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: rgba(244, 241, 255, 0.82);
}
.note-view-foot {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ------------------------------------------------------------
   Dot popup
   ------------------------------------------------------------ */

.post-card {
  width: 330px;
  max-height: min(70vh, 520px);
  padding: 18px;
  border-radius: 10px;
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(160deg, rgba(20, 20, 28, 0.98), rgba(7, 7, 11, 0.99));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.75), 0 0 50px -20px rgba(139, 92, 246, 0.3);
  backdrop-filter: blur(18px);
}
.post-card-tag {
  margin-bottom: 10px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: #6f7390;
}
.post-card-title {
  margin: 0 0 12px;
  padding-right: 28px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 620;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #f5f2ff;
  overflow-wrap: anywhere;
}
.post-card-text { margin-bottom: 12px; font-size: 13px; line-height: 1.5; }
.post-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.post-card-actions .btn { flex: 0 0 auto; }

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

.signal-title {
  display: block;
  margin: 3px 0 4px;
  font-size: 13px;
  font-weight: 650;
  color: #f6f3ff;
  letter-spacing: -0.01em;
}
.signal-row .signal-text { margin-bottom: 6px; }

/* ------------------------------------------------------------
   Extra button motion
   ------------------------------------------------------------ */

.btn { will-change: transform; }
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, 0.2) 50%, transparent 75%);
  transform: translateX(-130%);
  transition: transform 0.55s ease;
  pointer-events: none;
}
.btn.primary:hover:not(:disabled)::after { transform: translateX(130%); }
.btn.ghost:hover { transform: translateY(-1px); }
.icon-btn { transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease; }
.icon-btn:hover { transform: translateY(-1px); }
.tab-btn:hover { transform: translateY(-2px); }
.tab-btn:active { transform: translateY(0) scale(0.88); }
.note-menu:hover svg { transform: rotate(90deg); }
.filter-chip:active,
.pastes-new:active,
.basic-submit:active { transform: scale(0.95); }
.paste-row:active { background: rgba(139, 92, 246, 0.16); }

.post-card:not([hidden]) {
  animation: cardIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.note-view-layer:not([hidden]) .note-view-card {
  animation: noteIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pastes-toggle:active { transform: translateY(-50%) scale(0.96); }
.pastes-close:active, .note-back:active, .note-view-close:active, .note-menu:active { transform: scale(0.94); }
.basic-submit:focus-visible, .basic-input:focus-visible { outline: 2px solid rgba(176, 124, 255, 0.8); outline-offset: 2px; }

@keyframes mtdoxFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes mtdoxAuthIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pasteRowIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes noteIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (min-width: 900px) {
  #message-input.note-body {
    transition: right 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .note-compose-layer.meta-open #message-input.note-body {
    right: 404px;
  }
}

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

@media (max-width: 680px) {
  .auth-layer {
    padding: 20px;
    padding-top: max(28px, env(safe-area-inset-top));
    align-items: start;
  }
  .auth-card { padding-top: 10px; }
  .auth-logo { width: 44px; height: 44px; margin-bottom: 15px; }
  #auth-title { font-size: 24px; margin-bottom: 20px; }

  .pastes-toggle {
    width: 28px;
    height: 56px;
  }
  .pastes-panel { width: 100%; }
  .pastes-filters { max-height: 82px; }

  .note-back { top: 15px; left: 15px; width: 36px; height: 36px; }
  .note-wordmark { top: 25px; left: 63px; }
  #message-input.note-body {
    top: 70px;
    left: 20px;
    right: 20px;
    bottom: 62px;
    font-size: 19px;
    line-height: 1.55;
  }
  .note-count { left: 20px; bottom: 20px; }
  .note-menu { top: 13px; right: 14px; width: 42px; height: 39px; }
  .note-meta {
    top: 61px;
    right: 12px;
    left: 12px;
    width: auto;
    padding: 15px;
  }
  .note-meta-head { margin-bottom: 14px; padding-bottom: 12px; }

  .post-card {
    width: auto;
    max-height: min(70vh, 520px);
    left: 12px !important;
    right: 12px;
    bottom: 12px !important;
    top: auto !important;
  }

  .note-view-card { padding: 34px 20px 46px; }
  .note-view-meta { margin-top: 26px; }
  .note-view-body { padding-top: 22px; }
}

/* Server-backed community screens and the translucent MTDOX finish */
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.brand-home { display: flex; align-items: center; gap: 10px; }
.brand-sub {
  margin-left: 48px;
  color: #d99cff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .28em;
  line-height: 1;
  transition: color .2s ease, text-shadow .2s ease;
}
.brand-sub:hover { color: #fff; text-shadow: 0 0 12px rgba(216, 156, 255, .8); }
.tab-shell, .tab-items, .user-chip, .pastes-panel, .note-meta, .note-view-card,
.dashboard-layer, .dash-shell, .dash-card, .post-card, .toast {
  backdrop-filter: blur(20px) saturate(135%);
}
.tab-shell { background: rgba(7, 8, 20, .58); }
.tab-items { background: rgba(8, 9, 23, .78); }
.user-chip { background: rgba(9, 10, 24, .66); }
.pastes-panel { background: rgba(7, 8, 22, .78); }
.note-meta { background: rgba(9, 10, 24, .72); }
.note-view-card {
  background: linear-gradient(145deg, rgba(18, 20, 39, .84), rgba(7, 8, 19, .76));
  border-color: rgba(255, 255, 255, .14);
}
.dash-shell {
  background: linear-gradient(145deg, rgba(20, 20, 38, .73), rgba(8, 8, 18, .76));
}
.dash-card {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(255, 255, 255, .1);
  transition: transform .26s cubic-bezier(.2,.8,.2,1), border-color .26s ease, box-shadow .26s ease;
}
.dash-card:hover { transform: translateY(-2px); border-color: rgba(190, 150, 255, .2); box-shadow: 0 18px 38px rgba(0, 0, 0, .18); }
.stat-card { animation: communityReveal .42s cubic-bezier(.2,.8,.2,1) both; transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease; }
.stat-card:nth-child(2) { animation-delay: 45ms; }
.stat-card:nth-child(3) { animation-delay: 90ms; }
.stat-card:nth-child(4) { animation-delay: 135ms; }
.stat-card:hover { transform: translateY(-3px); border-color: rgba(190, 150, 255, .24); box-shadow: 0 18px 38px rgba(0, 0, 0, .2); }
.post-card {
  background: linear-gradient(145deg, rgba(18, 18, 36, .84), rgba(7, 8, 19, .78));
  border-color: rgba(255, 255, 255, .13);
}
.dash-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 21px 0 13px;
}
.dash-tab {
  padding: 8px 13px;
  color: rgba(244, 241, 255, .64);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  transition: color .2s ease, transform .2s ease;
}
.dash-tab:hover { color: #fff; border-color: rgba(190, 150, 255, .4); transform: translateY(-2px); }
.dash-tab.is-active {
  color: #fff;
  border-color: rgba(186, 140, 255, .42);
  background: rgba(139, 92, 246, .22);
  box-shadow: 0 0 22px rgba(139, 92, 246, .12);
}
.dash-section { animation: communityReveal .35s cubic-bezier(.2,.8,.2,1) both; }
.dash-section[hidden] { display: none; }
.user-search input {
  width: min(240px, 45vw);
  height: 34px;
  padding: 0 11px;
  color: #fff;
  background: rgba(5, 6, 15, .44);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 10px;
  outline: 0;
}
.user-search input:focus { border-color: rgba(185, 139, 255, .65); box-shadow: 0 0 0 3px rgba(139, 92, 246, .12); }
.user-list { max-height: 480px; overflow: auto; padding: 7px; }
.user-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 9px 11px;
  margin: 4px;
  border: 1px solid rgba(255, 255, 255, .065);
  border-radius: 13px;
  background: rgba(255, 255, 255, .025);
  animation: communityReveal .36s ease both;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.user-row:hover { transform: translateY(-2px); border-color: rgba(186, 140, 255, .27); background: rgba(255, 255, 255, .06); }
.user-list-avatar, .profile-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background-color: #33214f;
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
}
.user-list-avatar { width: 38px; height: 38px; font-size: 14px; }
.user-list-details { display: grid; gap: 3px; min-width: 0; flex: 1; }
.user-list-details > span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.profile-link {
  width: fit-content;
  padding: 0;
  color: #e5d5ff;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color .18s ease, text-shadow .18s ease;
}
.profile-link:hover { color: #fff; text-shadow: 0 0 12px rgba(176, 124, 255, .52); }
.signal-top .profile-link { font-size: 11.5px; font-weight: 650; }
.post-card-who .profile-link, .note-view-meta .profile-link { font-size: inherit; font-weight: 650; }
.role-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: #d3c4ec;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.role-admin { color: #fff; border-color: rgba(255, 69, 80, .5); background: rgba(118, 9, 18, .33); }
.role-moderator { color: #d6c0ff; border-color: rgba(176, 124, 255, .3); background: rgba(139, 92, 246, .12); }
.role-select {
  width: 108px;
  padding: 6px 8px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 9px;
  background: #131323;
  font-size: 11px;
}
.admin-note { margin: 0; padding: 0 18px 10px; color: var(--muted); font-size: 11px; }
.user-row.admin-user {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(255, 43, 56, .64);
  background: linear-gradient(105deg, rgba(0, 0, 0, .95), rgba(74, 4, 12, .72), rgba(0, 0, 0, .94));
  background-size: 220% 100%;
  animation: communityReveal .36s ease both, adminGradient 5s ease-in-out infinite;
  box-shadow: inset 0 0 25px rgba(255, 0, 22, .08), 0 0 20px rgba(255, 0, 20, .1);
}
.user-row.admin-user::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 25, 39, .12) 50%, transparent 75%);
  content: "";
  transform: translateX(-100%);
  animation: redSweep 4s ease-in-out infinite;
}
.profile-layer, .chat-layer, .ip-layer, .password-layer {
  z-index: 96;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 22px;
  background: rgba(2, 2, 8, .52);
  backdrop-filter: blur(16px) saturate(125%);
}
.profile-card, .chat-card, .ip-card, .password-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(24, 23, 42, .82), rgba(7, 8, 18, .84));
  box-shadow: 0 30px 100px rgba(0, 0, 0, .55);
  backdrop-filter: blur(24px) saturate(150%);
  animation: communityReveal .42s cubic-bezier(.2,.8,.2,1) both;
}
.profile-card { padding: 0 28px 28px; }
.profile-close { position: absolute; z-index: 2; top: 13px; right: 13px; width: 36px; height: 36px; font-size: 22px; }
.profile-banner {
  height: 180px;
  margin: 0 -28px 0;
  background:
    radial-gradient(400px 180px at 20% 0%, rgba(190, 110, 255, .43), transparent 65%),
    linear-gradient(135deg, rgba(44, 25, 73, .96), rgba(8, 8, 17, .98));
  background-position: center;
  background-size: cover;
  border-radius: 24px 24px 0 0;
}
.profile-heading { position: relative; z-index: 1; display: flex; align-items: end; gap: 15px; margin-top: -42px; }
.profile-avatar { width: 92px; height: 92px; border-width: 3px; border-color: rgba(12, 12, 23, .9); font-size: 30px; transition: transform .3s ease, box-shadow .3s ease; }
.profile-avatar:hover { transform: translateY(-2px) scale(1.035); box-shadow: 0 10px 28px rgba(139, 92, 246, .25); }
.profile-title { flex: 1; min-width: 0; padding-bottom: 4px; }
.profile-title h2 { margin: 0; overflow-wrap: anywhere; font-size: clamp(22px, 4vw, 30px); }
.profile-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.profile-heading .role-badge { margin-bottom: 7px; }
.profile-bio { min-height: 28px; margin: 19px 0; color: rgba(244, 241, 255, .78); line-height: 1.6; white-space: pre-wrap; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-edit-form { display: grid; gap: 13px; margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); }
.profile-field { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }
.profile-field input, .profile-field textarea, .chat-compose textarea {
  width: 100%;
  padding: 10px 12px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  outline: 0;
  background: rgba(4, 5, 13, .58);
  resize: vertical;
}
.profile-field input:focus, .profile-field textarea:focus, .chat-compose textarea:focus { border-color: rgba(182, 137, 255, .65); }
.profile-field input[type=file] { padding: 8px; font-size: 11px; }
.profile-hint { margin: 0; color: var(--muted-2); font-size: 10px; }
.avatar-trigger {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.avatar-trigger:hover { transform: scale(1.07); }
.avatar-trigger .avatar { background-position: center; background-size: cover; }
.profile-trigger { border: 0; background: transparent; cursor: pointer; }
.note-view-controls { display: flex; align-items: center; gap: 6px; }
.note-export, .note-view-fullscreen {
  min-height: 29px;
  padding: 0 9px;
  color: rgba(240, 233, 255, .83);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 8px;
  background: rgba(255, 255, 255, .055);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .08em;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.note-export:hover, .note-view-fullscreen:hover { transform: translateY(-2px); border-color: rgba(190, 150, 255, .48); background: rgba(139, 92, 246, .17); }
.note-view-layer:fullscreen, .note-view-card:fullscreen { width: 100vw; height: 100vh; max-width: none; max-height: none; border-radius: 0; overflow: auto; }
.note-view-card.is-fullscreen { position: fixed; z-index: 110; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; overflow: auto; border-radius: 0; }
.chat-card { display: flex; flex-direction: column; width: min(650px, 100%); height: min(760px, 86vh); padding: 22px; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 5px 0 0; font-size: 22px; }
.chat-messages { display: flex; flex: 1; flex-direction: column; gap: 9px; overflow-y: auto; padding: 15px 2px; }
.chat-message { align-self: flex-start; max-width: 82%; padding: 10px 13px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 13px 13px 13px 4px; background: rgba(255, 255, 255, .065); animation: communityReveal .25s ease both; }
.chat-message.is-mine { align-self: flex-end; border-color: rgba(177, 126, 255, .25); border-radius: 13px 13px 4px 13px; background: rgba(122, 71, 205, .22); }
.chat-message strong { font-size: 10px; color: #dac7ff; }
.chat-message p { margin: 5px 0; font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message time { color: var(--muted-2); font-size: 9px; }
.chat-compose { display: flex; align-items: end; gap: 9px; padding-top: 12px; border-top: 1px solid var(--line); }
.chat-compose textarea { min-height: 45px; max-height: 110px; }
.ip-card { width: min(720px, 100%); padding: 27px; }
.ip-card .dash-head { align-items: center; }
.ip-disclaimer { color: var(--muted); font-size: 12px; line-height: 1.5; }
.ip-search { display: flex; gap: 9px; }
.ip-search input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; color: #fff; border: 1px solid rgba(255, 255, 255, .15); border-radius: 10px; outline: 0; background: rgba(3, 4, 12, .62); }
.ip-search input:focus { border-color: rgba(184, 138, 255, .7); }
.ip-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.ip-result { display: grid; gap: 5px; min-width: 0; padding: 11px 12px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 11px; background: rgba(255, 255, 255, .035); animation: communityReveal .32s ease both; }
.ip-result:nth-child(2) { animation-delay: 35ms; }
.ip-result:nth-child(3) { animation-delay: 70ms; }
.ip-result:nth-child(4) { animation-delay: 105ms; }
.ip-result span { color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.ip-result strong { overflow-wrap: anywhere; font-size: 12px; font-weight: 600; }
.password-card { display: grid; gap: 13px; width: min(440px, 100%); padding: 28px; }
.password-card h2 { margin: 0; font-size: 24px; }
.password-card > p:not(.form-error) { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@keyframes communityReveal { from { opacity: 0; transform: translateY(9px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes adminGradient { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes redSweep { 0%, 35% { transform: translateX(-110%); } 70%, 100% { transform: translateX(110%); } }

@media (max-width: 680px) {
  .note-view-head { align-items: flex-start; }
  .note-view-controls { flex-wrap: wrap; justify-content: flex-end; }
  .note-view-controls .note-view-close { width: 34px; height: 34px; }
  .profile-card { padding: 0 18px 21px; }
  .profile-banner { height: 145px; margin-right: -18px; margin-left: -18px; }
  .profile-heading { gap: 10px; }
  .profile-avatar { width: 72px; height: 72px; }
  .profile-heading .role-badge { margin-left: auto; }
  .chat-card, .ip-card, .password-card { padding: 17px; }
  .ip-results { grid-template-columns: 1fr; }
  .role-select { width: 86px; }
  .user-row { gap: 8px; padding: 8px; }
  .user-list-avatar { width: 32px; height: 32px; }
  .user-search input { width: min(170px, 38vw); }
}

/* ------------------------------------------------------------
   Extra motion + glass polish (auth screens stay still)
   ------------------------------------------------------------ */

.brand-text strong {
  background: linear-gradient(100deg, #fff 0%, #e6d7ff 28%, #fff 52%, #b98cff 76%, #fff 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: brandShimmer 9s ease-in-out infinite;
}
.brand-sub { animation: softPulse 4.6s ease-in-out infinite; }
.user-chip {
  border-color: rgba(255, 255, 255, .13);
  animation: chipGlow 7s ease-in-out infinite;
}
.avatar-trigger .avatar {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 0 18px rgba(139, 92, 246, .26);
  animation: avatarBreathe 5.5s ease-in-out infinite;
}
.tab-btn:hover, .pastes-toggle:hover {
  filter: drop-shadow(0 0 10px rgba(176, 124, 255, .35));
}
.dash-shell {
  animation: cardIn .5s cubic-bezier(.22, 1, .36, 1) both, ambientGlow 11s ease-in-out infinite;
}
.profile-card, .chat-card, .ip-card, .password-card {
  background: linear-gradient(145deg, rgba(24, 23, 42, .88), rgba(7, 8, 18, .9));
  animation: communityReveal .42s cubic-bezier(.2, .8, .2, 1) both, ambientGlow 13s ease-in-out infinite;
}
.note-view-card {
  animation: noteRise .5s cubic-bezier(.2, .8, .2, 1) both, ambientGlow 15s ease-in-out infinite;
}
.dash-card { position: relative; overflow: hidden; }
.dash-card::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(190, 150, 255, .07) 50%, transparent 65%);
  content: "";
  pointer-events: none;
  transform: translateX(-130%);
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}
.dash-card:hover::after { transform: translateX(130%); }
.stat-card { position: relative; overflow: hidden; }
.stat-card::after {
  position: absolute;
  inset: -40% -10%;
  background: radial-gradient(220px 120px at 20% 0%, rgba(190, 150, 255, .16), transparent 70%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.stat-card:hover::after { opacity: 1; }
.signal-row { transition: background .16s ease, transform .2s ease, box-shadow .2s ease; }
.signal-row.is-clickable:hover { transform: translateX(3px); box-shadow: inset 2px 0 0 rgba(176, 124, 255, .55); }
.user-row .user-list-avatar { transition: transform .25s ease, box-shadow .25s ease; }
.user-row:hover .user-list-avatar { transform: scale(1.08); box-shadow: 0 0 0 1px rgba(190, 150, 255, .35), 0 0 18px rgba(139, 92, 246, .3); }
.profile-avatar { cursor: default; }
.profile-link { position: relative; }
.profile-link::after {
  position: absolute;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(190, 150, 255, .8), transparent);
  content: "";
  opacity: 0;
  transform: scaleX(.3);
  transition: opacity .2s ease, transform .25s ease;
}
.profile-link:hover::after { opacity: 1; transform: scaleX(1); }
.note-view-body { animation: noteBodyIn .55s .08s cubic-bezier(.2, .8, .2, 1) both; }
.chat-message { transition: transform .2s ease, border-color .2s ease; }
.chat-message:hover { transform: translateY(-1px); border-color: rgba(190, 150, 255, .28); }
.ip-result { transition: transform .22s ease, border-color .22s ease, background .22s ease; }
.ip-result:hover { transform: translateY(-2px); border-color: rgba(190, 150, 255, .3); background: rgba(255, 255, 255, .055); }

@keyframes brandShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes softPulse {
  0%, 100% { opacity: .66; }
  50% { opacity: 1; }
}
@keyframes chipGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(139, 92, 246, 0); }
  50% { box-shadow: 0 0 24px rgba(139, 92, 246, .16); }
}
@keyframes avatarBreathe {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 0 16px rgba(139, 92, 246, .2); }
  50% { box-shadow: 0 0 0 1px rgba(255, 255, 255, .22), 0 0 26px rgba(139, 92, 246, .38); }
}
@keyframes ambientGlow {
  0%, 100% { box-shadow: 0 30px 100px rgba(0, 0, 0, .52), 0 0 0 rgba(139, 92, 246, 0); }
  50% { box-shadow: 0 32px 110px rgba(0, 0, 0, .58), 0 0 42px rgba(139, 92, 246, .1); }
}
@keyframes noteRise {
  from { opacity: 0; transform: translateY(12px) scale(.992); }
  to { opacity: 1; transform: none; }
}
@keyframes noteBodyIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {

  .dash-section, .user-row, .user-row.admin-user, .user-row.admin-user::after,
  .profile-card, .chat-card, .ip-card, .password-card, .chat-message,
  .brand-text strong, .brand-sub, .user-chip, .avatar-trigger .avatar,
  .dash-shell, .note-view-card, .note-view-body {
    animation: none !important;
  }
  .dash-tab, .user-row, .profile-link, .note-export, .note-view-fullscreen,
  .avatar-trigger, .brand-sub, .dash-card::after, .signal-row,
  .user-row .user-list-avatar, .chat-message, .ip-result { transition: none !important; }
}

/* ============================================================
   PUBLIC COMMENTS
   ============================================================ */

.note-comments {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, .09);
}
.note-comments-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.note-comments-head h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 7px 0 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 620;
  letter-spacing: -.025em;
}
.comment-count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  color: #d9c6ff;
  border: 1px solid rgba(176, 124, 255, .28);
  border-radius: 999px;
  background: rgba(139, 92, 246, .14);
}
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 20px;
}
.comment {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018));
  animation: commentIn .42s cubic-bezier(.2, .8, .2, 1) backwards;
  transition: border-color .24s ease, transform .24s ease, background .24s ease;
}
.comment:hover {
  border-color: rgba(190, 150, 255, .26);
  background: linear-gradient(150deg, rgba(255, 255, 255, .06), rgba(139, 92, 246, .05));
  transform: translateY(-1px);
}
.comment.has-investigation { border-color: rgba(176, 124, 255, .22); }
.comment-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  color: #d9c6ff;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  background: linear-gradient(140deg, rgba(139, 92, 246, .5), rgba(232, 121, 249, .28));
  background-position: center;
  background-size: cover;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 9px; }
.comment-head .profile-link { color: #e7dbff; font-size: 11.5px; font-weight: 650; }
.comment-head time { margin-left: auto; color: #6f7390; font-size: 10px; white-space: nowrap; }
.comment-delete {
  width: 21px;
  height: 21px;
  padding: 0;
  color: #8b8fa9;
  font-size: 15px;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.comment-delete:hover { color: #ffdbe4; border-color: rgba(251, 113, 133, .3); background: rgba(251, 113, 133, .14); transform: rotate(90deg); }
.comment-text { margin: 7px 0 0; color: rgba(244, 241, 255, .8); font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-shot { margin: 11px 0 0; }
.comment-shot a {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(176, 124, 255, .22);
  border-radius: 11px;
  background: #070812;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.comment-shot a:hover { border-color: rgba(190, 150, 255, .5); box-shadow: 0 12px 40px rgba(139, 92, 246, .18); }
.comment-shot img { display: block; width: 100%; height: auto; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.comment-shot a:hover img { transform: scale(1.015); }
.comment-shot figcaption { margin-top: 6px; color: #6f7390; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; }
.comment-empty {
  padding: 22px;
  color: #777b95;
  font-size: 12px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, .1);
  border-radius: 13px;
}
.comment-form { display: grid; gap: 9px; margin-top: 18px; }
.comment-form textarea {
  width: 100%;
  min-height: 84px;
  padding: 12px 14px;
  color: #f4f1ff;
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 12px;
  outline: 0;
  background: rgba(4, 5, 13, .6);
  resize: vertical;
  transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.comment-form textarea:focus {
  border-color: rgba(182, 137, 255, .62);
  background: rgba(9, 9, 24, .8);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .14);
}
.comment-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comment-form-foot span { color: #6f7390; font-size: 10px; }
.comment-form .form-error { min-height: 0; margin: 0; }

/* ============================================================
   INVESTIGATION BOARD
   ============================================================ */

.investigate-layer {
  z-index: 97;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 14px;
  background:
    radial-gradient(900px 620px at 18% 0%, rgba(76, 29, 149, .24), transparent 65%),
    radial-gradient(900px 620px at 88% 100%, rgba(30, 64, 175, .16), transparent 65%),
    rgba(2, 2, 8, .72);
  backdrop-filter: blur(18px) saturate(125%);
  animation: mtdoxFade .28s ease both;
}
.inv-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1420px, 100%);
  height: min(94vh, 1020px);
  overflow: hidden;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(19, 19, 35, .94), rgba(6, 7, 16, .96));
  box-shadow: 0 40px 120px rgba(0, 0, 0, .6);
  animation: invShellIn .45s cubic-bezier(.2, .8, .2, 1) both;
}
.inv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.inv-head-main h2 { margin: 3px 0 0; font-family: var(--font-display); font-size: clamp(21px, 3vw, 27px); font-weight: 620; letter-spacing: -.03em; }
.inv-sub { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.inv-tools { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.inv-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 33px;
  padding: 0 12px;
  color: rgba(240, 233, 255, .82);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .01em;
  text-transform: none;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 9px;
  background: rgba(255, 255, 255, .045);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
}
.inv-tool svg { width: 14px; height: 14px; }
.inv-tool:hover { transform: translateY(-1px); color: #fff; border-color: rgba(190, 150, 255, .42); background: rgba(139, 92, 246, .16); }
.inv-tool:active { transform: scale(.96); }
.inv-tool.is-primary { color: #16091f; border-color: transparent; background: linear-gradient(120deg, #c9a7ff, #8b5cf6); box-shadow: 0 6px 20px rgba(139, 92, 246, .3); }
.inv-tool.is-primary:hover { background: linear-gradient(120deg, #dcc4ff, #9a6bff); box-shadow: 0 8px 26px rgba(139, 92, 246, .42); }
.inv-tool.is-publish { color: #d7ffe8; border-color: rgba(74, 222, 128, .35); background: rgba(34, 197, 94, .16); }
.inv-tool.is-publish:hover { border-color: rgba(74, 222, 128, .62); background: rgba(34, 197, 94, .26); }
.inv-tool.is-danger { color: #ffc9d3; border-color: rgba(251, 113, 133, .26); background: rgba(251, 113, 133, .1); }
.inv-tool.is-danger:hover { border-color: rgba(251, 113, 133, .5); background: rgba(251, 113, 133, .18); }
.inv-tool.is-active { color: #fff; border-color: rgba(190, 150, 255, .62); background: rgba(139, 92, 246, .28); box-shadow: 0 0 20px rgba(139, 92, 246, .3); }
.inv-close { width: 34px; height: 34px; font-size: 20px; }
.inv-publishbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .018);
}
.inv-publishbar input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  color: #fff;
  font: inherit;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 9px;
  outline: 0;
  background: rgba(3, 4, 12, .55);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.inv-publishbar input:focus { border-color: rgba(182, 137, 255, .6); box-shadow: 0 0 0 3px rgba(139, 92, 246, .12); }
.inv-status { flex: 0 0 auto; color: #777b95; font-size: 10.5px; }
.inv-body {
  display: grid;
  flex: 1;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  padding: 14px;
}
.inv-paste {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
  padding: 15px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .022);
}
.inv-paste-label { font-size: 8.5px; font-weight: 750; letter-spacing: .22em; color: #7b7fa0; }
.inv-paste h3 { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 620; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.inv-paste p { margin: 0; color: var(--muted); font-size: 10.5px; }
.inv-paste-text {
  flex: 1;
  min-height: 90px;
  max-height: 300px;
  overflow: auto;
  padding: 11px;
  color: rgba(244, 241, 255, .72);
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 10px;
  background: rgba(3, 4, 12, .45);
}
.inv-help { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .07); }
.inv-help strong { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #a89bc6; }
.inv-help span { color: #6f7390; font-size: 10.5px; line-height: 1.5; }
.inv-stage { position: relative; min-width: 0; min-height: 0; }
.inv-board {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
  background-color: #080913;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(176, 124, 255, .14) 1px, transparent 1px),
    radial-gradient(620px 420px at 30% 0%, rgba(88, 40, 168, .14), transparent 70%),
    radial-gradient(620px 420px at 90% 100%, rgba(29, 78, 216, .1), transparent 70%);
  background-size: 28px 28px, auto, auto;
}
.inv-board.is-linking { cursor: crosshair; }
.inv-board.is-busy { user-select: none; }
.inv-edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.inv-edge {
  fill: none;
  stroke: rgba(196, 156, 255, .72);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: stroke;
  cursor: pointer;
  transition: stroke .18s ease, stroke-width .18s ease;
  animation: edgeDraw .5s ease both;
}
.inv-edge:hover { stroke: #ffd7e2; stroke-width: 2.6; }
.inv-nodes { position: absolute; inset: 0; }
.inv-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #6f7390;
  font-size: 12px;
  text-align: center;
  pointer-events: none;
}
.inv-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 150px;
  overflow: visible;
  border: 1px solid rgba(190, 150, 255, .3);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(24, 24, 44, .97), rgba(10, 11, 23, .98));
  box-shadow: 0 16px 46px rgba(0, 0, 0, .5), 0 0 30px -16px rgba(139, 92, 246, .6);
  animation: nodeIn .3s cubic-bezier(.2, .8, .2, 1) backwards;
  transition: border-color .2s ease, box-shadow .2s ease, transform .16s ease;
}
.inv-node:hover, .inv-node.is-dragging { border-color: rgba(202, 168, 255, .56); box-shadow: 0 20px 54px rgba(0, 0, 0, .58), 0 0 36px -12px rgba(139, 92, 246, .7); }
.inv-node.is-dragging { transform: scale(1.012); z-index: 4; }
.inv-node.is-resizing { z-index: 4; }
.inv-node.is-armed { border-color: rgba(255, 214, 158, .75); box-shadow: 0 0 0 2px rgba(255, 214, 158, .18), 0 20px 54px rgba(0, 0, 0, .58); }
.inv-node-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  border-radius: 11px 11px 0 0;
  background: rgba(255, 255, 255, .035);
  cursor: grab;
  touch-action: none;
}
.inv-node.is-dragging .inv-node-bar { cursor: grabbing; }
.inv-node-grip { color: #7b7fa0; font-size: 8px; letter-spacing: 1px; }
.inv-node-label { flex: 1; color: #b8a9d8; font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.inv-node-action {
  padding: 2px 6px;
  color: #a99cc4;
  font: inherit;
  font-size: 9px;
  font-weight: 650;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.inv-node-image:hover { color: #fff; border-color: rgba(190, 150, 255, .35); background: rgba(139, 92, 246, .2); }
.inv-node-remove { font-size: 13px; line-height: 1; }
.inv-node-remove:hover { color: #ffd1da; border-color: rgba(251, 113, 133, .35); background: rgba(251, 113, 133, .16); }
.inv-node-media { position: relative; flex: 0 0 auto; height: 42%; min-height: 0; overflow: hidden; background: #05060f; }
.inv-node-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.inv-node-unimage {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 21px;
  height: 21px;
  padding: 0;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  background: rgba(5, 6, 15, .72);
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.inv-node-unimage:hover { background: rgba(251, 113, 133, .7); transform: rotate(90deg); }
.inv-node-text {
  flex: 1;
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  color: rgba(244, 241, 255, .87);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  border: 0;
  outline: 0;
  background: transparent;
  resize: none;
}
.inv-node-text::placeholder { color: #5f6380; }
.inv-port {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: -8px;
  width: 15px;
  height: 15px;
  padding: 0;
  border: 2px solid rgba(10, 11, 22, .95);
  border-radius: 50%;
  background: linear-gradient(140deg, #e2ccff, #8b5cf6);
  box-shadow: 0 0 0 1px rgba(196, 156, 255, .35), 0 0 12px rgba(139, 92, 246, .6);
  cursor: crosshair;
  opacity: .55;
  transform: translateY(-50%);
  transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
}
.inv-node:hover .inv-port, .inv-board.is-linking .inv-port, .inv-node.is-armed .inv-port { opacity: 1; }
.inv-port:hover { transform: translateY(-50%) scale(1.25); box-shadow: 0 0 0 4px rgba(139, 92, 246, .2), 0 0 18px rgba(196, 156, 255, .8); }
.inv-resize {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background:
    linear-gradient(135deg, transparent 46%, rgba(196, 156, 255, .55) 47%, rgba(196, 156, 255, .55) 54%, transparent 55%),
    linear-gradient(135deg, transparent 66%, rgba(196, 156, 255, .4) 67%, rgba(196, 156, 255, .4) 74%, transparent 75%);
  cursor: nwse-resize;
  opacity: .6;
  transition: opacity .16s ease;
}
.inv-node:hover .inv-resize { opacity: 1; }

/* paste chooser */
.inv-chooser {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 4, 11, .76);
  backdrop-filter: blur(10px);
  animation: mtdoxFade .2s ease both;
}
.inv-chooser-card {
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  max-height: min(640px, 86%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(24, 23, 42, .97), rgba(7, 8, 18, .98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  animation: communityReveal .32s cubic-bezier(.2, .8, .2, 1) both;
}
.inv-chooser-card header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 12px; }
.inv-chooser-card h3 { margin: 4px 0 0; font-size: 21px; }
.inv-chooser-card > input {
  margin: 0 20px 12px;
  height: 38px;
  padding: 0 12px;
  color: #fff;
  font: inherit;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 9px;
  outline: 0;
  background: rgba(3, 4, 12, .55);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.inv-chooser-card > input:focus { border-color: rgba(182, 137, 255, .6); box-shadow: 0 0 0 3px rgba(139, 92, 246, .12); }
.inv-chooser-list { display: flex; flex: 1; flex-direction: column; gap: 6px; min-height: 0; padding: 0 14px 16px; overflow: auto; }
.inv-chooser-row {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  color: inherit;
  font: inherit;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 10px;
  background: rgba(255, 255, 255, .025);
  cursor: pointer;
  animation: commentIn .35s cubic-bezier(.2, .8, .2, 1) backwards;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.inv-chooser-row strong { font-size: 12.5px; font-weight: 650; }
.inv-chooser-row span { color: var(--muted); font-size: 10.5px; }
.inv-chooser-row:hover { transform: translateX(3px); border-color: rgba(190, 150, 255, .35); background: rgba(139, 92, 246, .12); }

/* ============================================================
   PROFILE EDITOR Ã¢â‚¬â€ live preview
   ============================================================ */

.profile-preview {
  position: relative;
  height: 170px;
  margin: 18px 0 8px;
}
.profile-preview-banner {
  position: absolute;
  inset: 0 0 30px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 15px;
  background:
    radial-gradient(420px 200px at 18% 0%, rgba(190, 110, 255, .4), transparent 65%),
    linear-gradient(135deg, rgba(44, 25, 73, .96), rgba(8, 8, 17, .98));
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 -30px 50px -20px rgba(3, 4, 11, .8);
  transition: background-image .3s ease;
}
.profile-preview-banner::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 55%, rgba(5, 6, 15, .5));
  content: "";
  pointer-events: none;
}
.profile-preview-btn {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  color: #f0e9ff;
  font: inherit;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .02em;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 7px;
  background: rgba(5, 6, 15, .58);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.profile-preview-btn:hover { transform: translateY(-1px); border-color: rgba(206, 172, 255, .6); background: rgba(139, 92, 246, .3); }
.profile-preview-btn-avatar { top: auto; right: auto; bottom: 0; left: 100px; }
.profile-preview-avatar {
  position: absolute;
  bottom: 0;
  left: 16px;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  overflow: hidden;
  font-size: 25px;
  font-weight: 650;
  color: #e8daff;
  border: 2px solid rgba(12, 12, 23, .95);
  border-radius: 50%;
  background: linear-gradient(140deg, rgba(139, 92, 246, .6), rgba(232, 121, 249, .34));
  background-position: center;
  background-size: cover;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .08);
}
.profile-preview-avatar.has-image span { display: none; }
.profile-field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.profile-field-label em { color: #6f7390; font-size: 9.5px; font-style: normal; font-weight: 500; letter-spacing: .04em; }

/* ============================================================
   RICHER, CLEANER MOTION
   ============================================================ */

/* smooth hover lift on the paste rows and dashboard cards */
.paste-row { transition: background .2s ease, transform .2s ease, box-shadow .25s ease, border-color .2s ease; }
.paste-row:hover { transform: translateX(3px); }
.post-card { transition: box-shadow .3s ease, border-color .3s ease, transform .3s ease; }
.post-card:hover { border-color: rgba(190, 150, 255, .3); box-shadow: 0 30px 80px rgba(0, 0, 0, .8), 0 0 60px -18px rgba(139, 92, 246, .45); }
.dash-tab { transition: color .2s ease, transform .2s ease; }
.dash-tab:hover { transform: translateY(-1px); }
.stat-card { transition: transform .28s cubic-bezier(.2, .8, .2, 1), border-color .28s ease, box-shadow .28s ease; }
.stat-card:hover { transform: translateY(-3px); border-color: rgba(190, 150, 255, .26); box-shadow: 0 18px 50px rgba(0, 0, 0, .4); }
.user-row { transition: background .2s ease, transform .2s ease, border-color .2s ease; }
.note-view-investigate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 29px;
  padding: 0 10px;
  color: #ebaebf;
  font: inherit;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
  border: 1px solid rgba(251, 113, 133, .28);
  border-radius: 8px;
  background: rgba(251, 113, 133, .1);
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.note-view-investigate svg { width: 13px; height: 13px; }
.note-view-investigate:hover { transform: translateY(-2px); border-color: rgba(251, 113, 133, .55); background: rgba(251, 113, 133, .18); box-shadow: 0 8px 22px rgba(251, 113, 133, .16); }
.note-view-investigate:active { transform: scale(.96); }
.toast { transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .3s ease; }
.note-comments { animation: commentSectionIn .5s .1s cubic-bezier(.2, .8, .2, 1) both; }
.layer:not([hidden]) .dash-shell,
.layer:not([hidden]) .profile-card,
.layer:not([hidden]) .chat-card,
.layer:not([hidden]) .ip-card,
.layer:not([hidden]) .password-card,
.layer:not([hidden]) .inv-shell { will-change: transform, opacity; }
.signal-row.is-clickable:hover .signal-title { color: #fff; }
.profile-avatar { cursor: pointer; }

@keyframes commentIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes commentSectionIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes invShellIn {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes nodeIn {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: none; }
}
@keyframes edgeDraw {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes tabGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(139, 92, 246, 0); }
  50% { box-shadow: 0 0 18px rgba(139, 92, 246, .18); }
}

/* ============================================================
   Investigation + comments responsive
   ============================================================ */

@media (max-width: 900px) {
  .inv-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(320px, 1fr); }
  .inv-paste {
    flex-flow: row wrap;
    align-items: center;
    max-height: none;
    padding: 12px 14px;
  }
  .inv-paste-label, .inv-paste h3, .inv-paste p { width: 100%; }
  .inv-paste-text, .inv-help { display: none; }
  .inv-paste .btn { flex: 1 1 130px; }
  .inv-head { flex-direction: column; align-items: flex-start; }
  .inv-tools { width: 100%; justify-content: flex-start; }
  .inv-status { display: none; }
}
@media (max-width: 620px) {
  .inv-shell { height: 96vh; border-radius: 16px; }
  .inv-head, .inv-publishbar, .inv-body { padding-left: 12px; padding-right: 12px; }
  .inv-body { padding: 10px; }
  .inv-close { position: absolute; top: 12px; right: 12px; }
  .inv-head { padding-right: 52px; }
  .inv-tool { min-height: 31px; padding: 0 9px; font-size: 10px; }
  .inv-sub { display: none; }
  .profile-preview { height: 148px; }
  .profile-preview-avatar { width: 64px; height: 64px; }
  .profile-preview-btn-avatar { left: 88px; }
  .note-view-controls { row-gap: 6px; }
  .comment-form-foot { flex-wrap: wrap; }
  .comment-form-foot .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .investigate-layer, .inv-shell, .inv-node, .inv-edge, .inv-chooser, .inv-chooser-card,
  .inv-chooser-row, .comment, .note-comments, .dash-tab.is-active {
    animation: none !important;
  }
  .inv-tool, .comment, .comment-delete, .comment-shot a, .comment-shot img,
  .inv-node, .inv-port, .inv-resize, .inv-chooser-row, .profile-preview-btn {
    transition: none !important;
  }
}

/* ============================================================
   ENTRANCE CHOREOGRAPHY
   ============================================================ */

.dashboard-layer:not([hidden]) .stat-card {
  animation: statRise .52s cubic-bezier(.2, .8, .2, 1) backwards;
}
.dashboard-layer:not([hidden]) .stat-card:nth-child(1) { animation-delay: .04s; }
.dashboard-layer:not([hidden]) .stat-card:nth-child(2) { animation-delay: .1s; }
.dashboard-layer:not([hidden]) .stat-card:nth-child(3) { animation-delay: .16s; }
.dashboard-layer:not([hidden]) .stat-card:nth-child(4) { animation-delay: .22s; }
.dashboard-layer:not([hidden]) .dash-card {
  animation: cardLift .52s cubic-bezier(.2, .8, .2, 1) backwards;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), border-color .28s ease, box-shadow .28s ease;
}
.dashboard-layer:not([hidden]) .dash-columns .dash-card:nth-child(1) { animation-delay: .14s; }
.dashboard-layer:not([hidden]) .dash-columns .dash-card:nth-child(2) { animation-delay: .2s; }
.dashboard-layer:not([hidden]) .dash-card:hover {
  transform: translateY(-2px);
  border-color: rgba(190, 150, 255, .2);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .3);
}
.dashboard-layer:not([hidden]) .dash-tabs { animation: chipRise .42s .1s cubic-bezier(.2, .8, .2, 1) backwards; }

.pastes-panel.is-open .paste-row { animation: pasteRowIn .42s cubic-bezier(.2, .8, .2, 1) both; }
.pastes-panel.is-open .paste-row:nth-child(1) { animation-delay: .03s; }
.pastes-panel.is-open .paste-row:nth-child(2) { animation-delay: .06s; }
.pastes-panel.is-open .paste-row:nth-child(3) { animation-delay: .09s; }
.pastes-panel.is-open .paste-row:nth-child(4) { animation-delay: .12s; }
.pastes-panel.is-open .paste-row:nth-child(5) { animation-delay: .15s; }
.pastes-panel.is-open .paste-row:nth-child(6) { animation-delay: .18s; }
.pastes-panel.is-open .paste-row:nth-child(7) { animation-delay: .21s; }
.pastes-panel.is-open .paste-row:nth-child(8) { animation-delay: .24s; }
.pastes-panel.is-open .paste-row:nth-child(n+9) { animation-delay: .27s; }

.tab-shell.is-open .tab-btn { animation: tabItemIn .32s cubic-bezier(.2, .8, .2, 1) backwards; }
.tab-shell.is-open .tab-btn:nth-of-type(1) { animation-delay: .04s; }
.tab-shell.is-open .tab-btn:nth-of-type(2) { animation-delay: .08s; }
.tab-shell.is-open .tab-btn:nth-of-type(3) { animation-delay: .12s; }
.tab-shell.is-open .tab-btn:nth-of-type(4) { animation-delay: .16s; }

.note-view-layer:not([hidden]) .note-view-meta { animation: noteFadeUp .45s .04s cubic-bezier(.2, .8, .2, 1) both; }
.note-view-layer:not([hidden]) #note-view-title { animation: noteTitleIn .6s .06s cubic-bezier(.2, .8, .2, 1) both; }
.note-view-layer:not([hidden]) .note-view-place { animation: noteFadeUp .45s .12s cubic-bezier(.2, .8, .2, 1) both; }
.note-view-layer:not([hidden]) .note-view-foot { animation: noteFadeUp .45s .18s cubic-bezier(.2, .8, .2, 1) both; }

.user-chip { transition: transform .26s cubic-bezier(.2, .8, .2, 1), border-color .26s ease; }
.user-chip:hover { transform: translateY(-1px); border-color: rgba(190, 150, 255, .3); }
.avatar-trigger .avatar { transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease; }
.avatar-trigger:hover .avatar { transform: scale(1.06) rotate(-3deg); }
.filter-chip { transition: transform .2s ease, color .2s ease, background .2s ease, border-color .2s ease; }
.filter-chip:hover { transform: translateY(-1px); }
.filter-chip.is-active { box-shadow: 0 0 18px rgba(139, 92, 246, .18); }
.tab-btn svg { transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.tab-btn:hover svg { transform: scale(1.12); }
.post-card-actions .btn { transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.post-card-actions .btn:hover { transform: translateY(-2px); }

@keyframes statRise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes cardLift {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes chipRise {
  from { opacity: 0; transform: translateY(6px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes tabItemIn {
  from { opacity: 0; transform: translateX(8px) scale(.94); }
  to { opacity: 1; transform: none; }
}
@keyframes noteFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes noteTitleIn {
  from { opacity: 0; transform: translateY(14px); letter-spacing: -.02em; }
  to { opacity: 1; transform: none; letter-spacing: -.045em; }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-layer:not([hidden]) .stat-card,
  .dashboard-layer:not([hidden]) .dash-card,
  .dashboard-layer:not([hidden]) .dash-tab,
  .pastes-panel.is-open .paste-row,
  .tab-shell.is-open .tab-btn,
  .note-view-layer:not([hidden]) .note-view-meta,
  .note-view-layer:not([hidden]) #note-view-title,
  .note-view-layer:not([hidden]) .note-view-place,
  .note-view-layer:not([hidden]) .note-view-foot {
    animation: none !important;
  }
  .user-chip, .avatar-trigger .avatar, .filter-chip, .tab-btn svg, .post-card-actions .btn,
  .dashboard-layer:not([hidden]) .dash-card { transition: none !important; }
}

/* ============================================================
   AMBIENT MOTION — aurora, HUD choreography, sheen
   ============================================================ */

.space::before {
  position: absolute;
  inset: -42vmax;
  background: conic-gradient(
    from 0deg,
    transparent 0 58%,
    rgba(139, 92, 246, .12) 70%,
    rgba(59, 130, 246, .07) 79%,
    transparent 90%
  );
  content: "";
  pointer-events: none;
  animation: auroraSpin 52s linear infinite;
}

.space::after {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(720px 520px at 50% 112%, rgba(139, 92, 246, .16), transparent 70%),
    radial-gradient(600px 420px at 92% 8%, rgba(59, 130, 246, .09), transparent 70%);
  content: "";
  pointer-events: none;
  animation: auroraPulse 17s ease-in-out infinite alternate;
}

.hud .brand { animation: hudDrop .85s cubic-bezier(.2, .8, .2, 1) .05s backwards; }
.tab-shell { animation: hudFade 1s .12s backwards, shellGlow 7.5s 1.4s ease-in-out infinite; }
.user-chip { animation: hudDrop .85s cubic-bezier(.2, .8, .2, 1) .2s backwards, chipGlow 7s ease-in-out infinite; }
.world-meta { animation: hudDrop .8s cubic-bezier(.2, .8, .2, 1) .3s backwards; }
.pastes-toggle { animation: hudFade 1.1s .4s backwards; }
.globe-caption { animation: hudFade 1.3s .5s backwards; }

.brand-mark {
  animation: markHalo 6.5s ease-in-out infinite;
}
.brand-mark img {
  animation: markFloat 9s ease-in-out infinite;
}

.user-chip:hover .avatar { transform: scale(1.07) rotate(-2deg); }

.toast.is-visible { animation: toastLift .4s cubic-bezier(.2, .9, .3, 1) both; }

.note-view-layer:not([hidden]) #note-view-title {
  background: linear-gradient(100deg, #fff 0%, #f0e7ff 34%, #fff 52%, #cbb0ff 76%, #fff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: noteTitleIn .6s .06s cubic-bezier(.2, .8, .2, 1) backwards, titleSheen 12s 1.2s ease-in-out infinite;
}

.profile-banner { position: relative; overflow: hidden; }
.profile-banner::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, transparent 34%, rgba(255, 255, 255, .16) 50%, transparent 66%);
  content: "";
  pointer-events: none;
  transform: translateX(-120%);
  animation: bannerSheen 11s 2s ease-in-out infinite;
}

.paste-row { position: relative; }
.paste-row::before {
  position: absolute;
  top: 16%;
  bottom: 16%;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, #e2ccff, #8b5cf6);
  content: "";
  opacity: 0;
  transform: scaleY(.25);
  transition: opacity .22s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.paste-row:hover::before { opacity: 1; transform: scaleY(1); }

.dash-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 156, 255, .6), transparent);
  content: "";
  transform: scaleX(0);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.dash-card:hover::before { transform: scaleX(1); }

.role-badge { position: relative; overflow: hidden; }
.role-badge::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
  content: "";
  pointer-events: none;
  transform: translateX(-130%);
  animation: badgeShine 7s 2.5s ease-in-out infinite;
}

.signal-row { will-change: transform; }
.btn:not(:disabled):active,
.icon-btn:active,
.filter-chip:active { transform: scale(.96); }

.post-card:not([hidden]) { animation: cardPop .4s cubic-bezier(.34, 1.36, .64, 1) backwards; }
.post-card { transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease, border-color .3s ease; }
.post-card:hover {
  transform: translateY(-3px);
  border-color: rgba(190, 150, 255, .34);
  box-shadow: 0 34px 90px rgba(0, 0, 0, .82), 0 0 70px -16px rgba(139, 92, 246, .5);
}

.dash-shell .dash-card { will-change: transform; }
.stat-card strong { transition: color .25s ease, text-shadow .25s ease; }
.stat-card:hover strong { color: #fff; text-shadow: 0 0 22px rgba(196, 156, 255, .45); }

.world-meta span[id] { transition: color .25s ease, text-shadow .3s ease; }
.is-bumped { animation: valueBump .7s cubic-bezier(.2, .8, .2, 1) both; }

.comment-form textarea:hover { border-color: rgba(190, 150, 255, .32); }
.inv-node.is-armed .inv-port { animation: portPulse 1.4s ease-in-out infinite; }
.inv-chooser-row:hover strong { color: #fff; }

@keyframes auroraSpin {
  to { transform: rotate(1turn); }
}
@keyframes auroraPulse {
  from { opacity: .35; }
  to { opacity: .8; }
}
@keyframes hudDrop {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: none; }
}
@keyframes hudFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes shellGlow {
  0%, 100% { box-shadow: 0 14px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06); }
  50% { box-shadow: 0 16px 48px rgba(0, 0, 0, .5), 0 0 38px rgba(139, 92, 246, .18), inset 0 1px 0 rgba(255, 255, 255, .08); }
}
@keyframes markHalo {
  0%, 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, .38), 0 0 0 rgba(139, 92, 246, 0); }
  50% { box-shadow: 0 10px 28px rgba(0, 0, 0, .42), 0 0 26px rgba(139, 92, 246, .32); }
}
@keyframes markFloat {
  0%, 100% { transform: scale(1) rotate(0); }
  50% { transform: scale(1.055) rotate(-1.4deg); }
}
@keyframes toastLift {
  from { opacity: 0; transform: translate(-50%, 16px) scale(.97); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes titleSheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes bannerSheen {
  0%, 62% { transform: translateX(-120%); }
  82%, 100% { transform: translateX(120%); }
}
@keyframes badgeShine {
  0%, 76% { transform: translateX(-130%); }
  92%, 100% { transform: translateX(130%); }
}
@keyframes valueBump {
  0% { opacity: .45; text-shadow: none; }
  45% { opacity: 1; color: #fff; text-shadow: 0 0 16px rgba(196, 156, 255, .8); }
  100% { opacity: 1; text-shadow: none; }
}
@keyframes portPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(196, 156, 255, .35), 0 0 10px rgba(139, 92, 246, .5); }
  50% { box-shadow: 0 0 0 5px rgba(139, 92, 246, .16), 0 0 22px rgba(196, 156, 255, .9); }
}

/* ============================================================
   MOBILE LAYOUT — bottom dock, sheets, mobile reader
   ============================================================ */

@media (max-width: 720px) {
  body { overscroll-behavior-y: none; }

  /* top bar */
  .hud {
    padding: calc(10px + env(safe-area-inset-top)) 12px 0;
    gap: 10px;
    align-items: flex-start;
  }
  .hud::before {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: -1;
    height: calc(92px + env(safe-area-inset-top));
    background: linear-gradient(180deg, rgba(4, 5, 13, .94), rgba(4, 5, 13, .55) 55%, transparent);
    content: "";
    pointer-events: none;
  }
  .brand { min-width: 0; gap: 0; }
  .brand-home { gap: 9px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .brand-text strong { font-size: 14px; letter-spacing: .17em; }
  .brand-sub { display: none; }

  .user-chip {
    position: fixed;
    top: calc(11px + env(safe-area-inset-top));
    right: 12px;
    margin: 0;
    padding: 4px;
    gap: 2px;
  }
  .avatar-trigger { width: 38px; height: 38px; }
  .user-chip .signout { width: 34px; height: 34px; }

  /* bottom navigation dock */
  .tab-shell {
    position: fixed;
    top: auto;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
    height: 66px;
    padding: 7px 8px;
    border-radius: 22px;
    background: rgba(8, 10, 22, .9);
    box-shadow: 0 18px 46px rgba(0, 0, 0, .62), 0 0 38px rgba(139, 92, 246, .12), inset 0 1px 0 rgba(255, 255, 255, .06);
    transform: none;
    animation: hudFade .8s .1s backwards;
    backface-visibility: hidden;
  }
  .tab-arrow { display: none; }
  .tab-items,
  .tab-shell.is-open .tab-items {
    width: 100% !important;
    opacity: 1 !important;
    overflow: visible;
    transform: none !important;
    justify-content: space-around;
    gap: 3px;
    transition: none;
  }
  .tab-sep { display: none; }
  .tab-btn {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    width: auto;
    height: 52px;
    gap: 3px;
    border-radius: 15px;
    color: rgba(244, 241, 255, .68);
  }
  .tab-btn svg { width: 21px; height: 21px; opacity: 1; }
  .tab-tracker svg { width: 23px; height: 23px; }
  .tab-btn::after {
    position: static;
    display: block;
    padding: 0;
    margin: 0;
    color: inherit;
    font-family: var(--font);
    font-size: 8.5px;
    font-weight: 650;
    letter-spacing: .04em;
    white-space: nowrap;
    background: none;
    border: 0;
    opacity: 1;
    transform: none;
  }
  .tab-btn:hover::after { transform: none; }
  .tab-btn:active { transform: scale(.93); background: rgba(139, 92, 246, .16); }

  /* globe chrome */
  .pastes-toggle {
    top: auto;
    bottom: calc(92px + env(safe-area-inset-bottom));
    left: 12px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 14px;
    transform: none;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .42);
    animation: hudFade .9s .35s backwards;
  }
  .pastes-toggle:hover { width: 44px; transform: translateY(-2px); }
  body.pastes-open .pastes-toggle { transform: none; opacity: 0; pointer-events: none; }
  .world-meta {
    right: auto;
    bottom: calc(100px + env(safe-area-inset-bottom));
    left: 66px;
    padding: 7px 11px;
    font-size: 9.5px;
  }
  .globe-hint, .globe-caption { display: none; }

  .pastes-panel {
    width: 100%;
    padding-top: calc(26px + env(safe-area-inset-top));
    padding-bottom: env(safe-area-inset-bottom);
  }
  .pastes-list { padding-bottom: 96px; }

  /* paste card = bottom sheet above the dock */
  .post-card {
    top: auto !important;
    right: 10px;
    bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    left: 10px !important;
    width: auto;
    max-height: 60vh;
    padding: 18px;
    border-radius: 20px;
  }
  .toast {
    bottom: calc(154px + env(safe-area-inset-bottom));
    max-width: calc(100% - 24px);
  }

  /* note reader */
  .note-view-card {
    width: 100%;
    padding: calc(22px + env(safe-area-inset-top)) 18px calc(40px + env(safe-area-inset-bottom));
  }
  .note-view-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 16px;
  }
  .note-view-controls { width: 100%; flex-wrap: wrap; gap: 6px; }
  .note-view-controls .note-view-close { margin-left: auto; }
  .note-view-meta { margin-top: 22px; }
  #note-view-title { font-size: clamp(31px, 9.4vw, 46px); margin: 10px 0 12px; }
  .note-view-place { margin-bottom: 22px; }
  .note-view-body { padding-top: 22px; font-size: 16px; line-height: 1.68; }
  .note-comments { margin-top: 36px; padding-top: 22px; }
  .comment { padding: 12px; }
  .comment-shot figcaption { font-size: 9px; }

  /* full-screen profile / chat / IP sheets */
  .profile-layer, .chat-layer, .ip-layer {
    place-items: stretch;
    padding: 0;
  }
  .profile-card, .chat-card, .ip-card {
    width: 100%;
    max-height: none;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .profile-card {
    padding: 0 16px calc(26px + env(safe-area-inset-bottom));
  }
  .profile-banner {
    height: 176px;
    margin-right: -16px;
    margin-left: -16px;
    border-radius: 0 0 20px 20px;
  }
  .profile-heading { gap: 11px; margin-top: -38px; }
  .profile-avatar { width: 76px; height: 76px; font-size: 25px; }
  .profile-close {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
    z-index: 6;
    background: rgba(5, 6, 15, .58);
    backdrop-filter: blur(10px);
  }
  .profile-preview { height: 158px; }
  .password-layer { place-items: center; padding: 16px; }
  .password-card {
    width: 100%;
    min-height: 0;
    max-height: calc(100dvh - 32px);
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 20px;
    padding: 22px;
  }

  .chat-card {
    height: 100dvh;
    padding: calc(16px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
    border-radius: 0;
  }
  .chat-messages { gap: 8px; }
  .chat-message { max-width: 88%; }

  .ip-card {
    padding: calc(20px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
  }
  .ip-card .dash-head {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
  .ip-card .dash-head h2 { text-align: left; }
  .ip-results { grid-template-columns: 1fr; }

  /* dashboard = full-height sheet */
  .dashboard-layer { padding: 0; }
  .dash-shell {
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    padding: calc(18px + env(safe-area-inset-top)) 14px calc(28px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
  }
  .dash-head { gap: 12px; padding-bottom: 16px; }
  .dash-head h2 { font-size: 29px; }
  .dash-head-actions { width: 100%; justify-content: space-between; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
  .stat-card { padding: 12px; border-radius: 14px; }
  .stat-card strong { font-size: 25px; }
  .dash-columns { gap: 12px; }
  .dash-card { border-radius: 16px; }
  .dash-tabs {
    flex-wrap: nowrap;
    gap: 6px;
    margin: 18px 0 12px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .dash-tabs::-webkit-scrollbar { display: none; }
  .dash-tab { flex: 0 0 auto; }
  .user-list { max-height: 46vh; }
  .dash-card-head { gap: 10px; }
  .user-search input { width: min(180px, 46vw); }
  .dash-foot { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* investigation board */
  .investigate-layer { padding: 0; }
  .inv-shell {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  .inv-head {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
    padding: calc(14px + env(safe-area-inset-top)) 12px 10px;
  }
  .inv-head-main { padding-right: 42px; }
  .inv-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; width: 32px; height: 32px; }
  .inv-tools {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 5px;
    padding: 2px 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .inv-tools::-webkit-scrollbar { display: none; }
  .inv-tool { flex: 0 0 auto; min-height: 31px; padding: 0 8px; gap: 4px; font-size: 9.5px; }
  .inv-tool svg { width: 13px; height: 13px; }
  .inv-publishbar { padding: 8px 12px; }
  .inv-body { gap: 8px; padding: 10px; grid-template-rows: auto minmax(240px, 1fr); }
  .inv-board { min-height: 240px; border-radius: 12px; }
  .inv-paste {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 6px;
    padding: 12px;
    border-radius: 12px;
  }
  .inv-paste-label, .inv-paste h3, .inv-paste p, .inv-paste-text, .inv-help { grid-column: 1 / -1; }
  .inv-paste .btn { min-height: 32px; padding: 0 7px; font-size: 9.5px; }
  .inv-status { display: none; }

  /* compose */
  .compose-panel { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .compose-inner h2 { text-wrap: balance; }
}

@media (max-width: 390px) {
  .brand-text strong { font-size: 13px; letter-spacing: .14em; }
  .brand-mark { width: 32px; height: 32px; }
  .avatar-trigger { width: 34px; height: 34px; }
  .user-chip .signout { width: 30px; height: 30px; }
  .tab-btn::after { font-size: 8px; }
  .note-export, .note-view-fullscreen { min-height: 27px; padding: 0 7px; font-size: 8px; }
  .note-view-investigate { min-height: 27px; padding: 0 8px; font-size: 8px; }
  .stat-card strong { font-size: 23px; }
  .profile-title h2 { font-size: 23px; }
}

@media (max-width: 340px) {
  .tab-btn::after { content: none; }
  .tab-btn { height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .space::before, .space::after,
  .hud .brand, .tab-shell, .user-chip, .world-meta, .pastes-toggle,
  .globe-caption, .brand-mark, .brand-mark img, .toast.is-visible,
  .note-view-layer:not([hidden]) #note-view-title, .profile-banner::after,
  .role-badge::after, .post-card:not([hidden]), .is-bumped,
  .inv-node.is-armed .inv-port {
    animation: none !important;
  }
  .paste-row::before, .dash-card::before, .post-card,
  .stat-card strong, .world-meta span[id] { transition: none !important; }
}

/* ============================================================
   MOTION 2.0 — tactile buttons, mobile sheet choreography
   ============================================================ */

.btn,
.icon-btn,
.inv-tool,
.filter-chip,
.note-export,
.note-view-fullscreen,
.note-view-investigate,
.tab-btn,
.comment,
.ip-result {
  transition:
    transform .2s cubic-bezier(.2, .8, .2, 1),
    color .2s ease,
    border-color .2s ease,
    background-color .2s ease,
    box-shadow .25s ease;
}

.btn {
  position: relative;
  overflow: hidden;
}
.btn::after {
  position: absolute;
  inset: -1px;
  background: linear-gradient(108deg, transparent 32%, rgba(255, 255, 255, .34) 50%, transparent 68%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateX(-140%) skewX(-12deg);
}
.btn.primary::after,
.btn.accent::after {
  animation: btnSheen 6.4s 1.2s ease-in-out infinite;
}
.btn:not(:disabled):hover::after { animation: btnSheen 1.05s ease-out; }
.btn:not(:disabled):hover { transform: translateY(-2px); }
.btn.primary:not(:disabled):hover {
  box-shadow: 0 14px 34px rgba(89, 39, 190, .42), 0 0 24px rgba(139, 92, 246, .22);
}
.btn:not(:disabled):active { transform: translateY(0) scale(.965); }
.icon-btn svg { transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.icon-btn:hover svg { transform: rotate(-6deg) scale(1.08); }
.icon-btn:active { transform: scale(.92); }
.inv-tool:hover svg { transform: scale(1.12) rotate(-4deg); }
.note-view-controls > *:hover,
.note-view-investigate:hover,
.note-view-fullscreen:hover { transform: translateY(-1px); }

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .14), 0 0 22px rgba(139, 92, 246, .1);
}

.chat-message { animation: none; }
.chat-message.is-incoming { animation: chatInLeft .32s cubic-bezier(.2, .8, .2, 1) backwards; }
.chat-message.is-incoming.is-mine { animation-name: chatInRight; }

.note-view-layer:not([hidden]) .note-view-controls > * {
  animation: softPop .4s cubic-bezier(.2, .8, .2, 1) backwards;
}
.note-view-layer:not([hidden]) .note-view-controls > *:nth-child(1) { animation-delay: .04s; }
.note-view-layer:not([hidden]) .note-view-controls > *:nth-child(2) { animation-delay: .07s; }
.note-view-layer:not([hidden]) .note-view-controls > *:nth-child(3) { animation-delay: .1s; }
.note-view-layer:not([hidden]) .note-view-controls > *:nth-child(4) { animation-delay: .13s; }
.note-view-layer:not([hidden]) .note-view-controls > *:nth-child(5) { animation-delay: .16s; }
.note-view-layer:not([hidden]) .note-view-controls > *:nth-child(6) { animation-delay: .19s; }

.profile-layer:not([hidden]) .profile-heading,
.profile-layer:not([hidden]) .profile-bio,
.profile-layer:not([hidden]) .profile-actions,
.profile-layer:not([hidden]) .profile-edit-form:not([hidden]) {
  animation: softPop .44s cubic-bezier(.2, .8, .2, 1) backwards;
}
.profile-layer:not([hidden]) .profile-heading { animation-delay: .04s; }
.profile-layer:not([hidden]) .profile-bio { animation-delay: .09s; }
.profile-layer:not([hidden]) .profile-actions { animation-delay: .14s; }
.profile-layer:not([hidden]) .profile-edit-form:not([hidden]) { animation-delay: .02s; }

.dashboard-layer:not([hidden]) .dash-foot { animation: softPop .45s .24s cubic-bezier(.2, .8, .2, 1) backwards; }
.investigate-layer:not([hidden]) .inv-head-main,
.investigate-layer:not([hidden]) .inv-publishbar,
.investigate-layer:not([hidden]) .inv-paste,
.investigate-layer:not([hidden]) .inv-stage {
  animation: softPop .46s cubic-bezier(.2, .8, .2, 1) backwards;
}
.investigate-layer:not([hidden]) .inv-head-main { animation-delay: .03s; }
.investigate-layer:not([hidden]) .inv-publishbar { animation-delay: .08s; }
.investigate-layer:not([hidden]) .inv-paste { animation-delay: .13s; }
.investigate-layer:not([hidden]) .inv-stage { animation-delay: .18s; }

.ip-layer:not([hidden]) .dash-head,
.ip-layer:not([hidden]) .ip-disclaimer,
.ip-layer:not([hidden]) .ip-search {
  animation: softPop .4s cubic-bezier(.2, .8, .2, 1) backwards;
}
.ip-layer:not([hidden]) .dash-head { animation-delay: .03s; }
.ip-layer:not([hidden]) .ip-disclaimer { animation-delay: .08s; }
.ip-layer:not([hidden]) .ip-search { animation-delay: .13s; }
.ip-layer:not([hidden]) .ip-result:nth-child(1) { animation-delay: .02s; }
.ip-layer:not([hidden]) .ip-result:nth-child(2) { animation-delay: .05s; }
.ip-layer:not([hidden]) .ip-result:nth-child(3) { animation-delay: .08s; }
.ip-layer:not([hidden]) .ip-result:nth-child(4) { animation-delay: .11s; }
.ip-layer:not([hidden]) .ip-result:nth-child(5) { animation-delay: .14s; }
.ip-layer:not([hidden]) .ip-result:nth-child(6) { animation-delay: .17s; }

/* Mobile-only sheet motion. Desktop keeps its compact modal entrances. */
@media (max-width: 720px) {
  .dashboard-layer:not([hidden]) .dash-shell,
  .profile-layer:not([hidden]) .profile-card,
  .chat-layer:not([hidden]) .chat-card,
  .ip-layer:not([hidden]) .ip-card,
  .note-view-layer:not([hidden]) .note-view-card,
  .investigate-layer:not([hidden]) .inv-shell {
    animation: sheetRise .48s cubic-bezier(.16, 1, .3, 1) both;
  }
  .profile-layer:not([hidden]) .profile-banner { animation: softPop .5s cubic-bezier(.2, .8, .2, 1) backwards; }
  .profile-layer:not([hidden]) .profile-edit-form:not([hidden]) .profile-preview,
  .profile-layer:not([hidden]) .profile-edit-form:not([hidden]) .profile-field,
  .profile-layer:not([hidden]) .profile-edit-form:not([hidden]) .profile-note,
  .profile-layer:not([hidden]) .profile-edit-form:not([hidden]) .profile-actions {
    animation: fieldIn .38s cubic-bezier(.2, .8, .2, 1) backwards;
  }
  .profile-layer:not([hidden]) .profile-edit-form:not([hidden]) .profile-field:nth-of-type(1) { animation-delay: .05s; }
  .profile-layer:not([hidden]) .profile-edit-form:not([hidden]) .profile-field:nth-of-type(2) { animation-delay: .09s; }
  .dashboard-layer:not([hidden]) .dash-tabs { animation: chipRise .42s .08s cubic-bezier(.2, .8, .2, 1) backwards; }
  .investigate-layer:not([hidden]) .inv-tools { animation: softPop .42s .07s cubic-bezier(.2, .8, .2, 1) backwards; }
}

@keyframes btnSheen {
  0%, 55% { opacity: 0; transform: translateX(-140%) skewX(-12deg); }
  63% { opacity: .8; }
  88%, 100% { opacity: 0; transform: translateX(140%) skewX(-12deg); }
}
@keyframes sheetRise {
  from { opacity: 0; transform: translateY(30px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes softPop {
  from { opacity: 0; transform: translateY(9px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes fieldIn {
  from { opacity: 0; transform: translateX(-7px); }
  to { opacity: 1; transform: none; }
}
@keyframes chatInLeft {
  from { opacity: 0; transform: translateX(-10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes chatInRight {
  from { opacity: 0; transform: translateX(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .btn::after,
  .note-view-layer:not([hidden]) .note-view-controls > *,
  .profile-layer:not([hidden]) .profile-heading,
  .profile-layer:not([hidden]) .profile-bio,
  .profile-layer:not([hidden]) .profile-actions,
  .profile-layer:not([hidden]) .profile-edit-form:not([hidden]),
  .dashboard-layer:not([hidden]) .dash-foot,
  .investigate-layer:not([hidden]) .inv-head-main,
  .investigate-layer:not([hidden]) .inv-publishbar,
  .investigate-layer:not([hidden]) .inv-paste,
  .investigate-layer:not([hidden]) .inv-stage,
  .ip-layer:not([hidden]) .dash-head,
  .ip-layer:not([hidden]) .ip-disclaimer,
  .ip-layer:not([hidden]) .ip-search,
  .chat-message.is-incoming,
  .dashboard-layer:not([hidden]) .dash-shell,
  .profile-layer:not([hidden]) .profile-card,
  .chat-layer:not([hidden]) .chat-card,
  .ip-layer:not([hidden]) .ip-card,
  .note-view-layer:not([hidden]) .note-view-card,
  .investigate-layer:not([hidden]) .inv-shell {
    animation: none !important;
  }
}

/* ============================================================
   HUD BUTTON FADE-IN — dashboard, compose, TR, side drawer, profile
   ============================================================ */

body.is-authed .tab-shell {
  animation: navFade .62s .04s cubic-bezier(.2, .8, .2, 1) backwards, shellGlow 7.5s 1.4s ease-in-out infinite;
}
body.is-authed .pastes-toggle {
  animation: navFade .52s .32s cubic-bezier(.2, .8, .2, 1) backwards;
}
body.is-authed .user-chip {
  animation: navFade .56s .26s cubic-bezier(.2, .8, .2, 1) backwards, chipGlow 7s ease-in-out infinite;
}
body.is-authed .avatar-trigger {
  animation: avatarFadeIn .6s .34s cubic-bezier(.16, 1, .3, 1) backwards;
}
body.is-authed .tab-btn {
  animation: navBtnIn .5s cubic-bezier(.16, 1, .3, 1) backwards;
}
body.is-authed .tab-btn:nth-of-type(1) { animation-delay: .12s; }
body.is-authed .tab-btn:nth-of-type(2) { animation-delay: .19s; }
body.is-authed .tab-btn:nth-of-type(3) { animation-delay: .26s; }
body.is-authed .tab-btn:nth-of-type(4) { animation-delay: .33s; }

.tab-shell.is-open .tab-btn {
  animation: navBtnIn .4s cubic-bezier(.16, 1, .3, 1) backwards;
}
.tab-shell.is-open .tab-btn:nth-of-type(1) { animation-delay: .04s; }
.tab-shell.is-open .tab-btn:nth-of-type(2) { animation-delay: .1s; }
.tab-shell.is-open .tab-btn:nth-of-type(3) { animation-delay: .16s; }
.tab-shell.is-open .tab-btn:nth-of-type(4) { animation-delay: .22s; }

.tab-btn svg {
  opacity: .9;
  transition: opacity .22s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
}
.tab-btn:hover svg,
.tab-btn:focus-visible svg {
  opacity: 1;
  transform: translateY(-1px) scale(1.08);
}
.tab-btn::before {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, .34), transparent 68%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.tab-btn:hover::before,
.tab-btn:focus-visible::before { opacity: 1; }

.pastes-toggle svg {
  opacity: .9;
  transition: opacity .22s ease, transform .25s ease;
}
.pastes-toggle:hover svg,
.pastes-toggle:focus-visible svg { opacity: 1; }

.avatar-trigger .avatar {
  transition: opacity .22s ease, transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease;
}
.user-chip:hover .avatar,
.avatar-trigger:focus-visible .avatar { opacity: 1; }

body.is-authed .user-name,
body.is-authed .user-chip .signout {
  animation: navFade .45s .42s cubic-bezier(.2, .8, .2, 1) backwards;
}

@keyframes navFade {
  from { opacity: 0; filter: blur(4px); }
  to { opacity: 1; filter: none; }
}
@keyframes navBtnIn {
  from { opacity: 0; transform: translateY(-7px) scale(.86); }
  to { opacity: 1; transform: none; }
}
@keyframes avatarFadeIn {
  from { opacity: 0; transform: scale(.78) rotate(-6deg); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.is-authed .tab-shell,
  body.is-authed .pastes-toggle,
  body.is-authed .user-chip,
  body.is-authed .avatar-trigger,
  body.is-authed .tab-btn,
  .tab-shell.is-open .tab-btn,
  body.is-authed .user-name,
  body.is-authed .user-chip .signout {
    animation: none !important;
  }
}
