:root {
  --bg0: #0f1328;
  --bg1: #171c38;
  --bg2: #252d55;
  --stroke: rgba(150, 168, 255, 0.14);
  --text: rgba(238, 242, 255, 0.96);
  --muted: rgba(191, 201, 232, 0.76);
  --faint: rgba(157, 169, 207, 0.54);
  --chip: rgba(255, 255, 255, 0.06);
  --panel: rgba(27, 34, 63, 0.76);
  --panel-strong: rgba(31, 39, 73, 0.92);
  --hot: #f5f3c2;
  --blue: #8db2ff;
  --pink: #a2b5ff;
  --wine: #39457f;
  --rose: #d6ddff;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Courier New", monospace;
  --sans: "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", sans-serif;
  --display: "SF Pro Display", "PingFang SC", "HarmonyOS Sans SC", "Segoe UI", sans-serif;
  --app-shell-max-width: 460px;
  --app-shell-inline-padding: 14px;
  --app-shell-viewport-width: 100vw;
  --app-shell-fixed-width: min(calc(var(--app-shell-viewport-width) - (var(--app-shell-inline-padding) * 2)), var(--app-shell-max-width));
  --app-shell-nav-left: 50%;
  --app-shell-nav-width: var(--app-shell-fixed-width);
  --app-shell-nav-top: auto;
  --app-shell-nav-bottom: max(10px, calc(env(safe-area-inset-bottom) + 4px));
  --app-shell-nav-translate-x: -50%;
  --app-shell-nav-height: 82px;
  --detail-content-max-width: 1080px;
  --settings-shell-max-width: var(--app-shell-fixed-width);
  --chat-shell-max-width: 100%;
  --chat-overlay-max-width: var(--app-shell-fixed-width);
  --chat-bg-width: var(--app-shell-fixed-width);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --panel-highlight: rgba(255, 255, 255, 0.08);
  --shadow-panel: 0 18px 42px rgba(5, 9, 25, 0.28);
  --shadow-float: 0 14px 30px rgba(5, 9, 25, 0.24);
}

@supports (width: 100dvw) {
  :root {
    --app-shell-viewport-width: 100dvw;
  }
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  background-color: var(--bg0);
}
body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(920px 560px at 10% 8%, rgba(141, 178, 255, 0.22), transparent 56%),
    radial-gradient(760px 420px at 86% 10%, rgba(245, 243, 194, 0.08), transparent 58%),
    radial-gradient(760px 460px at 50% 100%, rgba(95, 113, 194, 0.18), transparent 62%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 48%, #0b1023 100%);
}

.bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.aura {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(720px 420px at 14% 24%, rgba(134, 170, 255, 0.12), transparent 68%),
    radial-gradient(760px 460px at 82% 64%, rgba(245, 243, 194, 0.08), transparent 72%),
    radial-gradient(640px 360px at 50% 18%, rgba(93, 111, 191, 0.16), transparent 62%);
  filter: blur(18px);
  transform: rotate(-5deg);
}
.grain {
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.16;
}

.app {
  width: 100%;
  max-width: var(--app-shell-max-width);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 var(--app-shell-inline-padding);
  position: relative;
  overflow-x: hidden;
  overflow-x: clip;
}
@supports (height: 100dvh) {
  .app {
    min-height: 100dvh;
  }
}
.content { padding-bottom: calc(var(--app-shell-nav-height) + 20px + env(safe-area-inset-bottom)); }
.page { padding-top: 6px; }
.routeLoadingPage {
  min-height: min(58vh, 520px);
  display: grid;
  place-items: center;
}
.routeLoadingPanel {
  display: inline-grid;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}
.routeLoadingSpinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(238, 242, 255, 0.18);
  border-top-color: rgba(245, 243, 194, 0.82);
  border-radius: 50%;
  animation: routeLoadingSpin 780ms linear infinite;
}
.routeLoadingText {
  line-height: 1.35;
}
@keyframes routeLoadingSpin {
  to { transform: rotate(360deg); }
}
.routeChromeLess .content { padding-bottom: 0; }
.routeChromeLess .page { padding-top: 0; }
.routeChromeLess .bottomNav { display: none; }

html.chatRoomViewportLock,
body.chatRoomViewportLock {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

@media (max-width: 640px) {
  .app[data-route="chat-room"] {
    --app-shell-max-width: 100%;
    --app-shell-inline-padding: 0px;
    --chat-shell-max-width: 100%;
    --chat-bg-width: 100%;
  }
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid rgba(141, 178, 255, 0.68);
  outline-offset: 2px;
}
button,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  -webkit-appearance: none;
  appearance: none;
  transition:
    transform 140ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}
button:active { transform: translateY(1px); }

.bottomNav {
  position: fixed;
  left: var(--app-shell-nav-left);
  transform: translateX(var(--app-shell-nav-translate-x));
  top: var(--app-shell-nav-top);
  bottom: var(--app-shell-nav-bottom);
  width: var(--app-shell-nav-width);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 7px calc(6px + env(safe-area-inset-bottom));
  border: 1px solid rgba(150, 168, 255, 0.16);
  border-radius: 24px;
  background:
    radial-gradient(320px 180px at 50% 0%, rgba(141, 178, 255, 0.12), transparent 72%),
    linear-gradient(180deg, rgba(24, 31, 57, 0.84), rgba(13, 18, 36, 0.96));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 44px rgba(5, 9, 25, 0.38);
  touch-action: manipulation;
  z-index: 80;
}
.bn {
  color: var(--faint);
  text-decoration: none;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 5px 0 4px;
  min-height: 44px;
  border-radius: 16px;
  touch-action: manipulation;
}
.bn .ico {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 13px;
}
.bn .txt { font-weight: 850; font-size: 10.5px; letter-spacing: 0.02em; }
.bn.active { color: var(--hot); }
.bn.active .ico {
  background: linear-gradient(180deg, rgba(245, 243, 194, 0.22), rgba(141, 178, 255, 0.12));
  box-shadow:
    inset 0 0 0 1px rgba(245, 243, 194, 0.14),
    0 8px 18px rgba(14, 21, 48, 0.26);
}
.bn.active .txt { text-shadow: 0 0 16px rgba(245, 243, 194, 0.16); }

@media (min-width: 820px) {
  .bottomNav {
    left: 50%;
    top: auto;
    bottom: 18px;
    width: min(600px, calc(var(--app-shell-viewport-width) - 48px));
    transform: translateX(-50%);
    padding: 8px 10px;
    border-radius: 30px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .bn {
    padding: 7px 0 6px;
  }

  .bn .ico {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .bn .txt {
    font-size: 12px;
  }

  .content {
    padding-bottom: calc(var(--app-shell-nav-height) + 28px);
  }
}

.topBar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px 12px; }
.tbLeft {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  font-family: var(--display);
  font-weight: 760;
  font-size: 20px;
  letter-spacing: 0.012em;
}
.tbRight { display: flex; gap: 10px; align-items: center; }
.iconBtn {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(150, 168, 255, 0.20);
  background:
    radial-gradient(80px 60px at 50% 0%, rgba(141, 178, 255, 0.18), transparent 70%),
    linear-gradient(180deg, rgba(37, 46, 84, 0.96), rgba(20, 26, 50, 0.98));
  color: rgba(238, 242, 255, 0.92);
  width: 40px;
  height: 40px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 10px 22px rgba(6, 10, 24, 0.24);
}
.iconBtn:hover,
.iconBtn:focus-visible {
  border-color: rgba(141, 178, 255, 0.28);
  background:
    radial-gradient(80px 60px at 50% 0%, rgba(141, 178, 255, 0.22), transparent 72%),
    linear-gradient(180deg, rgba(49, 60, 105, 0.98), rgba(24, 31, 59, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 12px 24px rgba(6, 10, 24, 0.28);
}

.tokenPill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,240,236,0.16);
  background: rgba(255,244,240,0.08);
  font-weight: 800;
}

.empty {
  padding: 36px 14px 28px;
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--muted);
}
.emptyRich {
  min-height: clamp(420px, calc(100vh - 180px), 680px);
  align-content: center;
  padding: clamp(28px, 8vh, 76px) 0 40px;
}
.emptyPanel {
  position: relative;
  width: min(100%, 436px);
  display: grid;
  gap: 16px;
  padding: 22px 18px 18px;
  border-radius: 28px;
  border: 1px solid rgba(150, 168, 255, 0.16);
  background:
    radial-gradient(240px 140px at 50% 0%, rgba(141, 178, 255, 0.14), transparent 72%),
    linear-gradient(180deg, rgba(31, 39, 73, 0.94), rgba(17, 22, 43, 0.98));
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}
.emptyPanelGlow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(220px 120px at 12% 0%, rgba(141, 178, 255, 0.12), transparent 72%),
    radial-gradient(220px 140px at 88% 0%, rgba(245, 243, 194, 0.08), transparent 74%);
  opacity: 0.9;
}
.emptyHead {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}
.emptyEyebrow {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(150, 168, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--faint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.emptyIcon {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  border: 1px solid rgba(255,240,236,0.20);
  background:
    radial-gradient(120px 80px at 50% 0%, rgba(243,162,183,0.18), transparent 72%),
    linear-gradient(180deg, rgba(255,244,240,0.08), rgba(255,244,240,0.04));
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 24px;
  opacity: 0.88;
  box-shadow: var(--shadow-float);
}
.emptyRich .emptyIcon {
  width: 64px;
  height: 64px;
  border-radius: 22px;
  font-size: 28px;
}
.emptyTitle {
  font-family: var(--display);
  font-weight: 760;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.emptySub {
  color: var(--muted);
  max-width: 340px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.6;
}
.emptyFeatureGrid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.emptyFeatureGrid > .emptyFeature:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
.emptyFeature {
  min-height: 86px;
  padding: 12px 12px 10px;
  border-radius: 18px;
  border: 1px solid rgba(150, 168, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.04);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.emptyFeatureTitle {
  color: rgba(245, 248, 255, 0.96);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}
.emptyFeatureSub {
  margin-top: 6px;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.55;
}
.emptyActions {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  gap: 10px;
}
.empty-login .emptyPanel {
  gap: 14px;
}
.empty-login .emptySub {
  max-width: 320px;
}
.empty-login .emptyFeatureGrid {
  gap: 8px;
}
.empty-login .emptyFeature {
  min-height: 80px;
  padding: 11px 12px 10px;
  box-shadow: none;
}
.empty-login .emptyFeatureSub {
  line-height: 1.48;
}
.empty-login .emptyActions {
  margin-top: 2px;
}
.empty-layout-workbench.emptyRich,
.empty-layout-account.emptyRich,
.empty-layout-settings.emptyRich,
.empty-layout-story.emptyRich {
  align-content: start;
  padding-top: clamp(18px, 6vh, 56px);
}
.empty-layout-workbench .emptyPanel {
  width: min(100%, 540px);
}
.empty-layout-account .emptyPanel {
  width: min(100%, 520px);
}
.empty-layout-account .emptyActions,
.empty-layout-story .emptyActions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.empty-layout-settings .emptyPanel {
  width: min(100%, 500px);
}
.empty-layout-story .emptyPanel {
  width: min(100%, 560px);
}
.empty-layout-settings .emptyFeatureGrid,
.empty-layout-story .emptyFeatureGrid {
  grid-template-columns: 1fr;
}
.empty-layout-settings .emptyFeature,
.empty-layout-story .emptyFeature {
  min-height: auto;
}
.empty-layout-story .emptyHead {
  justify-items: start;
  text-align: left;
}
.empty-layout-story .emptySub,
.empty-layout-story .emptyFoot {
  max-width: none;
  text-align: left;
}
.empty-layout-story .emptyIcon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
}
.btnPrimary {
  margin-top: 4px;
  -webkit-appearance: none;
  appearance: none;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 15px;
  padding: 0 18px;
  font-weight: 900;
  border: 1px solid rgba(141, 178, 255, 0.32);
  background:
    radial-gradient(180px 80px at 50% 0%, rgba(245, 243, 194, 0.14), transparent 72%),
    linear-gradient(180deg, rgba(141, 178, 255, 0.28), rgba(57, 69, 127, 0.36));
  color: rgba(245, 248, 255, 0.96);
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(18, 25, 53, 0.26);
}
.btnGhost {
  -webkit-appearance: none;
  appearance: none;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 15px;
  padding: 0 18px;
  border: 1px solid rgba(150, 168, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(31, 39, 73, 0.52);
  color: rgba(238, 242, 255, 0.92);
  font-weight: 850;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 20px rgba(6, 10, 24, 0.16);
}
.btnPrimary:hover { transform: translateY(-1px); }
.btnGhost:hover { transform: translateY(-1px); }
.emptyFoot {
  position: relative;
  z-index: 1;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.6;
  text-align: left;
}
@media (min-width: 900px) {
  .empty-layout-workbench .emptyPanel {
    width: min(100%, 620px);
  }

  .empty-layout-account .emptyPanel {
    width: min(100%, 580px);
  }

  .empty-layout-settings .emptyPanel {
    width: min(100%, 560px);
  }

  .empty-layout-story .emptyPanel {
    width: min(100%, 640px);
  }
}
@media (max-width: 420px) {
  .emptyRich {
    padding-bottom: calc(164px + env(safe-area-inset-bottom));
  }

  .empty-login.emptyRich {
    padding-bottom: calc(188px + env(safe-area-inset-bottom));
  }

  .emptyPanel {
    gap: 14px;
    padding: 20px 16px 16px;
    border-radius: 24px;
  }

  .empty-login .emptyPanel {
    gap: 12px;
    margin-bottom: 12px;
  }

  .emptyHead {
    gap: 10px;
  }

  .emptyFeature {
    min-height: 74px;
    padding: 10px 11px 9px;
  }

  .emptyFeatureSub {
    font-size: 11px;
  }

  .empty-login .emptyFeature {
    min-height: 68px;
    padding: 9px 10px 8px;
  }

  .emptyActions {
    gap: 8px;
  }

  .btnPrimary,
  .btnGhost {
    min-height: 40px;
  }

  .empty-login .btnGhost {
    display: none;
  }

  .empty-layout-account .emptyActions,
  .empty-layout-story .emptyActions {
    grid-template-columns: 1fr;
  }

  .empty-layout-story.empty-login .btnGhost {
    display: inline-flex;
  }

  .emptyFoot {
    display: none;
  }
}
.toast {
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid rgba(150, 168, 255, 0.14);
  background: linear-gradient(180deg, rgba(35, 42, 77, 0.90), rgba(21, 27, 53, 0.92));
  padding: 14px;
  box-shadow: 0 16px 38px rgba(8, 11, 28, 0.28);
}
.toastTitle {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
}
.toastSub { color: var(--muted); margin-top: 6px; line-height: 1.55; }
.toastLink { display: inline-block; margin-top: 10px; color: rgba(255, 236, 214, 0.92); }

.menuOverlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 23, 0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 120;
}
.menuOverlay.open { opacity: 1; pointer-events: auto; }
.menuPanel {
  position: absolute;
  right: 12px;
  top: 12px;
  width: min(360px, calc(100% - 24px));
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  border-radius: 24px;
  border: 1px solid rgba(150, 168, 255, 0.16);
  background:
    radial-gradient(280px 180px at 0% 0%, rgba(141, 178, 255, 0.12), transparent 72%),
    linear-gradient(180deg, rgba(30, 38, 70, 0.98), rgba(17, 22, 43, 0.98));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 14px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  box-shadow: 0 24px 50px rgba(4, 8, 24, 0.34);
}
.menuHead { display: flex; align-items: center; justify-content: space-between; }
.menuTitle {
  font-family: var(--display);
  font-weight: 760;
  font-size: 19px;
}
.menuSection {
  margin-top: 16px;
  color: var(--faint);
  font-weight: 900;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.menuItem {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 13px;
  border-radius: 18px;
  text-decoration: none;
  color: rgba(238, 242, 255, 0.90);
  border: 1px solid rgba(150, 168, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03)),
    rgba(255,255,255,0.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.menuItem:hover {
  background:
    linear-gradient(180deg, rgba(141, 178, 255, 0.10), rgba(255,255,255,0.04)),
    rgba(255,255,255,0.05);
  transform: translateY(-1px);
}
.miDot { opacity: 0.85; }
.miLabel { font-weight: 900; }
.miArrow { margin-left: auto; color: var(--faint); font-size: 18px; }

@media (max-width: 560px) {
  .menuPanel {
    right: 8px;
    top: max(8px, calc(env(safe-area-inset-top) + 4px));
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
}

.detailPage {
  max-width: var(--detail-content-max-width);
  margin: 0 auto;
  padding-bottom: 36px;
}
.dHead { padding: 2px 2px 8px; }
.dAuthor { display: flex; align-items: center; gap: 10px; }
.dAva {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,240,236,0.14);
  background: rgba(255,244,240,0.06);
  display: grid;
  place-items: center;
  font-weight: 900;
  position: relative;
  overflow: hidden;
}
.dAvaImg { width: 100%; height: 100%; object-fit: cover; border-radius: 999px; }
.dAvaFallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.dAuthorName { font-weight: 900; }
.dTitle {
  margin-top: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.14;
}
.dSub { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dUpdated { color: var(--muted); font-weight: 800; }
.dPills { display: flex; gap: 10px; align-items: center; }
.dHeat, .dTokens {
  border: 1px solid rgba(255,240,236,0.12);
  background: rgba(255,244,240,0.07);
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 12px;
}
.dMiniRow { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 2px 10px; }
.dTag {
  border: 1px solid rgba(255,240,236,0.10);
  background: rgba(255,244,240,0.05);
  border-radius: 999px;
  padding: 7px 11px;
  font-weight: 900;
  color: rgba(255,246,242,0.86);
  font-size: 12px;
}
.dTabs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; padding: 4px 0 6px; }
.dTab {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 11px 0;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
}
.dTab.active { color: var(--text); border-bottom: 2px solid rgba(243, 162, 183, 0.62); }
.dTabContent { padding: 8px 2px 2px; }
.dOpenerComposite {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dOpener { color: rgba(255,246,242,0.84); line-height: 1.72; white-space: pre-wrap; }
.dOpener.sandbox { white-space: normal; }
.dOpener.sandbox .richSandbox {
  min-height: 132px;
  border-radius: 18px;
  border: 1px solid rgba(255,240,236,0.10);
  background: rgba(255,244,240,0.05);
}
.dOpener.sandbox.richLayout-immersive {
  overflow: visible;
}
.dOpener.sandbox.richLayout-immersive .richSandbox {
  border: 0;
  border-radius: 24px;
  background: transparent;
  box-shadow: none;
}
.dOpener.sandbox.richLayout-immersive .richSandbox::before,
.dOpener.sandbox.richLayout-immersive .richSandbox::after {
  display: none;
}
.dDescPlain {
  color: rgba(255,246,242,0.84);
  line-height: 1.72;
  white-space: pre-wrap;
}
.dRich {
  border-radius: 18px;
  border: 1px solid rgba(255,240,236,0.10);
  background: rgba(255,244,240,0.05);
  padding: 14px;
  overflow: auto;
  color: rgba(255,246,242,0.88);
}
.dRich img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}
.dRich table {
  width: 100%;
  border-collapse: collapse;
}
.dRich td, .dRich th {
  border: 1px solid rgba(255,240,236,0.10);
  padding: 8px;
}
.dRich.richTone-light,
.dOpener.richTone-light {
  color: #17141a;
}
.dRich.richTone-light a,
.dOpener.richTone-light a {
  color: #ab4966;
}
.dRich.richTone-dark,
.dOpener.richTone-dark {
  color: rgba(255,246,242,0.88);
}
.dRich [data-compat-part="block"],
.dOpener [data-compat-part="block"] {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid rgba(255,240,236,0.10);
  background:
    radial-gradient(180px 100px at 12% 0%, rgba(243, 162, 183, 0.10), transparent 74%),
    rgba(255,244,240,0.04);
}
.dRich [data-compat-part="head"],
.dOpener [data-compat-part="head"] {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.dRich [data-compat-part="kicker"],
.dOpener [data-compat-part="kicker"] {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(243, 162, 183, 0.28);
  background: rgba(243, 162, 183, 0.10);
  color: rgba(255, 223, 230, 0.94);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.dRich.richTone-light [data-compat-part="kicker"],
.dOpener.richTone-light [data-compat-part="kicker"] {
  color: #ab4966;
}
.dRich [data-compat-part="label"],
.dOpener [data-compat-part="label"] {
  font-size: 15px;
  font-weight: 900;
}
.dRich [data-compat-part="body"],
.dOpener [data-compat-part="body"] {
  display: grid;
  gap: 10px;
}
.dRich [data-compat-part="body"] p,
.dOpener [data-compat-part="body"] p {
  margin: 0;
}
.dMedia {
  margin-top: 6px;
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255,240,236,0.12);
  background: rgba(255,244,240,0.05);
}
.dMediaBg {
  position: absolute;
  inset: 0;
  filter: blur(18px);
  opacity: 0.55;
  background: radial-gradient(240px 160px at 40% 40%, rgba(255,255,255,0.10), transparent 60%);
}
.dMediaMain { position: relative; padding: 14px; display: grid; place-items: center; min-height: 228px; }
.dImg { max-width: 100%; max-height: 320px; border-radius: 18px; box-shadow: 0 18px 42px rgba(12, 4, 9, 0.36); }
.dImgPh { color: var(--muted); font-weight: 900; }
.dFull { position: absolute; right: 12px; top: 12px; }
.dDesc { padding: 12px 2px 8px; color: rgba(255,246,242,0.84); line-height: 1.72; font-size: 14px; }
.dLeadCard {
  margin: 12px 0 4px;
  display: grid;
  gap: 10px;
  padding: 15px 14px;
  border-radius: 22px;
  border: 1px solid rgba(150, 168, 255, 0.12);
  background:
    radial-gradient(200px 120px at 0% 0%, rgba(141, 178, 255, 0.12), transparent 72%),
    linear-gradient(180deg, rgba(28, 35, 65, 0.94), rgba(16, 21, 42, 0.96));
  box-shadow: 0 16px 34px rgba(7, 10, 24, 0.24);
}
.dLeadEyebrow {
  color: rgba(245, 243, 194, 0.82);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dLeadTitle {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.16;
}
.dLeadSub {
  color: rgba(191, 201, 232, 0.76);
  font-size: 13px;
  line-height: 1.6;
}
.dLeadQuote {
  color: rgba(238, 242, 255, 0.88);
  font-size: 14px;
  line-height: 1.62;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(150, 168, 255, 0.08);
  background: rgba(255,255,255,0.03);
}
.dLeadActions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.dChatBtnLead {
  min-height: 48px;
}
.dLeadSecondary {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(150, 168, 255, 0.14);
  background: rgba(255,255,255,0.04);
  color: rgba(238, 242, 255, 0.92);
  border-radius: 16px;
  padding: 0 14px;
  min-height: 48px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}
.dBottom {
  position: static;
  left: auto;
  transform: none;
  bottom: auto;
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 14px 2px 0;
  border-top: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: auto;
}
.dActions { display: flex; gap: 10px; }
.dBottomInfo {
  margin-top: 12px;
  padding: 16px 14px;
  border-radius: 20px;
  border: 1px solid rgba(150, 168, 255, 0.10);
  background: rgba(255,255,255,0.03);
}
.dBottomTitle {
  font-size: 14px;
  font-weight: 900;
  color: rgba(245, 248, 255, 0.96);
}
.dAct {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(255,240,236,0.12);
  background: rgba(255,244,240,0.05);
  color: rgba(255,246,242,0.86);
  border-radius: 14px;
  padding: 10px 11px;
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
  flex: 1;
}
.dBottomHint {
  color: rgba(191, 201, 232, 0.68);
  font-size: 12px;
  line-height: 1.55;
  padding: 0 2px;
}
.dChatBtn {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(243, 162, 183, 0.34);
  background: linear-gradient(180deg, rgba(243, 162, 183, 0.96), rgba(179, 92, 122, 0.84));
  color: white;
  border-radius: 18px;
  padding: 14px 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(127, 65, 88, 0.22);
  width: 100%;
}

@media (max-width: 380px) {
  .app { padding: 0 10px; }
  .logo { font-size: 22px; }
  .dTitle { font-size: 30px; }
  .dLeadActions { grid-template-columns: 1fr; }
}

@media (min-width: 900px) {
  .app[data-route="chat"] {
    --app-shell-max-width: 980px;
    --app-shell-inline-padding: 18px;
  }

  .app[data-route="create"] {
    --app-shell-max-width: 1040px;
    --app-shell-inline-padding: 18px;
  }

  .app[data-route="me"] {
    --app-shell-max-width: 920px;
    --app-shell-inline-padding: 18px;
  }

  .app[data-route="discover"] {
    --app-shell-max-width: 1240px;
    --app-shell-inline-padding: 18px;
  }

  .app[data-route="detail"] {
    --app-shell-max-width: 1180px;
    --app-shell-inline-padding: 18px;
  }

  .app[data-route="chat-room"] {
    --app-shell-max-width: 1280px;
    --app-shell-inline-padding: 18px;
    --chat-shell-max-width: 1040px;
    --chat-overlay-max-width: 760px;
    --chat-bg-width: 100%;
  }

  .app[data-route="settings"] {
    --app-shell-max-width: 960px;
    --app-shell-inline-padding: 18px;
    --settings-shell-max-width: 720px;
  }

  .detailPage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    grid-template-areas:
      "head media"
      "chips media"
      "tabs media"
      "content media";
    column-gap: 28px;
    align-items: start;
  }

  .detailPage > .dHead { grid-area: head; }
  .detailPage > .dMiniRow { grid-area: chips; }
  .detailPage > .dTabs { grid-area: tabs; }
  .detailPage > .dTabContent { grid-area: content; }
  .detailPage > .dMedia {
    grid-area: media;
    margin-top: 6px;
    position: sticky;
    top: 84px;
  }

  .dTabContent {
    min-width: 0;
    padding-right: 12px;
  }
}
