
/* --- Desktop (restored from feature/desktop-from-old) --- */
:root {
  color-scheme: light;
  --ink: #111a36;
  --muted: #69728a;
  --line: #edf0fa;
  --blue: #4452ff;
  --violet: #7a3cff;
  --teal: #20c8ad;
  --orange: #ff7b3c;
  --paper: #ffffff;
  --soft: #f8faff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  scrollbar-gutter: stable;
}

/* Product navigation: utility header on desktop, native-style bottom navigation on mobile. */
.header-icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(205, 216, 236, 0.86);
  border-radius: 13px;
  color: #66718a;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 #fff, 0 8px 20px rgba(24, 36, 78, 0.06);
}

.header-icon-button svg,
.mobile-bottom-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-icon-button:hover,
.header-icon-button.active {
  color: #3157ff;
  border-color: rgba(49, 87, 255, 0.28);
  background: rgba(49, 87, 255, 0.08);
}

.wallet-status-dot {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 6px;
  height: 6px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #a8b1c3;
}

.wallet-button.connected .wallet-status-dot {
  background: #13b895;
  box-shadow: 0 0 0 3px rgba(19, 184, 149, 0.12);
}

.mobile-bottom-nav {
  display: none;
}

.markets-header {
  align-items: end;
}

.arc-faucet-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(49, 87, 255, 0.2);
  border-radius: 12px;
  color: #3157ff;
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.portfolio-surface {
  width: min(760px, 100%);
  margin: 46px auto 0;
}

.portfolio-surface header span,
.portfolio-wallet-state span {
  color: #3157ff;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.portfolio-surface h1 {
  margin: 8px 0 6px;
}

.portfolio-surface header p,
.portfolio-wallet-state small {
  color: #748099;
  font-weight: 650;
}

.portfolio-wallet-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding: 24px;
  border: 1px solid rgba(205, 216, 236, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 18px 42px rgba(24, 36, 78, 0.08);
}

.portfolio-wallet-state div {
  display: grid;
  gap: 7px;
}

.portfolio-wallet-state strong {
  color: #071226;
  font-size: 1.8rem;
}

.portfolio-wallet-state button:not(.copy-address-btn) {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #3157ff;
  font-weight: 800;
}

.portfolio-section-tabs {
  display: flex;
  gap: 10px;
  margin: 22px 0 14px;
}

.portfolio-section-tabs span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(196, 210, 235, 0.86);
  border-radius: 999px;
  color: #586780;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 850;
}

.portfolio-position-section {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.portfolio-position-section > h2 {
  margin: 0;
  color: #101b31;
  font-size: 1rem;
}

.portfolio-position-card,
.portfolio-empty {
  border: 1px solid rgba(205, 216, 236, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 42px rgba(24, 36, 78, 0.08);
}

.portfolio-position-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.portfolio-position-top,
.portfolio-position-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.portfolio-position-top > span:last-child,
.portfolio-position-footer {
  color: #73819b;
  font-size: 0.78rem;
  font-weight: 800;
}

.portfolio-position-card h2 {
  margin: 0;
  color: #081326;
  font-size: clamp(1.05rem, 2.3vw, 1.35rem);
  line-height: 1.16;
}

.portfolio-position-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(209, 220, 239, 0.82);
  border-radius: 14px;
}

.portfolio-position-stats div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-right: 1px solid rgba(209, 220, 239, 0.82);
}

.portfolio-position-stats div:last-child {
  border-right: 0;
}

.portfolio-position-stats span {
  color: #79869b;
  font-size: 0.68rem;
  font-weight: 820;
}

.portfolio-position-stats strong {
  color: #0f1b31;
  font-size: 0.95rem;
}

.portfolio-empty {
  padding: 22px;
  color: #697891;
  font-weight: 750;
  line-height: 1.45;
}

.portfolio-empty.compact {
  padding: 16px;
  box-shadow: none;
}

@media (max-width: 640px) {
  body {
    padding-bottom: 78px;
  }

  .site-header {
    display: flex !important;
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    min-height: 58px;
    margin: 10px 10px 0 !important;
    padding: 9px 10px !important;
    justify-content: space-between;
  }

  .site-header .brand-lockup {
    gap: 8px !important;
  }

  .site-header .brand-lockup span {
    display: inline !important;
    color: #071226;
    font-size: 1rem;
    font-weight: 850;
  }

  .site-header .top-compact-controls {
    display: flex;
    width: auto;
    gap: 6px !important;
  }

  .site-header .desktop-header-nav {
    display: none !important;
  }

  .site-header .archive-pill,
  .site-header .wallet-button {
    display: inline-grid !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    border-radius: 12px !important;
  }

  .site-header .archive-pill svg,
  .site-header .wallet-button svg {
    width: 18px;
    height: 18px;
  }

  .category-tabs {
    top: 78px;
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 80;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 62px;
    padding: 6px;
    border: 1px solid rgba(205, 216, 236, 0.86);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 50px rgba(20, 31, 66, 0.18);
    backdrop-filter: blur(22px) saturate(1.15);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
  }

  .mobile-bottom-nav button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    min-width: 0;
    padding: 4px 2px;
    border: 0;
    border-radius: 13px;
    color: #7a849a;
    background: transparent;
  }

  .mobile-bottom-nav button span {
    font-size: 0.64rem;
    font-weight: 800;
  }

  .mobile-bottom-nav button.active {
    color: #3157ff;
    background: rgba(49, 87, 255, 0.09);
  }

  .mobile-bottom-nav svg {
    width: 19px;
    height: 19px;
  }

  .markets-header {
    display: flex;
    align-items: end;
    gap: 12px;
    padding-inline: 18px;
  }

  .markets-header h1 {
    font-size: 2.8rem;
  }

  .arc-faucet-button {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 0.68rem;
  }

  .portfolio-surface {
    margin: 28px 18px 0;
    width: calc(100% - 36px);
  }

  .portfolio-surface h1 {
    font-size: 2.8rem;
  }

  .portfolio-wallet-state {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .portfolio-position-stats {
    grid-template-columns: 1fr;
  }

  .portfolio-position-stats div {
    border-right: 0;
    border-bottom: 1px solid rgba(209, 220, 239, 0.82);
  }

  .portfolio-position-stats div:last-child {
    border-bottom: 0;
  }
}

body {
  margin: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior-y: none;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

button {
  font: inherit;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: clamp(22px, 4vw, 48px);
}

.brief-board {
  position: relative;
  width: min(900px, 100%);
  min-height: calc(100vh - clamp(44px, 8vw, 96px));
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto 42px 32px;
  gap: 18px;
  align-items: center;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-lockup img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(16, 26, 55, 0.14));
}

.brand-lockup span {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 850;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.top-actions button,
.menu-panel button {
  height: 38px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  padding: 0 12px;
  font-weight: 750;
}

.top-actions button:hover,
.menu-panel button:hover {
  color: var(--blue);
  background: var(--soft);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  place-content: center;
  gap: 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.menu-button:hover {
  background: var(--soft);
}

.menu-button span {
  display: block;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.menu-button span:nth-child(2) {
  width: 11px;
}

.profile-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 12px 24px rgba(68, 82, 255, 0.28);
}

.top-saved,
.top-markets,
.top-portfolio {
  height: 38px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-weight: 800;
}

.menu-panel {
  position: absolute;
  top: 78px;
  right: 88px;
  z-index: 10;
  display: grid;
  width: 190px;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 45px rgba(30, 42, 92, 0.14);
}

.menu-panel[hidden] {
  display: none;
}

.story-list[hidden],
.story-detail[hidden] {
  display: none !important;
}

.menu-panel button {
  text-align: left;
}

.brief-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-top: clamp(42px, 7vw, 78px);
}

.headline-row {
  width: 100%;
  max-width: 760px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.date-label {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 650;
}

.menu-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 800;
}

.hero-badge {
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 18px;
  border: 1px solid rgba(237, 240, 250, 0.94);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(30, 42, 92, 0.06);
}

.hero-badge span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-badge strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.category-tabs {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  gap: 18px;
  margin: 36px -2px 26px;
  padding: 10px 0;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  scrollbar-width: none;
}

body.detail-mode .brief-hero,
body.detail-mode .category-tabs,
body.detail-mode .archive-controls,
body.detail-mode .top-actions,
body.detail-mode .top-saved,
body.detail-mode .top-markets,
body.detail-mode .top-portfolio,
body.detail-mode .menu-button,
body.detail-mode .profile-dot {
  display: none;
}

.archive-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 28px 0 4px;
}

/* Desktop header compact controls (Archive pill + Saved) */
.top-compact-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.top-compact-controls .top-saved,
.top-compact-controls .top-markets,
.top-compact-controls .top-portfolio,
.top-compact-controls .wallet-button,
.top-compact-controls .archive-pill {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), var(--soft));
  color: var(--muted);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(23,34,72,0.04);
}

.top-compact-controls .archive-pill:hover,
.top-compact-controls .top-markets:hover,
.top-compact-controls .top-portfolio:hover {
  border-color: rgba(68,82,255,0.14);
  color: var(--blue);
}

.archive-controls label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.archive-controls select,
.archive-controls button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.archive-controls select {
  min-width: 150px;
  padding: 0 36px 0 12px;
}

.archive-controls button {
  padding: 0 13px;
}

.archive-controls button:hover {
  color: var(--blue);
  border-color: rgba(68, 82, 255, 0.28);
  background: var(--soft);
}

#archiveStatus {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

body.detail-mode .site-header {
  position: fixed;
  z-index: 80;
  top: 22px;
  left: clamp(22px, 4vw, 48px);
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex: 0 0 auto;
  min-width: 42px;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 750;
}

.category-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 10px 22px rgba(68, 82, 255, 0.24);
}

.story-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: min(760px, 100%);
}

.story-card {
  display: grid;
  gap: 16px;
  min-height: 0;
  padding: 18px 18px 16px;
  border: 1px solid rgba(237, 240, 250, 0.96);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 16px 38px rgba(30, 42, 92, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.story-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(30, 42, 92, 0.1);
}

.story-card {
  cursor: pointer;
}

.story-image-frame {
  display: block;
  width: 100%;
  height: clamp(190px, 34vw, 320px);
  overflow: hidden;
  border-radius: 16px;
  background: var(--soft);
}

.story-image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.story-card:hover .story-image-frame img {
  transform: scale(1.025);
}

.story-topline,
.story-source {
  display: flex;
  align-items: center;
}

.wallet-button {
  white-space: nowrap;
}

.mobile-menu-button,
.mobile-menu-panel {
  display: none;
}

.story-topline {
  justify-content: space-between;
  gap: 14px;
}

.story-card-actions {
  position: relative;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.story-source > div {
  display: grid;
  gap: 3px;
}

.story-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.story-icon span {
  position: relative;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 5px;
  box-shadow: none;
}

.story-icon span::before,
.story-icon span::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
}

.story-icon span::before {
  left: 50%;
  top: -7px;
  bottom: -7px;
  width: 3px;
  transform: translateX(-50%);
}

.story-icon span::after {
  top: 50%;
  left: -7px;
  right: -7px;
  height: 3px;
  transform: translateY(-50%);
}

.story-icon.blue {
  background: linear-gradient(135deg, #3f49ff, #6e38ff);
}

.story-icon.orange {
  background: linear-gradient(135deg, #ff7b3c, #ff4c3c);
}

.story-icon.teal {
  background: linear-gradient(135deg, #16c2a7, #49d98e);
}

.story-icon.violet {
  background: linear-gradient(135deg, #8a42ff, #5e39e8);
}

.story-icon.slate {
  background: linear-gradient(135deg, #eef1f8, #dce2ef);
}

.story-icon.slate span {
  border-color: #aeb7c8;
}

.story-icon.slate span::before,
.story-icon.slate span::after {
  background: #aeb7c8;
}

.story-copy {
  min-width: 0;
}

.story-copy h2 {
  margin: 10px 0 0;
  font-size: clamp(1.24rem, 3vw, 1.7rem);
  line-height: 1.28;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.story-copy p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(68, 82, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 850;
}

.category-chip.Crypto {
  color: var(--violet);
  background: rgba(122, 60, 255, 0.08);
}

.category-chip.Sports {
  color: var(--teal);
  background: rgba(32, 200, 173, 0.1);
}

.category-chip.Anime {
  color: var(--violet);
  background: rgba(122, 60, 255, 0.08);
}

.category-chip.Tech {
  color: #3f5f86;
  background: rgba(63, 95, 134, 0.1);
}

.source-button,
.back-button,
.card-source-button {
  border: 0;
  text-decoration: none;
}

.source-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-size: 0.84rem;
  font-weight: 850;
}

.card-action-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.card-source-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-size: 0.84rem;
  font-weight: 850;
}

.back-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px 0 12px;
  border: 1px solid rgba(224, 230, 246, 0.8);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(23, 34, 72, 0.05);
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease, color 140ms ease;
  margin-bottom: 24px;
}

.back-button:hover {
  color: var(--blue);
  background: #fff;
  border-color: rgba(68, 82, 255, 0.2);
  box-shadow: 0 6px 22px rgba(68, 82, 255, 0.12);
  transform: translateY(-1px);
}

.back-button:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.8);
}

.story-detail {
  width: min(760px, 100%);
}

/* Fullscreen detail overlay used when opening AI summary as a dedicated page */
.story-detail.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(22px, 4vw, 48px);
  padding-top: 96px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  overflow: auto;
  box-shadow: none;
}

.detail-container {
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.story-detail.fullscreen .detail-card {
  width: 100%;
}

.detail-card {
  display: grid;
  gap: 18px;
  padding-bottom: 38px;
}

.detail-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.detail-card h2 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.detail-image {
  width: 100%;
  max-height: 470px;
  object-fit: cover;
  border-radius: 22px;
  background: var(--soft);
  box-shadow: 0 18px 44px rgba(30, 42, 92, 0.08);
}

.detail-summary {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.detail-summary strong {
  font-size: 0.86rem;
}

.detail-summary p {
  margin: 0;
  color: #26314d;
  font-family: "Comic Relief", system-ui, "Comic Sans MS", "Comic Neue", "Chalkboard SE", cursive;
  font-size: clamp(1.05rem, 2.3vw, 1.24rem);
  font-weight: 700;
  line-height: 1.62;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

.source-button {
  justify-self: start;
}

.save-button,
.bookmark-button,
.export-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(210, 220, 239, 0.84);
  border-radius: 14px;
  color: #6f7b93;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 255, 0.68)),
    rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 10px 22px rgba(24, 36, 78, 0.075);
  backdrop-filter: blur(14px) saturate(1.12);
  -webkit-backdrop-filter: blur(14px) saturate(1.12);
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 120ms ease;
}

.save-button:hover,
.bookmark-button:hover,
.export-button:hover {
  color: #4452ff;
  border-color: rgba(68, 82, 255, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 255, 0.84)),
    rgba(255, 255, 255, 0.84);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 14px 30px rgba(68, 82, 255, 0.13);
  transform: translateY(-1px);
}

.bookmark-button:focus-visible,
.export-button:focus-visible {
  outline: 3px solid rgba(68, 82, 255, 0.18);
  outline-offset: 3px;
}

.action-icon {
  display: block;
  width: 18px;
  height: 18px;
  vector-effect: non-scaling-stroke;
}

.save-button span,
.bookmark-button span {
  position: absolute;
  inset: 8px 8px;
  border: 2px solid #aab2c5;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.save-button span::after,
.bookmark-button span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 10px;
  height: 10px;
  border-left: 2px solid #aab2c5;
  border-bottom: 2px solid #aab2c5;
  background: #fff;
  transform: translateX(-50%) rotate(-45deg);
}

.save-button.saved span,
.save-button.saved span::after,
.bookmark-button[aria-pressed="true"] span,
.bookmark-button[aria-pressed="true"] span::after {
  border-color: var(--blue);
}

.bookmark-button[aria-pressed="true"] {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #4452ff 0%, #8d49ff 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 14px 28px rgba(68, 82, 255, 0.22);
}

.bookmark-button[aria-pressed="true"] .action-icon {
  fill: currentColor;
  stroke-width: 1.7;
}

.share-control {
  position: relative;
  z-index: 4;
}

.export-button {
  color: #6c55e8;
}

.export-button span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 14px;
  height: 20px;
  border: 2px solid #9fa9bf;
  border-top: 0;
  border-radius: 0 0 4px 4px;
  transform: translateX(-50%);
}

.export-button span::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 11px;
  height: 11px;
  border-right: 2px solid #9fa9bf;
  border-bottom: 2px solid #9fa9bf;
  transform: translateX(-50%) rotate(45deg);
}

.export-button span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 2px;
  height: 16px;
  border-radius: 999px;
  background: #9fa9bf;
  transform: translateX(-50%);
}

.export-button:hover span,
.export-button:hover span::before {
  border-color: var(--blue);
}

.export-button:hover span::after {
  background: var(--blue);
}

.share-menu {
  position: absolute;
  top: 43px;
  right: 0;
  display: grid;
  width: 138px;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(224, 230, 244, 0.94);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(23, 34, 72, 0.14);
}

.share-menu[hidden] {
  display: none;
}

.share-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: left;
}

.share-menu button:hover {
  color: var(--blue);
  background: var(--soft);
}

.action-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(320px, calc(100vw - 32px));
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid rgba(224, 230, 246, 0.92);
  border-radius: 999px;
  color: #071229;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(23, 34, 72, 0.18);
  font-size: 0.88rem;
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

.empty-state {
  grid-column: 1 / -1;
  padding: 34px 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  .app-shell {
    padding: 22px;
  }

  .brief-board {
    min-height: calc(100vh - 44px);
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) 42px 32px;
  }

  .top-actions {
    display: none;
  }

  .menu-button {
    display: grid;
  }

  .menu-panel {
    top: 74px;
    right: 70px;
  }

  .brief-hero {
    align-items: start;
    flex-direction: column;
    margin-top: 46px;
  }

  .hero-badge {
    width: 100%;
  }

}

@media (max-width: 520px) {
  .brand-lockup span {
    display: none;
  }

  h1 {
    font-size: 3.2rem;
  }

  .category-tabs {
    gap: 12px;
  }

  .story-card {
    padding: 14px;
  }

  .story-icon {
    width: 42px;
    height: 42px;
  }
}

/* Visual refresh */
:root {
  --ink: #071229;
  --muted: #657089;
  --line: #e7ecf6;
  --blue: #4257ff;
  --violet: #6f3cff;
  --teal: #23c9a7;
  --paper: #ffffff;
  --soft: #f4f7ff;
  --shadow-sm: 0 10px 28px rgba(23, 34, 72, 0.06);
  --shadow-md: 0 18px 46px rgba(23, 34, 72, 0.1);
  --shadow-lg: 0 28px 80px rgba(23, 34, 72, 0.14);
}

html {
  background: #f7f9fd;
}

body {
  background:
    radial-gradient(circle at 50% -10%, rgba(68, 82, 255, 0.08), transparent 34rem),
    linear-gradient(180deg, #fbfcff 0%, #f4f7fb 100%);
}

.app-shell {
  padding: clamp(18px, 3.4vw, 44px);
}

.brief-board {
  width: min(900px, 100%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: 10px 0 14px;
  background: linear-gradient(180deg, rgba(251, 252, 255, 0.96), rgba(251, 252, 255, 0.76));
  backdrop-filter: blur(18px);
}

.brand-lockup {
  gap: 10px;
}

.brand-lockup img {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #fff;
  filter: drop-shadow(0 12px 22px rgba(7, 18, 41, 0.12));
}

.brand-lockup span {
  font-size: 1.18rem;
  letter-spacing: 0;
}

.top-saved,
.menu-button {
  height: 42px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.top-saved {
  padding: 0 16px;
  background: linear-gradient(135deg, #4357ff, #7040ff);
}

.brief-hero {
  align-items: end;
  margin-top: clamp(34px, 6vw, 62px);
  padding-bottom: 4px;
}

h1 {
  max-width: 760px;
  font-size: clamp(3.15rem, 8vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.date-label {
  color: #6a7489;
  font-size: 0.98rem;
}

.archive-controls {
  gap: 9px;
  margin: 26px 0 6px;
  padding: 10px;
  border: 1px solid rgba(231, 236, 246, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}

.archive-controls select,
.archive-controls button {
  min-height: 40px;
  border-color: rgba(209, 217, 235, 0.8);
  border-radius: 13px;
  box-shadow: inset 0 -1px 0 rgba(7, 18, 41, 0.03);
}

.archive-controls select:focus,
.archive-controls button:focus-visible,
.category-tab:focus-visible,
.story-card:focus-visible,
.card-source-button:focus-visible,
.source-button:focus-visible {
  outline: 3px solid rgba(68, 82, 255, 0.16);
  outline-offset: 2px;
}

.category-tabs {
  top: 66px;
  gap: 10px;
  margin: 18px -4px 18px;
  padding: 10px 4px;
  background: rgba(247, 249, 253, 0.86);
}

.category-tab {
  height: 40px;
  min-width: 52px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.category-tab:hover {
  color: var(--ink);
  border-color: rgba(209, 217, 235, 0.72);
  background: #fff;
}

.category-tab.active {
  box-shadow: 0 12px 26px rgba(68, 82, 255, 0.22);
}

.story-list {
  width: min(720px, 100%);
  margin: 0 auto;
  gap: 18px;
}

.story-card {
  position: relative;
  gap: 15px;
  padding: clamp(15px, 3vw, 20px);
  border-color: rgba(224, 230, 244, 0.88);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.story-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), transparent 34%);
}

.story-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.story-image-frame {
  height: clamp(220px, 38vw, 345px);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.story-image-frame img {
  filter: saturate(1.06) contrast(1.02);
}

.story-topline,
.story-copy,
.card-action-row {
  position: relative;
  z-index: 1;
}

.story-source strong {
  color: #071229;
  font-size: 0.96rem;
}

.story-source span {
  color: #7a8497;
}

.story-icon {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  box-shadow: 0 10px 22px rgba(23, 34, 72, 0.12);
}

.story-copy h2 {
  margin-top: 12px;
  color: #06122f;
  font-size: clamp(1.32rem, 3.4vw, 1.82rem);
  line-height: 1.22;
}

.story-copy p {
  color: #748099;
}

.category-chip {
  min-height: 30px;
  border: 1px solid rgba(68, 82, 255, 0.08);
  font-size: 0.76rem;
}

.card-source-button,
.source-button {
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(68, 82, 255, 0.22);
}

.save-button,
.export-button {
  border-radius: 13px;
}

.story-detail.fullscreen {
  background:
    radial-gradient(circle at 50% -12%, rgba(68, 82, 255, 0.08), transparent 34rem),
    linear-gradient(180deg, #fbfcff 0%, #f4f7fb 100%);
}

.story-detail.fullscreen .detail-card,
.story-detail.fullscreen .back-button {
  width: min(800px, 100%);
}

.detail-card {
  gap: 20px;
}

.detail-card h2 {
  color: #06122f;
  font-size: clamp(2.15rem, 6vw, 4.35rem);
}

.detail-image {
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.detail-summary {
  gap: 10px;
  padding: clamp(18px, 3vw, 24px);
  border-color: rgba(224, 230, 244, 0.92);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
}

.detail-summary strong {
  color: #071229;
}

.detail-summary p {
  color: #23304a;
}

/* Final UI tuning */
.app-shell {
  padding-top: clamp(14px, 2.4vw, 28px);
}

.brief-board {
  width: min(900px, 100%);
}

.site-header {
  padding: 6px 0 10px;
}

.brief-hero {
  width: min(760px, 100%);
  margin: clamp(18px, 3.6vw, 38px) auto 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(3.35rem, 7vw, 5.7rem);
  line-height: 0.98;
}

.archive-controls {
  width: min(760px, 100%);
  margin: 22px auto 0;
  padding: 9px 10px;
  border-radius: 18px;
}

.archive-controls label {
  padding-left: 0;
  color: #5f6b84;
}

.archive-controls select {
  min-width: 150px;
}

#archiveStatus {
  margin-left: 2px;
}

.category-tabs {
  width: min(760px, 100%);
  margin: 16px auto 18px;
  padding: 8px 0;
  background: transparent;
}

.category-tab {
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 8px 20px rgba(23, 34, 72, 0.045);
}

.detail-summary p {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 650;
}

.detail-summary.Crypto p {
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.04rem, 2.1vw, 1.2rem);
  font-weight: 600;
  line-height: 1.64;
}

/* Mobile-only refinements to match mock (≤ 640px) */
@media (max-width: 640px) {
  /* Ensure mobile-only blocks are visible */
  .mobile-only { display: block; }
  .desktop-only { display: none; }

  .story-card {
    padding: 14px;
    border-radius: 14px;
    gap: 8px;
  }


  .mobile-card-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-card-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
  }

  .mobile-card-text {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .mobile-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .mobile-icons {
    display: flex;
    gap: 8px;
  }

  .mobile-card-image {
    width: 88px;
    min-width: 88px;
    height: 88px;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 0;
    align-self: flex-start;
    display: block;
  }

  .mobile-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block;
  }

  .mobile-card-text h2 {
    margin: 0 0 6px;
    font-size: 1.06rem;
    line-height: 1.18;
    font-weight: 800;
  }

  .mobile-card-time {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
  }

  .mobile-card-image img {
    width: 88px;
    height: 88px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
  }

  /* Ensure image container is positioned for icon overlays */
  .mobile-card-image {
    position: relative;
    min-width: 88px;
    min-height: 88px;
    display: block;
  }

  .mobile-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
  }

  .mobile-action-btn {
    font-size: 0.78rem;
    padding: 6px 10px;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    border: 1px solid rgba(230,235,248,0.9);
    font-weight: 800;
    opacity: 0.9;
  }

  /* Make AI summary and Open source visually smaller and muted on mobile */
  .detail-summary strong { font-size: 0.82rem; }
  .detail-summary p { font-size: 0.96rem; opacity: 0.9; font-weight: 600; }

  /* Small bookmark and export icons - default styles (non-overlay) */
  .mobile-bookmark-btn,
  .mobile-export-icon {
    position: relative;
    top: auto;
    right: auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    border: 0;
    box-shadow: 0 8px 20px rgba(23,34,72,0.06);
    z-index: 2;
    color: #fff;
  }

  /* Give distinct colors: bookmark (teal/green), export/save (blue/violet) */
  .mobile-bookmark-btn,
  .mobile-export-icon {
    background: #f3eaff;
    color: #7040ff;
  }

  .mobile-bookmark-btn:active,
  .mobile-export-icon:active {
    background: #e3d6ff;
  }

  .story-card { position: relative; padding-top: 8px; }

  /* Archive button moved visually to header area on mobile */
  .mobile-archive-card { display: none; }
  .top-saved { margin-left: 8px; }

  /* Compact archive/date selector pill - shown in header area */
  .archive-controls { display: none; }

  /* Safe-area at bottom */
  .brief-board { padding-bottom: calc(env(safe-area-inset-bottom, 16px) + 20px); }
}

/* Compact header controls for mobile */
@media (max-width: 640px) {
  .top-compact-controls {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .top-compact-controls .top-saved,
  .top-compact-controls .archive-pill {
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid rgba(230,235,248,0.9);
    background: #fff;
    font-weight: 800;
    color: var(--muted);
    box-shadow: 0 8px 20px rgba(23,34,72,0.05);
  }

  .archive-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .archive-pill::after {
    content: '\25BE';
    font-size: 0.7rem;
    opacity: 0.7;
  }
}

.detail-summary.Sports p {
  font-family: "Barlow Condensed", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.26rem, 2.6vw, 1.48rem);
  font-weight: 600;
  line-height: 1.38;
}

.detail-summary.Anime p {
  font-family: "Comic Relief", system-ui, "Comic Sans MS", "Comic Neue", "Chalkboard SE", cursive;
  font-size: clamp(1.05rem, 2.3vw, 1.24rem);
  font-weight: 700;
  line-height: 1.62;
}

.detail-summary.Tech p {
  color: #344861;
}

@media (max-width: 820px) {
  .brief-hero {
    margin-top: 30px;
  }
}

@media (max-width: 520px) {
  .brief-hero {
    margin-top: 22px;
  }

  .archive-controls {
    gap: 8px;
  }

  #archiveStatus {
    flex-basis: 100%;
    padding-left: 2px;
  }

  .category-tabs {
    margin-top: 12px;
  }
}

@media (max-width: 820px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .brief-hero {
    margin-top: 34px;
  }

  .archive-controls {
    padding: 9px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding: 16px;
  }

  h1 {
    font-size: 3.4rem;
  }

  .top-saved {
    padding: 0 12px;
  }

  .archive-controls {
    align-items: stretch;
  }

  .archive-controls select {
    flex: 1 1 140px;
    min-width: 0;
  }

  .story-image-frame {
    height: clamp(205px, 62vw, 280px);
  }

  .detail-card h2 {
    font-size: 2.25rem;
  }
}

/* Mobile: inline icons next to category chip and ensure image is pushed down */
@media (max-width: 640px) {
  .mobile-card-text {
    display: block;
    gap: 8px;
  }

  .mobile-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .mobile-icons {
    display: inline-flex;
    gap: 8px;
    align-items: center;
  }

  .mobile-icons button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    display: inline-grid;
    place-items: center;
  }

  .mobile-card-image {
    margin-top: 12px;
  }
}


/* ============================================================
   MOBILE REDESIGN -- matches the premium app mockup
   Applies at <= 640px
   ============================================================ */

/* Show/hide helpers */
.desktop-only { display: block; }
.mobile-only  { display: none; }

.story-topline.desktop-only {
  display: flex;
}

.card-action-row.desktop-only {
  display: flex;
}

@media (max-width: 640px) {
  .desktop-only { display: none !important; }
  .mobile-only  { display: revert; }

  body {
    background:
      radial-gradient(circle at 72% 8%, rgba(68, 120, 255, 0.07), transparent 48%),
      radial-gradient(circle at 14% 88%, rgba(110, 60, 255, 0.05), transparent 42%),
      linear-gradient(180deg, #f8faff 0%, #f1f5fb 100%);
  }

  .app-shell {
    padding: 0 0 32px;
  }

  .brief-board {
    width: 100%;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px 12px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(224, 230, 246, 0.6);
    box-shadow: 0 4px 24px rgba(23, 34, 72, 0.06);
  }

  .brand-lockup img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .brand-lockup span {
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    display: block;
  }

  .top-saved {
    height: 36px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 800;
    background: linear-gradient(135deg, #4357ff, #7040ff);
    box-shadow: 0 8px 18px rgba(68, 82, 255, 0.26);
  }

  .brief-hero {
    display: none;
  }

  .archive-controls {
    display: none;
    width: calc(100% - 36px);
    margin: 0 18px 16px;
    padding: 11px 12px;
    border-radius: 16px;
  }

  .archive-controls.mobile-open {
    display: flex;
  }

  .category-tabs {
    top: 66px;
    gap: 0;
    margin: 0;
    padding: 0 18px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1.5px solid rgba(224, 230, 246, 0.7);
    overflow-x: auto;
  }

  .category-tab {
    position: relative;
    height: 46px;
    min-width: auto;
    padding: 0 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #8a93ab;
    font-size: 0.92rem;
    font-weight: 700;
    box-shadow: none;
    white-space: nowrap;
    transition: color 180ms ease;
  }

  .category-tab::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 12px;
    right: 12px;
    height: 2.5px;
    border-radius: 999px;
    background: var(--blue);
    opacity: 0;
    transform: scaleX(0.4);
    transition: opacity 200ms ease, transform 200ms ease;
  }

  .category-tab.active {
    color: var(--blue);
    background: transparent;
    box-shadow: none;
  }

  .category-tab.active::after {
    opacity: 1;
    transform: scaleX(1);
  }

  .category-tab:hover:not(.active) {
    color: var(--ink);
    border-color: transparent;
    background: transparent;
  }

  .story-list {
    width: 100%;
    margin: 0;
    gap: 0;
    padding: 10px 0 0;
  }

  .story-card {
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    border-bottom: 1px solid rgba(224, 230, 246, 0.7);
    background: transparent;
    box-shadow: none;
    overflow: visible;
    transition: background 140ms ease;
  }

  .story-card::before {
    display: none;
  }

  .story-card:hover {
    transform: none;
    box-shadow: none;
    background: rgba(68, 82, 255, 0.025);
  }

  .story-card:active {
    background: rgba(68, 82, 255, 0.05);
  }

  .mobile-card-inner {
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  .mobile-card-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start; /* top-align text with image */
    gap: 12px;
    padding: 15px 18px 8px;
  }

  .mobile-card-actions {
    display: flex;
    gap: 10px;
    padding: 0 18px 15px;
  }

  .mobile-action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    border: 0;
    transition: background 180ms ease, transform 100ms ease;
  }

  .mobile-action-btn.source-btn {
    background: var(--soft);
    color: var(--ink);
    border: 1px solid rgba(224, 230, 246, 0.8);
  }

  .mobile-action-btn.source-btn:active {
    background: #eef2fa;
    transform: scale(0.97);
  }

  .mobile-action-btn.summary-btn {
    background: linear-gradient(135deg, var(--blue), var(--violet));
    color: #fff;
    box-shadow: 0 4px 14px rgba(68, 82, 255, 0.2);
  }

  .mobile-action-btn.summary-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 6px rgba(68, 82, 255, 0.15);
  }

  .mobile-card-text {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    justify-content: flex-start; /* force content to the top */
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
  }

  /* Top-line: category chip left, icons right */
  .mobile-card-topline {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* chip and icons aligned left */
    width: 100%;
    gap: 8px;
    flex-wrap: nowrap; /* keep chip and icons on same row */
  }

  .mobile-icons {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 8px; /* sit next to the chip */
  }

  .mobile-bookmark-btn,
  .mobile-export-icon {
    width: 36px;
    height: 36px;
    padding: 6px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent; /* keep existing color/design untouched */
    box-shadow: none;
  }

  /* When a story is saved, show active color on the bookmark icon */
  .mobile-bookmark-btn[aria-pressed="true"] {
    color: var(--violet);
  }

  .mobile-card-text .category-chip {
    align-self: flex-start;
    min-height: 22px;
    padding: 0 8px;
    border: 0;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 6px;
  }

  .mobile-card-text .category-chip.Crypto {
    color: #5b4fff;
    background: rgba(91, 79, 255, 0.1);
  }

  .mobile-card-text .category-chip.Sports {
    color: #0eaa8c;
    background: rgba(14, 170, 140, 0.1);
  }

  .mobile-card-text .category-chip.Anime {
    color: #8b35e0;
    background: rgba(139, 53, 224, 0.1);
  }

  .mobile-card-text .category-chip.Tech {
    color: #3f5f86;
    background: rgba(63, 95, 134, 0.1);
  }

  .mobile-card-text h2 {
    margin: 0;
    color: #06122f;
    font-size: 1.0rem;
    font-weight: 750;
    line-height: 1.35;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
  }

  .mobile-card-time {
    display: block;
    margin-top: 2px;
    color: #8a93ab;
    font-size: 0.8rem;
    font-weight: 650;
  }

  .mobile-card-image {
    flex: 0 0 105px;
    width: 105px;
    height: 105px;
    border-radius: 16px;
    overflow: hidden;
    background: #eef1fa;
    box-shadow: 0 8px 20px rgba(23, 34, 72, 0.1);
    align-self: flex-start; /* ensure image stays top-aligned */
  }

  /* Action buttons should sit below the top row and span full width */
  .mobile-card-actions {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    width: 100%;
  }

  .mobile-action-btn {
    flex: 1 1 0;
  }

  .mobile-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease;
  }

  .story-card:active .mobile-card-image img {
    transform: scale(1.04);
  }

  .mobile-archive-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: calc(100% - 36px);
    margin: 18px 18px 0;
    padding: 16px 16px 16px 14px;
    border: 1px solid rgba(224, 230, 246, 0.9);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(23, 34, 72, 0.07);
    backdrop-filter: blur(12px);
    text-align: left;
    cursor: pointer;
    transition: box-shadow 160ms ease, transform 160ms ease;
  }

  .mobile-archive-card:hover {
    box-shadow: 0 14px 34px rgba(23, 34, 72, 0.11);
    transform: translateY(-1px);
  }

  .mobile-archive-card:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(23, 34, 72, 0.08);
  }

  .mobile-archive-icon {
    display: flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: var(--blue);
    background: rgba(68, 82, 255, 0.08);
  }

  .mobile-archive-text {
    flex: 1 1 0;
    min-width: 0;
  }

  .mobile-archive-text strong {
    display: block;
    color: #06122f;
    font-size: 1.0rem;
    font-weight: 800;
    letter-spacing: -0.01em;
  }

  .mobile-archive-text span {
    display: block;
    margin-top: 2px;
    color: #8a93ab;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.4;
  }

  .mobile-archive-chevron {
    display: flex;
    align-items: center;
    color: var(--blue);
    opacity: 0.85;
  }

  body.detail-mode .site-header {
    display: none !important;
  }

  .story-detail.fullscreen {
    padding: 18px 16px 40px;
    background: #f8faff;
  }

  .story-detail.fullscreen .detail-card {
    width: 100%;
    padding: 0;
    gap: 16px;
  }

  .detail-card h2 {
    font-size: 1.7rem;
    line-height: 1.15;
  }

  .detail-image {
    border-radius: 18px;
    max-height: 240px;
  }

  .detail-summary {
    padding: 16px;
    border-radius: 18px;
  }

  .detail-summary p {
    font-size: 1.0rem;
    line-height: 1.58;
  }

  .source-button {
    min-height: 46px;
    font-size: 0.94rem;
    border-radius: 14px;
    justify-self: stretch;
    text-align: center;
  }

  #archiveStatus {
    display: none;
  }

  .empty-state {
    margin: 28px 18px;
    border-radius: 18px;
  }
}

/* Final mobile header contract: brand icon, Markets, menu. */
@media (max-width: 640px) {
  html,
  body {
    scrollbar-gutter: auto;
  }

  body {
    overflow-y: auto;
  }

  .site-header {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    margin-inline: 10px !important;
    grid-template-columns: minmax(38px, 1fr) auto !important;
    gap: 6px !important;
  }

  .site-header .brand-lockup span {
    display: none !important;
  }

  .site-header .brand-lockup {
    gap: 0 !important;
  }

  .site-header .top-compact-controls {
    width: max-content;
    max-width: 100%;
    gap: 4px !important;
  }

  .site-header .top-markets,
  .site-header .top-portfolio,
  .site-header .wallet-button {
    min-height: 34px !important;
    padding: 5px 8px !important;
    font-size: 0.74rem !important;
  }

  .site-header .wallet-button {
    display: none !important;
  }

  .site-header .mobile-menu-button {
    display: inline-grid !important;
    flex: 0 0 34px;
  }
}

/* Final navigation contract. Keep this last so legacy mobile layers cannot override it. */
@media (max-width: 640px) {
  body {
    padding-bottom: 78px !important;
  }

  .site-header {
    display: flex !important;
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    min-height: 58px !important;
    margin: 10px 10px 0 !important;
    padding: 9px 10px !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  .site-header .brand-lockup {
    display: flex !important;
    gap: 8px !important;
    min-width: 0;
  }

  .site-header .brand-lockup span {
    display: inline !important;
    color: #071226 !important;
    font-size: 1rem !important;
    font-weight: 850 !important;
  }

  .site-header .top-compact-controls {
    display: flex !important;
    width: auto !important;
    max-width: none !important;
    gap: 6px !important;
  }

  .site-header .desktop-header-nav {
    display: none !important;
  }

  .site-header .archive-pill,
  .site-header .wallet-button {
    display: inline-grid !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    border-radius: 12px !important;
  }

  .category-tabs {
    top: 78px !important;
  }
}

/* Professional glass polish */
:root {
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(205, 216, 236, 0.72);
  --surface-shadow: 0 18px 58px rgba(24, 36, 78, 0.11);
  --surface-shadow-soft: 0 10px 34px rgba(24, 36, 78, 0.075);
  --brand-gradient: linear-gradient(135deg, #3157ff 0%, #6f3cff 58%, #9a5cff 100%);
}

body {
  color: #071226;
  background:
    linear-gradient(115deg, rgba(49, 87, 255, 0.09), transparent 29rem),
    linear-gradient(245deg, rgba(32, 200, 173, 0.1), transparent 28rem),
    linear-gradient(180deg, #fbfcff 0%, #f2f6fb 48%, #edf3f9 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(7, 18, 38, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 18, 38, 0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 72%);
}

.brief-board {
  width: min(980px, 100%);
}

.site-header {
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid rgba(220, 228, 244, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 44px rgba(24, 36, 78, 0.075);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
}

.brand-lockup img {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.86),
    0 12px 24px rgba(24, 36, 78, 0.12);
}

.brand-lockup span {
  color: #071226;
  font-size: 1.08rem;
  font-weight: 900;
}

.top-compact-controls .top-saved,
.top-compact-controls .top-markets,
.top-compact-controls .top-portfolio,
.top-compact-controls .archive-pill,
.archive-controls select,
.archive-controls button {
  border: 1px solid rgba(205, 216, 236, 0.82);
  background: rgba(255, 255, 255, 0.74);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 24px rgba(24, 36, 78, 0.055);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.top-compact-controls .top-saved:hover,
.top-compact-controls .top-markets:hover,
.top-compact-controls .top-portfolio:hover,
.top-compact-controls .archive-pill:hover,
.archive-controls button:hover {
  color: #1f35d8;
  border-color: rgba(68, 82, 255, 0.32);
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}

.top-compact-controls .top-markets.active,
.top-compact-controls .top-portfolio.active {
  color: #fff;
  border-color: transparent;
  background: #17213a;
  box-shadow: 0 12px 26px rgba(23, 33, 58, 0.2);
}

.markets-list {
  width: min(1040px, 100%);
}

.markets-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 18px 0 8px;
}

.markets-header h1 {
  margin: 0;
  font-size: clamp(2.7rem, 7vw, 4.8rem);
  line-height: 0.96;
}

.markets-header p {
  margin: 10px 0 0;
  color: #647089;
  font-size: 1.05rem;
  font-weight: 650;
}

.market-kicker {
  color: #3157ff;
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

.market-card {
  display: grid;
  grid-column: 1 / -1;
  gap: 18px;
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(205, 216, 236, 0.84);
  border-radius: 22px;
  color: #071226;
  text-align: left;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 48px rgba(24, 36, 78, 0.09);
  backdrop-filter: blur(18px);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.market-card:hover {
  transform: translateY(-3px);
  border-color: rgba(49, 87, 255, 0.28);
  box-shadow: 0 24px 62px rgba(24, 36, 78, 0.14);
}

.market-card-topline,
.market-probability-row,
.market-card-footer {
  display: flex;
  align-items: center;
}

.market-card-topline,
.market-card-footer {
  justify-content: space-between;
  gap: 12px;
}

.market-card h2 {
  max-width: 760px;
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1.18;
}

.market-probability-row {
  gap: 8px;
  color: #6d7890;
  font-weight: 720;
}

.market-probability-row strong {
  color: #071226;
  font-size: 2.6rem;
  line-height: 1;
}

.market-move {
  margin-left: auto;
  font-weight: 850;
}

.market-share-prices {
  margin-left: auto;
  color: #536078;
  font-size: 0.78rem;
  font-weight: 820;
}

.market-move.up {
  color: #0b9c7d;
}

.market-move.down {
  color: #d04c67;
}

.market-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf6;
}

.market-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3157ff, #20c8ad);
}

.market-card-footer {
  color: #788398;
  font-size: 0.82rem;
  font-weight: 750;
}

.market-detail-container {
  width: min(980px, 100%);
}

.story-detail.fullscreen:has(.market-detail-container) {
  overflow: hidden;
  padding-bottom: 18px;
}

.market-detail-container {
  height: calc(100vh - 114px);
  min-height: 0;
}

.market-detail-container > .back-button {
  flex: 0 0 auto;
  width: auto;
  min-height: 36px;
  margin-bottom: 14px;
  padding: 0 14px;
}

.market-detail-card {
  display: grid;
  gap: 24px;
  width: 100%;
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid rgba(205, 216, 236, 0.84);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--surface-shadow);
  backdrop-filter: blur(20px);
}

.market-detail-card > h2 {
  max-width: 820px;
  margin: 0;
  color: #071226;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.04;
}

.market-hero-grid,
.market-information-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.market-price-panel,
.market-trade-panel,
.market-information-grid > section {
  padding: 20px;
  border: 1px solid rgba(205, 216, 236, 0.78);
  border-radius: 20px;
  background: rgba(248, 250, 254, 0.74);
}

.market-price-panel {
  display: grid;
  gap: 12px;
  color: #657089;
  font-weight: 720;
}

.market-price-panel strong {
  color: #071226;
  font-size: clamp(3.5rem, 8vw, 6rem);
  line-height: 0.9;
}

.market-trade-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.market-side {
  display: flex;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 850;
  cursor: pointer;
}

.market-side.yes {
  color: #087d67;
  border-color: rgba(11, 156, 125, 0.2);
  background: rgba(32, 200, 173, 0.1);
}

.market-side.no {
  color: #bd405b;
  border-color: rgba(208, 76, 103, 0.2);
  background: rgba(208, 76, 103, 0.08);
}

.market-trade-panel > span {
  grid-column: 1 / -1;
  color: #788398;
  font-size: 0.8rem;
  line-height: 1.45;
}

.market-information-grid h3 {
  margin: 10px 0 0;
  color: #071226;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1.2rem;
}

.market-information-grid p {
  color: #536078;
  line-height: 1.55;
}

.market-information-grid dl {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.market-information-grid dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.market-information-grid dt {
  color: #788398;
}

.market-information-grid dd {
  margin: 0;
  color: #25324b;
  font-weight: 760;
  text-align: right;
}

.market-thread-link button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(49, 87, 255, 0.2);
  border-radius: 12px;
  color: #3157ff;
  background: rgba(49, 87, 255, 0.06);
  font-weight: 820;
  cursor: pointer;
}

.market-card-updates,
.market-detail-updates {
  display: inline-flex;
  align-items: center;
  color: #788398;
  font-size: 0.78rem;
  font-weight: 820;
}

.market-story-surface {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  padding: 0;
  overflow: visible;
  border-radius: 24px;
}

.market-decision-surface {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
  z-index: 3;
  display: grid;
  gap: 15px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid rgba(205, 216, 236, 0.84);
  background: rgba(250, 252, 255, 0.94);
  box-shadow: 0 16px 30px rgba(24, 36, 78, 0.07);
  backdrop-filter: blur(24px) saturate(1.12);
}

.market-detail-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.market-decision-surface > h2 {
  max-width: 850px;
  margin: 0;
  color: #071226;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.06;
  text-wrap: balance;
}

.market-decision-row {
  display: block;
  min-width: 0;
}

.market-compact-price,
.market-decision-surface .market-trade-panel {
  min-height: 80px;
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.market-compact-price {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  align-items: center;
  padding: 8px 12px;
  border-right: 1px solid rgba(205, 216, 236, 0.8);
  border-radius: 0;
}

.market-compact-price span {
  color: #788398;
  font-size: 0.74rem;
  font-weight: 780;
}

.market-compact-price strong {
  grid-column: 1;
  color: #071226;
  font-size: 2.45rem;
  line-height: 1;
}

.market-compact-price small {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #788398;
  font-size: 0.78rem;
  font-weight: 820;
}

.market-compact-price small.up {
  color: #0b8d73;
}

.market-compact-price small.down {
  color: #c4425d;
}

.market-decision-surface .market-trade-panel {
  padding: 8px;
  border: 1px solid rgba(205, 216, 236, 0.8);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  min-width: 0;
}

.market-order-mode {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(205, 216, 236, 0.78);
  border-radius: 10px;
  background: rgba(237, 242, 249, 0.82);
}

.market-order-mode button {
  min-height: 28px;
  border: 0;
  border-radius: 7px;
  color: #7a869a;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 820;
}

.market-order-mode button.active {
  color: #26334b;
  background: #fff;
  box-shadow: 0 2px 7px rgba(24, 36, 78, 0.1);
}

.market-decision-surface .market-side {
  position: relative;
  display: grid;
  place-content: center;
  gap: 4px;
  min-height: 80px;
  padding: 0 18px;
  border-width: 1px 1px 4px;
  text-align: center;
  font-size: 1rem;
  transition: transform 100ms ease, box-shadow 100ms ease, filter 100ms ease;
}

.market-decision-surface .market-side.yes {
  border-color: rgba(11, 156, 125, 0.3);
  background: linear-gradient(180deg, #e8fbf6, #d7f5ed);
  box-shadow: 0 4px 0 #96dccc;
}

.market-decision-surface .market-side.no {
  border-color: rgba(208, 76, 103, 0.26);
  background: linear-gradient(180deg, #fff3f6, #fce6eb);
  box-shadow: 0 4px 0 #edb3c0;
}

.market-decision-surface .market-side:hover {
  filter: brightness(1.015);
  transform: translateY(-1px);
}

.market-decision-surface .market-side:active {
  box-shadow: none;
  transform: translateY(4px);
}

.market-decision-surface .market-side span {
  font-size: 1.05rem;
  font-weight: 850;
}

.market-decision-surface .market-side strong {
  font-size: 1.05rem;
}

.market-decision-surface > .market-meter {
  height: 5px;
  margin-top: -8px;
}

.market-volume {
  display: flex;
  gap: 7px;
  align-items: baseline;
  margin: -5px 2px 0;
  color: #8a95a8;
  font-size: 0.72rem;
  font-weight: 720;
}

.market-volume strong {
  color: #536078;
  font-size: 0.78rem;
  font-weight: 850;
}

.market-resolution {
  border: 1px solid rgba(198, 211, 234, 0.82);
  border-radius: 14px;
  background: rgba(248, 250, 254, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.market-resolution summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  color: #5c6880;
  font-size: 0.8rem;
  font-weight: 730;
  cursor: pointer;
  list-style: none;
}

.market-resolution summary::-webkit-details-marker {
  display: none;
}

.market-resolution summary strong {
  color: #1c2942;
}

.market-resolution summary > span:last-child {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(49, 87, 255, 0.18);
  border-radius: 9px;
  color: #3157ff;
  background: rgba(49, 87, 255, 0.055);
  font-weight: 850;
}

.market-resolution[open] summary {
  border-bottom: 1px solid rgba(205, 216, 236, 0.7);
  background: rgba(243, 247, 253, 0.78);
}

.market-resolution > div {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.market-resolution p {
  margin: 0;
  color: #34415a;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 0.9rem;
  font-weight: 620;
  line-height: 1.58;
}

.market-resolution > div span {
  color: #788398;
  font-size: 0.78rem;
  font-weight: 680;
}

.market-resolution-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.market-resolution-facts div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(211, 221, 239, 0.72);
}

.market-resolution-facts div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.market-resolution-facts dt {
  color: #788398;
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.market-resolution-facts dd {
  margin: 0;
  color: #1f2c45;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 0.82rem;
  font-weight: 720;
  line-height: 1.4;
}

.market-resolution-inline {
  display: grid;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  gap: 6px;
  padding: 10px 12px;
  border-color: rgba(176, 196, 229, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 255, 0.9));
  box-shadow:
    0 12px 28px rgba(40, 55, 92, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.market-resolution-inline-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-width: 0;
  flex-wrap: wrap;
}

.market-resolution-inline-head strong {
  color: #101b31;
  font-size: 0.83rem;
  font-weight: 880;
}

.market-resolution-inline-head span {
  min-width: 0;
  color: #687791;
  font-size: 0.72rem;
  font-weight: 780;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.market-resolution-inline > span {
  min-width: 0;
  color: #7a879d;
  font-size: 0.72rem;
  font-weight: 720;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.market-resolution-inline p {
  min-width: 0;
  margin: 0;
  color: #24314a;
  font-size: 0.76rem;
  font-weight: 660;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.market-resolution-rule {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  min-width: 0;
  gap: 8px;
  align-items: start;
}

.market-resolution-rule > strong {
  color: #526582;
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
  line-height: 1.35;
}

.market-evidence-thread {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  gap: 16px;
  padding: 26px 26px 34px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background:
    linear-gradient(180deg, rgba(245, 248, 253, 0.52), rgba(255, 255, 255, 0.76));
}

.market-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(205, 216, 236, 0.74);
  border-radius: 12px;
  background: rgba(205, 216, 236, 0.74);
}

.market-stats div {
  display: grid;
  gap: 3px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.78);
}

.market-stats span {
  color: #8490a4;
  font-size: 0.68rem;
  font-weight: 760;
}

.market-stats strong {
  color: #243149;
  font-size: 0.88rem;
  font-weight: 850;
}

.market-evidence-thread > header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.market-evidence-thread h3 {
  margin: 7px 0 0;
  color: #071226;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.market-evidence-thread > header > span {
  flex: 0 0 auto;
  color: #6f7b92;
  font-size: 0.78rem;
  font-weight: 820;
}

.market-thread-intro {
  margin: 0;
  color: #6a768d;
  font-size: 0.9rem;
  font-weight: 650;
}

.market-thread-timeline {
  position: relative;
  display: grid;
  gap: 0;
}

.market-thread-timeline::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 6px;
  width: 1px;
  background: #d8e0ed;
}

.market-thread-update {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 18px;
  padding: 0 0 25px;
}

.market-thread-update:last-child {
  padding-bottom: 0;
}

.market-thread-marker {
  z-index: 1;
  width: 13px;
  height: 13px;
  margin-top: 5px;
  border: 3px solid #f8fafd;
  border-radius: 50%;
  background: #7c879c;
  box-shadow: 0 0 0 1px #d8e0ed;
}

.market-thread-update > div:last-child {
  padding: 0 0 1px;
}

.market-thread-update-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #7a869b;
  font-size: 0.76rem;
  font-weight: 780;
}

.market-thread-update h4 {
  margin: 7px 0 0;
  color: #101a31;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1.08rem;
  line-height: 1.3;
}

.market-thread-update p {
  margin: 7px 0 0;
  color: #59667e;
  font-size: 0.9rem;
  font-weight: 590;
  line-height: 1.5;
}

.market-thread-source-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-top: 9px;
  padding: 0 10px;
  border: 1px solid rgba(49, 87, 255, 0.16);
  border-radius: 9px;
  color: #3157ff;
  background: rgba(49, 87, 255, 0.045);
  font-size: 0.76rem;
  font-weight: 840;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, transform 120ms ease;
}

.market-thread-source-link:hover {
  border-color: rgba(49, 87, 255, 0.3);
  background: rgba(49, 87, 255, 0.09);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .site-header {
    grid-template-columns: minmax(38px, 1fr) auto;
    gap: 8px;
  }

  .brand-lockup span {
    display: none;
  }

  .brand-lockup {
    gap: 0;
  }

  .top-compact-controls {
    gap: 5px;
    min-width: 0;
  }

  .top-compact-controls .top-markets,
  .top-compact-controls .wallet-button {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 0.76rem;
  }

  .top-compact-controls .top-saved,
  .top-compact-controls .archive-pill {
    display: none;
  }

  .top-compact-controls .wallet-button {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-menu-button {
    display: inline-grid;
    place-content: center;
    width: 34px;
    height: 34px;
    gap: 3px;
    padding: 0;
    border: 1px solid rgba(205, 216, 236, 0.82);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.76);
  }

  .mobile-menu-button span {
    display: block;
    width: 14px;
    height: 1.5px;
    border-radius: 999px;
    background: #45516a;
  }

  .mobile-menu-panel {
    position: absolute;
    top: 62px;
    right: 10px;
    z-index: 40;
    width: min(280px, calc(100vw - 20px));
    gap: 5px;
    padding: 10px;
    border: 1px solid rgba(205, 216, 236, 0.86);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 54px rgba(24, 36, 78, 0.18);
    backdrop-filter: blur(22px);
  }

  .mobile-menu-panel:not([hidden]) {
    display: grid;
  }

  .mobile-menu-panel button,
  .mobile-menu-panel a {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0 11px;
    border: 0;
    border-radius: 9px;
    color: #34415a;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 780;
    text-decoration: none;
  }

  .mobile-menu-panel button:hover,
  .mobile-menu-panel a:hover {
    background: #f3f6fb;
  }

  .mobile-wallet-card {
    display: grid;
    gap: 4px;
    margin-bottom: 4px;
    padding: 12px;
    border-radius: 11px;
    background: #f3f6fb;
  }

  .mobile-wallet-card span,
  .mobile-wallet-card small {
    color: #7a869b;
    font-size: 0.7rem;
    font-weight: 720;
  }

  .mobile-wallet-card strong {
    color: #17233b;
    font-size: 0.86rem;
  }

  .markets-list {
    padding: 0 12px 24px;
  }

  .markets-header {
    align-items: start;
    padding: 14px 4px 6px;
  }

  .markets-header h1 {
    font-size: 3rem;
  }

  .markets-grid,
  .market-hero-grid,
  .market-information-grid {
    grid-template-columns: 1fr;
  }

  .market-card:first-child {
    grid-column: auto;
  }

  .market-card {
    gap: 15px;
    padding: 18px;
    border-radius: 20px;
  }

  .market-card h2 {
    font-size: 1.22rem;
  }

  .market-card-footer {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }

  .market-detail-card {
    max-width: 100%;
    border-radius: 22px;
  }

  .story-detail.fullscreen:has(.market-detail-container) {
    padding: 10px;
  }

  .market-detail-container {
    height: calc(100dvh - 20px);
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    overflow: hidden;
  }

  .market-story-surface {
    align-self: stretch;
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    overflow: hidden;
    contain: inline-size;
  }

  .market-decision-surface {
    position: relative;
    align-self: stretch;
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    gap: 8px;
    padding: 12px;
    overflow: hidden;
    contain: inline-size;
  }

  .market-decision-surface > *,
  .market-decision-row > *,
  .market-trade-panel > *,
  .market-stats > * {
    max-inline-size: 100%;
    min-inline-size: 0;
  }

  .market-decision-surface > h2 {
    font-size: clamp(1.35rem, 6.2vw, 1.72rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .market-decision-row {
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    overflow: hidden;
    contain: inline-size;
  }

  .market-compact-price,
  .market-decision-surface .market-trade-panel {
    min-height: 58px;
  }

  .market-compact-price {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 3px 10px;
    padding: 6px 9px 8px;
    border-right: 0;
    border-bottom: 1px solid rgba(205, 216, 236, 0.8);
  }

  .market-compact-price strong {
    grid-column: 1;
    font-size: 1.75rem;
  }

  .market-compact-price small {
    display: block;
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    font-size: 0.7rem;
  }

  .market-decision-surface .market-trade-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    overflow: hidden;
    contain: inline-size;
  }

  .market-decision-surface .market-side {
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    min-width: 0;
    min-height: 56px;
    padding: 0 6px;
    border-bottom-width: 3px;
  }

  .market-decision-surface .market-side span,
  .market-decision-surface .market-side strong {
    font-size: 0.88rem;
  }

  .market-stats div {
    min-width: 0;
    padding: 6px 7px;
    overflow: hidden;
  }

  .market-stats {
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    contain: inline-size;
  }

  .market-resolution {
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    contain: inline-size;
  }

  .market-stats span {
    font-size: 0.62rem;
  }

  .market-stats strong {
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .market-resolution summary {
    align-items: center;
    min-height: 38px;
    padding: 7px 8px 7px 10px;
    overflow: hidden;
  }

  .market-resolution > div {
    gap: 12px;
    padding: 13px;
  }

  .market-resolution-facts div {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 9px;
  }

  .market-resolution p {
    font-size: 0.84rem;
  }

  .market-resolution summary > span:first-child {
    min-width: 0;
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .market-resolution summary > span:last-child {
    flex: 0 0 auto;
  }

  .market-evidence-thread {
    align-self: stretch;
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    padding: 15px 12px 26px;
    scrollbar-gutter: auto;
    contain: inline-size;
  }

  .market-evidence-thread > header {
    align-items: start;
  }

  .market-detail-container > .back-button {
    width: auto;
    min-height: 32px;
    margin: 0 0 7px 4px;
  }

  .market-information-grid dl div {
    display: grid;
    gap: 4px;
  }

  .market-information-grid dd {
    text-align: left;
  }
}

/* Market trading controls and mobile bottom-nav safe space. */
.market-side.active.yes {
  border-color: rgba(8, 125, 103, 0.34);
  box-shadow: inset 0 -4px 0 rgba(8, 125, 103, 0.22), 0 8px 18px rgba(8, 125, 103, 0.08);
}

.market-side.active.no {
  border-color: rgba(189, 64, 91, 0.34);
  box-shadow: inset 0 -4px 0 rgba(189, 64, 91, 0.2), 0 8px 18px rgba(189, 64, 91, 0.08);
}

.market-amount-panel,
.market-payout-panel,
.market-submit-button {
  grid-column: 1 / -1;
}

.market-amount-panel {
  display: grid;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid rgba(205, 216, 236, 0.72);
}

.market-amount-panel label,
.market-payout-panel span {
  color: #66728a;
  font-size: 0.76rem;
  font-weight: 850;
}

.market-amount-input {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(205, 216, 236, 0.86);
  border-radius: 14px;
  background: rgba(248, 250, 255, 0.9);
}

.market-amount-input span {
  color: #071226;
  font-size: 1.6rem;
  font-weight: 900;
}

.market-amount-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #071226;
  background: transparent;
  font-size: 2rem;
  font-weight: 900;
}

.market-quick-amounts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.market-quick-amounts button {
  min-height: 32px;
  border: 0;
  border-radius: 10px;
  color: #53627e;
  background: rgba(226, 234, 248, 0.72);
  font-size: 0.75rem;
  font-weight: 850;
}

.market-payout-panel {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(32, 200, 173, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(233, 255, 250, 0.82), rgba(248, 252, 255, 0.86));
}

.market-payout-panel strong {
  color: #0b9b80;
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  line-height: 1;
}

.market-payout-panel small {
  color: #66728a;
  font-weight: 760;
}

.market-submit-button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(180deg, #3157ff, #2448e8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 4px 0 #1833b9;
  font-weight: 900;
  justify-content: center;
}

@media (max-width: 640px) {
  .story-list {
    padding-bottom: 104px !important;
  }

  .story-detail.fullscreen {
    padding-bottom: 92px !important;
  }

  .market-evidence-thread {
    padding-bottom: 126px !important;
  }

  .market-decision-surface .market-trade-panel {
    max-height: 42vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .market-decision-surface .market-trade-panel::-webkit-scrollbar {
    display: none;
  }

  .market-amount-panel {
    padding: 10px 6px 8px;
  }

  .market-amount-input {
    min-height: 44px;
    padding: 0 11px;
  }

  .market-amount-input input {
    font-size: 1.55rem;
  }

  .market-payout-panel {
    padding: 10px;
  }

  .market-submit-button {
    min-height: 44px;
  }
}

.brief-hero {
  padding: 8px 0 0;
}

h1 {
  color: #071226;
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 0;
}

.date-label {
  color: #68748d;
  font-weight: 760;
}

.archive-controls {
  border: 1px solid rgba(216, 225, 243, 0.82);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--surface-shadow-soft);
  backdrop-filter: blur(20px) saturate(1.12);
  -webkit-backdrop-filter: blur(20px) saturate(1.12);
}

.category-tabs {
  top: 84px;
  margin-top: 22px;
  border-radius: 20px;
  background: rgba(242, 246, 251, 0.76);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.category-tab {
  border: 1px solid rgba(218, 226, 242, 0.72);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  color: #5e6980;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.category-tab.active {
  border-color: transparent;
  background: var(--brand-gradient);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 14px 30px rgba(68, 82, 255, 0.24);
}

.story-list {
  width: min(760px, 100%);
  gap: 22px;
}

.story-card {
  border: 1px solid rgba(211, 221, 239, 0.82);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.66)),
    rgba(255, 255, 255, 0.72);
  box-shadow: var(--surface-shadow);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}

.story-card:hover {
  transform: translateY(-4px);
  border-color: rgba(174, 190, 226, 0.86);
  box-shadow: 0 28px 80px rgba(24, 36, 78, 0.15);
}

.story-image-frame {
  border-radius: 20px;
  background: linear-gradient(135deg, #eef4ff, #f7f9fd);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.68),
    0 14px 34px rgba(24, 36, 78, 0.08);
}

.story-copy h2,
.detail-card h2 {
  color: #071226;
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 760;
}

.story-copy h2 {
  font-size: clamp(1.24rem, 2.55vw, 1.62rem);
  line-height: 1.22;
}

.story-copy p {
  color: #778298;
  font-size: 0.94rem;
}

.story-source strong {
  color: #101a31;
}

.story-source span {
  color: #778298;
}

.mobile-bookmark-btn,
.mobile-export-icon {
  border: 1px solid rgba(193, 205, 230, 0.82);
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 8px 18px rgba(24, 36, 78, 0.065);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card-source-button,
.source-button {
  background: var(--brand-gradient);
  box-shadow: 0 16px 34px rgba(68, 82, 255, 0.24);
}

.thread-button,
.mobile-action-btn.thread-btn {
  color: #2d3a55;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 22px rgba(24, 36, 78, 0.08);
}

.thread-button:hover,
.mobile-action-btn.thread-btn:active {
  color: #3157ff;
}

.share-menu {
  border: 1px solid rgba(205, 216, 236, 0.84);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 48px rgba(24, 36, 78, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.story-detail.fullscreen {
  background:
    linear-gradient(115deg, rgba(49, 87, 255, 0.09), transparent 29rem),
    linear-gradient(245deg, rgba(32, 200, 173, 0.1), transparent 28rem),
    linear-gradient(180deg, #fbfcff 0%, #f2f6fb 100%);
}

.story-detail.fullscreen .detail-card {
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid rgba(211, 221, 239, 0.82);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--surface-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.detail-summary {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.thread-container {
  width: min(820px, 100%);
}

.thread-card {
  overflow: hidden;
}

.thread-card h2 {
  max-width: 760px;
}

.thread-intro {
  margin: -4px 0 2px;
  color: #6b748c;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.55;
}

.thread-timeline {
  position: relative;
  display: grid;
  gap: 16px;
  margin-top: 4px;
}

.thread-timeline::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 13px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(68, 82, 255, 0.38), rgba(32, 200, 173, 0.14));
}

.thread-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
}

.thread-dot {
  z-index: 1;
  width: 28px;
  height: 28px;
  border: 7px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: var(--brand-gradient);
  box-shadow: 0 8px 20px rgba(68, 82, 255, 0.2);
}

.thread-item-body {
  padding: 16px;
  border: 1px solid rgba(211, 221, 239, 0.82);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 10px 28px rgba(24, 36, 78, 0.07);
}

.thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #788398;
  font-size: 0.82rem;
  font-weight: 760;
}

.thread-item h3 {
  margin: 10px 0 0;
  color: #071226;
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.06rem, 2vw, 1.28rem);
  line-height: 1.24;
}

.thread-item p {
  margin: 8px 0 0;
  color: #43506a;
  font-size: 0.95rem;
  font-weight: 590;
  line-height: 1.55;
}

.thread-source-link {
  display: inline-flex;
  margin-top: 12px;
  color: #3157ff;
  font-size: 0.86rem;
  font-weight: 820;
  text-decoration: none;
}

.thread-loading {
  margin-left: 42px;
  padding: 16px;
  border: 1px dashed rgba(205, 216, 236, 0.9);
  border-radius: 18px;
  color: #788398;
  font-weight: 760;
}

@media (max-width: 640px) {
  body {
    background:
      linear-gradient(135deg, rgba(49, 87, 255, 0.09), transparent 22rem),
      linear-gradient(235deg, rgba(32, 200, 173, 0.08), transparent 22rem),
      linear-gradient(180deg, #fbfcff 0%, #f2f6fb 100%);
  }

  body::before {
    background-size: 34px 34px;
    opacity: 0.7;
  }

  .site-header {
    margin: 10px 10px 0;
    padding: 10px 12px;
    border-radius: 20px;
    border-bottom: 1px solid rgba(220, 228, 244, 0.78);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 14px 34px rgba(24, 36, 78, 0.1);
  }

  .brand-lockup span {
    display: inline;
    font-size: 1rem;
  }

  .brand-lockup img {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .top-compact-controls .top-saved,
  .top-compact-controls .top-markets,
  .top-compact-controls .top-portfolio,
  .top-compact-controls .archive-pill {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 0.82rem;
  }

  .brief-hero {
    padding: 0 18px;
    margin-top: 30px;
  }

  h1 {
    font-size: clamp(3.2rem, 17vw, 4.45rem);
  }

  .date-label {
    font-size: 0.98rem;
  }

  .archive-controls.mobile-open {
    width: calc(100% - 20px);
    margin: 14px 10px 0;
    padding: 12px;
    border-radius: 20px;
  }

  .category-tabs {
    top: 70px;
    margin: 22px 0 8px;
    padding: 9px 14px 11px;
    border-radius: 0;
    background: rgba(247, 250, 254, 0.72);
    border-bottom: 1px solid rgba(220, 228, 244, 0.62);
  }

  .category-tab {
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.66);
  }

  .story-list {
    padding: 12px 12px 24px;
    gap: 14px;
  }

  .story-card {
    padding: 0;
    border: 1px solid rgba(211, 221, 239, 0.82);
    border-radius: 22px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.68)),
      rgba(255, 255, 255, 0.72);
    box-shadow: 0 16px 42px rgba(24, 36, 78, 0.105);
    overflow: hidden;
  }

  .story-card:hover,
  .story-card:active {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.72)),
      rgba(255, 255, 255, 0.76);
    transform: translateY(-1px);
    box-shadow: 0 18px 48px rgba(24, 36, 78, 0.13);
  }

  .mobile-card-body {
    gap: 13px;
    padding: 15px 15px 10px;
  }

  .mobile-card-image {
    flex-basis: 98px;
    width: 98px;
    min-width: 98px;
    height: 98px;
    min-height: 98px;
    border-radius: 18px;
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.72),
      0 12px 26px rgba(24, 36, 78, 0.1);
  }

  .mobile-card-image img {
    width: 100%;
    height: 100%;
    border-radius: 18px;
  }

  .mobile-card-text h2 {
    color: #071226;
    font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 1.02rem;
    font-weight: 760;
    line-height: 1.22;
  }

  .mobile-card-time {
    color: #7b869b;
  }

  .mobile-card-actions {
    padding: 0 15px 15px;
  }

  .mobile-action-btn {
    min-height: 38px;
    border: 1px solid rgba(205, 216, 236, 0.72);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  }

  .mobile-action-btn.summary-btn {
    color: #fff;
    background: var(--brand-gradient);
    box-shadow: 0 12px 26px rgba(68, 82, 255, 0.2);
  }

  .mobile-action-btn.source-btn {
    color: #26334a;
  }

  .story-detail.fullscreen {
    padding: 12px;
  }

  .story-detail.fullscreen .detail-card {
    padding: 16px;
    border-radius: 24px;
  }

  .mobile-card-actions {
    flex-wrap: wrap;
  }

  .mobile-action-btn.thread-btn {
    flex: 1 1 100%;
    color: #3157ff;
  }

  .thread-card h2 {
    font-size: 1.85rem;
  }

  .thread-item {
    gap: 10px;
  }

  .thread-item-body {
    padding: 14px;
    border-radius: 18px;
  }

  .thread-timeline::before {
    left: 13px;
  }
}

.category-tabs .category-tab.active {
  color: #fff;
  border-color: transparent;
  background: var(--brand-gradient);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 14px 30px rgba(68, 82, 255, 0.24);
}

.archive-controls {
  justify-content: flex-start;
}

.archive-controls select {
  min-width: 170px;
}

#archiveStatus {
  display: none;
}

@media (max-width: 640px) {
  .category-tabs .category-tab.active {
    color: #fff;
    background: var(--brand-gradient);
    box-shadow: 0 12px 26px rgba(68, 82, 255, 0.22);
  }

  .category-tabs .category-tab.active::after {
    display: none;
  }

  .archive-controls.mobile-open {
    justify-content: flex-start;
  }

  .archive-controls select {
    flex: 1 1 auto;
    min-width: 0;
  }

  .story-card {
    position: relative;
  }

  .mobile-card-topline {
    padding-right: 0;
  }

  .mobile-icons {
    position: absolute;
    top: 23px;
    right: 23px;
    z-index: 5;
    display: inline-flex;
    gap: 7px;
    margin-left: 0;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.66);
    box-shadow: 0 10px 24px rgba(24, 36, 78, 0.16);
    backdrop-filter: blur(14px) saturate(1.12);
    -webkit-backdrop-filter: blur(14px) saturate(1.12);
  }

  .mobile-bookmark-btn,
  .mobile-export-icon,
  .mobile-icons button {
    width: 30px;
    height: 30px;
    padding: 5px;
    border: 0;
    border-radius: 10px;
    color: #6244e8;
    background: rgba(255, 255, 255, 0.54);
    box-shadow: none;
  }

  .mobile-bookmark-btn[aria-pressed="true"] {
    color: #fff;
    background: var(--brand-gradient);
  }

  .mobile-icons {
    top: 14px;
    right: 16px;
  }

  .mobile-card-image {
    margin-top: 52px;
  }

  .mobile-card-text {
    padding-top: 12px;
  }
}

/* Keep the fixed market workspace tied to the real mobile viewport. */
@media (max-width: 640px) {
  .story-detail.fullscreen:has(.market-detail-container) {
    inset: 0 auto 0 0;
    inline-size: 100vw;
    max-inline-size: 100vw;
    padding: 10px 20px 10px 10px;
    overflow: hidden;
  }

  .story-detail.fullscreen .market-detail-container {
    inline-size: calc(100vw - 30px);
    max-inline-size: calc(100vw - 30px);
    min-inline-size: 0;
    margin: 0;
  }

  .story-detail.fullscreen .market-story-surface {
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    padding: 0;
  }

  .market-decision-surface,
  .market-decision-row,
  .market-trade-panel,
  .market-stats,
  .market-resolution,
  .market-evidence-thread {
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
  }

  .market-evidence-thread > header > div,
  .market-thread-update > div:last-child,
  .market-thread-update h4,
  .market-thread-update p {
    min-inline-size: 0;
    max-inline-size: 100%;
  }

  .market-thread-update h4,
  .market-thread-update p {
    overflow-wrap: anywhere;
  }

  .market-compact-price small {
    display: none;
  }
}

/* Real market order ticket */
.market-decision-surface .market-trade-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.market-order-ticket {
  display: grid;
  gap: 0;
  padding: 9px;
  border: 1px solid rgba(205, 216, 236, 0.72);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 255, 0.82));
}

.market-order-ticket .market-amount-panel,
.market-order-ticket .market-payout-panel {
  grid-column: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.market-order-ticket .market-amount-input {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 10px 13px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.88);
}

.market-amount-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
}

.market-order-ticket .market-amount-input span,
.market-order-ticket .market-amount-input input {
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
}

.market-inline-payout {
  display: flex;
  gap: 7px;
  align-items: baseline;
  color: rgba(89, 102, 126, 0.58);
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 520;
}

.market-order-ticket .market-inline-payout span,
.market-inline-payout strong {
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 520;
  line-height: 1;
}

.market-order-ticket .market-inline-payout span {
  color: rgba(89, 102, 126, 0.52);
}

.market-inline-payout strong {
  color: rgba(9, 191, 164, 0.48);
}

.market-quick-amounts,
.market-payout-panel {
  display: none !important;
}

.market-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.market-action-grid .market-side {
  width: 100%;
}

.market-volume {
  margin: 10px 8px 0;
  font-size: 0.78rem;
}

.market-story-surface,
.market-story-surface button,
.market-story-surface input,
.market-story-surface a,
.market-story-surface summary {
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
}

.market-thread-update h4 {
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.02rem;
  font-weight: 760;
  letter-spacing: 0;
}

.market-thread-update p,
.market-thread-update-meta,
.market-thread-source-link,
.market-thread-intro,
.market-evidence-thread > header > span {
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
}

@media (max-width: 640px) {
  .market-decision-surface .market-trade-panel {
    max-height: none;
    overflow: visible;
  }

  .market-order-ticket {
    padding: 7px;
  }

  .market-action-grid {
    gap: 7px;
  }

  .market-action-grid .market-side {
    min-height: 52px;
  }
}

/* Final mobile header contract: brand icon, Markets, wallet, menu. */
@media (max-width: 640px) {
  .site-header {
    grid-template-columns: minmax(38px, 1fr) auto !important;
    gap: 6px !important;
  }

  .site-header .brand-lockup span {
    display: none !important;
  }

  .site-header .brand-lockup {
    gap: 0 !important;
  }

  .site-header .top-compact-controls {
    gap: 4px !important;
  }

  .site-header .top-markets {
    min-height: 34px !important;
    padding: 5px 8px !important;
    font-size: 0.74rem !important;
  }

  .site-header .wallet-button {
    display: none !important;
  }

  .site-header .mobile-menu-button {
    display: inline-grid !important;
    flex: 0 0 34px;
  }
}

/* Current mobile shell: named brand, archive/wallet utilities, bottom navigation. */
.category-tabs[hidden],
.brief-hero[hidden],
.archive-controls[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  body {
    padding-bottom: 78px !important;
  }

  .site-header {
    display: flex !important;
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    min-height: 58px !important;
    margin: 10px 10px 0 !important;
    padding: 9px 10px !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  .site-header .brand-lockup {
    display: flex !important;
    gap: 8px !important;
  }

  .site-header .brand-lockup span {
    display: inline !important;
    color: #071226 !important;
    font-size: 1rem !important;
    font-weight: 850 !important;
  }

  .site-header .top-compact-controls {
    display: flex !important;
    width: auto !important;
    max-width: none !important;
    gap: 6px !important;
  }

  .site-header .desktop-header-nav,
  .site-header .mobile-menu-button {
    display: none !important;
  }

  .site-header .archive-pill,
  .site-header .wallet-button {
    display: inline-grid !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    border-radius: 12px !important;
  }

  .category-tabs {
    top: 78px !important;
  }
}

/* Polished header utilities. */
.site-header .archive-pill {
  overflow: hidden;
  color: #53627e;
  background: linear-gradient(180deg, #ffffff, #f2f6ff);
  box-shadow:
    inset 0 1px 0 #fff,
    0 3px 0 rgba(174, 188, 216, 0.38),
    0 10px 22px rgba(24, 36, 78, 0.08);
}

.calendar-symbol {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  color: #3157ff;
  background: rgba(49, 87, 255, 0.09);
}

.calendar-symbol svg {
  width: 17px !important;
  height: 17px !important;
}

.site-header .wallet-button {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-width: 132px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid #294de8;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(180deg, #4367ff 0%, #3157ff 72%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 4px 0 #2544c8,
    0 12px 24px rgba(49, 87, 255, 0.2);
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.site-header .wallet-button:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 5px 0 #2544c8,
    0 14px 28px rgba(49, 87, 255, 0.24);
}

.site-header .wallet-button:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 1px 0 #2544c8,
    0 6px 14px rgba(49, 87, 255, 0.16);
}

.site-header .wallet-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-header .wallet-button.connected {
  border-color: #079d82;
  background: linear-gradient(180deg, #19c5a7, #0bad91);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 4px 0 #07846e,
    0 12px 24px rgba(11, 173, 145, 0.2);
}

.site-header .wallet-button .wallet-status-dot {
  display: none;
}

@media (max-width: 640px) {
  .site-header .archive-pill {
    display: inline-grid !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
  }

  .site-header .wallet-button {
    display: inline-flex !important;
    width: auto !important;
    min-width: 116px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
    font-size: 0.7rem !important;
  }

  .site-header .wallet-button svg {
    width: 16px !important;
    height: 16px !important;
  }
}

/* Premium mobile/header icon pass. */
.site-header {
  overflow: visible;
}

.brand-lockup {
  position: relative;
}

.brand-lockup img {
  padding: 5px;
  border: 1px solid rgba(200, 211, 233, 0.75);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 3px 0 rgba(178, 191, 219, 0.42),
    0 14px 26px rgba(24, 36, 78, 0.11);
}

.brand-lockup span {
  letter-spacing: 0;
}

.site-header .archive-pill {
  border-color: rgba(198, 211, 238, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 245, 255, 0.96));
}

.calendar-symbol {
  width: 27px;
  height: 27px;
  border: 1px solid rgba(71, 104, 255, 0.16);
  border-radius: 9px;
  color: #3157ff;
  background:
    linear-gradient(180deg, rgba(233, 239, 255, 0.95), rgba(246, 249, 255, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.site-header .wallet-button {
  border-color: rgba(10, 160, 136, 0.78);
  color: #ffffff;
  background:
    linear-gradient(180deg, #20c7aa 0%, #0da68d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 4px 0 #087864,
    0 15px 28px rgba(8, 120, 100, 0.2);
}

.site-header .wallet-button:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    0 5px 0 #087864,
    0 18px 34px rgba(8, 120, 100, 0.24);
}

.site-header .wallet-button svg {
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.08));
}

.mobile-icons {
  gap: 7px;
  padding: 5px;
  border: 1px solid rgba(219, 226, 241, 0.72);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.86));
  box-shadow:
    0 12px 28px rgba(24, 36, 78, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.mobile-bookmark-btn,
.mobile-export-icon,
.mobile-icons button {
  color: #5d47ff !important;
  background: transparent !important;
  box-shadow: none !important;
}

.mobile-bookmark-btn:hover,
.mobile-export-icon:hover,
.mobile-icons button:hover {
  background: rgba(93, 71, 255, 0.08) !important;
}

.mobile-bottom-nav {
  border-color: rgba(197, 210, 238, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(249, 251, 255, 0.9));
}

.mobile-bottom-nav button.active {
  background:
    linear-gradient(180deg, rgba(239, 243, 255, 0.98), rgba(226, 233, 255, 0.96));
  box-shadow: inset 0 1px 0 #fff;
}

@media (max-width: 640px) {
  .site-header {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 255, 0.76)) !important;
  }

  .brand-lockup img {
    width: 40px !important;
    height: 40px !important;
    border-radius: 14px !important;
  }

  .site-header .brand-lockup span {
    font-size: 0.98rem !important;
  }

  .site-header .top-compact-controls {
    gap: 8px !important;
  }

  .site-header .archive-pill {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    border-radius: 14px !important;
  }

  .site-header .wallet-button {
    min-width: 112px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 13px !important;
    border-radius: 14px !important;
  }
}

/* Product-wide typography and archive icon refresh. */
html,
body,
button,
input,
select,
textarea,
a,
p,
span,
small,
strong,
label,
summary,
h1,
h2,
h3,
h4 {
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
}

.site-header .archive-pill {
  border-color: rgba(188, 203, 233, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 246, 255, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 4px 0 rgba(168, 183, 216, 0.34),
    0 14px 28px rgba(24, 36, 78, 0.11);
}

.calendar-symbol {
  width: 29px;
  height: 29px;
  border: 0;
  border-radius: 0;
  color: #3157ff;
  background: transparent;
  box-shadow: none;
}

.calendar-symbol svg {
  width: 19px !important;
  height: 19px !important;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calendar-symbol svg path:nth-child(3) {
  fill: rgba(49, 87, 255, 0.13);
  stroke-width: 1.45;
}

/* Mobile market detail: a normal scrollable page with the thread inline. */
@media (max-width: 640px) {
  .story-detail.fullscreen:has(.market-detail-container) {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
    padding: 10px 14px calc(92px + env(safe-area-inset-bottom)) !important;
    overflow: visible !important;
  }

  .story-detail.fullscreen .market-detail-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .market-detail-container > .back-button { flex: 0 0 auto !important; min-height: 36px !important; margin: 0 0 9px !important; padding: 0 16px !important; }

  .story-detail.fullscreen .market-story-surface {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 0 !important;
    overflow: visible !important;
    border-radius: 22px !important;
  }

  .market-decision-surface {
    position: relative !important; z-index: 1 !important; display: block !important; width: 100% !important;
    max-height: none !important; padding: 12px !important; overflow: visible !important; contain: none !important;
  }

  .market-detail-meta { margin-bottom: 6px !important; }
  .market-decision-surface > h2 { max-width: 100% !important; margin: 12px 0 12px !important; font-size: clamp(1.35rem, 6vw, 1.72rem) !important; line-height: 1.08 !important; }

  .market-decision-surface .market-trade-panel {
    display: grid !important; grid-template-columns: 1fr !important; gap: 8px !important; width: 100% !important;
    max-height: none !important; margin: 0 !important; padding: 7px !important; overflow: visible !important; contain: none !important;
  }

  .market-trade-mode { min-height: 42px !important; }
  .market-order-ticket { padding: 8px !important; }
  .market-order-ticket label { gap: 5px !important; }
  .market-amount-input { min-height: 58px !important; padding: 9px 12px !important; }
  .market-amount-input span { font-size: 1.35rem !important; }
  .market-inline-payout { gap: 4px !important; }
  .market-inline-payout span { font-size: 1.02rem !important; }
  .market-inline-payout strong { font-size: 0.64rem !important; }

  .market-action-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; width: 100% !important; }
  .market-action-grid .market-side { min-height: 56px !important; height: 56px !important; padding: 0 10px !important; overflow: visible !important; }
  .market-action-grid .market-side span, .market-action-grid .market-side strong { line-height: 1.15 !important; }
  .market-volume-line { margin: 6px 0 7px !important; font-size: 0.82rem !important; }
  .market-resolution-row { min-height: 42px !important; padding: 0 8px 0 12px !important; }
  .market-resolution-inline { gap: 5px !important; padding: 9px 11px !important; }
  .market-resolution-inline-head { align-items: flex-start !important; gap: 4px !important; }
  .market-resolution-inline-head span { max-width: 100%; text-align: left; font-size: 0.66rem !important; white-space: normal !important; overflow-wrap: anywhere !important; }
  .market-resolution-rule { grid-template-columns: 42px minmax(0, 1fr) !important; gap: 7px !important; }
  .market-resolution-rule > strong { font-size: 0.58rem !important; }
  .market-resolution-inline p { font-size: 0.7rem !important; line-height: 1.25 !important; overflow-wrap: anywhere !important; }

  .market-evidence-thread {
    display: grid !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 18px 14px 22px !important;
    border: 0 !important;
    background: rgba(247, 250, 255, 0.84) !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .market-evidence-thread > header { align-items: flex-start !important; }
  .market-evidence-thread h3 { margin: 7px 0 0 !important; font-size: clamp(1.16rem, 5.2vw, 1.48rem) !important; line-height: 1.12 !important; }
  .market-thread-intro { flex: 0 0 auto !important; margin: 7px 0 10px !important; font-size: 0.82rem !important; line-height: 1.34 !important; }
  .market-thread-timeline { flex: 0 0 auto !important; min-height: 0 !important; padding-bottom: 20px !important; }
  .market-thread-update { padding-bottom: 18px !important; }

}

/* --- Custom Portfolio Wallet Buttons (Copy & Faucet) --- */
.copy-address-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  min-height: 28px;
  border: 1px solid #e9d5ff;
  border-radius: 8px;
  color: #6d28d9;
  background: #f3e8ff;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-address-btn svg {
  flex-shrink: 0;
  color: #6d28d9;
}

.copy-address-btn:hover {
  background: #e9d5ff;
  color: #5b21b6;
  border-color: #d8b4fe;
  box-shadow: 0 2px 4px rgba(124, 58, 237, 0.08);
}

.faucet-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  min-height: 28px;
  border: 1px solid rgba(49, 87, 255, 0.25);
  border-radius: 8px;
  color: #3157ff;
  background: rgba(49, 87, 255, 0.05);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.faucet-link svg {
  flex-shrink: 0;
  color: #3157ff;
}

.faucet-link:hover {
  background: rgba(49, 87, 255, 0.12);
  border-color: rgba(49, 87, 255, 0.45);
  box-shadow: 0 2px 6px rgba(49, 87, 255, 0.08);
  transform: translateY(-0.5px);
}

/* Skeleton loaders */
@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton {
  display: block;
  border-radius: 10px;
  background: linear-gradient(90deg, #e8edf6 0%, #f4f7fc 45%, #e8edf6 90%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.35s ease-in-out infinite;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
}

.skeleton-line:last-child {
  margin-bottom: 0;
}

.skeleton-line.xs {
  width: 28%;
}

.skeleton-line.sm {
  width: 42%;
}

.skeleton-line.md {
  width: 62%;
}

.skeleton-line.lg {
  width: 82%;
}

.skeleton-line.xl {
  width: 96%;
}

.skeleton-chip {
  width: 72px;
  height: 28px;
  border-radius: 999px;
}

.skeleton-image {
  width: 100%;
  border-radius: 16px;
}

.skeleton-meter {
  width: 100%;
  height: 8px;
  border-radius: 999px;
}

.skeleton-probability {
  width: 72px;
  height: 42px;
  border-radius: 12px;
}

.story-card.skeleton-card {
  pointer-events: none;
  cursor: default;
}

.story-card.skeleton-card:hover {
  transform: none;
  box-shadow: 0 16px 38px rgba(30, 42, 92, 0.06);
}

.story-card.skeleton-card .skeleton-image {
  height: clamp(190px, 34vw, 320px);
}

.detail-summary-skeleton {
  display: grid;
  gap: 12px;
}

.thread-skeleton-timeline {
  display: grid;
  gap: 18px;
  margin-top: 8px;
}

.thread-skeleton-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.thread-skeleton-dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 999px;
}

.market-card.skeleton-market-card {
  pointer-events: none;
  cursor: default;
}

.market-card.skeleton-market-card:hover {
  transform: none;
}

.market-evidence-skeleton {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}

.market-evidence-skeleton-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 14px;
}

.portfolio-skeleton-grid {
  display: grid;
  gap: 14px;
}

.portfolio-skeleton-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(205, 216, 236, 0.84);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 48px rgba(24, 36, 78, 0.09);
}

.wallet-balance-skeleton {
  width: 120px;
  height: 28px;
  border-radius: 10px;
}

.skeleton-aria-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
