:root {
  --app-bg: #fff7f5;
  --app-surface: #ffffff;
  --app-ink: #281b1b;
  --app-muted: #786565;
  --app-line: #efd9d5;
  --app-navy: #8f1018;
  --app-blue: #b51f2b;
  --app-blue-soft: #fff0ed;
  --app-red: #d92d38;
  --app-red-soft: #fff0ed;
  --app-green: #11805b;
  --app-green-soft: #eaf7f1;
  --app-cyan: #9b5421;
  --app-cyan-soft: #fff4e8;
  --app-amber: #b47908;
  --app-amber-soft: #fff6dc;
  --app-coral: #e05035;
  --primary: #c52431;
  --primary-dark: #99151f;
  --bg: #fff7f5;
  --card-bg: #fff;
  --text: #281b1b;
  --text-secondary: #786565;
  --border: #efd9d5;
  --red: #d92d38;
  --green: #11805b;
  --blue: #b51f2b;
  --cyan: #9b5421;
  --amber: #b47908;
}

html, body {
  min-height: 100%;
  background-color: #fff7f5 !important;
  color: #281b1b !important;
}

body {
  min-height: 100vh;
  background-image: linear-gradient(rgba(255, 249, 246, .50), rgba(255, 249, 246, .50)), url('/static/images/dragon-background.jpeg?v=1') !important;
  background-size: auto, min(86vw, 1050px) auto !important;
  background-position: center, center 58px !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
}
.risk-reminder{position:fixed;left:50%;bottom:12px;transform:translateX(-50%);z-index:9998;padding:10px 22px;border:1px solid #f0c35e;border-radius:999px;background:rgba(135,8,18,.94);color:#fff7d1;font-size:13px;font-weight:850;letter-spacing:.02em;box-shadow:0 8px 24px rgba(85,0,8,.28);white-space:nowrap}
@media(max-width:700px){.risk-reminder{bottom:6px;width:calc(100% - 12px);padding:8px 5px;text-align:center;font-size:10px;white-space:normal;border-radius:10px}}

.header, .top {
  background: #a71924 !important;
  color: #fff !important;
  border-bottom: 3px solid #e6b84a !important;
  box-shadow: 0 3px 12px rgba(112, 10, 18, .18) !important;
}

.header a, .top a, .top b, .brand, .logo {
  color: #fff !important;
}

.logo-sub, .header-links a, .topnav a {
  color: #ffe9d0 !important;
}

.header-links a:hover, .topnav a:hover, .top a:hover {
  color: #fff7c5 !important;
}

.eyebrow, .level, .analysis-label, .impact, .link, a.source {
  color: #b51f2b !important;
}

.head h1, .hero h1, .titlebar h1, .intro h1 {
  color: #5f1118 !important;
}

.head p, .hero p, .titlebar p, .intro p, .hint, .tips, .method, .note,
.updated, .count, .summary, .desc {
  color: #786565 !important;
}

.card, .column-card, .panel, .workspace, .content-card, .feed, .list,
.stats, .filters, .builder, .ticker-bar, .usage-band, .locked, .empty,
.login, .tablewrap, .market-state, .branch, .item, .metric, .summary-item {
  border-color: #efd9d5 !important;
}

.card, .column-card, .panel, .workspace, .content-card, .feed, .list,
.stats, .filters, .builder, .ticker-bar, .usage-band, .locked, .empty,
.login, .branch, .item {
  background-color: #fff !important;
  box-shadow: 0 5px 16px rgba(120, 31, 37, .06) !important;
}

.filters, .tools, .tabs, .filterrow {
  accent-color: #c52431;
}

.filters {
  border-top-color: #c52431 !important;
}

button, .btn, .primary, .run, .locked a, .apply, .ai-button {
  border-color: #c52431;
}

.btn:not(.ghost):not(.danger), .primary, .run, .locked a, .apply,
.segments button.active, .filter.active, .tab.active, .tabs button.active,
.chart-btn.active, .ai-button {
  background: #c52431 !important;
  border-color: #c52431 !important;
  color: #fff !important;
}

.btn:hover, .primary:hover, .run:hover, .ai-button:hover {
  background: #a71924 !important;
}

.btn.ghost, button.ghost {
  background: #fff0ed !important;
  color: #a71924 !important;
}

.btn.danger {
  background: #86151d !important;
}

input, select, textarea, .search {
  border-color: #dfc5c1 !important;
  background-color: #fff !important;
}

input:focus, select:focus, textarea:focus, .search:focus {
  border-color: #c52431 !important;
  box-shadow: 0 0 0 3px rgba(197, 36, 49, .11) !important;
}

.badge, .tag, .status, .alias, .code {
  background-color: #fff0ed !important;
  color: #a71924 !important;
  border-color: #f0d1cc !important;
}

.badge-paid, .due, .status.due {
  background: #fff3d5 !important;
  color: #986000 !important;
}

.badge-free {
  background: #eaf7f1 !important;
  color: #08734f !important;
}

.up, .red, .ticker-up, .stock-up, .performance .up {
  color: #d92d38 !important;
}

.down, .green, .ticker-down, .stock-down, .performance .down {
  color: #11805b !important;
}

.dashboard-intro, .hero, .intro {
  border-bottom-color: #efd9d5 !important;
}

.market-state {
  background: #fff1e8 !important;
  border-left-color: #e6a52e !important;
}

.pulse {
  background: #d92d38 !important;
}

.column-card {
  border-top: 3px solid #c52431 !important;
}

.column-card:before, .news-card:before, .pool-card:before,
.indicator-card:before, .holdings-card:before {
  background: #d92d38 !important;
}

.column-card .icon, .news-card .icon, .pool-card .icon,
.indicator-card .icon {
  color: #c52431 !important;
}

.holdings-card {
  background: #8f1018 !important;
  border-color: #e6b84a !important;
}

.holdings-card .title, .holdings-card .desc {
  color: #fff !important;
}

.holding-card, .news, .card {
  border-top-color: #c52431 !important;
}

.holding-card.tone-up, .card:has(.performance .up) {
  border-top-color: #d92d38 !important;
}

.holding-card.tone-down, .card:has(.performance .down) {
  border-top-color: #11805b !important;
}

.stock-avatar {
  background: #c52431 !important;
  color: #fff !important;
}

.plan .datum:nth-child(1) { border-top-color: #c52431 !important; }
.plan .datum:nth-child(2) { border-top-color: #d7951e !important; }
.plan .datum:nth-child(3) { border-top-color: #d92d38 !important; }
.plan .datum:nth-child(4) { border-top-color: #8d5a15 !important; }

.market, .analysis, .summary, .ai, .signal-news, .signal-community {
  background-color: #fff5f0 !important;
  border-color: #efd2ca !important;
}

.chart-tabs, .quotes, .chart-wrap {
  border-color: #e4c9c4 !important;
}

table th {
  background: #fff4f1 !important;
  color: #8c3b40 !important;
}

table td {
  border-bottom-color: #f0dfdc !important;
}

.footer, footer {
  border-top-color: #ead1cd !important;
}

@media (max-width: 800px) {
  .header, .top { border-bottom-width: 2px !important; }
  .column-card, .card { box-shadow: 0 3px 10px rgba(120, 31, 37, .05) !important; }
}

/* Homepage: the dragon is atmosphere, while the workflow remains the product. */
body:has(.home-heading) {
  background-image: linear-gradient(rgba(255, 249, 246, .50), rgba(255, 249, 246, .50)), url('/static/images/dragon-background.jpeg?v=1') !important;
  background-size: auto, min(86vw, 1050px) auto !important;
  background-position: center, center 58px !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
}

.home-heading { display:flex; justify-content:space-between; align-items:end; gap:28px; margin:18px 0; padding:34px 36px; border:1px solid #e3b94f; border-radius:22px; overflow:hidden; background:linear-gradient(112deg,rgba(91,3,12,.98),rgba(174,24,38,.88)),url('/static/images/china-dragon-banner.png?v=2') center 43%/cover; box-shadow:0 18px 42px rgba(105,14,22,.22); }
.home-heading h1 { margin:6px 0 0; font-size:32px; line-height:1.25; color:#fff !important; text-shadow:0 2px 7px rgba(65,0,5,.35); }
.home-heading p { max-width:450px; margin:0 0 4px; color:#ffe4d5 !important; font-size:14px; line-height:1.8; text-align:right; }
.home-heading .eyebrow { color:#ffd56e !important; font-weight:850; font-size:12px; letter-spacing:.12em; }

.dashboard-intro .hero-copy {
  max-width: 620px;
  position: relative;
  z-index: 1;
}

.dashboard-intro .eyebrow {
  display: inline-block;
  color: #ffe7a2 !important;
  border-left: 3px solid #f1bd43;
  padding-left: 9px;
  font-size: 12px;
}

.dashboard-intro h1 {
  color: #fff !important;
  font-size: 36px !important;
  margin: 11px 0 10px !important;
  text-shadow: 0 2px 5px rgba(73, 3, 8, .4);
}

.dashboard-intro p {
  max-width: 590px;
  color: #ffe9dd !important;
  font-size: 14px !important;
  line-height: 1.8;
  text-shadow: 0 1px 3px rgba(73, 3, 8, .45);
}

.dashboard-intro .market-state {
  width: fit-content;
  min-width: 230px;
  margin-top: 24px;
  padding: 10px 14px;
  background: rgba(93, 8, 14, .78) !important;
  border: 1px solid rgba(255, 222, 143, .4) !important;
  border-left: 4px solid #f1bd43 !important;
  color: #fff;
}

.dashboard-intro .market-state small {
  color: #ffd8c0 !important;
}

.dashboard-intro .pulse {
  background: #ffd25e !important;
  box-shadow: 0 0 0 4px rgba(255, 210, 94, .16);
}

.columns-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
.columns-grid .column-card {
  border-top: 1px solid #efd9d5 !important;
  border-left-width: 1px !important;
  min-height:220px !important;
  background:rgba(255,255,255,.93) !important;
}
.columns-grid .column-card:before { width:4px !important; }
.step-number { position:absolute; right:18px; bottom:8px; color:rgba(119,33,38,.07); font-size:62px; font-weight:900; line-height:1; }
.card-links { display:flex; gap:9px; margin-top:16px; position:relative; z-index:1; }
.card-links span { color:#9a2029; font-size:12px; font-weight:750; }
.columns-grid .column-card .icon { width:36px; height:36px; display:grid; place-items:center; border-radius:4px; background:#f8eeee; font-size:23px; font-weight:800; }

.columns-grid .holdings-card:before { background: #e5ae32 !important; }
.columns-grid .news-card:before { background: #dc493a !important; }
.columns-grid .pool-card:before { background: #ee7b28 !important; }
.columns-grid .indicator-card:before { background: #b98528 !important; }
.columns-grid .news-card .icon { color: #dc493a !important; }
.columns-grid .pool-card .icon { color: #ee7b28 !important; }
.columns-grid .indicator-card .icon { color: #b98528 !important; }

.columns-grid .holdings-card { color:inherit !important; border:1px solid #efd9d5 !important; grid-column:auto !important; }
.columns-grid .holdings-card .title { color:inherit !important; font-size:18px !important; }
.columns-grid .holdings-card .desc { color:#666 !important; }
.columns-grid .discover-card:before { background:#a8272f !important; }

/* Eight home capabilities: fixed order and individually identifiable colors. */
.columns-grid.home-core .morning-entry { order:1; --tile-bg:#fff5d9; --tile-line:#e7af32; }
.columns-grid.home-core .change-entry { order:2; --tile-bg:#ffe7ec; --tile-line:#dc3b55; }
.columns-grid.home-core .review-entry { order:3; --tile-bg:#f1e8ff; --tile-line:#8650c4; }
.columns-grid.home-core .pool-entry { order:4; --tile-bg:#fff0e5; --tile-line:#dc6a31; }
.columns-grid.home-core .indicator-entry { order:5; --tile-bg:#ffe8e8; --tile-line:#c82e3c; }
.columns-grid.home-core .sentence-entry { order:6; --tile-bg:#e8f1ff; --tile-line:#3970d4; }
.columns-grid.home-core .news-entry { order:7; --tile-bg:#ffe8f1; --tile-line:#d64e86; }
.columns-grid.home-core .diagnosis-entry { order:8; --tile-bg:#fff3dc; --tile-line:#bd7a13; }
.columns-grid.home-core .column-card {
  background:linear-gradient(145deg,rgba(255,255,255,.96),var(--tile-bg)) !important;
  border-color:color-mix(in srgb,var(--tile-line) 42%,white) !important;
  border-top-color:var(--tile-line) !important;
}
.columns-grid.home-core .column-card:before { background:var(--tile-line) !important; }
.columns-grid.home-core .column-card .badge {
  background:var(--tile-line) !important;color:#fff !important;border:1px solid rgba(255,255,255,.58) !important;
  box-shadow:0 4px 10px color-mix(in srgb,var(--tile-line) 28%,transparent) !important;
}
@media (min-width: 801px) {
  .home-heading{flex-wrap:nowrap!important}.home-heading>div{flex:0 0 auto}.home-heading p{max-width:none!important;white-space:nowrap!important;flex:1}
}

@media (max-width: 800px) {
  body, body:has(.home-heading) { background-size:auto, 92vw auto !important; background-position:center, center 58px !important; }
  .home-heading { display:block; margin:10px 0 13px; padding:24px 20px; border-radius:15px; }
  .home-heading h1 { font-size:25px; }
  .home-heading p { margin-top:9px; text-align:left; }
  .columns-grid:not(.home-core) { grid-template-columns:1fr !important; }
  .columns-grid:not(.home-core) .column-card { min-height:190px !important; }
  .columns-grid.home-core { grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:7px !important; }
  .columns-grid.home-core .column-card {
    width:100% !important;
    min-width:0 !important;
    min-height:0 !important;
    height:auto !important;
    aspect-ratio:1 / 1 !important;
    padding:9px 4px 7px !important;
    display:flex !important;
    flex-direction:column !important;
    justify-content:center !important;
    overflow:hidden !important;
  }
}

@media (max-width: 480px) {
  .header-links a:first-child, .paid-btn { display:none; }
  .ticker-bar { margin-top:4px !important; }
}
