:root {
  color-scheme: dark;
  --obsidian: #070a0f;
  --graphite: #141a22;
  --navy: #0b1f3a;
  --gold: #c7a86b;
  --blue: #1f7bff;
  --cyan: #22d3c5;
  --green: #17b26a;
  --red: #d92d20;
  --mist: #eef3f8;
  --gray: #8a95a6;
  --line: rgba(199, 168, 107, 0.22);
  --panel: rgba(20, 26, 34, 0.82);
  --panel-strong: rgba(11, 31, 58, 0.78);
  font-family: "Inter", "SF Pro Display", "HarmonyOS Sans SC", "MiSans", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--obsidian);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--mist);
  background:
    linear-gradient(rgba(34, 211, 197, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 197, 0.04) 1px, transparent 1px),
    linear-gradient(135deg, #070a0f 0%, #09111e 38%, #0b1f3a 100%);
  background-size: 44px 44px, 44px 44px, cover;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(180deg, rgba(7, 10, 15, 0.1), rgba(7, 10, 15, 0.72)),
    repeating-linear-gradient(120deg, transparent 0 18px, rgba(199, 168, 107, 0.035) 18px 19px);
}

img {
  display: block;
  max-width: 100%;
}

button,
a,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.sticky-overview {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(560px, 1.1fr);
  gap: 10px;
  align-items: stretch;
  min-height: 0;
  padding: 10px 0 12px;
  margin: -12px 0 18px;
  background: linear-gradient(180deg, rgba(7, 10, 15, 0.98) 0%, rgba(7, 10, 15, 0.94) 78%, rgba(7, 10, 15, 0.72) 100%);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.site-header {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 118px;
  padding: 14px 18px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(20, 26, 34, 0.92), rgba(11, 31, 58, 0.78));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.site-header::after {
  position: absolute;
  right: 72px;
  bottom: -46px;
  width: 260px;
  height: 132px;
  content: "";
  background: url("./assets/brand/data-flow.png") center / contain no-repeat;
  opacity: 0.28;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 8px;
  background: rgba(7, 10, 15, 0.68);
  border: 1px solid rgba(199, 168, 107, 0.48);
  border-radius: 8px;
}

.brand-mark img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.title-block {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.eyebrow,
.toolbar-kicker,
.metric-label,
.metric-foot,
.dialog-date {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 3.8vw, 56px);
  line-height: 1.05;
  letter-spacing: 0;
}

.header-signal {
  position: relative;
  z-index: 1;
  width: 74px;
  opacity: 0.76;
}

.home-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  color: var(--mist);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  background: rgba(7, 10, 15, 0.66);
  border: 1px solid rgba(199, 168, 107, 0.46);
  border-radius: 8px;
  text-decoration: none;
}

.home-link:hover {
  color: #fff;
  border-color: rgba(241, 213, 137, 0.78);
  background: rgba(199, 168, 107, 0.16);
}

.summary-strip {
  display: grid;
  grid-template-columns: 0.75fr 0.95fr 1.5fr;
  gap: 10px;
  margin: 0;
}

.metric-card {
  min-height: 118px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid rgba(199, 168, 107, 0.2);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(238, 243, 248, 0.05);
}

.metric-card.primary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(135deg, rgba(20, 26, 34, 0.95), rgba(11, 31, 58, 0.92));
}

.metric-card strong {
  display: block;
  margin: 6px 0 7px;
  color: #fff;
  font-family: "DIN Alternate", "Inter", sans-serif;
  font-size: 38px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.keyword-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: #d8f8f5;
  font-size: 13px;
  line-height: 1.2;
  background: rgba(34, 211, 197, 0.1);
  border: 1px solid rgba(34, 211, 197, 0.28);
  border-radius: 999px;
}

.keyword-list.compact span {
  color: var(--mist);
  background: rgba(199, 168, 107, 0.12);
  border-color: rgba(199, 168, 107, 0.28);
}

.wall-stage {
  position: relative;
  isolation: isolate;
}

.market-layer {
  position: absolute;
  top: 52px;
  right: 0;
  left: 0;
  z-index: 0;
  min-height: 420px;
  height: min(54vw, 640px);
  overflow: hidden;
  pointer-events: none;
}

.market-layer::before,
.market-layer::after {
  position: absolute;
  content: "";
}

.market-layer::before {
  top: 72px;
  right: 5%;
  left: 6%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(199, 168, 107, 0.42), rgba(34, 211, 197, 0.38), transparent);
  box-shadow:
    0 92px 0 rgba(34, 211, 197, 0.12),
    0 184px 0 rgba(199, 168, 107, 0.1),
    0 276px 0 rgba(34, 211, 197, 0.08);
}

.market-layer::after {
  top: 18px;
  right: 11%;
  width: 420px;
  height: 420px;
  background:
    linear-gradient(90deg, transparent 49%, rgba(34, 211, 197, 0.14) 50%, transparent 51%),
    linear-gradient(transparent 49%, rgba(34, 211, 197, 0.12) 50%, transparent 51%);
  border: 1px solid rgba(34, 211, 197, 0.08);
  opacity: 0.38;
  transform: rotate(8deg);
}

.signal-board,
.radar-plate,
.kline-plate,
.ai-core-plate {
  position: absolute;
  background:
    linear-gradient(135deg, rgba(20, 26, 34, 0.72), rgba(11, 31, 58, 0.34)),
    rgba(7, 10, 15, 0.3);
  border: 1px solid rgba(199, 168, 107, 0.18);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(238, 243, 248, 0.05), 0 20px 58px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
}

.signal-board {
  top: 88px;
  right: 8%;
  width: min(420px, 30vw);
  min-width: 260px;
  padding: 16px 18px 18px;
}

.signal-title,
.kline-plate span {
  color: rgba(199, 168, 107, 0.86);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.signal-bars {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.signal-bars i {
  display: block;
  height: 7px;
  overflow: hidden;
  background: rgba(238, 243, 248, 0.06);
  border: 1px solid rgba(238, 243, 248, 0.08);
  border-radius: 999px;
}

.signal-bars i::before {
  display: block;
  width: var(--bar-width, 64%);
  height: 100%;
  content: "";
  background: linear-gradient(90deg, rgba(199, 168, 107, 0.68), rgba(34, 211, 197, 0.82), rgba(31, 123, 255, 0.58));
  border-radius: inherit;
}

.signal-bars i:nth-child(2)::before {
  --bar-width: 82%;
}

.signal-bars i:nth-child(3)::before {
  --bar-width: 46%;
}

.signal-bars i:nth-child(4)::before {
  --bar-width: 72%;
}

.radar-plate {
  top: 230px;
  right: 21%;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border-radius: 999px;
  opacity: 0.9;
}

.radar-plate img {
  width: 92px;
  opacity: 0.72;
}

.kline-plate {
  top: 306px;
  left: 42%;
  display: flex;
  gap: 12px;
  align-items: center;
  width: 274px;
  padding: 12px 14px;
  opacity: 0.82;
}

.kline-plate img {
  width: 94px;
  opacity: 0.72;
}

.ai-core-plate {
  top: 182px;
  left: 5%;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  opacity: 0.72;
  transform: rotate(45deg);
}

.ai-core-plate img {
  width: 48px;
  transform: rotate(-45deg);
}

.wall-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.wall-toolbar h2 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.1;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  color: var(--mist);
  text-decoration: none;
  background: rgba(238, 243, 248, 0.06);
  border: 1px solid rgba(238, 243, 248, 0.14);
  border-radius: 8px;
}

.admin-link:hover {
  border-color: rgba(199, 168, 107, 0.52);
}

.waterfall {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.waterfall-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: var(--column-offset, 0);
}

.review-card {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px;
  color: inherit;
  cursor: zoom-in;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(20, 26, 34, 0.86), rgba(11, 31, 58, 0.62)),
    rgba(20, 26, 34, 0.78);
  border: 1px solid rgba(199, 168, 107, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
  break-inside: avoid;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.review-card:hover {
  transform: translateY(-2px);
  border-color: rgba(199, 168, 107, 0.48);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.38);
}

.phone-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 0.58;
  background: #05070b;
  border: 1px solid rgba(238, 243, 248, 0.12);
  border-radius: 22px;
  box-shadow: inset 0 0 0 5px #0b0e14;
}

.phone-frame::before {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 2;
  width: 72px;
  height: 18px;
  content: "";
  background: #05070b;
  border: 1px solid rgba(238, 243, 248, 0.08);
  border-radius: 999px;
  transform: translateX(-50%);
}

.phone-frame.has-image::before {
  display: none;
}

.phone-frame.has-image {
  display: block;
  aspect-ratio: auto;
  padding: 8px;
  overflow: visible;
  background:
    linear-gradient(145deg, rgba(238, 243, 248, 0.1), rgba(7, 10, 15, 0.3)),
    rgba(20, 26, 34, 0.78);
  box-shadow: inset 0 0 0 1px rgba(238, 243, 248, 0.05), 0 14px 34px rgba(0, 0, 0, 0.28);
}

.phone-screen {
  min-height: 380px;
  padding: 42px 14px 18px;
  background:
    linear-gradient(180deg, rgba(11, 31, 58, 0.95), rgba(7, 10, 15, 0.98)),
    linear-gradient(rgba(34, 211, 197, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 197, 0.04) 1px, transparent 1px);
  background-size: cover, 24px 24px, 24px 24px;
}

.phone-screen img {
  width: 100%;
  height: auto;
  border-radius: 18px;
}

.phone-screen.has-image {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  border-radius: 16px;
}

.phone-screen.has-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top center;
  border-radius: 14px;
}

.review-card .phone-screen.has-image {
  max-height: none;
}

.mock-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: rgba(238, 243, 248, 0.72);
  font-size: 12px;
}

.mock-chat-title {
  margin: 0 0 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.chat-bubble {
  width: fit-content;
  max-width: 86%;
  margin-bottom: 9px;
  padding: 9px 11px;
  color: #0a1019;
  font-size: 13px;
  line-height: 1.45;
  background: #e8eef5;
  border-radius: 14px 14px 14px 4px;
}

.chat-bubble.right {
  margin-left: auto;
  color: #04110e;
  background: #80e2c6;
  border-radius: 14px 14px 4px;
}

.placeholder-stamp {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  background: rgba(199, 168, 107, 0.1);
  border: 1px solid rgba(199, 168, 107, 0.24);
  border-radius: 999px;
}

.card-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 74px;
  padding: 10px 4px 2px;
}

.card-meta h3 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.35;
}

.card-meta p {
  margin: 0;
  color: var(--gray);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.sentinel {
  height: 1px;
}

.review-dialog {
  width: min(1500px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  overflow: hidden;
  color: var(--mist);
  background: rgba(7, 10, 15, 0.96);
  border: 1px solid rgba(199, 168, 107, 0.38);
  border-radius: 8px;
  box-shadow: 0 36px 120px rgba(0, 0, 0, 0.68);
}

.review-dialog::backdrop {
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(8px);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 38px;
  height: 38px;
  color: var(--mist);
  cursor: pointer;
  background: rgba(238, 243, 248, 0.08);
  border: 1px solid rgba(238, 243, 248, 0.18);
  border-radius: 999px;
}

.dialog-grid {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(280px, 340px);
  gap: 0;
}

.dialog-media {
  display: grid;
  place-items: start center;
  min-height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
  padding: 20px;
  overflow: auto;
  background:
    linear-gradient(rgba(34, 211, 197, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 197, 0.035) 1px, transparent 1px),
    #070a0f;
  background-size: 32px 32px;
}

.dialog-media .phone-frame {
  width: min(760px, 100%);
}

.dialog-media .phone-frame.has-image {
  width: min(760px, 100%);
  aspect-ratio: auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.dialog-media .phone-screen {
  min-height: min(76vh, 860px);
}

.dialog-media .phone-screen.has-image {
  min-height: 0;
  max-height: none;
  overflow: visible;
  background: transparent;
  border-radius: 0;
}

.dialog-media .phone-screen.has-image img {
  height: auto;
  object-fit: contain;
  border-radius: 18px;
}

.dialog-media .mock-status {
  font-size: 15px;
}

.dialog-media .mock-chat-title {
  font-size: 22px;
}

.dialog-media .chat-bubble {
  max-width: 88%;
  padding: 13px 16px;
  font-size: 18px;
  line-height: 1.5;
}

.dialog-meta {
  padding: 54px 24px 24px;
  background: linear-gradient(180deg, rgba(20, 26, 34, 0.98), rgba(11, 31, 58, 0.76));
  border-left: 1px solid rgba(199, 168, 107, 0.18);
}

.dialog-meta h3 {
  margin: 10px 0 12px;
  font-size: 28px;
  line-height: 1.2;
}

.dialog-meta p {
  color: var(--gray);
  line-height: 1.7;
}

.admin-page {
  max-width: 1120px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(320px, 0.58fr);
  gap: 14px;
}

.admin-panel {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-panel h2 {
  margin-bottom: 14px;
  font-size: 22px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  color: var(--mist);
  background: rgba(7, 10, 15, 0.72);
  border: 1px solid rgba(238, 243, 248, 0.16);
  border-radius: 8px;
}

.field input {
  min-height: 42px;
  padding: 0 12px;
}

.field textarea {
  min-height: 180px;
  padding: 12px;
  resize: vertical;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.control-button {
  min-height: 38px;
  padding: 0 12px;
  color: #081018;
  cursor: pointer;
  background: var(--gold);
  border: 0;
  border-radius: 8px;
}

.control-button.secondary {
  color: var(--mist);
  background: rgba(238, 243, 248, 0.08);
  border: 1px solid rgba(238, 243, 248, 0.16);
}

.json-output {
  min-height: 420px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 1180px) {
  .waterfall {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100% - 20px, 720px);
    padding-top: 10px;
  }

  .sticky-overview {
    grid-template-columns: 1fr;
    padding: 8px 0 10px;
    margin-top: -10px;
  }

  .site-header {
    grid-template-columns: auto 1fr;
    min-height: 78px;
    padding: 10px 12px;
  }

  .home-link {
    grid-column: 1 / -1;
    width: 100%;
  }

  .header-signal {
    display: none;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
  }

  h1 {
    font-size: 30px;
  }

  .admin-layout,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 74px;
    padding: 10px;
  }

  .metric-card strong {
    font-size: 26px;
  }

  .market-layer {
    top: 36px;
    min-height: 320px;
    height: 430px;
  }

  .signal-board {
    right: 4%;
    min-width: 210px;
    width: 48vw;
  }

  .radar-plate,
  .kline-plate {
    display: none;
  }

  .ai-core-plate {
    left: auto;
    right: 12%;
    top: 232px;
    width: 64px;
    height: 64px;
  }

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

  .waterfall-column {
    gap: 10px;
  }

  .review-card {
    margin-bottom: 10px;
    padding: 8px;
  }

  .phone-frame {
    border-radius: 22px;
  }

  .phone-screen {
    min-height: 300px;
    padding: 36px 10px 14px;
  }

  .chat-bubble {
    font-size: 12px;
  }

  .dialog-meta {
    border-left: 0;
    border-top: 1px solid rgba(199, 168, 107, 0.18);
  }

  .dialog-media {
    min-height: 70vh;
    max-height: 70vh;
  }

  .dialog-media .phone-frame {
    width: min(560px, 100%);
  }
}

@media (max-width: 560px) {
  .market-layer {
    display: none;
  }

  .waterfall {
    grid-template-columns: 1fr;
  }

  .waterfall-column {
    padding-top: 0 !important;
  }

  .wall-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 760px) and (min-width: 861px) {
  .site-header {
    min-height: 92px;
    padding: 10px 14px;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
  }

  .brand-mark img {
    width: 42px;
    height: 42px;
  }

  h1 {
    font-size: 40px;
  }

  .metric-card {
    min-height: 92px;
    padding: 10px 12px;
  }

  .metric-card strong {
    margin: 5px 0;
    font-size: 30px;
  }
}
