:root {
  color-scheme: dark;
  --bg: #07090c;
  --panel: #11161c;
  --panel-2: #171e26;
  --panel-3: #0d1218;
  --line: #26313d;
  --line-strong: #3a4858;
  --text: #f3f7fb;
  --muted: #8a98a8;
  --soft: #b9c5d2;
  --green: #28d17c;
  --red: #ff5f6d;
  --amber: #ffc857;
  --cyan: #54d7ff;
  --violet: #a78bfa;
  --glow: rgba(84, 215, 255, 0.18);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 70% 0%, rgba(84, 215, 255, 0.12), transparent 26rem),
    radial-gradient(circle at 8% 92%, rgba(40, 209, 124, 0.08), transparent 24rem),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 75%);
}

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

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(12, 16, 22, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(84, 215, 255, 0.55);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(40, 209, 124, 0.95), rgba(84, 215, 255, 0.92));
  color: #061014;
  font-weight: 900;
  box-shadow: 0 0 28px var(--glow);
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.top-links a {
  color: var(--muted);
  text-decoration: none;
}

.nav-item {
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--text);
}

.side-panel,
.module,
.feed-column,
.chart-panel,
.writer-panel,
.profile-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 22, 28, 0.9);
  box-shadow: var(--shadow);
}

.side-panel {
  margin-top: 24px;
  padding: 16px;
}

.side-panel h2,
.section-heading h2 {
  margin: 0;
  font-size: 15px;
}

.status-row,
.setting-row,
.ticker-row,
.source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.status-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.status-row strong {
  color: var(--soft);
}

.main-content {
  position: relative;
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

.top-links {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 22, 28, 0.74);
}

.top-links a {
  min-width: 86px;
  padding: 9px 12px;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
}

.top-links a.active,
.top-links a:hover {
  background: var(--panel-2);
  color: var(--text);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.market-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 16px;
  margin-bottom: 16px;
}

.chart-panel {
  overflow: hidden;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.section-heading span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  gap: 8px;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-3);
  color: var(--text);
  outline: none;
}

select {
  height: 38px;
  padding: 0 12px;
}

input {
  height: 42px;
  padding: 0 13px;
}

input[type="file"] {
  height: auto;
  padding: 11px 13px;
}

textarea {
  resize: vertical;
  padding: 13px;
  line-height: 1.55;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(84, 215, 255, 0.12);
}

#klineCanvas {
  display: block;
  width: 100%;
  height: 420px;
  background: #080c11;
}

.chart-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.chart-stat {
  padding: 11px 14px;
  border-right: 1px solid var(--line);
}

.chart-stat:last-child {
  border-right: 0;
}

.chart-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.chart-stat strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.ticker-strip {
  display: grid;
  gap: 10px;
}

.index-dial-card {
  display: grid;
  gap: 10px;
  min-height: 102px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(84, 215, 255, 0.08), transparent 45%),
    rgba(17, 22, 28, 0.92);
  cursor: pointer;
}

.index-dial-card:hover,
.index-dial-card.active {
  border-color: rgba(84, 215, 255, 0.65);
  background:
    linear-gradient(135deg, rgba(84, 215, 255, 0.14), transparent 48%),
    rgba(17, 22, 28, 0.96);
}

.dial-head,
.dial-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dial-head span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.dial-head strong {
  font-size: 13px;
}

.dial-ring {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--dial-color) var(--dial-value), rgba(255, 255, 255, 0.08) 0);
}

.dial-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--panel-3);
}

.dial-ring span {
  position: relative;
  font-size: 11px;
  font-weight: 900;
}

.dial-copy {
  display: grid;
  min-width: 0;
  justify-items: end;
  text-align: right;
}

.dial-copy strong {
  font-size: 18px;
  line-height: 1.15;
}

.dial-copy em {
  max-width: 138px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticker-tile {
  min-height: 102px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 22, 28, 0.9);
}

.ticker-tile strong {
  display: block;
  font-size: 20px;
}

.ticker-tile span {
  color: var(--muted);
  font-size: 13px;
}

.ticker-tile em {
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-weight: 800;
}

.filter-bar {
  display: flex;
  align-items: end;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
}

.filter-chip,
.primary-button,
.ghost-button {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.filter-chip {
  min-width: 96px;
  padding: 0 14px;
  background: rgba(17, 22, 28, 0.9);
  color: var(--text);
  white-space: nowrap;
}

.filter-chip.active,
.filter-chip:hover {
  border-color: var(--cyan);
  background: rgba(84, 215, 255, 0.1);
  color: var(--cyan);
}

.search-box {
  display: grid;
  flex: 1;
  min-width: 240px;
  gap: 6px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.feed-column,
.module,
.writer-panel,
.profile-panel {
  overflow: hidden;
}

.feed-list,
.watch-list,
.source-list,
.article-list {
  display: grid;
}

.feed-item {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.feed-item:last-child {
  border-bottom: 0;
}

.feed-time {
  color: var(--muted);
  font-size: 13px;
}

.feed-title {
  margin: 0 0 7px;
  font-size: 16px;
  line-height: 1.35;
}

.feed-reader-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.feed-reader-link:hover {
  color: var(--cyan);
}

.feed-summary {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.feed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
}

.badge.crypto {
  color: var(--amber);
}

.badge.macro {
  color: var(--cyan);
}

.badge.regulation {
  color: var(--violet);
}

.impact {
  min-width: 72px;
  align-self: start;
  text-align: right;
  color: var(--green);
  font-weight: 800;
}

.right-column {
  display: grid;
  gap: 16px;
}

.watch-row,
.source-row {
  min-height: 54px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.watch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.watch-row[data-chart-symbol] {
  cursor: pointer;
}

.watch-row[data-chart-symbol]:hover,
.watch-row[data-chart-symbol].active {
  background: rgba(84, 215, 255, 0.08);
}

.watch-row:last-child,
.source-row:last-child {
  border-bottom: 0;
}

.watch-row span,
.source-row span {
  color: var(--muted);
  font-size: 13px;
}

.watch-price {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
}

.positive {
  color: var(--green) !important;
}

.negative {
  color: var(--red) !important;
}

.empty-state {
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

.content-grid {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.timemachine-grid {
  display: grid;
  gap: 16px;
}

.writer-panel.wide {
  grid-column: 1 / -1;
}

.profile-panel {
  padding: 22px;
}

.avatar {
  display: block;
  width: 132px;
  height: 132px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 0 32px rgba(84, 215, 255, 0.15);
}

.profile-panel h2 {
  margin: 18px 0 8px;
}

.profile-panel p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.login-state {
  display: grid;
  gap: 10px;
}

.primary-button {
  padding: 0 16px;
  border-color: rgba(40, 209, 124, 0.6);
  background: linear-gradient(135deg, rgba(40, 209, 124, 0.92), rgba(84, 215, 255, 0.82));
  color: #061014;
  font-weight: 800;
}

.danger-button {
  height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 95, 109, 0.55);
  border-radius: 8px;
  background: rgba(255, 95, 109, 0.1);
  color: var(--red);
  cursor: pointer;
  font-weight: 800;
}

.danger-button:hover {
  background: rgba(255, 95, 109, 0.18);
}

.ghost-button {
  padding: 0 14px;
  background: transparent;
  color: var(--text);
}

.split-content {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: 560px;
}

.article-list {
  border-right: 1px solid var(--line);
}

.article-card {
  padding: 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.article-card:hover,
.article-card.active {
  background: rgba(84, 215, 255, 0.08);
}

.article-card strong {
  display: block;
  line-height: 1.35;
}

.article-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.library-layout {
  grid-template-columns: 1fr;
  min-height: auto;
}

.library-layout .article-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding: 14px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

.entry-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 318px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(84, 215, 255, 0.1), transparent 52%),
    rgba(13, 18, 24, 0.92);
}

.entry-card:hover,
.entry-card.active {
  border-color: rgba(84, 215, 255, 0.68);
  background:
    linear-gradient(135deg, rgba(84, 215, 255, 0.16), transparent 54%),
    rgba(17, 22, 28, 0.98);
}

.entry-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: #0a1017;
}

.entry-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entry-cover--placeholder {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(40, 209, 124, 0.16), transparent 42%),
    linear-gradient(90deg, rgba(84, 215, 255, 0.16), rgba(17, 22, 28, 0.86));
}

.entry-cover--placeholder span {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.entry-cover--placeholder strong {
  color: var(--text);
  font-size: 42px;
  line-height: 1;
}

.entry-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.entry-kicker,
.entry-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.entry-kicker span,
.entry-kicker time,
.entry-card-footer span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.entry-kicker span:first-child {
  color: var(--cyan);
  font-weight: 900;
  text-transform: uppercase;
}

.entry-card strong {
  font-size: 19px;
}

.entry-excerpt {
  display: -webkit-box !important;
  min-height: 60px;
  overflow: hidden;
  margin: 0 !important;
  color: var(--soft) !important;
  font-size: 13px !important;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.article-hero-cover {
  overflow: hidden;
  margin: -26px -26px 22px;
  border-bottom: 1px solid var(--line);
  aspect-ratio: 21 / 9;
  max-height: 360px;
  background: #0a1017;
}

.article-hero-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-lead {
  max-width: 860px;
  margin: 0 0 18px;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.65;
}

.library-hint {
  display: grid;
  align-content: center;
  min-height: 220px;
  padding: 32px;
  color: var(--muted);
}

.library-hint span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.library-hint strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 24px;
}

.library-hint p {
  max-width: 520px;
  margin: 10px 0 0;
  color: var(--soft);
  line-height: 1.7;
}

.article-view {
  min-width: 0;
  padding: 26px;
}

.article-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.article-topline h1 {
  margin-top: 0;
}

.article-view h1,
.article-view h2,
.article-view h3 {
  line-height: 1.25;
}

.article-view p,
.article-view li {
  color: var(--soft);
  line-height: 1.75;
}

.article-view a {
  color: var(--cyan);
}

.article-view pre {
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070b10;
}

.article-view code {
  color: var(--cyan);
}

.article-view table {
  width: 100%;
  border-collapse: collapse;
}

.article-view th,
.article-view td {
  padding: 9px;
  border: 1px solid var(--line);
}

.attachment-stack {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.attachment-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 11, 16, 0.72);
}

.attachment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.attachment-heading a {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.attachment-preview iframe {
  display: block;
  width: 100%;
  min-height: 620px;
  border: 0;
  background: #0b1016;
}

.attachment-preview--image img {
  display: block;
  width: 100%;
  max-height: 680px;
  object-fit: contain;
  background: #090e14;
}

.docx-render {
  display: block;
  max-height: 720px;
  overflow: auto;
  padding: 22px;
  background: #f7f8fb;
  color: #141a21;
  font-family: ui-serif, Georgia, "Times New Roman", "Songti SC", SimSun, serif;
}

.docx-render p,
.docx-render li,
.docx-render td,
.docx-render h1,
.docx-render h2,
.docx-render h3 {
  color: #141a21;
  white-space: pre-wrap;
}

.docx-render p {
  margin: 0 0 10px;
  line-height: 1.78;
}

.docx-render h1,
.docx-render h2,
.docx-render h3 {
  margin: 18px 0 10px;
  line-height: 1.35;
}

.docx-render h1 {
  font-size: 24px;
  text-align: center;
}

.docx-render h2 {
  font-size: 20px;
}

.docx-render h3 {
  font-size: 17px;
}

.docx-list {
  margin: 8px 0 12px 1.4em;
  padding: 0;
}

.docx-table {
  width: 100%;
  margin: 14px 0 18px;
  border-collapse: collapse;
  color: #141a21;
  table-layout: auto;
}

.docx-table td {
  padding: 8px 10px;
  border: 1px solid #c7d0dc;
  vertical-align: top;
  line-height: 1.65;
}

.docx-align-center {
  text-align: center;
}

.docx-align-right {
  text-align: right;
}

.docx-align-both {
  text-align: justify;
}

.docx-tab {
  display: inline-block;
  width: 2em;
}

.timemachine-panel {
  overflow: visible;
}

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

.archive-actions input {
  width: 154px;
  color-scheme: dark;
}

.archive-workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  align-items: start;
}

.calendar-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
  padding: 16px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(84, 215, 255, 0.08), transparent 48%),
    rgba(13, 18, 24, 0.78);
}

.calendar-toolbar,
.calendar-weekdays,
.archive-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.calendar-toolbar {
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
}

.calendar-toolbar strong {
  text-align: center;
  font-size: 17px;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 22px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  display: grid;
  min-height: 48px;
  place-items: center;
  padding: 5px;
  border: 1px solid rgba(84, 215, 255, calc(var(--heat, 0) * 0.68));
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(84, 215, 255, var(--heat, 0)), rgba(40, 209, 124, calc(var(--heat, 0) * 0.42))),
    rgba(17, 22, 28, 0.82);
  color: var(--text);
  cursor: pointer;
}

.calendar-day strong {
  font-size: 14px;
  line-height: 1;
}

.calendar-day span {
  margin-top: 3px;
  color: var(--soft);
  font-size: 10px;
}

.calendar-day.no-data {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(185, 197, 210, 0.3);
  cursor: not-allowed;
}

.calendar-day.empty {
  min-height: 48px;
}

.calendar-day.active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(84, 215, 255, 0.18), 0 0 24px rgba(84, 215, 255, 0.16);
}

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-legend i {
  width: 24px;
  height: 8px;
  border-radius: 999px;
  background: rgba(84, 215, 255, 0.16);
}

.calendar-legend i.mid {
  background: rgba(84, 215, 255, 0.42);
}

.calendar-legend i.hot {
  background: rgba(40, 209, 124, 0.72);
}

.archive-view {
  display: grid;
  gap: 18px;
}

.daily-brief {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(84, 215, 255, 0.12), transparent 50%),
    rgba(13, 18, 24, 0.86);
}

.brief-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.daily-brief h1 {
  margin-bottom: 10px;
  font-size: 36px;
}

.daily-brief p {
  max-width: 880px;
  margin: 0;
  color: var(--soft);
  font-size: 17px;
  line-height: 1.75;
}

.brief-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.brief-metrics div,
.lead-headlines .archive-reader-link,
.cluster-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 11, 16, 0.54);
}

.brief-metrics div {
  padding: 14px;
}

.brief-metrics span,
.cluster-heading span,
.cluster-meta span,
.raw-feed summary span {
  color: var(--muted);
  font-size: 12px;
}

.brief-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.brief-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brief-strip span {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
}

.brief-strip strong {
  color: var(--text);
}

.lead-headlines {
  display: grid;
  gap: 8px;
}

.lead-headlines .archive-reader-link {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.lead-headlines .archive-reader-link:hover {
  border-color: rgba(84, 215, 255, 0.58);
}

.lead-headlines span {
  color: var(--muted);
  font-size: 12px;
}

.lead-headlines strong {
  font-size: 14px;
  line-height: 1.4;
}

.cluster-section {
  display: grid;
  gap: 14px;
}

.cluster-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.cluster-heading h2 {
  margin: 0 0 4px;
}

.cluster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.cluster-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-top: 3px solid var(--cyan);
}

.cluster-card.tone-green {
  border-top-color: var(--green);
}

.cluster-card.tone-amber {
  border-top-color: var(--amber);
}

.cluster-card.tone-violet {
  border-top-color: var(--violet);
}

.cluster-topline,
.raw-feed summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cluster-topline span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.cluster-topline strong {
  color: var(--soft);
  font-size: 12px;
}

.cluster-card h2 {
  margin: 0;
  font-size: 19px;
}

.cluster-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.cluster-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cluster-meta span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.cluster-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.cluster-details summary {
  color: var(--cyan);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.raw-feed {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 18, 24, 0.72);
}

.raw-feed summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 900;
}

.raw-feed .archive-timeline {
  margin: 0;
  padding: 0 16px 16px;
}

.archive-empty strong,
.archive-empty span {
  display: block;
}

.archive-empty strong {
  margin-bottom: 6px;
  color: var(--text);
}

.archive-timeline {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.archive-bucket {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 18, 24, 0.72);
}

.archive-bucket time {
  color: var(--muted);
  font-size: 13px;
}

.archive-bucket h2 {
  margin: 8px 0;
}

.archive-items {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.archive-reader-link {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 22, 28, 0.72);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.archive-reader-link:hover {
  border-color: rgba(84, 215, 255, 0.58);
  background: rgba(84, 215, 255, 0.08);
}

.archive-items span {
  color: var(--muted);
  font-size: 13px;
}

.modal {
  width: min(720px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: hidden;
}

#editorModal {
  width: min(920px, calc(100vw - 32px));
}

.reader-modal {
  width: min(1120px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
}

.reader-body {
  gap: 0;
  padding-bottom: 0;
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

.reader-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 22, 28, 0.96);
}

.reader-heading h2 {
  overflow: hidden;
  max-width: 640px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.reader-content {
  max-height: calc(100vh - 90px);
  overflow: auto;
}

.reader-content--external {
  padding: 0;
}

.external-reader-shell {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr);
  height: calc(100vh - 90px);
  min-height: 560px;
}

.external-summary {
  display: grid;
  gap: 12px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(84, 215, 255, 0.1), transparent 46%),
    rgba(13, 18, 24, 0.94);
}

.reader-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.reader-source-row a {
  color: var(--cyan);
  font-weight: 800;
  text-decoration: none;
}

.external-summary h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
}

.external-summary p {
  max-width: 860px;
  margin: 0;
  color: var(--soft);
  line-height: 1.65;
}

.reader-fallback {
  color: var(--muted) !important;
  font-size: 13px;
}

.reader-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
  background: #fff;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.modal-body {
  display: grid;
  gap: 14px;
  padding: 0 0 18px;
  width: 100%;
  min-width: 0;
  max-height: calc(100vh - 34px);
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-body > label,
.modal-body > .cover-cropper,
.modal-body > .primary-button,
.form-error {
  margin: 0 24px;
}

.modal-body label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.editor-body {
  width: 100%;
}

.editor-body textarea {
  min-height: 320px;
}

.cover-cropper {
  display: grid;
  gap: 10px;
}

.cover-stage {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #081018;
}

.cover-stage canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  cursor: grab;
  touch-action: none;
}

.cover-stage canvas.dragging {
  cursor: grabbing;
}

.cover-controls {
  display: flex;
  align-items: end;
  gap: 12px;
}

.range-field {
  display: grid;
  flex: 1;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.range-field input[type="range"] {
  height: 22px;
  padding: 0;
}

.form-error {
  min-height: 18px;
  color: var(--red);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1120px) {
  .market-board,
  .dashboard-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    height: auto;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 12px;
    align-items: center;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    margin-bottom: 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }

  .brand span {
    display: none;
  }

  .nav-list {
    grid-column: 1 / -1;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    flex: 0 0 auto;
    padding: 8px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .side-panel,
  .top-links {
    display: none;
  }

  .main-content {
    padding: 12px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
  }

  .eyebrow {
    display: none;
  }

  h1 {
    font-size: 25px;
  }

  .section-heading {
    min-height: 0;
    padding: 11px 12px;
  }

  .market-board {
    gap: 10px;
    margin-bottom: 10px;
  }

  #klineCanvas {
    height: 320px;
  }

  .ticker-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .index-dial-card {
    flex: 0 0 210px;
    min-height: 94px;
  }

  .dashboard-grid {
    gap: 10px;
  }

  .timemachine-panel > .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .archive-actions {
    flex-wrap: wrap;
  }

  .archive-actions input {
    flex: 1;
    min-width: 160px;
  }

  .archive-workspace {
    grid-template-columns: 1fr;
  }

  .calendar-panel {
    position: static;
    gap: 10px;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .calendar-day,
  .calendar-day.empty {
    min-height: 42px;
  }

  .archive-view {
    scroll-margin-top: 118px;
  }

  .daily-brief {
    padding: 16px;
  }

  .brief-metrics {
    grid-template-columns: repeat(3, minmax(92px, 1fr));
    overflow-x: auto;
  }

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

  .split-content {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .article-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #view-timemachine .article-list,
  #view-blog .article-list,
  #view-research .article-list {
    display: flex;
    overflow-x: auto;
  }

  #view-timemachine .article-card,
  #view-blog .article-card,
  #view-research .article-card {
    flex: 0 0 178px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  #view-timemachine .article-view,
  #view-blog .article-view,
  #view-research .article-view {
    scroll-margin-top: 118px;
  }

  #view-blog .profile-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 14px;
    align-items: center;
    padding: 14px;
  }

  #view-blog .avatar {
    grid-row: span 3;
    width: 72px;
    height: 72px;
  }

  #view-blog .profile-panel h2 {
    margin: 0;
    font-size: 18px;
  }

  #view-blog .profile-panel p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
  }

  #view-blog .login-state {
    grid-column: 2;
  }

  .library-layout .article-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 12px;
  }

  #view-blog .library-layout .article-card.entry-card,
  #view-research .library-layout .article-card.entry-card {
    flex: 0 0 300px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .library-layout .article-view {
    scroll-margin-top: 118px;
  }
}

@media (max-width: 640px) {
  .main-content,
  .sidebar {
    padding: 10px;
  }

  .sidebar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
  }

  .brand > div {
    display: none;
  }

  .nav-list {
    grid-column: auto;
    padding-bottom: 0;
  }

  h1 {
    font-size: 23px;
  }

  .brand strong {
    font-size: 14px;
  }

  .chart-panel .section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar select {
    min-width: 0;
    flex: 1;
  }

  #klineCanvas {
    height: 250px;
  }

  .chart-stats {
    grid-template-columns: repeat(5, minmax(78px, 1fr));
    overflow-x: auto;
  }

  .chart-stat {
    min-width: 78px;
    padding: 8px 10px;
  }

  .dial-ring {
    width: 48px;
    height: 48px;
  }

  .dial-copy strong {
    font-size: 16px;
  }

  .filter-bar {
    align-items: stretch;
    flex-wrap: nowrap;
  }

  .search-box {
    flex: 0 0 220px;
    min-width: 220px;
    margin-left: 0;
  }

  .feed-item {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .impact {
    text-align: left;
  }

  .ticker-strip {
    margin-right: -10px;
    padding-right: 10px;
  }

  .index-dial-card {
    flex-basis: 184px;
    min-height: 88px;
    padding: 10px;
  }

  .feed-column .section-heading,
  .module .section-heading {
    min-height: 48px;
  }

  .calendar-toolbar {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
  }

  .icon-button {
    width: 38px;
  }

  .calendar-weekdays,
  .archive-calendar {
    gap: 5px;
  }

  .calendar-weekdays span {
    font-size: 10px;
  }

  .calendar-day,
  .calendar-day.empty {
    min-height: 36px;
    border-radius: 7px;
  }

  .calendar-day strong {
    font-size: 12px;
  }

  .calendar-day span {
    font-size: 9px;
  }

  .daily-brief h1 {
    font-size: 28px;
  }

  .daily-brief p {
    font-size: 14px;
    line-height: 1.65;
  }

  .brief-metrics div {
    min-width: 92px;
    padding: 11px;
  }

  .brief-metrics strong {
    font-size: 19px;
  }

  .lead-headlines strong,
  .cluster-card h2 {
    font-size: 16px;
  }

  .cluster-card {
    padding: 13px;
  }

  .article-view {
    padding: 16px;
  }

  .reader-modal {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
  }

  .reader-heading {
    align-items: start;
    padding: 12px;
  }

  .reader-heading h2 {
    max-width: 100%;
    white-space: normal;
  }

  .reader-actions {
    width: 100%;
    justify-content: stretch;
  }

  .reader-actions .ghost-button,
  .reader-actions .danger-button {
    flex: 1;
  }

  .reader-content {
    max-height: calc(100vh - 130px);
  }

  .external-reader-shell {
    height: calc(100vh - 130px);
    min-height: 480px;
  }

  .external-summary {
    padding: 16px;
  }

  .external-summary h1 {
    font-size: 21px;
  }

  .reader-frame {
    min-height: 460px;
  }

  .article-card {
    padding: 12px;
  }

  #view-timemachine .article-card,
  #view-blog .article-card,
  #view-research .article-card {
    flex-basis: 164px;
  }

  #view-blog .library-layout .article-card.entry-card,
  #view-research .library-layout .article-card.entry-card {
    flex-basis: 278px;
    min-height: 304px;
    padding: 0;
  }

  .entry-card-body {
    padding: 12px;
  }

  .entry-card strong {
    font-size: 17px;
  }

  .entry-excerpt {
    min-height: 56px;
    font-size: 12px !important;
  }

  .article-hero-cover {
    margin: -16px -16px 16px;
    aspect-ratio: 16 / 9;
  }

  .article-lead {
    font-size: 15px;
    line-height: 1.6;
  }

  .cover-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .cover-controls .ghost-button {
    width: 100%;
  }

  #view-blog .profile-panel {
    padding: 12px;
  }

  #view-blog .avatar {
    width: 58px;
    height: 58px;
  }

  #view-blog .login-state .primary-button,
  #view-blog .login-state .ghost-button {
    width: 100%;
  }

  .top-links {
    width: 100%;
  }

  .top-links a {
    flex: 1;
    min-width: 0;
  }
}
